@elastic/eui 95.1.0 → 95.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_dark.css +8 -604
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +8 -604
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/color_picker/color_palette_display/color_palette_display.js +9 -9
- package/es/components/color_picker/color_palette_display/color_palette_display.styles.js +24 -0
- package/es/components/color_picker/color_palette_display/color_palette_display_fixed.js +2 -0
- package/es/components/color_picker/color_palette_display/color_palette_display_fixed.styles.js +14 -0
- package/es/components/color_picker/color_palette_picker/color_palette_picker.js +34 -26
- package/es/components/color_picker/color_picker.js +26 -39
- package/es/components/color_picker/color_picker.styles.js +15 -5
- package/es/components/color_picker/color_picker_swatch.js +5 -1
- package/es/components/color_picker/color_picker_swatch.styles.js +19 -0
- package/es/components/color_picker/hue.js +11 -6
- package/es/components/color_picker/hue.styles.js +29 -0
- package/es/components/color_picker/saturation.js +29 -16
- package/es/components/color_picker/saturation.styles.js +23 -0
- package/es/components/combo_box/combo_box_input/combo_box_input.js +2 -1
- package/es/components/context_menu/context_menu_item.js +1 -1
- package/es/components/form/file_picker/file_picker.js +54 -40
- package/es/components/form/file_picker/file_picker.styles.js +98 -0
- package/es/components/form/range/range.styles.js +1 -1
- package/es/components/icon/assets/app_cases.js +9 -7
- package/es/components/icon/assets/logo_elastic_stack.js +6 -12
- package/es/components/modal/modal.styles.js +1 -1
- package/es/components/popover/popover.js +5 -3
- package/es/components/provider/provider.js +2 -2
- package/es/components/steps/step.js +5 -3
- package/es/components/steps/step.styles.js +13 -5
- package/es/components/steps/step_horizontal.js +8 -3
- package/es/components/steps/step_horizontal.styles.js +1 -0
- package/es/components/steps/step_number.js +48 -24
- package/es/components/steps/step_number.styles.js +4 -2
- package/es/components/steps/steps.js +3 -1
- package/es/components/steps/steps_horizontal.js +1 -1
- package/es/global_styling/mixins/_helpers.js +10 -2
- package/es/services/breakpoint/current_breakpoint.js +5 -3
- package/es/services/theme/provider.js +10 -2
- package/es/services/theme/warning.js +7 -2
- package/eui.d.ts +7610 -7492
- package/i18ntokens.json +66 -66
- package/lib/components/color_picker/color_palette_display/color_palette_display.js +9 -9
- package/lib/components/color_picker/color_palette_display/color_palette_display.styles.js +30 -0
- package/lib/components/color_picker/color_palette_display/color_palette_display_fixed.js +2 -0
- package/lib/components/color_picker/color_palette_display/color_palette_display_fixed.styles.js +19 -0
- package/lib/components/color_picker/color_palette_picker/color_palette_picker.js +37 -27
- package/lib/components/color_picker/color_picker.js +26 -39
- package/lib/components/color_picker/color_picker.styles.js +15 -5
- package/lib/components/color_picker/color_picker_swatch.js +5 -1
- package/lib/components/color_picker/color_picker_swatch.styles.js +25 -0
- package/lib/components/color_picker/hue.js +11 -6
- package/lib/components/color_picker/hue.styles.js +35 -0
- package/lib/components/color_picker/saturation.js +27 -14
- package/lib/components/color_picker/saturation.styles.js +29 -0
- package/lib/components/combo_box/combo_box_input/combo_box_input.js +2 -1
- package/lib/components/context_menu/context_menu_item.js +1 -1
- package/lib/components/form/file_picker/file_picker.js +56 -42
- package/lib/components/form/file_picker/file_picker.styles.js +102 -0
- package/lib/components/form/range/range.styles.js +1 -1
- package/lib/components/icon/assets/app_cases.js +9 -7
- package/lib/components/icon/assets/logo_elastic_stack.js +6 -12
- package/lib/components/icon/svgs/app_cases.svg +6 -5
- package/lib/components/icon/svgs/logo_elastic_stack.svg +4 -7
- package/lib/components/modal/modal.styles.js +1 -1
- package/lib/components/popover/popover.js +5 -3
- package/lib/components/provider/provider.js +1 -1
- package/lib/components/steps/step.js +5 -3
- package/lib/components/steps/step.styles.js +13 -5
- package/lib/components/steps/step_horizontal.js +8 -3
- package/lib/components/steps/step_horizontal.styles.js +1 -0
- package/lib/components/steps/step_number.js +48 -24
- package/lib/components/steps/step_number.styles.js +3 -1
- package/lib/components/steps/steps.js +3 -1
- package/lib/components/steps/steps_horizontal.js +1 -1
- package/lib/global_styling/mixins/_helpers.js +10 -2
- package/lib/services/breakpoint/current_breakpoint.js +6 -4
- package/lib/services/theme/provider.js +9 -1
- package/lib/services/theme/warning.js +7 -2
- package/optimize/es/components/color_picker/color_palette_display/color_palette_display.js +8 -8
- package/optimize/es/components/color_picker/color_palette_display/color_palette_display.styles.js +24 -0
- package/optimize/es/components/color_picker/color_palette_display/color_palette_display_fixed.js +2 -0
- package/optimize/es/components/color_picker/color_palette_display/color_palette_display_fixed.styles.js +14 -0
- package/optimize/es/components/color_picker/color_palette_picker/color_palette_picker.js +34 -26
- package/optimize/es/components/color_picker/color_picker.js +26 -39
- package/optimize/es/components/color_picker/color_picker.styles.js +15 -5
- package/optimize/es/components/color_picker/color_picker_swatch.js +5 -1
- package/optimize/es/components/color_picker/color_picker_swatch.styles.js +19 -0
- package/optimize/es/components/color_picker/hue.js +11 -6
- package/optimize/es/components/color_picker/hue.styles.js +29 -0
- package/optimize/es/components/color_picker/saturation.js +29 -16
- package/optimize/es/components/color_picker/saturation.styles.js +23 -0
- package/optimize/es/components/combo_box/combo_box_input/combo_box_input.js +2 -1
- package/optimize/es/components/form/file_picker/file_picker.js +45 -39
- package/optimize/es/components/form/file_picker/file_picker.styles.js +98 -0
- package/optimize/es/components/form/range/range.styles.js +1 -1
- package/optimize/es/components/icon/assets/app_cases.js +9 -7
- package/optimize/es/components/icon/assets/logo_elastic_stack.js +6 -12
- package/optimize/es/components/modal/modal.styles.js +1 -1
- package/optimize/es/components/popover/popover.js +5 -3
- package/optimize/es/components/provider/provider.js +2 -2
- package/optimize/es/components/steps/step.js +2 -2
- package/optimize/es/components/steps/step.styles.js +13 -5
- package/optimize/es/components/steps/step_horizontal.js +8 -3
- package/optimize/es/components/steps/step_horizontal.styles.js +1 -0
- package/optimize/es/components/steps/step_number.js +44 -22
- package/optimize/es/components/steps/step_number.styles.js +4 -2
- package/optimize/es/components/steps/steps_horizontal.js +1 -1
- package/optimize/es/global_styling/mixins/_helpers.js +10 -2
- package/optimize/es/services/breakpoint/current_breakpoint.js +5 -3
- package/optimize/es/services/theme/provider.js +10 -2
- package/optimize/es/services/theme/warning.js +7 -2
- package/optimize/lib/components/color_picker/color_palette_display/color_palette_display.js +8 -8
- package/optimize/lib/components/color_picker/color_palette_display/color_palette_display.styles.js +30 -0
- package/optimize/lib/components/color_picker/color_palette_display/color_palette_display_fixed.js +2 -0
- package/optimize/lib/components/color_picker/color_palette_display/color_palette_display_fixed.styles.js +19 -0
- package/optimize/lib/components/color_picker/color_palette_picker/color_palette_picker.js +38 -27
- package/optimize/lib/components/color_picker/color_picker.js +26 -39
- package/optimize/lib/components/color_picker/color_picker.styles.js +15 -5
- package/optimize/lib/components/color_picker/color_picker_swatch.js +5 -1
- package/optimize/lib/components/color_picker/color_picker_swatch.styles.js +25 -0
- package/optimize/lib/components/color_picker/hue.js +11 -6
- package/optimize/lib/components/color_picker/hue.styles.js +35 -0
- package/optimize/lib/components/color_picker/saturation.js +27 -14
- package/optimize/lib/components/color_picker/saturation.styles.js +29 -0
- package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.js +2 -1
- package/optimize/lib/components/form/file_picker/file_picker.js +47 -41
- package/optimize/lib/components/form/file_picker/file_picker.styles.js +102 -0
- package/optimize/lib/components/form/range/range.styles.js +1 -1
- package/optimize/lib/components/icon/assets/app_cases.js +9 -7
- package/optimize/lib/components/icon/assets/logo_elastic_stack.js +6 -12
- package/optimize/lib/components/icon/svgs/app_cases.svg +6 -5
- package/optimize/lib/components/icon/svgs/logo_elastic_stack.svg +4 -7
- package/optimize/lib/components/modal/modal.styles.js +1 -1
- package/optimize/lib/components/popover/popover.js +5 -3
- package/optimize/lib/components/provider/provider.js +1 -1
- package/optimize/lib/components/steps/step.js +2 -2
- package/optimize/lib/components/steps/step.styles.js +13 -5
- package/optimize/lib/components/steps/step_horizontal.js +8 -3
- package/optimize/lib/components/steps/step_horizontal.styles.js +1 -0
- package/optimize/lib/components/steps/step_number.js +44 -22
- package/optimize/lib/components/steps/step_number.styles.js +3 -1
- package/optimize/lib/components/steps/steps_horizontal.js +1 -1
- package/optimize/lib/global_styling/mixins/_helpers.js +10 -2
- package/optimize/lib/services/breakpoint/current_breakpoint.js +6 -4
- package/optimize/lib/services/theme/provider.js +9 -1
- package/optimize/lib/services/theme/warning.js +7 -2
- package/package.json +10 -7
- package/src/components/form/_index.scss +0 -1
- package/src/components/index.scss +0 -1
- package/src/global_styling/mixins/_shadow.scss +5 -0
- package/src/themes/amsterdam/overrides/_index.scss +0 -1
- package/test-env/components/color_picker/color_palette_display/color_palette_display.js +9 -9
- package/test-env/components/color_picker/color_palette_display/color_palette_display.styles.js +30 -0
- package/test-env/components/color_picker/color_palette_display/color_palette_display_fixed.js +2 -0
- package/test-env/components/color_picker/color_palette_display/color_palette_display_fixed.styles.js +19 -0
- package/test-env/components/color_picker/color_palette_picker/color_palette_picker.js +38 -27
- package/test-env/components/color_picker/color_picker.js +26 -39
- package/test-env/components/color_picker/color_picker.styles.js +15 -5
- package/test-env/components/color_picker/color_picker_swatch.js +5 -1
- package/test-env/components/color_picker/color_picker_swatch.styles.js +25 -0
- package/test-env/components/color_picker/hue.js +11 -6
- package/test-env/components/color_picker/hue.styles.js +35 -0
- package/test-env/components/color_picker/saturation.js +27 -14
- package/test-env/components/color_picker/saturation.styles.js +29 -0
- package/test-env/components/combo_box/combo_box_input/combo_box_input.js +2 -1
- package/test-env/components/context_menu/context_menu_item.js +1 -1
- package/test-env/components/form/file_picker/file_picker.js +51 -42
- package/test-env/components/form/file_picker/file_picker.styles.js +102 -0
- package/test-env/components/form/range/range.styles.js +1 -1
- package/test-env/components/icon/assets/app_cases.js +9 -7
- package/test-env/components/icon/assets/logo_elastic_stack.js +6 -12
- package/test-env/components/modal/modal.styles.js +1 -1
- package/test-env/components/popover/popover.js +5 -3
- package/test-env/components/provider/provider.js +1 -1
- package/test-env/components/steps/step.js +5 -3
- package/test-env/components/steps/step.styles.js +13 -5
- package/test-env/components/steps/step_horizontal.js +8 -3
- package/test-env/components/steps/step_horizontal.styles.js +1 -0
- package/test-env/components/steps/step_number.js +48 -24
- package/test-env/components/steps/step_number.styles.js +3 -1
- package/test-env/components/steps/steps.js +3 -1
- package/test-env/components/steps/steps_horizontal.js +1 -1
- package/test-env/global_styling/mixins/_helpers.js +10 -2
- package/test-env/services/breakpoint/current_breakpoint.js +6 -4
- package/test-env/services/theme/provider.js +9 -1
- package/test-env/services/theme/warning.js +7 -2
- package/src/components/color_picker/_color_picker.scss +0 -37
- package/src/components/color_picker/_color_picker_swatch.scss +0 -18
- package/src/components/color_picker/_hue.scss +0 -88
- package/src/components/color_picker/_index.scss +0 -7
- package/src/components/color_picker/_saturation.scss +0 -57
- package/src/components/color_picker/_variables.scss +0 -6
- package/src/components/color_picker/color_palette_display/_color_palette_display.scss +0 -18
- package/src/components/color_picker/color_palette_display/_color_palette_display_fixed.scss +0 -12
- package/src/components/color_picker/color_palette_display/_index.scss +0 -4
- package/src/components/color_picker/color_palette_display/_mixins.scss +0 -22
- package/src/components/color_picker/color_palette_display/_variables.scss +0 -6
- package/src/components/color_picker/color_palette_picker/_color_palette_picker.scss +0 -9
- package/src/components/color_picker/color_palette_picker/_index.scss +0 -1
- package/src/components/form/file_picker/_file_picker.scss +0 -212
- package/src/components/form/file_picker/_index.scss +0 -2
- package/src/components/form/file_picker/_variables.scss +0 -1
- package/src/themes/amsterdam/overrides/_hue.scss +0 -44
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
var _excluded = ["id", "name", "initialPromptText", "className", "disabled", "compressed", "onChange", "isInvalid", "fullWidth", "isLoading", "display"];
|
|
1
|
+
var _excluded = ["stylesMemoizer", "id", "name", "initialPromptText", "className", "disabled", "compressed", "onChange", "isInvalid", "fullWidth", "isLoading", "display"];
|
|
2
2
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
3
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
5
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
7
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
8
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
9
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
4
10
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
5
11
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
6
12
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
@@ -27,29 +33,25 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
27
33
|
import React, { Component } from 'react';
|
|
28
34
|
import PropTypes from "prop-types";
|
|
29
35
|
import classNames from 'classnames';
|
|
30
|
-
import {
|
|
31
|
-
import { EuiValidatableControl } from '../validatable_control';
|
|
36
|
+
import { withEuiStylesMemoizer, htmlIdGenerator } from '../../../services';
|
|
32
37
|
import { EuiButtonEmpty } from '../../button';
|
|
33
38
|
import { EuiProgress } from '../../progress';
|
|
34
39
|
import { EuiIcon } from '../../icon';
|
|
35
40
|
import { EuiI18n } from '../../i18n';
|
|
36
41
|
import { EuiLoadingSpinner } from '../../loading';
|
|
37
|
-
import { htmlIdGenerator } from '../../../services/accessibility';
|
|
38
42
|
import { FormContext } from '../eui_form_context';
|
|
43
|
+
import { EuiValidatableControl } from '../validatable_control';
|
|
44
|
+
import { EuiFormControlLayoutClearButton } from '../form_control_layout/form_control_layout_clear_button';
|
|
45
|
+
import { euiFilePickerStyles } from './file_picker.styles';
|
|
39
46
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
large: 'euiFilePicker--large'
|
|
43
|
-
};
|
|
44
|
-
export var DISPLAYS = keysOf(displayToClassNameMap);
|
|
45
|
-
export var EuiFilePicker = /*#__PURE__*/function (_Component) {
|
|
46
|
-
function EuiFilePicker() {
|
|
47
|
+
export var EuiFilePickerClass = /*#__PURE__*/function (_Component) {
|
|
48
|
+
function EuiFilePickerClass() {
|
|
47
49
|
var _this;
|
|
48
|
-
_classCallCheck(this,
|
|
50
|
+
_classCallCheck(this, EuiFilePickerClass);
|
|
49
51
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
50
52
|
args[_key] = arguments[_key];
|
|
51
53
|
}
|
|
52
|
-
_this = _callSuper(this,
|
|
54
|
+
_this = _callSuper(this, EuiFilePickerClass, [].concat(args));
|
|
53
55
|
_defineProperty(_this, "state", {
|
|
54
56
|
promptText: null,
|
|
55
57
|
isHoveringDrop: false
|
|
@@ -105,18 +107,19 @@ export var EuiFilePicker = /*#__PURE__*/function (_Component) {
|
|
|
105
107
|
});
|
|
106
108
|
return _this;
|
|
107
109
|
}
|
|
108
|
-
_inherits(
|
|
109
|
-
return _createClass(
|
|
110
|
+
_inherits(EuiFilePickerClass, _Component);
|
|
111
|
+
return _createClass(EuiFilePickerClass, [{
|
|
110
112
|
key: "render",
|
|
111
113
|
value: function render() {
|
|
112
114
|
var _this2 = this;
|
|
113
115
|
var _ref = this.context,
|
|
114
116
|
defaultFullWidth = _ref.defaultFullWidth;
|
|
115
117
|
return ___EmotionJSX(EuiI18n, {
|
|
116
|
-
token: "euiFilePicker.
|
|
117
|
-
default: "
|
|
118
|
-
}, function (
|
|
118
|
+
token: "euiFilePicker.removeSelectedAriaLabel",
|
|
119
|
+
default: "Remove selected files"
|
|
120
|
+
}, function (removeSelectedAriaLabel) {
|
|
119
121
|
var _this2$props = _this2.props,
|
|
122
|
+
stylesMemoizer = _this2$props.stylesMemoizer,
|
|
120
123
|
id = _this2$props.id,
|
|
121
124
|
name = _this2$props.name,
|
|
122
125
|
initialPromptText = _this2$props.initialPromptText,
|
|
@@ -133,34 +136,39 @@ export var EuiFilePicker = /*#__PURE__*/function (_Component) {
|
|
|
133
136
|
var promptId = "".concat(id || _this2.generatedId, "-filePicker__prompt");
|
|
134
137
|
var isOverridingInitialPrompt = _this2.state.promptText != null;
|
|
135
138
|
var normalFormControl = display === 'default';
|
|
136
|
-
var classes = classNames('euiFilePicker',
|
|
137
|
-
|
|
138
|
-
'euiFilePicker--compressed': compressed,
|
|
139
|
-
'euiFilePicker--fullWidth': fullWidth,
|
|
139
|
+
var classes = classNames('euiFilePicker', {
|
|
140
|
+
'euiFilePicker-isDroppingFile': _this2.state.isHoveringDrop,
|
|
140
141
|
'euiFilePicker-isInvalid': isInvalid,
|
|
141
142
|
'euiFilePicker-isLoading': isLoading,
|
|
142
143
|
'euiFilePicker-hasFiles': isOverridingInitialPrompt
|
|
143
144
|
}, className);
|
|
145
|
+
var styles = stylesMemoizer(euiFilePickerStyles);
|
|
146
|
+
var cssStyles = [styles.euiFilePicker, fullWidth ? styles.fullWidth : styles.formWidth, _this2.state.isHoveringDrop && styles.isDroppingFile, isInvalid && !disabled && styles.invalid, isOverridingInitialPrompt && !disabled && styles.hasFiles, isLoading && styles.loading];
|
|
147
|
+
var inputStyles = [styles.input.euiFilePicker__input, !normalFormControl && !disabled && styles.input.largeInteractive];
|
|
148
|
+
var promptStyles = [styles.euiFilePicker__prompt, disabled && styles.disabled].concat(_toConsumableArray(normalFormControl ? [compressed ? styles.compressed : styles.uncompressed] : [styles.large.large, compressed ? styles.large.compressed : styles.large.uncompressed]));
|
|
149
|
+
var iconStyles = [styles.icon.euiFilePicker__icon].concat(_toConsumableArray(normalFormControl ? [styles.icon.normal, compressed ? styles.icon.compresssed : styles.icon.uncompressed] : [styles.icon.large]));
|
|
150
|
+
var rightIconStyles = normalFormControl ? [styles.rightIcon.euiFilePicker__rightIcon, compressed ? styles.rightIcon.compressed : styles.rightIcon.uncompressed] : undefined;
|
|
144
151
|
var clearButton;
|
|
145
152
|
if (isLoading && normalFormControl) {
|
|
146
153
|
// Override clear button with loading spinner if it is in loading state
|
|
147
154
|
clearButton = ___EmotionJSX(EuiLoadingSpinner, {
|
|
148
|
-
|
|
155
|
+
css: rightIconStyles,
|
|
156
|
+
className: "euiFilePicker__loadingSpinner",
|
|
157
|
+
size: compressed ? 's' : 'm'
|
|
149
158
|
});
|
|
150
159
|
} else if (isOverridingInitialPrompt && !disabled) {
|
|
151
160
|
if (normalFormControl) {
|
|
152
|
-
clearButton = ___EmotionJSX(
|
|
153
|
-
|
|
154
|
-
"
|
|
161
|
+
clearButton = ___EmotionJSX(EuiFormControlLayoutClearButton, {
|
|
162
|
+
"aria-label": removeSelectedAriaLabel,
|
|
163
|
+
css: [styles.euiFilePicker__clearButton, rightIconStyles, ";label:clearButton;"],
|
|
155
164
|
className: "euiFilePicker__clearButton",
|
|
156
|
-
onClick: _this2.removeFiles
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
type: "cross"
|
|
160
|
-
}));
|
|
165
|
+
onClick: _this2.removeFiles,
|
|
166
|
+
size: compressed ? 's' : 'm'
|
|
167
|
+
});
|
|
161
168
|
} else {
|
|
162
169
|
clearButton = ___EmotionJSX(EuiButtonEmpty, {
|
|
163
|
-
"aria-label":
|
|
170
|
+
"aria-label": removeSelectedAriaLabel,
|
|
171
|
+
css: styles.euiFilePicker__clearButton,
|
|
164
172
|
className: "euiFilePicker__clearButton",
|
|
165
173
|
size: "xs",
|
|
166
174
|
onClick: _this2.removeFiles
|
|
@@ -178,15 +186,15 @@ export var EuiFilePicker = /*#__PURE__*/function (_Component) {
|
|
|
178
186
|
position: "absolute"
|
|
179
187
|
});
|
|
180
188
|
return ___EmotionJSX("div", {
|
|
189
|
+
css: cssStyles,
|
|
181
190
|
className: classes
|
|
182
|
-
}, ___EmotionJSX("div", {
|
|
183
|
-
className: "euiFilePicker__wrap"
|
|
184
191
|
}, ___EmotionJSX(EuiValidatableControl, {
|
|
185
192
|
isInvalid: isInvalid
|
|
186
193
|
}, ___EmotionJSX("input", _extends({
|
|
187
194
|
type: "file",
|
|
188
195
|
id: id,
|
|
189
196
|
name: name,
|
|
197
|
+
css: inputStyles,
|
|
190
198
|
className: "euiFilePicker__input",
|
|
191
199
|
onChange: _this2.handleChange,
|
|
192
200
|
ref: function ref(input) {
|
|
@@ -198,23 +206,25 @@ export var EuiFilePicker = /*#__PURE__*/function (_Component) {
|
|
|
198
206
|
disabled: disabled,
|
|
199
207
|
"aria-describedby": promptId
|
|
200
208
|
}, rest))), ___EmotionJSX("div", {
|
|
209
|
+
css: promptStyles,
|
|
201
210
|
className: "euiFilePicker__prompt",
|
|
202
211
|
id: promptId
|
|
203
212
|
}, ___EmotionJSX(EuiIcon, {
|
|
213
|
+
css: iconStyles,
|
|
204
214
|
className: "euiFilePicker__icon",
|
|
205
215
|
color: isInvalid ? 'danger' : disabled ? 'subdued' : 'primary',
|
|
206
216
|
type: isInvalid ? 'alert' : 'importAction',
|
|
207
217
|
size: normalFormControl ? 'm' : 'l',
|
|
208
218
|
"aria-hidden": "true"
|
|
209
|
-
}), ___EmotionJSX("
|
|
219
|
+
}), ___EmotionJSX("span", {
|
|
210
220
|
className: "euiFilePicker__promptText"
|
|
211
|
-
}, _this2.state.promptText || initialPromptText), clearButton, loader))
|
|
221
|
+
}, _this2.state.promptText || initialPromptText), clearButton, loader));
|
|
212
222
|
});
|
|
213
223
|
}
|
|
214
224
|
}]);
|
|
215
225
|
}(Component);
|
|
216
|
-
_defineProperty(
|
|
217
|
-
_defineProperty(
|
|
226
|
+
_defineProperty(EuiFilePickerClass, "contextType", FormContext);
|
|
227
|
+
_defineProperty(EuiFilePickerClass, "defaultProps", {
|
|
218
228
|
initialPromptText: ___EmotionJSX(EuiI18n, {
|
|
219
229
|
token: "euiFilePicker.promptText",
|
|
220
230
|
default: "Select or drag and drop a file"
|
|
@@ -222,12 +232,13 @@ _defineProperty(EuiFilePicker, "defaultProps", {
|
|
|
222
232
|
compressed: false,
|
|
223
233
|
display: 'large'
|
|
224
234
|
});
|
|
225
|
-
|
|
235
|
+
EuiFilePickerClass.propTypes = {
|
|
226
236
|
id: PropTypes.string,
|
|
227
237
|
name: PropTypes.string,
|
|
228
238
|
className: PropTypes.string,
|
|
229
239
|
/**
|
|
230
240
|
* The content that appears in the dropzone if no file is attached
|
|
241
|
+
* @default 'Select or drag and drop a file'
|
|
231
242
|
*/
|
|
232
243
|
initialPromptText: PropTypes.node,
|
|
233
244
|
/**
|
|
@@ -236,12 +247,14 @@ EuiFilePicker.propTypes = {
|
|
|
236
247
|
onChange: PropTypes.func,
|
|
237
248
|
/**
|
|
238
249
|
* Reduces the size to a typical (compressed) input
|
|
250
|
+
* @default false
|
|
239
251
|
*/
|
|
240
252
|
compressed: PropTypes.bool,
|
|
241
253
|
/**
|
|
242
254
|
* Size or type of display;
|
|
243
255
|
* `default` for normal height, similar to other controls;
|
|
244
256
|
* `large` for taller size
|
|
257
|
+
* @default large
|
|
245
258
|
*/
|
|
246
259
|
display: PropTypes.oneOf(["default", "large"]),
|
|
247
260
|
/**
|
|
@@ -256,4 +269,5 @@ EuiFilePicker.propTypes = {
|
|
|
256
269
|
"aria-label": PropTypes.string,
|
|
257
270
|
"data-test-subj": PropTypes.string,
|
|
258
271
|
css: PropTypes.any
|
|
259
|
-
};
|
|
272
|
+
};
|
|
273
|
+
export var EuiFilePicker = withEuiStylesMemoizer(EuiFilePickerClass);
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
4
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
5
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
6
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
7
|
+
* Side Public License, v 1.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { css } from '@emotion/react';
|
|
11
|
+
import { euiCanAnimate, euiFontSize, euiTextTruncate, logicalCSS, mathWithUnits } from '../../../global_styling';
|
|
12
|
+
import { euiFormControlStyles, euiFormVariables } from '../form.styles';
|
|
13
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
14
|
+
name: "6h1iuq-euiFilePicker__clearButton",
|
|
15
|
+
styles: "pointer-events:auto;position:relative;label:euiFilePicker__clearButton;"
|
|
16
|
+
} : {
|
|
17
|
+
name: "6h1iuq-euiFilePicker__clearButton",
|
|
18
|
+
styles: "pointer-events:auto;position:relative;label:euiFilePicker__clearButton;",
|
|
19
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
20
|
+
};
|
|
21
|
+
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
22
|
+
name: "d8me89-euiFilePicker__rightIcon",
|
|
23
|
+
styles: "position:absolute;label:euiFilePicker__rightIcon;"
|
|
24
|
+
} : {
|
|
25
|
+
name: "d8me89-euiFilePicker__rightIcon",
|
|
26
|
+
styles: "position:absolute;label:euiFilePicker__rightIcon;",
|
|
27
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
28
|
+
};
|
|
29
|
+
var _ref3 = process.env.NODE_ENV === "production" ? {
|
|
30
|
+
name: "19x04ih-largeInteractive",
|
|
31
|
+
styles: "&:hover,&:focus,.euiFilePicker-isDroppingFile &{&+.euiFilePicker__prompt{.euiFilePicker__promptText{text-decoration:underline;}.euiFilePicker__icon{transform:scale(1.1);}}};label:largeInteractive;"
|
|
32
|
+
} : {
|
|
33
|
+
name: "19x04ih-largeInteractive",
|
|
34
|
+
styles: "&:hover,&:focus,.euiFilePicker-isDroppingFile &{&+.euiFilePicker__prompt{.euiFilePicker__promptText{text-decoration:underline;}.euiFilePicker__icon{transform:scale(1.1);}}};label:largeInteractive;",
|
|
35
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
36
|
+
};
|
|
37
|
+
var _ref4 = process.env.NODE_ENV === "production" ? {
|
|
38
|
+
name: "1j9s7hu-euiFilePicker__input",
|
|
39
|
+
styles: "position:absolute;inset:0;opacity:0;&:hover{cursor:pointer;}&:hover:disabled{cursor:not-allowed;}&:disabled{opacity:0;};label:euiFilePicker__input;"
|
|
40
|
+
} : {
|
|
41
|
+
name: "1j9s7hu-euiFilePicker__input",
|
|
42
|
+
styles: "position:absolute;inset:0;opacity:0;&:hover{cursor:pointer;}&:hover:disabled{cursor:not-allowed;}&:disabled{opacity:0;};label:euiFilePicker__input;",
|
|
43
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
44
|
+
};
|
|
45
|
+
export var euiFilePickerStyles = function euiFilePickerStyles(euiThemeContext) {
|
|
46
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
47
|
+
var formStyles = euiFormControlStyles(euiThemeContext);
|
|
48
|
+
var formVariables = euiFormVariables(euiThemeContext);
|
|
49
|
+
var _euiFontSize = euiFontSize(euiThemeContext, 's'),
|
|
50
|
+
fontSize = _euiFontSize.fontSize,
|
|
51
|
+
lineHeight = _euiFontSize.lineHeight;
|
|
52
|
+
return {
|
|
53
|
+
euiFilePicker: /*#__PURE__*/css("--euiFormControlLeftIconsCount:1;position:relative;&:has(input:focus){--euiFormControlStateColor:", euiTheme.colors.primary, ";};label:euiFilePicker;"),
|
|
54
|
+
isDroppingFile: /*#__PURE__*/css("--euiFormControlStateColor:", euiTheme.colors.primary, ";;label:isDroppingFile;"),
|
|
55
|
+
invalid: /*#__PURE__*/css("--euiFormControlStateColor:", euiTheme.colors.danger, ";;label:invalid;"),
|
|
56
|
+
hasFiles: /*#__PURE__*/css("--euiFormControlRightIconsCount:1;font-weight:", euiTheme.font.weight.bold, ";;label:hasFiles;"),
|
|
57
|
+
loading: /*#__PURE__*/css("--euiFormControlRightIconsCount:1;border-radius:", formVariables.controlCompressedBorderRadius, ";overflow:hidden;;label:loading;"),
|
|
58
|
+
// Skip the css() on the default width to avoid generating a className
|
|
59
|
+
formWidth: formStyles.formWidth,
|
|
60
|
+
fullWidth: /*#__PURE__*/css(formStyles.fullWidth, ";label:fullWidth;"),
|
|
61
|
+
// The input is an invisible dropzone / button
|
|
62
|
+
input: {
|
|
63
|
+
euiFilePicker__input: _ref4,
|
|
64
|
+
largeInteractive: _ref3
|
|
65
|
+
},
|
|
66
|
+
euiFilePicker__prompt: /*#__PURE__*/css("pointer-events:none;font-size:", fontSize, ";line-height:1;", euiTextTruncate(), " color:", euiTheme.colors.text, ";border:", euiTheme.border.width.thick, " dashed var(--euiFormControlStateColor, ", euiTheme.colors.lightShade, ");", euiCanAnimate, "{transition:border-color ", euiTheme.animation.fast, " ease-in,background-color ", euiTheme.animation.fast, " ease-in;};label:euiFilePicker__prompt;"),
|
|
67
|
+
disabled: /*#__PURE__*/css(formStyles.disabled, ";label:disabled;"),
|
|
68
|
+
// Skip the css() on the default height to avoid generating a className
|
|
69
|
+
uncompressed: formStyles.uncompressed,
|
|
70
|
+
compressed: /*#__PURE__*/css(formStyles.compressed, ";label:compressed;"),
|
|
71
|
+
// Completely different rendering style from the normal form controls
|
|
72
|
+
large: {
|
|
73
|
+
large: /*#__PURE__*/css("padding-inline:", euiTheme.size.l, ";display:flex;flex-direction:column;align-items:center;justify-content:center;.euiFilePicker__promptText{", euiTextTruncate(), " line-height:", lineHeight, ";};label:large;"),
|
|
74
|
+
// Static heights so that surrounding contents don't shift around
|
|
75
|
+
uncompressed: "\n ".concat(logicalCSS('height', mathWithUnits(euiTheme.size.base, function (x) {
|
|
76
|
+
return x * 8;
|
|
77
|
+
})), "\n border-radius: ").concat(formVariables.controlBorderRadius, ";\n "),
|
|
78
|
+
compressed: /*#__PURE__*/css(logicalCSS('height', mathWithUnits(euiTheme.size.base, function (x) {
|
|
79
|
+
return x * 6.5;
|
|
80
|
+
})), " border-radius:", formVariables.controlCompressedBorderRadius, ";;label:compressed;")
|
|
81
|
+
},
|
|
82
|
+
icon: {
|
|
83
|
+
euiFilePicker__icon: /*#__PURE__*/css(";label:euiFilePicker__icon;"),
|
|
84
|
+
normal: /*#__PURE__*/css("position:absolute;", logicalCSS('top', 0), " ", logicalCSS('height', '100%'), ";;label:normal;"),
|
|
85
|
+
uncompressed: "\n ".concat(logicalCSS('left', euiTheme.size.m), "\n "),
|
|
86
|
+
compresssed: /*#__PURE__*/css(logicalCSS('left', euiTheme.size.s), " ", logicalCSS('width', euiTheme.size.m), ";;label:compresssed;"),
|
|
87
|
+
large: /*#__PURE__*/css(logicalCSS('margin-bottom', euiTheme.size.base), " ", euiCanAnimate, "{transition:transform ", euiTheme.animation.fast, " ", euiTheme.animation.resistance, ";};label:large;")
|
|
88
|
+
},
|
|
89
|
+
rightIcon: {
|
|
90
|
+
euiFilePicker__rightIcon: _ref2,
|
|
91
|
+
uncompressed: "\n ".concat(logicalCSS('top', euiTheme.size.m), "\n ").concat(logicalCSS('right', euiTheme.size.m), "\n "),
|
|
92
|
+
compressed: /*#__PURE__*/css(logicalCSS('right', euiTheme.size.s), " ", logicalCSS('top', '50%'), " ", logicalCSS('margin-top', mathWithUnits(euiTheme.size.m, function (x) {
|
|
93
|
+
return x / -2;
|
|
94
|
+
})), ";;label:compressed;")
|
|
95
|
+
},
|
|
96
|
+
euiFilePicker__clearButton: _ref
|
|
97
|
+
};
|
|
98
|
+
};
|
|
@@ -82,7 +82,7 @@ export var euiRangeThumbStyle = function euiRangeThumbStyle(euiThemeContext) {
|
|
|
82
82
|
return "\n ".concat(euiRangeThumbBoxShadow(euiThemeContext), ";\n ").concat(euiRangeThumbBorder(euiThemeContext), ";\n cursor: pointer;\n background-color: ").concat(range.thumbBackgroundColor, ";\n padding: 0;\n block-size: ").concat(range.thumbHeight, ";\n inline-size: ").concat(range.thumbWidth, ";\n box-sizing: border-box; // required for firefox or the border makes the width and height to increase\n ");
|
|
83
83
|
};
|
|
84
84
|
export var euiRangeThumbPerBrowser = function euiRangeThumbPerBrowser(content) {
|
|
85
|
-
return "\n &::-webkit-slider-thumb { ".concat(content, "; }\n &::-moz-range-thumb
|
|
85
|
+
return "\n &::-webkit-slider-thumb { ".concat(content, "; }\n &::-moz-range-thumb { ").concat(content, "; }\n &::-ms-thumb {").concat(content, "; }\n ");
|
|
86
86
|
};
|
|
87
87
|
export var euiRangeThumbFocus = function euiRangeThumbFocus(euiThemeContext, color) {
|
|
88
88
|
var range = euiRangeVariables(euiThemeContext);
|
|
@@ -22,21 +22,23 @@ var EuiIconAppCases = function EuiIconAppCases(_ref) {
|
|
|
22
22
|
xmlns: "http://www.w3.org/2000/svg",
|
|
23
23
|
width: 32,
|
|
24
24
|
height: 32,
|
|
25
|
-
fill: "none",
|
|
26
25
|
viewBox: "0 0 32 32",
|
|
27
26
|
"aria-labelledby": titleId
|
|
28
27
|
}, props), title ? ___EmotionJSX("title", {
|
|
29
28
|
id: titleId
|
|
30
29
|
}, title) : null, ___EmotionJSX("path", {
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
d: "M4 6h22v7h-2V8H6v19H4V6Z",
|
|
31
|
+
className: "euiIcon__fillSecondary"
|
|
32
|
+
}), ___EmotionJSX("path", {
|
|
33
|
+
d: "M10 12H7v-2h3v2Zm1 0h12v-2H11v2Z",
|
|
34
|
+
className: "euiIcon__fillSecondary"
|
|
35
|
+
}), ___EmotionJSX("path", {
|
|
36
|
+
d: "M24 1H0v26h1l-1 .001v.026a2.256 2.256 0 0 0 .01.185 4.318 4.318 0 0 0 .563 1.792C1.194 30.064 2.399 31 4.5 31H17v-2H8.429a4.32 4.32 0 0 0 .57-1.927v-.062L9 27.005v-.003S9 27 8 27h1V16h21v3h2v-5H7v12.995l-.003.05a2.32 2.32 0 0 1-.298.95C6.442 28.436 5.898 29 4.5 29c-1.398 0-1.942-.564-2.199-1.004a2.32 2.32 0 0 1-.3-1.001L2 26.992V3h20v3h2V1Z"
|
|
33
37
|
}), ___EmotionJSX("path", {
|
|
34
|
-
d: "
|
|
38
|
+
d: "M23 21v3h-3v2h3v3h2v-3h3v-2h-3v-3h-2Z"
|
|
35
39
|
}), ___EmotionJSX("path", {
|
|
36
40
|
fillRule: "evenodd",
|
|
37
|
-
d: "
|
|
38
|
-
className: "euiIcon__fillSecondary",
|
|
39
|
-
clipRule: "evenodd"
|
|
41
|
+
d: "M24 32a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm0-2a5 5 0 1 0 0-10 5 5 0 0 0 0 10Z"
|
|
40
42
|
}));
|
|
41
43
|
};
|
|
42
44
|
export var icon = EuiIconAppCases;
|
|
@@ -26,21 +26,15 @@ var EuiIconLogoElasticStack = function EuiIconLogoElasticStack(_ref) {
|
|
|
26
26
|
"aria-labelledby": titleId
|
|
27
27
|
}, props), title ? ___EmotionJSX("title", {
|
|
28
28
|
id: titleId
|
|
29
|
-
}, title) : null, ___EmotionJSX("
|
|
30
|
-
fill: "none",
|
|
31
|
-
fillRule: "evenodd"
|
|
32
|
-
}, ___EmotionJSX("path", {
|
|
29
|
+
}, title) : null, ___EmotionJSX("path", {
|
|
33
30
|
fill: "#F04E98",
|
|
34
|
-
d: "
|
|
31
|
+
d: "M0 2.37A2.37 2.37 0 0 1 2.37 0h27.26A2.37 2.37 0 0 1 32 2.37v6.52H0V2.37Z"
|
|
35
32
|
}), ___EmotionJSX("path", {
|
|
36
33
|
fill: "#00BFB3",
|
|
37
|
-
d: "M0
|
|
34
|
+
d: "M0 20.148h32v-8.296H0v8.296Z"
|
|
38
35
|
}), ___EmotionJSX("path", {
|
|
39
|
-
fill: "#
|
|
40
|
-
d: "
|
|
41
|
-
})
|
|
42
|
-
fill: "#FEC514",
|
|
43
|
-
d: "M17.5 23v9h12a2.5 2.5 0 0 0 2.5-2.5V23H17.5Z"
|
|
44
|
-
})));
|
|
36
|
+
fill: "#07C",
|
|
37
|
+
d: "M0 23.111h32v6.519A2.37 2.37 0 0 1 29.63 32H2.37A2.37 2.37 0 0 1 0 29.63v-6.52Z"
|
|
38
|
+
}));
|
|
45
39
|
};
|
|
46
40
|
export var icon = EuiIconLogoElasticStack;
|
|
@@ -13,7 +13,7 @@ import { euiFormVariables } from '../form/form.styles';
|
|
|
13
13
|
export var euiModalStyles = function euiModalStyles(euiThemeContext) {
|
|
14
14
|
var euiTheme = euiThemeContext.euiTheme;
|
|
15
15
|
return {
|
|
16
|
-
euiModal: /*#__PURE__*/css(euiShadowXLarge(euiThemeContext), " display:flex;flex-direction:column;max-block-size:75vh;position:relative;background-color:", euiTheme.colors.emptyShade, ";border-radius:", euiTheme.border.radius.medium, ";z-index:", euiTheme.levels.modal, ";min-inline-size:", euiFormVariables(euiThemeContext).maxWidth, ";max-inline-size:calc(100vw - ", euiTheme.size.base, ");", euiCanAnimate, "{animation:", euiAnimSlideInUp(euiTheme.size.xxl), " ", euiTheme.animation.slow, " ", euiTheme.animation.bounce, ";}", euiMaxBreakpoint(euiThemeContext, 'm'), "{position:fixed;inset:0;border-radius:0;inline-size:100vw!important;min-inline-size:0!important;max-inline-size:none!important;max-block-size:100vh!important;}&:focus{outline:none;};label:euiModal;"),
|
|
16
|
+
euiModal: /*#__PURE__*/css(euiShadowXLarge(euiThemeContext), " display:flex;flex-direction:column;max-block-size:75vh;position:relative;background-color:", euiTheme.colors.emptyShade, ";border-radius:", euiTheme.border.radius.medium, ";z-index:", euiTheme.levels.modal, ";min-inline-size:", euiFormVariables(euiThemeContext).maxWidth, ";max-inline-size:calc(100vw - ", euiTheme.size.base, ");overflow:hidden;", euiCanAnimate, "{animation:", euiAnimSlideInUp(euiTheme.size.xxl), " ", euiTheme.animation.slow, " ", euiTheme.animation.bounce, ";}", euiMaxBreakpoint(euiThemeContext, 'm'), "{position:fixed;inset:0;border-radius:0;inline-size:100vw!important;min-inline-size:0!important;max-inline-size:none!important;max-block-size:100vh!important;}&:focus{outline:none;};label:euiModal;"),
|
|
17
17
|
// Variants
|
|
18
18
|
defaultMaxWidth: /*#__PURE__*/css("max-inline-size:min(\n ", euiTheme.breakpoint.m, "px,\n calc(100vw - ", euiTheme.size.base, ")\n );;label:defaultMaxWidth;"),
|
|
19
19
|
confirmation: /*#__PURE__*/css("min-inline-size:", euiFormVariables(euiThemeContext).maxWidth, ";", euiMaxBreakpoint(euiThemeContext, 'm'), "{", euiShadowXLarge(euiThemeContext, {
|
|
@@ -125,9 +125,11 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
125
125
|
});
|
|
126
126
|
_defineProperty(_this, "handleStrandedFocus", function () {
|
|
127
127
|
_this.strandedFocusTimeout = window.setTimeout(function () {
|
|
128
|
-
// If `returnFocus` failed and focus was stranded
|
|
129
|
-
// attempt to manually restore focus to the toggle button
|
|
130
|
-
|
|
128
|
+
// If `returnFocus` failed and focus was stranded,
|
|
129
|
+
// attempt to manually restore focus to the toggle button.
|
|
130
|
+
// The stranded focus is either in most cases on body but
|
|
131
|
+
// it will be on the panel instead on mount when isOpen=true
|
|
132
|
+
if (document.activeElement === document.body || document.activeElement === _this.panel) {
|
|
131
133
|
if (!_this.button) return;
|
|
132
134
|
var focusableItems = focusable(_this.button);
|
|
133
135
|
if (!focusableItems.length) return;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import { EuiThemeProvider
|
|
10
|
+
import { EuiThemeProvider } from '../../services';
|
|
11
11
|
import { emitEuiProviderWarning } from '../../services/theme/warning';
|
|
12
12
|
import { cache as fallbackCache } from '../../services/emotion/css';
|
|
13
13
|
import { EuiGlobalStyles } from '../../global_styling/reset/global_styles';
|
|
@@ -76,5 +76,5 @@ export var EuiProvider = function EuiProvider(_ref) {
|
|
|
76
76
|
children: Utilities && ___EmotionJSX(Utilities, null)
|
|
77
77
|
})), ___EmotionJSX(EuiComponentDefaultsProvider, {
|
|
78
78
|
componentDefaults: componentDefaults
|
|
79
|
-
},
|
|
79
|
+
}, children))));
|
|
80
80
|
};
|
|
@@ -48,9 +48,9 @@ export var EuiStep = function EuiStep(_ref) {
|
|
|
48
48
|
}, ___EmotionJSX(EuiStepNumber, {
|
|
49
49
|
number: step,
|
|
50
50
|
status: status,
|
|
51
|
-
titleSize: titleSize
|
|
51
|
+
titleSize: titleSize === 'xxs' ? 'none' : titleSize
|
|
52
52
|
}), ___EmotionJSX(EuiTitle, {
|
|
53
|
-
size: titleSize,
|
|
53
|
+
size: titleSize === 'xxs' ? 'xs' : titleSize,
|
|
54
54
|
className: "euiStep__title",
|
|
55
55
|
css: cssStepTitleStyles
|
|
56
56
|
}, /*#__PURE__*/createElement(headingElement, null, title))), ___EmotionJSX("div", {
|
|
@@ -81,7 +81,9 @@ EuiStep.propTypes = {
|
|
|
81
81
|
*/
|
|
82
82
|
status: PropTypes.any,
|
|
83
83
|
/**
|
|
84
|
-
* Title sizing equivalent to EuiTitle
|
|
84
|
+
* Title sizing equivalent to **EuiTitle**, but only `m`, `s`, `xs` font sizes.
|
|
85
|
+
* The `xxs` size reduces the size of the accompanying step indicator, but not the title itself.
|
|
86
|
+
* @default s
|
|
85
87
|
*/
|
|
86
88
|
titleSize: PropTypes.any
|
|
87
89
|
};
|
|
@@ -13,6 +13,7 @@ export var euiStepVariables = function euiStepVariables(euiTheme) {
|
|
|
13
13
|
return {
|
|
14
14
|
numberSize: euiTheme.size.xl,
|
|
15
15
|
numberXSSize: euiTheme.size.l,
|
|
16
|
+
numberXXSSize: euiTheme.size.base,
|
|
16
17
|
numberMargin: euiTheme.size.base
|
|
17
18
|
};
|
|
18
19
|
};
|
|
@@ -32,9 +33,10 @@ export var euiStepStyles = function euiStepStyles(euiThemeContext) {
|
|
|
32
33
|
return {
|
|
33
34
|
euiStep: /*#__PURE__*/css("&:not(:last-of-type){background-image:", lineGradient, ";background-repeat:no-repeat;};label:euiStep;"),
|
|
34
35
|
// Sizes
|
|
35
|
-
m: /*#__PURE__*/css("&:not(:last-of-type){background-position:left ",
|
|
36
|
-
s: /*#__PURE__*/css("&:not(:last-of-type){background-position:left ",
|
|
37
|
-
xs: /*#__PURE__*/css("&:not(:last-of-type){background-position:-", euiTheme.size.xs, " ",
|
|
36
|
+
m: /*#__PURE__*/css("&:not(:last-of-type){background-position:left ", euiStep.numberSize, ";};label:m;"),
|
|
37
|
+
s: /*#__PURE__*/css("&:not(:last-of-type){background-position:left ", euiStep.numberSize, ";};label:s;"),
|
|
38
|
+
xs: /*#__PURE__*/css("&:not(:last-of-type){background-position:-", euiTheme.size.xs, " ", euiStep.numberXSSize, ";};label:xs;"),
|
|
39
|
+
xxs: /*#__PURE__*/css("&:not(:last-of-type){background-position:-", euiTheme.size.s, " ", euiStep.numberXXSSize, ";};label:xxs;")
|
|
38
40
|
};
|
|
39
41
|
};
|
|
40
42
|
export var euiStepContentStyles = function euiStepContentStyles(euiThemeContext) {
|
|
@@ -58,7 +60,12 @@ export var euiStepContentStyles = function euiStepContentStyles(euiThemeContext)
|
|
|
58
60
|
return x / 2 + y;
|
|
59
61
|
})), logicalCSS('margin-left', mathWithUnits(euiStep.numberXSSize, function (x) {
|
|
60
62
|
return x / 2;
|
|
61
|
-
})), ";;label:xs;")
|
|
63
|
+
})), ";;label:xs;"),
|
|
64
|
+
xxs: /*#__PURE__*/css(logicalCSS('padding-left', mathWithUnits([euiStep.numberXXSSize, euiStep.numberMargin], function (x, y) {
|
|
65
|
+
return x / 2 + y;
|
|
66
|
+
})), logicalCSS('margin-left', mathWithUnits(euiStep.numberXXSSize, function (x) {
|
|
67
|
+
return x / 2;
|
|
68
|
+
})), ";;label:xxs;")
|
|
62
69
|
};
|
|
63
70
|
};
|
|
64
71
|
export var euiStepTitleStyles = function euiStepTitleStyles(euiThemeContext) {
|
|
@@ -71,6 +78,7 @@ export var euiStepTitleStyles = function euiStepTitleStyles(euiThemeContext) {
|
|
|
71
78
|
// Sizes
|
|
72
79
|
m: /*#__PURE__*/css(";label:m;"),
|
|
73
80
|
s: /*#__PURE__*/css(logicalCSS('padding-top', euiTheme.size.xs), ";;label:s;"),
|
|
74
|
-
xs: /*#__PURE__*/css(";label:xs;")
|
|
81
|
+
xs: /*#__PURE__*/css(";label:xs;"),
|
|
82
|
+
xxs: /*#__PURE__*/css("line-height:", euiStep.numberXXSSize, ";;label:xxs;")
|
|
75
83
|
};
|
|
76
84
|
};
|
|
@@ -13,11 +13,17 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
13
13
|
import classNames from 'classnames';
|
|
14
14
|
import PropTypes from "prop-types";
|
|
15
15
|
import React from 'react';
|
|
16
|
+
import { useEuiTheme } from '../../services';
|
|
16
17
|
import { EuiStepNumber } from './step_number';
|
|
17
18
|
import { useI18nCompleteStep, useI18nCurrentStep, useI18nDisabledStep, useI18nIncompleteStep, useI18nStep, useI18nWarningStep, useI18nErrorsStep, useI18nLoadingStep } from './step_strings';
|
|
18
|
-
import { useEuiTheme } from '../../services';
|
|
19
19
|
import { euiStepHorizontalStyles, euiStepHorizontalNumberStyles, euiStepHorizontalTitleStyles } from './step_horizontal.styles';
|
|
20
20
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
21
|
+
// The titleSize map is not 1 to 1; small == xs on the titleSize map
|
|
22
|
+
var stepNumberSizeMap = {
|
|
23
|
+
xs: 'none',
|
|
24
|
+
s: 'xs',
|
|
25
|
+
m: 'm'
|
|
26
|
+
};
|
|
21
27
|
export var EuiStepHorizontal = function EuiStepHorizontal(_ref) {
|
|
22
28
|
var className = _ref.className,
|
|
23
29
|
_ref$step = _ref.step,
|
|
@@ -89,8 +95,7 @@ export var EuiStepHorizontal = function EuiStepHorizontal(_ref) {
|
|
|
89
95
|
className: "euiStepHorizontal__number",
|
|
90
96
|
status: status,
|
|
91
97
|
number: step,
|
|
92
|
-
titleSize: size
|
|
93
|
-
,
|
|
98
|
+
titleSize: stepNumberSizeMap[size],
|
|
94
99
|
css: cssNumberStyles
|
|
95
100
|
}), ___EmotionJSX("span", {
|
|
96
101
|
className: "euiStepHorizontal__title",
|
|
@@ -40,6 +40,7 @@ export var euiStepHorizontalStyles = function euiStepHorizontalStyles(euiThemeCo
|
|
|
40
40
|
// Adjust the size of the step number and connecting lines based on size
|
|
41
41
|
m: _generateStepSizeAndInset(euiStep.numberSize),
|
|
42
42
|
s: _generateStepSizeAndInset(euiStep.numberXSSize),
|
|
43
|
+
xs: _generateStepSizeAndInset(euiStep.numberXXSSize),
|
|
43
44
|
// Note: these selectors must be nested because focus/hover state
|
|
44
45
|
// is on the parent container, but affects specific children
|
|
45
46
|
enabled: /*#__PURE__*/css("&:focus,&:hover{.euiStepHorizontal__title{text-decoration:underline;}}&:focus{outline:none;.euiStepHorizontal__number{", euiFocusRing(euiThemeContext), ";}.euiStepHorizontal__number:not(:focus-visible){outline:", euiTheme.focus.width, " solid ", euiTheme.colors.darkestShade, ";}};label:enabled;"),
|