@elastic/eui 65.0.0 → 66.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 (169) hide show
  1. package/dist/eui_theme_dark.css +28 -197
  2. package/dist/eui_theme_dark.min.css +1 -1
  3. package/dist/eui_theme_light.css +28 -197
  4. package/dist/eui_theme_light.min.css +1 -1
  5. package/es/components/basic_table/basic_table.js +13 -2
  6. package/es/components/basic_table/in_memory_table.js +13 -2
  7. package/es/components/card/card.styles.js +2 -2
  8. package/es/components/combo_box/combo_box.js +2 -15
  9. package/es/components/datagrid/body/data_grid_body.js +17 -6
  10. package/es/components/datagrid/body/data_grid_cell.js +29 -12
  11. package/es/components/datagrid/body/header/data_grid_header_cell.js +17 -6
  12. package/es/components/datagrid/body/header/data_grid_header_row.js +17 -6
  13. package/es/components/datagrid/data_grid.js +17 -6
  14. package/es/components/datagrid/utils/in_memory.js +17 -6
  15. package/es/components/date_picker/react-datepicker/original.package.json +124 -0
  16. package/es/components/description_list/description_list.js +11 -3
  17. package/es/components/description_list/description_list_context.js +2 -1
  18. package/es/components/description_list/description_list_description.js +3 -1
  19. package/es/components/description_list/description_list_description.styles.js +5 -2
  20. package/es/components/description_list/description_list_title.js +4 -3
  21. package/es/components/description_list/description_list_title.styles.js +7 -3
  22. package/es/components/description_list/description_list_types.js +2 -1
  23. package/es/components/form/field_search/field_search.js +6 -16
  24. package/es/components/form/range/range_input.js +1 -1
  25. package/es/components/header/header_section/header_section_item.js +4 -3
  26. package/es/components/icon/icon.js +3 -10
  27. package/es/components/list_group/list_group.js +7 -1
  28. package/es/components/list_group/list_group_item.js +10 -3
  29. package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +13 -1
  30. package/es/components/modal/modal.js +1 -3
  31. package/es/components/observer/mutation_observer/mutation_observer.js +1 -1
  32. package/es/components/page/page_sidebar/page_sidebar.js +5 -1
  33. package/es/components/table/table_row_cell.js +4 -6
  34. package/es/components/tabs/tabbed_content/tabbed_content.js +2 -19
  35. package/es/global_styling/functions/logicals.json +56 -0
  36. package/es/global_styling/mixins/_typography.js +1 -1
  37. package/es/services/theme/hooks.js +11 -16
  38. package/eui.d.ts +29 -10
  39. package/i18ntokens.json +18 -18
  40. package/lib/components/basic_table/basic_table.js +13 -2
  41. package/lib/components/basic_table/in_memory_table.js +13 -2
  42. package/lib/components/card/card.styles.js +2 -2
  43. package/lib/components/combo_box/combo_box.js +2 -15
  44. package/lib/components/datagrid/body/data_grid_body.js +17 -6
  45. package/lib/components/datagrid/body/data_grid_cell.js +29 -12
  46. package/lib/components/datagrid/body/header/data_grid_header_cell.js +17 -6
  47. package/lib/components/datagrid/body/header/data_grid_header_row.js +17 -6
  48. package/lib/components/datagrid/data_grid.js +17 -6
  49. package/lib/components/datagrid/utils/in_memory.js +17 -6
  50. package/lib/components/date_picker/react-datepicker/original.package.json +124 -0
  51. package/lib/components/description_list/description_list.js +11 -3
  52. package/lib/components/description_list/description_list_context.js +2 -1
  53. package/lib/components/description_list/description_list_description.js +3 -1
  54. package/lib/components/description_list/description_list_description.styles.js +5 -2
  55. package/lib/components/description_list/description_list_title.js +4 -3
  56. package/lib/components/description_list/description_list_title.styles.js +7 -3
  57. package/lib/components/description_list/description_list_types.js +4 -2
  58. package/lib/components/form/field_search/field_search.js +6 -16
  59. package/lib/components/form/range/range_input.js +1 -1
  60. package/lib/components/header/header_section/header_section_item.js +4 -3
  61. package/lib/components/icon/icon.js +3 -10
  62. package/lib/components/list_group/list_group.js +7 -1
  63. package/lib/components/list_group/list_group_item.js +10 -3
  64. package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +13 -1
  65. package/lib/components/modal/modal.js +1 -3
  66. package/lib/components/observer/mutation_observer/mutation_observer.js +1 -1
  67. package/lib/components/page/page_sidebar/page_sidebar.js +5 -1
  68. package/lib/components/table/table_row_cell.js +4 -6
  69. package/lib/components/tabs/tabbed_content/tabbed_content.js +2 -19
  70. package/lib/global_styling/functions/logicals.json +56 -0
  71. package/lib/global_styling/mixins/_typography.js +1 -1
  72. package/lib/services/theme/hooks.js +10 -15
  73. package/optimize/es/components/card/card.styles.js +2 -2
  74. package/optimize/es/components/combo_box/combo_box.js +2 -15
  75. package/optimize/es/components/date_picker/react-datepicker/original.package.json +124 -0
  76. package/optimize/es/components/description_list/description_list.js +5 -2
  77. package/optimize/es/components/description_list/description_list_context.js +2 -1
  78. package/optimize/es/components/description_list/description_list_description.js +3 -1
  79. package/optimize/es/components/description_list/description_list_description.styles.js +5 -2
  80. package/optimize/es/components/description_list/description_list_title.js +4 -3
  81. package/optimize/es/components/description_list/description_list_title.styles.js +7 -3
  82. package/optimize/es/components/description_list/description_list_types.js +2 -1
  83. package/optimize/es/components/form/field_search/field_search.js +6 -16
  84. package/optimize/es/components/form/range/range_input.js +1 -1
  85. package/optimize/es/components/header/header_section/header_section_item.js +4 -3
  86. package/optimize/es/components/icon/icon.js +3 -10
  87. package/optimize/es/components/list_group/list_group_item.js +3 -2
  88. package/optimize/es/components/modal/modal.js +1 -3
  89. package/optimize/es/components/observer/mutation_observer/mutation_observer.js +1 -1
  90. package/optimize/es/components/page/page_sidebar/page_sidebar.js +5 -1
  91. package/optimize/es/components/tabs/tabbed_content/tabbed_content.js +2 -19
  92. package/optimize/es/global_styling/functions/logicals.json +56 -0
  93. package/optimize/es/global_styling/mixins/_typography.js +1 -1
  94. package/optimize/es/services/theme/hooks.js +11 -16
  95. package/optimize/lib/components/card/card.styles.js +2 -2
  96. package/optimize/lib/components/combo_box/combo_box.js +2 -15
  97. package/optimize/lib/components/date_picker/react-datepicker/original.package.json +124 -0
  98. package/optimize/lib/components/description_list/description_list.js +5 -2
  99. package/optimize/lib/components/description_list/description_list_context.js +2 -1
  100. package/optimize/lib/components/description_list/description_list_description.js +3 -1
  101. package/optimize/lib/components/description_list/description_list_description.styles.js +5 -2
  102. package/optimize/lib/components/description_list/description_list_title.js +4 -3
  103. package/optimize/lib/components/description_list/description_list_title.styles.js +7 -3
  104. package/optimize/lib/components/description_list/description_list_types.js +4 -2
  105. package/optimize/lib/components/form/field_search/field_search.js +6 -16
  106. package/optimize/lib/components/form/range/range_input.js +1 -1
  107. package/optimize/lib/components/header/header_section/header_section_item.js +4 -3
  108. package/optimize/lib/components/icon/icon.js +3 -10
  109. package/optimize/lib/components/list_group/list_group_item.js +3 -2
  110. package/optimize/lib/components/modal/modal.js +1 -3
  111. package/optimize/lib/components/observer/mutation_observer/mutation_observer.js +1 -1
  112. package/optimize/lib/components/page/page_sidebar/page_sidebar.js +5 -1
  113. package/optimize/lib/components/tabs/tabbed_content/tabbed_content.js +2 -19
  114. package/optimize/lib/global_styling/functions/logicals.json +56 -0
  115. package/optimize/lib/global_styling/mixins/_typography.js +1 -1
  116. package/optimize/lib/services/theme/hooks.js +10 -15
  117. package/package.json +1 -1
  118. package/src/components/badge/_badge.scss +0 -5
  119. package/src/components/datagrid/_data_grid_data_row.scss +7 -0
  120. package/src/components/datagrid/body/header/_data_grid_header_row.scss +1 -1
  121. package/src/components/filter_group/_filter_group.scss +3 -1
  122. package/src/components/flex/_flex_group.scss +2 -11
  123. package/src/components/flex/_flex_item.scss +0 -6
  124. package/src/components/form/field_search/_field_search.scss +0 -5
  125. package/src/components/form/form_control_layout/_form_control_layout_delimited.scss +0 -3
  126. package/src/components/form/form_row/_form_row.scss +0 -1
  127. package/src/components/header/header_section/_header_section_item.scss +1 -1
  128. package/src/components/list_group/_list_group_item.scss +3 -25
  129. package/src/components/modal/_modal.scss +5 -20
  130. package/src/components/page/page_content/_page_content.scss +0 -1
  131. package/src/components/table/_responsive.scss +0 -1
  132. package/src/components/table/_table.scss +0 -5
  133. package/src/global_styling/mixins/_form.scss +0 -4
  134. package/src/global_styling/mixins/_helpers.scss +0 -8
  135. package/src/global_styling/mixins/_typography.scss +1 -5
  136. package/src/global_styling/utility/_index.scss +0 -1
  137. package/test-env/components/basic_table/basic_table.js +13 -2
  138. package/test-env/components/basic_table/in_memory_table.js +13 -2
  139. package/test-env/components/card/card.styles.js +2 -2
  140. package/test-env/components/combo_box/combo_box.js +2 -15
  141. package/test-env/components/datagrid/body/data_grid_body.js +17 -6
  142. package/test-env/components/datagrid/body/data_grid_cell.js +29 -12
  143. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +17 -6
  144. package/test-env/components/datagrid/body/header/data_grid_header_row.js +17 -6
  145. package/test-env/components/datagrid/data_grid.js +17 -6
  146. package/test-env/components/datagrid/utils/in_memory.js +17 -6
  147. package/test-env/components/date_picker/react-datepicker/original.package.json +124 -0
  148. package/test-env/components/description_list/description_list.js +11 -3
  149. package/test-env/components/description_list/description_list_context.js +2 -1
  150. package/test-env/components/description_list/description_list_description.js +3 -1
  151. package/test-env/components/description_list/description_list_description.styles.js +5 -2
  152. package/test-env/components/description_list/description_list_title.js +4 -3
  153. package/test-env/components/description_list/description_list_title.styles.js +7 -3
  154. package/test-env/components/description_list/description_list_types.js +4 -2
  155. package/test-env/components/form/field_search/field_search.js +6 -16
  156. package/test-env/components/form/range/range_input.js +1 -1
  157. package/test-env/components/header/header_section/header_section_item.js +4 -3
  158. package/test-env/components/list_group/list_group.js +7 -1
  159. package/test-env/components/list_group/list_group_item.js +10 -3
  160. package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +13 -1
  161. package/test-env/components/modal/modal.js +1 -3
  162. package/test-env/components/observer/mutation_observer/mutation_observer.js +1 -1
  163. package/test-env/components/page/page_sidebar/page_sidebar.js +5 -1
  164. package/test-env/components/table/table_row_cell.js +4 -6
  165. package/test-env/components/tabs/tabbed_content/tabbed_content.js +2 -19
  166. package/test-env/global_styling/functions/logicals.json +56 -0
  167. package/test-env/global_styling/mixins/_typography.js +1 -1
  168. package/test-env/services/theme/hooks.js +10 -15
  169. package/src/global_styling/utility/_utility.scss +0 -15
