@elastic/eui 85.1.0 → 86.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 (185) hide show
  1. package/dist/eui_charts_theme.js +26 -2
  2. package/dist/eui_charts_theme.js.map +1 -1
  3. package/es/components/combo_box/combo_box_options_list/combo_box_title.js +1 -3
  4. package/es/components/datagrid/body/data_grid_body.js +7 -7
  5. package/es/components/datagrid/body/data_grid_body_custom.js +7 -7
  6. package/es/components/datagrid/body/data_grid_body_virtualized.js +7 -7
  7. package/es/components/datagrid/body/data_grid_cell.js +14 -13
  8. package/es/components/datagrid/body/header/data_grid_control_header_cell.js +2 -2
  9. package/es/components/datagrid/body/header/data_grid_header_cell.js +1 -1
  10. package/es/components/datagrid/body/header/data_grid_header_row.js +5 -5
  11. package/es/components/datagrid/controls/data_grid_toolbar.js +31 -26
  12. package/es/components/datagrid/controls/display_selector.js +1 -1
  13. package/es/components/datagrid/data_grid.js +7 -7
  14. package/es/components/datagrid/utils/in_memory.js +4 -4
  15. package/es/components/datagrid/utils/row_heights.js +4 -4
  16. package/es/components/date_picker/date_picker.js +1 -1
  17. package/es/components/drag_and_drop/drag_drop_context.js +1 -1
  18. package/es/components/drag_and_drop/draggable.js +2 -2
  19. package/es/components/drag_and_drop/droppable.js +1 -1
  20. package/es/components/drag_and_drop/index.js +3 -2
  21. package/es/components/header/header_section/header_section_item_button.js +94 -0
  22. package/es/components/highlight/highlight.js +2 -2
  23. package/es/components/inline_edit/inline_edit_text.js +2 -3
  24. package/es/components/inline_edit/inline_edit_title.js +2 -3
  25. package/es/components/inner_text/index.js +1 -2
  26. package/es/components/markdown_editor/markdown_actions.js +1 -1
  27. package/es/components/markdown_editor/markdown_editor_text_area.js +10 -4
  28. package/es/components/modal/confirm_modal.js +11 -29
  29. package/es/components/outside_click_detector/outside_click_detector.js +10 -11
  30. package/es/components/page/page_template.js +8 -8
  31. package/es/components/popover/wrapping_popover.js +1 -9
  32. package/es/components/portal/portal.js +34 -24
  33. package/es/components/tabs/tabs.js +25 -0
  34. package/es/components/timeline/timeline_item_icon.js +3 -3
  35. package/es/components/tour/tour_step.js +16 -12
  36. package/es/services/color/eui_palettes.js +7 -1
  37. package/es/services/color/index.js +1 -1
  38. package/es/services/index.js +1 -1
  39. package/es/services/time/timer.js +3 -5
  40. package/es/test/rtl/component_helpers.js +1 -1
  41. package/es/test/rtl/index.js +2 -1
  42. package/es/test/rtl/render_hook.js +23 -0
  43. package/eui.d.ts +1234 -748
  44. package/i18ntokens.json +144 -144
  45. package/lib/components/combo_box/combo_box_options_list/combo_box_title.js +1 -3
  46. package/lib/components/datagrid/body/data_grid_body.js +7 -7
  47. package/lib/components/datagrid/body/data_grid_body_custom.js +7 -7
  48. package/lib/components/datagrid/body/data_grid_body_virtualized.js +7 -7
  49. package/lib/components/datagrid/body/data_grid_cell.js +14 -13
  50. package/lib/components/datagrid/body/header/data_grid_control_header_cell.js +2 -2
  51. package/lib/components/datagrid/body/header/data_grid_header_cell.js +1 -1
  52. package/lib/components/datagrid/body/header/data_grid_header_row.js +5 -5
  53. package/lib/components/datagrid/controls/data_grid_toolbar.js +41 -38
  54. package/lib/components/datagrid/controls/display_selector.js +1 -1
  55. package/lib/components/datagrid/data_grid.js +7 -7
  56. package/lib/components/datagrid/utils/in_memory.js +4 -4
  57. package/lib/components/datagrid/utils/row_heights.js +4 -4
  58. package/lib/components/date_picker/date_picker.js +1 -1
  59. package/lib/components/drag_and_drop/drag_drop_context.js +2 -2
  60. package/lib/components/drag_and_drop/draggable.js +3 -3
  61. package/lib/components/drag_and_drop/droppable.js +2 -2
  62. package/lib/components/header/header_section/header_section_item_button.js +94 -0
  63. package/lib/components/highlight/highlight.js +2 -2
  64. package/lib/components/inline_edit/inline_edit_text.js +2 -3
  65. package/lib/components/inline_edit/inline_edit_title.js +2 -3
  66. package/lib/components/inner_text/index.js +1 -8
  67. package/lib/components/markdown_editor/markdown_actions.js +1 -1
  68. package/lib/components/markdown_editor/markdown_editor_text_area.js +10 -4
  69. package/lib/components/modal/confirm_modal.js +10 -28
  70. package/lib/components/outside_click_detector/outside_click_detector.js +10 -11
  71. package/lib/components/page/page_template.js +8 -8
  72. package/lib/components/popover/wrapping_popover.js +1 -9
  73. package/lib/components/portal/portal.js +34 -24
  74. package/lib/components/tabs/tabs.js +25 -0
  75. package/lib/components/timeline/timeline_item_icon.js +6 -3
  76. package/lib/components/tour/tour_step.js +15 -11
  77. package/lib/services/color/eui_palettes.js +9 -2
  78. package/lib/services/color/index.js +7 -0
  79. package/lib/services/index.js +7 -0
  80. package/lib/services/time/timer.js +3 -5
  81. package/lib/test/rtl/component_helpers.js +1 -1
  82. package/lib/test/rtl/index.js +13 -1
  83. package/lib/test/rtl/render_hook.js +29 -0
  84. package/optimize/es/components/datagrid/body/data_grid_cell.js +10 -9
  85. package/optimize/es/components/datagrid/controls/data_grid_toolbar.js +31 -26
  86. package/optimize/es/components/datagrid/controls/display_selector.js +1 -1
  87. package/optimize/es/components/datagrid/utils/in_memory.js +2 -2
  88. package/optimize/es/components/datagrid/utils/row_heights.js +4 -4
  89. package/optimize/es/components/date_picker/date_picker.js +1 -1
  90. package/optimize/es/components/drag_and_drop/drag_drop_context.js +1 -1
  91. package/optimize/es/components/drag_and_drop/draggable.js +2 -2
  92. package/optimize/es/components/drag_and_drop/droppable.js +1 -1
  93. package/optimize/es/components/drag_and_drop/index.js +3 -2
  94. package/optimize/es/components/highlight/highlight.js +2 -2
  95. package/optimize/es/components/inline_edit/inline_edit_text.js +2 -3
  96. package/optimize/es/components/inline_edit/inline_edit_title.js +2 -3
  97. package/optimize/es/components/inner_text/index.js +1 -2
  98. package/optimize/es/components/markdown_editor/markdown_actions.js +1 -1
  99. package/optimize/es/components/markdown_editor/markdown_editor_text_area.js +10 -4
  100. package/optimize/es/components/modal/confirm_modal.js +11 -24
  101. package/optimize/es/components/outside_click_detector/outside_click_detector.js +10 -11
  102. package/optimize/es/components/popover/wrapping_popover.js +1 -9
  103. package/optimize/es/components/portal/portal.js +34 -25
  104. package/optimize/es/components/timeline/timeline_item_icon.js +3 -3
  105. package/optimize/es/components/tour/tour_step.js +16 -12
  106. package/optimize/es/services/color/eui_palettes.js +7 -1
  107. package/optimize/es/services/color/index.js +1 -1
  108. package/optimize/es/services/index.js +1 -1
  109. package/optimize/es/services/time/timer.js +3 -5
  110. package/optimize/es/test/rtl/component_helpers.js +1 -1
  111. package/optimize/es/test/rtl/index.js +2 -1
  112. package/optimize/es/test/rtl/render_hook.js +23 -0
  113. package/optimize/lib/components/datagrid/body/data_grid_cell.js +10 -9
  114. package/optimize/lib/components/datagrid/controls/data_grid_toolbar.js +36 -28
  115. package/optimize/lib/components/datagrid/controls/display_selector.js +1 -1
  116. package/optimize/lib/components/datagrid/utils/in_memory.js +2 -2
  117. package/optimize/lib/components/datagrid/utils/row_heights.js +4 -4
  118. package/optimize/lib/components/date_picker/date_picker.js +1 -1
  119. package/optimize/lib/components/drag_and_drop/drag_drop_context.js +2 -2
  120. package/optimize/lib/components/drag_and_drop/draggable.js +3 -3
  121. package/optimize/lib/components/drag_and_drop/droppable.js +2 -2
  122. package/optimize/lib/components/highlight/highlight.js +2 -2
  123. package/optimize/lib/components/inline_edit/inline_edit_text.js +2 -3
  124. package/optimize/lib/components/inline_edit/inline_edit_title.js +2 -3
  125. package/optimize/lib/components/inner_text/index.js +1 -8
  126. package/optimize/lib/components/markdown_editor/markdown_actions.js +1 -1
  127. package/optimize/lib/components/markdown_editor/markdown_editor_text_area.js +10 -4
  128. package/optimize/lib/components/modal/confirm_modal.js +10 -23
  129. package/optimize/lib/components/outside_click_detector/outside_click_detector.js +10 -11
  130. package/optimize/lib/components/popover/wrapping_popover.js +1 -9
  131. package/optimize/lib/components/portal/portal.js +34 -25
  132. package/optimize/lib/components/timeline/timeline_item_icon.js +6 -4
  133. package/optimize/lib/components/tour/tour_step.js +15 -11
  134. package/optimize/lib/services/color/eui_palettes.js +9 -2
  135. package/optimize/lib/services/color/index.js +7 -0
  136. package/optimize/lib/services/index.js +7 -0
  137. package/optimize/lib/services/time/timer.js +3 -5
  138. package/optimize/lib/test/rtl/component_helpers.js +1 -1
  139. package/optimize/lib/test/rtl/index.js +13 -1
  140. package/optimize/lib/test/rtl/render_hook.js +29 -0
  141. package/package.json +23 -16
  142. package/test-env/components/combo_box/combo_box_options_list/combo_box_title.js +1 -3
  143. package/test-env/components/datagrid/body/data_grid_body.js +7 -7
  144. package/test-env/components/datagrid/body/data_grid_body_custom.js +7 -7
  145. package/test-env/components/datagrid/body/data_grid_body_virtualized.js +7 -7
  146. package/test-env/components/datagrid/body/data_grid_cell.js +14 -13
  147. package/test-env/components/datagrid/body/header/data_grid_control_header_cell.js +2 -2
  148. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +1 -1
  149. package/test-env/components/datagrid/body/header/data_grid_header_row.js +5 -5
  150. package/test-env/components/datagrid/controls/data_grid_toolbar.js +36 -28
  151. package/test-env/components/datagrid/controls/display_selector.js +1 -1
  152. package/test-env/components/datagrid/data_grid.js +7 -7
  153. package/test-env/components/datagrid/utils/in_memory.js +4 -4
  154. package/test-env/components/datagrid/utils/row_heights.js +4 -4
  155. package/test-env/components/date_picker/date_picker.js +1 -1
  156. package/test-env/components/drag_and_drop/drag_drop_context.js +2 -2
  157. package/test-env/components/drag_and_drop/draggable.js +3 -3
  158. package/test-env/components/drag_and_drop/droppable.js +2 -2
  159. package/test-env/components/header/header_section/header_section_item_button.js +94 -0
  160. package/test-env/components/highlight/highlight.js +2 -2
  161. package/test-env/components/inline_edit/inline_edit_text.js +2 -3
  162. package/test-env/components/inline_edit/inline_edit_title.js +2 -3
  163. package/test-env/components/inner_text/index.js +1 -8
  164. package/test-env/components/markdown_editor/markdown_actions.js +1 -1
  165. package/test-env/components/markdown_editor/markdown_editor_text_area.js +10 -4
  166. package/test-env/components/modal/confirm_modal.js +10 -23
  167. package/test-env/components/outside_click_detector/outside_click_detector.js +10 -11
  168. package/test-env/components/page/page_template.js +8 -8
  169. package/test-env/components/popover/wrapping_popover.js +1 -9
  170. package/test-env/components/portal/portal.js +34 -25
  171. package/test-env/components/tabs/tabs.js +25 -0
  172. package/test-env/components/timeline/timeline_item_icon.js +6 -3
  173. package/test-env/components/tour/tour_step.js +15 -11
  174. package/test-env/services/color/eui_palettes.js +9 -2
  175. package/test-env/services/color/index.js +7 -0
  176. package/test-env/services/index.js +7 -0
  177. package/test-env/services/time/timer.js +3 -5
  178. package/test-env/test/rtl/component_helpers.js +1 -1
  179. package/test-env/test/rtl/index.js +13 -1
  180. package/test-env/test/rtl/render_hook.js +29 -0
  181. package/es/components/inner_text/render_to_text.js +0 -47
  182. package/lib/components/inner_text/render_to_text.js +0 -54
  183. package/optimize/es/components/inner_text/render_to_text.js +0 -42
  184. package/optimize/lib/components/inner_text/render_to_text.js +0 -52
  185. package/test-env/components/inner_text/render_to_text.js +0 -52
