@elastic/eui 91.3.1 → 92.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.
Files changed (160) hide show
  1. package/dist/eui_charts_theme.js.map +1 -1
  2. package/dist/eui_theme_dark.css +0 -513
  3. package/dist/eui_theme_dark.min.css +1 -1
  4. package/dist/eui_theme_light.css +0 -513
  5. package/dist/eui_theme_light.min.css +1 -1
  6. package/es/components/basic_table/basic_table.js +5 -5
  7. package/es/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
  8. package/es/components/filter_group/filter_button.js +20 -13
  9. package/es/components/filter_group/filter_button.styles.js +11 -20
  10. package/es/components/flyout/flyout.js +4 -4
  11. package/es/components/flyout/flyout_resizable.js +127 -0
  12. package/es/components/flyout/flyout_resizable.styles.js +27 -0
  13. package/es/components/flyout/index.js +2 -1
  14. package/es/components/form/range/dual_range.js +15 -66
  15. package/es/components/form/range/range.js +6 -5
  16. package/es/components/form/range/range_slider.js +28 -22
  17. package/es/components/form/text_area/text_area.js +39 -3
  18. package/es/components/index.js +0 -2
  19. package/es/components/markdown_editor/markdown_editor.js +12 -13
  20. package/es/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
  21. package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
  22. package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +5 -0
  23. package/es/components/tree_view/tree_view.js +23 -25
  24. package/es/utils/prop_types/is.js +2 -2
  25. package/eui.d.ts +825 -1141
  26. package/i18ntokens.json +68 -338
  27. package/lib/components/basic_table/basic_table.js +5 -5
  28. package/lib/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
  29. package/lib/components/filter_group/filter_button.js +20 -13
  30. package/lib/components/filter_group/filter_button.styles.js +11 -20
  31. package/lib/components/flyout/flyout.js +4 -4
  32. package/lib/components/flyout/flyout_resizable.js +136 -0
  33. package/lib/components/flyout/flyout_resizable.styles.js +32 -0
  34. package/lib/components/flyout/index.js +8 -1
  35. package/lib/components/form/range/dual_range.js +15 -66
  36. package/lib/components/form/range/range.js +6 -5
  37. package/lib/components/form/range/range_slider.js +27 -21
  38. package/lib/components/form/text_area/text_area.js +42 -3
  39. package/lib/components/index.js +0 -22
  40. package/lib/components/markdown_editor/markdown_editor.js +12 -13
  41. package/lib/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
  42. package/lib/components/pagination/pagination_button.js +79 -2
  43. package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
  44. package/lib/components/tree_view/tree_view.js +23 -25
  45. package/lib/utils/prop_types/is.js +2 -2
  46. package/optimize/es/components/basic_table/basic_table.js +5 -5
  47. package/optimize/es/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
  48. package/optimize/es/components/filter_group/filter_button.js +20 -13
  49. package/optimize/es/components/filter_group/filter_button.styles.js +11 -20
  50. package/optimize/es/components/flyout/flyout.js +4 -4
  51. package/optimize/es/components/flyout/flyout_resizable.js +121 -0
  52. package/optimize/es/components/flyout/flyout_resizable.styles.js +27 -0
  53. package/optimize/es/components/flyout/index.js +2 -1
  54. package/optimize/es/components/form/range/dual_range.js +15 -66
  55. package/optimize/es/components/form/range/range.js +6 -5
  56. package/optimize/es/components/form/range/range_slider.js +26 -21
  57. package/optimize/es/components/form/text_area/text_area.js +29 -3
  58. package/optimize/es/components/index.js +0 -2
  59. package/optimize/es/components/markdown_editor/markdown_editor.js +12 -13
  60. package/optimize/es/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
  61. package/optimize/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
  62. package/optimize/es/components/tree_view/tree_view.js +23 -25
  63. package/optimize/es/utils/prop_types/is.js +2 -2
  64. package/optimize/lib/components/basic_table/basic_table.js +5 -5
  65. package/optimize/lib/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
  66. package/optimize/lib/components/filter_group/filter_button.js +20 -13
  67. package/optimize/lib/components/filter_group/filter_button.styles.js +11 -20
  68. package/optimize/lib/components/flyout/flyout.js +4 -4
  69. package/optimize/lib/components/flyout/flyout_resizable.js +131 -0
  70. package/optimize/lib/components/flyout/flyout_resizable.styles.js +32 -0
  71. package/optimize/lib/components/flyout/index.js +8 -1
  72. package/optimize/lib/components/form/range/dual_range.js +15 -66
  73. package/optimize/lib/components/form/range/range.js +6 -5
  74. package/optimize/lib/components/form/range/range_slider.js +26 -21
  75. package/optimize/lib/components/form/text_area/text_area.js +32 -3
  76. package/optimize/lib/components/index.js +0 -22
  77. package/optimize/lib/components/markdown_editor/markdown_editor.js +12 -13
  78. package/optimize/lib/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
  79. package/optimize/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
  80. package/optimize/lib/components/tree_view/tree_view.js +23 -25
  81. package/optimize/lib/utils/prop_types/is.js +2 -2
  82. package/package.json +2 -2
  83. package/src/components/index.scss +0 -2
  84. package/test-env/components/basic_table/basic_table.js +5 -5
  85. package/test-env/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
  86. package/test-env/components/filter_group/filter_button.js +20 -13
  87. package/test-env/components/filter_group/filter_button.styles.js +11 -20
  88. package/test-env/components/flyout/flyout_resizable.js +131 -0
  89. package/test-env/components/flyout/flyout_resizable.styles.js +32 -0
  90. package/test-env/components/flyout/index.js +8 -1
  91. package/test-env/components/form/range/dual_range.js +15 -66
  92. package/test-env/components/form/range/range.js +6 -5
  93. package/test-env/components/form/range/range_slider.js +27 -21
  94. package/test-env/components/form/text_area/text_area.js +42 -3
  95. package/test-env/components/index.js +0 -22
  96. package/test-env/components/markdown_editor/markdown_editor.js +12 -13
  97. package/test-env/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
  98. package/test-env/components/pagination/pagination_button.js +79 -2
  99. package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
  100. package/test-env/components/tree_view/tree_view.js +23 -25
  101. package/test-env/utils/prop_types/is.js +2 -2
  102. package/es/components/control_bar/control_bar.a11y.js +0 -133
  103. package/es/components/control_bar/control_bar.js +0 -609
  104. package/es/components/control_bar/index.js +0 -9
  105. package/es/components/notification/index.js +0 -9
  106. package/es/components/notification/notification_event.a11y.js +0 -104
  107. package/es/components/notification/notification_event.js +0 -288
  108. package/es/components/notification/notification_event_messages.js +0 -79
  109. package/es/components/notification/notification_event_meta.js +0 -148
  110. package/es/components/notification/notification_event_read_button.js +0 -86
  111. package/es/components/notification/notification_event_read_icon.js +0 -77
  112. package/lib/components/control_bar/control_bar.a11y.js +0 -134
  113. package/lib/components/control_bar/control_bar.js +0 -441
  114. package/lib/components/control_bar/index.js +0 -12
  115. package/lib/components/notification/index.js +0 -12
  116. package/lib/components/notification/notification_event.a11y.js +0 -105
  117. package/lib/components/notification/notification_event.js +0 -297
  118. package/lib/components/notification/notification_event_messages.js +0 -88
  119. package/lib/components/notification/notification_event_meta.js +0 -157
  120. package/lib/components/notification/notification_event_read_button.js +0 -93
  121. package/lib/components/notification/notification_event_read_icon.js +0 -64
  122. package/optimize/es/components/control_bar/control_bar.a11y.js +0 -128
  123. package/optimize/es/components/control_bar/control_bar.js +0 -308
  124. package/optimize/es/components/control_bar/index.js +0 -9
  125. package/optimize/es/components/notification/index.js +0 -9
  126. package/optimize/es/components/notification/notification_event.a11y.js +0 -99
  127. package/optimize/es/components/notification/notification_event.js +0 -114
  128. package/optimize/es/components/notification/notification_event_messages.js +0 -63
  129. package/optimize/es/components/notification/notification_event_meta.js +0 -106
  130. package/optimize/es/components/notification/notification_event_read_button.js +0 -44
  131. package/optimize/es/components/notification/notification_event_read_icon.js +0 -44
  132. package/optimize/lib/components/control_bar/control_bar.a11y.js +0 -134
  133. package/optimize/lib/components/control_bar/control_bar.js +0 -301
  134. package/optimize/lib/components/control_bar/index.js +0 -12
  135. package/optimize/lib/components/notification/index.js +0 -12
  136. package/optimize/lib/components/notification/notification_event.a11y.js +0 -105
  137. package/optimize/lib/components/notification/notification_event.js +0 -123
  138. package/optimize/lib/components/notification/notification_event_messages.js +0 -74
  139. package/optimize/lib/components/notification/notification_event_meta.js +0 -117
  140. package/optimize/lib/components/notification/notification_event_read_button.js +0 -51
  141. package/optimize/lib/components/notification/notification_event_read_icon.js +0 -51
  142. package/src/components/control_bar/_control_bar.scss +0 -232
  143. package/src/components/control_bar/_index.scss +0 -2
  144. package/src/components/control_bar/_variables.scss +0 -12
  145. package/src/components/notification/_index.scss +0 -5
  146. package/src/components/notification/_notification_event.scss +0 -40
  147. package/src/components/notification/_notification_event_messages.scss +0 -17
  148. package/src/components/notification/_notification_event_meta.scss +0 -44
  149. package/src/components/notification/_notification_event_read_button.scss +0 -5
  150. package/src/components/notification/_notification_event_read_icon.scss +0 -12
  151. package/test-env/components/control_bar/control_bar.a11y.js +0 -134
  152. package/test-env/components/control_bar/control_bar.js +0 -436
  153. package/test-env/components/control_bar/index.js +0 -12
  154. package/test-env/components/notification/index.js +0 -12
  155. package/test-env/components/notification/notification_event.a11y.js +0 -105
  156. package/test-env/components/notification/notification_event.js +0 -296
  157. package/test-env/components/notification/notification_event_messages.js +0 -85
  158. package/test-env/components/notification/notification_event_meta.js +0 -154
  159. package/test-env/components/notification/notification_event_read_button.js +0 -92
  160. package/test-env/components/notification/notification_event_read_icon.js +0 -63
