@elastic/eui 90.0.0 → 90.0.1

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 (84) hide show
  1. package/es/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +2 -2
  2. package/es/components/collapsible_nav_beta/collapsible_nav_body_footer.js +4 -1
  3. package/es/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +13 -9
  4. package/es/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +1 -101
  5. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +20 -58
  6. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +89 -37
  7. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +67 -81
  8. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.styles.js +1 -19
  9. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +7 -102
  10. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +4 -4
  11. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_group.js +11 -90
  12. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +150 -130
  13. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_link.js +0 -10
  14. package/es/components/combo_box/combo_box.js +1 -1
  15. package/es/components/selectable/selectable.js +16 -1
  16. package/es/components/selectable/selectable_list/selectable_list.js +227 -78
  17. package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +16 -1
  18. package/es/components/text_truncate/text_truncate.js +33 -10
  19. package/eui.d.ts +381 -68
  20. package/i18ntokens.json +38 -38
  21. package/lib/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +1 -1
  22. package/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.js +4 -1
  23. package/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +13 -9
  24. package/lib/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +1 -101
  25. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +20 -58
  26. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +89 -37
  27. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +66 -80
  28. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.styles.js +11 -28
  29. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +7 -104
  30. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +4 -4
  31. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_group.js +10 -89
  32. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +150 -130
  33. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_link.js +0 -10
  34. package/lib/components/combo_box/combo_box.js +1 -1
  35. package/lib/components/selectable/selectable.js +16 -1
  36. package/lib/components/selectable/selectable_list/selectable_list.js +227 -78
  37. package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +16 -1
  38. package/lib/components/text_truncate/text_truncate.js +32 -9
  39. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +2 -2
  40. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_body_footer.js +4 -1
  41. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +13 -9
  42. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +1 -3
  43. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +10 -5
  44. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +8 -36
  45. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.styles.js +1 -19
  46. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +6 -23
  47. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +4 -4
  48. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_group.js +10 -10
  49. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +9 -5
  50. package/optimize/es/components/selectable/selectable_list/selectable_list.js +199 -76
  51. package/optimize/es/components/text_truncate/text_truncate.js +26 -9
  52. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +1 -1
  53. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.js +4 -1
  54. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +13 -9
  55. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +1 -3
  56. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +10 -5
  57. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +8 -36
  58. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.styles.js +11 -28
  59. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +6 -26
  60. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +4 -4
  61. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_group.js +9 -9
  62. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +9 -5
  63. package/optimize/lib/components/selectable/selectable_list/selectable_list.js +199 -76
  64. package/optimize/lib/components/text_truncate/text_truncate.js +25 -8
  65. package/package.json +1 -1
  66. package/test-env/components/auto_sizer/auto_sizer.js +10 -3
  67. package/test-env/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +1 -1
  68. package/test-env/components/collapsible_nav_beta/collapsible_nav_body_footer.js +4 -1
  69. package/test-env/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +13 -9
  70. package/test-env/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +1 -101
  71. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +20 -58
  72. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +89 -37
  73. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +66 -80
  74. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.styles.js +11 -28
  75. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +7 -105
  76. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +4 -4
  77. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_group.js +10 -89
  78. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +150 -130
  79. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_link.js +0 -10
  80. package/test-env/components/combo_box/combo_box.js +1 -1
  81. package/test-env/components/selectable/selectable.js +16 -1
  82. package/test-env/components/selectable/selectable_list/selectable_list.js +227 -78
  83. package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +16 -1
  84. package/test-env/components/text_truncate/text_truncate.js +32 -9
@@ -10,7 +10,7 @@ import { css } from '@emotion/react';
10
10
  import { logicalCSS } from '../../global_styling';
11
11
  import { euiShadowFlat } from '../../themes';
12
12
  import { euiHeaderVariables } from '../header/header.styles';