@@ -9,6 +9,7 @@ exports.EuiHeaderSectionItemButton = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
11
  var _react = _interopRequireWildcard(require("react"));
12
+ var _propTypes = _interopRequireDefault(require("prop-types"));
12
13
  var _classnames = _interopRequireDefault(require("classnames"));
13
14
  var _badge_notification = require("../../badge/notification_badge/badge_notification");
14
15
  var _icon = require("../../icon");
@@ -175,4 +176,97 @@ ref) {
175
176
  }, children), buttonNotification);
176
177
  });
177
178
  exports.EuiHeaderSectionItemButton = EuiHeaderSectionItemButton;
179
+ EuiHeaderSectionItemButton.propTypes = {
180
+ href: _propTypes.default.string,
181
+ onClick: _propTypes.default.func,
182
+ /**
183
+ * Any of the named color palette options.
184
+ * **`'ghost'` is set for deprecation. Use EuiThemeProvide.colorMode = 'dark' instead.**
185
+ */
186
+ /**
187
+ * Any of the named color palette options.
188
+ * **`'ghost'` is set for deprecation. Use EuiThemeProvide.colorMode = 'dark' instead.**
189
+ */
190
+ color: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.oneOf(["ghost"])]),
191
+ size: _propTypes.default.any,
192
+ /**
193
+ * Ensure the text of the button sits flush to the left, right, or both sides of its container
194
+ */
195
+ /**
196
+ * Ensure the text of the button sits flush to the left, right, or both sides of its container
197
+ */
198
+ flush: _propTypes.default.any,
199
+ /**
200
+ * `disabled` is also allowed
201
+ */
202
+ /**
203
+ * `disabled` is also allowed
204
+ */
205
+ isDisabled: _propTypes.default.bool,
206
+ /**
207
+ * Force disables the button and changes the icon to a loading spinner
208
+ */
209
+ /**
210
+ * Force disables the button and changes the icon to a loading spinner
211
+ */
212
+ isLoading: _propTypes.default.bool,
213
+ /**
214
+ * Applies the boolean state as the `aria-pressed` property to create a toggle button.
215
+ * *Only use when the readable text does not change between states.*
216
+ */
217
+ /**
218
+ * Applies the boolean state as the `aria-pressed` property to create a toggle button.
219
+ * *Only use when the readable text does not change between states.*
220
+ */
221
+ isSelected: _propTypes.default.bool,
222
+ target: _propTypes.default.string,
223
+ rel: _propTypes.default.string,
224
+ type: _propTypes.default.oneOf(["button", "submit"]),
225
+ buttonRef: _propTypes.default.any,
226
+ /**
227
+ * Object of props passed to the <span/> wrapping the button's content
228
+ */
229
+ /**
230
+ * Object of props passed to the <span/> wrapping the button's content
231
+ */
232
+ contentProps: _propTypes.default.shape({
233
+ className: _propTypes.default.string,
234
+ "aria-label": _propTypes.default.string,
235
+ "data-test-subj": _propTypes.default.string,
236
+ css: _propTypes.default.any
237
+ }),
238
+ /**
239
+ * Any `type` accepted by EuiIcon
240
+ */
241
+ iconType: _propTypes.default.oneOfType([_propTypes.default.oneOf(["accessibility", "addDataApp", "advancedSettingsApp", "agentApp", "aggregate", "analyzeEvent", "annotation", "apmApp", "apmTrace", "appSearchApp", "apps", "arrowDown", "arrowLeft", "arrowRight", "arrowUp", "arrowStart", "arrowEnd", "article", "asterisk", "at", "auditbeatApp", "beaker", "bell", "bellSlash", "beta", "bolt", "boxesHorizontal", "boxesVertical", "branch", "branchUser", "broom", "brush", "bug", "bullseye", "calendar", "canvasApp", "casesApp", "check", "checkInCircleFilled", "cheer", "classificationJob", "clock", "cloudDrizzle", "cloudStormy", "cloudSunny", "cluster", "codeApp", "color", "compute", "console", "consoleApp", "container", "continuityAbove", "continuityAboveBelow", "continuityBelow", "continuityWithin", "controlsHorizontal", "controlsVertical", "copy", "copyClipboard", "createAdvancedJob", "createMultiMetricJob", "createPopulationJob", "createSingleMetricJob", "cross", "crossClusterReplicationApp", "crosshairs", "currency", "cut", "dashboardApp", "dataVisualizer", "database", "desktop", "devToolsApp", "discoverApp", "discuss", "document", "documentEdit", "documentation", "documents", "dot", "dotInCircle", "doubleArrowLeft", "doubleArrowRight", "download", "editorAlignCenter", "editorAlignLeft", "editorAlignRight", "editorBold", "editorChecklist", "editorCodeBlock", "editorComment", "editorDistributeHorizontal", "editorDistributeVertical", "editorHeading", "editorItalic", "editorItemAlignBottom", "editorItemAlignCenter", "editorItemAlignLeft", "editorItemAlignMiddle", "editorItemAlignRight", "editorItemAlignTop", "editorLink", "editorOrderedList", "editorPositionBottomLeft", "editorPositionBottomRight", "editorPositionTopLeft", "editorPositionTopRight", "editorRedo", "editorStrike", "editorTable", "editorUnderline", "editorUndo", "editorUnorderedList", "email", "empty", "emsApp", "eql", "eraser", "error", "exit", "expand", "expandMini", "exportAction", "eye", "eyeClosed", "faceHappy", "faceNeutral", "faceSad", "filebeatApp", "filter", "filterExclude", "filterIgnore", "filterInclude", "filterInCircle", "flag", "fleetApp", "fold", "folderCheck", "folderClosed", "folderExclamation", "folderOpen", "frameNext", "framePrevious", "fullScreen", "fullScreenExit", "function", "gear", "gisApp", "glasses", "globe", "grab", "grabHorizontal", "graphApp", "grid", "grokApp", "heart", "heartbeatApp", "heatmap", "help", "home", "iInCircle", "image", "importAction", "indexClose", "indexEdit", "indexFlush", "indexManagementApp", "indexMapping", "indexOpen", "indexPatternApp", "indexRollupApp", "indexRuntime", "indexSettings", "indexTemporary", "infinity", "inputOutput", "inspect", "invert", "ip", "key", "keyboard", "kqlField", "kqlFunction", "kqlOperand", "kqlSelector", "kqlValue", "kubernetesNode", "kubernetesPod", "launch", "layers", "lensApp", "lettering", "lineDashed", "lineDotted", "lineSolid", "link", "list", "listAdd", "lock", "lockOpen", "logoAWS", "logoAWSMono", "logoAerospike", "logoApache", "logoAppSearch", "logoAzure", "logoAzureMono", "logoBeats", "logoBusinessAnalytics", "logoCeph", "logoCloud", "logoCloudEnterprise", "logoCode", "logoCodesandbox", "logoCouchbase", "logoDocker", "logoDropwizard", "logoElastic", "logoElasticStack", "logoElasticsearch", "logoEnterpriseSearch", "logoEtcd", "logoGCP", "logoGCPMono", "logoGithub", "logoGmail", "logoGolang", "logoGoogleG", "logoHAproxy", "logoIBM", "logoIBMMono", "logoKafka", "logoKibana", "logoKubernetes", "logoLogging", "logoLogstash", "logoMaps", "logoMemcached", "logoMetrics", "logoMongodb", "logoMySQL", "logoNginx", "logoObservability", "logoOsquery", "logoPhp", "logoPostgres", "logoPrometheus", "logoRabbitmq", "logoRedis", "logoSecurity", "logoSiteSearch", "logoSketch", "logoSlack", "logoUptime", "logoVulnerabilityManagement", "logoWebhook", "logoWindows", "logoWorkplaceSearch", "logsApp", "logstashFilter", "logstashIf", "logstashInput", "logstashOutput", "logstashQueue", "machineLearningApp", "magnet", "magnifyWithExclamation", "magnifyWithMinus", "magnifyWithPlus", "managementApp", "mapMarker", "memory", "menu", "menuDown", "menuLeft", "menuRight", "menuUp", "merge", "metricbeatApp", "metricsApp", "minimize", "minus", "minusInCircle", "minusInCircleFilled", "mobile", "monitoringApp", "moon", "namespace", "nested", "node", "notebookApp", "number", "offline", "online", "outlierDetectionJob", "package", "packetbeatApp", "pageSelect", "pagesSelect", "paperClip", "partial", "pause", "payment", "pencil", "percent", "pin", "pinFilled", "pipelineApp", "pivot", "play", "playFilled", "plus", "plusInCircle", "plusInCircleFilled", "popout", "push", "questionInCircle", "quote", "recentlyViewedApp", "refresh", "regressionJob", "reporter", "reportingApp", "returnKey", "save", "savedObjectsApp", "scale", "search", "searchProfilerApp", "securityAnalyticsApp", "securityApp", "securitySignal", "securitySignalDetected", "securitySignalResolved", "sessionViewer", "shard", "share", "snowflake", "sortAscending", "sortDescending", "sortDown", "sortLeft", "sortRight", "sortUp", "sortable", "spaces", "spacesApp", "sparkles", "sqlApp", "starEmpty", "starEmptySpace", "starFilled", "starFilledSpace", "starMinusEmpty", "starMinusFilled", "starPlusEmpty", "starPlusFilled", "stats", "stop", "stopFilled", "stopSlash", "storage", "string", "submodule", "sun", "swatchInput", "symlink", "tableDensityCompact", "tableDensityExpanded", "tableDensityNormal", "tableOfContents", "tag", "tear", "temperature", "timeline", "timelineWithArrow", "timelionApp", "timeRefresh", "timeslider", "training", "trash", "unfold", "unlink", "upgradeAssistantApp", "uptimeApp", "user", "userAvatar", "users", "usersRolesApp", "vector", "videoPlayer", "visArea", "visAreaStacked", "visBarHorizontal", "visBarHorizontalStacked", "visBarVertical", "visBarVerticalStacked", "visGauge", "visGoal", "visLine", "visMapCoordinate", "visMapRegion", "visMetric", "visPie", "visTable", "visTagCloud", "visText", "visTimelion", "visVega", "visVisualBuilder", "visualizeApp", "vulnerabilityManagementApp", "warning", "alert", "watchesApp", "wordWrap", "wordWrapDisabled", "workplaceSearchApp", "wrench", "tokenAlias", "tokenAnnotation", "tokenArray", "tokenBinary", "tokenBoolean", "tokenClass", "tokenCompletionSuggester", "tokenConstant", "tokenDate", "tokenDenseVector", "tokenElement", "tokenEnum", "tokenEnumMember", "tokenEvent", "tokenException", "tokenField", "tokenFile", "tokenFlattened", "tokenFunction", "tokenGeo", "tokenHistogram", "tokenInterface", "tokenIP", "tokenJoin", "tokenKey", "tokenKeyword", "tokenMethod", "tokenMetricCounter", "tokenMetricGauge", "tokenModule", "tokenNamespace", "tokenNested", "tokenNull", "tokenNumber", "tokenObject", "tokenOperator", "tokenPackage", "tokenParameter", "tokenPercolator", "tokenProperty", "tokenRange", "tokenRankFeature", "tokenRankFeatures", "tokenRepo", "tokenSearchType", "tokenShape", "tokenString", "tokenStruct", "tokenSymbol", "tokenTag", "tokenText", "tokenTokenCount", "tokenVariable"]).isRequired, _propTypes.default.string.isRequired, _propTypes.default.elementType.isRequired]),
242
+ /**
243
+ * Can only be one side `left` or `right`
244
+ */
245
+ iconSide: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.oneOf([undefined])]),
246
+ /**
247
+ * Object of props passed to the <span/> wrapping the content's text/children only (not icon)
248
+ */
249
+ textProps: _propTypes.default.shape({
250
+ className: _propTypes.default.string,
251
+ "aria-label": _propTypes.default.string,
252
+ "data-test-subj": _propTypes.default.string,
253
+ css: _propTypes.default.any,
254
+ ref: _propTypes.default.any,
255
+ "data-text": _propTypes.default.string
256
+ }),
257
+ iconSize: _propTypes.default.any,
258
+ className: _propTypes.default.string,
259
+ "aria-label": _propTypes.default.string,
260
+ "data-test-subj": _propTypes.default.string,
261
+ css: _propTypes.default.any,
262
+ /**
263
+ * Inserts the node into a EuiBadgeNotification and places it appropriately against the button.
264
+ * Or pass `true` to render a simple dot
265
+ */
266
+ notification: _propTypes.default.oneOfType([_propTypes.default.node.isRequired, _propTypes.default.bool.isRequired]),
267
+ /**
268
+ * Changes the color of the notification background
269
+ */
270
+ notificationColor: _propTypes.default.any
271
+ };
178
272
  EuiHeaderSectionItemButton.displayName = 'EuiHeaderSectionItemButton';
