@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,609 +0,0 @@
1
- var _excluded = ["children", "className", "showContent", "controls", "size", "leftOffset", "rightOffset", "maxHeight", "showOnMobile", "style", "position", "bodyClassName", "landmarkHeading"],
2
- _excluded2 = ["controlType", "id", "color", "label", "className"],
3
- _excluded3 = ["controlType", "id", "iconType", "className", "color", "onClick", "href"],
4
- _excluded4 = ["controlType", "id", "text", "className"],
5
- _excluded5 = ["controlType", "id", "label", "onClick", "className"],
6
- _excluded6 = ["controlType", "id"];
7
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
8
- 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); }
9
- 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; }
10
- 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; }
11
- 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; }
12
- 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; }
13
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
14
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
15
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
16
- 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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
17
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
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 _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
20
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
21
- 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; } }
22
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
23
- 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; }
24
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
25
- 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); }
26
- /*
27
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
28
- * or more contributor license agreements. Licensed under the Elastic License
29
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
30
- * in compliance with, at your election, the Elastic License 2.0 or the Server
31
- * Side Public License, v 1.
32
- */
33
-
34
- import classNames from 'classnames';
35
- import PropTypes from "prop-types";
36
- import React, { Component } from 'react';
37
- import { EuiThemeProvider } from '../../services';
38
- import { EuiScreenReaderOnly } from '../accessibility';
39
- import { EuiBreadcrumbs } from '../breadcrumbs';
40
- import { EuiButton, EuiButtonIcon } from '../button';
41
- import { EuiI18n } from '../i18n';
42
- import { EuiIcon } from '../icon';
43
- import { EuiPortal } from '../portal';
44
-
45
- /**
46
- * Extends EuiButton excluding `size`. Requires `label` as the `children`.
47
- */
48
-
49
- /**
50
- * Creates a `button` visually styles as a tab.
51
- * Requires `label` as the `children`.
52
- * `onClick` must be provided to handle the content swapping.
53
- */
54
-
55
- /**
56
- * Extends EuiBreadcrumbs
57
- */
58
-
59
- /**
60
- * Simple div controlling color and size text output.
61
- * Requires `label` as the `children`.
62
- */
63
-
64
- /**
65
- * Custom props specific to the icon control type
66
- */
67
-
68
- /**
69
- * Icon can extend EuiIcon
70
- * Had to omit `onClick` as it's a valid prop of SVGElement
71
- * Also omits `type` and `id` as these are also specific to icon control
72
- */
73
-
74
- /**
75
- * Icon can extend EuiButtonIcon
76
- * Also omits `iconType` and `id` as these are also specific to icon control
77
- */
78
-
79
- /**
80
- * @deprecated
81
- */
82
- import { jsx as ___EmotionJSX } from "@emotion/react";
83
- /**
84
- * @deprecated - EuiControlBar is scheduled for deprecation due to low internal usage and high
85
- * overlap with other existing EUI components. We recommend using EuiBottomBar instead,
86
- * or copying this component into your own application for usage if necessary.
87
- *
88
- * The component will be permanently removed in December 2023.
89
- */
90
- export var EuiControlBar = /*#__PURE__*/function (_Component) {
91
- _inherits(EuiControlBar, _Component);
92
- var _super = _createSuper(EuiControlBar);
93
- function EuiControlBar() {
94
- var _this;
95
- _classCallCheck(this, EuiControlBar);
96
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
97
- args[_key] = arguments[_key];
98
- }
99
- _this = _super.call.apply(_super, [this].concat(args));
100
- _defineProperty(_assertThisInitialized(_this), "bar", null);
101
- _defineProperty(_assertThisInitialized(_this), "state", {
102
- selectedTab: ''
103
- });
104
- return _this;
105
- }
106
- _createClass(EuiControlBar, [{
107
- key: "componentDidMount",
108
- value: function componentDidMount() {
109
- if (this.props.position === 'fixed') {
110
- var height = this.bar ? this.bar.clientHeight : -1;
111
- document.body.style.paddingBottom = "".concat(height, "px");
112
- if (this.props.bodyClassName) {
113
- document.body.classList.add(this.props.bodyClassName);
114
- }
115
- }
116
- }
117
- }, {
118
- key: "componentWillUnmount",
119
- value: function componentWillUnmount() {
120
- document.body.style.paddingBottom = '';
121
- if (this.props.bodyClassName) {
122
- document.body.classList.remove(this.props.bodyClassName);
123
- }
124
- }
125
- }, {
126
- key: "render",
127
- value: function render() {
128
- var _this2 = this;
129
- var _this$props = this.props,
130
- children = _this$props.children,
131
- className = _this$props.className,
132
- showContent = _this$props.showContent,
133
- controls = _this$props.controls,
134
- size = _this$props.size,
135
- leftOffset = _this$props.leftOffset,
136
- rightOffset = _this$props.rightOffset,
137
- maxHeight = _this$props.maxHeight,
138
- showOnMobile = _this$props.showOnMobile,
139
- style = _this$props.style,
140
- position = _this$props.position,
141
- bodyClassName = _this$props.bodyClassName,
142
- landmarkHeading = _this$props.landmarkHeading,
143
- rest = _objectWithoutProperties(_this$props, _excluded);
144
- var styles = _objectSpread(_objectSpread({}, style), {}, {
145
- left: leftOffset,
146
- right: rightOffset,
147
- maxHeight: maxHeight
148
- });
149
- var classes = classNames('euiControlBar', className, {
150
- 'euiControlBar-isOpen': showContent,
151
- 'euiControlBar--large': size === 'l',
152
- 'euiControlBar--medium': size === 'm',
153
- 'euiControlBar--small': size === 's',
154
- 'euiControlBar--fixed': position === 'fixed',
155
- 'euiControlBar--absolute': position === 'absolute',
156
- 'euiControlBar--relative': position === 'relative',
157
- 'euiControlBar--showOnMobile': showOnMobile
158
- });
159
- var handleTabClick = function handleTabClick(control, e) {
160
- _this2.setState({
161
- selectedTab: control.id
162
- }, function () {
163
- control.onClick(e);
164
- });
165
- };
166
- var controlItem = function controlItem(control, index) {
167
- switch (control.controlType) {
168
- case 'button':
169
- {
170
- var controlType = control.controlType,
171
- id = control.id,
172
- color = control.color,
173
- label = control.label,
174
- _className = control.className,
175
- _rest = _objectWithoutProperties(control, _excluded2);
176
- return ___EmotionJSX(EuiButton, _extends({
177
- key: id + index,
178
- className: classNames('euiControlBar__button', _className),
179
- color: color
180
- }, _rest, {
181
- size: "s"
182
- }), label);
183
- }
184
- case 'icon':
185
- {
186
- var _controlType = control.controlType,
187
- _id = control.id,
188
- iconType = control.iconType,
189
- _className2 = control.className,
190
- _control$color = control.color,
191
- _color = _control$color === void 0 ? 'text' : _control$color,
192
- onClick = control.onClick,
193
- href = control.href,
194
- _rest2 = _objectWithoutProperties(control, _excluded3);
195
- return onClick || href ? ___EmotionJSX(EuiButtonIcon, _extends({
196
- key: _id + index,
197
- className: classNames('euiControlBar__buttonIcon', _className2),
198
- onClick: onClick,
199
- href: href,
200
- color: _color
201
- }, _rest2, {
202
- iconType: iconType
203
- })) : ___EmotionJSX(EuiIcon, _extends({
204
- key: _id + index,
205
- className: classNames('euiControlBar__icon', _className2),
206
- type: iconType,
207
- color: _color
208
- }, _rest2));
209
- }
210
- case 'divider':
211
- return ___EmotionJSX("div", {
212
- key: control.controlType + index,
213
- className: "euiControlBar__divider"
214
- });
215
- case 'spacer':
216
- return ___EmotionJSX("div", {
217
- key: control.controlType + index,
218
- className: "euiControlBar__spacer"
219
- });
220
- case 'text':
221
- {
222
- var _controlType2 = control.controlType,
223
- _id2 = control.id,
224
- text = control.text,
225
- _className3 = control.className,
226
- _rest3 = _objectWithoutProperties(control, _excluded4);
227
- return ___EmotionJSX("div", _extends({
228
- key: _id2,
229
- className: classNames('euiControlBar__text', _className3)
230
- }, _rest3), text);
231
- }
232
- case 'tab':
233
- {
234
- var _controlType3 = control.controlType,
235
- _id3 = control.id,
236
- _label = control.label,
237
- _onClick = control.onClick,
238
- _className4 = control.className,
239
- _rest4 = _objectWithoutProperties(control, _excluded5);
240
- var tabClasses = classNames('euiControlBar__tab', {
241
- 'euiControlBar__tab--active': showContent && _id3 === _this2.state.selectedTab
242
- }, _className4);
243
- return ___EmotionJSX("button", _extends({
244
- key: _id3 + index,
245
- className: tabClasses,
246
- onClick: function onClick(event) {
247
- return handleTabClick(control, event);
248
- }
249
- }, _rest4), _label);
250
- }
251
- case 'breadcrumbs':
252
- {
253
- var _controlType4 = control.controlType,
254
- _id4 = control.id,
255
- _rest5 = _objectWithoutProperties(control, _excluded6);
256
- return ___EmotionJSX(EuiBreadcrumbs, _extends({
257
- className: "euiControlBar__breadcrumbs",
258
- key: control.id
259
- }, _rest5));
260
- }
261
- }
262
- };
263
- var controlBar = ___EmotionJSX(EuiI18n, {
264
- token: "euiControlBar.screenReaderHeading",
265
- default: "Page level controls"
266
- }, function (screenReaderHeading) {
267
- return ___EmotionJSX(EuiThemeProvider, {
268
- colorMode: "dark",
269
- wrapperProps: {
270
- cloneElement: true
271
- }
272
- }, ___EmotionJSX("section", _extends({
273
- className: classes
274
- // Though it would be better to use aria-labelledby than aria-label
275
- // and not repeat the same string twice, a bug in voiceover won't list
276
- // some landmarks in the rotor without an aria-label
277
- ,
278
- "aria-label": landmarkHeading ? landmarkHeading : screenReaderHeading
279
- }, rest, {
280
- style: styles
281
- }), ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("h2", null, landmarkHeading ? landmarkHeading : screenReaderHeading)), ___EmotionJSX("div", {
282
- className: "euiControlBar__controls",
283
- ref: function ref(node) {
284
- _this2.bar = node;
285
- }
286
- }, controls.map(function (control, index) {
287
- return controlItem(control, index);
288
- })), _this2.props.showContent ? ___EmotionJSX("div", {
289
- className: "euiControlBar__content"
290
- }, children) : null));
291
- });
292
- return position === 'fixed' ? ___EmotionJSX(EuiPortal, null, controlBar, ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("p", {
293
- "aria-live": "assertive"
294
- }, landmarkHeading ? ___EmotionJSX(EuiI18n, {
295
- token: "euiControlBar.customScreenReaderAnnouncement",
296
- default: "There is a new region landmark called {landmarkHeading} with page level controls at the end of the document.",
297
- values: {
298
- landmarkHeading: landmarkHeading
299
- }
300
- }) : ___EmotionJSX(EuiI18n, {
301
- token: "euiControlBar.screenReaderAnnouncement",
302
- default: "There is a new region landmark with page level controls at the end of the document."
303
- })))) : controlBar;
304
- }
305
- }]);
306
- return EuiControlBar;
307
- }(Component);
308
- _defineProperty(EuiControlBar, "defaultProps", {
309
- leftOffset: 0,
310
- rightOffset: 0,
311
- position: 'fixed',
312
- size: 'l',
313
- showContent: false,
314
- showOnMobile: false
315
- });
316
- EuiControlBar.propTypes = {
317
- className: PropTypes.string,
318
- "aria-label": PropTypes.string,
319
- "data-test-subj": PropTypes.string,
320
- css: PropTypes.any,
321
- /**
322
- * Show or hide the content area containing the `children`
323
- */
324
- showContent: PropTypes.bool,
325
- /**
326
- * An array of controls, actions, and layout spacers to display.
327
- * Accepts `'button' | 'tab' | 'breadcrumbs' | 'text' | 'icon' | 'spacer' | 'divider'`
328
- */
329
- controls: PropTypes.arrayOf(PropTypes.shape({
330
- href: PropTypes.string,
331
- onClick: PropTypes.func,
332
- id: PropTypes.string,
333
- label: PropTypes.oneOfType([PropTypes.node.isRequired, PropTypes.node]),
334
- buttonRef: PropTypes.any,
335
- controlType: PropTypes.oneOfType([PropTypes.oneOfType([PropTypes.oneOfType([PropTypes.oneOfType([PropTypes.oneOfType([PropTypes.oneOf(["button"]).isRequired, PropTypes.oneOfType([PropTypes.oneOf(["breadcrumbs"]).isRequired, PropTypes.oneOf(["tab"]).isRequired]).isRequired]).isRequired, PropTypes.oneOf(["text"]).isRequired]).isRequired, PropTypes.oneOf(["icon"]).isRequired]).isRequired, PropTypes.oneOf(["divider"]).isRequired]).isRequired, PropTypes.oneOf(["spacer"]).isRequired]).isRequired,
336
- className: PropTypes.string,
337
- "aria-label": PropTypes.string,
338
- "data-test-subj": PropTypes.string,
339
- css: PropTypes.any,
340
- /**
341
- * Hides extra (above the max) breadcrumbs under a collapsed item as the window gets smaller.
342
- * Pass a custom #EuiBreadcrumbResponsiveMaxCount object to change the number of breadcrumbs to show at the particular breakpoints.
343
- *
344
- * Pass `false` to turn this behavior off.
345
- *
346
- * Default: `{ xs: 1, s: 2, m: 4 }`
347
- */
348
- responsive: PropTypes.oneOfType([PropTypes.bool.isRequired, PropTypes.any.isRequired]),
349
- /**
350
- * Forces all breadcrumbs to single line and
351
- * truncates each breadcrumb to a particular width,
352
- * except for the last item
353
- */
354
- truncate: PropTypes.bool,
355
- /**
356
- * Collapses the inner items past the maximum set here
357
- * into a single ellipses item.
358
- * Omitting or passing a `0` value will show all breadcrumbs.
359
- */
360
- max: PropTypes.oneOfType([PropTypes.number.isRequired, PropTypes.oneOf([null])]),
361
- /**
362
- * The array of individual #EuiBreadcrumb items
363
- */
364
- breadcrumbs: PropTypes.arrayOf(PropTypes.shape({
365
- className: PropTypes.string,
366
- "aria-label": PropTypes.string,
367
- "data-test-subj": PropTypes.string,
368
- css: PropTypes.any,
369
- href: PropTypes.string,
370
- rel: PropTypes.string,
371
- onClick: PropTypes.func,
372
- /**
373
- * Visible label of the breadcrumb
374
- */
375
- text: PropTypes.node.isRequired,
376
- /**
377
- * Force a max-width on the breadcrumb text
378
- */
379
- truncate: PropTypes.bool,
380
- /**
381
- * Accepts any EuiLink `color` when rendered as one (has `href`, `onClick`, or `popoverContent`)
382
- */
383
- color: PropTypes.any,
384
- /**
385
- * Override the existing `aria-current` which defaults to `page` for the last breadcrumb
386
- */
387
- "aria-current": PropTypes.any,
388
- /**
389
- * Creates a breadcrumb that toggles a popover dialog
390
- *
391
- * If passed, both `href` and `onClick` will be ignored - the breadcrumb's
392
- * click behavior should only trigger a popover.
393
- */
394
- popoverContent: PropTypes.node,
395
- /**
396
- * Allows customizing the popover if necessary. Accepts any props that
397
- * [EuiPopover](/#/layout/popover) accepts, except for props that control state.
398
- */
399
- popoverProps: PropTypes.shape({
400
- /**
401
- * Class name passed to the direct parent of the button
402
- *
403
- * @deprecated Use `className` instead
404
- */
405
- anchorClassName: PropTypes.string,
406
- /**
407
- * Alignment of the popover and arrow relative to the button
408
- */
409
- anchorPosition: PropTypes.any,
410
- /**
411
- * Style and position alteration for arrow-less attachment.
412
- * Intended for use with inputs as anchors, e.g. EuiInputPopover
413
- */
414
- attachToAnchor: PropTypes.bool,
415
- /**
416
- * @deprecated Use `popoverRef` instead
417
- */
418
- buttonRef: PropTypes.any,
419
- /**
420
- * Restrict the popover's position within this element
421
- */
422
- container: PropTypes.any,
423
- /**
424
- * CSS display type for both the popover and anchor
425
- */
426
- display: PropTypes.any,
427
- /**
428
- * Object of props passed to EuiFocusTrap
429
- */
430
- focusTrapProps: PropTypes.any,
431
- /**
432
- * Show arrow indicating to originating button
433
- */
434
- hasArrow: PropTypes.bool,
435
- /**
436
- * Specifies what element should initially have focus; Can be a DOM
437
- * node, or a selector string (which will be passed to
438
- * document.querySelector() to find the DOM node), or a function that
439
- * returns a DOM node.
440
- *
441
- * If not passed, initial focus defaults to the popover panel.
442
- */
443
- initialFocus: PropTypes.any,
444
- /**
445
- * Passed directly to EuiPortal for DOM positioning. Both properties are
446
- * required if prop is specified
447
- */
448
- insert: PropTypes.shape({
449
- sibling: PropTypes.any.isRequired,
450
- position: PropTypes.oneOf(["before", "after"]).isRequired
451
- }),
452
- /**
453
- * Traps tab focus within the popover contents
454
- */
455
- ownFocus: PropTypes.bool,
456
- /**
457
- * Custom class added to the EuiPanel containing the popover contents
458
- */
459
- panelClassName: PropTypes.string,
460
- /**
461
- * EuiPanel padding on all sides
462
- */
463
- panelPaddingSize: PropTypes.any,
464
- /**
465
- * Standard DOM `style` attribute. Passed to the EuiPanel
466
- */
467
- panelStyle: PropTypes.any,
468
- /**
469
- * Object of props passed to EuiPanel. See #EuiPopoverPanelProps
470
- */
471
- panelProps: PropTypes.shape({
472
- element: PropTypes.oneOf(["div"]),
473
- /**
474
- * Padding for all four sides
475
- */
476
- paddingSize: PropTypes.any,
477
- /**
478
- * Corner border radius
479
- */
480
- borderRadius: PropTypes.any,
481
- /**
482
- * When true the panel will grow in height to match `EuiFlexItem`
483
- */
484
- grow: PropTypes.bool,
485
- panelRef: PropTypes.any,
486
- className: PropTypes.string,
487
- "aria-label": PropTypes.string,
488
- "data-test-subj": PropTypes.string,
489
- css: PropTypes.any
490
- }),
491
- panelRef: PropTypes.any,
492
- /**
493
- * Optional screen reader instructions to announce upon popover open,
494
- * in addition to EUI's default popover instructions for Escape on close.
495
- * Useful for popovers that may have additional keyboard capabilities such as
496
- * arrow navigation.
497
- */
498
- popoverScreenReaderText: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.node.isRequired]),
499
- popoverRef: PropTypes.any,
500
- /**
501
- * When `true`, the popover's position is re-calculated when the user
502
- * scrolls, this supports having fixed-position popover anchors. When nesting
503
- * an `EuiPopover` in a scrollable container, `repositionOnScroll` should be `true`
504
- */
505
- repositionOnScroll: PropTypes.bool,
506
- /**
507
- * By default, popovers will attempt to position themselves along the initial
508
- * axis specified. If there is not enough room either vertically or horizontally
509
- * however, the popover will attempt to reposition itself along the secondary
510
- * cross axis if there is room there instead.
511
- *
512
- * If you do not not want this repositioning to occur (and it is acceptable for
513
- * the popover to appear offscreen), set this to false to disable this behavior.
514
- *
515
- * @default true
516
- */
517
- repositionToCrossAxis: PropTypes.bool,
518
- /**
519
- * Must be set to true if using `EuiDragDropContext` within a popover,
520
- * otherwise your nested drag & drop will have incorrect positioning
521
- */
522
- hasDragDrop: PropTypes.bool,
523
- /**
524
- * By default, popover content inherits the z-index of the anchor
525
- * component; pass `zIndex` to override
526
- */
527
- zIndex: PropTypes.number,
528
- /**
529
- * Distance away from the anchor that the popover will render
530
- */
531
- offset: PropTypes.number,
532
- /**
533
- * Minimum distance between the popover and the bounding container;
534
- * Pass an array of 4 values to adjust each side differently: `[top, right, bottom, left]`
535
- * Default is 16
536
- */
537
- buffer: PropTypes.oneOfType([PropTypes.number.isRequired, PropTypes.any.isRequired]),
538
- /**
539
- * Element to pass as the child element of the arrow;
540
- * Use case is typically limited to an accompanying `EuiBeacon`
541
- */
542
- arrowChildren: PropTypes.node,
543
- /**
544
- * Provide a name to the popover panel
545
- */
546
- "aria-label": PropTypes.string,
547
- /**
548
- * Alternative option to `aria-label` that takes an `id`.
549
- * Usually takes the `id` of the popover title
550
- */
551
- "aria-labelledby": PropTypes.string,
552
- /**
553
- * Function callback for when the popover positon changes
554
- */
555
- onPositionChange: PropTypes.func,
556
- className: PropTypes.string,
557
- "data-test-subj": PropTypes.string,
558
- css: PropTypes.any
559
- })
560
- }).isRequired),
561
- /**
562
- * Determines breadcrumbs appearance, with `page` being the default styling.
563
- * Application breadcrumbs should only be once per page, in (e.g.) EuiHeader
564
- */
565
- type: PropTypes.oneOf(["page", "application"]),
566
- /**
567
- * Whether the last breadcrumb should visually (and accessibly, to screen readers)
568
- * be highlighted as the current page. Defaults to true.
569
- */
570
- lastBreadcrumbIsCurrentPage: PropTypes.bool,
571
- text: PropTypes.node,
572
- iconType: PropTypes.string
573
- }).isRequired).isRequired,
574
- /**
575
- * The default height of the content area.
576
- */
577
- size: PropTypes.oneOf(["s", "m", "l"]),
578
- /**
579
- * Customize the max height.
580
- * Best when used with `size=l` as this will ensure the actual height equals the max height set.
581
- */
582
- maxHeight: PropTypes.oneOfType([PropTypes.number.isRequired, PropTypes.string.isRequired]),
583
- /**
584
- * Set the offset from the left side of the screen.
585
- */
586
- leftOffset: PropTypes.oneOfType([PropTypes.number.isRequired, PropTypes.string.isRequired]),
587
- /**
588
- * Set the offset from the left side of the screen.
589
- */
590
- rightOffset: PropTypes.oneOfType([PropTypes.number.isRequired, PropTypes.string.isRequired]),
591
- /**
592
- * The control bar is hidden on mobile by default. Use the `showOnMobile` prop to force it's display on mobile screens.
593
- * You'll need to ensure that the content you place into the bar renders as expected on mobile.
594
- */
595
- showOnMobile: PropTypes.bool,
596
- /**
597
- * By default EuiControlBar will live in a portal, fixed position to the browser window.
598
- * Change the position of the bar to live inside a container and be positioned against its parent.
599
- */
600
- position: PropTypes.oneOf(["fixed", "relative", "absolute"]),
601
- /**
602
- * Optional class applied to the body used when `position = fixed`
603
- */
604
- bodyClassName: PropTypes.string,
605
- /**
606
- * Customize the screen reader heading that helps users find this control. Default is "Page level controls".
607
- */
608
- landmarkHeading: PropTypes.string
609
- };
@@ -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';