13
- import { euiCollapsibleNavBodyStyles } from './collapsible_nav_body_footer.styles';
13
+ import { hideScrollbars } from './collapsible_nav_body_footer.styles';
14
14
  export var euiCollapsibleNavBetaStyles = function euiCollapsibleNavBetaStyles(euiThemeContext) {
15
15
  var euiTheme = euiThemeContext.euiTheme;
16
16
 
@@ -24,7 +24,7 @@ export var euiCollapsibleNavBetaStyles = function euiCollapsibleNavBetaStyles(eu
24
24
  left: /*#__PURE__*/css(logicalCSS('border-right', euiTheme.border.thin), ";;label:left;"),
25
25
  right: /*#__PURE__*/css(logicalCSS('border-left', euiTheme.border.thin), ";;label:right;"),
26
26
  isPush: /*#__PURE__*/css(euiShadowFlat(euiThemeContext), ";;label:isPush;"),
27
- isPushCollapsed: /*#__PURE__*/css(euiCollapsibleNavBodyStyles._isPushCollapsed, ";;label:isPushCollapsed;"),
27
+ isPushCollapsed: /*#__PURE__*/css(hideScrollbars, ";;label:isPushCollapsed;"),
28
28
  isOverlayFullWidth: /*#__PURE__*/css("&.euiFlyout{", logicalCSS('max-width', '100% !important'), ";};label:isOverlayFullWidth;")
29
29
  };
30
30
  };
