@splunk/react-ui 4.20.0 → 4.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/Accordion.js +425 -441
  2. package/Anchor.js +147 -193
  3. package/Animation.js +142 -166
  4. package/AnimationToggle.js +197 -253
  5. package/Box.js +145 -194
  6. package/Breadcrumbs.js +288 -298
  7. package/Button.js +488 -613
  8. package/ButtonGroup.js +160 -212
  9. package/ButtonSimple.js +543 -562
  10. package/CHANGELOG.md +26 -0
  11. package/Calendar.js +1107 -1195
  12. package/Card.js +771 -746
  13. package/CardLayout.js +205 -223
  14. package/Chip.js +509 -612
  15. package/Clickable.js +416 -472
  16. package/CloseButton.js +165 -250
  17. package/Code.js +1808 -2172
  18. package/Code.js.LICENSE.txt +8 -0
  19. package/CollapsiblePanel.js +586 -675
  20. package/Color.js +1066 -1297
  21. package/ColumnLayout.js +402 -465
  22. package/ComboBox.js +892 -969
  23. package/Concertina.js +998 -963
  24. package/ControlGroup.js +687 -718
  25. package/Date.js +567 -697
  26. package/DefinitionList.js +308 -310
  27. package/Divider.js +149 -194
  28. package/Dropdown.js +459 -558
  29. package/DualListbox.js +1480 -1735
  30. package/EventListener.js +94 -165
  31. package/File.js +1051 -1173
  32. package/FormRows.js +885 -880
  33. package/Heading.js +216 -263
  34. package/Image.js +446 -558
  35. package/JSONTree.js +690 -699
  36. package/Layer.js +442 -582
  37. package/Link.js +336 -361
  38. package/List.js +213 -237
  39. package/Markdown.js +510 -612
  40. package/Menu.js +1109 -1331
  41. package/Message.js +474 -629
  42. package/MessageBar.js +387 -561
  43. package/Modal.js +810 -798
  44. package/ModalLayer.js +326 -343
  45. package/Monogram.js +308 -368
  46. package/Multiselect.js +3558 -3998
  47. package/Number.js +729 -843
  48. package/Paginator.js +510 -615
  49. package/Paragraph.js +145 -188
  50. package/Popover.js +1470 -1693
  51. package/Progress.js +301 -362
  52. package/RadioBar.js +610 -651
  53. package/RadioList.js +483 -544
  54. package/Resize.js +530 -623
  55. package/ResultsMenu.js +494 -597
  56. package/ScreenReaderContent.js +142 -187
  57. package/Scroll.js +595 -598
  58. package/ScrollContainerContext.js +197 -278
  59. package/Search.js +745 -817
  60. package/Select.js +2441 -2746
  61. package/SidePanel.js +390 -392
  62. package/Slider.js +668 -825
  63. package/SlidingPanels.js +639 -645
  64. package/SplitButton.js +464 -499
  65. package/StaticContent.js +161 -217
  66. package/StepBar.js +386 -466
  67. package/Switch.js +710 -764
  68. package/TabBar.js +724 -815
  69. package/TabLayout.js +406 -438
  70. package/Table.js +4842 -5121
  71. package/Text.js +1169 -1351
  72. package/TextArea.js +1097 -1307
  73. package/Tooltip.js +624 -721
  74. package/TransitionOpen.js +489 -546
  75. package/Typography.js +176 -229
  76. package/WaitSpinner.js +230 -298
  77. package/package.json +14 -15
  78. package/stubs-splunkui.d.ts +4 -1
  79. package/types/src/ComboBox/Option.d.ts +1 -1
  80. package/types/src/Concertina/Concertina.d.ts +4 -0
  81. package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
  82. package/types/src/JSONTree/TreeNode.d.ts +5 -0
  83. package/types/src/Link/Link.d.ts +7 -3
  84. package/types/src/Link/docs/examples/NewWindow.d.ts +2 -0
  85. package/types/src/Markdown/Markdown.d.ts +1 -1
  86. package/types/src/Markdown/renderers/MarkdownHeading.d.ts +1 -1
  87. package/types/src/Menu/Item.d.ts +1 -1
  88. package/types/src/Menu/Menu.d.ts +1 -0
  89. package/types/src/MessageBar/docs/examples/WithActions.d.ts +2 -0
  90. package/types/src/Multiselect/Option.d.ts +1 -1
  91. package/types/src/Search/Option.d.ts +1 -1
  92. package/types/src/Select/Option.d.ts +1 -1
  93. package/types/src/Select/OptionBase.d.ts +1 -1
  94. package/types/src/fixtures/FetchOptions.d.ts +2 -8
  95. package/useForceUpdate.js +112 -146
  96. package/useKeyPress.js +74 -128
  97. package/usePrevious.js +65 -129
  98. package/useRovingFocus.js +122 -218
  99. package/types/src/Link/docs/examples/NewTab.d.ts +0 -2
  100. /package/types/src/Table/docs/examples/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts} +0 -0
  101. /package/types/src/Table/docs/examples/prisma/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts} +0 -0
