@splunk/react-ui 4.21.0 → 4.22.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 (92) hide show
  1. package/Accordion.js +425 -325
  2. package/Anchor.js +147 -117
  3. package/Animation.js +142 -94
  4. package/AnimationToggle.js +197 -193
  5. package/Box.js +145 -118
  6. package/Breadcrumbs.js +288 -206
  7. package/Button.js +488 -465
  8. package/ButtonGroup.js +160 -128
  9. package/ButtonSimple.js +543 -462
  10. package/CHANGELOG.md +24 -3
  11. package/Calendar.js +1111 -1001
  12. package/Card.js +771 -598
  13. package/CardLayout.js +205 -147
  14. package/Chip.js +509 -488
  15. package/Clickable.js +414 -352
  16. package/CloseButton.js +165 -142
  17. package/Code.js +1807 -2084
  18. package/CollapsiblePanel.js +586 -519
  19. package/Color.js +1068 -1068
  20. package/ColumnLayout.js +402 -363
  21. package/ComboBox.js +903 -794
  22. package/Concertina.js +997 -802
  23. package/ControlGroup.js +687 -594
  24. package/Date.js +567 -547
  25. package/DefinitionList.js +308 -234
  26. package/Divider.js +149 -118
  27. package/Dropdown.js +459 -416
  28. package/DualListbox.js +1479 -1541
  29. package/EventListener.js +94 -97
  30. package/File.js +1051 -969
  31. package/FormRows.js +883 -696
  32. package/Heading.js +216 -193
  33. package/Image.js +446 -402
  34. package/JSONTree.js +690 -551
  35. package/Layer.js +437 -410
  36. package/Link.js +336 -255
  37. package/List.js +213 -161
  38. package/Markdown.js +509 -487
  39. package/Menu.js +1104 -1056
  40. package/Message.js +475 -441
  41. package/MessageBar.js +387 -373
  42. package/Modal.js +810 -634
  43. package/ModalLayer.js +326 -243
  44. package/Monogram.js +308 -276
  45. package/Multiselect.js +3564 -3364
  46. package/Number.js +729 -687
  47. package/Paginator.js +510 -449
  48. package/Paragraph.js +145 -112
  49. package/Popover.js +1459 -1432
  50. package/Progress.js +301 -246
  51. package/RadioBar.js +634 -527
  52. package/RadioList.js +483 -444
  53. package/Resize.js +530 -489
  54. package/ResultsMenu.js +479 -455
  55. package/ScreenReaderContent.js +142 -111
  56. package/Scroll.js +595 -456
  57. package/ScrollContainerContext.js +197 -206
  58. package/Search.js +756 -650
  59. package/Select.js +2446 -2345
  60. package/SidePanel.js +390 -284
  61. package/Slider.js +680 -676
  62. package/SlidingPanels.js +639 -503
  63. package/SplitButton.js +464 -367
  64. package/StaticContent.js +161 -133
  65. package/StepBar.js +386 -358
  66. package/Switch.js +710 -640
  67. package/TabBar.js +741 -680
  68. package/TabLayout.js +406 -322
  69. package/Table.js +4974 -4616
  70. package/Text.js +1170 -1138
  71. package/TextArea.js +1102 -1090
  72. package/Tooltip.js +624 -581
  73. package/TransitionOpen.js +489 -422
  74. package/Typography.js +176 -153
  75. package/WaitSpinner.js +230 -206
  76. package/package.json +7 -7
  77. package/types/src/Color/Color.d.ts +0 -1
  78. package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
  79. package/types/src/JSONTree/TreeNode.d.ts +5 -0
  80. package/types/src/RadioBar/RadioBar.d.ts +1 -0
  81. package/types/src/ResultsMenu/ResultsMenu.d.ts +0 -2
  82. package/types/src/Select/docs/examples/Icons.d.ts +1 -9
  83. package/types/src/Slider/Slider.d.ts +1 -0
  84. package/types/src/TabBar/Tab.d.ts +10 -1
  85. package/types/src/TabBar/TabBar.d.ts +4 -2
  86. package/types/src/Table/Head.d.ts +7 -3
  87. package/types/src/Table/Table.d.ts +3 -2
  88. package/types/src/Table/TableContext.d.ts +2 -0
  89. package/useForceUpdate.js +112 -82
  90. package/useKeyPress.js +74 -71
  91. package/usePrevious.js +65 -65
  92. package/useRovingFocus.js +122 -138