@@ -47,9 +47,12 @@ export var EuiCollapsibleNavFooter = function EuiCollapsibleNavFooter(_ref2) {
47
47
  var className = _ref2.className,
48
48
  props = _objectWithoutProperties(_ref2, _excluded2);
49
49
  var classes = classNames('euiCollapsibleNav__footer', className);
50
+ var _useContext2 = useContext(EuiCollapsibleNavContext),
51
+ isCollapsed = _useContext2.isCollapsed,
52
+ isPush = _useContext2.isPush;
50
53
  var euiTheme = useEuiTheme();
51
54
  var styles = euiCollapsibleNavFooterStyles(euiTheme);
52
- var cssStyles = [styles.euiCollapsibleNav__footer];
55
+ var cssStyles = [styles.euiCollapsibleNav__footer, isCollapsed && isPush && styles.isPushCollapsed];
53
56
  return ___EmotionJSX(EuiFlyoutFooter, _extends({
54
57
  className: classes,
55
58
  css: cssStyles
@@ -7,19 +7,23 @@
7
7
  */
8
8
 
9
9
  import { css } from '@emotion/react';
10
- import { logicalCSS } from '../../global_styling';
10
+ import { logicalCSS, euiYScrollWithShadows } from '../../global_styling';
11
+
12
+ // Hide the scrollbar for docked mode (while still keeping the nav scrollable)
13
+ // Otherwise if scrollbars are visible, button icon visibility suffers.
14
+ export var hideScrollbars = "\n scrollbar-width: none; /* Firefox */\n\n &::-webkit-scrollbar {\n display: none; /* Chrome, Edge, & Safari */\n }\n";
11
15
  export var euiCollapsibleNavBodyStyles = {
12
16
  // In case things get really dire responsively, ensure the footer doesn't overtake the body
13
17
  euiCollapsibleNav__body: /*#__PURE__*/css(logicalCSS('min-height', '50%'), ";;label:euiCollapsibleNav__body;"),
14
- get isPushCollapsed() {
15
- return /*#__PURE__*/css(".euiFlyoutBody__overflow{", this._isPushCollapsed, ";};label:isPushCollapsed;");
16
- },
17
- // CSS is reused by main euiCollapsibleNav styles in case the body component isn't used
18
- _isPushCollapsed: "\n /* Hide the scrollbar for docked mode (while still keeping the nav scrollable)\n Otherwise if scrollbars are visible, button icon visibility suffers. */\n scrollbar-width: none; /* Firefox */\n\n &::-webkit-scrollbar {\n display: none; /* Chrome, Edge, & Safari */\n }\n "
18
+ isPushCollapsed: /*#__PURE__*/css(".euiFlyoutBody__overflow{", hideScrollbars, ";};label:isPushCollapsed;")
19
19
  };
20
- export var euiCollapsibleNavFooterStyles = function euiCollapsibleNavFooterStyles(_ref) {
21
- var euiTheme = _ref.euiTheme;
20
+ export var euiCollapsibleNavFooterStyles = function euiCollapsibleNavFooterStyles(euiThemeContext) {
21
+ var euiTheme = euiThemeContext.euiTheme;
22
22
  return {
23
- euiCollapsibleNav__footer: /*#__PURE__*/css("background-color:", euiTheme.colors.emptyShade, ";", logicalCSS('border-top', euiTheme.border.thin), ";;label:euiCollapsibleNav__footer;")
23
+ euiCollapsibleNav__footer: /*#__PURE__*/css("background-color:", euiTheme.colors.emptyShade, ";", logicalCSS('border-top', euiTheme.border.thin), " ", euiYScrollWithShadows(euiThemeContext, {
24
+ side: 'end',
25
+ height: 'auto'
26
+ }), " flex-shrink:0;;label:euiCollapsibleNav__footer;"),
27
+ isPushCollapsed: /*#__PURE__*/css(hideScrollbars, ";;label:isPushCollapsed;")
24
28
  };
25
29
  };
@@ -49,118 +49,18 @@ export var EuiCollapsibleNavGroup = function EuiCollapsibleNavGroup(_ref) {
49
49
  })));
50
50
  };
51
51
  EuiCollapsibleNavGroup.propTypes = {
52
- /**
53
- * Required text to render as the nav item title
54
- */
55
- title: PropTypes.string.isRequired,
56
- /**
57
- * Allows customizing the title element.
58
- * Consider using a heading element for better accessibility.
59
- * Defaults to an unsemantic `span` or `div`, depending on context.
60
- */
61
- titleElement: PropTypes.oneOf(["h2", "h3", "h4", "h5", "h6", "span", "div"]),
62
- icon: PropTypes.oneOfType([PropTypes.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", "grabOmnidirectional", "gradient", "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", "palette", "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", "transitionLeftIn", "transitionLeftOut", "transitionTopIn", "transitionTopOut", "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", "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", "tokenVectorDense", "tokenDenseVector", "tokenVectorSparse"]).isRequired, PropTypes.string.isRequired, PropTypes.elementType.isRequired]),
63
- /**
64
- * Optional props to pass to the title icon
65
- */
66
- iconProps: PropTypes.any,
67
52
  className: PropTypes.string,
68
53
  "aria-label": PropTypes.string,
69
54
  "data-test-subj": PropTypes.string,
70
55
  css: PropTypes.any,
71
- /**
72
- * The nav item link.
73
- * If not included, and no `onClick` is specified, the nav item
74
- * will render as an non-interactive `<span>`.
75
- */
76
- href: PropTypes.string,
77
- /**
78
- * If set to false, will (visually) render an always-open accordion that cannot
79
- * be toggled closed. Ignored if `items` is not passed.
80
- *
81
- * @default true
82
- */
83
- isCollapsible: PropTypes.bool,
84
- /**
85
- * If a `href` is specified, use this prop to pass any prop that `EuiLink` accepts
86
- */
87
- linkProps: PropTypes.any,
88
56
  /**
89
57
  * Highlights whether an item is currently selected, e.g.
90
58
  * if the user is on the same page as the nav link
91
59
  */
92
60
  isSelected: PropTypes.bool,
93
61
  /**
94
- * Will render an array of `EuiCollapsibleNavItems`.
95
- *
96
- * Accepts any #EuiCollapsibleNavItemProps. Or, to render completely custom
97
- * subitem content, pass an object with a `renderItem` callback.
98
- */
99
- items: PropTypes.arrayOf(PropTypes.shape({
100
- /**
101
- * Required text to render as the nav item title
102
- */
103
- title: PropTypes.string,
104
- /**
105
- * Allows customizing the title element.
106
- * Consider using a heading element for better accessibility.
107
- * Defaults to an unsemantic `span` or `div`, depending on context.
108
- */
109
- titleElement: PropTypes.oneOf(["h2", "h3", "h4", "h5", "h6", "span", "div"]),
110
- /**
111
- * Optional icon to render to the left of title content
112
- */
113
- icon: PropTypes.oneOfType([PropTypes.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", "grabOmnidirectional", "gradient", "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", "palette", "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", "transitionLeftIn", "transitionLeftOut", "transitionTopIn", "transitionTopOut", "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", "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", "tokenVectorDense", "tokenDenseVector", "tokenVectorSparse"]).isRequired, PropTypes.string.isRequired, PropTypes.elementType.isRequired]),
114
- /**
115
- * Optional props to pass to the title icon
62
+ * Optional props to pass to the wrapping div
116
63
  */
117
- iconProps: PropTypes.any,
118
- className: PropTypes.string,
119
- "aria-label": PropTypes.string,
120
- "data-test-subj": PropTypes.string,
121
- css: PropTypes.any,
122
- /**
123
- * The nav item link.
124
- * If not included, and no `onClick` is specified, the nav item
125
- * will render as an non-interactive `<span>`.
126
- */
127
- href: PropTypes.string,
128
- /**
129
- * Will render either an accordion or group of nested child item links.
130
- *
131
- * Accepts any #EuiCollapsibleNavItemProps. Or, to render completely custom
132
- * subitem content, pass an object with a `renderItem` callback.
133
- */
134
- items: PropTypes.arrayOf(PropTypes.shape({
135
- renderItem: PropTypes.func
136
- }).isRequired),
137
- /**
138
- * If set to false, will (visually) render an always-open accordion that cannot
139
- * be toggled closed. Ignored if `items` is not passed.
140
- *
141
- * @default true
142
- */
143
- isCollapsible: PropTypes.bool,
144
- /**
145
- * If `items` is specified, and `isCollapsible` is not set to false, you may
146
- * use this prop to pass any prop that `EuiAccordion` accepts, including props
147
- * that control the toggled state of the accordion (e.g. `initialIsOpen`, `forceState`)
148
- */
149
- accordionProps: PropTypes.any,
150
- /**
151
- * If a `href` is specified, use this prop to pass any prop that `EuiLink` accepts
152
- */
153
- linkProps: PropTypes.any,
154
- /**
155
- * Highlights whether an item is currently selected, e.g.
156
- * if the user is on the same page as the nav link
157
- */
158
- isSelected: PropTypes.bool,
159
- renderItem: PropTypes.func
160
- }).isRequired).isRequired,
161
- /**
162
- * Optional props to pass to the wrapping div
163
- */
164
64
  wrapperProps: PropTypes.shape({
165
65
  className: PropTypes.string,
166
66
  "aria-label": PropTypes.string,
@@ -1,4 +1,4 @@
1
- var _excluded = ["href", "title", "icon", "iconProps", "isSelected", "onClick", "hideToolTip", "linkProps", "accordionProps", "titleElement", "items"];
1
+ var _excluded = ["href", "title", "icon", "iconProps", "isSelected", "onClick", "hideToolTip", "linkProps", "titleElement"];
2
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
@@ -28,9 +28,7 @@ export var EuiCollapsedNavButton = function EuiCollapsedNavButton(_ref) {
28
28
  onClick = _ref.onClick,
29
29
  hideToolTip = _ref.hideToolTip,
30
30
  linkProps = _ref.linkProps,
31
- accordionProps = _ref.accordionProps,
32
31
  titleElement = _ref.titleElement,
33
- items = _ref.items,
34
32
  rest = _objectWithoutProperties(_ref, _excluded);
35
33
  var euiTheme = useEuiTheme();
36
34
  var _useContext = useContext(EuiCollapsibleNavContext),
@@ -63,6 +61,15 @@ export var EuiCollapsedNavButton = function EuiCollapsedNavButton(_ref) {
63
61
  })));
64
62
  };
65
63
  EuiCollapsedNavButton.propTypes = {
64
+ className: PropTypes.string,
65
+ "aria-label": PropTypes.string,
66
+ "data-test-subj": PropTypes.string,
67
+ css: PropTypes.any,
68
+ /**
69
+ * Highlights whether an item is currently selected, e.g.
70
+ * if the user is on the same page as the nav link
71
+ */
72
+ isSelected: PropTypes.bool,
66
73
  /**
67
74
  * Required text to render as the nav item title
68
75
  */
@@ -78,64 +85,19 @@ EuiCollapsedNavButton.propTypes = {
78
85
  * Optional props to pass to the title icon
79
86
  */
80
87
  iconProps: PropTypes.any,
81
- className: PropTypes.string,
82
- "aria-label": PropTypes.string,
83
- "data-test-subj": PropTypes.string,
84
- css: PropTypes.any,
85
88
  /**
86
- * The nav item link.
87
- * If not included, and no `onClick` is specified, the nav item
88
- * will render as an non-interactive `<span>`.
89
- */
89
+ * The nav item link.
90
+ *
91
+ * If not included, and no `onClick` is specified, the nav item
92
+ * will render as an non-interactive `<span>`.
93
+ *
94
+ * Should not be used together with `items`, as the title will
95
+ * trigger the accordion collapse/expand action instead of a link.
96
+ */
90
97
  href: PropTypes.string,
91
98
  /**
92
- * Will render either an accordion or group of nested child item links.
93
- *
94
- * Accepts any #EuiCollapsibleNavItemProps. Or, to render completely custom
95
- * subitem content, pass an object with a `renderItem` callback.
96
- */
97
- items: PropTypes.arrayOf(PropTypes.shape({
98
- /**
99
- * Required text to render as the nav item title
100
- */
101
- title: PropTypes.string,
102
- /**
103
- * Allows customizing the title element.
104
- * Consider using a heading element for better accessibility.
105
- * Defaults to an unsemantic `span` or `div`, depending on context.
106
- */
107
- titleElement: PropTypes.oneOf(["h2", "h3", "h4", "h5", "h6", "span", "div"]),
108
- /**
109
- * Optional icon to render to the left of title content
110
- */
111
- icon: PropTypes.oneOfType([PropTypes.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", "grabOmnidirectional", "gradient", "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", "palette", "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", "transitionLeftIn", "transitionLeftOut", "transitionTopIn", "transitionTopOut", "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", "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", "tokenVectorDense", "tokenDenseVector", "tokenVectorSparse"]).isRequired, PropTypes.string.isRequired, PropTypes.elementType.isRequired]),
112
- /**
113
- * Optional props to pass to the title icon
114
- */
115
- iconProps: PropTypes.any,
116
- renderItem: PropTypes.func
117
- }).isRequired),
118
- /**
119
- * If set to false, will (visually) render an always-open accordion that cannot
120
- * be toggled closed. Ignored if `items` is not passed.
121
- *
122
- * @default true
123
- */
124
- isCollapsible: PropTypes.bool,
125
- /**
126
- * If `items` is specified, and `isCollapsible` is not set to false, you may
127
- * use this prop to pass any prop that `EuiAccordion` accepts, including props
128
- * that control the toggled state of the accordion (e.g. `initialIsOpen`, `forceState`)
129
- */
130
- accordionProps: PropTypes.any,
131
- /**
132
- * If a `href` is specified, use this prop to pass any prop that `EuiLink` accepts
133
- */
99
+ * If a `href` is specified, use this prop to pass any prop that `EuiLink` accepts
100
+ */
134
101
  linkProps: PropTypes.any,
135
- /**
136
- * Highlights whether an item is currently selected, e.g.
137
- * if the user is on the same page as the nav link
138
- */
139
- isSelected: PropTypes.bool,
140
102
  hideToolTip: PropTypes.bool
141
103
  };
@@ -1,4 +1,4 @@
1
- var _excluded = ["items", "className"];
1
+ var _excluded = ["className", "href", "linkProps", "items", "accordionProps", "isCollapsible"];
2
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
@@ -24,19 +24,33 @@ import classNames from 'classnames';
24
24
  */
25
25
  import { jsx as ___EmotionJSX } from "@emotion/react";
26
26
  export var EuiCollapsedNavItem = function EuiCollapsedNavItem(_ref) {
27
- var items = _ref.items,
28
- className = _ref.className,
27
+ var className = _ref.className,
28
+ href = _ref.href,
29
+ linkProps = _ref.linkProps,
30
+ items = _ref.items,
31
+ accordionProps = _ref.accordionProps,
32
+ isCollapsible = _ref.isCollapsible,
29
33
  props = _objectWithoutProperties(_ref, _excluded);
30
34
  var classes = classNames('euiCollapsedNavItem', className);
31
- var hasItems = items && items.length > 0;
32
- return hasItems ? ___EmotionJSX(EuiCollapsedNavPopover, _extends({
35
+ return items ? ___EmotionJSX(EuiCollapsedNavPopover, _extends({
33
36
  items: items,
34
37
  className: classes
35
38
  }, props)) : ___EmotionJSX(EuiCollapsedNavButton, _extends({
39
+ href: href,
40
+ linkProps: linkProps,
36
41
  className: classes
37
42
  }, props));
38
43
  };
39
44
  EuiCollapsedNavItem.propTypes = {
45
+ className: PropTypes.string,
46
+ "aria-label": PropTypes.string,
47
+ "data-test-subj": PropTypes.string,
48
+ css: PropTypes.any,
49
+ /**
50
+ * Highlights whether an item is currently selected, e.g.
51
+ * if the user is on the same page as the nav link
52
+ */
53
+ isSelected: PropTypes.bool,
40
54
  /**
41
55
  * Required text to render as the nav item title
42
56
  */
@@ -52,23 +66,36 @@ EuiCollapsedNavItem.propTypes = {
52
66
  * Optional props to pass to the title icon
53
67
  */
54
68
  iconProps: PropTypes.any,
55
- className: PropTypes.string,
56
- "aria-label": PropTypes.string,
57
- "data-test-subj": PropTypes.string,
58
- css: PropTypes.any,
59
69
  /**
60
- * The nav item link.
61
- * If not included, and no `onClick` is specified, the nav item
62
- * will render as an non-interactive `<span>`.
63
- */
70
+ * The nav item link.
71
+ *
72
+ * If not included, and no `onClick` is specified, the nav item
73
+ * will render as an non-interactive `<span>`.
74
+ *
75
+ * Should not be used together with `items`, as the title will
76
+ * trigger the accordion collapse/expand action instead of a link.
77
+ */
64
78
  href: PropTypes.string,
65
79
  /**
66
- * Will render either an accordion or group of nested child item links.
67
- *
68
- * Accepts any #EuiCollapsibleNavItemProps. Or, to render completely custom
69
- * subitem content, pass an object with a `renderItem` callback.
70
- */
80
+ * If a `href` is specified, use this prop to pass any prop that `EuiLink` accepts
81
+ */
82
+ linkProps: PropTypes.any,
83
+ /**
84
+ * Will render either an accordion or group of nested child item links.
85
+ *
86
+ * Accepts any #EuiCollapsibleNavItemProps. Or, to render completely custom
87
+ * subitem content, pass an object with a `renderItem` callback.
88
+ */
71
89
  items: PropTypes.arrayOf(PropTypes.shape({
90
+ className: PropTypes.string,
91
+ "aria-label": PropTypes.string,
92
+ "data-test-subj": PropTypes.string,
93
+ css: PropTypes.any,
94
+ /**
95
+ * Highlights whether an item is currently selected, e.g.
96
+ * if the user is on the same page as the nav link
97
+ */
98
+ isSelected: PropTypes.bool,
72
99
  /**
73
100
  * Required text to render as the nav item title
74
101
  */
@@ -87,28 +114,53 @@ EuiCollapsedNavItem.propTypes = {
87
114
  * Optional props to pass to the title icon
88
115
  */
89
116
  iconProps: PropTypes.any,
117
+ /**
118
+ * The nav item link.
119
+ *
120
+ * If not included, and no `onClick` is specified, the nav item
121
+ * will render as an non-interactive `<span>`.
122
+ *
123
+ * Should not be used together with `items`, as the title will
124
+ * trigger the accordion collapse/expand action instead of a link.
125
+ */
126
+ href: PropTypes.string,
127
+ /**
128
+ * If a `href` is specified, use this prop to pass any prop that `EuiLink` accepts
129
+ */
130
+ linkProps: PropTypes.any,
131
+ /**
132
+ * Will render either an accordion or group of nested child item links.
133
+ *
134
+ * Accepts any #EuiCollapsibleNavItemProps. Or, to render completely custom
135
+ * subitem content, pass an object with a `renderItem` callback.
136
+ */
137
+ items: PropTypes.arrayOf(PropTypes.any.isRequired),
138
+ /**
139
+ * If set to false, will (visually) render an always-open accordion that cannot
140
+ * be toggled closed. Ignored if `items` is not passed.
141
+ *
142
+ * @default true
143
+ */
144
+ isCollapsible: PropTypes.bool,
145
+ /**
146
+ * If `items` is specified, and `isCollapsible` is not set to false, you may
147
+ * use this prop to pass any prop that `EuiAccordion` accepts, including props
148
+ * that control the toggled state of the accordion (e.g. `initialIsOpen`, `forceState`)
149
+ */
150
+ accordionProps: PropTypes.any,
90
151
  renderItem: PropTypes.func
91
152
  }).isRequired),
92
153
  /**
93
- * If set to false, will (visually) render an always-open accordion that cannot
94
- * be toggled closed. Ignored if `items` is not passed.
95
- *
96
- * @default true
97
- */
154
+ * If set to false, will (visually) render an always-open accordion that cannot
155
+ * be toggled closed. Ignored if `items` is not passed.
156
+ *
157
+ * @default true
158
+ */
98
159
  isCollapsible: PropTypes.bool,
99
160
  /**
100
- * If `items` is specified, and `isCollapsible` is not set to false, you may
101
- * use this prop to pass any prop that `EuiAccordion` accepts, including props
102
- * that control the toggled state of the accordion (e.g. `initialIsOpen`, `forceState`)
103
- */
104
- accordionProps: PropTypes.any,
105
- /**
106
- * If a `href` is specified, use this prop to pass any prop that `EuiLink` accepts
107
- */
108
- linkProps: PropTypes.any,
109
- /**
110
- * Highlights whether an item is currently selected, e.g.
111
- * if the user is on the same page as the nav link
112
- */
113
- isSelected: PropTypes.bool
161
+ * If `items` is specified, and `isCollapsible` is not set to false, you may
162
+ * use this prop to pass any prop that `EuiAccordion` accepts, including props
163
+ * that control the toggled state of the accordion (e.g. `initialIsOpen`, `forceState`)
164
+ */
165
+ accordionProps: PropTypes.any
114
166
  };