package/TabBar.js CHANGED
@@ -1,835 +1,744 @@
1
- module.exports =
2
- /******/ (function(modules) { // webpackBootstrap
3
- /******/ // The module cache
4
- /******/ var installedModules = {};
5
- /******/
6
- /******/ // The require function
7
- /******/ function __webpack_require__(moduleId) {
8
- /******/
9
- /******/ // Check if module is in cache
10
- /******/ if(installedModules[moduleId]) {
11
- /******/ return installedModules[moduleId].exports;
12
- /******/ }
13
- /******/ // Create a new module (and put it into the cache)
14
- /******/ var module = installedModules[moduleId] = {
15
- /******/ i: moduleId,
16
- /******/ l: false,
17
- /******/ exports: {}
18
- /******/ };
19
- /******/
20
- /******/ // Execute the module function
21
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22
- /******/
23
- /******/ // Flag the module as loaded
24
- /******/ module.l = true;
25
- /******/
26
- /******/ // Return the exports of the module
27
- /******/ return module.exports;
28
- /******/ }
29
- /******/
30
- /******/
31
- /******/ // expose the modules object (__webpack_modules__)
32
- /******/ __webpack_require__.m = modules;
33
- /******/
34
- /******/ // expose the module cache
35
- /******/ __webpack_require__.c = installedModules;
36
- /******/
37
- /******/ // define getter function for harmony exports
38
- /******/ __webpack_require__.d = function(exports, name, getter) {
39
- /******/ if(!__webpack_require__.o(exports, name)) {
40
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
41
- /******/ }
42
- /******/ };
43
- /******/
44
- /******/ // define __esModule on exports
45
- /******/ __webpack_require__.r = function(exports) {
46
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
47
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48
- /******/ }
49
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
50
- /******/ };
51
- /******/
52
- /******/ // create a fake namespace object
53
- /******/ // mode & 1: value is a module id, require it
54
- /******/ // mode & 2: merge all properties of value into the ns
55
- /******/ // mode & 4: return value when already ns object
56
- /******/ // mode & 8|1: behave like require
57
- /******/ __webpack_require__.t = function(value, mode) {
58
- /******/ if(mode & 1) value = __webpack_require__(value);
59
- /******/ if(mode & 8) return value;
60
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
61
- /******/ var ns = Object.create(null);
62
- /******/ __webpack_require__.r(ns);
63
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
64
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
65
- /******/ return ns;
66
- /******/ };
67
- /******/
68
- /******/ // getDefaultExport function for compatibility with non-harmony modules
69
- /******/ __webpack_require__.n = function(module) {
70
- /******/ var getter = module && module.__esModule ?
71
- /******/ function getDefault() { return module['default']; } :
72
- /******/ function getModuleExports() { return module; };
73
- /******/ __webpack_require__.d(getter, 'a', getter);
74
- /******/ return getter;
75
- /******/ };
76
- /******/
77
- /******/ // Object.prototype.hasOwnProperty.call
78
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
79
- /******/
80
- /******/ // __webpack_public_path__
81
- /******/ __webpack_require__.p = "";
82
- /******/
83
- /******/
84
- /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 186);
86
- /******/ })
87
- /************************************************************************/
88
- /******/ ({
89
-
90
- /***/ 0:
91
- /***/ (function(module, exports) {
92
-
93
- module.exports = require("@splunk/themes");
94
-
95
- /***/ }),
96
-
97
- /***/ 1:
98
- /***/ (function(module, exports) {
99
-
100
- module.exports = require("prop-types");
101
-
102
- /***/ }),
103
-
104
- /***/ 10:
105
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
106
-
107
- "use strict";
108
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return updateReactRef; });
109
- /**
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
+ Tab: () => /* reexport */ L,
65
+ default: () => /* reexport */ te
66
+ });
67
+ // CONCATENATED MODULE: external "react"
68
+ const r = require("react");
69
+ var n = e.n(r);
70
+ // CONCATENATED MODULE: external "prop-types"
71
+ const i = require("prop-types");
72
+ var o = e.n(i);
73
+ // CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
74
+ const a = require("@splunk/ui-utils/keyboard");
75
+ // CONCATENATED MODULE: external "styled-components"
76
+ const l = require("styled-components");
77
+ var c = e.n(l);
78
+ // CONCATENATED MODULE: external "@splunk/themes"
79
+ const s = require("@splunk/themes");
80
+ // CONCATENATED MODULE: ./src/TabBar/TabBarStyles.ts
81
+ var p = c().div.withConfig({
82
+ displayName: "TabBarStyles__Styled",
83
+ componentId: "sc-1t85fen-0"
84
+ })([ "", " position:relative;&::before{content:'';display:block;position:absolute;left:0;top:0;right:0;bottom:0;border:0 solid ", ";}", ";" ], s.mixins.reset("flex"), (0,
85
+ s.pick)({
86
+ enterprise: s.variables.borderLightColor,
87
+ prisma: s.variables.neutral200
88
+ }), (0, s.pickVariant)("$layout", {
89
+ horizontal: {
90
+ prisma: (0, s.pickVariant)("$withUnderline", {
91
+ /* context appearance is only supported for Prisma */
92
+ true: (0, l.css)([ "&::before{border-bottom-width:1px;}" ])
93
+ }),
94
+ enterprise: (0, l.css)([ "&::before{border-bottom-width:1px;}" ])
95
+ },
96
+ vertical: {
97
+ enterprise: (0, l.css)([ "display:inline-block;&::before{border-right-width:1px;}" ]),
98
+ prisma: (0, l.css)([ "display:inline-block;&::before{border-right-width:1px;}" ])
99
+ }
100
+ }));
101
+ // CONCATENATED MODULE: external "@splunk/react-ui/Popover"
102
+ const u = require("@splunk/react-ui/Popover");
103
+ var d = e.n(u);
104
+ // CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
105
+ const f = require("@splunk/react-ui/ScreenReaderContent");
106
+ var b = e.n(f);
107
+ // CONCATENATED MODULE: external "@splunk/ui-utils/id"
108
+ const v = require("@splunk/ui-utils/id");
109
+ // CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
110
+ const h = require("@splunk/react-ui/Clickable");
111
+ var y = e.n(h);
112
+ // CONCATENATED MODULE: ./src/TabBar/TabStyles.ts
113
+ var m = c()(y()).withConfig({
114
+ displayName: "TabStyles__StyledClickable",
115
+ componentId: "sc-1ry8mzj-0"
116
+ })([ "flex:0 1 auto;display:block;position:relative;line-height:", ";text-align:center;white-space:nowrap;color:", ";", ";&[aria-selected='true']{cursor:default;", "}&[aria-selected='false']{box-shadow:none;font-weight:", ";", " &:hover:not([disabled]){", "}}&:focus{box-shadow:", ";", "}" ], (0,
117
+ s.pick)({
118
+ enterprise: "24px",
119
+ prisma: "20px"
120
+ }), s.variables.contentColorDefault, (0, s.pickVariant)("$layout", {
121
+ horizontal: (0, l.css)([ "padding:", ";margin-bottom:1px;" ], (0, s.pick)({
122
+ enterprise: "3px 20px",
123
+ prisma: {
124
+ comfortable: "0 20px",
125
+ compact: "0 16px"
126
+ }
127
+ })),
128
+ vertical: {
129
+ enterprise: (0, l.css)([ "width:100%;text-align:left;right:1px;padding:10px 20px;", "" ], (function(e) {
130
+ var t = e.$icon;
131
+ return t && (0, l.css)([ "text-align:center;" ]);
132
+ })),
133
+ prisma: (0, l.css)([ "width:100%;right:1px;padding:", ";" ], (0, s.pick)({
134
+ comfortable: "0 20px",
135
+ compact: "0 16px"
136
+ }))
137
+ }
138
+ }), (0, s.pick)({
139
+ enterprise: (0, l.css)([ "font-weight:", ";" ], s.variables.fontWeightBold),
140
+ prisma: (0, l.css)([ "color:", ";font-weight:", ";" ], s.variables.contentColorActive, s.variables.fontWeightBold)
141
+ }), (0, s.pick)({
142
+ enterprise: "normal",
143
+ prisma: s.variables.fontWeightSemiBold
144
+ }), (0, s.pick)({
145
+ prisma: (0, l.css)([ "&::after{display:block;content:attr(title);font-weight:", ";height:0;color:transparent;overflow:hidden;visibility:hidden;}" ], s.variables.fontWeightBold)
146
+ }), (0, s.pick)({
147
+ prisma: (0, l.css)([ "color:", ";" ], s.variables.contentColorActive)
148
+ }), s.variables.focusShadowInset, (0, s.pick)({
149
+ prisma: (0, l.css)([ "color:", ";" ], s.variables.contentColorActive)
150
+ }));
151
+ var g = c().div.withConfig({
152
+ displayName: "TabStyles__StyledUnderline",
153
+ componentId: "sc-1ry8mzj-1"
154
+ })([ "position:absolute;", " ", ";[aria-selected='true'] > &&{background-color:", ";", ";}", ":hover:not([disabled]) > &&{", ";}" ], (0,
155
+ s.pick)({
156
+ enterprise: (0, l.css)([ "background:", ";" ], s.variables.borderLightColor)
157
+ }), (0, s.pickVariant)("$layout", {
158
+ horizontal: (0, l.css)([ "height:0;box-sizing:border-box;width:", ";", " transition:height 0.2s;" ], (0,
159
+ s.pick)({
160
+ enterprise: (0, l.css)([ "calc(100% - 20px * 2)" ]),
161
+ prisma: {
162
+ comfortable: (0, l.css)([ "calc(100% - 20px * 2)" ]),
163
+ compact: (0, l.css)([ "calc(100% - 16px * 2)" ])
164
+ }
165
+ }), (0, s.pick)({
166
+ enterprise: (0, l.css)([ "bottom:-1px;" ])
167
+ })),
168
+ vertical: {
169
+ enterprise: (0, l.css)([ "width:0;height:calc(100% - 10px * 2);top:10px;right:-1px;transition:width 0.2s;" ]),
170
+ prisma: (0, l.css)([ "width:1px;height:calc(100% - 10px * 2);top:10px;right:-1px;transition:width 0.2s;box-sizing:border-box;" ])
171
+ }
172
+ }), (0, s.pick)({
173
+ enterprise: s.variables.accentColor,
174
+ prisma: s.variables.contentColorActive
175
+ }), (0, s.pickVariant)("$layout", {
176
+ horizontal: {
177
+ enterprise: (0, l.css)([ "height:3px;" ]),
178
+ prisma: (0, s.pickVariant)("$withUnderline", {
179
+ // context appearance is only supported for Prisma
180
+ true: (0, l.css)([ "height:1px;" ])
181
+ })
182
+ },
183
+ vertical: {
184
+ enterprise: (0, l.css)([ "width:3px;" ]),
185
+ prisma: (0, l.css)([ "width:1px;" ])
186
+ }
187
+ }), m, (0, s.pickVariant)("$layout", {
188
+ horizontal: {
189
+ enterprise: (0, l.css)([ "height:3px;" ])
190
+ },
191
+ vertical: {
192
+ enterprise: (0, l.css)([ "width:3px;" ])
193
+ }
194
+ }));
195
+ var x = c().span.withConfig({
196
+ displayName: "TabStyles__StyledIcon",
197
+ componentId: "sc-1ry8mzj-2"
198
+ })([ "", ";" ], (0, s.pickVariant)("$iconSize", {
199
+ inline: (0, l.css)([ "", " text-align:left;padding-right:", ";> svg{transform:translateY(-1px);}" ], (0,
200
+ s.pick)({
201
+ prisma: (0, l.css)([ "display:inline-block;width:16px;height:16px;" ])
202
+ }), (0, s.pick)({
203
+ enterprise: "0.4em",
204
+ prisma: "8px"
205
+ })),
206
+ small: (0, l.css)([ "font-size:24px;height:24px;text-align:center;display:block;padding:4px 0;" ]),
207
+ large: (0, l.css)([ "font-size:48px;height:48px;text-align:center;display:block;padding:8px 0 0;" ])
208
+ }));
209
+ var k = c().div.withConfig({
210
+ displayName: "TabStyles__StyledLabel",
211
+ componentId: "sc-1ry8mzj-3"
212
+ })([ "overflow:hidden;text-overflow:ellipsis;min-width:10px;margin:", ";" ], (0,
213
+ s.pick)({
214
+ enterprise: "0",
215
+ prisma: {
216
+ comfortable: "16px 0",
217
+ compact: "10px 0"
218
+ }
219
+ }));
220
+ var w = c().div.withConfig({
221
+ displayName: "TabStyles__StyledCount",
222
+ componentId: "sc-1ry8mzj-4"
223
+ })([ "", " display:inline-block;border-radius:18px;color:", ";font-size:", ";line-height:10px;padding:4px 6px;margin-left:", ";", " &[disabled]{background:", ";color:", ";}" ], s.mixins.reset("inlne-block"), s.variables.contentColorDefault, (0,
224
+ s.pick)({
225
+ enterprise: "inherit",
226
+ prisma: "10px"
227
+ }), (0, s.pick)({
228
+ enterprise: "0",
229
+ prisma: "8px"
230
+ }), (0, s.pick)({
231
+ enterprise: (0, l.css)([ "&::before{content:'(';}&::after{content:')';}" ]),
232
+ prisma: (0, l.css)([ "background:", ";" ], s.variables.neutral100)
233
+ }), s.variables.interactiveColorBackgroundDisabled, s.variables.contentColorDisabled);
234
+ var O = c().div.withConfig({
235
+ displayName: "TabStyles__StyledTooltipContent",
236
+ componentId: "sc-1ry8mzj-5"
237
+ })([ "padding:8px;font-size:", ";" ], s.variables.fontSizeSmall);
238
+ // CONCATENATED MODULE: ./src/TabBar/TabBarContext.tsx
239
+ var S = (0, r.createContext)({});
240
+ S.displayName = "TabBar";
241
+ /* harmony default export */ const C = S;
242
+ // CONCATENATED MODULE: ./src/utils/getCountValue.ts
243
+ // A utility for max count
244
+ var I = function e(t, r) {
245
+ if (t > r) {
246
+ return "".concat(r, "+");
247
+ }
248
+ return t;
249
+ };
250
+ // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
251
+ /**
110
252
  * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
111
253
  *
112
254
  * @param ref - The React callback or object ref. Can be `null` or `undefined`.
113
255
  * @param current - The new value of the ref.
114
256
  */