package/Menu.js CHANGED
@@ -1,1082 +1,1130 @@
1
- /******/ (() => { // webpackBootstrap
2
- /******/ "use strict";
3
- /******/ // The require scope
4
- /******/ var __webpack_require__ = {};
5
- /******/
6
- /************************************************************************/
7
- /******/ /* webpack/runtime/compat get default export */
8
- /******/ (() => {
9
- /******/ // getDefaultExport function for compatibility with non-harmony modules
10
- /******/ __webpack_require__.n = (module) => {
11
- /******/ var getter = module && module.__esModule ?
12
- /******/ () => (module['default']) :
13
- /******/ () => (module);
14
- /******/ __webpack_require__.d(getter, { a: getter });
15
- /******/ return getter;
16
- /******/ };
17
- /******/ })();
18
- /******/
19
- /******/ /* webpack/runtime/define property getters */
20
- /******/ (() => {
21
- /******/ // define getter functions for harmony exports
22
- /******/ __webpack_require__.d = (exports, definition) => {
23
- /******/ for(var key in definition) {
24
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
25
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
26
- /******/ }
27
- /******/ }
28
- /******/ };
29
- /******/ })();
30
- /******/
31
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
32
- /******/ (() => {
33
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
34
- /******/ })();
35
- /******/
36
- /******/ /* webpack/runtime/make namespace object */
37
- /******/ (() => {
38
- /******/ // define __esModule on exports
39
- /******/ __webpack_require__.r = (exports) => {
40
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
41
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
42
- /******/ }
43
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
44
- /******/ };
45
- /******/ })();
46
- /******/
47
- /************************************************************************/
48
- var __webpack_exports__ = {};
49
- // ESM COMPAT FLAG
50
- __webpack_require__.r(__webpack_exports__);
51
-
52
- // EXPORTS
53
- __webpack_require__.d(__webpack_exports__, {
54
- Divider: () => (/* reexport */ Menu_Divider),
55
- Heading: () => (/* reexport */ Menu_Heading),
56
- Item: () => (/* reexport */ Menu_Item),
57
- MenuContext: () => (/* reexport */ MenuContext),
58
- "default": () => (/* reexport */ Menu_Menu)
59
- });
60
-
61
- ;// CONCATENATED MODULE: external "react"
62
- const external_react_namespaceObject = require("react");
63
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_namespaceObject);
64
- ;// CONCATENATED MODULE: external "prop-types"
65
- const external_prop_types_namespaceObject = require("prop-types");
66
- var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_namespaceObject);
67
- ;// CONCATENATED MODULE: external "lodash/omit"
68
- const omit_namespaceObject = require("lodash/omit");
69
- var omit_default = /*#__PURE__*/__webpack_require__.n(omit_namespaceObject);
70
- ;// CONCATENATED MODULE: external "@splunk/react-ui/Popover"
71
- const Popover_namespaceObject = require("@splunk/react-ui/Popover");
72
- ;// CONCATENATED MODULE: external "@splunk/ui-utils/focus"
73
- const focus_namespaceObject = require("@splunk/ui-utils/focus");
74
- ;// CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
75
- const keyboard_namespaceObject = require("@splunk/ui-utils/keyboard");
76
- ;// CONCATENATED MODULE: external "@splunk/react-ui/useForceUpdate"
77
- const useForceUpdate_namespaceObject = require("@splunk/react-ui/useForceUpdate");
78
- var useForceUpdate_default = /*#__PURE__*/__webpack_require__.n(useForceUpdate_namespaceObject);
79
- ;// CONCATENATED MODULE: external "styled-components"
80
- const external_styled_components_namespaceObject = require("styled-components");
81
- var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_namespaceObject);
82
- ;// CONCATENATED MODULE: external "@splunk/themes"
83
- const themes_namespaceObject = require("@splunk/themes");
84
- ;// CONCATENATED MODULE: ./src/Menu/DividerStyles.ts
85
-
86
-
87
- var Styled = external_styled_components_default().div.withConfig({
88
- displayName: "DividerStyles__Styled",
89
- componentId: "l3zfh3-0"
90
- })(["border-top:1px solid ", ";", ""], (0,themes_namespaceObject.pick)({
91
- enterprise: themes_namespaceObject.variables.borderColor,
92
- prisma: themes_namespaceObject.variables.neutral200
93
- }), (0,themes_namespaceObject.pick)({
94
- prisma: {
95
- comfortable: (0,external_styled_components_namespaceObject.css)(["margin:8px 0;"]),
96
- compact: (0,external_styled_components_namespaceObject.css)(["margin:6px 0;"])
97
- }
98
- }));
99
-
100
- ;// CONCATENATED MODULE: ./src/Menu/MenuContext.tsx
101
-
102
- var MenuContext = /*#__PURE__*/(0,external_react_namespaceObject.createContext)({
103
- role: 'menu'
104
- });
105
-
106
- ;// CONCATENATED MODULE: ./src/Menu/Divider.tsx
107
- function _extends() { _extends = Object.assign || 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); }
108
-
109
-
110
-
111
-
112
- var propTypes = {};
113
-
114
- /**
1
+ /******/ (() => {
2
+ // webpackBootstrap
3
+ /******/ "use strict";
4
+ /******/ // The require scope
5
+ /******/ var e = {};
6
+ /******/
7
+ /************************************************************************/
8
+ /******/ /* webpack/runtime/compat get default export */
9
+ /******/ (() => {
10
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
11
+ /******/ e.n = t => {
12
+ /******/ var r = t && t.__esModule ?
13
+ /******/ () => t["default"]
14
+ /******/ : () => t
15
+ /******/;
16
+ e.d(r, {
17
+ a: r
18
+ });
19
+ /******/ return r;
20
+ /******/ };
21
+ /******/ })();
22
+ /******/
23
+ /******/ /* webpack/runtime/define property getters */
24
+ /******/ (() => {
25
+ /******/ // define getter functions for harmony exports
26
+ /******/ e.d = (t, r) => {
27
+ /******/ for (var n in r) {
28
+ /******/ if (e.o(r, n) && !e.o(t, n)) {
29
+ /******/ Object.defineProperty(t, n, {
30
+ enumerable: true,
31
+ get: r[n]
32
+ });
33
+ /******/ }
34
+ /******/ }
35
+ /******/ };
36
+ /******/ })();
37
+ /******/
38
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
39
+ /******/ (() => {
40
+ /******/ e.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)
41
+ /******/;
42
+ })();
43
+ /******/
44
+ /******/ /* webpack/runtime/make namespace object */
45
+ /******/ (() => {
46
+ /******/ // define __esModule on exports
47
+ /******/ e.r = e => {
48
+ /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
49
+ /******/ Object.defineProperty(e, Symbol.toStringTag, {
50
+ value: "Module"
51
+ });
52
+ /******/ }
53
+ /******/ Object.defineProperty(e, "__esModule", {
54
+ value: true
55
+ });
56
+ /******/ };
57
+ /******/ })();
58
+ /******/
59
+ /************************************************************************/ var t = {};
60
+ // ESM COMPAT FLAG
61
+ e.r(t);
62
+ // EXPORTS
63
+ e.d(t, {
64
+ Divider: () => /* reexport */ x,
65
+ Heading: () => /* reexport */ H,
66
+ Item: () => /* reexport */ ze,
67
+ MenuContext: () => /* reexport */ h,
68
+ default: () => /* reexport */ rt
69
+ });
70
+ // CONCATENATED MODULE: external "react"
71
+ const r = require("react");
72
+ var n = e.n(r);
73
+ // CONCATENATED MODULE: external "prop-types"
74
+ const i = require("prop-types");
75
+ var o = e.n(i);
76
+ // CONCATENATED MODULE: external "lodash/omit"
77
+ const a = require("lodash/omit");
78
+ var l = e.n(a);
79
+ // CONCATENATED MODULE: external "@splunk/react-ui/Popover"
80
+ const s = require("@splunk/react-ui/Popover");
81
+ // CONCATENATED MODULE: external "@splunk/ui-utils/focus"
82
+ const c = require("@splunk/ui-utils/focus");
83
+ // CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
84
+ const p = require("@splunk/ui-utils/keyboard");
85
+ // CONCATENATED MODULE: external "@splunk/react-ui/useForceUpdate"
86
+ const u = require("@splunk/react-ui/useForceUpdate");
87
+ var d = e.n(u);
88
+ // CONCATENATED MODULE: external "styled-components"
89
+ const f = require("styled-components");
90
+ var v = e.n(f);
91
+ // CONCATENATED MODULE: external "@splunk/themes"
92
+ const b = require("@splunk/themes");
93
+ // CONCATENATED MODULE: ./src/Menu/DividerStyles.ts
94
+ var m = v().div.withConfig({
95
+ displayName: "DividerStyles__Styled",
96
+ componentId: "l3zfh3-0"
97
+ })([ "border-top:1px solid ", ";", "" ], (0, b.pick)({
98
+ enterprise: b.variables.borderColor,
99
+ prisma: b.variables.neutral200
100
+ }), (0, b.pick)({
101
+ prisma: {
102
+ comfortable: (0, f.css)([ "margin:8px 0;" ]),
103
+ compact: (0, f.css)([ "margin:6px 0;" ])
104
+ }
105
+ }));
106
+ // CONCATENATED MODULE: ./src/Menu/MenuContext.tsx
107
+ var h = (0, r.createContext)({
108
+ role: "menu"
109
+ });
110
+ // CONCATENATED MODULE: ./src/Menu/Divider.tsx
111
+ function y() {
112
+ y = Object.assign || function(e) {
113
+ for (var t = 1; t < arguments.length; t++) {
114
+ var r = arguments[t];
115
+ for (var n in r) {
116
+ if (Object.prototype.hasOwnProperty.call(r, n)) {
117
+ e[n] = r[n];
118
+ }
119
+ }
120
+ }
121
+ return e;
122
+ };
123
+ return y.apply(this, arguments);
124
+ }
125
+ var g = {};
126
+ /**
115
127
  * A non-interactive menu item used to visually separate groups of items in the menu.
116
- */
117
- function Divider(_ref) {
118
- var otherProps = _extends({}, _ref);
119
-
120
- // @docs-props-type DividerPropsBase
121
- var _useContext = (0,external_react_namespaceObject.useContext)(MenuContext),
122
- role = _useContext.role;
123
-
124
- return /*#__PURE__*/external_react_default().createElement(Styled // dividers are not supported in role="listbox"
125
- // this causes Firefox to incorrectly read the total number
126
- // of items in the list if it contains a heading or divider
127
- // so we set them to aria-hidden to prevent that
128
- , _extends({
129
- "aria-hidden": role === 'listbox',
130
- "data-test": "divider",
131
- role: "separator"
132
- }, otherProps));
133
- }
134
-
135
- Divider.propTypes = propTypes;
136
- /* Remove the item if it is the first item after filtering */
137
-
138
- Divider.filterFirst = true;
139
- /* Remove consecutive items with filterConsecutive = true (Dividers and Headings) */
140
-
141
- Divider.filterConsecutive = true;
142
- /* Remove the item if it is the last item after filtering. */
143
-
144
- Divider.filterLast = true;
145
- /* Tag the item as Divider */
146
-
147
- Divider.as = 'Divider';
148
- /* harmony default export */ const Menu_Divider = (Divider);
149
- ;// CONCATENATED MODULE: external "@splunk/react-ui/Heading"
150
- const Heading_namespaceObject = require("@splunk/react-ui/Heading");
151
- var Heading_default = /*#__PURE__*/__webpack_require__.n(Heading_namespaceObject);
152
- ;// CONCATENATED MODULE: external "@splunk/themes/useSplunkTheme"
153
- const useSplunkTheme_namespaceObject = require("@splunk/themes/useSplunkTheme");
154
- var useSplunkTheme_default = /*#__PURE__*/__webpack_require__.n(useSplunkTheme_namespaceObject);
155
- ;// CONCATENATED MODULE: ./src/Menu/HeadingStyles.ts
156
-
157
-
158
- var HeadingStyles_Styled = external_styled_components_default().div.withConfig({
159
- displayName: "HeadingStyles__Styled",
160
- componentId: "mcd2ws-0"
161
- })(["", " border-top:1px solid transparent;padding:", ";&:not(:first-child){", ";}"], themes_namespaceObject.mixins.reset('block'), (0,themes_namespaceObject.pick)({
162
- enterprise: (0,external_styled_components_namespaceObject.css)(["", " ", " 6px"], themes_namespaceObject.variables.spacingQuarter, themes_namespaceObject.variables.spacingHalf),
163
- prisma: {
164
- comfortable: '13px 16px 10px 16px',
165
- compact: '9px 16px 6px 16px'
166
- }
167
- }), (0,themes_namespaceObject.pick)({
168
- enterprise: (0,external_styled_components_namespaceObject.css)(["border-top:", ";"], themes_namespaceObject.variables.border),
169
- prisma: {
170
- comfortable: (0,external_styled_components_namespaceObject.css)(["border-top:1px solid ", ";margin-top:6px;padding-top:19px;"], themes_namespaceObject.variables.neutral200),
171
- compact: (0,external_styled_components_namespaceObject.css)(["border-top:1px solid ", ";margin-top:6px;padding-top:15px;"], themes_namespaceObject.variables.neutral200)
172
- }
173
- }));
174
- var PrismaSectionTitle = external_styled_components_default().h5.withConfig({
175
- displayName: "HeadingStyles__PrismaSectionTitle",
176
- componentId: "mcd2ws-1"
177
- })(["", " font-size:", ";line-height:", ";font-weight:", ";letter-spacing:0.02em;"], themes_namespaceObject.mixins.reset('block'), themes_namespaceObject.variables.fontSizeSmall, themes_namespaceObject.variables.lineHeight, themes_namespaceObject.variables.fontWeightBold);
178
-
179
- ;// CONCATENATED MODULE: ./src/Menu/Heading.tsx
180
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
181
-
182
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
183
-
184
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
185
-
186
- function Heading_extends() { Heading_extends = Object.assign || 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 Heading_extends.apply(this, arguments); }
187
-
188
- 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; }
189
-
190
- 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; }
191
-
192
-
193
-
194
-
195
-
196
-
197
-
198
- var Heading_propTypes = {
199
- children: (external_prop_types_default()).node,
200
- title: (external_prop_types_default()).bool,
201
- outerStyle: (external_prop_types_default()).object
202
- };
203
-
204
- /**
128
+ */ function k(e) {
129
+ var t = y({}, e);
130
+ // @docs-props-type DividerPropsBase
131
+ var i = (0, r.useContext)(h), o = i.role;
132
+
133
+ return n().createElement(m, y({
134
+ "aria-hidden": o === "listbox",
135
+ "data-test": "divider",
136
+ role: "separator"
137
+ }, t));
138
+ }
139
+ k.propTypes = g;
140
+ /* Remove the item if it is the first item after filtering */ k.filterFirst = true;
141
+ /* Remove consecutive items with filterConsecutive = true (Dividers and Headings) */ k.filterConsecutive = true;
142
+ /* Remove the item if it is the last item after filtering. */ k.filterLast = true;
143
+ /* Tag the item as Divider */ k.as = "Divider";
144
+ /* harmony default export */ const x = k;
145
+ // CONCATENATED MODULE: external "@splunk/react-ui/Heading"
146
+ const w = require("@splunk/react-ui/Heading");
147
+ var S = e.n(w);
148
+ // CONCATENATED MODULE: external "@splunk/themes/useSplunkTheme"
149
+ const O = require("@splunk/themes/useSplunkTheme");
150
+ var C = e.n(O);
151
+ // CONCATENATED MODULE: ./src/Menu/HeadingStyles.ts
152
+ var I = v().div.withConfig({
153
+ displayName: "HeadingStyles__Styled",
154
+ componentId: "mcd2ws-0"
155
+ })([ "", " border-top:1px solid transparent;padding:", ";&:not(:first-child){", ";}" ], b.mixins.reset("block"), (0,
156
+ b.pick)({
157
+ enterprise: (0, f.css)([ "", " ", " 6px" ], b.variables.spacingQuarter, b.variables.spacingHalf),
158
+ prisma: {
159
+ comfortable: "13px 16px 10px 16px",
160
+ compact: "9px 16px 6px 16px"
161
+ }
162
+ }), (0, b.pick)({
163
+ enterprise: (0, f.css)([ "border-top:", ";" ], b.variables.border),
164
+ prisma: {
165
+ comfortable: (0, f.css)([ "border-top:1px solid ", ";margin-top:6px;padding-top:19px;" ], b.variables.neutral200),
166
+ compact: (0, f.css)([ "border-top:1px solid ", ";margin-top:6px;padding-top:15px;" ], b.variables.neutral200)
167
+ }
168
+ }));
169
+ var P = v().h5.withConfig({
170
+ displayName: "HeadingStyles__PrismaSectionTitle",
171
+ componentId: "mcd2ws-1"
172
+ })([ "", " font-size:", ";line-height:", ";font-weight:", ";letter-spacing:0.02em;" ], b.mixins.reset("block"), b.variables.fontSizeSmall, b.variables.lineHeight, b.variables.fontWeightBold);
173
+ // CONCATENATED MODULE: ./src/Menu/Heading.tsx
174
+ function _(e, t) {
175
+ var r = Object.keys(e);
176
+ if (Object.getOwnPropertySymbols) {
177
+ var n = Object.getOwnPropertySymbols(e);
178
+ if (t) n = n.filter((function(t) {
179
+ return Object.getOwnPropertyDescriptor(e, t).enumerable;
180
+ }));
181
+ r.push.apply(r, n);
182
+ }
183
+ return r;
184
+ }
185
+ function j(e) {
186
+ for (var t = 1; t < arguments.length; t++) {
187
+ var r = arguments[t] != null ? arguments[t] : {};
188
+ if (t % 2) {
189
+ _(Object(r), true).forEach((function(t) {
190
+ E(e, t, r[t]);
191
+ }));
192
+ } else if (Object.getOwnPropertyDescriptors) {
193
+ Object.defineProperties(e, Object.getOwnPropertyDescriptors(r));
194
+ } else {
195
+ _(Object(r)).forEach((function(t) {
196
+ Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
197
+ }));
198
+ }
199
+ }
200
+ return e;
201
+ }
202
+ function E(e, t, r) {
203
+ if (t in e) {
204
+ Object.defineProperty(e, t, {
205
+ value: r,
206
+ enumerable: true,
207
+ configurable: true,
208
+ writable: true
209
+ });
210
+ } else {
211
+ e[t] = r;
212
+ }
213
+ return e;
214
+ }
215
+ function T() {
216
+ T = Object.assign || function(e) {
217
+ for (var t = 1; t < arguments.length; t++) {
218
+ var r = arguments[t];
219
+ for (var n in r) {
220
+ if (Object.prototype.hasOwnProperty.call(r, n)) {
221
+ e[n] = r[n];
222
+ }
223
+ }
224
+ }
225
+ return e;
226
+ };
227
+ return T.apply(this, arguments);
228
+ }
229
+ function D(e, t) {
230
+ if (e == null) return {};
231
+ var r = R(e, t);
232
+ var n, i;
233
+ if (Object.getOwnPropertySymbols) {
234
+ var o = Object.getOwnPropertySymbols(e);
235
+ for (i = 0; i < o.length; i++) {
236
+ n = o[i];
237
+ if (t.indexOf(n) >= 0) continue;
238
+ if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
239
+ r[n] = e[n];
240
+ }
241
+ }
242
+ return r;
243
+ }
244
+ function R(e, t) {
245
+ if (e == null) return {};
246
+ var r = {};
247
+ var n = Object.keys(e);
248
+ var i, o;
249
+ for (o = 0; o < n.length; o++) {
250
+ i = n[o];
251
+ if (t.indexOf(i) >= 0) continue;
252
+ r[i] = e[i];
253
+ }
254
+ return r;
255
+ }
256
+ var q = {
257
+ children: o().node,
258
+ title: o().bool,
259
+ outerStyle: o().object
260
+ };
261
+ /**
205
262
  * A non-interactive `Menu` item used to separate and label groups of `Menu` items.
206
- */
207
- function Heading(_ref) {
208
- var children = _ref.children,
209
- title = _ref.title,
210
- outerStyle = _ref.outerStyle,
211
- otherProps = _objectWithoutProperties(_ref, ["children", "title", "outerStyle"]);
212
-
213
- var _useContext = (0,external_react_namespaceObject.useContext)(MenuContext),
214
- role = _useContext.role;
215
-
216
- var _useSplunkTheme = useSplunkTheme_default()(),
217
- family = _useSplunkTheme.family;
218
-
219
- var inner = family === 'prisma' ? /*#__PURE__*/external_react_default().createElement(PrismaSectionTitle, Heading_extends({
220
- as: title ? 'h4' : 'h5',
221
- style: outerStyle,
222
- "data-test": "heading"
223
- }, otherProps), children) : /*#__PURE__*/external_react_default().createElement((Heading_default()), Heading_extends({
224
- style: _objectSpread(_objectSpread({}, outerStyle), {}, {
225
- margin: 0
226
- }),
227
- level: title ? 4 : 'ss',
228
- "data-test": "heading"
229
- }, otherProps), children); // headings are not supported in role="listbox"
230
- // this causes Firefox to incorrectly read the total number
231
- // of items in the list if it contains a heading or divider
232
- // so we set them to aria-hidden to prevent that
233
-
234
- return /*#__PURE__*/external_react_default().createElement(HeadingStyles_Styled, {
235
- "aria-hidden": role === 'listbox'
236
- }, inner);
237
- }
238
-
239
- Heading.propTypes = Heading_propTypes;
240
- /* Remove consecutive items with filterConsecutive = true (Dividers and Headings) */
241
-
242
- Heading.filterConsecutive = true;
243
- /* Remove the item if it is the last item after filtering. */
244
-
245
- Heading.filterLast = true;
246
- /* Tag the item as a Heading */
247
-
248
- Heading.as = 'Heading';
249
- /* harmony default export */ const Menu_Heading = (Heading);
250
- ;// CONCATENATED MODULE: external "lodash/isString"
251
- const isString_namespaceObject = require("lodash/isString");
252
- var isString_default = /*#__PURE__*/__webpack_require__.n(isString_namespaceObject);
253
- ;// CONCATENATED MODULE: external "@splunk/react-icons/CaretSmallRight"
254
- const CaretSmallRight_namespaceObject = require("@splunk/react-icons/CaretSmallRight");
255
- var CaretSmallRight_default = /*#__PURE__*/__webpack_require__.n(CaretSmallRight_namespaceObject);
256
- ;// CONCATENATED MODULE: external "@splunk/react-icons/Checkmark"
257
- const Checkmark_namespaceObject = require("@splunk/react-icons/Checkmark");
258
- var Checkmark_default = /*#__PURE__*/__webpack_require__.n(Checkmark_namespaceObject);
259
- ;// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Check"
260
- const Check_namespaceObject = require("@splunk/react-icons/enterprise/Check");
261
- var Check_default = /*#__PURE__*/__webpack_require__.n(Check_namespaceObject);
262
- ;// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/ChevronRight"
263
- const ChevronRight_namespaceObject = require("@splunk/react-icons/enterprise/ChevronRight");
264
- var ChevronRight_default = /*#__PURE__*/__webpack_require__.n(ChevronRight_namespaceObject);
265
- ;// CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
266
- const Clickable_namespaceObject = require("@splunk/react-ui/Clickable");
267
- var Clickable_default = /*#__PURE__*/__webpack_require__.n(Clickable_namespaceObject);
268
- ;// CONCATENATED MODULE: external "@splunk/react-ui/Switch"
269
- const Switch_namespaceObject = require("@splunk/react-ui/Switch");
270
- var Switch_default = /*#__PURE__*/__webpack_require__.n(Switch_namespaceObject);
271
- ;// CONCATENATED MODULE: ./src/Menu/ItemStyles.ts
272
-
273
-
274
-
275
-
276
- var itemDescription = (0,external_styled_components_namespaceObject.css)(["color:", ";font-size:", ";line-height:", ";overflow:inherit;white-space:inherit;text-overflow:inherit;"], (0,themes_namespaceObject.pick)({
277
- prisma: themes_namespaceObject.variables.contentColorDefault,
278
- enterprise: themes_namespaceObject.variables.textGray
279
- }), themes_namespaceObject.variables.fontSizeSmall, (0,themes_namespaceObject.pick)({
280
- prisma: '16px'
281
- }));
282
- var StyledItemDescriptionBottom = external_styled_components_default().span.withConfig({
283
- displayName: "ItemStyles__StyledItemDescriptionBottom",
284
- componentId: "sc-4kc053-0"
285
- })(["", ";display:block;"], itemDescription);
286
- var StyledItemDescriptionRight = external_styled_components_default().span.withConfig({
287
- displayName: "ItemStyles__StyledItemDescriptionRight",
288
- componentId: "sc-4kc053-1"
289
- })(["", ";float:right;padding-left:", ";max-width:50%;text-align:right;box-sizing:border-box;"], itemDescription, themes_namespaceObject.variables.spacing);
290
- var StyledItemSelectedIcon = external_styled_components_default().div.withConfig({
291
- displayName: "ItemStyles__StyledItemSelectedIcon",
292
- componentId: "sc-4kc053-2"
293
- })(["position:absolute;", " color:", ";"], (0,themes_namespaceObject.pick)({
294
- prisma: (0,external_styled_components_namespaceObject.css)(["right:16px;"]),
295
- enterprise: (0,external_styled_components_namespaceObject.css)(["top:5px;right:3px;left:8px;"])
296
- }), (0,themes_namespaceObject.pick)({
297
- prisma: themes_namespaceObject.variables.contentColorActive,
298
- enterprise: themes_namespaceObject.variables.accentColorL10
299
- }));
300
- var StyledItemIcon = external_styled_components_default().span.withConfig({
301
- displayName: "ItemStyles__StyledItemIcon",
302
- componentId: "sc-4kc053-3"
303
- })(["flex:0 0 auto;padding-right:", ";min-width:10px;display:inline-block;text-align:center;vertical-align:", ";", ""], (0,themes_namespaceObject.pick)({
304
- prisma: '8px',
305
- enterprise: '3px'
306
- }), (0,themes_namespaceObject.pick)({
307
- prisma: 'initial',
308
- enterprise: 'middle'
309
- }), (0,themes_namespaceObject.pick)({
310
- prisma: (0,external_styled_components_namespaceObject.css)(["color:", ";display:inline-flex;align-items:center;min-width:20px;min-height:20px;& > svg{width:20px;height:20px;}"], themes_namespaceObject.variables.contentColorMuted),
311
- enterprise: (0,external_styled_components_namespaceObject.css)(["transform:translateY(-1px);"])
312
- }));
313
- var StyledClickable = external_styled_components_default()((Clickable_default())).withConfig({
314
- displayName: "ItemStyles__StyledClickable",
315
- componentId: "sc-4kc053-4"
316
- })(["display:block;position:relative;cursor:pointer;color:", ";word-wrap:break-word;max-width:100%;width:100%;padding:", ";", " ", " ", " &:not([disabled]){&:hover{background:", ";", "}&:focus{outline:0;box-shadow:", ";", "}", " ", "}&[disabled]{color:", ";cursor:not-allowed;", ",", "{color:inherit;}", "{cursor:not-allowed;color:", ";}", "}", ""], (0,themes_namespaceObject.pick)({
317
- prisma: themes_namespaceObject.variables.contentColorActive,
318
- enterprise: {
319
- dark: themes_namespaceObject.variables.gray96,
320
- light: themes_namespaceObject.variables.gray22
321
- }
322
- }), (0,themes_namespaceObject.pick)({
323
- prisma: {
324
- comfortable: '10px 16px',
325
- compact: '6px 16px'
326
- },
327
- enterprise: '6px 10px'
328
- }), function (_ref) {
329
- var $isSelectable = _ref.$isSelectable,
330
- $selectableAppearance = _ref.$selectableAppearance;
331
- return $isSelectable && (0,themes_namespaceObject.pick)({
332
- prisma: (0,external_styled_components_namespaceObject.css)(["padding-right:44px;", ""], function () {
333
- return $selectableAppearance === 'checkbox' && 'padding-left: 42px;';
334
- }),
335
- enterprise: (0,external_styled_components_namespaceObject.css)(["padding-right:10px;padding-left:", ";"], function () {
336
- return $selectableAppearance === 'checkbox' ? '32px' : '28px';
337
- })
338
- });
339
- }, function (_ref2) {
340
- var $active = _ref2.$active,
341
- $preventFocus = _ref2.$preventFocus;
342
- return $active && !$preventFocus && (0,external_styled_components_namespaceObject.css)(["box-shadow:", ";"], themes_namespaceObject.variables.focusShadowInset);
343
- }, function (_ref3) {
344
- var $active = _ref3.$active;
345
- return $active && (0,external_styled_components_namespaceObject.css)(["background:", ";font-weight:", ";"], (0,themes_namespaceObject.pick)({
346
- enterprise: {
347
- light: themes_namespaceObject.variables.gray92,
348
- dark: themes_namespaceObject.variables.gray22
349
- },
350
- prisma: themes_namespaceObject.variables.neutral100
351
- }), themes_namespaceObject.variables.fontWeightBold);
352
- }, (0,themes_namespaceObject.pick)({
353
- prisma: themes_namespaceObject.variables.interactiveColorOverlayHover,
354
- enterprise: themes_namespaceObject.variables.backgroundColorHover
355
- }), function (_ref4) {
356
- var $selected = _ref4.$selected;
357
- return $selected && (0,themes_namespaceObject.pick)({
358
- prisma: (0,external_styled_components_namespaceObject.css)(["background:", ";"], themes_namespaceObject.mixins.overlayColors(themes_namespaceObject.variables.interactiveColorOverlaySelected, themes_namespaceObject.variables.interactiveColorOverlayHover))
359
- });
360
- }, themes_namespaceObject.variables.focusShadowInset, (0,themes_namespaceObject.pick)({
361
- prisma: (0,external_styled_components_namespaceObject.css)(["background:", ";"], themes_namespaceObject.variables.interactiveColorOverlayHover)
362
- }), (0,themes_namespaceObject.pick)({
363
- prisma: (0,external_styled_components_namespaceObject.css)(["&:active{background:", ";}"], themes_namespaceObject.variables.interactiveColorOverlayActive)
364
- }), function (_ref5) {
365
- var $selected = _ref5.$selected;
366
- return $selected && (0,themes_namespaceObject.pick)({
367
- prisma: (0,external_styled_components_namespaceObject.css)(["background:", ";&:active{background:", ";}"], themes_namespaceObject.variables.interactiveColorOverlaySelected, themes_namespaceObject.mixins.overlayColors(themes_namespaceObject.variables.interactiveColorOverlaySelected, themes_namespaceObject.variables.interactiveColorOverlayActive))
368
- });
369
- }, (0,themes_namespaceObject.pick)({
370
- enterprise: {
371
- light: themes_namespaceObject.variables.gray45,
372
- dark: themes_namespaceObject.variables.contentColorDisabled
373
- },
374
- prisma: themes_namespaceObject.variables.contentColorDisabled
375
- }),
376
- /* sc-sel */
377
- StyledItemDescriptionBottom,
378
- /* sc-sel */
379
- StyledItemDescriptionRight,
380
- /* sc-sel */
381
- StyledItemSelectedIcon, (0,themes_namespaceObject.pick)({
382
- prisma: themes_namespaceObject.variables.contentColorDisabled,
383
- enterprise: themes_namespaceObject.variables.gray80
384
- }), (0,themes_namespaceObject.pick)({
385
- prisma: (0,external_styled_components_namespaceObject.css)(["& > * > ", "{color:", ";}"],
386
- /* sc-sel */
387
- StyledItemIcon, themes_namespaceObject.variables.contentColorDisabled)
388
- }), function (_ref6) {
389
- var $selected = _ref6.$selected;
390
- return $selected && (0,themes_namespaceObject.pick)({
391
- prisma: (0,external_styled_components_namespaceObject.css)(["", "{color:", ";}"],
263
+ */ function N(e) {
264
+ var t = e.children, i = e.title, o = e.outerStyle, a = D(e, [ "children", "title", "outerStyle" ]);
265
+ var l = (0, r.useContext)(h), s = l.role;
266
+ var c = C()(), p = c.family;
267
+ var u = p === "prisma" ? n().createElement(P, T({
268
+ as: i ? "h4" : "h5",
269
+ style: o,
270
+ "data-test": "heading"
271
+ }, a), t) : n().createElement(S(), T({
272
+ style: j(j({}, o), {}, {
273
+ margin: 0
274
+ }),
275
+ level: i ? 4 : "ss",
276
+ "data-test": "heading"
277
+ }, a), t);
278
+ // headings are not supported in role="listbox"
279
+ // this causes Firefox to incorrectly read the total number
280
+ // of items in the list if it contains a heading or divider
281
+ // so we set them to aria-hidden to prevent that
282
+
283
+ return n().createElement(I, {
284
+ "aria-hidden": s === "listbox"
285
+ }, u);
286
+ }
287
+ N.propTypes = q;
288
+ /* Remove consecutive items with filterConsecutive = true (Dividers and Headings) */ N.filterConsecutive = true;
289
+ /* Remove the item if it is the last item after filtering. */ N.filterLast = true;
290
+ /* Tag the item as a Heading */ N.as = "Heading";
291
+ /* harmony default export */ const H = N;
292
+ // CONCATENATED MODULE: external "lodash/isString"
293
+ const F = require("lodash/isString");
294
+ var $ = e.n(F);
295
+ // CONCATENATED MODULE: external "@splunk/react-icons/ChevronRight"
296
+ const A = require("@splunk/react-icons/ChevronRight");
297
+ var M = e.n(A);
298
+ // CONCATENATED MODULE: external "@splunk/react-icons/Checkmark"
299
+ const K = require("@splunk/react-icons/Checkmark");
300
+ var z = e.n(K);
301
+ // CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Check"
302
+ const L = require("@splunk/react-icons/enterprise/Check");
303
+ var W = e.n(L);
304
+ // CONCATENATED MODULE: external "@splunk/react-icons/enterprise/ChevronRight"
305
+ const B = require("@splunk/react-icons/enterprise/ChevronRight");
306
+ var G = e.n(B);
307
+ // CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
308
+ const U = require("@splunk/react-ui/Clickable");
309
+ var V = e.n(U);
310
+ // CONCATENATED MODULE: external "@splunk/react-ui/Switch"
311
+ const Q = require("@splunk/react-ui/Switch");
312
+ var Y = e.n(Q);
313
+ // CONCATENATED MODULE: ./src/Menu/ItemStyles.ts
314
+ var J = (0, f.css)([ "color:", ";font-size:", ";line-height:", ";overflow:inherit;white-space:inherit;text-overflow:inherit;" ], (0,
315
+ b.pick)({
316
+ prisma: b.variables.contentColorDefault,
317
+ enterprise: b.variables.textGray
318
+ }), b.variables.fontSizeSmall, (0, b.pick)({
319
+ prisma: "16px"
320
+ }));
321
+ var X = v().span.withConfig({
322
+ displayName: "ItemStyles__StyledItemDescriptionBottom",
323
+ componentId: "sc-4kc053-0"
324
+ })([ "", ";display:block;" ], J);
325
+ var Z = v().span.withConfig({
326
+ displayName: "ItemStyles__StyledItemDescriptionRight",
327
+ componentId: "sc-4kc053-1"
328
+ })([ "", ";float:right;padding-left:", ";max-width:50%;text-align:right;box-sizing:border-box;" ], J, b.variables.spacing);
329
+ var ee = v().div.withConfig({
330
+ displayName: "ItemStyles__StyledItemSelectedIcon",
331
+ componentId: "sc-4kc053-2"
332
+ })([ "position:absolute;", " color:", ";" ], (0, b.pick)({
333
+ prisma: (0, f.css)([ "right:16px;" ]),
334
+ enterprise: (0, f.css)([ "top:5px;right:3px;left:8px;" ])
335
+ }), (0, b.pick)({
336
+ prisma: b.variables.contentColorActive,
337
+ enterprise: b.variables.accentColorL10
338
+ }));
339
+ var te = v().span.withConfig({
340
+ displayName: "ItemStyles__StyledItemIcon",
341
+ componentId: "sc-4kc053-3"
342
+ })([ "flex:0 0 auto;padding-right:", ";min-width:10px;display:inline-block;text-align:center;vertical-align:", ";", "" ], (0,
343
+ b.pick)({
344
+ prisma: "8px",
345
+ enterprise: "3px"
346
+ }), (0, b.pick)({
347
+ prisma: "initial",
348
+ enterprise: "middle"
349
+ }), (0, b.pick)({
350
+ prisma: (0, f.css)([ "color:", ";display:inline-flex;align-items:center;min-width:20px;min-height:20px;& > svg{width:20px;height:20px;}" ], b.variables.contentColorMuted),
351
+ enterprise: (0, f.css)([ "transform:translateY(-1px);" ])
352
+ }));
353
+ var re = v()(V()).withConfig({
354
+ displayName: "ItemStyles__StyledClickable",
355
+ componentId: "sc-4kc053-4"
356
+ })([ "display:block;position:relative;cursor:pointer;color:", ";word-wrap:break-word;max-width:100%;width:100%;padding:", ";", " ", " ", " &:not([disabled]){&:hover{background:", ";", "}&:focus{outline:0;box-shadow:", ";", "}", " ", "}&[disabled]{color:", ";cursor:not-allowed;", ",", "{color:inherit;}", "{cursor:not-allowed;color:", ";}", "}", "" ], (0,
357
+ b.pick)({
358
+ prisma: b.variables.contentColorActive,
359
+ enterprise: {
360
+ dark: b.variables.gray96,
361
+ light: b.variables.gray22
362
+ }
363
+ }), (0, b.pick)({
364
+ prisma: {
365
+ comfortable: "10px 16px",
366
+ compact: "6px 16px"
367
+ },
368
+ enterprise: "6px 10px"
369
+ }), (function(e) {
370
+ var t = e.$isSelectable, r = e.$selectableAppearance;
371
+ return t && (0, b.pick)({
372
+ prisma: (0, f.css)([ "padding-right:44px;", "" ], (function() {
373
+ return r === "checkbox" && "padding-left: 42px;";
374
+ })),
375
+ enterprise: (0, f.css)([ "padding-right:10px;padding-left:", ";" ], (function() {
376
+ return r === "checkbox" ? "32px" : "28px";
377
+ }))
378
+ });
379
+ }), (function(e) {
380
+ var t = e.$active, r = e.$preventFocus;
381
+ return t && !r && (0, f.css)([ "box-shadow:", ";" ], b.variables.focusShadowInset);
382
+ }), (function(e) {
383
+ var t = e.$active;
384
+ return t && (0, f.css)([ "background:", ";font-weight:", ";" ], (0, b.pick)({
385
+ enterprise: {
386
+ light: b.variables.gray92,
387
+ dark: b.variables.gray22
388
+ },
389
+ prisma: b.variables.neutral100
390
+ }), b.variables.fontWeightBold);
391
+ }), (0, b.pick)({
392
+ prisma: b.variables.interactiveColorOverlayHover,
393
+ enterprise: b.variables.backgroundColorHover
394
+ }), (function(e) {
395
+ var t = e.$selected;
396
+ return t && (0, b.pick)({
397
+ prisma: (0, f.css)([ "background:", ";" ], b.mixins.overlayColors(b.variables.interactiveColorOverlaySelected, b.variables.interactiveColorOverlayHover))
398
+ });
399
+ }), b.variables.focusShadowInset, (0, b.pick)({
400
+ prisma: (0, f.css)([ "background:", ";" ], b.variables.interactiveColorOverlayHover)
401
+ }), (0, b.pick)({
402
+ prisma: (0, f.css)([ "&:active{background:", ";}" ], b.variables.interactiveColorOverlayActive)
403
+ }), (function(e) {
404
+ var t = e.$selected;
405
+ return t && (0, b.pick)({
406
+ prisma: (0, f.css)([ "background:", ";&:active{background:", ";}" ], b.variables.interactiveColorOverlaySelected, b.mixins.overlayColors(b.variables.interactiveColorOverlaySelected, b.variables.interactiveColorOverlayActive))
407
+ });
408
+ }), (0, b.pick)({
409
+ enterprise: {
410
+ light: b.variables.gray45,
411
+ dark: b.variables.contentColorDisabled
412
+ },
413
+ prisma: b.variables.contentColorDisabled
414
+ }),
415
+ /* sc-sel */
416
+ X,
392
417
  /* sc-sel */
393
- StyledItemIcon, themes_namespaceObject.variables.contentColorActive)
394
- });
395
- });
396
- var StyledSwitch = external_styled_components_default()((Switch_default())).withConfig({
397
- displayName: "ItemStyles__StyledSwitch",
398
- componentId: "sc-4kc053-5"
399
- })(["position:absolute;left:", ";top:", ";"], (0,themes_namespaceObject.pick)({
400
- prisma: '16px',
401
- enterprise: '8px'
402
- }), (0,themes_namespaceObject.pick)({
403
- prisma: '0px',
404
- enterprise: {
405
- comfortable: '-1px',
406
- compact: '2px'
407
- }
408
- }));
409
- var StyledInnerWrapper = external_styled_components_default().span.withConfig({
410
- displayName: "ItemStyles__StyledInnerWrapper",
411
- componentId: "sc-4kc053-6"
412
- })(["display:flex;align-items:flex-start;"]);
413
- var StyledTitleAndDescriptionWrapper = external_styled_components_default().span.withConfig({
414
- displayName: "ItemStyles__StyledTitleAndDescriptionWrapper",
415
- componentId: "sc-4kc053-7"
416
- })(["max-width:100%;width:100%;align-self:center;word-break:break-word;white-space:normal;", ""], function (_ref7) {
417
- var $truncate = _ref7.$truncate;
418
- return $truncate && (0,external_styled_components_namespaceObject.css)(["white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"]);
419
- });
420
- var StyledLabel = external_styled_components_default().div.withConfig({
421
- displayName: "ItemStyles__StyledLabel",
422
- componentId: "sc-4kc053-8"
423
- })(["overflow:inherit;white-space:inherit;text-overflow:inherit;max-width:100%;min-height:20px;", ""], function (_ref8) {
424
- var $truncate = _ref8.$truncate;
425
- return $truncate && (0,external_styled_components_namespaceObject.css)(["display:block;clear:both;"]);
426
- });
427
- var StyledMatch = external_styled_components_default().span.withConfig({
428
- displayName: "ItemStyles__StyledMatch",
429
- componentId: "sc-4kc053-9"
430
- })(["border-bottom:1px solid ", ";"], (0,themes_namespaceObject.pick)({
431
- prisma: themes_namespaceObject.variables.contentColorActive,
432
- enterprise: {
433
- dark: themes_namespaceObject.variables.gray96,
434
- light: themes_namespaceObject.variables.gray45
435
- }
436
- }));
437
- var StyledSubmenu = external_styled_components_default().span.withConfig({
438
- displayName: "ItemStyles__StyledSubmenu",
439
- componentId: "sc-4kc053-10"
440
- })(["float:right;padding-left:", ";color:", ";"], themes_namespaceObject.variables.spacingSmall, (0,themes_namespaceObject.pick)({
441
- prisma: 'inherit',
442
- enterprise: themes_namespaceObject.variables.textGray
443
- }));
444
-
445
- ;// CONCATENATED MODULE: external "@splunk/react-icons/ArrowSquareTopRight"
446
- const ArrowSquareTopRight_namespaceObject = require("@splunk/react-icons/ArrowSquareTopRight");
447
- var ArrowSquareTopRight_default = /*#__PURE__*/__webpack_require__.n(ArrowSquareTopRight_namespaceObject);
448
- ;// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/External"
449
- const External_namespaceObject = require("@splunk/react-icons/enterprise/External");
450
- var External_default = /*#__PURE__*/__webpack_require__.n(External_namespaceObject);
451
- ;// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
452
- const i18n_namespaceObject = require("@splunk/ui-utils/i18n");
453
- ;// CONCATENATED MODULE: ./src/Menu/icons/External.tsx
454
-
455
-
456
-
457
-
458
-
459
-
460
-
461
- var label = (0,i18n_namespaceObject._)('Open externally');
462
-
463
- var iconStyles = (0,external_styled_components_namespaceObject.css)(["width:0.8em;height:0.8em;vertical-align:baseline;"]);
464
- var StyledEnterprise = external_styled_components_default()((External_default())).withConfig({
465
- displayName: "External__StyledEnterprise",
466
- componentId: "sc-1turs2s-0"
467
- })(["", " margin:0 0 0 3px;"], iconStyles);
468
- var StyledPrisma = external_styled_components_default()((ArrowSquareTopRight_default())).withConfig({
469
- displayName: "External__StyledPrisma",
470
- componentId: "sc-1turs2s-1"
471
- })(["", " margin:0 0 0 4px;"], iconStyles);
472
-
473
- function External() {
474
- var _useSplunkTheme = (0,themes_namespaceObject.useSplunkTheme)(),
475
- isEnterprise = _useSplunkTheme.isEnterprise,
476
- isCompact = _useSplunkTheme.isCompact;
477
-
478
- var prismaSize = isCompact ? '20px' : '24px';
479
- return isEnterprise ? /*#__PURE__*/external_react_default().createElement(StyledEnterprise, {
480
- screenReaderText: label
481
- }) : /*#__PURE__*/external_react_default().createElement(StyledPrisma, {
482
- "aria-label": label,
483
- height: prismaSize,
484
- width: prismaSize
485
- }, /*#__PURE__*/external_react_default().createElement("title", null, label));
486
- }
487
-
488
- /* harmony default export */ const icons_External = (External);
489
- ;// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
490
- /**
418
+ Z,
419
+ /* sc-sel */
420
+ ee, (0, b.pick)({
421
+ prisma: b.variables.contentColorDisabled,
422
+ enterprise: b.variables.gray80
423
+ }), (0, b.pick)({
424
+ prisma: (0, f.css)([ "& > * > ", "{color:", ";}" ],
425
+ /* sc-sel */
426
+ te, b.variables.contentColorDisabled)
427
+ }), (function(e) {
428
+ var t = e.$selected;
429
+ return t && (0, b.pick)({
430
+ prisma: (0, f.css)([ "", "{color:", ";}" ],
431
+ /* sc-sel */
432
+ te, b.variables.contentColorActive)
433
+ });
434
+ }));
435
+ var ne = v()(Y()).withConfig({
436
+ displayName: "ItemStyles__StyledSwitch",
437
+ componentId: "sc-4kc053-5"
438
+ })([ "position:absolute;left:", ";top:", ";" ], (0, b.pick)({
439
+ prisma: "16px",
440
+ enterprise: "8px"
441
+ }), (0, b.pick)({
442
+ prisma: "0px",
443
+ enterprise: {
444
+ comfortable: "-1px",
445
+ compact: "2px"
446
+ }
447
+ }));
448
+ var ie = v().span.withConfig({
449
+ displayName: "ItemStyles__StyledInnerWrapper",
450
+ componentId: "sc-4kc053-6"
451
+ })([ "display:flex;align-items:flex-start;" ]);
452
+ var oe = v().span.withConfig({
453
+ displayName: "ItemStyles__StyledTitleAndDescriptionWrapper",
454
+ componentId: "sc-4kc053-7"
455
+ })([ "max-width:100%;width:100%;align-self:center;word-break:break-word;white-space:normal;", "" ], (function(e) {
456
+ var t = e.$truncate;
457
+ return t && (0, f.css)([ "white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" ]);
458
+ }));
459
+ var ae = v().div.withConfig({
460
+ displayName: "ItemStyles__StyledLabel",
461
+ componentId: "sc-4kc053-8"
462
+ })([ "overflow:inherit;white-space:inherit;text-overflow:inherit;max-width:100%;min-height:20px;", "" ], (function(e) {
463
+ var t = e.$truncate;
464
+ return t && (0, f.css)([ "display:block;clear:both;" ]);
465
+ }));
466
+ var le = v().span.withConfig({
467
+ displayName: "ItemStyles__StyledMatch",
468
+ componentId: "sc-4kc053-9"
469
+ })([ "border-bottom:1px solid ", ";" ], (0, b.pick)({
470
+ prisma: b.variables.contentColorActive,
471
+ enterprise: {
472
+ dark: b.variables.gray96,
473
+ light: b.variables.gray45
474
+ }
475
+ }));
476
+ var se = v().span.withConfig({
477
+ displayName: "ItemStyles__StyledSubmenu",
478
+ componentId: "sc-4kc053-10"
479
+ })([ "float:right;padding-left:", ";color:", ";", "" ], b.variables.spacingSmall, (0,
480
+ b.pick)({
481
+ prisma: "inherit",
482
+ enterprise: b.variables.textGray
483
+ }), (0, b.pick)({
484
+ prisma: (0, f.css)([ "& > svg{width:20px;height:20px;}" ])
485
+ }));
486
+ // CONCATENATED MODULE: external "@splunk/react-icons/ArrowSquareTopRight"
487
+ const ce = require("@splunk/react-icons/ArrowSquareTopRight");
488
+ var pe = e.n(ce);
489
+ // CONCATENATED MODULE: external "@splunk/react-icons/enterprise/External"
490
+ const ue = require("@splunk/react-icons/enterprise/External");
491
+ var de = e.n(ue);
492
+ // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
493
+ const fe = require("@splunk/ui-utils/i18n");
494
+ // CONCATENATED MODULE: ./src/Menu/icons/External.tsx
495
+ var ve = (0, fe._)("Open externally");
496
+ var be = (0, f.css)([ "width:0.8em;height:0.8em;vertical-align:baseline;" ]);
497
+ var me = v()(de()).withConfig({
498
+ displayName: "External__StyledEnterprise",
499
+ componentId: "sc-1turs2s-0"
500
+ })([ "", " margin:0 0 0 3px;" ], be);
501
+ var he = v()(pe()).withConfig({
502
+ displayName: "External__StyledPrisma",
503
+ componentId: "sc-1turs2s-1"
504
+ })([ "", " margin:0 0 0 4px;" ], be);
505
+ function ye() {
506
+ var e = (0, b.useSplunkTheme)(), t = e.isEnterprise, r = e.isCompact;
507
+ var i = r ? "20px" : "24px";
508
+ return t ? n().createElement(me, {
509
+ screenReaderText: ve
510
+ }) : n().createElement(he, {
511
+ "aria-label": ve,
512
+ height: i,
513
+ width: i
514
+ }, n().createElement("title", null, ve));
515
+ }
516
+ /* harmony default export */ const ge = ye;
517
+ // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
518
+ /**
491
519
  * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
492
520
  *
493
521
  * @param ref - The React callback or object ref. Can be `null` or `undefined`.
494
522
  * @param current - The new value of the ref.
495
523
  */