@@ -88,9 +88,7 @@ var EuiModal = function EuiModal(_ref) {
88
88
  color: "text",
89
89
  "aria-label": closeModal
90
90
  });
91
- }), (0, _react2.jsx)("div", {
92
- className: "euiModal__flex"
93
- }, children))));
91
+ }), children)));
94
92
  };
95
93
 
96
94
  exports.EuiModal = EuiModal;
@@ -69,7 +69,7 @@ var EuiMutationObserver = /*#__PURE__*/function (_EuiObserver) {
69
69
  exports.EuiMutationObserver = EuiMutationObserver;
70
70
 
71
71
  var makeMutationObserver = function makeMutationObserver(node, _observerOptions, callback) {
72
- // IE11 and the MutationObserver polyfill used in Kibana (for Jest) implement
72
+ // The MutationObserver polyfill used in Kibana (for Jest) implements
73
73
  // an older spec in which specifying `attributeOldValue` or `attributeFilter`
74
74
  // without specifying `attributes` results in a `SyntaxError`.
75
75
  // The following logic patches the newer spec in which `attributes: true` can be
@@ -76,13 +76,17 @@ var EuiPageSidebar = function EuiPageSidebar(_ref) {
76
76
  setInlineStyles = _useState2[1];
77
77
 
78
78
  (0, _react.useEffect)(function () {
79
+ var updatedStyles = _objectSpread(_objectSpread({}, style), (0, _global_styling.logicalStyle)('min-width', isResponding ? '100%' : minWidth));
80
+
79
81
  if (sticky) {
80
82
  var _document$body$datase;
81
83
 
82
84
  var euiHeaderFixedCounter = Number((_document$body$datase = document.body.dataset.fixedHeaders) !== null && _document$body$datase !== void 0 ? _document$body$datase : 0);
83
85
  var offset = _typeof(sticky) === 'object' ? sticky === null || sticky === void 0 ? void 0 : sticky.offset : themeContext.euiTheme.base * 3 * euiHeaderFixedCounter;
84
- setInlineStyles(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, style), (0, _global_styling.logicalStyle)('min-width', isResponding ? '100%' : minWidth)), (0, _global_styling.logicalStyle)('top', offset)), (0, _global_styling.logicalStyle)('max-height', "calc(100vh - ".concat(offset, "px)"))));
86
+ updatedStyles = _objectSpread(_objectSpread(_objectSpread({}, updatedStyles), (0, _global_styling.logicalStyle)('top', offset)), (0, _global_styling.logicalStyle)('max-height', "calc(100vh - ".concat(offset, "px)")));
85
87
  }
88
+
89
+ setInlineStyles(updatedStyles);
86
90
  }, [style, sticky, themeContext.euiTheme.base, isResponding, minWidth]);
