@elastic/eui 59.1.0 → 60.1.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/README.md +7 -0
- package/dist/eui_theme_dark.css +0 -493
- package/dist/eui_theme_dark.json +7 -44
- package/dist/eui_theme_dark.json.d.ts +7 -44
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -493
- package/dist/eui_theme_light.json +7 -44
- package/dist/eui_theme_light.json.d.ts +7 -44
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/accessibility/screen_reader_live/screen_reader_live.js +30 -7
- package/es/components/accessibility/screen_reader_only/screen_reader_only.js +14 -19
- package/es/components/accessibility/screen_reader_only/screen_reader_only.styles.js +11 -1
- package/es/components/accessibility/skip_link/skip_link.js +20 -4
- package/es/components/avatar/avatar.js +2 -2
- package/es/components/badge/badge.js +1 -1
- package/es/components/button/button_icon/button_icon.js +1 -1
- package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +2 -2
- package/es/components/combo_box/matching_options.js +3 -2
- package/es/components/datagrid/body/data_grid_body.js +6 -6
- package/es/components/datagrid/body/data_grid_cell.js +12 -12
- package/es/components/datagrid/body/header/data_grid_header_cell.js +6 -6
- package/es/components/datagrid/body/header/data_grid_header_row.js +6 -6
- package/es/components/datagrid/data_grid.js +6 -6
- package/es/components/datagrid/utils/in_memory.js +6 -6
- package/es/components/date_picker/date_picker.js +1 -1
- package/es/components/empty_prompt/empty_prompt.js +1 -1
- package/es/components/form/field_text/field_text.js +1 -1
- package/es/components/form/form_control_layout/form_control_layout.js +1 -1
- package/es/components/form/form_control_layout/form_control_layout_icons.js +1 -1
- package/es/components/health/health.js +1 -1
- package/es/components/icon/icon.js +43 -495
- package/es/components/icon/icon.styles.js +75 -0
- package/es/components/icon/icon_map.js +455 -0
- package/es/components/icon/named_colors.js +2 -13
- package/es/components/list_group/list_group.js +1 -1
- package/es/components/list_group/list_group_item.js +1 -1
- package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +2 -2
- package/es/components/notification/notification_event.js +2 -2
- package/es/components/notification/notification_event_meta.js +1 -1
- package/es/components/notification/notification_event_read_button.js +1 -1
- package/es/components/progress/progress.js +34 -87
- package/es/components/progress/progress.styles.js +155 -0
- package/es/components/provider/cache/cache_provider.js +17 -0
- package/es/components/provider/cache/index.js +8 -0
- package/es/components/provider/provider.js +35 -5
- package/es/components/selectable/selectable.js +39 -22
- package/es/components/selectable/selectable_list/selectable_list.js +1 -1
- package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +2 -2
- package/es/components/stat/stat.js +28 -35
- package/es/components/stat/stat.styles.js +38 -0
- package/es/components/timeline/timeline.js +15 -8
- package/es/components/timeline/timeline.styles.js +29 -0
- package/es/components/timeline/timeline_item.js +4 -16
- package/es/components/timeline/timeline_item.styles.js +18 -3
- package/es/components/timeline/timeline_item_icon.styles.js +14 -4
- package/es/components/tool_tip/icon_tip.js +1 -1
- package/es/global_styling/functions/logicals.js +2 -2
- package/es/global_styling/utility/utility.js +17 -0
- package/es/services/theme/hooks.js +4 -2
- package/es/services/theme/provider.js +1 -5
- package/es/test/emotion-prefix.js +29 -0
- package/es/test/index.d.ts +5 -0
- package/es/test/index.js +2 -1
- package/eui.d.ts +450 -454
- package/i18ntokens.json +18 -18
- package/lib/components/accessibility/screen_reader_live/screen_reader_live.js +29 -6
- package/lib/components/accessibility/screen_reader_only/screen_reader_only.js +22 -19
- package/lib/components/accessibility/screen_reader_only/screen_reader_only.styles.js +16 -2
- package/lib/components/accessibility/skip_link/skip_link.js +21 -4
- package/lib/components/avatar/avatar.js +2 -2
- package/lib/components/badge/badge.js +1 -1
- package/lib/components/button/button_icon/button_icon.js +1 -1
- package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +2 -2
- package/lib/components/combo_box/matching_options.js +3 -2
- package/lib/components/datagrid/body/data_grid_body.js +6 -6
- package/lib/components/datagrid/body/data_grid_cell.js +12 -12
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +6 -6
- package/lib/components/datagrid/body/header/data_grid_header_row.js +6 -6
- package/lib/components/datagrid/data_grid.js +6 -6
- package/lib/components/datagrid/utils/in_memory.js +6 -6
- package/lib/components/date_picker/date_picker.js +1 -1
- package/lib/components/empty_prompt/empty_prompt.js +1 -1
- package/lib/components/form/field_text/field_text.js +1 -1
- package/lib/components/form/form_control_layout/form_control_layout.js +1 -1
- package/lib/components/form/form_control_layout/form_control_layout_icons.js +1 -1
- package/lib/components/health/health.js +1 -1
- package/lib/components/icon/icon.js +54 -499
- package/lib/components/icon/icon.styles.js +79 -0
- package/lib/components/icon/icon_map.js +463 -0
- package/lib/components/icon/named_colors.js +4 -15
- package/lib/components/list_group/list_group.js +1 -1
- package/lib/components/list_group/list_group_item.js +1 -1
- package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +2 -2
- package/lib/components/notification/notification_event.js +2 -2
- package/lib/components/notification/notification_event_meta.js +1 -1
- package/lib/components/notification/notification_event_read_button.js +1 -1
- package/lib/components/progress/progress.js +36 -88
- package/lib/components/progress/progress.styles.js +166 -0
- package/lib/components/provider/cache/cache_provider.js +29 -0
- package/lib/components/provider/cache/index.js +18 -0
- package/lib/components/provider/provider.js +36 -5
- package/lib/components/selectable/selectable.js +39 -22
- package/lib/components/selectable/selectable_list/selectable_list.js +1 -1
- package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +3 -3
- package/lib/components/stat/stat.js +30 -40
- package/lib/components/stat/stat.styles.js +45 -0
- package/lib/components/timeline/timeline.js +20 -9
- package/lib/components/timeline/timeline.styles.js +39 -0
- package/lib/components/timeline/timeline_item.js +4 -17
- package/lib/components/timeline/timeline_item.styles.js +17 -10
- package/lib/components/timeline/timeline_item_icon.styles.js +15 -4
- package/lib/components/tool_tip/icon_tip.js +1 -1
- package/lib/global_styling/functions/logicals.js +2 -2
- package/lib/global_styling/utility/utility.js +31 -0
- package/lib/services/theme/hooks.js +4 -2
- package/lib/services/theme/provider.js +3 -6
- package/lib/test/emotion-prefix.js +38 -0
- package/lib/test/index.d.ts +5 -0
- package/lib/test/index.js +23 -1
- package/optimize/es/components/accessibility/screen_reader_live/screen_reader_live.js +21 -6
- package/optimize/es/components/accessibility/screen_reader_only/screen_reader_only.js +11 -17
- package/optimize/es/components/accessibility/screen_reader_only/screen_reader_only.styles.js +11 -1
- package/optimize/es/components/accessibility/skip_link/skip_link.js +20 -4
- package/optimize/es/components/combo_box/matching_options.js +3 -2
- package/optimize/es/components/icon/icon.js +40 -492
- package/optimize/es/components/icon/icon.styles.js +75 -0
- package/optimize/es/components/icon/icon_map.js +455 -0
- package/optimize/es/components/icon/named_colors.js +2 -13
- package/optimize/es/components/progress/progress.js +31 -84
- package/optimize/es/components/progress/progress.styles.js +155 -0
- package/optimize/es/components/provider/cache/cache_provider.js +17 -0
- package/optimize/es/components/provider/cache/index.js +8 -0
- package/optimize/es/components/provider/provider.js +35 -5
- package/optimize/es/components/selectable/selectable.js +33 -22
- package/optimize/es/components/stat/stat.js +25 -33
- package/optimize/es/components/stat/stat.styles.js +38 -0
- package/optimize/es/components/timeline/timeline.js +10 -1
- package/optimize/es/components/timeline/timeline.styles.js +29 -0
- package/optimize/es/components/timeline/timeline_item.js +4 -9
- package/optimize/es/components/timeline/timeline_item.styles.js +18 -3
- package/optimize/es/components/timeline/timeline_item_icon.styles.js +14 -4
- package/optimize/es/global_styling/functions/logicals.js +2 -2
- package/optimize/es/global_styling/utility/utility.js +17 -0
- package/optimize/es/services/theme/hooks.js +4 -2
- package/optimize/es/services/theme/provider.js +1 -5
- package/optimize/es/test/emotion-prefix.js +27 -0
- package/optimize/es/test/index.d.ts +5 -0
- package/optimize/es/test/index.js +2 -1
- package/optimize/lib/components/accessibility/screen_reader_live/screen_reader_live.js +20 -5
- package/optimize/lib/components/accessibility/screen_reader_only/screen_reader_only.js +18 -16
- package/optimize/lib/components/accessibility/screen_reader_only/screen_reader_only.styles.js +16 -2
- package/optimize/lib/components/accessibility/skip_link/skip_link.js +21 -4
- package/optimize/lib/components/combo_box/matching_options.js +3 -2
- package/optimize/lib/components/icon/icon.js +49 -494
- package/optimize/lib/components/icon/icon.styles.js +81 -0
- package/optimize/lib/components/icon/icon_map.js +463 -0
- package/optimize/lib/components/icon/named_colors.js +4 -15
- package/optimize/lib/components/progress/progress.js +33 -85
- package/optimize/lib/components/progress/progress.styles.js +168 -0
- package/optimize/lib/components/provider/cache/cache_provider.js +29 -0
- package/optimize/lib/components/provider/cache/index.js +18 -0
- package/optimize/lib/components/provider/provider.js +36 -5
- package/optimize/lib/components/selectable/selectable.js +33 -22
- package/optimize/lib/components/stat/stat.js +27 -37
- package/optimize/lib/components/stat/stat.styles.js +47 -0
- package/optimize/lib/components/timeline/timeline.js +14 -2
- package/optimize/lib/components/timeline/timeline.styles.js +39 -0
- package/optimize/lib/components/timeline/timeline_item.js +4 -10
- package/optimize/lib/components/timeline/timeline_item.styles.js +17 -10
- package/optimize/lib/components/timeline/timeline_item_icon.styles.js +15 -4
- package/optimize/lib/global_styling/functions/logicals.js +2 -2
- package/optimize/lib/global_styling/utility/utility.js +31 -0
- package/optimize/lib/services/theme/hooks.js +4 -2
- package/optimize/lib/services/theme/provider.js +3 -6
- package/optimize/lib/test/emotion-prefix.js +40 -0
- package/optimize/lib/test/index.d.ts +5 -0
- package/optimize/lib/test/index.js +23 -1
- package/package.json +2 -2
- package/src/components/form/form_control_layout/_form_control_layout.scss +2 -4
- package/src/components/index.scss +0 -4
- package/src/global_styling/variables/_form.scss +9 -0
- package/src/themes/amsterdam/overrides/_index.scss +0 -1
- package/test-env/components/accessibility/screen_reader_live/screen_reader_live.js +29 -6
- package/test-env/components/accessibility/screen_reader_only/screen_reader_only.js +21 -18
- package/test-env/components/accessibility/screen_reader_only/screen_reader_only.styles.js +16 -2
- package/test-env/components/accessibility/skip_link/skip_link.js +21 -4
- package/test-env/components/avatar/avatar.js +2 -2
- package/test-env/components/badge/badge.js +1 -1
- package/test-env/components/button/button_icon/button_icon.js +1 -1
- package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +2 -2
- package/test-env/components/combo_box/matching_options.js +3 -2
- package/test-env/components/datagrid/body/data_grid_body.js +6 -6
- package/test-env/components/datagrid/body/data_grid_cell.js +12 -12
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +6 -6
- package/test-env/components/datagrid/body/header/data_grid_header_row.js +6 -6
- package/test-env/components/datagrid/data_grid.js +6 -6
- package/test-env/components/datagrid/utils/in_memory.js +6 -6
- package/test-env/components/date_picker/date_picker.js +1 -1
- package/test-env/components/empty_prompt/empty_prompt.js +1 -1
- package/test-env/components/form/field_text/field_text.js +1 -1
- package/test-env/components/form/form_control_layout/form_control_layout.js +1 -1
- package/test-env/components/form/form_control_layout/form_control_layout_icons.js +1 -1
- package/test-env/components/health/health.js +1 -1
- package/test-env/components/icon/icon.styles.js +81 -0
- package/test-env/components/icon/icon_map.js +463 -0
- package/test-env/components/icon/named_colors.js +4 -15
- package/test-env/components/list_group/list_group.js +1 -1
- package/test-env/components/list_group/list_group_item.js +1 -1
- package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +2 -2
- package/test-env/components/notification/notification_event.js +2 -2
- package/test-env/components/notification/notification_event_meta.js +1 -1
- package/test-env/components/notification/notification_event_read_button.js +1 -1
- package/test-env/components/progress/progress.js +36 -88
- package/test-env/components/progress/progress.styles.js +168 -0
- package/test-env/components/provider/cache/cache_provider.js +29 -0
- package/test-env/components/provider/cache/index.js +18 -0
- package/test-env/components/provider/provider.js +36 -5
- package/test-env/components/selectable/selectable.js +39 -22
- package/test-env/components/selectable/selectable_list/selectable_list.js +1 -1
- package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +3 -3
- package/test-env/components/stat/stat.js +29 -39
- package/test-env/components/stat/stat.styles.js +47 -0
- package/test-env/components/timeline/timeline.js +19 -9
- package/test-env/components/timeline/timeline.styles.js +39 -0
- package/test-env/components/timeline/timeline_item.js +4 -17
- package/test-env/components/timeline/timeline_item.styles.js +17 -10
- package/test-env/components/timeline/timeline_item_icon.styles.js +15 -4
- package/test-env/components/tool_tip/icon_tip.js +1 -1
- package/test-env/global_styling/functions/logicals.js +2 -2
- package/test-env/global_styling/utility/utility.js +31 -0
- package/test-env/services/theme/hooks.js +4 -2
- package/test-env/services/theme/provider.js +3 -6
- package/test-env/test/emotion-prefix.js +40 -0
- package/test-env/test/index.js +23 -1
- package/src/components/accessibility/_index.scss +0 -1
- package/src/components/accessibility/screen_reader_only/_screen_reader_only.scss +0 -5
- package/src/components/icon/_icon.scss +0 -87
- package/src/components/icon/_index.scss +0 -2
- package/src/components/icon/_variables.scss +0 -22
- package/src/components/progress/_index.scss +0 -2
- package/src/components/progress/_progress.scss +0 -166
- package/src/components/progress/_variables.scss +0 -21
- package/src/components/stat/_index.scss +0 -1
- package/src/components/stat/_stat.scss +0 -50
- package/src/themes/amsterdam/overrides/_progress.scss +0 -3
|
@@ -5,14 +5,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.EuiStat = exports.COLORS = exports.ALIGNMENTS = void 0;
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
|
|
14
|
-
var _common = require("../common");
|
|
15
|
-
|
|
16
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
15
|
|
|
18
16
|
var _text = require("../text");
|
|
@@ -23,6 +21,10 @@ var _accessibility = require("../accessibility");
|
|
|
23
21
|
|
|
24
22
|
var _i18n = require("../i18n");
|
|
25
23
|
|
|
24
|
+
var _services = require("../../services");
|
|
25
|
+
|
|
26
|
+
var _stat = require("./stat.styles");
|
|
27
|
+
|
|
26
28
|
var _react2 = require("@emotion/react");
|
|
27
29
|
|
|
28
30
|
var _excluded = ["children", "className", "description", "isLoading", "reverse", "textAlign", "title", "titleColor", "titleSize", "titleElement", "descriptionElement"];
|
|
@@ -35,32 +37,19 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
35
37
|
|
|
36
38
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
37
39
|
|
|
40
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
41
|
+
|
|
42
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
43
|
+
|
|
44
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
45
|
+
|
|
38
46
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
39
47
|
|
|
40
48
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
41
49
|
|
|
42
|
-
var
|
|
43
|
-
default: null,
|
|
44
|
-
subdued: 'euiStat__title--subdued',
|
|
45
|
-
primary: 'euiStat__title--primary',
|
|
46
|
-
success: 'euiStat__title--success',
|
|
47
|
-
danger: 'euiStat__title--danger',
|
|
48
|
-
accent: 'euiStat__title--accent'
|
|
49
|
-
};
|
|
50
|
-
var COLORS = (0, _common.keysOf)(colorToClassNameMap);
|
|
50
|
+
var COLORS = ['default', 'subdued', 'primary', 'success', 'danger', 'accent'];
|
|
51
51
|
exports.COLORS = COLORS;
|
|
52
|
-
var
|
|
53
|
-
left: 'euiStat--leftAligned',
|
|
54
|
-
center: 'euiStat--centerAligned',
|
|
55
|
-
right: 'euiStat--rightAligned'
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
var isColorClass = function isColorClass(input) {
|
|
59
|
-
return colorToClassNameMap.hasOwnProperty(input);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
exports.isColorClass = isColorClass;
|
|
63
|
-
var ALIGNMENTS = (0, _common.keysOf)(textAlignToClassNameMap);
|
|
52
|
+
var ALIGNMENTS = ['left', 'center', 'right'];
|
|
64
53
|
exports.ALIGNMENTS = ALIGNMENTS;
|
|
65
54
|
|
|
66
55
|
var EuiStat = function EuiStat(_ref) {
|
|
@@ -84,10 +73,10 @@ var EuiStat = function EuiStat(_ref) {
|
|
|
84
73
|
descriptionElement = _ref$descriptionEleme === void 0 ? 'p' : _ref$descriptionEleme,
|
|
85
74
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
86
75
|
|
|
87
|
-
var
|
|
88
|
-
var
|
|
89
|
-
|
|
90
|
-
|
|
76
|
+
var euiTheme = (0, _services.useEuiTheme)();
|
|
77
|
+
var styles = (0, _stat.euiStatStyles)();
|
|
78
|
+
var cssStyles = [styles.euiStat, styles[textAlign]];
|
|
79
|
+
var classes = (0, _classnames.default)('euiStat', className);
|
|
91
80
|
var commonProps = {
|
|
92
81
|
'aria-hidden': true
|
|
93
82
|
};
|
|
@@ -95,26 +84,27 @@ var EuiStat = function EuiStat(_ref) {
|
|
|
95
84
|
size: "s",
|
|
96
85
|
className: "euiStat__description"
|
|
97
86
|
}, /*#__PURE__*/(0, _react.createElement)(descriptionElement, commonProps, description));
|
|
98
|
-
var
|
|
99
|
-
|
|
87
|
+
var isNamedTitleColor = COLORS.includes(titleColor);
|
|
88
|
+
var titleStyles = (0, _stat.euiStatTitleStyles)(euiTheme);
|
|
89
|
+
var titleCssStyles = [titleStyles.euiStat__title, isNamedTitleColor && titleStyles[titleColor], isLoading && titleStyles.isLoading];
|
|
90
|
+
var titleProps = isNamedTitleColor ? commonProps : _objectSpread(_objectSpread({}, commonProps), {}, {
|
|
100
91
|
style: {
|
|
101
|
-
color:
|
|
92
|
+
color: titleColor
|
|
102
93
|
}
|
|
103
|
-
};
|
|
94
|
+
});
|
|
104
95
|
var titleChildren = isLoading ? '--' : title;
|
|
105
|
-
var titleDisplay =
|
|
106
|
-
size: titleSize,
|
|
107
|
-
className: titleClasses
|
|
108
|
-
}, /*#__PURE__*/(0, _react.createElement)(titleElement, commonProps, titleChildren)) : (0, _react2.jsx)(_title.EuiTitle, {
|
|
96
|
+
var titleDisplay = (0, _react2.jsx)(_title.EuiTitle, {
|
|
109
97
|
size: titleSize,
|
|
110
|
-
className:
|
|
111
|
-
|
|
98
|
+
className: "euiStat__title",
|
|
99
|
+
css: titleCssStyles
|
|
100
|
+
}, /*#__PURE__*/(0, _react.createElement)(titleElement, titleProps, titleChildren));
|
|
112
101
|
var screenReader = (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("p", null, isLoading ? (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
113
102
|
token: "euiStat.loadingText",
|
|
114
103
|
default: "Statistic is loading"
|
|
115
104
|
}) : (0, _react2.jsx)(_react.Fragment, null, reverse ? "".concat(title, " ").concat(description) : "".concat(description, " ").concat(title))));
|
|
116
105
|
var statDisplay = (0, _react2.jsx)(_react.Fragment, null, !reverse && descriptionDisplay, titleDisplay, reverse && descriptionDisplay, typeof title === 'string' && typeof description === 'string' && screenReader);
|
|
117
106
|
return (0, _react2.jsx)("div", _extends({
|
|
107
|
+
css: cssStyles,
|
|
118
108
|
className: classes
|
|
119
109
|
}, rest), statDisplay, children);
|
|
120
110
|
};
|
|
@@ -139,7 +129,7 @@ EuiStat.propTypes = {
|
|
|
139
129
|
* Flips the order of the description and title
|
|
140
130
|
*/
|
|
141
131
|
reverse: _propTypes.default.bool,
|
|
142
|
-
textAlign: _propTypes.default.
|
|
132
|
+
textAlign: _propTypes.default.any,
|
|
143
133
|
|
|
144
134
|
/**
|
|
145
135
|
* The (value) text
|
|
@@ -149,7 +139,7 @@ EuiStat.propTypes = {
|
|
|
149
139
|
/**
|
|
150
140
|
* The color of the title text
|
|
151
141
|
*/
|
|
152
|
-
titleColor: _propTypes.default.oneOfType([_propTypes.default.
|
|
142
|
+
titleColor: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.string.isRequired]),
|
|
153
143
|
|
|
154
144
|
/**
|
|
155
145
|
* Size of the title. See EuiTitle for options ('s', 'm', 'l'... etc)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.euiStatTitleStyles = exports.euiStatStyles = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
|
+
|
|
10
|
+
var _global_styling = require("../../global_styling");
|
|
11
|
+
|
|
12
|
+
var _templateObject;
|
|
13
|
+
|
|
14
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
15
|
+
|
|
16
|
+
var euiStatStyles = function euiStatStyles() {
|
|
17
|
+
return {
|
|
18
|
+
euiStat: /*#__PURE__*/(0, _react.css)(";label:euiStat;"),
|
|
19
|
+
// Text align
|
|
20
|
+
left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('left'), " align-items:flex-start;;label:left;"),
|
|
21
|
+
center: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('center'), " align-items:center;;label:center;"),
|
|
22
|
+
right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('right'), " align-items:flex-end;;label:right;")
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
exports.euiStatStyles = euiStatStyles;
|
|
27
|
+
|
|
28
|
+
var euiStatTitleStyles = function euiStatTitleStyles(_ref) {
|
|
29
|
+
var euiTheme = _ref.euiTheme;
|
|
30
|
+
return {
|
|
31
|
+
euiStat__title: /*#__PURE__*/(0, _react.css)(";label:euiStat__title;"),
|
|
32
|
+
// Colors
|
|
33
|
+
default: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.fullShade, ";;label:default;"),
|
|
34
|
+
subdued: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.subduedText, ";;label:subdued;"),
|
|
35
|
+
primary: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.primaryText, ";;label:primary;"),
|
|
36
|
+
success: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.successText, ";;label:success;"),
|
|
37
|
+
danger: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.dangerText, ";;label:danger;"),
|
|
38
|
+
accent: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.accentText, ";;label:accent;"),
|
|
39
|
+
// Loading
|
|
40
|
+
isLoading: /*#__PURE__*/(0, _react.css)(_global_styling.euiCanAnimate, "{animation:", euiStatPulse, " 1.5s infinite ease-in-out;};label:isLoading;")
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
exports.euiStatTitleStyles = euiStatTitleStyles;
|
|
45
|
+
var euiStatPulse = (0, _react.keyframes)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% { opacity: 1; }\n 50% { opacity: .25; }\n 100% { opacity: 1; }\n"])));
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.EuiTimeline = void 0;
|
|
6
|
+
exports.GUTTER_SIZES = exports.EuiTimeline = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
@@ -11,11 +11,15 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
|
|
14
|
+
var _services = require("../../services");
|
|
15
|
+
|
|
14
16
|
var _timeline_item = require("./timeline_item");
|
|
15
17
|
|
|
18
|
+
var _timeline = require("./timeline.styles");
|
|
19
|
+
|
|
16
20
|
var _react2 = require("@emotion/react");
|
|
17
21
|
|
|
18
|
-
var _excluded = ["className", "items", "children"];
|
|
22
|
+
var _excluded = ["className", "items", "children", "gutterSize"];
|
|
19
23
|
|
|
20
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
25
|
|
|
@@ -25,17 +29,26 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
25
29
|
|
|
26
30
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
27
31
|
|
|
32
|
+
var GUTTER_SIZES = ['m', 'l', 'xl'];
|
|
33
|
+
exports.GUTTER_SIZES = GUTTER_SIZES;
|
|
34
|
+
|
|
28
35
|
var EuiTimeline = function EuiTimeline(_ref) {
|
|
29
36
|
var className = _ref.className,
|
|
30
37
|
_ref$items = _ref.items,
|
|
31
38
|
items = _ref$items === void 0 ? [] : _ref$items,
|
|
32
39
|
children = _ref.children,
|
|
40
|
+
_ref$gutterSize = _ref.gutterSize,
|
|
41
|
+
gutterSize = _ref$gutterSize === void 0 ? 'xl' : _ref$gutterSize,
|
|
33
42
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
34
43
|
|
|
35
44
|
var classes = (0, _classnames.default)('euiTimeline', className);
|
|
45
|
+
var euiTheme = (0, _services.useEuiTheme)();
|
|
46
|
+
var styles = (0, _timeline.euiTimelineStyles)(euiTheme);
|
|
47
|
+
var cssStyles = [styles.euiTimeline, styles[gutterSize]];
|
|
36
48
|
return (// eslint-disable-next-line jsx-a11y/no-redundant-roles
|
|
37
49
|
(0, _react2.jsx)("ol", _extends({
|
|
38
50
|
className: classes,
|
|
51
|
+
css: cssStyles,
|
|
39
52
|
role: "list"
|
|
40
53
|
}, rest), items.map(function (item, index) {
|
|
41
54
|
return (0, _react2.jsx)(_timeline_item.EuiTimelineItem, _extends({
|
|
@@ -55,17 +68,15 @@ EuiTimeline.propTypes = {
|
|
|
55
68
|
* Vertical alignment of the event with the icon
|
|
56
69
|
*/
|
|
57
70
|
verticalAlign: _propTypes.default.any,
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Sets the HTML element for `EuiTimelineItem`.
|
|
61
|
-
* By default, the element renders as a `<li/>`.
|
|
62
|
-
* Only change the HTML element when it is not wrapped in a `EuiTimeline` that renders as a `<ol/>`.
|
|
63
|
-
*/
|
|
64
|
-
component: _propTypes.default.any,
|
|
65
71
|
className: _propTypes.default.string,
|
|
66
72
|
"aria-label": _propTypes.default.string,
|
|
67
73
|
"data-test-subj": _propTypes.default.string
|
|
68
74
|
}).isRequired),
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Sets the size of the vertical space between each timeline item
|
|
78
|
+
*/
|
|
79
|
+
gutterSize: _propTypes.default.any,
|
|
69
80
|
className: _propTypes.default.string,
|
|
70
81
|
"aria-label": _propTypes.default.string,
|
|
71
82
|
"data-test-subj": _propTypes.default.string
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.euiTimelineStyles = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
|
+
|
|
10
|
+
var _global_styling = require("../../global_styling");
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
14
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
15
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
16
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
17
|
+
* Side Public License, v 1.
|
|
18
|
+
*/
|
|
19
|
+
var _gutterSizeAdjustment = function _gutterSizeAdjustment(gutterSize) {
|
|
20
|
+
return "\n gap: ".concat(gutterSize, ";\n\n // The vertical line height needs to be adjusted with the gutter size\n [class*='euiTimelineItem-']:not(:last-child) > [class*='euiTimelineItemIcon-']::before {\n ").concat((0, _global_styling.logicalCSS)('height', "calc(100% + ".concat(gutterSize, ")")), ";\n }\n ");
|
|
21
|
+
}; // The vertical line should only appear when the EuiTimelineItem's
|
|
22
|
+
// are wrapped in a EuiTimeline. That's why these styles live here.
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
var timelineVerticalLine = function timelineVerticalLine(euiTheme) {
|
|
26
|
+
return " \n [class*='euiTimelineItem-'] > [class*='euiTimelineItemIcon-']::before {\n content: '';\n position: absolute;\n ".concat((0, _global_styling.logicalCSS)('top', 0), ";\n ").concat((0, _global_styling.logicalCSS)('width', euiTheme.size.xxs), ";\n background-color: ").concat(euiTheme.colors.lightShade, ";\n }\n\n > [class*='euiTimelineItem-center']:first-child > [class*='euiTimelineItemIcon-']::before {\n ").concat((0, _global_styling.logicalCSS)('top', '50%'), ";\n }\n \n > [class*='euiTimelineItem-center']:last-child:not(:only-child) > [class*='euiTimelineItemIcon-']::before {\n ").concat((0, _global_styling.logicalCSS)('height', '50%'), ";\n }\n ");
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
var euiTimelineStyles = function euiTimelineStyles(_ref) {
|
|
30
|
+
var euiTheme = _ref.euiTheme;
|
|
31
|
+
return {
|
|
32
|
+
euiTimeline: /*#__PURE__*/(0, _react.css)("display:flex;flex-direction:column;", timelineVerticalLine(euiTheme), ";;label:euiTimeline;"),
|
|
33
|
+
m: /*#__PURE__*/(0, _react.css)(_gutterSizeAdjustment(euiTheme.size.base), ";label:m;"),
|
|
34
|
+
l: /*#__PURE__*/(0, _react.css)(_gutterSizeAdjustment(euiTheme.size.l), ";label:l;"),
|
|
35
|
+
xl: /*#__PURE__*/(0, _react.css)(_gutterSizeAdjustment(euiTheme.size.xl), ";label:xl;")
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
exports.euiTimelineStyles = euiTimelineStyles;
|
|
@@ -9,8 +9,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
|
-
var _services = require("../../services");
|
|
13
|
-
|
|
14
12
|
var _timeline_item_event = require("./timeline_item_event");
|
|
15
13
|
|
|
16
14
|
var _timeline_item_icon = require("./timeline_item_icon");
|
|
@@ -19,7 +17,7 @@ var _timeline_item = require("./timeline_item.styles");
|
|
|
19
17
|
|
|
20
18
|
var _react2 = require("@emotion/react");
|
|
21
19
|
|
|
22
|
-
var _excluded = ["children", "verticalAlign", "icon", "iconAriaLabel", "className"
|
|
20
|
+
var _excluded = ["children", "verticalAlign", "icon", "iconAriaLabel", "className"];
|
|
23
21
|
|
|
24
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
23
|
|
|
@@ -39,15 +37,11 @@ var EuiTimelineItem = function EuiTimelineItem(_ref) {
|
|
|
39
37
|
icon = _ref.icon,
|
|
40
38
|
iconAriaLabel = _ref.iconAriaLabel,
|
|
41
39
|
className = _ref.className,
|
|
42
|
-
_ref$component = _ref.component,
|
|
43
|
-
component = _ref$component === void 0 ? 'li' : _ref$component,
|
|
44
40
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
45
41
|
|
|
46
|
-
var
|
|
47
|
-
var
|
|
48
|
-
|
|
49
|
-
var Element = component;
|
|
50
|
-
return (0, _react2.jsx)(Element, _extends({
|
|
42
|
+
var styles = (0, _timeline_item.euiTimelineItemStyles)();
|
|
43
|
+
var cssStyles = [styles.euiTimelineItem, styles[verticalAlign]];
|
|
44
|
+
return (0, _react2.jsx)("li", _extends({
|
|
51
45
|
css: cssStyles
|
|
52
46
|
}, rest), (0, _react2.jsx)(_timeline_item_icon.EuiTimelineItemIcon, {
|
|
53
47
|
icon: icon,
|
|
@@ -64,13 +58,6 @@ EuiTimelineItem.propTypes = {
|
|
|
64
58
|
* Vertical alignment of the event with the icon
|
|
65
59
|
*/
|
|
66
60
|
verticalAlign: _propTypes.default.any,
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Sets the HTML element for `EuiTimelineItem`.
|
|
70
|
-
* By default, the element renders as a `<li/>`.
|
|
71
|
-
* Only change the HTML element when it is not wrapped in a `EuiTimeline` that renders as a `<ol/>`.
|
|
72
|
-
*/
|
|
73
|
-
component: _propTypes.default.any,
|
|
74
61
|
className: _propTypes.default.string,
|
|
75
62
|
"aria-label": _propTypes.default.string,
|
|
76
63
|
"data-test-subj": _propTypes.default.string
|
|
@@ -7,17 +7,24 @@ exports.euiTimelineItemStyles = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = require("@emotion/react");
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
11
|
+
|
|
12
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
13
|
+
name: "5bggde-euiTimelineItem",
|
|
14
|
+
styles: "display:flex;position:relative;label:euiTimelineItem;"
|
|
15
|
+
} : {
|
|
16
|
+
name: "5bggde-euiTimelineItem",
|
|
17
|
+
styles: "display:flex;position:relative;label:euiTimelineItem;",
|
|
18
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
var euiTimelineItemStyles = function euiTimelineItemStyles() {
|
|
19
22
|
return {
|
|
20
|
-
euiTimelineItem:
|
|
23
|
+
euiTimelineItem: _ref,
|
|
24
|
+
// Vertical alignments
|
|
25
|
+
// These classes are being targeted in timeline.styles.ts
|
|
26
|
+
top: /*#__PURE__*/(0, _react.css)(";label:top;"),
|
|
27
|
+
center: /*#__PURE__*/(0, _react.css)(";label:center;")
|
|
21
28
|
};
|
|
22
29
|
};
|
|
23
30
|
|
|
@@ -7,6 +7,8 @@ exports.euiTimelineItemIconStyles = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = require("@emotion/react");
|
|
9
9
|
|
|
10
|
+
var _global_styling = require("../../global_styling");
|
|
11
|
+
|
|
10
12
|
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)."; }
|
|
11
13
|
|
|
12
14
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
@@ -27,11 +29,20 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
|
27
29
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
28
30
|
};
|
|
29
31
|
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
+
var _ref3 = process.env.NODE_ENV === "production" ? {
|
|
33
|
+
name: "kuz8oa-euiTimelineItemIcon__content",
|
|
34
|
+
styles: "display:flex;justify-content:center;align-items:center;position:relative;label:euiTimelineItemIcon__content;"
|
|
35
|
+
} : {
|
|
36
|
+
name: "kuz8oa-euiTimelineItemIcon__content",
|
|
37
|
+
styles: "display:flex;justify-content:center;align-items:center;position:relative;label:euiTimelineItemIcon__content;",
|
|
38
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
var euiTimelineItemIconStyles = function euiTimelineItemIconStyles(_ref4) {
|
|
42
|
+
var euiTheme = _ref4.euiTheme;
|
|
32
43
|
return {
|
|
33
|
-
euiTimelineItemIcon: /*#__PURE__*/(0, _react.css)("display:flex;position:relative;flex-grow:0;
|
|
34
|
-
euiTimelineItemIcon__content:
|
|
44
|
+
euiTimelineItemIcon: /*#__PURE__*/(0, _react.css)("display:flex;position:relative;flex-grow:0;justify-content:center;", (0, _global_styling.logicalCSS)('margin-right', euiTheme.size.base), ";;label:euiTimelineItemIcon;"),
|
|
45
|
+
euiTimelineItemIcon__content: _ref3,
|
|
35
46
|
// Vertical alignments
|
|
36
47
|
top: _ref2,
|
|
37
48
|
center: _ref
|
|
@@ -48,9 +48,9 @@ var logicalPaddings = {
|
|
|
48
48
|
};
|
|
49
49
|
var logicalPosition = {
|
|
50
50
|
top: 'inset-block-start',
|
|
51
|
-
right: 'inset-inline-
|
|
51
|
+
right: 'inset-inline-end',
|
|
52
52
|
bottom: 'inset-block-end',
|
|
53
|
-
left: 'inset-inline-
|
|
53
|
+
left: 'inset-inline-start',
|
|
54
54
|
horizontal: 'inset-block',
|
|
55
55
|
vertical: 'inset-inline',
|
|
56
56
|
inset: 'inset'
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.EuiUtilityClasses = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _react2 = require("@emotion/react");
|
|
11
|
+
|
|
12
|
+
var _screen_reader_only = require("../../components/accessibility/screen_reader_only/screen_reader_only.styles");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
/*
|
|
17
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
18
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
19
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
20
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
21
|
+
* Side Public License, v 1.
|
|
22
|
+
*/
|
|
23
|
+
var globalStyles = /*#__PURE__*/(0, _react2.css)(".euiScreenReaderOnly{", (0, _screen_reader_only.euiScreenReaderOnly)(), ";};label:globalStyles;");
|
|
24
|
+
|
|
25
|
+
var EuiUtilityClasses = function EuiUtilityClasses() {
|
|
26
|
+
return (0, _react2.jsx)(_react2.Global, {
|
|
27
|
+
styles: globalStyles
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
exports.EuiUtilityClasses = EuiUtilityClasses;
|
|
@@ -32,8 +32,10 @@ var useEuiTheme = function useEuiTheme() {
|
|
|
32
32
|
|
|
33
33
|
exports.useEuiTheme = useEuiTheme;
|
|
34
34
|
|
|
35
|
+
// Provide the component props interface as the generic to allow the docs props table to populate.
|
|
36
|
+
// e.g., `const EuiComponent = withEuiTheme<EuiComponentProps>(_EuiComponent)`
|
|
35
37
|
var withEuiTheme = function withEuiTheme(Component) {
|
|
36
|
-
var componentName = Component.displayName || Component.name || '
|
|
38
|
+
var componentName = Component.displayName || Component.name || 'ComponentWithTheme';
|
|
37
39
|
|
|
38
40
|
var Render = function Render(props, ref) {
|
|
39
41
|
var _useEuiTheme = useEuiTheme(),
|
|
@@ -52,7 +54,7 @@ var withEuiTheme = function withEuiTheme(Component) {
|
|
|
52
54
|
};
|
|
53
55
|
|
|
54
56
|
var WithEuiTheme = /*#__PURE__*/(0, _react.forwardRef)(Render);
|
|
55
|
-
WithEuiTheme.displayName =
|
|
57
|
+
WithEuiTheme.displayName = componentName;
|
|
56
58
|
return WithEuiTheme;
|
|
57
59
|
};
|
|
58
60
|
|
|
@@ -9,14 +9,14 @@ exports.EuiThemeProvider = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
|
-
var _react2 = require("@emotion/react");
|
|
13
|
-
|
|
14
12
|
var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
|
|
15
13
|
|
|
16
14
|
var _context = require("./context");
|
|
17
15
|
|
|
18
16
|
var _utils = require("./utils");
|
|
19
17
|
|
|
18
|
+
var _react2 = require("@emotion/react");
|
|
19
|
+
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
21
|
|
|
22
22
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -39,7 +39,6 @@ var EuiThemeProvider = function EuiThemeProvider(_ref) {
|
|
|
39
39
|
var _system = _ref.theme,
|
|
40
40
|
_colorMode = _ref.colorMode,
|
|
41
41
|
_modifications = _ref.modify,
|
|
42
|
-
cache = _ref.cache,
|
|
43
42
|
children = _ref.children;
|
|
44
43
|
var parentSystem = (0, _react.useContext)(_context.EuiSystemContext);
|
|
45
44
|
var parentModifications = (0, _react.useContext)(_context.EuiModificationsContext);
|
|
@@ -113,9 +112,7 @@ var EuiThemeProvider = function EuiThemeProvider(_ref) {
|
|
|
113
112
|
value: modifications
|
|
114
113
|
}, (0, _react2.jsx)(_context.EuiThemeContext.Provider, {
|
|
115
114
|
value: theme
|
|
116
|
-
},
|
|
117
|
-
value: cache
|
|
118
|
-
}, children) : children))));
|
|
115
|
+
}, children))));
|
|
119
116
|
};
|
|
120
117
|
|
|
121
118
|
exports.EuiThemeProvider = EuiThemeProvider;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.replaceEmotionPrefix = void 0;
|
|
9
|
+
|
|
10
|
+
function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(re, groups) { return new BabelRegExp(re, undefined, groups); }; var _super = RegExp.prototype; var _groups = new WeakMap(); function BabelRegExp(re, flags, groups) { var _this = new RegExp(re, flags); _groups.set(_this, groups || _groups.get(re)); return _setPrototypeOf(_this, BabelRegExp.prototype); } _inherits(BabelRegExp, RegExp); BabelRegExp.prototype.exec = function (str) { var result = _super.exec.call(this, str); if (result) result.groups = buildGroups(result, this); return result; }; BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { if (typeof substitution === "string") { var groups = _groups.get(this); return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { return "$" + groups[name]; })); } else if (typeof substitution === "function") { var _this = this; return _super[Symbol.replace].call(this, str, function () { var args = arguments; if (_typeof(args[args.length - 1]) !== "object") { args = [].slice.call(args); args.push(buildGroups(args, _this)); } return substitution.apply(this, args); }); } else { return _super[Symbol.replace].call(this, str, substitution); } }; function buildGroups(result, re) { var g = _groups.get(re); return Object.keys(g).reduce(function (groups, name) { groups[name] = result[g[name]]; return groups; }, Object.create(null)); } return _wrapRegExp.apply(this, arguments); }
|
|
11
|
+
|
|
12
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
13
|
+
|
|
14
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
15
|
+
|
|
16
|
+
/*
|
|
17
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
18
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
19
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
20
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
21
|
+
* Side Public License, v 1.
|
|
22
|
+
*/
|
|
23
|
+
var replaceEmotionPrefix = function replaceEmotionPrefix(selector) {
|
|
24
|
+
var _euiMatch$groups;
|
|
25
|
+
|
|
26
|
+
// Matches the Emotion className pattern + the EUI variant naming convention.
|
|
27
|
+
// Starts with `css-[hash]-`.
|
|
28
|
+
// Contains `eui[ComponentName] or `Eui[ComponentName]`.
|
|
29
|
+
// Capture the component name (from above) and all variant additions until the end of the string.
|
|
30
|
+
var euiMatch = selector.match( /*#__PURE__*/_wrapRegExp(/css\x2D[0-9A-Z_a-z]{6,}\x2D([Ee]ui[A-Z][\x2D0-9A-Z_a-z]*$)/, {
|
|
31
|
+
euiComponent: 1
|
|
32
|
+
})); // Use the captured group (`euiComponent`) if available and prepend with `emotion-`,
|
|
33
|
+
// otherwise use the full selector.
|
|
34
|
+
|
|
35
|
+
return euiMatch !== null && euiMatch !== void 0 && (_euiMatch$groups = euiMatch.groups) !== null && _euiMatch$groups !== void 0 && _euiMatch$groups.euiComponent ? "emotion-".concat(euiMatch.groups.euiComponent) : selector;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
exports.replaceEmotionPrefix = replaceEmotionPrefix;
|
package/lib/test/index.d.ts
CHANGED
|
@@ -36,6 +36,10 @@ declare module '@elastic/eui/lib/test/react_warnings' {
|
|
|
36
36
|
declare module '@elastic/eui/lib/test/sleep' {
|
|
37
37
|
export function sleep(ms?: number): Promise<unknown>;
|
|
38
38
|
|
|
39
|
+
}
|
|
40
|
+
declare module '@elastic/eui/lib/test/emotion-prefix' {
|
|
41
|
+
export const replaceEmotionPrefix: (selector: string) => string;
|
|
42
|
+
|
|
39
43
|
}
|
|
40
44
|
declare module '@elastic/eui/lib/test' {
|
|
41
45
|
export { requiredProps } from '@elastic/eui/lib/test/required_props';
|
|
@@ -43,5 +47,6 @@ declare module '@elastic/eui/lib/test' {
|
|
|
43
47
|
export { findTestSubject } from '@elastic/eui/lib/test/find_test_subject';
|
|
44
48
|
export { startThrowingReactWarnings, stopThrowingReactWarnings, } from '@elastic/eui/lib/test/react_warnings';
|
|
45
49
|
export { sleep } from '@elastic/eui/lib/test/sleep';
|
|
50
|
+
export * from '@elastic/eui/lib/test/emotion-prefix';
|
|
46
51
|
|
|
47
52
|
}
|
package/lib/test/index.js
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
requiredProps: true,
|
|
8
|
+
takeMountedSnapshot: true,
|
|
9
|
+
findTestSubject: true,
|
|
10
|
+
startThrowingReactWarnings: true,
|
|
11
|
+
stopThrowingReactWarnings: true,
|
|
12
|
+
sleep: true
|
|
13
|
+
};
|
|
6
14
|
Object.defineProperty(exports, "findTestSubject", {
|
|
7
15
|
enumerable: true,
|
|
8
16
|
get: function get() {
|
|
@@ -48,4 +56,18 @@ var _find_test_subject = require("./find_test_subject");
|
|
|
48
56
|
|
|
49
57
|
var _react_warnings = require("./react_warnings");
|
|
50
58
|
|
|
51
|
-
var _sleep = require("./sleep");
|
|
59
|
+
var _sleep = require("./sleep");
|
|
60
|
+
|
|
61
|
+
var _emotionPrefix = require("./emotion-prefix");
|
|
62
|
+
|
|
63
|
+
Object.keys(_emotionPrefix).forEach(function (key) {
|
|
64
|
+
if (key === "default" || key === "__esModule") return;
|
|
65
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
66
|
+
if (key in exports && exports[key] === _emotionPrefix[key]) return;
|
|
67
|
+
Object.defineProperty(exports, key, {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
get: function get() {
|
|
70
|
+
return _emotionPrefix[key];
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
});
|