496
- function updateReactRef(ref, current) {
497
- if (ref) {
498
- if (typeof ref === 'function') {
499
- ref(current);
500
- } else {
501
- // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
502
- // the intention here is to signal "we will take care of setting 'current', not you".
503
- ref.current = current; // eslint-disable-line no-param-reassign
524
+ function ke(e, t) {
525
+ if (e) {
526
+ if (typeof e === "function") {
527
+ e(t);
528
+ } else {
529
+ // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
530
+ // the intention here is to signal "we will take care of setting 'current', not you".
531
+ e.current = t;
532
+ // eslint-disable-line no-param-reassign
533
+ }
534
+ }
504
535
  }
505
- }
506
- }
507
-
508
-
509
- ;// CONCATENATED MODULE: ./src/utils/scrollIntoViewIfNeeded.ts
510
- // A utility that attempts to move an element into view by scrolling it's derived parent.
511
- var scrollIntoViewIfNeeded_scrollIntoViewIfNeeded = function scrollIntoViewIfNeeded(el) {
512
- if (!el) {
513
- return;
514
- }
515
-
516
- var parentEl = el.offsetParent;
517
-
518
- if (!parentEl) {
519
- return;
520
- } // Below the bottom of the container.
521
-
522
-
523
- if (parentEl.scrollTop + parentEl.clientHeight < el.offsetTop + el.clientHeight) {
524
- parentEl.scrollTop = el.offsetTop + el.clientHeight - parentEl.clientHeight; // Above the top of the container.
525
- } else if (parentEl.scrollTop > el.offsetTop) {
526
- parentEl.scrollTop = el.offsetTop;
527
- }
528
- };
529
-
530
-
531
- ;// CONCATENATED MODULE: ./src/Menu/Item.tsx
532
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
533
-
534
- function Item_extends() { Item_extends = Object.assign || 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 Item_extends.apply(this, arguments); }
535
-
536
- function Item_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Item_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; }
537
-
538
- function Item_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; }
539
-
540
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
541
-
542
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
543
-
544
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
545
-
546
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
547
-
548
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
549
-
550
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
551
-
552
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
553
-
554
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
555
-
556
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
557
-
558
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
559
-
560
- function Item_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
561
-
562
-
563
-
564
-
565
-
566
-
567
-
568
-
569
-
570
-
571
-
572
-
573
-
574
-
575
- var Item_propTypes = {
576
- active: (external_prop_types_default()).bool,
577
- children: (external_prop_types_default()).node,
578
- description: (external_prop_types_default()).string,
579
- descriptionPosition: external_prop_types_default().oneOf(['right', 'bottom']),
580
- disabled: (external_prop_types_default()).bool,
581
- elementRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
582
- hasSubmenu: (external_prop_types_default()).bool,
583
- icon: (external_prop_types_default()).node,
584
-
585
- /** @private. The internal key of the tab */
586
- itemKey: (external_prop_types_default()).number,
587
- matchRanges: external_prop_types_default().arrayOf(external_prop_types_default().shape({
588
- start: (external_prop_types_default()).number.isRequired,
589
- end: (external_prop_types_default()).number.isRequired
590
- })),
591
- onClick: (external_prop_types_default()).func,
592
-
593
- /** @private */
594
- onFocus: (external_prop_types_default()).func,
595
- openInNewContext: (external_prop_types_default()).bool,
596
-
597
- /** @private */
598
- preventFocus: (external_prop_types_default()).bool,
599
- role: external_prop_types_default().oneOf(['menuitem', 'menuitemradio', 'menuitemcheckbox', 'listboxitem', 'option']),
600
- selectable: (external_prop_types_default()).bool,
601
- selectableAppearance: external_prop_types_default().oneOf(['checkmark', 'checkbox']),
602
- selected: (external_prop_types_default()).bool,
603
-
604
- /** @private */
605
- splunkTheme: (external_prop_types_default()).object,
606
- to: (external_prop_types_default()).string,
607
- truncate: (external_prop_types_default()).bool
608
- };
609
- var defaultProps = {
610
- active: false,
611
- descriptionPosition: 'bottom',
612
- disabled: false,
613
- hasSubmenu: false,
614
- openInNewContext: false,
615
- preventFocus: false,
616
- selectable: false,
617
- selectableAppearance: 'checkmark',
618
- selected: false,
619
- truncate: false
620
- };
621
-
622
- var Item = /*#__PURE__*/function (_Component) {
623
- _inherits(Item, _Component);
624
-
625
- var _super = _createSuper(Item);
626
-
627
- _createClass(Item, null, [{
628
- key: "validateProps",
629
- // @docs-props-type ItemPropsBase
630
- value: function validateProps(props) {
631
- if (false) {}
536
+ // CONCATENATED MODULE: ./src/utils/scrollIntoViewIfNeeded.ts
537
+ // A utility that attempts to move an element into view by scrolling it's derived parent.
538
+ var xe = function e(t) {
539
+ if (!t) {
540
+ return;
541
+ }
542
+ var r = t.offsetParent;
543
+ if (!r) {
544
+ return;
545
+ }
546
+ // Below the bottom of the container.
547
+ if (r.scrollTop + r.clientHeight < t.offsetTop + t.clientHeight) {
548
+ r.scrollTop = t.offsetTop + t.clientHeight - r.clientHeight;
549
+ // Above the top of the container.
550
+ } else if (r.scrollTop > t.offsetTop) {
551
+ r.scrollTop = t.offsetTop;
552
+ }
553
+ };
554
+ // CONCATENATED MODULE: ./src/Menu/Item.tsx
555
+ function we(e) {
556
+ "@babel/helpers - typeof";
557
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
558
+ we = function e(t) {
559
+ return typeof t;
560
+ };
561
+ } else {
562
+ we = function e(t) {
563
+ return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
564
+ };
565
+ }
566
+ return we(e);
632
567
  }
633
- }]);
634
-
635
- function Item(props) {
636
- var _this;
637
-
638
- _classCallCheck(this, Item);
639
-
640
- _this = _super.call(this, props);
641
-
642
- Item_defineProperty(_assertThisInitialized(_this), "el", null);
643
-
644
- Item_defineProperty(_assertThisInitialized(_this), "handleFocus", function (e) {
645
- var _this$props = _this.props,
646
- onFocus = _this$props.onFocus,
647
- itemKey = _this$props.itemKey;
648
- onFocus === null || onFocus === void 0 ? void 0 : onFocus(e, {
649
- itemKey: itemKey
650
- });
651
- });
652
-
653
- Item_defineProperty(_assertThisInitialized(_this), "handleMount", function (el) {
654
- _this.el = el;
655
- updateReactRef(_this.props.elementRef, el);
656
- });
657
-
658
- Item.validateProps(props);
659
- return _this;
660
- }
661
-
662
- _createClass(Item, [{
663
- key: "componentDidUpdate",
664
- value: function componentDidUpdate() {
665
- Item.validateProps(this.props);
568
+ function Se() {
569
+ Se = Object.assign || function(e) {
570
+ for (var t = 1; t < arguments.length; t++) {
571
+ var r = arguments[t];
572
+ for (var n in r) {
573
+ if (Object.prototype.hasOwnProperty.call(r, n)) {
574
+ e[n] = r[n];
575
+ }
576
+ }
577
+ }
578
+ return e;
579
+ };
580
+ return Se.apply(this, arguments);
666
581
  }
667
- }, {
668
- key: "focus",
669
- value: function focus() {
670
- var _this$el;
671
-
672
- (_this$el = this.el) === null || _this$el === void 0 ? void 0 : _this$el.focus();
582
+ function Oe(e, t) {
583
+ if (e == null) return {};
584
+ var r = Ce(e, t);
585
+ var n, i;
586
+ if (Object.getOwnPropertySymbols) {
587
+ var o = Object.getOwnPropertySymbols(e);
588
+ for (i = 0; i < o.length; i++) {
589
+ n = o[i];
590
+ if (t.indexOf(n) >= 0) continue;
591
+ if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
592
+ r[n] = e[n];
593
+ }
594
+ }
595
+ return r;
673
596
  }
674
- }, {
675
- key: "scrollIntoViewIfNeeded",
676
- value: function scrollIntoViewIfNeeded() {
677
- scrollIntoViewIfNeeded_scrollIntoViewIfNeeded(this.el);
597
+ function Ce(e, t) {
598
+ if (e == null) return {};
599
+ var r = {};
600
+ var n = Object.keys(e);
601
+ var i, o;
602
+ for (o = 0; o < n.length; o++) {
603
+ i = n[o];
604
+ if (t.indexOf(i) >= 0) continue;
605
+ r[i] = e[i];
606
+ }
607
+ return r;
678
608
  }
679
- }, {
680
- key: "renderLabel",
681
- value: function renderLabel() {
682
- var _this$props2 = this.props,
683
- children = _this$props2.children,
684
- matchRanges = _this$props2.matchRanges;
685
-
686
- if (!matchRanges || !isString_default()(children)) {
687
- return children;
688
- }
689
-
690
- var segments = []; // before first match. May be empty string.
691
-
692
- segments.push(children.substring(0, matchRanges[0].start));
693
- matchRanges.forEach(function (match, index) {
694
- segments.push(
695
- /*#__PURE__*/
696
- // eslint-disable-next-line react/no-array-index-key
697
- external_react_default().createElement(StyledMatch, {
698
- key: index,
699
- "data-test": "match"
700
- }, children.substring(match.start, match.end)));
701
-
702
- if (index < matchRanges.length - 1) {
703
- segments.push(children.substring(match.end, matchRanges[index + 1].start));
704
- } else {
705
- segments.push(children.substring(match.end, children.length));
609
+ function Ie(e, t) {
610
+ if (!(e instanceof t)) {
611
+ throw new TypeError("Cannot call a class as a function");
706
612
  }
707
- });
708
- return segments;
709
613
  }
710
- }, {
711
- key: "render",
712
- value: function render() {
713
- var _this$props3 = this.props,
714
- active = _this$props3.active,
715
- children = _this$props3.children,
716
- hasSubmenu = _this$props3.hasSubmenu,
717
- selectable = _this$props3.selectable,
718
- selectableAppearance = _this$props3.selectableAppearance,
719
- selected = _this$props3.selected,
720
- icon = _this$props3.icon,
721
- description = _this$props3.description,
722
- disabled = _this$props3.disabled,
723
- onClick = _this$props3.onClick,
724
- preventFocus = _this$props3.preventFocus,
725
- role = _this$props3.role,
726
- splunkTheme = _this$props3.splunkTheme,
727
- to = _this$props3.to,
728
- truncate = _this$props3.truncate,
729
- descriptionPosition = _this$props3.descriptionPosition,
730
- openInNewContext = _this$props3.openInNewContext,
731
- otherProps = Item_objectWithoutProperties(_this$props3, ["active", "children", "hasSubmenu", "selectable", "selectableAppearance", "selected", "icon", "description", "disabled", "onClick", "preventFocus", "role", "splunkTheme", "to", "truncate", "descriptionPosition", "openInNewContext"]);
732
-
733
- var isEnterprise = splunkTheme.isEnterprise,
734
- isPrisma = splunkTheme.isPrisma;
735
- var isSelectable = selectable || selected;
736
- var defaultRole = {
737
- nonselectable: 'menuitem',
738
- checkmark: 'menuitemradio',
739
- checkbox: 'menuitemcheckbox'
740
- }[isSelectable ? selectableAppearance : 'nonselectable']; // aria-checked updates only with checkmark appearance for now SUI-2578
741
-
742
- var ariaProps = {
743
- 'aria-haspopup': hasSubmenu ? true : undefined,
744
- 'aria-checked': selectableAppearance === 'checkmark' && selected ? true : undefined
745
- };
746
- var selectablePosition = isPrisma ? 'right' : 'left';
747
- var descriptionRight = description && descriptionPosition === 'right' && selectablePosition !== 'right';
748
- var descriptionBottom = description && !descriptionRight;
749
- var selectableCheckmark = selected && selectableAppearance === 'checkmark' && /*#__PURE__*/external_react_default().createElement(StyledItemSelectedIcon, null, isPrisma ? /*#__PURE__*/external_react_default().createElement((Checkmark_default()), {
750
- inline: true,
751
- height: "16",
752
- width: "16"
753
- }) : /*#__PURE__*/external_react_default().createElement((Check_default()), {
754
- hideDefaultTooltip: true,
755
- inline: true,
756
- screenReaderText: null,
757
- size: 0.85
758
- }));
759
- return /*#__PURE__*/external_react_default().createElement(StyledClickable, Item_extends({
760
- $isSelectable: isSelectable,
761
- $selectableAppearance: selectableAppearance,
762
- $selected: selected,
763
- $active: active,
764
- $preventFocus: preventFocus,
765
- "data-test-selected": isSelectable ? selected : null,
766
- "data-test": "item",
767
- "data-has-icon": !!icon,
768
- disabled: disabled,
769
- onClick: onClick,
770
- onFocus: this.handleFocus,
771
- onMouseDown: function onMouseDown(e) {
772
- if (preventFocus) {
773
- e.preventDefault();
774
- }
775
- },
776
- role: role || defaultRole,
777
- to: to,
778
- title: truncate && isString_default()(children) ? children : undefined,
779
- openInNewContext: openInNewContext
780
- }, ariaProps, omit_default()(otherProps, 'onFocus'), {
781
- elementRef: this.handleMount
782
- }), selectablePosition === 'left' && selectableCheckmark, selectable && selectableAppearance === 'checkbox' && /*#__PURE__*/external_react_default().createElement(StyledSwitch, {
783
- interactive: false,
784
- selected: selected,
785
- selectedLabel: "Selected",
786
- value: "menu-item"
787
- }), hasSubmenu && /*#__PURE__*/external_react_default().createElement(StyledSubmenu, null, isEnterprise ? /*#__PURE__*/external_react_default().createElement((ChevronRight_default()), {
788
- hideDefaultTooltip: true,
789
- screenReaderText: null
790
- }) : /*#__PURE__*/external_react_default().createElement((CaretSmallRight_default()), {
791
- height: "24",
792
- width: "24"
793
- })), descriptionRight && /*#__PURE__*/external_react_default().createElement(StyledItemDescriptionRight, {
794
- "data-test": "description"
795
- }, description), /*#__PURE__*/external_react_default().createElement(StyledInnerWrapper, null, icon && /*#__PURE__*/external_react_default().createElement(StyledItemIcon, null, icon), /*#__PURE__*/external_react_default().createElement(StyledTitleAndDescriptionWrapper, {
796
- $truncate: truncate
797
- }, /*#__PURE__*/external_react_default().createElement(StyledLabel, {
798
- $truncate: truncate,
799
- "data-test": "label"
800
- }, this.renderLabel(), openInNewContext && /*#__PURE__*/external_react_default().createElement(icons_External, null)), descriptionBottom && /*#__PURE__*/external_react_default().createElement(StyledItemDescriptionBottom, {
801
- "data-test": "description"
802
- }, description)), selectablePosition === 'right' && selectableCheckmark));
614
+ function Pe(e, t) {
615
+ for (var r = 0; r < t.length; r++) {
616
+ var n = t[r];
617
+ n.enumerable = n.enumerable || false;
618
+ n.configurable = true;
619
+ if ("value" in n) n.writable = true;
620
+ Object.defineProperty(e, n.key, n);
621
+ }
803
622
  }
804
- }]);
805
-
806
- return Item;
807
- }(external_react_namespaceObject.Component);
808
-
809
- Item_defineProperty(Item, "propTypes", Item_propTypes);
810
-
811
- Item_defineProperty(Item, "defaultProps", defaultProps);
812
-
813
- Item_defineProperty(Item, "as", void 0);
814
-
815
- var ItemWithThemeBase = (0,themes_namespaceObject.withSplunkTheme)(Item);
816
- var ItemWithTheme = ItemWithThemeBase;
817
- ItemWithTheme.propTypes = Item.propTypes;
818
- ItemWithTheme.as = 'Item';
819
- /* harmony default export */ const Menu_Item = (ItemWithTheme);
820
- ;// CONCATENATED MODULE: external "@splunk/react-ui/Scroll"
821
- const Scroll_namespaceObject = require("@splunk/react-ui/Scroll");
822
- var Scroll_default = /*#__PURE__*/__webpack_require__.n(Scroll_namespaceObject);
823
- ;// CONCATENATED MODULE: ./src/Menu/MenuStyles.ts
824
-
825
-
826
-
827
- var adjacentSiblingStyles = (0,external_styled_components_namespaceObject.css)(["border-top:1px solid ", ";"], (0,themes_namespaceObject.pick)({
828
- enterprise: themes_namespaceObject.variables.gray60,
829
- prisma: themes_namespaceObject.variables.neutral200
830
- }));
831
- var MenuStyles_Styled = external_styled_components_default().div.withConfig({
832
- displayName: "MenuStyles__Styled",
833
- componentId: "sc-1olffp9-0"
834
- })(["", ";background-color:", ";border-radius:", ";min-width:60px;overflow:auto;position:relative;", " &:focus{outline:0;box-shadow:", ";", "}& + &{", "}"], themes_namespaceObject.mixins.reset('block'), (0,themes_namespaceObject.pick)({
835
- enterprise: themes_namespaceObject.variables.backgroundColor,
836
- prisma: themes_namespaceObject.variables.backgroundColorPopup
837
- }), themes_namespaceObject.variables.borderRadius, (0,themes_namespaceObject.pick)({
838
- prisma: (0,external_styled_components_namespaceObject.css)(["padding:8px 0;"])
839
- }), themes_namespaceObject.variables.focusShadowInset, (0,themes_namespaceObject.pick)({
840
- prisma: (0,external_styled_components_namespaceObject.css)(["background:", ";"], themes_namespaceObject.variables.interactiveColorOverlayHover)
841
- }), adjacentSiblingStyles);
842
- var StyledScroll = external_styled_components_default()(MenuStyles_Styled.withComponent((Scroll_default()))).withConfig({
843
- displayName: "MenuStyles__StyledScroll",
844
- componentId: "sc-1olffp9-1"
845
- })(["", " + &,& + ", "{", "}"],
846
- /* sc-sel */
847
- MenuStyles_Styled,
848
- /* sc-sel */
849
- MenuStyles_Styled, adjacentSiblingStyles);
850
-
851
- ;// CONCATENATED MODULE: ./src/utils/navigateList.ts
852
- // A utility for keyboard navigation of lists
853
- function getNextListItem(refs, currentIndex, nextIndex) {
854
- for (var i = 0; i < refs.length; i += 1) {
855
- var _refs$pointer$current;
856
-
857
- var pointer = (i + nextIndex) % refs.length;
858
-
859
- if (((_refs$pointer$current = refs[pointer].current) === null || _refs$pointer$current === void 0 ? void 0 : _refs$pointer$current.props.disabled) !== true) {
860
- return refs[pointer];
623
+ function _e(e, t, r) {
624
+ if (t) Pe(e.prototype, t);
625
+ if (r) Pe(e, r);
626
+ return e;
861
627
  }
862
- }
863
-
864
- return refs[currentIndex];
865
- }
866
-
867
- function getPrevListItem(refs, currentIndex, prevIndex) {
868
- for (var i = refs.length; i > 0; i -= 1) {
869
- var _refs$pointer$current2;
870
-
871
- var pointer = (i + prevIndex) % refs.length;
872
-
873
- if (((_refs$pointer$current2 = refs[pointer].current) === null || _refs$pointer$current2 === void 0 ? void 0 : _refs$pointer$current2.props.disabled) !== true) {
874
- return refs[pointer];
628
+ function je(e, t) {
629
+ if (typeof t !== "function" && t !== null) {
630
+ throw new TypeError("Super expression must either be null or a function");
631
+ }
632
+ e.prototype = Object.create(t && t.prototype, {
633
+ constructor: {
634
+ value: e,
635
+ writable: true,
636
+ configurable: true
637
+ }
638
+ });
639
+ if (t) Ee(e, t);
640
+ }
641
+ function Ee(e, t) {
642
+ Ee = Object.setPrototypeOf || function e(t, r) {
643
+ t.__proto__ = r;
644
+ return t;
645
+ };
646
+ return Ee(e, t);
647
+ }
648
+ function Te(e) {
649
+ var t = qe();
650
+ return function r() {
651
+ var n = Ne(e), i;
652
+ if (t) {
653
+ var o = Ne(this).constructor;
654
+ i = Reflect.construct(n, arguments, o);
655
+ } else {
656
+ i = n.apply(this, arguments);
657
+ }
658
+ return De(this, i);
659
+ };
660
+ }
661
+ function De(e, t) {
662
+ if (t && (we(t) === "object" || typeof t === "function")) {
663
+ return t;
664
+ }
665
+ return Re(e);
875
666
  }
876
- }
877
-
878
- return refs[currentIndex];
879
- }
880
-
881
-
882
- ;// CONCATENATED MODULE: ./src/Menu/Menu.tsx
883
- function Menu_extends() { Menu_extends = Object.assign || 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 Menu_extends.apply(this, arguments); }
884
-
885
- function Menu_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Menu_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; }
886
-
887
- function Menu_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; }
888
-
889
-
890
-
891
-
892
-
893
-
894
-
895
-
896
-
897
-
898
-
899
-
900
-
901
-
902
-
903
- var Menu_propTypes = {
904
- children: (external_prop_types_default()).node,
905
-
906
- /** @private */
907
- controlledExternally: (external_prop_types_default()).bool,
908
- elementRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
909
- retainFocus: (external_prop_types_default()).bool,
910
- stopScrollPropagation: (external_prop_types_default()).bool
911
- };
912
- var Menu_defaultProps = {
913
- stopScrollPropagation: false
914
- };
915
-
916
- function Menu(_ref) {
917
- var children = _ref.children,
918
- controlledExternally = _ref.controlledExternally,
919
- elementRef = _ref.elementRef,
920
- retainFocusProp = _ref.retainFocus,
921
- stopScrollPropagation = _ref.stopScrollPropagation,
922
- otherProps = Menu_objectWithoutProperties(_ref, ["children", "controlledExternally", "elementRef", "retainFocus", "stopScrollPropagation"]);
923
-
924
- // @docs-props-type MenuPropsBase
925
- var _useContext = (0,external_react_namespaceObject.useContext)(MenuContext),
926
- _useContext$role = _useContext.role,
927
- role = _useContext$role === void 0 ? 'menu' : _useContext$role;
928
-
929
- var _useContext2 = (0,external_react_namespaceObject.useContext)(Popover_namespaceObject.PopoverContext),
930
- retainFocusFromContext = _useContext2.retainFocus;
931
-
932
- var forceUpdate = useForceUpdate_default()();
933
- var retainFocus = true;
934
-
935
- if (retainFocusProp != null) {
936
- retainFocus = retainFocusProp;
937
- } else if (retainFocusFromContext != null) {
938
- retainFocus = retainFocusFromContext;
939
- }
940
-
941
- var focusedItemKeyRef = external_react_default().useRef(0);
942
- var itemRefs = [];
943
- var itemKeyCounter = 0;
944
- var firstEnabledItemKey;
945
- var focusedItemKeyIsDisabled = false;
946
- var hasSelectedItems = false;
947
- var hasSelectedEnabledItems = false;
948
-
949
- var handleKeyDown = function handleKeyDown(e) {
950
- // SUI-2734: keeping this active even if controlledExternally is set
951
- // because Firefox + Voiceover (and possibly other a11y tools)
952
- // can still set focus on the Menu items and this avoids the
953
- // whole page scrolling when that happens
954
- var key = (0,keyboard_namespaceObject.keycode)(e.nativeEvent);
955
- var focusedItemKey = focusedItemKeyRef.current;
956
- var itemToFocusRef; // the "retainFocus" checks here mimic the prior tab key functionality
957
-
958
- if (key === 'down' || retainFocus && (0,focus_namespaceObject.isTabKey)(e)) {
959
- itemToFocusRef = getNextListItem(itemRefs, focusedItemKey, focusedItemKey + 1);
960
- } else if (key === 'up' || retainFocus && (0,focus_namespaceObject.isTabKey)(e) && e.shiftKey) {
961
- itemToFocusRef = getPrevListItem(itemRefs, focusedItemKey, focusedItemKey - 1);
962
- } else if (key === 'home') {
963
- itemToFocusRef = getNextListItem(itemRefs, focusedItemKey, 0);
964
- } else if (key === 'end') {
965
- itemToFocusRef = getPrevListItem(itemRefs, focusedItemKey, itemRefs.length - 1);
667
+ function Re(e) {
668
+ if (e === void 0) {
669
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
670
+ }
671
+ return e;
966
672
  }
967
-
968
- if (itemToFocusRef != null) {
969
- var _itemToFocusRef$curre, _itemToFocusRef$curre2;
970
-
971
- (_itemToFocusRef$curre = itemToFocusRef.current) === null || _itemToFocusRef$curre === void 0 ? void 0 : (_itemToFocusRef$curre2 = _itemToFocusRef$curre.focus) === null || _itemToFocusRef$curre2 === void 0 ? void 0 : _itemToFocusRef$curre2.call(_itemToFocusRef$curre);
972
- e.preventDefault();
673
+ function qe() {
674
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
675
+ if (Reflect.construct.sham) return false;
676
+ if (typeof Proxy === "function") return true;
677
+ try {
678
+ Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
679
+ return true;
680
+ } catch (e) {
681
+ return false;
682
+ }
973
683
  }
974
- };
975
-
976
- var itemOnFocus = (0,external_react_namespaceObject.useCallback)(function (e, data) {
977
- var itemKey = data.itemKey;
978
-
979
- if (itemKey != null) {
980
- focusedItemKeyRef.current = itemKey;
684
+ function Ne(e) {
685
+ Ne = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
686
+ return t.__proto__ || Object.getPrototypeOf(t);
687
+ };
688
+ return Ne(e);
981
689
  }
982
- }, []);
983
- var childrenCleaned = external_react_namespaceObject.Children.toArray(children).filter(external_react_namespaceObject.isValidElement).reduce(function (acc, item, index, original) {
984
- /* Filter out initial Dividers
690
+ function He(e, t, r) {
691
+ if (t in e) {
692
+ Object.defineProperty(e, t, {
693
+ value: r,
694
+ enumerable: true,
695
+ configurable: true,
696
+ writable: true
697
+ });
698
+ } else {
699
+ e[t] = r;
700
+ }
701
+ return e;
702
+ }
703
+ var Fe = {
704
+ active: o().bool,
705
+ children: o().node,
706
+ description: o().string,
707
+ descriptionPosition: o().oneOf([ "right", "bottom" ]),
708
+ disabled: o().bool,
709
+ elementRef: o().oneOfType([ o().func, o().object ]),
710
+ hasSubmenu: o().bool,
711
+ icon: o().node,
712
+ /** @private. The internal key of the tab */
713
+ itemKey: o().number,
714
+ matchRanges: o().arrayOf(o().shape({
715
+ start: o().number.isRequired,
716
+ end: o().number.isRequired
717
+ })),
718
+ onClick: o().func,
719
+ /** @private */
720
+ onFocus: o().func,
721
+ openInNewContext: o().bool,
722
+ /** @private */
723
+ preventFocus: o().bool,
724
+ role: o().oneOf([ "menuitem", "menuitemradio", "menuitemcheckbox", "listboxitem", "option" ]),
725
+ selectable: o().bool,
726
+ selectableAppearance: o().oneOf([ "checkmark", "checkbox" ]),
727
+ selected: o().bool,
728
+ /** @private */
729
+ splunkTheme: o().object,
730
+ to: o().string,
731
+ truncate: o().bool
732
+ };
733
+ var $e = {
734
+ active: false,
735
+ descriptionPosition: "bottom",
736
+ disabled: false,
737
+ hasSubmenu: false,
738
+ openInNewContext: false,
739
+ preventFocus: false,
740
+ selectable: false,
741
+ selectableAppearance: "checkmark",
742
+ selected: false,
743
+ truncate: false
744
+ };
745
+ var Ae = function(e) {
746
+ je(r, e);
747
+ var t = Te(r);
748
+ _e(r, null, [ {
749
+ key: "validateProps",
750
+ // @docs-props-type ItemPropsBase
751
+ value: function e(t) {
752
+ if (false) {}
753
+ }
754
+ } ]);
755
+ function r(e) {
756
+ var n;
757
+ Ie(this, r);
758
+ n = t.call(this, e);
759
+ He(Re(n), "el", null);
760
+ He(Re(n), "handleFocus", (function(e) {
761
+ var t = n.props, r = t.onFocus, i = t.itemKey;
762
+ r === null || r === void 0 ? void 0 : r(e, {
763
+ itemKey: i
764
+ });
765
+ }));
766
+ He(Re(n), "handleMount", (function(e) {
767
+ n.el = e;
768
+ ke(n.props.elementRef, e);
769
+ }));
770
+ r.validateProps(e);
771
+ return n;
772
+ }
773
+ _e(r, [ {
774
+ key: "componentDidUpdate",
775
+ value: function e() {
776
+ r.validateProps(this.props);
777
+ }
778
+ }, {
779
+ key: "focus",
780
+ value: function e() {
781
+ var t;
782
+ (t = this.el) === null || t === void 0 ? void 0 : t.focus();
783
+ }
784
+ }, {
785
+ key: "scrollIntoViewIfNeeded",
786
+ value: function e() {
787
+ xe(this.el);
788
+ }
789
+ }, {
790
+ key: "renderLabel",
791
+ value: function e() {
792
+ var t = this.props, r = t.children, i = t.matchRanges;
793
+ if (!i || !$()(r)) {
794
+ return r;
795
+ }
796
+ var o = [];
797
+ // before first match. May be empty string.
798
+ o.push(r.substring(0, i[0].start));
799
+ i.forEach((function(e, t) {
800
+ o.push(
801
+
802
+ // eslint-disable-next-line react/no-array-index-key
803
+ n().createElement(le, {
804
+ key: t,
805
+ "data-test": "match"
806
+ }, r.substring(e.start, e.end)));
807
+ if (t < i.length - 1) {
808
+ o.push(r.substring(e.end, i[t + 1].start));
809
+ } else {
810
+ o.push(r.substring(e.end, r.length));
811
+ }
812
+ }));
813
+ return o;
814
+ }
815
+ }, {
816
+ key: "render",
817
+ value: function e() {
818
+ var t = this.props, r = t.active, i = t.children, o = t.hasSubmenu, a = t.selectable, s = t.selectableAppearance, c = t.selected, p = t.icon, u = t.description, d = t.disabled, f = t.onClick, v = t.preventFocus, b = t.role, m = t.splunkTheme, h = t.to, y = t.truncate, g = t.descriptionPosition, k = t.openInNewContext, x = Oe(t, [ "active", "children", "hasSubmenu", "selectable", "selectableAppearance", "selected", "icon", "description", "disabled", "onClick", "preventFocus", "role", "splunkTheme", "to", "truncate", "descriptionPosition", "openInNewContext" ]);
819
+ var w = m.isEnterprise, S = m.isPrisma;
820
+ var O = a || c;
821
+ var C = {
822
+ nonselectable: "menuitem",
823
+ checkmark: "menuitemradio",
824
+ checkbox: "menuitemcheckbox"
825
+ }[O ? s : "nonselectable"];
826
+ // aria-checked updates only with checkmark appearance for now SUI-2578
827
+ var I = {
828
+ "aria-haspopup": o ? true : undefined,
829
+ "aria-checked": s === "checkmark" && c ? true : undefined
830
+ };
831
+ var P = S ? "right" : "left";
832
+ var _ = u && g === "right" && P !== "right";
833
+ var j = u && !_;
834
+ var E = c && s === "checkmark" && n().createElement(ee, null, S ? n().createElement(z(), {
835
+ inline: true,
836
+ height: "16",
837
+ width: "16"
838
+ }) : n().createElement(W(), {
839
+ hideDefaultTooltip: true,
840
+ inline: true,
841
+ screenReaderText: null,
842
+ size: .85
843
+ }));
844
+
845
+ return n().createElement(re, Se({
846
+ $isSelectable: O,
847
+ $selectableAppearance: s,
848
+ $selected: c,
849
+ $active: r,
850
+ $preventFocus: v,
851
+ "data-test-selected": O ? c : null,
852
+ "data-test": "item",
853
+ "data-has-icon": !!p,
854
+ disabled: d,
855
+ onClick: f,
856
+ onFocus: this.handleFocus,
857
+ onMouseDown: function e(t) {
858
+ if (v) {
859
+ t.preventDefault();
860
+ }
861
+ },
862
+ role: b || C,
863
+ to: h,
864
+ title: y && $()(i) ? i : undefined,
865
+ openInNewContext: k
866
+ }, I, l()(x, "onFocus"), {
867
+ elementRef: this.handleMount
868
+ }), P === "left" && E, a && s === "checkbox" && n().createElement(ne, {
869
+ interactive: false,
870
+ selected: c,
871
+ selectedLabel: "Selected",
872
+ value: "menu-item"
873
+ }), o && n().createElement(se, null, w ? n().createElement(G(), {
874
+ hideDefaultTooltip: true,
875
+ screenReaderText: null
876
+ }) : n().createElement(M(), null)), _ && n().createElement(Z, {
877
+ "data-test": "description"
878
+ }, u), n().createElement(ie, null, p && n().createElement(te, null, p), n().createElement(oe, {
879
+ $truncate: y
880
+ }, n().createElement(ae, {
881
+ $truncate: y,
882
+ "data-test": "label"
883
+ }, this.renderLabel(), k && n().createElement(ge, null)), j && n().createElement(X, {
884
+ "data-test": "description"
885
+ }, u)), P === "right" && E));
886
+ }
887
+ } ]);
888
+ return r;
889
+ }(r.Component);
890
+ He(Ae, "propTypes", Fe);
891
+ He(Ae, "defaultProps", $e);
892
+ He(Ae, "as", void 0);
893
+ var Me = (0, b.withSplunkTheme)(Ae);
894
+ var Ke = Me;
895
+ Ke.propTypes = Ae.propTypes;
896
+ Ke.as = "Item";
897
+ /* harmony default export */ const ze = Ke;
898
+ // CONCATENATED MODULE: external "@splunk/react-ui/Scroll"
899
+ const Le = require("@splunk/react-ui/Scroll");
900
+ var We = e.n(Le);
901
+ // CONCATENATED MODULE: ./src/Menu/MenuStyles.ts
902
+ var Be = (0, f.css)([ "border-top:1px solid ", ";" ], (0, b.pick)({
903
+ enterprise: b.variables.gray60,
904
+ prisma: b.variables.neutral200
905
+ }));
906
+ var Ge = v().div.withConfig({
907
+ displayName: "MenuStyles__Styled",
908
+ componentId: "sc-1olffp9-0"
909
+ })([ "", ";background-color:", ";border-radius:", ";min-width:60px;overflow:auto;position:relative;", " &:focus{outline:0;box-shadow:", ";", "}& + &{", "}" ], b.mixins.reset("block"), (0,
910
+ b.pick)({
911
+ enterprise: b.variables.backgroundColor,
912
+ prisma: b.variables.backgroundColorPopup
913
+ }), b.variables.borderRadius, (0, b.pick)({
914
+ prisma: (0, f.css)([ "padding:8px 0;" ])
915
+ }), b.variables.focusShadowInset, (0, b.pick)({
916
+ prisma: (0, f.css)([ "background:", ";" ], b.variables.interactiveColorOverlayHover)
917
+ }), Be);
918
+ var Ue = v()(Ge.withComponent(We())).withConfig({
919
+ displayName: "MenuStyles__StyledScroll",
920
+ componentId: "sc-1olffp9-1"
921
+ })([ "", " + &,& + ", "{", "}" ],
922
+ /* sc-sel */
923
+ Ge,
924
+ /* sc-sel */
925
+ Ge, Be);
926
+ // CONCATENATED MODULE: ./src/utils/navigateList.ts
927
+ // A utility for keyboard navigation of lists
928
+ function Ve(e, t, r) {
929
+ for (var n = 0; n < e.length; n += 1) {
930
+ var i;
931
+ var o = (n + r) % e.length;
932
+ if (((i = e[o].current) === null || i === void 0 ? void 0 : i.props.disabled) !== true) {
933
+ return e[o];
934
+ }
935
+ }
936
+ return e[t];
937
+ }
938
+ function Qe(e, t, r) {
939
+ for (var n = e.length; n > 0; n -= 1) {
940
+ var i;
941
+ var o = (n + r) % e.length;
942
+ if (((i = e[o].current) === null || i === void 0 ? void 0 : i.props.disabled) !== true) {
943
+ return e[o];
944
+ }
945
+ }
946
+ return e[t];
947
+ }
948
+ // CONCATENATED MODULE: ./src/Menu/Menu.tsx
949
+ function Ye() {
950
+ Ye = Object.assign || function(e) {
951
+ for (var t = 1; t < arguments.length; t++) {
952
+ var r = arguments[t];
953
+ for (var n in r) {
954
+ if (Object.prototype.hasOwnProperty.call(r, n)) {
955
+ e[n] = r[n];
956
+ }
957
+ }
958
+ }
959
+ return e;
960
+ };
961
+ return Ye.apply(this, arguments);
962
+ }
963
+ function Je(e, t) {
964
+ if (e == null) return {};
965
+ var r = Xe(e, t);
966
+ var n, i;
967
+ if (Object.getOwnPropertySymbols) {
968
+ var o = Object.getOwnPropertySymbols(e);
969
+ for (i = 0; i < o.length; i++) {
970
+ n = o[i];
971
+ if (t.indexOf(n) >= 0) continue;
972
+ if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
973
+ r[n] = e[n];
974
+ }
975
+ }
976
+ return r;
977
+ }
978
+ function Xe(e, t) {
979
+ if (e == null) return {};
980
+ var r = {};
981
+ var n = Object.keys(e);
982
+ var i, o;
983
+ for (o = 0; o < n.length; o++) {
984
+ i = n[o];
985
+ if (t.indexOf(i) >= 0) continue;
986
+ r[i] = e[i];
987
+ }
988
+ return r;
989
+ }
990
+ var Ze = {
991
+ children: o().node,
992
+ /** @private */
993
+ controlledExternally: o().bool,
994
+ elementRef: o().oneOfType([ o().func, o().object ]),
995
+ retainFocus: o().bool,
996
+ stopScrollPropagation: o().bool
997
+ };
998
+ var et = {
999
+ stopScrollPropagation: false
1000
+ };
1001
+ function tt(e) {
1002
+ var t = e.children, i = e.controlledExternally, o = e.elementRef, a = e.retainFocus, u = e.stopScrollPropagation, f = Je(e, [ "children", "controlledExternally", "elementRef", "retainFocus", "stopScrollPropagation" ]);
1003
+ // @docs-props-type MenuPropsBase
1004
+ var v = (0, r.useContext)(h), b = v.role, m = b === void 0 ? "menu" : b;
1005
+ var y = (0, r.useContext)(s.PopoverContext), g = y.retainFocus;
1006
+ var k = d()();
1007
+ var x = true;
1008
+ if (a != null) {
1009
+ x = a;
1010
+ } else if (g != null) {
1011
+ x = g;
1012
+ }
1013
+ var w = n().useRef(0);
1014
+ var S = [];
1015
+ var O = 0;
1016
+ var C;
1017
+ var I = false;
1018
+ var P = false;
1019
+ var _ = false;
1020
+ var j = function e(t) {
1021
+ // SUI-2734: keeping this active even if controlledExternally is set
1022
+ // because Firefox + Voiceover (and possibly other a11y tools)
1023
+ // can still set focus on the Menu items and this avoids the
1024
+ // whole page scrolling when that happens
1025
+ var r = (0, p.keycode)(t.nativeEvent);
1026
+ var n = w.current;
1027
+ var i;
1028
+ // the "retainFocus" checks here mimic the prior tab key functionality
1029
+ if (r === "down" || x && (0, c.isTabKey)(t)) {
1030
+ i = Ve(S, n, n + 1);
1031
+ } else if (r === "up" || x && (0, c.isTabKey)(t) && t.shiftKey) {
1032
+ i = Qe(S, n, n - 1);
1033
+ } else if (r === "home") {
1034
+ i = Ve(S, n, 0);
1035
+ } else if (r === "end") {
1036
+ i = Qe(S, n, S.length - 1);
1037
+ }
1038
+ if (i != null) {
1039
+ var o, a;
1040
+ (o = i.current) === null || o === void 0 ? void 0 : (a = o.focus) === null || a === void 0 ? void 0 : a.call(o);
1041
+ t.preventDefault();
1042
+ }
1043
+ };
1044
+ var E = (0, r.useCallback)((function(e, t) {
1045
+ var r = t.itemKey;
1046
+ if (r != null) {
1047
+ w.current = r;
1048
+ }
1049
+ }), []);
1050
+ var T = r.Children.toArray(t).filter(r.isValidElement).reduce((function(e, t, r, o) {
1051
+ /* Filter out initial Dividers
985
1052
  * Requires reduce() over filter() because a Heading may have been
986
1053
  * before the Divider.
987
1054
  */
988
- if (item.type.as === 'Divider' && acc.length === 0) {
989
- return acc;
990
- } // Filter out consecutive Dividers and Headings
991
- // If Divider is next to Heading then it will remove both Heading and Divider unless Heading has title prop set to it
992
-
993
-
994
- if ((item.type.as === 'Heading' || item.type.as === 'Divider') && !item.props.title && item.type.filterConsecutive && original.length > index + 1) {
995
- var consec = original[index + 1];
996
-
997
- if (consec.type.as === 'Heading' || consec.type.as === 'Divider') {
998
- return acc;
999
- }
1000
- } // Filter out last Dividers and Headings
1001
-
1002
-
1003
- if ((item.type.as === 'Divider' || item.type.as === 'Heading') && index === original.length - 1) {
1004
- return acc;
1005
- } // the filterConsecutive check filters out Headings and Dividers whether styled or not
1006
- // the typeof check prevents props from being applied to HTML elements
1007
- // such as the zero-height scroll bottom div in <ResultsMenu>
1008
-
1009
-
1010
- if (!(item.type.as === 'Divider' || item.type.as === 'Heading') && typeof item.type !== 'string') {
1011
- var _ref2 = /*#__PURE__*/external_react_default().createRef();
1012
-
1013
- itemRefs.push(_ref2);
1014
-
1015
- if (firstEnabledItemKey == null && (!('disabled' in item.props) || !item.props.disabled)) {
1016
- firstEnabledItemKey = itemKeyCounter;
1017
- }
1018
-
1019
- if (focusedItemKeyRef.current === itemKeyCounter && 'disabled' in item.props && item.props.disabled) {
1020
- focusedItemKeyIsDisabled = true;
1021
- }
1022
-
1023
- if ('selected' in item.props && item.props.selected) {
1024
- hasSelectedItems = true;
1025
-
1026
- if ('disabled' in item.props && !item.props.disabled) {
1027
- hasSelectedEnabledItems = true;
1055
+ if (t.type.as === "Divider" && e.length === 0) {
1056
+ return e;
1057
+ }
1058
+ // Filter out consecutive Dividers and Headings
1059
+ // If Divider is next to Heading then it will remove both Heading and Divider unless Heading has title prop set to it
1060
+ if ((t.type.as === "Heading" || t.type.as === "Divider") && !t.props.title && t.type.filterConsecutive && o.length > r + 1) {
1061
+ var a = o[r + 1];
1062
+ if (a.type.as === "Heading" || a.type.as === "Divider") {
1063
+ return e;
1064
+ }
1065
+ }
1066
+ // Filter out last Dividers and Headings
1067
+ if ((t.type.as === "Divider" || t.type.as === "Heading") && r === o.length - 1) {
1068
+ return e;
1069
+ }
1070
+ // the filterConsecutive check filters out Headings and Dividers whether styled or not
1071
+ // the typeof check prevents props from being applied to HTML elements
1072
+ // such as the zero-height scroll bottom div in <ResultsMenu>
1073
+ if (!(t.type.as === "Divider" || t.type.as === "Heading") && typeof t.type !== "string") {
1074
+ var l = n().createRef();
1075
+ S.push(l);
1076
+ if (C == null && (!("disabled" in t.props) || !t.props.disabled)) {
1077
+ C = O;
1078
+ }
1079
+ if (w.current === O && "disabled" in t.props && t.props.disabled) {
1080
+ I = true;
1081
+ }
1082
+ if ("selected" in t.props && t.props.selected) {
1083
+ P = true;
1084
+ if ("disabled" in t.props && !t.props.disabled) {
1085
+ _ = true;
1086
+ }
1087
+ }
1088
+ var s = !i && w.current === O ? undefined : -1;
1089
+ e.push( n().cloneElement(t, {
1090
+ itemKey: O,
1091
+ onFocus: E,
1092
+ preventFocus: i,
1093
+ ref: function e(r) {
1094
+ ke(t.ref, r);
1095
+ ke(l, r);
1096
+ },
1097
+ tabIndex: s
1098
+ }));
1099
+ O += 1;
1100
+ return e;
1101
+ }
1102
+ e.push(t);
1103
+ return e;
1104
+ }), []);
1105
+ if (C !== w.current && (!P || _) && I && C != null) {
1106
+ w.current = C;
1107
+ k();
1028
1108
  }
1029
- }
1030
-
1031
- var tabIndex = !controlledExternally && focusedItemKeyRef.current === itemKeyCounter ? undefined : -1;
1032
- acc.push( /*#__PURE__*/external_react_default().cloneElement(item, {
1033
- itemKey: itemKeyCounter,
1034
- onFocus: itemOnFocus,
1035
- preventFocus: controlledExternally,
1036
- ref: function ref(c) {
1037
- updateReactRef(item.ref, c);
1038
- updateReactRef(_ref2, c);
1039
- },
1040
- tabIndex: tabIndex
1041
- }));
1042
- itemKeyCounter += 1;
1043
- return acc;
1109
+ var D = {
1110
+ "data-test": "menu",
1111
+ onKeyDown: j,
1112
+ role: m,
1113
+ tabIndex: C == null && !i ? 0 : undefined
1114
+ };
1115
+ return u ? n().createElement(Ue, Ye({}, D, {
1116
+ elementRef: o,
1117
+ stopScrollPropagation: true
1118
+ }, l()(f, "tagName")), T) : n().createElement(Ge, Ye({}, D, {
1119
+ ref: o
1120
+ }, f), T);
1044
1121
  }
1045
-
1046
- acc.push(item);
1047
- return acc;
1048
- }, []);
1049
-
1050
- if (firstEnabledItemKey !== focusedItemKeyRef.current && (!hasSelectedItems || hasSelectedEnabledItems) && focusedItemKeyIsDisabled && firstEnabledItemKey != null) {
1051
- focusedItemKeyRef.current = firstEnabledItemKey;
1052
- forceUpdate();
1053
- }
1054
-
1055
- var sharedProps = {
1056
- 'data-test': 'menu',
1057
- onKeyDown: handleKeyDown,
1058
- role: role,
1059
- tabIndex: firstEnabledItemKey == null && !controlledExternally ? 0 : undefined
1060
- };
1061
- return stopScrollPropagation ? /*#__PURE__*/external_react_default().createElement(StyledScroll, Menu_extends({}, sharedProps, {
1062
- elementRef: elementRef,
1063
- stopScrollPropagation: true
1064
- }, omit_default()(otherProps, 'tagName')), childrenCleaned) : /*#__PURE__*/external_react_default().createElement(MenuStyles_Styled, Menu_extends({}, sharedProps, {
1065
- ref: elementRef
1066
- }, otherProps), childrenCleaned);
1067
- }
1068
-
1069
- Menu.propTypes = Menu_propTypes;
1070
- Menu.defaultProps = Menu_defaultProps;
1071
- Menu.Item = Menu_Item;
1072
- Menu.Divider = Menu_Divider;
1073
- Menu.Heading = Menu_Heading;
1074
- /* harmony default export */ const Menu_Menu = (Menu);
1075
-
1076
- ;// CONCATENATED MODULE: ./src/Menu/index.ts
1077
-
1078
-
1079
-
1080
- module.exports = __webpack_exports__;
1081
- /******/ })()
1082
- ;
1122
+ tt.propTypes = Ze;
1123
+ tt.defaultProps = et;
1124
+ tt.Item = ze;
1125
+ tt.Divider = x;
1126
+ tt.Heading = H;
1127
+ /* harmony default export */ const rt = tt;
1128
+ // CONCATENATED MODULE: ./src/Menu/index.ts
1129
+ module.exports = t;
1130
+ /******/})();