@elastic/eui 92.2.0 → 93.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eui_theme_dark.css +0 -200
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -200
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/basic_table/basic_table.js +0 -9
- package/es/components/basic_table/in_memory_table.js +0 -10
- package/es/components/beacon/beacon.js +9 -6
- package/es/components/breadcrumbs/breadcrumb.js +0 -10
- package/es/components/breadcrumbs/breadcrumbs.js +0 -10
- package/es/components/code/code.js +2 -2
- package/es/components/code/code.styles.js +2 -4
- package/es/components/code/code_block.js +5 -3
- package/es/components/code/code_block.styles.js +4 -7
- package/es/components/code/code_block_controls.js +2 -2
- package/es/components/code/code_block_controls.styles.js +2 -4
- package/es/components/code/code_block_full_screen.js +2 -2
- package/es/components/code/code_syntax.styles.js +39 -34
- package/es/components/comment_list/comment_event.js +3 -2
- package/es/components/comment_list/comment_event.styles.js +2 -18
- package/es/components/context_menu/context_menu.js +2 -6
- package/es/components/context_menu/context_menu_item.js +2 -14
- package/es/components/empty_prompt/empty_prompt.js +62 -65
- package/es/components/empty_prompt/empty_prompt.styles.js +115 -0
- package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +0 -10
- package/es/components/header/header_links/header_links.js +0 -10
- package/es/components/page/page_header/page_header_content.js +0 -10
- package/es/components/popover/popover.js +3 -15
- package/es/components/search_bar/search_bar.js +36 -32
- package/es/components/search_bar/search_bar.styles.js +22 -0
- package/es/components/text_truncate/text_truncate.js +4 -1
- package/es/components/tour/_tour_footer.js +97 -0
- package/es/components/tour/_tour_footer.styles.js +23 -0
- package/es/components/tour/_tour_header.js +37 -0
- package/es/components/tour/_tour_header.styles.js +20 -0
- package/es/components/tour/tour.styles.js +5 -28
- package/es/components/tour/tour_step.js +45 -130
- package/es/global_styling/mixins/_color.js +46 -13
- package/eui.d.ts +125 -66
- package/i18ntokens.json +94 -148
- package/lib/components/basic_table/basic_table.js +0 -9
- package/lib/components/basic_table/in_memory_table.js +0 -10
- package/lib/components/beacon/beacon.js +11 -6
- package/lib/components/breadcrumbs/breadcrumb.js +0 -10
- package/lib/components/code/code.js +2 -2
- package/lib/components/code/code.styles.js +2 -4
- package/lib/components/code/code_block.js +5 -3
- package/lib/components/code/code_block.styles.js +4 -7
- package/lib/components/code/code_block_controls.js +2 -2
- package/lib/components/code/code_block_controls.styles.js +2 -4
- package/lib/components/code/code_block_full_screen.js +2 -2
- package/lib/components/code/code_syntax.styles.js +40 -36
- package/lib/components/comment_list/comment_event.js +2 -1
- package/lib/components/comment_list/comment_event.styles.js +3 -20
- package/lib/components/context_menu/context_menu.js +2 -6
- package/lib/components/context_menu/context_menu_item.js +2 -14
- package/lib/components/empty_prompt/empty_prompt.js +64 -64
- package/lib/components/empty_prompt/empty_prompt.styles.js +120 -0
- package/lib/components/popover/popover.js +3 -15
- package/lib/components/search_bar/search_bar.js +37 -33
- package/lib/components/search_bar/search_bar.styles.js +30 -0
- package/lib/components/text_truncate/text_truncate.js +4 -1
- package/lib/components/tour/_tour_footer.js +105 -0
- package/lib/components/tour/_tour_footer.styles.js +31 -0
- package/lib/components/tour/_tour_header.js +48 -0
- package/lib/components/tour/_tour_header.styles.js +27 -0
- package/lib/components/tour/tour.styles.js +7 -32
- package/lib/components/tour/tour_step.js +42 -117
- package/lib/global_styling/mixins/_color.js +50 -15
- package/optimize/es/components/basic_table/basic_table.js +0 -9
- package/optimize/es/components/basic_table/in_memory_table.js +0 -10
- package/optimize/es/components/beacon/beacon.js +9 -6
- package/optimize/es/components/code/code.js +2 -2
- package/optimize/es/components/code/code.styles.js +2 -4
- package/optimize/es/components/code/code_block.js +5 -3
- package/optimize/es/components/code/code_block.styles.js +4 -7
- package/optimize/es/components/code/code_block_controls.js +2 -2
- package/optimize/es/components/code/code_block_controls.styles.js +2 -4
- package/optimize/es/components/code/code_block_full_screen.js +2 -2
- package/optimize/es/components/code/code_syntax.styles.js +39 -34
- package/optimize/es/components/comment_list/comment_event.js +3 -2
- package/optimize/es/components/comment_list/comment_event.styles.js +2 -18
- package/optimize/es/components/context_menu/context_menu.js +2 -6
- package/optimize/es/components/context_menu/context_menu_item.js +2 -6
- package/optimize/es/components/empty_prompt/empty_prompt.js +62 -62
- package/optimize/es/components/empty_prompt/empty_prompt.styles.js +112 -0
- package/optimize/es/components/popover/popover.js +3 -5
- package/optimize/es/components/search_bar/search_bar.js +36 -32
- package/optimize/es/components/search_bar/search_bar.styles.js +22 -0
- package/optimize/es/components/text_truncate/text_truncate.js +4 -1
- package/optimize/es/components/tour/_tour_footer.js +89 -0
- package/optimize/es/components/tour/_tour_footer.styles.js +23 -0
- package/optimize/es/components/tour/_tour_header.js +33 -0
- package/optimize/es/components/tour/_tour_header.styles.js +20 -0
- package/optimize/es/components/tour/tour.styles.js +5 -28
- package/optimize/es/components/tour/tour_step.js +45 -113
- package/optimize/es/global_styling/mixins/_color.js +46 -13
- package/optimize/lib/components/basic_table/basic_table.js +0 -9
- package/optimize/lib/components/basic_table/in_memory_table.js +0 -10
- package/optimize/lib/components/beacon/beacon.js +12 -6
- package/optimize/lib/components/code/code.js +2 -2
- package/optimize/lib/components/code/code.styles.js +2 -4
- package/optimize/lib/components/code/code_block.js +5 -3
- package/optimize/lib/components/code/code_block.styles.js +4 -7
- package/optimize/lib/components/code/code_block_controls.js +2 -2
- package/optimize/lib/components/code/code_block_controls.styles.js +2 -4
- package/optimize/lib/components/code/code_block_full_screen.js +2 -2
- package/optimize/lib/components/code/code_syntax.styles.js +40 -36
- package/optimize/lib/components/comment_list/comment_event.js +2 -1
- package/optimize/lib/components/comment_list/comment_event.styles.js +3 -20
- package/optimize/lib/components/context_menu/context_menu.js +2 -6
- package/optimize/lib/components/context_menu/context_menu_item.js +2 -6
- package/optimize/lib/components/empty_prompt/empty_prompt.js +65 -62
- package/optimize/lib/components/empty_prompt/empty_prompt.styles.js +118 -0
- package/optimize/lib/components/popover/popover.js +3 -5
- package/optimize/lib/components/search_bar/search_bar.js +37 -33
- package/optimize/lib/components/search_bar/search_bar.styles.js +30 -0
- package/optimize/lib/components/text_truncate/text_truncate.js +4 -1
- package/optimize/lib/components/tour/_tour_footer.js +100 -0
- package/optimize/lib/components/tour/_tour_footer.styles.js +31 -0
- package/optimize/lib/components/tour/_tour_header.js +43 -0
- package/optimize/lib/components/tour/_tour_header.styles.js +27 -0
- package/optimize/lib/components/tour/tour.styles.js +7 -32
- package/optimize/lib/components/tour/tour_step.js +42 -110
- package/optimize/lib/global_styling/mixins/_color.js +50 -15
- package/package.json +1 -1
- package/src/components/index.scss +0 -2
- package/test-env/components/basic_table/basic_table.js +0 -9
- package/test-env/components/basic_table/in_memory_table.js +0 -10
- package/test-env/components/beacon/beacon.js +12 -6
- package/test-env/components/breadcrumbs/breadcrumb.js +0 -10
- package/test-env/components/code/code.styles.js +2 -4
- package/test-env/components/code/code_block.styles.js +4 -7
- package/test-env/components/code/code_block_controls.js +2 -2
- package/test-env/components/code/code_block_controls.styles.js +2 -4
- package/test-env/components/code/code_block_full_screen.js +2 -2
- package/test-env/components/code/code_syntax.styles.js +40 -36
- package/test-env/components/comment_list/comment_event.js +2 -1
- package/test-env/components/comment_list/comment_event.styles.js +3 -20
- package/test-env/components/context_menu/context_menu.js +2 -6
- package/test-env/components/context_menu/context_menu_item.js +2 -14
- package/test-env/components/empty_prompt/empty_prompt.js +65 -62
- package/test-env/components/empty_prompt/empty_prompt.styles.js +118 -0
- package/test-env/components/popover/popover.js +3 -15
- package/test-env/components/search_bar/search_bar.js +37 -33
- package/test-env/components/search_bar/search_bar.styles.js +30 -0
- package/test-env/components/text_truncate/text_truncate.js +4 -1
- package/test-env/components/tour/_tour_footer.js +100 -0
- package/test-env/components/tour/_tour_footer.styles.js +31 -0
- package/test-env/components/tour/_tour_header.js +48 -0
- package/test-env/components/tour/_tour_header.styles.js +27 -0
- package/test-env/components/tour/tour.styles.js +7 -32
- package/test-env/components/tour/tour_step.js +42 -114
- package/test-env/global_styling/mixins/_color.js +50 -15
- package/src/components/empty_prompt/_empty_prompt.scss +0 -128
- package/src/components/empty_prompt/_index.scss +0 -1
- package/src/components/search_bar/_index.scss +0 -1
- package/src/components/search_bar/_search_bar.scss +0 -10
|
@@ -8,17 +8,15 @@ exports.EuiTourStep = void 0;
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
var _global_styling = require("../../global_styling");
|
|
11
12
|
var _beacon = require("../beacon");
|
|
12
|
-
var _button = require("../button");
|
|
13
|
-
var _flex = require("../flex");
|
|
14
|
-
var _i18n = require("../i18n");
|
|
15
13
|
var _popover = require("../popover");
|
|
16
|
-
var _title = require("../title");
|
|
17
|
-
var _tour_step_indicator = require("./tour_step_indicator");
|
|
18
14
|
var _services = require("../../services");
|
|
15
|
+
var _tour_header = require("./_tour_header");
|
|
16
|
+
var _tour_footer = require("./_tour_footer");
|
|
19
17
|
var _tour = require("./tour.styles");
|
|
20
18
|
var _react2 = require("@emotion/react");
|
|
21
|
-
var _excluded = ["anchorPosition", "anchor", "children", "className", "css", "closePopover", "content", "isStepOpen", "minWidth", "maxWidth", "onFinish", "step", "stepsTotal", "
|
|
19
|
+
var _excluded = ["anchorPosition", "anchor", "children", "className", "css", "closePopover", "content", "isStepOpen", "minWidth", "maxWidth", "onFinish", "step", "stepsTotal", "subtitle", "title", "decoration", "footerAction", "panelProps", "panelClassName"];
|
|
22
20
|
/*
|
|
23
21
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
24
22
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -29,16 +27,12 @@ var _excluded = ["anchorPosition", "anchor", "children", "className", "css", "cl
|
|
|
29
27
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
30
28
|
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); }
|
|
31
29
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
30
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
32
31
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
33
32
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
34
33
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
35
34
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
36
35
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
37
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
38
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
39
|
-
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."); }
|
|
40
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
41
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
42
36
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
43
37
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
44
38
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -67,17 +61,17 @@ var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
67
61
|
_ref$step = _ref.step,
|
|
68
62
|
step = _ref$step === void 0 ? 1 : _ref$step,
|
|
69
63
|
stepsTotal = _ref.stepsTotal,
|
|
70
|
-
style = _ref.style,
|
|
71
64
|
subtitle = _ref.subtitle,
|
|
72
65
|
title = _ref.title,
|
|
73
66
|
_ref$decoration = _ref.decoration,
|
|
74
67
|
decoration = _ref$decoration === void 0 ? 'beacon' : _ref$decoration,
|
|
75
68
|
footerAction = _ref.footerAction,
|
|
76
69
|
panelProps = _ref.panelProps,
|
|
70
|
+
panelClassName = _ref.panelClassName,
|
|
77
71
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
78
72
|
var titleId = (0, _services.useGeneratedHtmlId)();
|
|
79
73
|
if (step === 0) {
|
|
80
|
-
console.warn('EuiTourStep `step` should 1-based indexing. Please update to eliminate 0 indexes.');
|
|
74
|
+
console.warn('EuiTourStep `step` should use 1-based indexing. Please update to eliminate 0 indexes.');
|
|
81
75
|
}
|
|
82
76
|
var _useState = (0, _react.useState)(null),
|
|
83
77
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -87,11 +81,10 @@ var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
87
81
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
88
82
|
popoverPosition = _useState4[0],
|
|
89
83
|
setPopoverPosition = _useState4[1];
|
|
90
|
-
var onPositionChange = function
|
|
84
|
+
var onPositionChange = (0, _react.useCallback)(function (position) {
|
|
91
85
|
setPopoverPosition(position);
|
|
92
|
-
};
|
|
86
|
+
}, []);
|
|
93
87
|
(0, _react.useEffect)(function () {
|
|
94
|
-
var timeout;
|
|
95
88
|
if (anchor) {
|
|
96
89
|
// Wait until next tick to find anchor node in case it's not already
|
|
97
90
|
// in DOM requestAnimationFrame isn't used here because we don't need to
|
|
@@ -99,126 +92,62 @@ var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
99
92
|
// needs to go through a react DOM rerender which may take more than
|
|
100
93
|
// 1 frame (16ms) of time.
|
|
101
94
|
// TODO: It would be ideal to have some kind of intersection observer here instead
|
|
102
|
-
timeout = window.setTimeout(function () {
|
|
95
|
+
var timeout = window.setTimeout(function () {
|
|
103
96
|
setAnchorNode((0, _services.findElementBySelectorOrRef)(anchor));
|
|
104
97
|
});
|
|
98
|
+
return function () {
|
|
99
|
+
return window.clearTimeout(timeout);
|
|
100
|
+
};
|
|
105
101
|
}
|
|
106
|
-
return function () {
|
|
107
|
-
timeout && window.clearTimeout(timeout);
|
|
108
|
-
};
|
|
109
102
|
}, [anchor]);
|
|
110
|
-
var
|
|
103
|
+
var anchorClasses = (0, _classnames.default)('euiTourAnchor', className);
|
|
104
|
+
var popoverClasses = (0, _classnames.default)('euiTour', panelClassName);
|
|
111
105
|
var euiTheme = (0, _services.useEuiTheme)();
|
|
112
106
|
var tourStyles = (0, _tour.euiTourStyles)(euiTheme);
|
|
113
|
-
var headerStyles = (0, _tour.euiTourHeaderStyles)(euiTheme);
|
|
114
|
-
var footerStyles = (0, _tour.euiTourFooterStyles)(euiTheme);
|
|
115
107
|
var beaconStyles = (0, _tour.euiTourBeaconStyles)(euiTheme);
|
|
116
108
|
var beaconCss = [beaconStyles.euiTourBeacon, isStepOpen && beaconStyles.isOpen, popoverPosition && beaconStyles[popoverPosition]];
|
|
117
|
-
var finishButtonProps = {
|
|
118
|
-
color: 'text',
|
|
119
|
-
flush: 'right',
|
|
120
|
-
size: 'xs'
|
|
121
|
-
};
|
|
122
|
-
var optionalFooterAction = Array.isArray(footerAction) ? (0, _react2.jsx)(_flex.EuiFlexGroup, {
|
|
123
|
-
gutterSize: "s",
|
|
124
|
-
alignItems: "center",
|
|
125
|
-
justifyContent: "flexEnd",
|
|
126
|
-
responsive: false,
|
|
127
|
-
wrap: true
|
|
128
|
-
}, footerAction.map(function (action, index) {
|
|
129
|
-
return (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
130
|
-
key: index,
|
|
131
|
-
grow: false
|
|
132
|
-
}, action);
|
|
133
|
-
})) : (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
134
|
-
grow: false
|
|
135
|
-
}, footerAction);
|
|
136
|
-
var footer = (0, _react2.jsx)(_flex.EuiFlexGroup, {
|
|
137
|
-
responsive: false,
|
|
138
|
-
justifyContent: stepsTotal > 1 ? 'spaceBetween' : 'flexEnd',
|
|
139
|
-
alignItems: "center"
|
|
140
|
-
}, stepsTotal > 1 && (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
141
|
-
grow: false
|
|
142
|
-
}, (0, _react2.jsx)("ul", {
|
|
143
|
-
className: "euiTourFooter__stepList"
|
|
144
|
-
}, _toConsumableArray(Array(stepsTotal).keys()).map(function (_, i) {
|
|
145
|
-
var status = 'complete';
|
|
146
|
-
if (step === i + 1) {
|
|
147
|
-
status = 'active';
|
|
148
|
-
} else if (step <= i) {
|
|
149
|
-
status = 'incomplete';
|
|
150
|
-
}
|
|
151
|
-
return (0, _react2.jsx)(_tour_step_indicator.EuiTourStepIndicator, {
|
|
152
|
-
key: i,
|
|
153
|
-
number: i + 1,
|
|
154
|
-
status: status
|
|
155
|
-
});
|
|
156
|
-
}))), footerAction ? optionalFooterAction : (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
157
|
-
grow: false
|
|
158
|
-
}, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
159
|
-
tokens: ['euiTourStep.endTour', 'euiTourStep.skipTour', 'euiTourStep.closeTour'],
|
|
160
|
-
defaults: ['End tour', 'Skip tour', 'Close tour']
|
|
161
|
-
}, function (_ref2) {
|
|
162
|
-
var _ref3 = _slicedToArray(_ref2, 3),
|
|
163
|
-
endTour = _ref3[0],
|
|
164
|
-
skipTour = _ref3[1],
|
|
165
|
-
closeTour = _ref3[2];
|
|
166
|
-
var content = closeTour;
|
|
167
|
-
if (stepsTotal > 1) {
|
|
168
|
-
content = stepsTotal === step ? endTour : skipTour;
|
|
169
|
-
}
|
|
170
|
-
return (0, _react2.jsx)(_button.EuiButtonEmpty, _extends({
|
|
171
|
-
onClick: onFinish
|
|
172
|
-
}, finishButtonProps), content);
|
|
173
|
-
})));
|
|
174
109
|
var hasBeacon = decoration === 'beacon';
|
|
175
|
-
var
|
|
110
|
+
var widthStyles = (0, _react.useMemo)(function () {
|
|
111
|
+
return (0, _global_styling.logicalStyles)({
|
|
112
|
+
minWidth: minWidth,
|
|
113
|
+
maxWidth: maxWidth
|
|
114
|
+
});
|
|
115
|
+
}, [minWidth, maxWidth]);
|
|
116
|
+
var noAnchor = !anchor && children;
|
|
117
|
+
var PopoverComponent = noAnchor ? _popover.EuiPopover : _popover.EuiWrappingPopover;
|
|
118
|
+
var button = noAnchor ? children : anchorNode;
|
|
119
|
+
return button ? (0, _react2.jsx)(PopoverComponent, _extends({
|
|
120
|
+
button: button,
|
|
121
|
+
className: anchorClasses,
|
|
176
122
|
anchorPosition: anchorPosition,
|
|
177
123
|
closePopover: closePopover,
|
|
178
124
|
isOpen: isStepOpen,
|
|
179
125
|
ownFocus: false,
|
|
180
|
-
panelClassName:
|
|
181
|
-
panelStyle: style,
|
|
126
|
+
panelClassName: popoverClasses,
|
|
182
127
|
panelProps: _objectSpread(_objectSpread({}, panelProps), {}, {
|
|
183
128
|
css: [tourStyles.euiTour, css, panelProps === null || panelProps === void 0 ? void 0 : panelProps.css]
|
|
184
129
|
}),
|
|
185
130
|
offset: hasBeacon ? 10 : 0,
|
|
186
|
-
|
|
131
|
+
"aria-labelledby": titleId,
|
|
187
132
|
arrowChildren: hasBeacon && (0, _react2.jsx)(_beacon.EuiBeacon, {
|
|
188
133
|
css: beaconCss,
|
|
189
134
|
className: "euiTour__beacon"
|
|
190
135
|
}),
|
|
191
136
|
onPositionChange: onPositionChange
|
|
192
|
-
}, rest)
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}, (0, _react2.jsx)(
|
|
199
|
-
css: headerStyles.euiTourHeader,
|
|
200
|
-
className: "euiTourHeader",
|
|
201
|
-
id: titleId
|
|
202
|
-
}, subtitle && (0, _react2.jsx)(_title.EuiTitle, {
|
|
203
|
-
css: headerStyles.euiTourHeader__subtitle,
|
|
204
|
-
size: "xxxs"
|
|
205
|
-
}, (0, _react2.jsx)("h2", null, subtitle)), (0, _react2.jsx)(_title.EuiTitle, {
|
|
206
|
-
css: headerStyles.euiTourHeader__title,
|
|
207
|
-
size: "xxs"
|
|
208
|
-
}, subtitle ? (0, _react2.jsx)("h3", null, title) : (0, _react2.jsx)("h2", null, title))), (0, _react2.jsx)("div", {
|
|
137
|
+
}, rest), (0, _react2.jsx)("div", {
|
|
138
|
+
style: widthStyles
|
|
139
|
+
}, (0, _react2.jsx)(_tour_header.EuiTourHeader, {
|
|
140
|
+
id: titleId,
|
|
141
|
+
title: title,
|
|
142
|
+
subtitle: subtitle
|
|
143
|
+
}), (0, _react2.jsx)("div", {
|
|
209
144
|
className: "euiTour__content"
|
|
210
|
-
}, content), (0, _react2.jsx)(
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
button: children
|
|
217
|
-
}, popoverProps), layout);
|
|
218
|
-
}
|
|
219
|
-
return anchorNode ? (0, _react2.jsx)(_popover.EuiWrappingPopover, _extends({
|
|
220
|
-
button: anchorNode
|
|
221
|
-
}, popoverProps), layout) : null;
|
|
145
|
+
}, content), (0, _react2.jsx)(_tour_footer.EuiTourFooter, {
|
|
146
|
+
footerAction: footerAction,
|
|
147
|
+
step: step,
|
|
148
|
+
stepsTotal: stepsTotal,
|
|
149
|
+
onFinish: onFinish
|
|
150
|
+
}))) : null;
|
|
222
151
|
};
|
|
223
152
|
exports.EuiTourStep = EuiTourStep;
|
|
224
153
|
EuiTourStep.propTypes = {
|
|
@@ -259,10 +188,6 @@ EuiTourStep.propTypes = {
|
|
|
259
188
|
* The total number of steps in the tour
|
|
260
189
|
*/
|
|
261
190
|
stepsTotal: _propTypes.default.number.isRequired,
|
|
262
|
-
/**
|
|
263
|
-
* Optional, standard DOM `style` attribute. Passed to the EuiPopover panel.
|
|
264
|
-
*/
|
|
265
|
-
style: _propTypes.default.any,
|
|
266
191
|
/**
|
|
267
192
|
* Smaller title text that appears atop each step in the tour. The subtitle gets wrapped in the appropriate heading level.
|
|
268
193
|
*/
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useEuiBackgroundColorCSS = exports.useEuiBackgroundColor = exports.euiBackgroundColor = exports.BACKGROUND_COLORS = void 0;
|
|
7
|
-
var _react = require("
|
|
6
|
+
exports.useEuiBorderColorCSS = exports.useEuiBackgroundColorCSS = exports.useEuiBackgroundColor = exports.euiBorderColor = exports.euiBackgroundColor = exports.BACKGROUND_COLORS = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _react2 = require("@emotion/react");
|
|
8
9
|
var _services = require("../../services");
|
|
9
10
|
/*
|
|
10
11
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -31,7 +32,7 @@ var euiBackgroundColor = function euiBackgroundColor(_ref, color) {
|
|
|
31
32
|
return (0, _services.transparentize)(euiTheme.colors[color], 0.1);
|
|
32
33
|
}
|
|
33
34
|
} else {
|
|
34
|
-
var
|
|
35
|
+
var _tintOrShade = function _tintOrShade(color) {
|
|
35
36
|
return colorMode === 'DARK' ? (0, _services.shade)(color, 0.8) : (0, _services.tint)(color, 0.9);
|
|
36
37
|
};
|
|
37
38
|
switch (color) {
|
|
@@ -40,7 +41,7 @@ var euiBackgroundColor = function euiBackgroundColor(_ref, color) {
|
|
|
40
41
|
case 'subdued':
|
|
41
42
|
return euiTheme.colors.body;
|
|
42
43
|
default:
|
|
43
|
-
return
|
|
44
|
+
return _tintOrShade(euiTheme.colors[color]);
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
};
|
|
@@ -55,15 +56,49 @@ var useEuiBackgroundColor = function useEuiBackgroundColor(color) {
|
|
|
55
56
|
};
|
|
56
57
|
exports.useEuiBackgroundColor = useEuiBackgroundColor;
|
|
57
58
|
var useEuiBackgroundColorCSS = function useEuiBackgroundColorCSS() {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
59
|
+
var euiThemeContext = (0, _services.useEuiTheme)();
|
|
60
|
+
return (0, _react.useMemo)(function () {
|
|
61
|
+
return {
|
|
62
|
+
transparent: /*#__PURE__*/(0, _react2.css)("background-color:", euiBackgroundColor(euiThemeContext, 'transparent'), ";;label:transparent;"),
|
|
63
|
+
plain: /*#__PURE__*/(0, _react2.css)("background-color:", euiBackgroundColor(euiThemeContext, 'plain'), ";;label:plain;"),
|
|
64
|
+
subdued: /*#__PURE__*/(0, _react2.css)("background-color:", euiBackgroundColor(euiThemeContext, 'subdued'), ";;label:subdued;"),
|
|
65
|
+
accent: /*#__PURE__*/(0, _react2.css)("background-color:", euiBackgroundColor(euiThemeContext, 'accent'), ";;label:accent;"),
|
|
66
|
+
primary: /*#__PURE__*/(0, _react2.css)("background-color:", euiBackgroundColor(euiThemeContext, 'primary'), ";;label:primary;"),
|
|
67
|
+
success: /*#__PURE__*/(0, _react2.css)("background-color:", euiBackgroundColor(euiThemeContext, 'success'), ";;label:success;"),
|
|
68
|
+
warning: /*#__PURE__*/(0, _react2.css)("background-color:", euiBackgroundColor(euiThemeContext, 'warning'), ";;label:warning;"),
|
|
69
|
+
danger: /*#__PURE__*/(0, _react2.css)("background-color:", euiBackgroundColor(euiThemeContext, 'danger'), ";;label:danger;")
|
|
70
|
+
};
|
|
71
|
+
}, [euiThemeContext]);
|
|
72
|
+
};
|
|
73
|
+
exports.useEuiBackgroundColorCSS = useEuiBackgroundColorCSS;
|
|
74
|
+
var euiBorderColor = function euiBorderColor(_ref4, color) {
|
|
75
|
+
var euiTheme = _ref4.euiTheme,
|
|
76
|
+
colorMode = _ref4.colorMode;
|
|
77
|
+
switch (color) {
|
|
78
|
+
case 'transparent':
|
|
79
|
+
case 'plain':
|
|
80
|
+
case 'subdued':
|
|
81
|
+
return euiTheme.border.color;
|
|
82
|
+
case 'warning':
|
|
83
|
+
return (0, _services.tintOrShade)(euiTheme.colors.warning, 0.4, colorMode);
|
|
84
|
+
default:
|
|
85
|
+
return (0, _services.tintOrShade)(euiTheme.colors[color], 0.6, colorMode);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
exports.euiBorderColor = euiBorderColor;
|
|
89
|
+
var useEuiBorderColorCSS = function useEuiBorderColorCSS() {
|
|
90
|
+
var euiThemeContext = (0, _services.useEuiTheme)();
|
|
91
|
+
return (0, _react.useMemo)(function () {
|
|
92
|
+
return {
|
|
93
|
+
transparent: /*#__PURE__*/(0, _react2.css)("border-color:", euiBorderColor(euiThemeContext, 'transparent'), ";;label:transparent;"),
|
|
94
|
+
plain: /*#__PURE__*/(0, _react2.css)("border-color:", euiBorderColor(euiThemeContext, 'plain'), ";;label:plain;"),
|
|
95
|
+
subdued: /*#__PURE__*/(0, _react2.css)("border-color:", euiBorderColor(euiThemeContext, 'subdued'), ";;label:subdued;"),
|
|
96
|
+
accent: /*#__PURE__*/(0, _react2.css)("border-color:", euiBorderColor(euiThemeContext, 'accent'), ";;label:accent;"),
|
|
97
|
+
primary: /*#__PURE__*/(0, _react2.css)("border-color:", euiBorderColor(euiThemeContext, 'primary'), ";;label:primary;"),
|
|
98
|
+
success: /*#__PURE__*/(0, _react2.css)("border-color:", euiBorderColor(euiThemeContext, 'success'), ";;label:success;"),
|
|
99
|
+
warning: /*#__PURE__*/(0, _react2.css)("border-color:", euiBorderColor(euiThemeContext, 'warning'), ";;label:warning;"),
|
|
100
|
+
danger: /*#__PURE__*/(0, _react2.css)("border-color:", euiBorderColor(euiThemeContext, 'danger'), ";;label:danger;")
|
|
101
|
+
};
|
|
102
|
+
}, [euiThemeContext]);
|
|
68
103
|
};
|
|
69
|
-
exports.
|
|
104
|
+
exports.useEuiBorderColorCSS = useEuiBorderColorCSS;
|
|
@@ -235,15 +235,6 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
235
235
|
});
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
* @deprecated Use `selection.selected` instead to declaratively control table selection
|
|
241
|
-
*/
|
|
242
|
-
}, {
|
|
243
|
-
key: "setSelection",
|
|
244
|
-
value: function setSelection(newSelection) {
|
|
245
|
-
this.changeSelection(newSelection);
|
|
246
|
-
}
|
|
247
238
|
}, {
|
|
248
239
|
key: "buildCriteria",
|
|
249
240
|
value: function buildCriteria(props) {
|
|
@@ -118,7 +118,6 @@ export var EuiInMemoryTable = /*#__PURE__*/function (_Component) {
|
|
|
118
118
|
var _this;
|
|
119
119
|
_classCallCheck(this, EuiInMemoryTable);
|
|
120
120
|
_this = _super.call(this, props);
|
|
121
|
-
_defineProperty(_assertThisInitialized(_this), "tableRef", void 0);
|
|
122
121
|
_defineProperty(_assertThisInitialized(_this), "onTableChange", function (_ref4) {
|
|
123
122
|
var page = _ref4.page,
|
|
124
123
|
sort = _ref4.sort;
|
|
@@ -251,17 +250,9 @@ export var EuiInMemoryTable = /*#__PURE__*/function (_Component) {
|
|
|
251
250
|
allowNeutralSort: allowNeutralSort !== false,
|
|
252
251
|
showPerPageOptions: showPerPageOptions
|
|
253
252
|
};
|
|
254
|
-
_this.tableRef = /*#__PURE__*/React.createRef();
|
|
255
253
|
return _this;
|
|
256
254
|
}
|
|
257
255
|
_createClass(EuiInMemoryTable, [{
|
|
258
|
-
key: "setSelection",
|
|
259
|
-
value: function setSelection(newSelection) {
|
|
260
|
-
if (this.tableRef.current) {
|
|
261
|
-
this.tableRef.current.setSelection(newSelection);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}, {
|
|
265
256
|
key: "renderSearchBar",
|
|
266
257
|
value: function renderSearchBar() {
|
|
267
258
|
var _this$props = this.props,
|
|
@@ -430,7 +421,6 @@ export var EuiInMemoryTable = /*#__PURE__*/function (_Component) {
|
|
|
430
421
|
var table =
|
|
431
422
|
// @ts-ignore complex relationship between pagination's existence and criteria, the code logic ensures this is correctly maintained
|
|
432
423
|
___EmotionJSX(EuiBasicTable, _extends({
|
|
433
|
-
ref: this.tableRef,
|
|
434
424
|
items: items,
|
|
435
425
|
itemId: itemId,
|
|
436
426
|
rowProps: rowProps,
|
|
@@ -12,10 +12,11 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
12
12
|
* Side Public License, v 1.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import React from 'react';
|
|
15
|
+
import React, { useMemo } from 'react';
|
|
16
16
|
import classNames from 'classnames';
|
|
17
|
-
import {
|
|
17
|
+
import { logicalStyles } from '../../global_styling';
|
|
18
18
|
import { useEuiTheme } from '../../services';
|
|
19
|
+
import { euiBeaconStyles } from './beacon.styles';
|
|
19
20
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
20
21
|
export var COLORS = ['subdued', 'primary', 'success', 'accent', 'danger', 'warning'];
|
|
21
22
|
export var EuiBeacon = function EuiBeacon(_ref) {
|
|
@@ -30,10 +31,12 @@ export var EuiBeacon = function EuiBeacon(_ref) {
|
|
|
30
31
|
var classes = classNames('euiBeacon', className);
|
|
31
32
|
var styles = euiBeaconStyles(euiTheme);
|
|
32
33
|
var cssStyles = [styles.euiBeacon, styles[color]];
|
|
33
|
-
var beaconStyle =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
var beaconStyle = useMemo(function () {
|
|
35
|
+
return logicalStyles(_objectSpread(_objectSpread({}, style), {}, {
|
|
36
|
+
height: size,
|
|
37
|
+
width: size
|
|
38
|
+
}));
|
|
39
|
+
}, [style, size]);
|
|
37
40
|
return ___EmotionJSX("div", _extends({
|
|
38
41
|
className: classes,
|
|
39
42
|
css: cssStyles,
|
|
@@ -14,6 +14,7 @@ import { highlight } from 'refractor';
|
|
|
14
14
|
import classNames from 'classnames';
|
|
15
15
|
import { DEFAULT_LANGUAGE, checkSupportedLanguage, getHtmlContent } from './utils';
|
|
16
16
|
import { useEuiTheme } from '../../services';
|
|
17
|
+
import { useEuiCodeSyntaxVariables } from './code_syntax.styles';
|
|
17
18
|
import { euiCodeStyles } from './code.styles';
|
|
18
19
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
19
20
|
export var EuiCode = function EuiCode(_ref) {
|
|
@@ -37,8 +38,7 @@ export var EuiCode = function EuiCode(_ref) {
|
|
|
37
38
|
return getHtmlContent(data, children);
|
|
38
39
|
}, [data, children]);
|
|
39
40
|
var classes = classNames('euiCode', className);
|
|
40
|
-
var
|
|
41
|
-
var styles = euiCodeStyles(euiTheme);
|
|
41
|
+
var styles = euiCodeStyles(useEuiTheme(), useEuiCodeSyntaxVariables());
|
|
42
42
|
var cssStyles = [styles.euiCode, transparentBackground && styles.transparentBackground];
|
|
43
43
|
return ___EmotionJSX("code", _extends({
|
|
44
44
|
className: classes,
|
|
@@ -9,7 +9,6 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
9
9
|
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
11
|
import { logicalShorthandCSS } from '../../global_styling';
|
|
12
|
-
import { euiCodeSyntaxColors, euiCodeSyntaxTokens } from './code_syntax.styles';
|
|
13
12
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
14
13
|
name: "gfiv3z-transparentBackground",
|
|
15
14
|
styles: "background:transparent;label:transparentBackground;"
|
|
@@ -18,14 +17,13 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
18
17
|
styles: "background:transparent;label:transparentBackground;",
|
|
19
18
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
20
19
|
};
|
|
21
|
-
export var euiCodeStyles = function euiCodeStyles(euiThemeContext) {
|
|
20
|
+
export var euiCodeStyles = function euiCodeStyles(euiThemeContext, euiCodeSyntaxVariables) {
|
|
22
21
|
var euiTheme = euiThemeContext.euiTheme;
|
|
23
|
-
var euiCodeSyntax = euiCodeSyntaxColors(euiThemeContext);
|
|
24
22
|
return {
|
|
25
23
|
/*
|
|
26
24
|
* 1. Size the code against the text its embedded within.
|
|
27
25
|
*/
|
|
28
|
-
euiCode: /*#__PURE__*/css("font-family:", euiTheme.font.familyCode, ";font-size:0.9em;", logicalShorthandCSS('padding', '0.2em 0.5em'), "background:",
|
|
26
|
+
euiCode: /*#__PURE__*/css("font-family:", euiTheme.font.familyCode, ";font-size:0.9em;", logicalShorthandCSS('padding', '0.2em 0.5em'), "background:", euiCodeSyntaxVariables.backgroundColor, ";border-radius:", euiTheme.border.radius.small, ";font-weight:", euiTheme.font.weight.bold, ";color:", euiCodeSyntaxVariables.inlineCodeColor, ";", euiCodeSyntaxVariables.tokensCss, ";;label:euiCode;"),
|
|
29
27
|
transparentBackground: _ref
|
|
30
28
|
};
|
|
31
29
|
};
|
|
@@ -24,6 +24,7 @@ import { useFullScreen, EuiCodeBlockFullScreenWrapper } from './code_block_full_
|
|
|
24
24
|
import { EuiCodeBlockControls } from './code_block_controls';
|
|
25
25
|
import { EuiCodeBlockVirtualized } from './code_block_virtualized';
|
|
26
26
|
import { euiCodeBlockStyles, euiCodeBlockPreStyles, euiCodeBlockCodeStyles } from './code_block.styles';
|
|
27
|
+
import { useEuiCodeSyntaxVariables } from './code_syntax.styles';
|
|
27
28
|
|
|
28
29
|
// Based on observed line height for non-virtualized code blocks
|
|
29
30
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
@@ -58,6 +59,7 @@ export var EuiCodeBlock = function EuiCodeBlock(_ref) {
|
|
|
58
59
|
lineNumbers = _ref$lineNumbers === void 0 ? false : _ref$lineNumbers,
|
|
59
60
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
60
61
|
var euiTheme = useEuiTheme();
|
|
62
|
+
var euiCodeSyntaxVariables = useEuiCodeSyntaxVariables();
|
|
61
63
|
var language = useMemo(function () {
|
|
62
64
|
return checkSupportedLanguage(_language);
|
|
63
65
|
}, [_language]);
|
|
@@ -109,7 +111,7 @@ export var EuiCodeBlock = function EuiCodeBlock(_ref) {
|
|
|
109
111
|
onKeyDown = _useFullScreen.onKeyDown;
|
|
110
112
|
var hasControls = !!(copyButton || fullScreenButton);
|
|
111
113
|
var hasBothControls = !!(copyButton && fullScreenButton);
|
|
112
|
-
var styles = euiCodeBlockStyles(euiTheme);
|
|
114
|
+
var styles = euiCodeBlockStyles(euiTheme, euiCodeSyntaxVariables);
|
|
113
115
|
var cssStyles = [styles.euiCodeBlock, styles[fontSize], transparentBackground && styles.transparentBackground, hasControls && (hasBothControls ? styles.hasBothControls[paddingSize] : styles.hasControls[paddingSize])];
|
|
114
116
|
var _useMemo = useMemo(function () {
|
|
115
117
|
var isWhiteSpacePre = whiteSpace === 'pre' || isVirtualized;
|
|
@@ -134,14 +136,14 @@ export var EuiCodeBlock = function EuiCodeBlock(_ref) {
|
|
|
134
136
|
preProps = _useMemo2[0],
|
|
135
137
|
preFullscreenProps = _useMemo2[1];
|
|
136
138
|
var codeProps = useMemo(function () {
|
|
137
|
-
var styles = euiCodeBlockCodeStyles(euiTheme);
|
|
139
|
+
var styles = euiCodeBlockCodeStyles(euiTheme, euiCodeSyntaxVariables);
|
|
138
140
|
var cssStyles = [styles.euiCodeBlock__code, isVirtualized && styles.isVirtualized];
|
|
139
141
|
return _objectSpread({
|
|
140
142
|
className: 'euiCodeBlock__code',
|
|
141
143
|
css: cssStyles,
|
|
142
144
|
'data-code-language': language
|
|
143
145
|
}, rest);
|
|
144
|
-
}, [language, euiTheme, isVirtualized, rest]);
|
|
146
|
+
}, [language, euiTheme, euiCodeSyntaxVariables, isVirtualized, rest]);
|
|
145
147
|
return ___EmotionJSX("div", {
|
|
146
148
|
css: cssStyles,
|
|
147
149
|
className: classNames('euiCodeBlock', className),
|
|
@@ -19,7 +19,6 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
19
19
|
|
|
20
20
|
import { css } from '@emotion/react';
|
|
21
21
|
import { euiPaddingSize, euiFontSize, euiScrollBarStyles, mathWithUnits } from '../../global_styling';
|
|
22
|
-
import { euiCodeSyntaxColors, euiCodeSyntaxTokens } from './code_syntax.styles';
|
|
23
22
|
var _ref4 = process.env.NODE_ENV === "production" ? {
|
|
24
23
|
name: "i92zwx-isFullScreen",
|
|
25
24
|
styles: "position:fixed;inset:0;label:isFullScreen;"
|
|
@@ -36,11 +35,10 @@ var _ref5 = process.env.NODE_ENV === "production" ? {
|
|
|
36
35
|
styles: "background:transparent;label:transparentBackground;",
|
|
37
36
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
38
37
|
};
|
|
39
|
-
export var euiCodeBlockStyles = function euiCodeBlockStyles(euiThemeContext) {
|
|
38
|
+
export var euiCodeBlockStyles = function euiCodeBlockStyles(euiThemeContext, euiCodeSyntaxVariables) {
|
|
40
39
|
var euiTheme = euiThemeContext.euiTheme;
|
|
41
|
-
var euiCodeSyntax = euiCodeSyntaxColors(euiThemeContext);
|
|
42
40
|
return {
|
|
43
|
-
euiCodeBlock: /*#__PURE__*/css("max-inline-size:100%;display:block;position:relative;background:",
|
|
41
|
+
euiCodeBlock: /*#__PURE__*/css("max-inline-size:100%;display:block;position:relative;background:", euiCodeSyntaxVariables.backgroundColor, ";", euiCodeSyntaxVariables.tokensCss, ";;label:euiCodeBlock;"),
|
|
44
42
|
// Font size
|
|
45
43
|
s: /*#__PURE__*/css(euiFontSize(euiThemeContext, 'xs'), ";;label:s;"),
|
|
46
44
|
m: /*#__PURE__*/css(euiFontSize(euiThemeContext, 's'), ";;label:m;"),
|
|
@@ -112,11 +110,10 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
112
110
|
styles: "position:relative;label:isVirtualized;",
|
|
113
111
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
114
112
|
};
|
|
115
|
-
export var euiCodeBlockCodeStyles = function euiCodeBlockCodeStyles(euiThemeContext) {
|
|
113
|
+
export var euiCodeBlockCodeStyles = function euiCodeBlockCodeStyles(euiThemeContext, euiCodeSyntaxVariables) {
|
|
116
114
|
var euiTheme = euiThemeContext.euiTheme;
|
|
117
|
-
var euiCodeSyntax = euiCodeSyntaxColors(euiThemeContext);
|
|
118
115
|
return {
|
|
119
|
-
euiCodeBlock__code: /*#__PURE__*/css("font-family:", euiTheme.font.familyCode, ";font-size:inherit;color:",
|
|
116
|
+
euiCodeBlock__code: /*#__PURE__*/css("font-family:", euiTheme.font.familyCode, ";font-size:inherit;color:", euiCodeSyntaxVariables.color, ";display:block;;label:euiCodeBlock__code;"),
|
|
120
117
|
isVirtualized: _ref
|
|
121
118
|
};
|
|
122
119
|
};
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
|
|
9
9
|
import React, { Fragment } from 'react';
|
|
10
10
|
import { useEuiTheme } from '../../services';
|
|
11
|
+
import { useEuiCodeSyntaxVariables } from './code_syntax.styles';
|
|
11
12
|
import { euiCodeBlockControlsStyles } from './code_block_controls.styles';
|
|
12
13
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
13
14
|
export var EuiCodeBlockControls = function EuiCodeBlockControls(_ref) {
|
|
14
15
|
var paddingSize = _ref.paddingSize,
|
|
15
16
|
controls = _ref.controls;
|
|
16
|
-
var
|
|
17
|
-
var styles = euiCodeBlockControlsStyles(euiTheme);
|
|
17
|
+
var styles = euiCodeBlockControlsStyles(useEuiTheme(), useEuiCodeSyntaxVariables());
|
|
18
18
|
var cssStyles = [styles.euiCodeBlock__controls, styles.offset[paddingSize]];
|
|
19
19
|
var hasControls = controls.some(function (control) {
|
|
20
20
|
return !!control;
|
|
@@ -16,7 +16,6 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
16
16
|
|
|
17
17
|
import { css } from '@emotion/react';
|
|
18
18
|
import { euiPaddingSize } from '../../global_styling';
|
|
19
|
-
import { euiCodeSyntaxColors } from './code_syntax.styles';
|
|
20
19
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
21
20
|
name: "to86kv-none",
|
|
22
21
|
styles: "inset-block-start:0;inset-inline-end:0;label:none;"
|
|
@@ -25,11 +24,10 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
25
24
|
styles: "inset-block-start:0;inset-inline-end:0;label:none;",
|
|
26
25
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
27
26
|
};
|
|
28
|
-
export var euiCodeBlockControlsStyles = function euiCodeBlockControlsStyles(euiThemeContext) {
|
|
27
|
+
export var euiCodeBlockControlsStyles = function euiCodeBlockControlsStyles(euiThemeContext, euiCodeSyntaxVariables) {
|
|
29
28
|
var euiTheme = euiThemeContext.euiTheme;
|
|
30
|
-
var euiCodeSyntax = euiCodeSyntaxColors(euiThemeContext);
|
|
31
29
|
return {
|
|
32
|
-
euiCodeBlock__controls: /*#__PURE__*/css("position:absolute;display:flex;flex-direction:column;gap:", euiTheme.size.xs, ";background:",
|
|
30
|
+
euiCodeBlock__controls: /*#__PURE__*/css("position:absolute;display:flex;flex-direction:column;gap:", euiTheme.size.xs, ";background:", euiCodeSyntaxVariables.backgroundColor, ";;label:euiCodeBlock__controls;"),
|
|
33
31
|
offset: {
|
|
34
32
|
none: _ref,
|
|
35
33
|
s: /*#__PURE__*/css("inset-block-start:", euiPaddingSize(euiThemeContext, 's'), ";inset-inline-end:", euiPaddingSize(euiThemeContext, 's'), ";;label:s;"),
|
|
@@ -13,6 +13,7 @@ import { useEuiI18n } from '../i18n';
|
|
|
13
13
|
import { EuiButtonIcon } from '../button';
|
|
14
14
|
import { EuiFocusTrap } from '../focus_trap';
|
|
15
15
|
import { EuiOverlayMask } from '../overlay_mask';
|
|
16
|
+
import { useEuiCodeSyntaxVariables } from './code_syntax.styles';
|
|
16
17
|
import { euiCodeBlockStyles } from './code_block.styles';
|
|
17
18
|
|
|
18
19
|
/**
|
|
@@ -68,8 +69,7 @@ export var useFullScreen = function useFullScreen(_ref) {
|
|
|
68
69
|
*/
|
|
69
70
|
export var EuiCodeBlockFullScreenWrapper = function EuiCodeBlockFullScreenWrapper(_ref2) {
|
|
70
71
|
var children = _ref2.children;
|
|
71
|
-
var
|
|
72
|
-
var styles = euiCodeBlockStyles(euiThemeContext);
|
|
72
|
+
var styles = euiCodeBlockStyles(useEuiTheme(), useEuiCodeSyntaxVariables());
|
|
73
73
|
var cssStyles = [styles.euiCodeBlock, styles.l,
|
|
74
74
|
// Force fullscreen to use large font
|
|
75
75
|
styles.isFullScreen];
|