@@ -1,93 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.EuiNotificationEventReadButton = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _propTypes = _interopRequireDefault(require("prop-types"));
9
- var _button = require("../button");
10
- var _i18n = require("../i18n");
11
- var _classnames = _interopRequireDefault(require("classnames"));
12
- var _react2 = require("@emotion/react");
13
- var _excluded = ["id", "isRead", "onClick", "eventName"];
14
- /*
15
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
16
- * or more contributor license agreements. Licensed under the Elastic License
17
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
18
- * in compliance with, at your election, the Elastic License 2.0 or the Server
19
- * Side Public License, v 1.
20
- */
21
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22
- 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); }
23
- 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; }
24
- 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; }
25
- var EuiNotificationEventReadButton = function EuiNotificationEventReadButton(_ref) {
26
- var id = _ref.id,
27
- isRead = _ref.isRead,
28
- onClick = _ref.onClick,
29
- eventName = _ref.eventName,
30
- rest = _objectWithoutProperties(_ref, _excluded);
31
- var classesReadState = (0, _classnames.default)('euiNotificationEventReadButton', {
32
- 'euiNotificationEventReadButton--isRead': isRead
33
- });
34
- var markAsReadAria = (0, _i18n.useEuiI18n)('euiNotificationEventReadButton.markAsReadAria', 'Mark {eventName} as read', {
35
- eventName: eventName
36
- });
37
- var markAsUnreadAria = (0, _i18n.useEuiI18n)('euiNotificationEventReadButton.markAsUnreadAria', 'Mark {eventName} as unread', {
38
- eventName: eventName
39
- });
40
- var markAsRead = (0, _i18n.useEuiI18n)('euiNotificationEventReadButton.markAsRead', 'Mark as read');
41
- var markAsUnread = (0, _i18n.useEuiI18n)('euiNotificationEventReadButton.markAsUnread', 'Mark as unread');
42
- var buttonAriaLabel = isRead ? markAsUnreadAria : markAsReadAria;
43
- var buttonTitle = isRead ? markAsUnread : markAsRead;
44
- return (0, _react2.jsx)(_button.EuiButtonIcon, _extends({
45
- iconType: "dot",
46
- "aria-label": buttonAriaLabel,
47
- title: buttonTitle,
48
- className: classesReadState,
49
- onClick: onClick,
50
- "data-test-subj": "".concat(id, "-notificationEventReadButton")
51
- }, rest));
52
- };
53
- exports.EuiNotificationEventReadButton = EuiNotificationEventReadButton;
54
- EuiNotificationEventReadButton.propTypes = {
55
- /**
56
- * Any of the named color palette options.
57
- */
58
- color: _propTypes.default.any,
59
- "aria-label": _propTypes.default.string,
60
- "aria-labelledby": _propTypes.default.string,
61
- /**
62
- * Size of the icon only.
63
- * This will not affect the overall size of the button
64
- */
65
- iconSize: _propTypes.default.any,
66
- /**
67
- * Sets the display style for matching other EuiButton types.
68
- * `base` is equivalent to a typical EuiButton
69
- * `fill` is equivalent to a filled EuiButton
70
- * `empty` (default) is equivalent to an EuiButtonEmpty
71
- */
72
- display: _propTypes.default.any,
73
- /**
74
- * Disables the button and changes the icon to a loading spinner
75
- */
76
- isLoading: _propTypes.default.bool,
77
- className: _propTypes.default.string,
78
- "data-test-subj": _propTypes.default.string,
79
- css: _propTypes.default.any,
80
- id: _propTypes.default.string.isRequired,
81
- /**
82
- * Shows an indicator of the read state of the event
83
- */
84
- isRead: _propTypes.default.bool.isRequired,
85
- /**
86
- * Applies an `onClick` handler to the `read` indicator.
87
- */
88
- onClick: _propTypes.default.func.isRequired,
89
- /**
90
- * A unique, human-friendly name for the event to be used in aria attributes (e.g. "alert-critical-01", "cloud-no-severity-12", etc..).
91
- */
92
- eventName: _propTypes.default.string.isRequired
93
- };
@@ -1,64 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.EuiNotificationEventReadIcon = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _propTypes = _interopRequireDefault(require("prop-types"));
9
- var _i18n = require("../i18n");
10
- var _classnames = _interopRequireDefault(require("classnames"));
11
- var _icon = require("../icon");
12
- var _react2 = require("@emotion/react");
13
- var _excluded = ["id", "isRead", "eventName"];
14
- /*
15
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
16
- * or more contributor license agreements. Licensed under the Elastic License
17
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
18
- * in compliance with, at your election, the Elastic License 2.0 or the Server
19
- * Side Public License, v 1.
20
- */
21
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22
- 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); }
23
- 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; }
24
- 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; }
25
- var EuiNotificationEventReadIcon = function EuiNotificationEventReadIcon(_ref) {
26
- var id = _ref.id,
27
- isRead = _ref.isRead,
28
- eventName = _ref.eventName,
29
- rest = _objectWithoutProperties(_ref, _excluded);
30
- var classesReadState = (0, _classnames.default)('euiNotificationEventReadIcon', {
31
- 'euiNotificationEventReadIcon--isRead': isRead
32
- });
33
- var readAria = (0, _i18n.useEuiI18n)('euiNotificationEventReadIcon.readAria', '{eventName} is read', {
34
- eventName: eventName
35
- });
36
- var unreadAria = (0, _i18n.useEuiI18n)('euiNotificationEventReadIcon.unreadAria', '{eventName} is unread', {
37
- eventName: eventName
38
- });
39
- var readTitle = (0, _i18n.useEuiI18n)('euiNotificationEventReadIcon.read', 'Read');
40
- var unreadTitle = (0, _i18n.useEuiI18n)('euiNotificationEventReadIcon.unread', 'Unread');
41
- var iconAriaLabel = isRead ? readAria : unreadAria;
42
- var iconTitle = isRead ? readTitle : unreadTitle;
43
- return (0, _react2.jsx)("div", {
44
- className: classesReadState
45
- }, (0, _react2.jsx)(_icon.EuiIcon, _extends({
46
- type: "dot",
47
- "aria-label": iconAriaLabel,
48
- title: iconTitle,
49
- color: "primary",
50
- "data-test-subj": "".concat(id, "-notificationEventReadIcon")
51
- }, rest)));
52
- };
53
- exports.EuiNotificationEventReadIcon = EuiNotificationEventReadIcon;
54
- EuiNotificationEventReadIcon.propTypes = {
55
- id: _propTypes.default.string.isRequired,
56
- /**
57
- * Shows an indicator of the read state of the event
58
- */
59
- isRead: _propTypes.default.bool.isRequired,
60
- /**
61
- * A unique, human-friendly name for the event to be used in aria attributes (e.g. "alert-critical-01", "cloud-no-severity-12", etc..).
62
- */
63
- eventName: _propTypes.default.string.isRequired
64
- };
@@ -1,128 +0,0 @@
1
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- /*
3
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
4
- * or more contributor license agreements. Licensed under the Elastic License
5
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
6
- * in compliance with, at your election, the Elastic License 2.0 or the Server
7
- * Side Public License, v 1.
8
- */
9
-
10
- /// <reference types="cypress" />
11
- /// <reference types="cypress-real-events" />
12
- /// <reference types="../../../cypress/support" />
13
-
14
- import React, { useState } from 'react';
15
- import { EuiButton } from '../button';
16
- import { EuiControlBar } from './control_bar';
17
- import { EuiPanel } from '../panel';
18
- import { EuiText } from '../text';
19
- import { jsx as ___EmotionJSX } from "@emotion/react";
20
- var ControlBar = function ControlBar() {
21
- var _useState = useState(false),
22
- _useState2 = _slicedToArray(_useState, 2),
23
- contentIsVisible = _useState2[0],
24
- setVisibility = _useState2[1];
25
- var _useState3 = useState(false),
26
- _useState4 = _slicedToArray(_useState3, 2),
27
- isDisplaying = _useState4[0],
28
- setDisplay = _useState4[1];
29
- var toggleContent = function toggleContent() {
30
- setVisibility(!contentIsVisible);
31
- };
32
- var toggleDisplay = function toggleDisplay() {
33
- setDisplay(!isDisplaying);
34
- setVisibility(false);
35
- };
36
- var codeControls = [{
37
- controlType: 'icon',
38
- id: 'root_icon',
39
- iconType: 'submodule',
40
- 'aria-label': 'Project Root'
41
- }, {
42
- controlType: 'breadcrumbs',
43
- id: 'current_file_path',
44
- breadcrumbs: [{
45
- text: 'src'
46
- }, {
47
- text: 'components'
48
- }]
49
- }, {
50
- controlType: 'spacer'
51
- }, {
52
- controlType: 'icon',
53
- id: 'status_icon',
54
- iconType: 'warning',
55
- color: 'warning',
56
- 'aria-label': 'Repo Status'
57
- }, {
58
- controlType: 'divider'
59
- }, {
60
- controlType: 'icon',
61
- id: 'branch_icon',
62
- iconType: 'branch',
63
- 'aria-label': 'Branch Icon'
64
- }, {
65
- controlType: 'text',
66
- id: 'branch_name',
67
- text: 'some_long_branch'
68
- }, {
69
- controlType: 'divider'
70
- }, {
71
- controlType: 'icon',
72
- id: 'github_icon',
73
- iconType: 'logoGithub',
74
- onClick: function onClick() {},
75
- title: 'Open in Github',
76
- 'aria-label': 'Open in Github'
77
- }, {
78
- controlType: 'divider'
79
- }, {
80
- controlType: 'button',
81
- id: 'open_history_view',
82
- label: contentIsVisible ? 'Hide history' : 'Show history',
83
- color: 'primary',
84
- onClick: toggleContent
85
- }];
86
- var display;
87
- if (isDisplaying) {
88
- display = ___EmotionJSX(EuiControlBar, {
89
- controls: codeControls,
90
- showContent: contentIsVisible
91
- }, ___EmotionJSX("div", {
92
- style: {
93
- padding: '2rem',
94
- maxWidth: '60rem',
95
- margin: '0 auto'
96
- }
97
- }, ___EmotionJSX(EuiPanel, null, ___EmotionJSX(EuiText, null, ___EmotionJSX("h1", null, "1984"), ___EmotionJSX("h3", null, "By: George Orwell"), ___EmotionJSX("p", null, "It was a bright cold day in April, and the clocks were striking thirteen. Winston Smith, his chin nuzzled into his breast in an effort to escape the vile wind, slipped quickly through the glass doors of Victory Mansions, though not quickly enough to prevent a swirl of gritty dust from entering along with him."), ___EmotionJSX("p", null, "The hallway smelt of boiled cabbage and old rag mats. At one end of it a coloured poster, too large for indoor display, had been tacked to the wall. It depicted simply an enormous face, more than a metre wide: the face of a man of about forty-five, with a heavy black moustache and ruggedly handsome features. Winston made for the stairs. It was no use trying the lift. Even at the best of times it was seldom working, and at present the electric current was cut off during daylight hours. It was part of the economy drive in preparation for Hate Week. The flat was seven flights up, and Winston, who was thirty-nine and had a varicose ulcer above his right ankle, went slowly, resting several times on the way. On each landing, opposite the lift-shaft, the poster with the enormous face gazed from the wall. It was one of those pictures which are so contrived that the eyes follow you about when you move. BIG BROTHER IS WATCHING YOU, the caption beneath it ran."), ___EmotionJSX("p", null, "Inside the flat a fruity voice was reading out a list of figures which had something to do with the production of pig-iron. The voice came from an oblong metal plaque like a dulled mirror which formed part of the surface of the right-hand wall. Winston turned a switch and the voice sank somewhat, though the words were still distinguishable. The instrument (the telescreen, it was called) could be dimmed, but there was no way of shutting it off completely. He moved over to the window: a smallish, frail figure, the meagreness of his body merely emphasized by the blue overalls which were the uniform of the party. His hair was very fair, his face naturally sanguine, his skin roughened by coarse soap and blunt razor blades and the cold of the winter that had just ended.")))));
98
- }
99
- return ___EmotionJSX("div", null, ___EmotionJSX(EuiButton, {
100
- onClick: toggleDisplay
101
- }, "Toggle example"), display);
102
- };
103
- beforeEach(function () {
104
- cy.viewport(1024, 768);
105
- cy.mount(___EmotionJSX(ControlBar, null));
106
- cy.get('section[aria-label="Page level controls"]').should('not.exist');
107
- });
108
- describe('EuiControlBar', function () {
109
- describe('Automated accessibility check', function () {
110
- it('has zero violations on render', function () {
111
- cy.checkAxe();
112
- });
113
- it('has zero violations when control bar is shown', function () {
114
- cy.get('button.euiButton').contains('Toggle example').realClick();
115
- cy.get('section[aria-label="Page level controls"]').should('exist');
116
- cy.checkAxe({
117
- context: 'section[aria-label="Page level controls"]'
118
- });
119
- });
120
- it('has zero violations when control bar is hidden', function () {
121
- cy.get('button.euiButton').contains('Toggle example').realClick();
122
- cy.get('section[aria-label="Page level controls"]').should('exist');
123
- cy.get('button.euiButton').contains('Toggle example').realClick();
124
- cy.get('section[aria-label="Page level controls"]').should('not.exist');
125
- cy.checkAxe();
126
- });
127
- });
128
- });
@@ -1,308 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
- import _createClass from "@babel/runtime/helpers/createClass";
5
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
6
- import _inherits from "@babel/runtime/helpers/inherits";
7
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
8
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
9
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
10
- var _excluded = ["children", "className", "showContent", "controls", "size", "leftOffset", "rightOffset", "maxHeight", "showOnMobile", "style", "position", "bodyClassName", "landmarkHeading"],
11
- _excluded2 = ["controlType", "id", "color", "label", "className"],
12
- _excluded3 = ["controlType", "id", "iconType", "className", "color", "onClick", "href"],
13
- _excluded4 = ["controlType", "id", "text", "className"],
14
- _excluded5 = ["controlType", "id", "label", "onClick", "className"],
15
- _excluded6 = ["controlType", "id"];
16
- 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; }
17
- 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; }
18
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
19
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
20
- /*
21
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
22
- * or more contributor license agreements. Licensed under the Elastic License
23
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
24
- * in compliance with, at your election, the Elastic License 2.0 or the Server
25
- * Side Public License, v 1.
26
- */
27
-
28
- import classNames from 'classnames';
29
- import React, { Component } from 'react';
30
- import { EuiThemeProvider } from '../../services';
31
- import { EuiScreenReaderOnly } from '../accessibility';
32
- import { EuiBreadcrumbs } from '../breadcrumbs';
33
- import { EuiButton, EuiButtonIcon } from '../button';
34
- import { EuiI18n } from '../i18n';
35
- import { EuiIcon } from '../icon';
36
- import { EuiPortal } from '../portal';
37
-
38
- /**
39
- * Extends EuiButton excluding `size`. Requires `label` as the `children`.
40
- */
41
-
42
- /**
43
- * Creates a `button` visually styles as a tab.
44
- * Requires `label` as the `children`.
45
- * `onClick` must be provided to handle the content swapping.
46
- */
47
-
48
- /**
49
- * Extends EuiBreadcrumbs
50
- */
51
-
52
- /**
53
- * Simple div controlling color and size text output.
54
- * Requires `label` as the `children`.
55
- */
56
-
57
- /**
58
- * Custom props specific to the icon control type
59
- */
60
-
61
- /**
62
- * Icon can extend EuiIcon
63
- * Had to omit `onClick` as it's a valid prop of SVGElement
64
- * Also omits `type` and `id` as these are also specific to icon control
65
- */
66
-
67
- /**
68
- * Icon can extend EuiButtonIcon
69
- * Also omits `iconType` and `id` as these are also specific to icon control
70
- */
71
-
72
- /**
73
- * @deprecated
74
- */
75
- import { jsx as ___EmotionJSX } from "@emotion/react";
76
- /**
77
- * @deprecated - EuiControlBar is scheduled for deprecation due to low internal usage and high
78
- * overlap with other existing EUI components. We recommend using EuiBottomBar instead,
79
- * or copying this component into your own application for usage if necessary.
80
- *
81
- * The component will be permanently removed in December 2023.
82
- */
83
- export var EuiControlBar = /*#__PURE__*/function (_Component) {
84
- _inherits(EuiControlBar, _Component);
85
- var _super = _createSuper(EuiControlBar);
86
- function EuiControlBar() {
87
- var _this;
88
- _classCallCheck(this, EuiControlBar);
89
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
90
- args[_key] = arguments[_key];
91
- }
92
- _this = _super.call.apply(_super, [this].concat(args));
93
- _defineProperty(_assertThisInitialized(_this), "bar", null);
94
- _defineProperty(_assertThisInitialized(_this), "state", {
95
- selectedTab: ''
96
- });
97
- return _this;
98
- }
99
- _createClass(EuiControlBar, [{
100
- key: "componentDidMount",
101
- value: function componentDidMount() {
102
- if (this.props.position === 'fixed') {
103
- var height = this.bar ? this.bar.clientHeight : -1;
104
- document.body.style.paddingBottom = "".concat(height, "px");
105
- if (this.props.bodyClassName) {
106
- document.body.classList.add(this.props.bodyClassName);
107
- }
108
- }
109
- }
110
- }, {
111
- key: "componentWillUnmount",
112
- value: function componentWillUnmount() {
113
- document.body.style.paddingBottom = '';
114
- if (this.props.bodyClassName) {
115
- document.body.classList.remove(this.props.bodyClassName);
116
- }
117
- }
118
- }, {
119
- key: "render",
120
- value: function render() {
121
- var _this2 = this;
122
- var _this$props = this.props,
123
- children = _this$props.children,
124
- className = _this$props.className,
125
- showContent = _this$props.showContent,
126
- controls = _this$props.controls,
127
- size = _this$props.size,
128
- leftOffset = _this$props.leftOffset,
129
- rightOffset = _this$props.rightOffset,
130
- maxHeight = _this$props.maxHeight,
131
- showOnMobile = _this$props.showOnMobile,
132
- style = _this$props.style,
133
- position = _this$props.position,
134
- bodyClassName = _this$props.bodyClassName,
135
- landmarkHeading = _this$props.landmarkHeading,
136
- rest = _objectWithoutProperties(_this$props, _excluded);
137
- var styles = _objectSpread(_objectSpread({}, style), {}, {
138
- left: leftOffset,
139
- right: rightOffset,
140
- maxHeight: maxHeight
141
- });
142
- var classes = classNames('euiControlBar', className, {
143
- 'euiControlBar-isOpen': showContent,
144
- 'euiControlBar--large': size === 'l',
145
- 'euiControlBar--medium': size === 'm',
146
- 'euiControlBar--small': size === 's',
147
- 'euiControlBar--fixed': position === 'fixed',
148
- 'euiControlBar--absolute': position === 'absolute',
149
- 'euiControlBar--relative': position === 'relative',
150
- 'euiControlBar--showOnMobile': showOnMobile
151
- });
152
- var handleTabClick = function handleTabClick(control, e) {
153
- _this2.setState({
154
- selectedTab: control.id
155
- }, function () {
156
- control.onClick(e);
157
- });
158
- };
159
- var controlItem = function controlItem(control, index) {
160
- switch (control.controlType) {
161
- case 'button':
162
- {
163
- var controlType = control.controlType,
164
- id = control.id,
165
- color = control.color,
166
- label = control.label,
167
- _className = control.className,
168
- _rest = _objectWithoutProperties(control, _excluded2);
169
- return ___EmotionJSX(EuiButton, _extends({
170
- key: id + index,
171
- className: classNames('euiControlBar__button', _className),
172
- color: color
173
- }, _rest, {
174
- size: "s"
175
- }), label);
176
- }
177
- case 'icon':
178
- {
179
- var _controlType = control.controlType,
180
- _id = control.id,
181
- iconType = control.iconType,
182
- _className2 = control.className,
183
- _control$color = control.color,
184
- _color = _control$color === void 0 ? 'text' : _control$color,
185
- onClick = control.onClick,
186
- href = control.href,
187
- _rest2 = _objectWithoutProperties(control, _excluded3);
188
- return onClick || href ? ___EmotionJSX(EuiButtonIcon, _extends({
189
- key: _id + index,
190
- className: classNames('euiControlBar__buttonIcon', _className2),
191
- onClick: onClick,
192
- href: href,
193
- color: _color
194
- }, _rest2, {
195
- iconType: iconType
196
- })) : ___EmotionJSX(EuiIcon, _extends({
197
- key: _id + index,
198
- className: classNames('euiControlBar__icon', _className2),
199
- type: iconType,
200
- color: _color
201
- }, _rest2));
202
- }
203
- case 'divider':
204
- return ___EmotionJSX("div", {
205
- key: control.controlType + index,
206
- className: "euiControlBar__divider"
207
- });
208
- case 'spacer':
209
- return ___EmotionJSX("div", {
210
- key: control.controlType + index,
211
- className: "euiControlBar__spacer"
212
- });
213
- case 'text':
214
- {
215
- var _controlType2 = control.controlType,
216
- _id2 = control.id,
217
- text = control.text,
218
- _className3 = control.className,
219
- _rest3 = _objectWithoutProperties(control, _excluded4);
220
- return ___EmotionJSX("div", _extends({
221
- key: _id2,
222
- className: classNames('euiControlBar__text', _className3)
223
- }, _rest3), text);
224
- }
225
- case 'tab':
226
- {
227
- var _controlType3 = control.controlType,
228
- _id3 = control.id,
229
- _label = control.label,
230
- _onClick = control.onClick,
231
- _className4 = control.className,
232
- _rest4 = _objectWithoutProperties(control, _excluded5);
233
- var tabClasses = classNames('euiControlBar__tab', {
234
- 'euiControlBar__tab--active': showContent && _id3 === _this2.state.selectedTab
235
- }, _className4);
236
- return ___EmotionJSX("button", _extends({
237
- key: _id3 + index,
238
- className: tabClasses,
239
- onClick: function onClick(event) {
240
- return handleTabClick(control, event);
241
- }
242
- }, _rest4), _label);
243
- }
244
- case 'breadcrumbs':
245
- {
246
- var _controlType4 = control.controlType,
247
- _id4 = control.id,
248
- _rest5 = _objectWithoutProperties(control, _excluded6);
249
- return ___EmotionJSX(EuiBreadcrumbs, _extends({
250
- className: "euiControlBar__breadcrumbs",
251
- key: control.id
252
- }, _rest5));
253
- }
254
- }
255
- };
256
- var controlBar = ___EmotionJSX(EuiI18n, {
257
- token: "euiControlBar.screenReaderHeading",
258
- default: "Page level controls"
259
- }, function (screenReaderHeading) {
260
- return ___EmotionJSX(EuiThemeProvider, {
261
- colorMode: "dark",
262
- wrapperProps: {
263
- cloneElement: true
264
- }
265
- }, ___EmotionJSX("section", _extends({
266
- className: classes
267
- // Though it would be better to use aria-labelledby than aria-label
268
- // and not repeat the same string twice, a bug in voiceover won't list
269
- // some landmarks in the rotor without an aria-label
270
- ,
271
- "aria-label": landmarkHeading ? landmarkHeading : screenReaderHeading
272
- }, rest, {
273
- style: styles
274
- }), ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("h2", null, landmarkHeading ? landmarkHeading : screenReaderHeading)), ___EmotionJSX("div", {
275
- className: "euiControlBar__controls",
276
- ref: function ref(node) {
277
- _this2.bar = node;
278
- }
279
- }, controls.map(function (control, index) {
280
- return controlItem(control, index);
281
- })), _this2.props.showContent ? ___EmotionJSX("div", {
282
- className: "euiControlBar__content"
283
- }, children) : null));
284
- });
285
- return position === 'fixed' ? ___EmotionJSX(EuiPortal, null, controlBar, ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("p", {
286
- "aria-live": "assertive"
287
- }, landmarkHeading ? ___EmotionJSX(EuiI18n, {
288
- token: "euiControlBar.customScreenReaderAnnouncement",
289
- default: "There is a new region landmark called {landmarkHeading} with page level controls at the end of the document.",
290
- values: {
291
- landmarkHeading: landmarkHeading
292
- }
293
- }) : ___EmotionJSX(EuiI18n, {
294
- token: "euiControlBar.screenReaderAnnouncement",
295
- default: "There is a new region landmark with page level controls at the end of the document."
296
- })))) : controlBar;
297
- }
298
- }]);
299
- return EuiControlBar;
300
- }(Component);
301
- _defineProperty(EuiControlBar, "defaultProps", {
302
- leftOffset: 0,
303
- rightOffset: 0,
304
- position: 'fixed',
305
- size: 'l',
306
- showContent: false,
307
- showOnMobile: false
308
- });
@@ -1,9 +0,0 @@
1
- /*
2
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
- * or more contributor license agreements. Licensed under the Elastic License
4
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
- * in compliance with, at your election, the Elastic License 2.0 or the Server
6
- * Side Public License, v 1.
7
- */
8
-
9
- export { EuiControlBar } from './control_bar';
@@ -1,9 +0,0 @@
1
- /*
2
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
- * or more contributor license agreements. Licensed under the Elastic License
4
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
- * in compliance with, at your election, the Elastic License 2.0 or the Server
6
- * Side Public License, v 1.
7
- */
8
-
9
- export { EuiNotificationEvent } from './notification_event';