115
- function updateReactRef(ref, current) {
116
- if (ref) {
117
- if (typeof ref === 'function') {
118
- ref(current);
119
- } else {
120
- // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
121
- // the intention here is to signal "we will take care of setting 'current', not you".
122
- ref.current = current; // eslint-disable-line no-param-reassign
257
+ function j(e, t) {
258
+ if (e) {
259
+ if (typeof e === "function") {
260
+ e(t);
261
+ } else {
262
+ // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
263
+ // the intention here is to signal "we will take care of setting 'current', not you".
264
+ e.current = t;
265
+ // eslint-disable-line no-param-reassign
266
+ }
267
+ }
123
268
  }
124
- }
125
- }
126
-
127
-
128
-
129
- /***/ }),
130
-
131
- /***/ 12:
132
- /***/ (function(module, exports) {
133
-
134
- module.exports = require("@splunk/react-ui/Clickable");
135
-
136
- /***/ }),
137
-
138
- /***/ 14:
139
- /***/ (function(module, exports) {
140
-
141
- module.exports = require("@splunk/react-ui/ScreenReaderContent");
142
-
143
- /***/ }),
144
-
145
- /***/ 186:
146
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
147
-
148
- "use strict";
149
- // ESM COMPAT FLAG
150
- __webpack_require__.r(__webpack_exports__);
151
-
152
- // EXPORTS
153
- __webpack_require__.d(__webpack_exports__, "default", function() { return /* reexport */ TabBar_TabBar; });
154
- __webpack_require__.d(__webpack_exports__, "Tab", function() { return /* reexport */ TabBar_Tab; });
155
-
156
- // EXTERNAL MODULE: external "react"
157
- var external_react_ = __webpack_require__(2);
158
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
159
-
160
- // EXTERNAL MODULE: external "prop-types"
161
- var external_prop_types_ = __webpack_require__(1);
162
- var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
163
-
164
- // EXTERNAL MODULE: external "@splunk/ui-utils/keyboard"
165
- var keyboard_ = __webpack_require__(7);
166
-
167
- // EXTERNAL MODULE: external "styled-components"
168
- var external_styled_components_ = __webpack_require__(3);
169
- var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
170
-
171
- // EXTERNAL MODULE: external "@splunk/themes"
172
- var themes_ = __webpack_require__(0);
173
-
174
- // CONCATENATED MODULE: ./src/TabBar/TabBarStyles.ts
175
-
176
-
177
- var Styled = external_styled_components_default.a.div.withConfig({
178
- displayName: "TabBarStyles__Styled",
179
- componentId: "sc-1t85fen-0"
180
- })(["", " position:relative;&::before{content:'';display:block;position:absolute;left:0;top:0;right:0;bottom:0;border:0 solid ", ";}", ";"], themes_["mixins"].reset('flex'), Object(themes_["pick"])({
181
- enterprise: themes_["variables"].borderLightColor,
182
- prisma: themes_["variables"].neutral200
183
- }), Object(themes_["pickVariant"])('$layout', {
184
- horizontal: {
185
- prisma: Object(themes_["pickVariant"])('$withUnderline', {
186
- /* context appearance is only supported for Prisma */
187
- "true": Object(external_styled_components_["css"])(["&::before{border-bottom-width:1px;}"])
188
- }),
189
- enterprise: Object(external_styled_components_["css"])(["&::before{border-bottom-width:1px;}"])
190
- },
191
- vertical: {
192
- enterprise: Object(external_styled_components_["css"])(["display:inline-block;&::before{border-right-width:1px;}"]),
193
- prisma: Object(external_styled_components_["css"])(["display:inline-block;&::before{border-right-width:1px;}"])
194
- }
195
- }));
196
-
197
- // EXTERNAL MODULE: external "@splunk/react-ui/Popover"
198
- var Popover_ = __webpack_require__(21);
199
- var Popover_default = /*#__PURE__*/__webpack_require__.n(Popover_);
200
-
201
- // EXTERNAL MODULE: external "@splunk/react-ui/ScreenReaderContent"
202
- var ScreenReaderContent_ = __webpack_require__(14);
203
- var ScreenReaderContent_default = /*#__PURE__*/__webpack_require__.n(ScreenReaderContent_);
204
-
205
- // EXTERNAL MODULE: external "@splunk/ui-utils/id"
206
- var id_ = __webpack_require__(8);
207
-
208
- // EXTERNAL MODULE: external "@splunk/react-ui/Clickable"
209
- var Clickable_ = __webpack_require__(12);
210
- var Clickable_default = /*#__PURE__*/__webpack_require__.n(Clickable_);
211
-
212
- // CONCATENATED MODULE: ./src/TabBar/TabStyles.ts
213
-
214
-
215
-
216
- var StyledClickable = external_styled_components_default()(Clickable_default.a).withConfig({
217
- displayName: "TabStyles__StyledClickable",
218
- componentId: "sc-1ry8mzj-0"
219
- })(["flex:0 1 auto;display:block;position:relative;line-height:", ";text-align:center;white-space:nowrap;color:", ";", ";&[aria-selected='true']{cursor:default;", "}&[aria-selected='false']{box-shadow:none;font-weight:", ";", " &:hover:not([disabled]){", "}}&:focus{box-shadow:", ";", "}"], Object(themes_["pick"])({
220
- enterprise: '24px',
221
- prisma: '20px'
222
- }), themes_["variables"].contentColorDefault, Object(themes_["pickVariant"])('$layout', {
223
- horizontal: Object(external_styled_components_["css"])(["padding:", ";margin-bottom:1px;"], Object(themes_["pick"])({
224
- enterprise: '3px 20px',
225
- prisma: {
226
- comfortable: '0 20px',
227
- compact: '0 16px'
269
+ // CONCATENATED MODULE: ./src/TabBar/Tab.tsx
270
+ function T(e) {
271
+ "@babel/helpers - typeof";
272
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
273
+ T = function e(t) {
274
+ return typeof t;
275
+ };
276
+ } else {
277
+ T = function e(t) {
278
+ return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
279
+ };
280
+ }
281
+ return T(e);
228
282
  }
229
- })),
230
- vertical: {
231
- enterprise: Object(external_styled_components_["css"])(["width:100%;text-align:left;right:1px;padding:10px 20px;", ""], function (_ref) {
232
- var $icon = _ref.$icon;
233
- return $icon && Object(external_styled_components_["css"])(["text-align:center;"]);
234
- }),
235
- prisma: Object(external_styled_components_["css"])(["width:100%;right:1px;padding:", ";"], Object(themes_["pick"])({
236
- comfortable: '0 20px',
237
- compact: '0 16px'
238
- }))
239
- }
240
- }), Object(themes_["pick"])({
241
- enterprise: Object(external_styled_components_["css"])(["font-weight:", ";"], themes_["variables"].fontWeightBold),
242
- prisma: Object(external_styled_components_["css"])(["color:", ";font-weight:", ";"], themes_["variables"].contentColorActive, themes_["variables"].fontWeightBold)
243
- }), Object(themes_["pick"])({
244
- enterprise: 'normal',
245
- prisma: themes_["variables"].fontWeightSemiBold
246
- }), Object(themes_["pick"])({
247
- prisma: Object(external_styled_components_["css"])(["&::after{display:block;content:attr(title);font-weight:", ";height:0;color:transparent;overflow:hidden;visibility:hidden;}"], themes_["variables"].fontWeightBold)
248
- }), Object(themes_["pick"])({
249
- prisma: Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].contentColorActive)
250
- }), themes_["variables"].focusShadowInset, Object(themes_["pick"])({
251
- prisma: Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].contentColorActive)
252
- }));
253
- var StyledUnderline = external_styled_components_default.a.div.withConfig({
254
- displayName: "TabStyles__StyledUnderline",
255
- componentId: "sc-1ry8mzj-1"
256
- })(["position:absolute;", " ", ";[aria-selected='true'] > &&{background-color:", ";", ";}", ":hover:not([disabled]) > &&{", ";}"], Object(themes_["pick"])({
257
- enterprise: Object(external_styled_components_["css"])(["background:", ";"], themes_["variables"].borderLightColor)
258
- }), Object(themes_["pickVariant"])('$layout', {
259
- horizontal: Object(external_styled_components_["css"])(["height:0;box-sizing:border-box;width:", ";", " transition:height 0.2s;"], Object(themes_["pick"])({
260
- enterprise: Object(external_styled_components_["css"])(["calc(100% - 20px * 2)"]),
261
- prisma: {
262
- comfortable: Object(external_styled_components_["css"])(["calc(100% - 20px * 2)"]),
263
- compact: Object(external_styled_components_["css"])(["calc(100% - 16px * 2)"])
283
+ function z() {
284
+ z = Object.assign || function(e) {
285
+ for (var t = 1; t < arguments.length; t++) {
286
+ var r = arguments[t];
287
+ for (var n in r) {
288
+ if (Object.prototype.hasOwnProperty.call(r, n)) {
289
+ e[n] = r[n];
290
+ }
291
+ }
292
+ }
293
+ return e;
294
+ };
295
+ return z.apply(this, arguments);
264
296
  }
265
- }), Object(themes_["pick"])({
266
- enterprise: Object(external_styled_components_["css"])(["bottom:-1px;"])
267
- })),
268
- vertical: {
269
- enterprise: Object(external_styled_components_["css"])(["width:0;height:calc(100% - 10px * 2);top:10px;right:-1px;transition:width 0.2s;"]),
270
- prisma: Object(external_styled_components_["css"])(["width:1px;height:calc(100% - 10px * 2);top:10px;right:-1px;transition:width 0.2s;box-sizing:border-box;"])
271
- }
272
- }), Object(themes_["pick"])({
273
- enterprise: themes_["variables"].accentColor,
274
- prisma: themes_["variables"].contentColorActive
275
- }), Object(themes_["pickVariant"])('$layout', {
276
- horizontal: {
277
- enterprise: Object(external_styled_components_["css"])(["height:3px;"]),
278
- prisma: Object(themes_["pickVariant"])('$withUnderline', {
279
- // context appearance is only supported for Prisma
280
- "true": Object(external_styled_components_["css"])(["height:1px;"])
281
- })
282
- },
283
- vertical: {
284
- enterprise: Object(external_styled_components_["css"])(["width:3px;"]),
285
- prisma: Object(external_styled_components_["css"])(["width:1px;"])
286
- }
287
- }), StyledClickable, Object(themes_["pickVariant"])('$layout', {
288
- horizontal: {
289
- enterprise: Object(external_styled_components_["css"])(["height:3px;"])
290
- },
291
- vertical: {
292
- enterprise: Object(external_styled_components_["css"])(["width:3px;"])
293
- }
294
- }));
295
- var StyledIcon = external_styled_components_default.a.span.withConfig({
296
- displayName: "TabStyles__StyledIcon",
297
- componentId: "sc-1ry8mzj-2"
298
- })(["", ";"], Object(themes_["pickVariant"])('$iconSize', {
299
- inline: Object(external_styled_components_["css"])(["", " text-align:left;padding-right:", ";> svg{transform:translateY(-1px);}"], Object(themes_["pick"])({
300
- prisma: Object(external_styled_components_["css"])(["display:inline-block;width:16px;height:16px;"])
301
- }), Object(themes_["pick"])({
302
- enterprise: '0.4em',
303
- prisma: '8px'
304
- })),
305
- small: Object(external_styled_components_["css"])(["font-size:24px;height:24px;text-align:center;display:block;padding:4px 0;"]),
306
- large: Object(external_styled_components_["css"])(["font-size:48px;height:48px;text-align:center;display:block;padding:8px 0 0;"])
307
- }));
308
- var StyledLabel = external_styled_components_default.a.div.withConfig({
309
- displayName: "TabStyles__StyledLabel",
310
- componentId: "sc-1ry8mzj-3"
311
- })(["overflow:hidden;text-overflow:ellipsis;min-width:10px;margin:", ";"], Object(themes_["pick"])({
312
- enterprise: '0',
313
- prisma: {
314
- comfortable: '16px 0',
315
- compact: '10px 0'
316
- }
317
- }));
318
- var StyledCount = external_styled_components_default.a.div.withConfig({
319
- displayName: "TabStyles__StyledCount",
320
- componentId: "sc-1ry8mzj-4"
321
- })(["", " display:inline-block;border-radius:18px;color:", ";font-size:", ";line-height:10px;padding:4px 6px;margin-left:", ";", " &[disabled]{background:", ";color:", ";}"], themes_["mixins"].reset('inlne-block'), themes_["variables"].contentColorDefault, Object(themes_["pick"])({
322
- enterprise: 'inherit',
323
- prisma: '10px'
324
- }), Object(themes_["pick"])({
325
- enterprise: '0',
326
- prisma: '8px'
327
- }), Object(themes_["pick"])({
328
- enterprise: Object(external_styled_components_["css"])(["&::before{content:'(';}&::after{content:')';}"]),
329
- prisma: Object(external_styled_components_["css"])(["background:", ";"], themes_["variables"].neutral100)
330
- }), themes_["variables"].interactiveColorBackgroundDisabled, themes_["variables"].contentColorDisabled);
331
- var StyledTooltipContent = external_styled_components_default.a.div.withConfig({
332
- displayName: "TabStyles__StyledTooltipContent",
333
- componentId: "sc-1ry8mzj-5"
334
- })(["padding:8px;font-size:", ";"], themes_["variables"].fontSizeSmall);
335
-
336
- // CONCATENATED MODULE: ./src/TabBar/TabBarContext.tsx
337
-
338
- var TabBarContext = /*#__PURE__*/Object(external_react_["createContext"])({});
339
- TabBarContext.displayName = 'TabBar';
340
- /* harmony default export */ var TabBar_TabBarContext = (TabBarContext);
341
- // CONCATENATED MODULE: ./src/utils/getCountValue.ts
342
- // A utility for max count
343
- var maxCountValue = function maxCountValue(count, maxCount) {
344
- if (count > maxCount) {
345
- return "".concat(maxCount, "+");
346
- }
347
-
348
- return count;
349
- };
350
- // EXTERNAL MODULE: ./src/utils/updateReactRef.ts
351
- var updateReactRef = __webpack_require__(10);
352
-
353
- // CONCATENATED MODULE: ./src/TabBar/Tab.tsx
354
- 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); }
355
-
356
- 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); }
357
-
358
- 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; }
359
-
360
- 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; }
361
-
362
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
363
-
364
- 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); } }
365
-
366
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
367
-
368
- 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); }
369
-
370
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
371
-
372
- 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); }; }
373
-
374
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
375
-
376
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
377
-
378
- 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; } }
379
-
380
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
381
-
382
- 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; }
383
-
384
-
385
-
386
-
387
-
388
-
389
-
390
-
391
-
392
-
393
- var propTypes = {
394
- /** @private. Is the tab active. */
395
- active: external_prop_types_default.a.bool,
396
- ariaControls: external_prop_types_default.a.string,
397
- count: external_prop_types_default.a.number,
398
- disabled: external_prop_types_default.a.bool,
399
- elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
400
- icon: external_prop_types_default.a.node,
401
- id: external_prop_types_default.a.string,
402
- label: external_prop_types_default.a.oneOfType([external_prop_types_default.a.string, external_prop_types_default.a.element]),
403
-
404
- /** @private Maximum count number in tab label */
405
- maxCount: external_prop_types_default.a.number,
406
- tabId: external_prop_types_default.a.string,
407
-
408
- /** @private. The internal key of the tab */
409
- tabKey: external_prop_types_default.a.number,
410
- to: external_prop_types_default.a.string,
411
- tooltip: external_prop_types_default.a.node
412
- };
413
- var defaultProps = {
414
- active: false
415
- };
416
-
417
- var Tab_Tab = /*#__PURE__*/function (_Component) {
418
- _inherits(Tab, _Component);
419
-
420
- var _super = _createSuper(Tab);
421
-
422
- // @docs-props-type TabPropsBase
423
- function Tab(props) {
424
- var _this;
425
-
426
- _classCallCheck(this, Tab);
427
-
428
- _this = _super.call(this, props);
429
-
430
- _defineProperty(_assertThisInitialized(_this), "popoverId", void 0);
431
-
432
- _defineProperty(_assertThisInitialized(_this), "ariaId", void 0);
433
-
434
- _defineProperty(_assertThisInitialized(_this), "handleMount", function (el) {
435
- _this.setState({
436
- anchor: el
437
- });
438
-
439
- Object(updateReactRef["a" /* updateReactRef */])(_this.props.elementRef, el);
440
- });
441
-
442
- _defineProperty(_assertThisInitialized(_this), "handleTooltipOpen", function () {
443
- _this.setState({
444
- open: true
445
- });
446
- });
447
-
448
- _defineProperty(_assertThisInitialized(_this), "handleTooltipClose", function () {
449
- _this.setState({
450
- open: false
451
- });
452
- });
453
-
454
- _defineProperty(_assertThisInitialized(_this), "handleClick", function (e) {
455
- var _this$props = _this.props,
456
- active = _this$props.active,
457
- tabId = _this$props.tabId,
458
- tabKey = _this$props.tabKey,
459
- to = _this$props.to;
460
- var onClick = _this.context.onClick; // preserve the previous behaviour from 2ad8e7eaf47 to avoid firing unnecessary onChange events
461
- // while preventing the "to" prop from incorrectly triggering <Clickable>'s providedOnClick on the active tab
462
-
463
- if (!active) {
464
- onClick === null || onClick === void 0 ? void 0 : onClick(e, {
465
- tabId: tabId,
466
- tabKey: tabKey
297
+ function _(e, t) {
298
+ if (e == null) return {};
299
+ var r = E(e, t);
300
+ var n, i;
301
+ if (Object.getOwnPropertySymbols) {
302
+ var o = Object.getOwnPropertySymbols(e);
303
+ for (i = 0; i < o.length; i++) {
304
+ n = o[i];
305
+ if (t.indexOf(n) >= 0) continue;
306
+ if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
307
+ r[n] = e[n];
308
+ }
309
+ }
310
+ return r;
311
+ }
312
+ function E(e, t) {
313
+ if (e == null) return {};
314
+ var r = {};
315
+ var n = Object.keys(e);
316
+ var i, o;
317
+ for (o = 0; o < n.length; o++) {
318
+ i = n[o];
319
+ if (t.indexOf(i) >= 0) continue;
320
+ r[i] = e[i];
321
+ }
322
+ return r;
323
+ }
324
+ function P(e, t) {
325
+ if (!(e instanceof t)) {
326
+ throw new TypeError("Cannot call a class as a function");
327
+ }
328
+ }
329
+ function $(e, t) {
330
+ for (var r = 0; r < t.length; r++) {
331
+ var n = t[r];
332
+ n.enumerable = n.enumerable || false;
333
+ n.configurable = true;
334
+ if ("value" in n) n.writable = true;
335
+ Object.defineProperty(e, n.key, n);
336
+ }
337
+ }
338
+ function R(e, t, r) {
339
+ if (t) $(e.prototype, t);
340
+ if (r) $(e, r);
341
+ return e;
342
+ }
343
+ function D(e, t) {
344
+ if (typeof t !== "function" && t !== null) {
345
+ throw new TypeError("Super expression must either be null or a function");
346
+ }
347
+ e.prototype = Object.create(t && t.prototype, {
348
+ constructor: {
349
+ value: e,
350
+ writable: true,
351
+ configurable: true
352
+ }
467
353
  });
468
- }
469
-
470
- if (to == null || to != null && active) {
471
- e.preventDefault();
472
- }
473
- });
474
-
475
- _defineProperty(_assertThisInitialized(_this), "handleFocus", function (e) {
476
- _this.handleTooltipOpen();
477
-
478
- var _this$props2 = _this.props,
479
- tabId = _this$props2.tabId,
480
- tabKey = _this$props2.tabKey;
481
- var onFocus = _this.context.onFocus;
482
- onFocus === null || onFocus === void 0 ? void 0 : onFocus(e, {
483
- tabId: tabId,
484
- tabKey: tabKey
485
- });
486
- });
487
-
488
- _this.popoverId = Object(id_["createDOMID"])('popover');
489
- _this.ariaId = Object(id_["createDOMID"])('aria-id');
490
- _this.state = {
491
- open: false,
492
- anchor: null
493
- };
494
- return _this;
495
- }
496
-
497
- _createClass(Tab, [{
498
- key: "focus",
499
- value: function focus() {
500
- var _this$state$anchor;
501
-
502
- (_this$state$anchor = this.state.anchor) === null || _this$state$anchor === void 0 ? void 0 : _this$state$anchor.focus();
354
+ if (t) M(e, t);
503
355
  }
504
- }, {
505
- key: "render",
506
- value: function render() {
507
- var _this$props3 = this.props,
508
- active = _this$props3.active,
509
- ariaControls = _this$props3.ariaControls,
510
- count = _this$props3.count,
511
- disabled = _this$props3.disabled,
512
- icon = _this$props3.icon,
513
- label = _this$props3.label,
514
- tabId = _this$props3.tabId,
515
- maxCount = _this$props3.maxCount,
516
- to = _this$props3.to,
517
- tooltip = _this$props3.tooltip,
518
- otherProps = _objectWithoutProperties(_this$props3, ["active", "ariaControls", "count", "disabled", "icon", "label", "tabId", "maxCount", "to", "tooltip"]);
519
-
520
- var _this$state = this.state,
521
- anchor = _this$state.anchor,
522
- open = _this$state.open;
523
- var _this$context = this.context,
524
- appearance = _this$context.appearance,
525
- disabledContext = _this$context.disabled,
526
- iconSize = _this$context.iconSize,
527
- layout = _this$context.layout,
528
- widthContext = _this$context.width;
529
- var style = otherProps.style;
530
- var disabledValue = disabledContext || disabled || false;
531
- var iconSizeValue = iconSize || 'inline';
532
- var layoutValue = layout || 'horizontal';
533
- var styleValue = widthContext ? {
534
- width: widthContext
535
- } : style;
536
- return (
537
- /*#__PURE__*/
538
- // TODO: Fix the ts error: https://splunk.atlassian.net/browse/SUI-5569
539
- // eslint-disable-next-line
540
- // @ts-ignore-next-line
541
- external_react_default.a.createElement(StyledClickable, _extends({
542
- "aria-controls": ariaControls,
543
- "aria-selected": active,
544
- "aria-labelledby": this.ariaId,
545
- "data-test": "tab",
546
- "data-test-tab-id": tabId,
547
- "data-test-popover-id": tooltip ? this.popoverId : undefined,
548
- $layout: layoutValue,
549
- $icon: icon && iconSizeValue !== 'inline' ? true : undefined,
550
- disabled: disabledValue,
551
- elementRef: this.handleMount,
552
- style: styleValue
553
- }, otherProps, {
554
- onClick: this.handleClick,
555
- onFocus: this.handleFocus,
556
- onMouseEnter: this.handleTooltipOpen,
557
- onBlur: this.handleTooltipClose,
558
- onMouseLeave: this.handleTooltipClose,
559
- role: "tab",
560
- tabIndex: active ? undefined : -1,
561
- to: to
562
- }), /*#__PURE__*/external_react_default.a.createElement(StyledLabel, {
563
- "data-test": "label",
564
- $withUnderline: appearance === 'navigation'
565
- }, icon && /*#__PURE__*/external_react_default.a.createElement(StyledIcon, {
566
- $iconSize: iconSizeValue
567
- }, icon), label, (count === 0 || count) && /*#__PURE__*/external_react_default.a.createElement(StyledCount, {
568
- "data-test": "count",
569
- disabled: disabledValue
570
- }, maxCount ? maxCountValue(count, maxCount) : count)), /*#__PURE__*/external_react_default.a.createElement(StyledUnderline, {
571
- $layout: layoutValue,
572
- $withUnderline: appearance === 'navigation'
573
- }), !disabled && tooltip && /*#__PURE__*/external_react_default.a.createElement(Popover_default.a, {
574
- role: "tooltip",
575
- anchor: anchor // override Popover's default animation to make it faster
576
- // this keeps the overall amount of time the Tooltip is on-screen the same
577
- // even with the increased default closeDelay to address SUI-5116
578
- ,
579
- animationConfig: {
580
- tension: 400
581
- },
582
- appearance: "inverted",
583
- closeReasons: ['offScreen', 'escapeKey'],
584
- defaultPlacement: layoutValue === 'vertical' ? 'right' : 'above',
585
- id: this.popoverId,
586
- open: !!anchor && open,
587
- align: "center"
588
- }, /*#__PURE__*/external_react_default.a.createElement(StyledTooltipContent, null, tooltip)), tooltip && /*#__PURE__*/external_react_default.a.createElement(ScreenReaderContent_default.a, {
589
- "aria-hidden": "true",
590
- id: this.ariaId
591
- }, tooltip))
592
- );
356
+ function M(e, t) {
357
+ M = Object.setPrototypeOf || function e(t, r) {
358
+ t.__proto__ = r;
359
+ return t;
360
+ };
361
+ return M(e, t);
593
362
  }
594
- }]);
595
-
596
- return Tab;
597
- }(external_react_["Component"]);
598
-
599
- _defineProperty(Tab_Tab, "propTypes", propTypes);
600
-
601
- _defineProperty(Tab_Tab, "defaultProps", defaultProps);
602
-
603
- _defineProperty(Tab_Tab, "contextType", TabBar_TabBarContext);
604
-
605
- /* harmony default export */ var TabBar_Tab = (Tab_Tab);
606
- // EXTERNAL MODULE: ./src/utils/navigateList.ts
607
- var navigateList = __webpack_require__(60);
608
-
609
- // CONCATENATED MODULE: ./src/TabBar/TabBar.tsx
610
- function TabBar_extends() { TabBar_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 TabBar_extends.apply(this, arguments); }
611
-
612
- function TabBar_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = TabBar_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; }
613
-
614
- function TabBar_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; }
615
-
616
-
617
-
618
-
619
-
620
-
621
-
622
-
623
- var minTabWidth = 50;
624
- /** @public */
625
-
626
- var TabBar_propTypes = {
627
- autoActivate: external_prop_types_default.a.bool,
628
- activeTabId: external_prop_types_default.a.string,
629
- appearance: external_prop_types_default.a.oneOf(['navigation', 'context']),
630
- children: external_prop_types_default.a.node,
631
-
632
- /** @private */
633
- disabled: external_prop_types_default.a.bool,
634
- elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
635
- iconSize: external_prop_types_default.a.oneOf(['inline', 'small', 'large']),
636
- layout: external_prop_types_default.a.oneOf(['horizontal', 'vertical']),
637
- onChange: external_prop_types_default.a.func,
638
- tabWidth: external_prop_types_default.a.number
639
- };
640
-
641
- function TabBar(_ref) {
642
- var activeTabId = _ref.activeTabId,
643
- autoActivate = _ref.autoActivate,
644
- _ref$appearance = _ref.appearance,
645
- appearance = _ref$appearance === void 0 ? 'navigation' : _ref$appearance,
646
- children = _ref.children,
647
- _ref$disabled = _ref.disabled,
648
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
649
- elementRef = _ref.elementRef,
650
- _ref$iconSize = _ref.iconSize,
651
- iconSize = _ref$iconSize === void 0 ? 'inline' : _ref$iconSize,
652
- _ref$layout = _ref.layout,
653
- layout = _ref$layout === void 0 ? 'horizontal' : _ref$layout,
654
- onChange = _ref.onChange,
655
- tabWidth = _ref.tabWidth,
656
- otherProps = TabBar_objectWithoutProperties(_ref, ["activeTabId", "autoActivate", "appearance", "children", "disabled", "elementRef", "iconSize", "layout", "onChange", "tabWidth"]);
657
-
658
- // @docs-props-type TabBarPropsBase
659
- var focusedTabIndex = Object(external_react_["useRef"])(0);
660
- var tabRefs = [];
661
- var nextTabKey = Object(external_react_["useMemo"])(function () {
662
- return layout === 'vertical' ? 'down' : 'right';
663
- }, [layout]);
664
- var previousTabKey = Object(external_react_["useMemo"])(function () {
665
- return layout === 'vertical' ? 'up' : 'left';
666
- }, [layout]);
667
-
668
- var tabOnFocus = function tabOnFocus(e, data) {
669
- var tabKey = data.tabKey;
670
-
671
- if (tabKey != null) {
672
- focusedTabIndex.current = tabKey;
363
+ function q(e) {
364
+ var t = A();
365
+ return function r() {
366
+ var n = B(e), i;
367
+ if (t) {
368
+ var o = B(this).constructor;
369
+ i = Reflect.construct(n, arguments, o);
370
+ } else {
371
+ i = n.apply(this, arguments);
372
+ }
373
+ return K(this, i);
374
+ };
673
375
  }
674
-
675
- if (autoActivate) {
676
- onChange === null || onChange === void 0 ? void 0 : onChange(e, {
677
- selectedTabId: data.tabId
678
- });
376
+ function K(e, t) {
377
+ if (t && (T(t) === "object" || typeof t === "function")) {
378
+ return t;
379
+ }
380
+ return V(e);
679
381
  }
680
- };
681
-
682
- var tabOnClick = function tabOnClick(e, data) {
683
- onChange === null || onChange === void 0 ? void 0 : onChange(e, {
684
- selectedTabId: data.tabId
685
- });
686
- };
687
-
688
- var tabKeyCounter = 0;
689
- var clonedChildren = external_react_["Children"].toArray(children).filter(external_react_["isValidElement"]).map(function (child) {
690
- // <TabBar> allows non-<Tab> children, pass them through without any modification
691
- if (typeof child.type === 'string' || child.type.name !== TabBar_Tab.name) {
692
- return child;
382
+ function V(e) {
383
+ if (e === void 0) {
384
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
385
+ }
386
+ return e;
387
+ }
388
+ function A() {
389
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
390
+ if (Reflect.construct.sham) return false;
391
+ if (typeof Proxy === "function") return true;
392
+ try {
393
+ Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
394
+ return true;
395
+ } catch (e) {
396
+ return false;
397
+ }
693
398
  }
694
-
695
- var ref = /*#__PURE__*/external_react_default.a.createRef();
696
- tabRefs.push(ref);
697
- var childProps = {
698
- active: activeTabId === child.props.tabId,
699
- tabKey: tabKeyCounter,
700
- ref: ref
399
+ function B(e) {
400
+ B = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
401
+ return t.__proto__ || Object.getPrototypeOf(t);
402
+ };
403
+ return B(e);
404
+ }
405
+ function N(e, t, r) {
406
+ if (t in e) {
407
+ Object.defineProperty(e, t, {
408
+ value: r,
409
+ enumerable: true,
410
+ configurable: true,
411
+ writable: true
412
+ });
413
+ } else {
414
+ e[t] = r;
415
+ }
416
+ return e;
417
+ }
418
+ var W = {
419
+ /** @private. Is the tab active. */
420
+ active: o().bool,
421
+ ariaControls: o().string,
422
+ count: o().number,
423
+ disabled: o().bool,
424
+ elementRef: o().oneOfType([ o().func, o().object ]),
425
+ icon: o().node,
426
+ id: o().string,
427
+ label: o().oneOfType([ o().string, o().element ]),
428
+ /** @private Maximum count number in tab label */
429
+ maxCount: o().number,
430
+ tabId: o().string,
431
+ /** @private. The internal key of the tab */
432
+ tabKey: o().number,
433
+ to: o().string,
434
+ tooltip: o().node
435
+ };
436
+ var F = {
437
+ active: false
701
438
  };
702
- tabKeyCounter += 1;
703
- return /*#__PURE__*/Object(external_react_["cloneElement"])(child, childProps);
704
- });
705
- var widthContext = tabWidth && tabWidth > minTabWidth ? tabWidth : null;
706
-
707
- var handleOnKeyDown = function handleOnKeyDown(e) {
708
- var key = Object(keyboard_["keycode"])(e.nativeEvent);
709
- var tabToFocusRef;
710
-
711
- if (key === nextTabKey) {
712
- tabToFocusRef = Object(navigateList["a" /* getNextListItem */])(tabRefs, focusedTabIndex.current, focusedTabIndex.current + 1);
713
- } else if (key === previousTabKey) {
714
- tabToFocusRef = Object(navigateList["b" /* getPrevListItem */])(tabRefs, focusedTabIndex.current, focusedTabIndex.current - 1);
715
- } else if (key === 'home') {
716
- tabToFocusRef = Object(navigateList["a" /* getNextListItem */])(tabRefs, focusedTabIndex.current, 0);
717
- } else if (key === 'end') {
718
- tabToFocusRef = Object(navigateList["b" /* getPrevListItem */])(tabRefs, focusedTabIndex.current, tabRefs.length - 1);
439
+ var U = function(e) {
440
+ D(r, e);
441
+ var t = q(r);
442
+ // @docs-props-type TabPropsBase
443
+ function r(e) {
444
+ var n;
445
+ P(this, r);
446
+ n = t.call(this, e);
447
+ N(V(n), "popoverId", void 0);
448
+ N(V(n), "ariaId", void 0);
449
+ N(V(n), "handleMount", (function(e) {
450
+ n.setState({
451
+ anchor: e
452
+ });
453
+ j(n.props.elementRef, e);
454
+ }));
455
+ N(V(n), "handleTooltipOpen", (function() {
456
+ n.setState({
457
+ open: true
458
+ });
459
+ }));
460
+ N(V(n), "handleTooltipClose", (function() {
461
+ n.setState({
462
+ open: false
463
+ });
464
+ }));
465
+ N(V(n), "handleClick", (function(e) {
466
+ var t = n.props, r = t.active, i = t.tabId, o = t.tabKey, a = t.to;
467
+ var l = n.context.onClick;
468
+ // preserve the previous behaviour from 2ad8e7eaf47 to avoid firing unnecessary onChange events
469
+ // while preventing the "to" prop from incorrectly triggering <Clickable>'s providedOnClick on the active tab
470
+ if (!r) {
471
+ l === null || l === void 0 ? void 0 : l(e, {
472
+ tabId: i,
473
+ tabKey: o
474
+ });
475
+ }
476
+ if (a == null || a != null && r) {
477
+ e.preventDefault();
478
+ }
479
+ }));
480
+ N(V(n), "handleFocus", (function(e) {
481
+ n.handleTooltipOpen();
482
+ var t = n.props, r = t.tabId, i = t.tabKey;
483
+ var o = n.context.onFocus;
484
+ o === null || o === void 0 ? void 0 : o(e, {
485
+ tabId: r,
486
+ tabKey: i
487
+ });
488
+ }));
489
+ n.popoverId = (0, v.createDOMID)("popover");
490
+ n.ariaId = (0, v.createDOMID)("aria-id");
491
+ n.state = {
492
+ open: false,
493
+ anchor: null
494
+ };
495
+ return n;
496
+ }
497
+ R(r, [ {
498
+ key: "focus",
499
+ value: function e() {
500
+ var t;
501
+ (t = this.state.anchor) === null || t === void 0 ? void 0 : t.focus();
502
+ }
503
+ }, {
504
+ key: "render",
505
+ value: function e() {
506
+ var t = this.props, r = t.active, i = t.ariaControls, o = t.count, a = t.disabled, l = t.icon, c = t.label, s = t.tabId, p = t.maxCount, u = t.to, f = t.tooltip, v = _(t, [ "active", "ariaControls", "count", "disabled", "icon", "label", "tabId", "maxCount", "to", "tooltip" ]);
507
+ var h = this.state, y = h.anchor, S = h.open;
508
+ var C = this.context, j = C.appearance, T = C.disabled, E = C.iconSize, P = C.layout, $ = C.width;
509
+ var R = v.style;
510
+ var D = T || a || false;
511
+ var M = E || "inline";
512
+ var q = P || "horizontal";
513
+ var K = $ ? {
514
+ width: $
515
+ } : R;
516
+
517
+ // TODO: Fix the ts error: https://splunk.atlassian.net/browse/SUI-5569
518
+ // eslint-disable-next-line
519
+ // @ts-ignore-next-line
520
+ return n().createElement(m, z({
521
+ "aria-controls": i,
522
+ "aria-selected": r,
523
+ "aria-labelledby": this.ariaId,
524
+ "data-test": "tab",
525
+ "data-test-tab-id": s,
526
+ "data-test-popover-id": f ? this.popoverId : undefined,
527
+ $layout: q,
528
+ $icon: l && M !== "inline" ? true : undefined,
529
+ disabled: D,
530
+ elementRef: this.handleMount,
531
+ style: K
532
+ }, v, {
533
+ onClick: this.handleClick,
534
+ onFocus: this.handleFocus,
535
+ onMouseEnter: this.handleTooltipOpen,
536
+ onBlur: this.handleTooltipClose,
537
+ onMouseLeave: this.handleTooltipClose,
538
+ role: "tab",
539
+ tabIndex: r ? undefined : -1,
540
+ to: u
541
+ }), n().createElement(k, {
542
+ "data-test": "label",
543
+ $withUnderline: j === "navigation"
544
+ }, l && n().createElement(x, {
545
+ $iconSize: M
546
+ }, l), c, (o === 0 || o) && n().createElement(n().Fragment, null, n().createElement(b(), null, " "), n().createElement(w, {
547
+ "data-test": "count",
548
+ disabled: D
549
+ }, p ? I(o, p) : o))), n().createElement(g, {
550
+ $layout: q,
551
+ $withUnderline: j === "navigation"
552
+ }), !a && f && n().createElement(d(), {
553
+ role: "tooltip",
554
+ anchor: y,
555
+ animationConfig: {
556
+ tension: 400
557
+ },
558
+ appearance: "inverted",
559
+ closeReasons: [ "offScreen", "escapeKey" ],
560
+ defaultPlacement: q === "vertical" ? "right" : "above",
561
+ id: this.popoverId,
562
+ open: !!y && S,
563
+ align: "center"
564
+ }, n().createElement(O, null, f)), f && n().createElement(b(), {
565
+ "aria-hidden": "true",
566
+ id: this.ariaId
567
+ }, f));
568
+ }
569
+ } ]);
570
+ return r;
571
+ }(r.Component);
572
+ N(U, "propTypes", W);
573
+ N(U, "defaultProps", F);
574
+ N(U, "contextType", C);
575
+ /* harmony default export */ const L = U;
576
+ // CONCATENATED MODULE: ./src/utils/navigateList.ts
577
+ // A utility for keyboard navigation of lists
578
+ function Y(e, t, r) {
579
+ for (var n = 0; n < e.length; n += 1) {
580
+ var i;
581
+ var o = (n + r) % e.length;
582
+ if (((i = e[o].current) === null || i === void 0 ? void 0 : i.props.disabled) !== true) {
583
+ return e[o];
584
+ }
585
+ }
586
+ return e[t];
719
587
  }
720
-
721
- if (tabToFocusRef != null) {
722
- var _tabToFocusRef$curren;
723
-
724
- (_tabToFocusRef$curren = tabToFocusRef.current) === null || _tabToFocusRef$curren === void 0 ? void 0 : _tabToFocusRef$curren.focus();
725
- e.preventDefault();
588
+ function G(e, t, r) {
589
+ for (var n = e.length; n > 0; n -= 1) {
590
+ var i;
591
+ var o = (n + r) % e.length;
592
+ if (((i = e[o].current) === null || i === void 0 ? void 0 : i.props.disabled) !== true) {
593
+ return e[o];
594
+ }
595
+ }
596
+ return e[t];
726
597
  }
727
- };
728
-
729
- return /*#__PURE__*/external_react_default.a.createElement(Styled, TabBar_extends({
730
- "data-tab-layout": layout,
731
- "data-test-active-tab-id": activeTabId,
732
- "data-test": "tab-bar",
733
- role: "tablist",
734
- ref: elementRef,
735
- $layout: layout,
736
- $withUnderline: appearance === 'navigation',
737
- onKeyDown: handleOnKeyDown
738
- }, otherProps), /*#__PURE__*/external_react_default.a.createElement(TabBar_TabBarContext.Provider, {
739
- value: {
740
- appearance: appearance,
741
- disabled: disabled,
742
- iconSize: iconSize,
743
- layout: layout,
744
- onClick: tabOnClick,
745
- onFocus: tabOnFocus,
746
- width: widthContext
598
+ // CONCATENATED MODULE: ./src/TabBar/TabBar.tsx
599
+ function H() {
600
+ H = Object.assign || function(e) {
601
+ for (var t = 1; t < arguments.length; t++) {
602
+ var r = arguments[t];
603
+ for (var n in r) {
604
+ if (Object.prototype.hasOwnProperty.call(r, n)) {
605
+ e[n] = r[n];
606
+ }
607
+ }
608
+ }
609
+ return e;
610
+ };
611
+ return H.apply(this, arguments);
747
612
  }
748
- }, clonedChildren));
749
- }
750
-
751
- TabBar.propTypes = TabBar_propTypes;
752
- TabBar.Tab = TabBar_Tab;
753
- /* harmony default export */ var TabBar_TabBar = (TabBar);
754
-
755
- // CONCATENATED MODULE: ./src/TabBar/index.ts
756
-
757
-
758
-
759
- /***/ }),
760
-
761
- /***/ 2:
762
- /***/ (function(module, exports) {
763
-
764
- module.exports = require("react");
765
-
766
- /***/ }),
767
-
768
- /***/ 21:
769
- /***/ (function(module, exports) {
770
-
771
- module.exports = require("@splunk/react-ui/Popover");
772
-
773
- /***/ }),
774
-
775
- /***/ 3:
776
- /***/ (function(module, exports) {
777
-
778
- module.exports = require("styled-components");
779
-
780
- /***/ }),
781
-
782
- /***/ 60:
783
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
784
-
785
- "use strict";
786
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getNextListItem; });
787
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getPrevListItem; });
788
- // A utility for keyboard navigation of lists
789
- function getNextListItem(refs, currentIndex, nextIndex) {
790
- for (var i = 0; i < refs.length; i += 1) {
791
- var _refs$pointer$current;
792
-
793
- var pointer = (i + nextIndex) % refs.length;
794
-
795
- if (((_refs$pointer$current = refs[pointer].current) === null || _refs$pointer$current === void 0 ? void 0 : _refs$pointer$current.props.disabled) !== true) {
796
- return refs[pointer];
613
+ function J(e, t) {
614
+ if (e == null) return {};
615
+ var r = Q(e, t);
616
+ var n, i;
617
+ if (Object.getOwnPropertySymbols) {
618
+ var o = Object.getOwnPropertySymbols(e);
619
+ for (i = 0; i < o.length; i++) {
620
+ n = o[i];
621
+ if (t.indexOf(n) >= 0) continue;
622
+ if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
623
+ r[n] = e[n];
624
+ }
625
+ }
626
+ return r;
797
627
  }
798
- }
799
-
800
- return refs[currentIndex];
801
- }
802
-
803
- function getPrevListItem(refs, currentIndex, prevIndex) {
804
- for (var i = refs.length; i > 0; i -= 1) {
805
- var _refs$pointer$current2;
806
-
807
- var pointer = (i + prevIndex) % refs.length;
808
-
809
- if (((_refs$pointer$current2 = refs[pointer].current) === null || _refs$pointer$current2 === void 0 ? void 0 : _refs$pointer$current2.props.disabled) !== true) {
810
- return refs[pointer];
628
+ function Q(e, t) {
629
+ if (e == null) return {};
630
+ var r = {};
631
+ var n = Object.keys(e);
632
+ var i, o;
633
+ for (o = 0; o < n.length; o++) {
634
+ i = n[o];
635
+ if (t.indexOf(i) >= 0) continue;
636
+ r[i] = e[i];
637
+ }
638
+ return r;
639
+ }
640
+ var X = 50;
641
+ /** @public */ var Z = {
642
+ autoActivate: o().bool,
643
+ activeTabId: o().string,
644
+ appearance: o().oneOf([ "navigation", "context" ]),
645
+ children: o().node,
646
+ /** @private */
647
+ disabled: o().bool,
648
+ elementRef: o().oneOfType([ o().func, o().object ]),
649
+ iconSize: o().oneOf([ "inline", "small", "large" ]),
650
+ layout: o().oneOf([ "horizontal", "vertical" ]),
651
+ onChange: o().func,
652
+ tabWidth: o().number
653
+ };
654
+ function ee(e) {
655
+ var t = e.activeTabId, i = e.autoActivate, o = e.appearance, l = o === void 0 ? "navigation" : o, c = e.children, s = e.disabled, u = s === void 0 ? false : s, d = e.elementRef, f = e.iconSize, b = f === void 0 ? "inline" : f, v = e.layout, h = v === void 0 ? "horizontal" : v, y = e.onChange, m = e.tabWidth, g = J(e, [ "activeTabId", "autoActivate", "appearance", "children", "disabled", "elementRef", "iconSize", "layout", "onChange", "tabWidth" ]);
656
+ // @docs-props-type TabBarPropsBase
657
+ var x = (0, r.useRef)(0);
658
+ var k = [];
659
+ var w = (0, r.useMemo)((function() {
660
+ return h === "vertical" ? "down" : "right";
661
+ }), [ h ]);
662
+ var O = (0, r.useMemo)((function() {
663
+ return h === "vertical" ? "up" : "left";
664
+ }), [ h ]);
665
+ var S = function e(t, r) {
666
+ var n = r.tabKey;
667
+ if (n != null) {
668
+ x.current = n;
669
+ }
670
+ if (i) {
671
+ y === null || y === void 0 ? void 0 : y(t, {
672
+ selectedTabId: r.tabId
673
+ });
674
+ }
675
+ };
676
+ var I = function e(t, r) {
677
+ y === null || y === void 0 ? void 0 : y(t, {
678
+ selectedTabId: r.tabId
679
+ });
680
+ };
681
+ var j = 0;
682
+ var T = r.Children.toArray(c).filter(r.isValidElement).map((function(e) {
683
+ // <TabBar> allows non-<Tab> children, pass them through without any modification
684
+ if (typeof e.type === "string" || e.type.name !== L.name) {
685
+ return e;
686
+ }
687
+ var i = n().createRef();
688
+ k.push(i);
689
+ var o = {
690
+ active: t === e.props.tabId,
691
+ tabKey: j,
692
+ ref: i
693
+ };
694
+ j += 1;
695
+
696
+ return (0, r.cloneElement)(e, o);
697
+ }));
698
+ var z = m && m > X ? m : null;
699
+ var _ = function e(t) {
700
+ var r = (0, a.keycode)(t.nativeEvent);
701
+ var n;
702
+ if (r === w) {
703
+ n = Y(k, x.current, x.current + 1);
704
+ } else if (r === O) {
705
+ n = G(k, x.current, x.current - 1);
706
+ } else if (r === "home") {
707
+ n = Y(k, x.current, 0);
708
+ } else if (r === "end") {
709
+ n = G(k, x.current, k.length - 1);
710
+ }
711
+ if (n != null) {
712
+ var i;
713
+ (i = n.current) === null || i === void 0 ? void 0 : i.focus();
714
+ t.preventDefault();
715
+ }
716
+ };
717
+
718
+ return n().createElement(p, H({
719
+ "data-tab-layout": h,
720
+ "data-test-active-tab-id": t,
721
+ "data-test": "tab-bar",
722
+ role: "tablist",
723
+ ref: d,
724
+ $layout: h,
725
+ $withUnderline: l === "navigation",
726
+ onKeyDown: _
727
+ }, g), n().createElement(C.Provider, {
728
+ value: {
729
+ appearance: l,
730
+ disabled: u,
731
+ iconSize: b,
732
+ layout: h,
733
+ onClick: I,
734
+ onFocus: S,
735
+ width: z
736
+ }
737
+ }, T));
811
738
  }
812
- }
813
-
814
- return refs[currentIndex];
815
- }
816
-
817
-
818
-
819
- /***/ }),
820
-
821
- /***/ 7:
822
- /***/ (function(module, exports) {
823
-
824
- module.exports = require("@splunk/ui-utils/keyboard");
825
-
826
- /***/ }),
827
-
828
- /***/ 8:
829
- /***/ (function(module, exports) {
830
-
831
- module.exports = require("@splunk/ui-utils/id");
832
-
833
- /***/ })
834
-
835
- /******/ });
739
+ ee.propTypes = Z;
740
+ ee.Tab = L;
741
+ /* harmony default export */ const te = ee;
742
+ // CONCATENATED MODULE: ./src/TabBar/index.ts
743
+ module.exports = t;
744
+ /******/})();