87
91
  return (0, _react2.jsx)("div", _extends({
88
92
  className: className,
@@ -219,9 +219,8 @@ EuiTableRowCell.propTypes = {
219
219
  showOnHover: _propTypes.default.bool,
220
220
 
221
221
  /**
222
- * Setting `textOnly` to `false` will break words unnecessarily on FF and
223
- * IE. To combat this problem on FF, wrap contents with the css utility
224
- * `.eui-textBreakWord`.
222
+ * Creates a text wrapper around cell content that helps word break or truncate
223
+ * long text correctly.
225
224
  */
226
225
  textOnly: _propTypes.default.bool,
227
226
 
@@ -242,9 +241,8 @@ EuiTableRowCell.propTypes = {
242
241
  showOnHover: _propTypes.default.bool,
243
242
 
244
243
  /**
245
- * Setting `textOnly` to `false` will break words unnecessarily on FF and
246
- * IE. To combat this problem on FF, wrap contents with the css utility
247
- * `.eui-textBreakWord`.
244
+ * Creates a text wrapper around cell content that helps word break or truncate
245
+ * long text correctly.
248
246
  */
249
247
  textOnly: _propTypes.default.bool,
250
248
 
@@ -149,24 +149,6 @@ var EuiTabbedContent = /*#__PURE__*/function (_Component) {
149
149
  }
150
150
 
151
151
  _createClass(EuiTabbedContent, [{
152
- key: "componentDidMount",
153
- value: function componentDidMount() {
154
- // IE11 doesn't support the `relatedTarget` event property for blur events
155
- // but does add it for focusout. React doesn't support `onFocusOut` so here we are.
156
- if (this.tabsRef.current) {
157
- // Current short-term solution for event listener (see https://github.com/elastic/eui/pull/2717)
158
- this.tabsRef.current.addEventListener('focusout', this.removeFocus);
159
- }
160
- }
161
- }, {
162
- key: "componentWillUnmount",
163
- value: function componentWillUnmount() {
164
- if (this.tabsRef.current) {
165
- // Current short-term solution for event listener (see https://github.com/elastic/eui/pull/2717)
166
- this.tabsRef.current.removeEventListener('focusout', this.removeFocus);
167
- }
168
- }
169
- }, {
170
152
  key: "render",
171
153
  value: function render() {
172
154
  var _this2 = this;
@@ -195,7 +177,8 @@ var EuiTabbedContent = /*#__PURE__*/function (_Component) {
195
177
  ref: this.tabsRef,
196
178
  expand: expand,
197
179
  size: size,
198
- onFocus: this.initializeFocus
180
+ onFocus: this.initializeFocus,
181
+ onBlur: this.removeFocus
199
182
  }, tabs.map(function (tab) {
200
183
  var id = tab.id,
201
184
  name = tab.name,
@@ -0,0 +1,56 @@
1
+ {
2
+ "height": "block-size",
3
+ "width": "inline-size",
4
+ "max-height": "max-block-size",
5
+ "max-width": "max-inline-size",
6
+ "min-height": "min-block-size",
7
+ "min-width": "min-inline-size",
8
+ "top": "inset-block-start",
9
+ "right": "inset-inline-end",
10
+ "bottom": "inset-block-end",
11
+ "left": "inset-inline-start",
12
+ "horizontal": "inset-block",
13
+ "vertical": "inset-inline",
14
+ "margin-left": "margin-inline-start",
15
+ "margin-right": "margin-inline-end",
16
+ "margin-top": "margin-block-start",
17
+ "margin-bottom": "margin-block-end",
18
+ "margin-horizontal": "margin-inline",
19
+ "margin-vertical": "margin-block",
20
+ "padding-left": "padding-inline-start",
21
+ "padding-right": "padding-inline-end",
22
+ "padding-top": "padding-block-start",
23
+ "padding-bottom": "padding-block-end",
24
+ "padding-horizontal": "padding-inline",
25
+ "padding-vertical": "padding-block",
26
+ "overflow-x": "overflow-inline",
27
+ "overflow-y": "overflow-block",
28
+ "border-horizontal": "border-inline",
29
+ "border-horizontal-color": "border-inline-color",
30
+ "border-horizontal-width": "border-inline-width",
31
+ "border-horizontal-style": "border-inline-style",
32
+ "border-vertical": "border-block",
33
+ "border-vertical-color": "border-block-color",
34
+ "border-vertical-width": "border-block-width",
35
+ "border-vertical-style": "border-block-style",
36
+ "border-bottom": "border-block-end",
37
+ "border-bottom-color": "border-block-end-color",
38
+ "border-bottom-style": "border-block-end-style",
39
+ "border-bottom-width": "border-block-end-width",
40
+ "border-top": "border-block-start",
41
+ "border-top-color": "border-block-start-color",
42
+ "border-top-style": "border-block-start-style",
43
+ "border-top-width": "border-block-start-width",
44
+ "border-right": "border-inline-end",
45
+ "border-right-color": "border-inline-end-color",
46
+ "border-right-style": "border-inline-end-style",
47
+ "border-right-width": "border-inline-end-width",
48
+ "border-left": "border-inline-start",
49
+ "border-left-color": "border-inline-start-color",
50
+ "border-left-style": "border-inline-start-style",
51
+ "border-left-width": "border-inline-start-width",
52
+ "border-top-left-radius": "border-start-start-radius",
53
+ "border-top-right-radius": "border-start-end-radius",
54
+ "border-bottom-left-radius": "border-end-start-radius",
55
+ "border-bottom-right-radius": "border-end-end-radius"
56
+ }
@@ -45,7 +45,7 @@ var useEuiFontSize = function useEuiFontSize(scale, options) {
45
45
  exports.useEuiFontSize = useEuiFontSize;
46
46
 
47
47
  var euiTextBreakWord = function euiTextBreakWord() {
48
- return "\n overflow-wrap: break-word !important; // makes sure the long string will wrap and not bust out of the container\n word-wrap: break-word !important; // spec says, they are literally just alternate names for each other but some browsers support one and not the other\n word-break: break-word; // IE doesn't understand but that's ok\n";
48
+ return "\n overflow-wrap: break-word !important; // makes sure the long string will wrap and not bust out of the container\n word-break: break-word;\n";
49
49
  };
50
50
  /**
51
51
  * Prevent text from wrapping onto multiple lines, and truncate with an ellipsis.
@@ -23,11 +23,14 @@ var useEuiTheme = function useEuiTheme() {
23
23
  var theme = (0, _react.useContext)(_context.EuiThemeContext);
24
24
  var colorMode = (0, _react.useContext)(_context.EuiColorModeContext);
25
25
  var modifications = (0, _react.useContext)(_context.EuiModificationsContext);
26
- return {
27
- euiTheme: theme,
28
- colorMode: colorMode,
29
- modifications: modifications
30
- };
26
+ var assembledTheme = (0, _react.useMemo)(function () {
27
+ return {
28
+ euiTheme: theme,
29
+ colorMode: colorMode,
30
+ modifications: modifications
31
+ };
32
+ }, [theme, colorMode, modifications]);
33
+ return assembledTheme;
31
34
  };
32
35
 
33
36
  exports.useEuiTheme = useEuiTheme;
@@ -38,17 +41,9 @@ var withEuiTheme = function withEuiTheme(Component) {
38
41
  var componentName = Component.displayName || Component.name || 'ComponentWithTheme';
39
42
 
40
43
  var Render = function Render(props, ref) {
41
- var _useEuiTheme = useEuiTheme(),
42
- euiTheme = _useEuiTheme.euiTheme,
43
- colorMode = _useEuiTheme.colorMode,
44
- modifications = _useEuiTheme.modifications;
45
-
44
+ var theme = useEuiTheme();
46
45
  return (0, _react2.jsx)(Component, _extends({
47
- theme: {
48
- euiTheme: euiTheme,
49
- colorMode: colorMode,
50
- modifications: modifications
51
- },
46
+ theme: theme,
52
47
  ref: ref
53
48
  }, props));
54
49
  };
@@ -84,14 +84,14 @@ export var euiCardStyles = function euiCardStyles(euiThemeContext, paddingSize,
84
84
  euiCard__description: /*#__PURE__*/css(logicalCSS('margin-top', halfSpacing), ";;label:euiCard__description;"),
85
85
  euiCard__footer: /*#__PURE__*/css("flex-grow:0;", logicalCSS('width', '100%'), ";", logicalCSS('margin-top', spacing), ";;label:euiCard__footer;"),
86
86
  top: {
87
- euiCard__top: /*#__PURE__*/css("flex-grow:0;font-size:0;position:relative;", logicalCSS('min-height', '1px'), ";", logicalCSS('margin-bottom', spacing), ";;label:euiCard__top;"),
87
+ euiCard__top: /*#__PURE__*/css("flex-grow:0;font-size:0;position:relative;", logicalCSS('margin-bottom', spacing), ";;label:euiCard__top;"),
88
88
  layout: {
89
89
  vertical: /*#__PURE__*/css(logicalCSS('width', '100%'), ";;label:vertical;"),
90
90
  horizontal: /*#__PURE__*/css(logicalCSS('width', 'auto'), ";;label:horizontal;")
91
91
  },
92
92
  disabled: _ref2
93
93
  },
94
- euiCard__image: /*#__PURE__*/css("position:relative;overflow:hidden;", logicalCSS('width', "calc(100% + (".concat(paddingAmount, " * 2))")), ";", logicalCSS('left', "-".concat(paddingAmount)), ";", logicalCSS('top', "-".concat(paddingAmount)), ";", logicalCSS('margin-bottom', "-".concat(paddingAmount)), ";", logicals['border-top-left-radius'], ":calc(", euiTheme.border.radius.medium, " - 1px);", logicals['border-top-right-radius'], ":calc(", euiTheme.border.radius.medium, " - 1px);", color === 'transparent' ? "border-radius: ".concat(euiTheme.border.radius.medium, ";") : undefined, " img{", logicalCSS('width', '100%'), ";};label:euiCard__image;"),
94
+ euiCard__image: /*#__PURE__*/css("position:relative;overflow:hidden;", logicalCSS('width', "calc(100% + (".concat(paddingAmount, " * 2))")), ";", logicalCSS('left', "-".concat(paddingAmount)), ";", logicalCSS('top', "-".concat(paddingAmount)), ";", logicalCSS('margin-bottom', "-".concat(paddingAmount)), ";", logicalCSS('border-top-left-radius', "calc(".concat(euiTheme.border.radius.medium, " - ").concat(euiTheme.border.width.thin, ")")), " ", logicals['border-top-right-radius'], ":calc(", euiTheme.border.radius.medium, " - ", euiTheme.border.width.thin, ");", color === 'transparent' ? "border-radius: ".concat(euiTheme.border.radius.medium, ";") : undefined, " img{", logicalCSS('width', '100%'), ";};label:euiCard__image;"),
95
95
  icon: {
96
96
  euiCard__icon: /*#__PURE__*/css(";label:euiCard__icon;"),
97
97
  withImage: /*#__PURE__*/css("position:absolute;", logicalCSS('top', '50%'), ";", logicalCSS('left', '50%'), ";transform:translate(-50%, calc(-50% + -", paddingAmount, "))!important;;label:withImage;"),
@@ -75,17 +75,9 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
75
75
  _defineProperty(_assertThisInitialized(_this), "comboBoxRefInstance", null);
76
76
 
77
77
  _defineProperty(_assertThisInitialized(_this), "comboBoxRefCallback", function (ref) {
78
- // IE11 doesn't support the `relatedTarget` event property for blur events
79
- // but does add it for focusout. React doesn't support `onFocusOut` so here we are.
80
- if (_this.comboBoxRefInstance) {
81
- _this.comboBoxRefInstance.removeEventListener('focusout', _this.onContainerBlur);
82
- }
83
-
84
78
  _this.comboBoxRefInstance = ref;
85
79
 
86
80
  if (_this.comboBoxRefInstance) {
87
- _this.comboBoxRefInstance.addEventListener('focusout', _this.onContainerBlur);
88
-
89
81
  var comboBoxBounds = _this.comboBoxRefInstance.getBoundingClientRect();
90
82
 
91
83
  _this.setState({
@@ -394,13 +386,7 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
394
386
 
395
387
  _defineProperty(_assertThisInitialized(_this), "onContainerBlur", function (event) {
396
388
  // close the options list, unless the user clicked on an option
397
-
398
- /**
399
- * FireFox returns `relatedTarget` as `null` for security reasons, but provides a proprietary `explicitOriginalTarget`.
400
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Event/explicitOriginalTarget
401
- */
402
- var focusEvent = event;
403
- var relatedTarget = focusEvent.relatedTarget || focusEvent.explicitOriginalTarget;
389
+ var relatedTarget = event.relatedTarget;
404
390
 
405
391
  var focusedInOptionsList = relatedTarget && _this.listRefInstance && _this.listRefInstance.contains(relatedTarget);
406
392
 
@@ -845,6 +831,7 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
845
831
  className: classes,
846
832
  "data-test-subj": dataTestSubj,
847
833
  onKeyDown: this.onKeyDown,
834
+ onBlur: this.onContainerBlur,
848
835
  ref: this.comboBoxRefCallback
849
836
  }), ___EmotionJSX(EuiComboBoxInput, {
850
837
  autoSizeInputRef: this.autoSizeInputRefCallback,
@@ -0,0 +1,124 @@
1
+ {
2
+ "author": "HackerOne",
3
+ "name": "@elastic/react-datepicker",
4
+ "description": "Forked from Hacker0x01/react-datepicker for accessibility - simple and reusable datepicker component for React",
5
+ "private": true,
6
+ "version": "2.0.0",
7
+ "license": "MIT",
8
+ "homepage": "https://github.com/Hacker0x01/react-datepicker",
9
+ "main": "lib",
10
+ "files": [
11
+ "*.md",
12
+ "dist",
13
+ "datepicker-lib",
14
+ "es",
15
+ "src/stylesheets"
16
+ ],
17
+ "resolutions": {
18
+ "**/diff": "^3.5.0"
19
+ },
20
+ "devDependencies": {
21
+ "babel-core": "^6.26.0",
22
+ "babel-eslint": "^8.0.2",
23
+ "babel-loader": "^6.2.10",
24
+ "babel-plugin-add-react-displayname": "^0.0.4",
25
+ "babel-plugin-external-helpers": "^6.22.0",
26
+ "babel-plugin-react-transform": "^3.0.0",
27
+ "babel-plugin-transform-class-properties": "^6.24.1",
28
+ "babel-plugin-transform-react-remove-prop-types": "^0.4.10",
29
+ "babel-polyfill": "^6.26.0",
30
+ "babel-preset-airbnb": "^2.4.0",
31
+ "babel-preset-env": "^1.6.1",
32
+ "babel-preset-react": "^6.24.1",
33
+ "babel-preset-stage-0": "^6.24.1",
34
+ "chai": "^3.5.0",
35
+ "cross-env": "^5.1.1",
36
+ "css-loader": "^1.0.0",
37
+ "enzyme": "^3.10.0",
38
+ "enzyme-adapter-react-16": "^1.14.0",
39
+ "eslint": "^4.18.2",
40
+ "eslint-plugin-import": "^2.8.0",
41
+ "eslint-plugin-node": "^5.2.1",
42
+ "eslint-plugin-promise": "^3.6.0",
43
+ "eslint-plugin-react": "^7.4.0",
44
+ "express": "^4.16.2",
45
+ "extract-text-webpack-plugin": "^1.0.1",
46
+ "flow-bin": "^0.68.0",
47
+ "highlight.js": "^9.12.0",
48
+ "husky": "^0.14.3",
49
+ "isparta-loader": "^2.0.0",
50
+ "karma": "^1.7.1",
51
+ "karma-chai": "^0.1.0",
52
+ "karma-coverage": "^1.1.1",
53
+ "karma-firefox-launcher": "^1.0.1",
54
+ "karma-mocha": "^1.3.0",
55
+ "karma-sinon": "^1.0.5",
56
+ "karma-sourcemap-loader": "^0.3.7",
57
+ "karma-webpack": "^2.0.5",
58
+ "lint-staged": "^6.0.0",
59
+ "lodash": "^4.17.13",
60
+ "mocha": "^4.0.1",
61
+ "moment": "^2.20.1",
62
+ "node-sass": "^4.13.1",
63
+ "npm-run-all": "^4.1.2",
64
+ "prettier": "^1.9.2",
65
+ "react": "^16.2.0",
66
+ "react-docgen": "^2.20.0",
67
+ "react-dom": "^16.2.0",
68
+ "react-test-renderer": "^16.8.6",
69
+ "react-transform-hmr": "^1.0.4",
70
+ "rimraf": "^2.6.2",
71
+ "rollup": "^0.62.0",
72
+ "rollup-plugin-babel": "^3.0.2",
73
+ "rollup-plugin-commonjs": "^8.2.6",
74
+ "rollup-plugin-node-resolve": "^3.0.0",
75
+ "rollup-plugin-uglify": "^2.0.1",
76
+ "sass-lint": "^1.12.1",
77
+ "sass-loader": "^4.1.1",
78
+ "sinon": "^4.1.2",
79
+ "style-loader": "^0.19.0",
80
+ "webpack": "^1.13.0",
81
+ "webpack-dev-middleware": "^1.12.0",
82
+ "webpack-dev-server": "^3.1.14",
83
+ "webpack-hot-middleware": "^2.20.0"
84
+ },
85
+ "peerDependencies": {
86
+ "moment": "^2.20.0",
87
+ "react": "^16.0.0",
88
+ "react-dom": "^16.0.0"
89
+ },
90
+ "dependencies": {
91
+ "classnames": "^2.2.5",
92
+ "focus-trap-react": "^4.0.0",
93
+ "json-loader": "^0.5.7",
94
+ "prop-types": "^15.6.0",
95
+ "react-onclickoutside": "^6.7.1",
96
+ "react-popper": "^1.0.2"
97
+ },
98
+ "scripts": {
99
+ "eslint": "eslint {src,test,docs-site/src}/**/*.{js,jsx} *.js",
100
+ "flow": "flow",
101
+ "precommit": "lint-staged",
102
+ "sass-lint": "sass-lint --config .sass-lint.yml 'src/stylesheets/*.scss, docs-site/src/*.scss' -i 'docs-site/src/higlight.scss, docs-site/src/reset.scss'",
103
+ "lint": "run-p eslint flow sass-lint",
104
+ "start": "cross-env MODULES=false node server.js",
105
+ "test": "cross-env NODE_ENV=test karma start karma.conf.js --single-run",
106
+ "prepublish": "test $(npm -v | tr . '\\n' | head -n 1) -ge '4' || exit 1",
107
+ "prepare": "npm run build",
108
+ "prebuild": "rimraf es lib dist",
109
+ "build": "cross-env NODE_ENV=production run-p build:** && run-p css:**",
110
+ "build-dev": "cross-env NODE_ENV=development run-p build:** && run-p css:**",
111
+ "css:prod": "mkdir -p lib && node-sass --output-style compressed src/stylesheets/datepicker.scss > lib/react-datepicker.min.css",
112
+ "css:modules:prod": "mkdir -p lib && node-sass --output-style compressed src/stylesheets/datepicker-cssmodules.scss > lib/react-datepicker-cssmodules.min.css",
113
+ "css:dev": "mkdir -p lib && node-sass --output-style expanded src/stylesheets/datepicker.scss > lib/react-datepicker.css",
114
+ "css:modules:dev": "mkdir -p lib && node-sass --output-style expanded src/stylesheets/datepicker-cssmodules.scss > lib/react-datepicker-cssmodules.css",
115
+ "build:es": "cross-env BABEL_ENV=cjs rollup -c -i src/index.jsx -o ../react-datepicker.js",
116
+ "build:docs": "cross-env MODULES=false webpack --config webpack.docs.config.js"
117
+ },
118
+ "lint-staged": {
119
+ "*.{js,jsx,json,css,scss,md}": [
120
+ "prettier --write",
121
+ "git add"
122
+ ]
123
+ }
124
+ }
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["align", "children", "className", "compressed", "descriptionProps", "listItems", "textStyle", "titleProps", "type"];
3
+ var _excluded = ["align", "children", "className", "compressed", "descriptionProps", "listItems", "textStyle", "titleProps", "type", "gutterSize"];
4
4
 
5
5
  /*
6
6
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@@ -31,6 +31,8 @@ export var EuiDescriptionList = function EuiDescriptionList(_ref) {
31
31
  titleProps = _ref.titleProps,
32
32
  _ref$type = _ref.type,
33
33
  type = _ref$type === void 0 ? 'row' : _ref$type,
34
+ _ref$gutterSize = _ref.gutterSize,
35
+ gutterSize = _ref$gutterSize === void 0 ? 'm' : _ref$gutterSize,
34
36
  rest = _objectWithoutProperties(_ref, _excluded);
35
37
 
36
38
  var euiTheme = useEuiTheme();
@@ -56,7 +58,8 @@ export var EuiDescriptionList = function EuiDescriptionList(_ref) {
56
58
  type: type,
57
59
  compressed: compressed,
58
60
  textStyle: textStyle,
59
- align: align
61
+ align: align,
62
+ gutterSize: gutterSize
60
63
  }
61
64
  }, ___EmotionJSX("dl", _extends({
62
65
  className: classes,
@@ -9,6 +9,7 @@ import { createContext } from 'react';
9
9
  export var contextDefaults = {
10
10
  type: 'row',
11
11
  textStyle: 'normal',
12
- align: 'left'
12
+ align: 'left',
13
+ gutterSize: 'm'
13
14
  };
14
15
  export var EuiDescriptionListContext = /*#__PURE__*/createContext(contextDefaults);
@@ -26,7 +26,8 @@ export var EuiDescriptionListDescription = function EuiDescriptionListDescriptio
26
26
  type = _useContext.type,
27
27
  textStyle = _useContext.textStyle,
28
28
  compressed = _useContext.compressed,
29
- align = _useContext.align;
29
+ align = _useContext.align,
30
+ gutterSize = _useContext.gutterSize;
30
31
 
31
32
  var theme = useEuiTheme();
32
33
  var styles = euiDescriptionListDescriptionStyles(theme);
@@ -43,6 +44,7 @@ export var EuiDescriptionListDescription = function EuiDescriptionListDescriptio
43
44
  conditionalStyles.push(styles.left);
44
45
  }
45
46
 
47
+ conditionalStyles.push(styles[gutterSize]);
46
48
  break;
47
49
  }
48
50
 
@@ -22,7 +22,7 @@ var _ref = process.env.NODE_ENV === "production" ? {
22
22
 
23
23
  export var euiDescriptionListDescriptionStyles = function euiDescriptionListDescriptionStyles(euiThemeContext) {
24
24
  var euiTheme = euiThemeContext.euiTheme;
25
- var columnDisplay = "\n ".concat(logicalCSS('width', '50%'), " // Flex-basis doesn't work in IE with padding\n ").concat(logicalCSS('padding-left', euiTheme.size.s), "\n &:not(:first-of-type) {\n ").concat(logicalCSS('margin-top', euiTheme.size.base), "\n }\n ");
25
+ var columnDisplay = "\n ".concat(logicalCSS('width', '50%'), "\n ").concat(logicalCSS('padding-left', euiTheme.size.s), "\n ");
26
26
  return {
27
27
  euiDescriptionList__description: /*#__PURE__*/css(";label:euiDescriptionList__description;"),
28
28
  // Types
@@ -42,6 +42,9 @@ export var euiDescriptionListDescriptionStyles = function euiDescriptionListDesc
42
42
  normal: /*#__PURE__*/css(euiFontSize(euiThemeContext, 's'), ";;label:normal;")
43
43
  },
44
44
  // Column types should align description text to the left when EuiDecriptionList is centered
45
- left: /*#__PURE__*/css(logicalTextAlignCSS('left'), ";;label:left;")
45
+ left: /*#__PURE__*/css(logicalTextAlignCSS('left'), ";;label:left;"),
46
+ // Gutter
47
+ s: /*#__PURE__*/css("&:not(:first-of-type){", logicalCSS('margin-top', euiTheme.size.s), ";};label:s;"),
48
+ m: /*#__PURE__*/css("&:not(:first-of-type){", logicalCSS('margin-top', euiTheme.size.base), ";};label:m;")
46
49
  };
47
50
  };
@@ -26,11 +26,12 @@ export var EuiDescriptionListTitle = function EuiDescriptionListTitle(_ref) {
26
26
  type = _useContext.type,
27
27
  textStyle = _useContext.textStyle,
28
28
  compressed = _useContext.compressed,
29
- align = _useContext.align;
29
+ align = _useContext.align,
30
+ gutterSize = _useContext.gutterSize;
30
31
 
31
32
  var theme = useEuiTheme();
32
33
  var styles = euiDescriptionListTitleStyles(theme);
33
- var conditionalStyles = compressed && textStyle === 'reverse' ? [styles.fontStyles.compressed] : [styles.fontStyles[textStyle]];
34
+ var conditionalStyles = compressed && textStyle !== 'reverse' ? [styles.fontStyles.compressed] : [styles.fontStyles[textStyle]];
34
35
 
35
36
  switch (type) {
36
37
  case 'inline':
@@ -46,7 +47,7 @@ export var EuiDescriptionListTitle = function EuiDescriptionListTitle(_ref) {
46
47
  break;
47
48
  }
48
49
 
49
- var cssStyles = [styles.euiDescriptionList__title, styles[type]].concat(_toConsumableArray(conditionalStyles));
50
+ var cssStyles = [styles.euiDescriptionList__title, styles[type], styles[gutterSize]].concat(_toConsumableArray(conditionalStyles));
50
51
  var classes = classNames('euiDescriptionList__title', className);
51
52
  return ___EmotionJSX("dt", _extends({
52
53
  className: classes,
@@ -12,9 +12,9 @@ import { euiTitle } from '../title/title.styles';
12
12
  export var euiDescriptionListTitleStyles = function euiDescriptionListTitleStyles(euiThemeContext) {
13
13
  var euiTheme = euiThemeContext.euiTheme,
14
14
  colorMode = euiThemeContext.colorMode;
15
- var columnDisplay = "\n ".concat(logicalCSS('width', '50%'), " // Flex-basis doesn't work in IE with padding\n ").concat(logicalCSS('padding-right', euiTheme.size.s), "\n ");
15
+ var columnDisplay = "\n ".concat(logicalCSS('width', '50%'), "\n ").concat(logicalCSS('padding-right', euiTheme.size.s), "\n ");
16
16
  return {
17
- euiDescriptionList__title: /*#__PURE__*/css(euiTextBreakWord(), "&:not(:first-of-type){", logicalCSS('margin-top', euiTheme.size.base), ";};label:euiDescriptionList__title;"),
17
+ euiDescriptionList__title: /*#__PURE__*/css(euiTextBreakWord(), ";;label:euiDescriptionList__title;"),
18
18
  // Types
19
19
  row: /*#__PURE__*/css(";label:row;"),
20
20
  column: /*#__PURE__*/css(columnDisplay, ";;label:column;"),
@@ -32,6 +32,10 @@ export var euiDescriptionListTitleStyles = function euiDescriptionListTitleStyle
32
32
  compressed: /*#__PURE__*/css(euiFontSize(euiThemeContext, 'xs'), ";", logicalCSS('padding-vertical', '0'), " ", logicalCSS('padding-horizontal', euiTheme.size.xs), ";;label:compressed;")
33
33
  },
34
34
  // Alignment
35
- right: /*#__PURE__*/css(logicalTextAlignCSS('right'), ";;label:right;")
35
+ right: /*#__PURE__*/css(logicalTextAlignCSS('right'), ";;label:right;"),
36
+ // Gutter
37
+ // Add margin only to the non-first <dt>.
38
+ s: /*#__PURE__*/css("&:not(:first-of-type){", logicalCSS('margin-top', euiTheme.size.s), ";};label:s;"),
39
+ m: /*#__PURE__*/css("&:not(:first-of-type){", logicalCSS('margin-top', euiTheme.size.base), ";};label:m;")
36
40
  };
37
41
  };
@@ -7,4 +7,5 @@
7
7
  */
8
8
  export var TYPES = ['row', 'inline', 'column', 'responsiveColumn'];
9
9
  export var ALIGNMENTS = ['center', 'left'];
10
- export var TEXT_STYLES = ['normal', 'reverse'];
10
+ export var TEXT_STYLES = ['normal', 'reverse'];
11
+ export var GUTTER_SIZES = ['s', 'm'];
@@ -68,26 +68,16 @@ export var EuiFieldSearch = /*#__PURE__*/function (_Component) {
68
68
 
69
69
  if (nativeInputValueSetter) {
70
70
  nativeInputValueSetter.call(_this.inputElement, '');
71
- } // dispatch input event, with IE11 support/fallback
71
+ } // dispatch input event
72
72
 
73
73
 
74
- var event;
75
-
76
- if ('Event' in window && typeof Event === 'function') {
77
- event = new Event('input', {
78
- bubbles: true,
79
- cancelable: false
80
- });
81
- } else {
82
- // IE11
83
- event = document.createEvent('Event');
84
- event.initEvent('input', true, false);
85
- }
74
+ var event = new Event('input', {
75
+ bubbles: true,
76
+ cancelable: false
77
+ });
86
78
 
87
79
  if (_this.inputElement) {
88
- if (event) {
89
- _this.inputElement.dispatchEvent(event);
90
- } // set focus on the search field
80
+ _this.inputElement.dispatchEvent(event); // set focus on the search field
91
81
 
92
82
 
93
83
  _this.inputElement.focus();
@@ -29,7 +29,7 @@ export var EuiRangeInput = function EuiRangeInput(_ref) {
29
29
  autoSize = _ref$autoSize === void 0 ? true : _ref$autoSize,
30
30
  rest = _objectWithoutProperties(_ref, _excluded);
31
31
 
32
- // Chrome will properly size the input based on the max value, but FF & IE do not.
32
+ // Chrome will properly size the input based on the max value, but FF does not.
33
33
  // Calculate the width of the input based on highest number of characters.
34
34
  // Add 2 to accommodate for input stepper
35
35
  var widthStyle = autoSize ? {
@@ -24,8 +24,9 @@ export var EuiHeaderSectionItem = function EuiHeaderSectionItem(_ref) {
24
24
  className = _ref.className,
25
25
  rest = _objectWithoutProperties(_ref, _excluded);
26
26
 
27
- var classes = classNames('euiHeaderSectionItem', borderToClassNameMap[border], className);
28
- return ___EmotionJSX("div", _extends({
27
+ var classes = classNames('euiHeaderSectionItem', borderToClassNameMap[border], className); // we check if there is any children and if not, we don't render anything
28
+
29
+ return children ? ___EmotionJSX("div", _extends({
29
30
  className: classes
30
- }, rest), children);
31
+ }, rest), children) : null;
31
32
  };
@@ -96,7 +96,7 @@ export var EuiIconClass = /*#__PURE__*/function (_PureComponent) {
96
96
 
97
97
  _this = _super.call(this, props);
98
98
 
99
- _defineProperty(_assertThisInitialized(_this), "isMounted", true);
99
+ _defineProperty(_assertThisInitialized(_this), "isMounted", false);
100
100
 
101
101
  _defineProperty(_assertThisInitialized(_this), "loadIconComponent", function (iconType) {
102
102
  if (iconComponentCache.hasOwnProperty(iconType)) {
@@ -154,6 +154,7 @@ export var EuiIconClass = /*#__PURE__*/function (_PureComponent) {
154
154
  _createClass(EuiIconClass, [{
155
155
  key: "componentDidMount",
156
156
  value: function componentDidMount() {
157
+ this.isMounted = true;
157
158
  var type = this.props.type;
158
159
 
159
160
  if (isEuiIconType(type) && this.state.icon == null) {
@@ -230,14 +231,7 @@ export var EuiIconClass = /*#__PURE__*/function (_PureComponent) {
230
231
 
231
232
  var styles = euiIconStyles(theme);
232
233
  var cssStyles = [styles.euiIcon, styles[size], color && isNamedColor(color) && styles[color], isCustomColor && styles.customColor, isElasticLogoOutline && styles.logoElasticOutline, isAppIcon && !appIconHasColor && styles.app, isLoading && styles.isLoading, !isLoading && neededLoading && styles.isLoaded];
233
- var icon = this.state.icon || empty; // This is a fix for IE and Edge, which ignores tabindex="-1" on an SVG, but respects
234
- // focusable="false".
235
- // - If there's no tabindex specified, we'll default the icon to not be focusable,
236
- // which is how SVGs behave in Chrome, Safari, and FF.
237
- // - If tabindex is -1, then the consumer wants the icon to be focusable by JavaScript only.
238
- // - If the tabindex is 0, the consumer wants the icon to be keyboard focusable.
239
-
240
- var focusable = tabIndex == null || tabIndex === -1 ? 'false' : 'true';
234
+ var icon = this.state.icon || empty;
241
235
 
242
236
  if (typeof icon === 'string') {
243
237
  return ___EmotionJSX("img", _extends({
@@ -269,7 +263,6 @@ export var EuiIconClass = /*#__PURE__*/function (_PureComponent) {
269
263
  style: optionalCustomStyles,
270
264
  css: cssStyles,
271
265
  tabIndex: tabIndex,
272
- focusable: focusable,
273
266
  role: "img",
274
267
  title: title,
275
268
  "data-icon-type": iconTitle,