@@ -54,9 +54,9 @@ var highlight = function highlight(searchSubject, searchValue, isStrict, highlig
54
54
  var preMatch = searchSubject.substring(0, indexOfMatch);
55
55
  var match = searchSubject.substring(indexOfMatch, indexOfMatch + searchValue.length);
56
56
  var postMatch = searchSubject.substring(indexOfMatch + searchValue.length);
57
- return (0, _react2.jsx)(_react.Fragment, null, preMatch, (0, _react2.jsx)(_mark.EuiMark, {
57
+ return (0, _react2.jsx)(_react.Fragment, null, preMatch || undefined, (0, _react2.jsx)(_mark.EuiMark, {
58
58
  hasScreenReaderHelpText: hasScreenReaderHelpText
59
- }, match), postMatch);
59
+ }, match), postMatch || undefined);
60
60
  };
61
61
  var getHightlightWords = function getHightlightWords(searchSubject, searchValue, isStrict) {
62
62
  var regex = new RegExp(searchValue, isStrict ? 'g' : 'gi');
@@ -17,7 +17,7 @@ var _inline_edit_form = require("./inline_edit_form");
17
17
  var _services = require("../../services");
18
18
  var _inline_edit_text = require("./inline_edit_text.styles");
19
19
  var _react2 = require("@emotion/react");
20
- var _excluded = ["children", "className", "size", "defaultValue", "placeholder", "inputAriaLabel", "startWithEditOpen", "readModeProps", "editModeProps", "isLoading", "isInvalid", "isReadOnly"];
20
+ var _excluded = ["className", "size", "defaultValue", "placeholder", "inputAriaLabel", "startWithEditOpen", "readModeProps", "editModeProps", "isLoading", "isInvalid", "isReadOnly"];
21
21
  /*
22
22
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
23
23
  * or more contributor license agreements. Licensed under the Elastic License
@@ -30,8 +30,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
30
30
  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; }
31
31
  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) { (0, _defineProperty2.default)(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; }
32
32
  var EuiInlineEditText = function EuiInlineEditText(_ref) {
33
- var children = _ref.children,
34
- className = _ref.className,
33
+ var className = _ref.className,
35
34
  _ref$size = _ref.size,
36
35
  size = _ref$size === void 0 ? 'm' : _ref$size,
37
36
  defaultValue = _ref.defaultValue,
@@ -17,7 +17,7 @@ var _inline_edit_form = require("./inline_edit_form");
17
17
  var _services = require("../../services");
18
18
  var _inline_edit_title = require("./inline_edit_title.styles");
19
19
  var _react2 = require("@emotion/react");
20
- var _excluded = ["children", "className", "size", "heading", "defaultValue", "placeholder", "inputAriaLabel", "startWithEditOpen", "readModeProps", "editModeProps", "isLoading", "isInvalid", "isReadOnly"];
20
+ var _excluded = ["className", "size", "heading", "defaultValue", "placeholder", "inputAriaLabel", "startWithEditOpen", "readModeProps", "editModeProps", "isLoading", "isInvalid", "isReadOnly"];
21
21
  /*
22
22
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
23
23
  * or more contributor license agreements. Licensed under the Elastic License
@@ -32,8 +32,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
32
32
  var HEADINGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'span'];
33
33
  exports.HEADINGS = HEADINGS;
34
34
  var EuiInlineEditTitle = function EuiInlineEditTitle(_ref) {
35
- var children = _ref.children,
36
- className = _ref.className,
35
+ var className = _ref.className,
37
36
  _ref$size = _ref.size,
38
37
  size = _ref$size === void 0 ? 'm' : _ref$size,
39
38
  heading = _ref.heading,
@@ -15,11 +15,4 @@ Object.defineProperty(exports, "useInnerText", {
15
15
  return _inner_text.useInnerText;
16
16
  }
17
17
  });
18
- Object.defineProperty(exports, "useRenderToText", {
19
- enumerable: true,
20
- get: function get() {
21
- return _render_to_text.useRenderToText;
22
- }
23
- });
24
- var _inner_text = require("./inner_text");
25
- var _render_to_text = require("./render_to_text");
18
+ var _inner_text = require("./inner_text");
@@ -51,8 +51,8 @@ SOFTWARE.
51
51
  var MarkdownActions = /*#__PURE__*/function () {
52
52
  function MarkdownActions(editorID, uiPlugins) {
53
53
  (0, _classCallCheck2.default)(this, MarkdownActions);
54
- this.editorID = editorID;
55
54
  (0, _defineProperty2.default)(this, "styles", void 0);
55
+ this.editorID = editorID;
56
56
  /**
57
57
  * This object is in the format:
58
58
  * [nameOfAction]: {[styles to apply]}
@@ -39,13 +39,19 @@ var EuiMarkdownEditorTextArea = /*#__PURE__*/(0, _react.forwardRef)(function (_r
39
39
  var classes = (0, _classnames.default)('euiMarkdownEditorTextArea', {
40
40
  'euiMarkdownEditorTextArea-isReadOnly': readOnly
41
41
  });
42
+
43
+ // Ignore invalid empty string style values
44
+ var style = {};
45
+ if (height !== '') {
46
+ style.height = height;
47
+ }
48
+ if (maxHeight !== '') {
49
+ style.maxHeight = maxHeight;
50
+ }
42
51
  return (0, _react2.jsx)("textarea", (0, _extends2.default)({
43
52
  ref: ref,
44
53
  "data-test-subj": "euiMarkdownEditorTextArea",
45
- style: {
46
- height: height,
47
- maxHeight: maxHeight
48
- },
54
+ style: style,
49
55
  className: classes
50
56
  }, rest, {
51
57
  rows: 6,
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.EuiConfirmModal = exports.CONFIRM_BUTTON = exports.CANCEL_BUTTON = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
12
11
  var _react = _interopRequireWildcard(require("react"));
13
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
@@ -51,33 +50,21 @@ var EuiConfirmModal = function EuiConfirmModal(_ref) {
51
50
  defaultFocusedButton = _ref.defaultFocusedButton,
52
51
  isLoading = _ref.isLoading,
53
52
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
54
- var _useState = (0, _react.useState)(null),
55
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
56
- cancelButton = _useState2[0],
57
- setCancelButton = _useState2[1];
58
- var _useState3 = (0, _react.useState)(null),
59
- _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
60
- confirmButton = _useState4[0],
61
- setConfirmButton = _useState4[1];
53
+ var cancelButtonRef = (0, _react.useRef)(null);
54
+ var confirmButtonRef = (0, _react.useRef)(null);
62
55
  (0, _react.useEffect)(function () {
63
56
  // We have to do this instead of using `autoFocus` because React's polyfill for auto-focusing
64
57
  // elements conflicts with the focus-trap logic we have on EuiModal.
65
58
  // Wait a beat for the focus-trap to complete, and then set focus to the right button. Check that
66
59
  // the buttons exist first, because it's possible the modal has been closed already.
67
- requestAnimationFrame(function () {
68
- if (defaultFocusedButton === CANCEL_BUTTON && cancelButton) {
69
- cancelButton.focus();
70
- } else if (defaultFocusedButton === CONFIRM_BUTTON && confirmButton) {
71
- confirmButton.focus();
60
+ setTimeout(function () {
61
+ if (defaultFocusedButton === CANCEL_BUTTON && cancelButtonRef.current) {
62
+ cancelButtonRef.current.focus();
63
+ } else if (defaultFocusedButton === CONFIRM_BUTTON && confirmButtonRef.current) {
64
+ confirmButtonRef.current.focus();
72
65
  }
73
66
  });
74
- });
75
- var confirmRef = function confirmRef(node) {
76
- return setConfirmButton(node);
77
- };
78
- var cancelRef = function cancelRef(node) {
79
- return setCancelButton(node);
80
- };
67
+ }, [defaultFocusedButton, cancelButtonRef, confirmButtonRef]);
81
68
  var classes = (0, _classnames.default)('euiModal--confirmation', className);
82
69
  var euiTheme = (0, _services.useEuiTheme)();
83
70
  var styles = (0, _modal2.euiModalStyles)(euiTheme);
@@ -103,13 +90,13 @@ var EuiConfirmModal = function EuiConfirmModal(_ref) {
103
90
  }, message)), (0, _react2.jsx)(_modal_footer.EuiModalFooter, null, (0, _react2.jsx)(_button.EuiButtonEmpty, {
104
91
  "data-test-subj": "confirmModalCancelButton",
105
92
  onClick: onCancel,
106
- buttonRef: cancelRef
93
+ buttonRef: cancelButtonRef
107
94
  }, cancelButtonText), (0, _react2.jsx)(_button.EuiButton, {
108
95
  "data-test-subj": "confirmModalConfirmButton",
109
96
  onClick: onConfirm,
110
97
  isLoading: isLoading,
111
98
  fill: true,
112
- buttonRef: confirmRef,
99
+ buttonRef: confirmButtonRef,
113
100
  color: buttonColor,
114
101
  isDisabled: confirmButtonDisabled
115
102
  }, confirmButtonText)));
@@ -28,17 +28,6 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
28
28
  var EuiOutsideClickDetector = /*#__PURE__*/function (_Component) {
29
29
  (0, _inherits2.default)(EuiOutsideClickDetector, _Component);
30
30
  var _super = _createSuper(EuiOutsideClickDetector);
31
- // We are working with the assumption that a click event is
32
- // equivalent to a sequential, compound press and release of
33
- // the pointing device (mouse, finger, stylus, etc.).
34
- // A click event's target can be imprecise, as the value will be
35
- // the closest common ancestor of the press (mousedown, touchstart)
36
- // and release (mouseup, touchend) events (often <body />) if
37
- // the the target of each event differs.
38
- // We need the actual event targets to make the correct decisions
39
- // about user intention. So, consider the down/start and up/end
40
- // items below as the deconstruction of a click event.
41
-
42
31
  function EuiOutsideClickDetector(props) {
43
32
  var _this;
44
33
  (0, _classCallCheck2.default)(this, EuiOutsideClickDetector);
@@ -60,6 +49,16 @@ var EuiOutsideClickDetector = /*#__PURE__*/function (_Component) {
60
49
  // virtual DOM and executes EuiClickDetector's onClick handler,
61
50
  // stamping the id even though the event originates outside
62
51
  // this component's reified DOM tree.
52
+ // We are working with the assumption that a click event is
53
+ // equivalent to a sequential, compound press and release of
54
+ // the pointing device (mouse, finger, stylus, etc.).
55
+ // A click event's target can be imprecise, as the value will be
56
+ // the closest common ancestor of the press (mousedown, touchstart)
57
+ // and release (mouseup, touchend) events (often <body />) if
58
+ // the the target of each event differs.
59
+ // We need the actual event targets to make the correct decisions
60
+ // about user intention. So, consider the down/start and up/end
61
+ // items below as the deconstruction of a click event.
63
62
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "id", void 0);
64
63
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "capturedDownIds", void 0);
65
64
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onClickOutside", function (e) {
@@ -397,20 +397,20 @@ EuiPageTemplate_Deprecated.propTypes = {
397
397
  */
398
398
  restrictWidth: _propTypes.default.oneOfType([_propTypes.default.bool.isRequired, _propTypes.default.number.isRequired, _propTypes.default.string.isRequired]),
399
399
  /**
400
- * Sets the HTML element for `EuiPageBody`.
401
- */
400
+ * Sets the HTML element for `EuiPageBody`.
401
+ */
402
402
  component: _propTypes.default.any,
403
403
  /**
404
- * Uses an EuiPanel as the main component instead of a plain div
405
- */
404
+ * Uses an EuiPanel as the main component instead of a plain div
405
+ */
406
406
  panelled: _propTypes.default.bool,
407
407
  /**
408
- * Extends any extra EuiPanel props if `panelled=true`
409
- */
408
+ * Extends any extra EuiPanel props if `panelled=true`
409
+ */
410
410
  panelProps: _propTypes.default.any,
411
411
  /**
412
- * Adjusts the padding
413
- */
412
+ * Adjusts the padding
413
+ */
414
414
  paddingSize: _propTypes.default.any
415
415
  }),
416
416
  /**
@@ -47,23 +47,15 @@ var EuiWrappingPopover = /*#__PURE__*/function (_Component) {
47
47
  }
48
48
  _this = _super.call.apply(_super, [this].concat(args));
49
49
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "portal", null);
50
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "anchor", null);
51
50
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setPortalRef", function (node) {
52
51
  _this.portal = node;
53
52
  });
54
53
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setAnchorRef", function (node) {
55
- _this.anchor = node;
54
+ node === null || node === void 0 ? void 0 : node.insertAdjacentElement('beforebegin', _this.props.button);
56
55
  });
57
56
  return _this;
58
57
  }
59
58
  (0, _createClass2.default)(EuiWrappingPopover, [{
60
- key: "componentDidMount",
61
- value: function componentDidMount() {
62
- if (this.anchor) {
63
- this.anchor.insertAdjacentElement('beforebegin', this.props.button);
64
- }
65
- }
66
- }, {
67
59
  key: "componentWillUnmount",
68
60
  value: function componentWillUnmount() {
69
61
  if (this.props.button.parentNode) {
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.insertPositions = exports.INSERT_POSITIONS = exports.EuiPortal = void 0;
8
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
11
10
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
12
11
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
13
12
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
@@ -42,35 +41,41 @@ var EuiPortal = /*#__PURE__*/function (_Component) {
42
41
  var _this;
43
42
  (0, _classCallCheck2.default)(this, EuiPortal);
44
43
  _this = _super.call(this, props);
45
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "portalNode", null);
46
- if (typeof window === 'undefined') return (0, _possibleConstructorReturn2.default)(_this); // Prevent SSR errors
47
-
48
- var insert = _this.props.insert;
49
- _this.portalNode = document.createElement('div');
50
- _this.portalNode.dataset.euiportal = 'true';
51
- if (insert == null) {
52
- // no insertion defined, append to body
53
- document.body.appendChild(_this.portalNode);
54
- } else {
55
- // inserting before or after an element
56
- var sibling = insert.sibling,
57
- position = insert.position;
58
- sibling.insertAdjacentElement(insertPositions[position], _this.portalNode);
59
- }
44
+ _this.state = {
45
+ portalNode: null
46
+ };
60
47
  return _this;
61
48
  }
62
49
  (0, _createClass2.default)(EuiPortal, [{
63
50
  key: "componentDidMount",
64
51
  value: function componentDidMount() {
65
- this.setThemeColor();
66
- this.updatePortalRef(this.portalNode);
52
+ var insert = this.props.insert;
53
+ var portalNode = document.createElement('div');
54
+ portalNode.dataset.euiportal = 'true';
55
+ if (insert == null) {
56
+ // no insertion defined, append to body
57
+ document.body.appendChild(portalNode);
58
+ } else {
59
+ // inserting before or after an element
60
+ var sibling = insert.sibling,
61
+ position = insert.position;
62
+ sibling.insertAdjacentElement(insertPositions[position], portalNode);
63
+ }
64
+ this.setThemeColor(portalNode);
65
+ this.updatePortalRef(portalNode);
66
+
67
+ // Update state with portalNode to intentionally trigger component rerender
68
+ // and call createPortal with correct root element in render()
69
+ this.setState({
70
+ portalNode: portalNode
71
+ });
67
72
  }
68
73
  }, {
69
74
  key: "componentWillUnmount",
70
75
  value: function componentWillUnmount() {
71
- var _this$portalNode;
72
- if ((_this$portalNode = this.portalNode) !== null && _this$portalNode !== void 0 && _this$portalNode.parentNode) {
73
- this.portalNode.parentNode.removeChild(this.portalNode);
76
+ var portalNode = this.state.portalNode;
77
+ if (portalNode !== null && portalNode !== void 0 && portalNode.parentNode) {
78
+ portalNode.parentNode.removeChild(portalNode);
74
79
  }
75
80
  this.updatePortalRef(null);
76
81
  }
@@ -78,13 +83,13 @@ var EuiPortal = /*#__PURE__*/function (_Component) {
78
83
  // Set the inherited color of the portal based on the wrapping EuiThemeProvider
79
84
  }, {
80
85
  key: "setThemeColor",
81
- value: function setThemeColor() {
82
- if (this.portalNode && this.context) {
86
+ value: function setThemeColor(portalNode) {
87
+ if (this.context) {
83
88
  var _this$context = this.context,
84
89
  hasDifferentColorFromGlobalTheme = _this$context.hasDifferentColorFromGlobalTheme,
85
90
  colorClassName = _this$context.colorClassName;
86
91
  if (hasDifferentColorFromGlobalTheme && this.props.insert == null) {
87
- this.portalNode.classList.add(colorClassName);
92
+ portalNode.classList.add(colorClassName);
88
93
  }
89
94
  }
90
95
  }
@@ -98,7 +103,11 @@ var EuiPortal = /*#__PURE__*/function (_Component) {
98
103
  }, {
99
104
  key: "render",
100
105
  value: function render() {
101
- return this.portalNode ? /*#__PURE__*/(0, _reactDom.createPortal)(this.props.children, this.portalNode) : null;
106
+ var portalNode = this.state.portalNode;
107
+ if (!portalNode) {
108
+ return null;
109
+ }
110
+ return /*#__PURE__*/(0, _reactDom.createPortal)(this.props.children, portalNode);
102
111
  }
103
112
  }]);
104
113
  return EuiPortal;
@@ -9,6 +9,7 @@ exports.SIZES = exports.EuiTabs = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
11
  var _react = _interopRequireWildcard(require("react"));
12
+ var _propTypes = _interopRequireDefault(require("prop-types"));
12
13
  var _classnames = _interopRequireDefault(require("classnames"));
13
14
  var _services = require("../../services");
14
15
  var _tabs = require("./tabs.styles");
@@ -54,4 +55,28 @@ var EuiTabs = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
54
55
  }, children));
55
56
  });
56
57
  exports.EuiTabs = EuiTabs;
58
+ EuiTabs.propTypes = {
59
+ className: _propTypes.default.string,
60
+ "aria-label": _propTypes.default.string,
61
+ "data-test-subj": _propTypes.default.string,
62
+ css: _propTypes.default.any,
63
+ /**
64
+ * ReactNode to render as this component's content
65
+ */
66
+ children: _propTypes.default.node,
67
+ /**
68
+ * Evenly stretches each tab to fill the
69
+ * horizontal space
70
+ */
71
+ expand: _propTypes.default.bool,
72
+ /**
73
+ * Adds a bottom border to separate it from the content after
74
+ */
75
+ bottomBorder: _propTypes.default.bool,
76
+ /**
77
+ * Sizes affect both font size and overall size.
78
+ * Only use the `xl` size when displayed as page titles.
79
+ */
80
+ size: _propTypes.default.any
81
+ };
57
82
  EuiTabs.displayName = 'EuiTabs';
@@ -1,16 +1,19 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.EuiTimelineItemIcon = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
+ var _react = _interopRequireWildcard(require("react"));
9
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
10
11
  var _avatar = require("../avatar");
11
12
  var _services = require("../../services");
12
13
  var _timeline_item_icon = require("./timeline_item_icon.styles");
13
14
  var _react2 = require("@emotion/react");
15
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
14
17
  /*
15
18
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
16
19
  * or more contributor license agreements. Licensed under the Elastic License
@@ -29,11 +32,11 @@ var EuiTimelineItemIcon = function EuiTimelineItemIcon(_ref) {
29
32
  var cssStyles = [styles.euiTimelineItemIcon, styles[verticalAlign]];
30
33
  var cssContentStyles = styles.euiTimelineItemIcon__content;
31
34
  var ariaLabel = iconAriaLabel ? iconAriaLabel : '';
32
- var iconRender = typeof icon === 'string' ? (0, _react2.jsx)(_avatar.EuiAvatar, {
35
+ var iconRender = /*#__PURE__*/(0, _react.isValidElement)(icon) ? icon : (0, _react2.jsx)(_avatar.EuiAvatar, {
33
36
  color: "subdued",
34
37
  name: ariaLabel,
35
38
  iconType: icon
36
- }) : icon;
39
+ });
37
40
  return (0, _react2.jsx)("div", {
38
41
  css: cssStyles
39
42
  }, (0, _react2.jsx)("div", {
@@ -68,12 +68,10 @@ var EuiTourStep = function EuiTourStep(_ref) {
68
68
  if (step === 0) {
69
69
  console.warn('EuiTourStep `step` should 1-based indexing. Please update to eliminate 0 indexes.');
70
70
  }
71
- var _useState = (0, _react.useState)(false),
71
+ var _useState = (0, _react.useState)(null),
72
72
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
73
- hasValidAnchor = _useState2[0],
74
- setHasValidAnchor = _useState2[1];
75
- var animationFrameId = (0, _react.useRef)();
76
- var anchorNode = (0, _react.useRef)(null);
73
+ anchorNode = _useState2[0],
74
+ setAnchorNode = _useState2[1];
77
75
  var _useState3 = (0, _react.useState)(),
78
76
  _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
79
77
  popoverPosition = _useState4[0],
@@ -82,14 +80,20 @@ var EuiTourStep = function EuiTourStep(_ref) {
82
80
  setPopoverPosition(position);
83
81
  };
84
82
  (0, _react.useEffect)(function () {
83
+ var timeout;
85
84
  if (anchor) {
86
- animationFrameId.current = window.requestAnimationFrame(function () {
87
- anchorNode.current = (0, _services.findElementBySelectorOrRef)(anchor);
88
- setHasValidAnchor(anchorNode.current ? true : false);
85
+ // Wait until next tick to find anchor node in case it's not already
86
+ // in DOM requestAnimationFrame isn't used here because we don't need to
87
+ // synchronize with repainting ticks and the updated value still
88
+ // needs to go through a react DOM rerender which may take more than
89
+ // 1 frame (16ms) of time.
90
+ // TODO: It would be ideal to have some kind of intersection observer here instead
91
+ timeout = window.setTimeout(function () {
92
+ setAnchorNode((0, _services.findElementBySelectorOrRef)(anchor));
89
93
  });
90
94
  }
91
95
  return function () {
92
- animationFrameId.current && window.cancelAnimationFrame(animationFrameId.current);
96
+ timeout && window.clearTimeout(timeout);
93
97
  };
94
98
  }, [anchor]);
95
99
  var classes = (0, _classnames.default)('euiTour', className);
@@ -201,8 +205,8 @@ var EuiTourStep = function EuiTourStep(_ref) {
201
205
  button: children
202
206
  }, popoverProps), layout);
203
207
  }
204
- return hasValidAnchor && anchorNode.current ? (0, _react2.jsx)(_popover.EuiWrappingPopover, (0, _extends2.default)({
205
- button: anchorNode.current
208
+ return anchorNode ? (0, _react2.jsx)(_popover.EuiWrappingPopover, (0, _extends2.default)({
209
+ button: anchorNode
206
210
  }, popoverProps), layout) : null;
207
211
  };
208
212
  exports.EuiTourStep = EuiTourStep;