@splunk/react-ui 4.21.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 (83) 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 +7 -2
  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 +1808 -2084
  18. package/Code.js.LICENSE.txt +8 -0
  19. package/CollapsiblePanel.js +586 -519
  20. package/Color.js +1066 -1069
  21. package/ColumnLayout.js +402 -363
  22. package/ComboBox.js +891 -794
  23. package/Concertina.js +997 -802
  24. package/ControlGroup.js +687 -594
  25. package/Date.js +567 -547
  26. package/DefinitionList.js +308 -234
  27. package/Divider.js +149 -118
  28. package/Dropdown.js +459 -416
  29. package/DualListbox.js +1479 -1541
  30. package/EventListener.js +94 -97
  31. package/File.js +1051 -969
  32. package/FormRows.js +883 -696
  33. package/Heading.js +216 -193
  34. package/Image.js +446 -402
  35. package/JSONTree.js +690 -551
  36. package/Layer.js +437 -410
  37. package/Link.js +336 -255
  38. package/List.js +213 -161
  39. package/Markdown.js +509 -487
  40. package/Menu.js +1105 -1056
  41. package/Message.js +475 -441
  42. package/MessageBar.js +387 -373
  43. package/Modal.js +810 -634
  44. package/ModalLayer.js +326 -243
  45. package/Monogram.js +308 -276
  46. package/Multiselect.js +3550 -3364
  47. package/Number.js +729 -687
  48. package/Paginator.js +510 -449
  49. package/Paragraph.js +145 -112
  50. package/Popover.js +1459 -1432
  51. package/Progress.js +301 -246
  52. package/RadioBar.js +610 -527
  53. package/RadioList.js +483 -444
  54. package/Resize.js +530 -489
  55. package/ResultsMenu.js +494 -455
  56. package/ScreenReaderContent.js +142 -111
  57. package/Scroll.js +595 -456
  58. package/ScrollContainerContext.js +197 -206
  59. package/Search.js +744 -650
  60. package/Select.js +2442 -2345
  61. package/SidePanel.js +390 -284
  62. package/Slider.js +669 -676
  63. package/SlidingPanels.js +639 -503
  64. package/SplitButton.js +464 -367
  65. package/StaticContent.js +161 -133
  66. package/StepBar.js +386 -358
  67. package/Switch.js +710 -640
  68. package/TabBar.js +726 -680
  69. package/TabLayout.js +406 -322
  70. package/Table.js +4842 -4616
  71. package/Text.js +1170 -1138
  72. package/TextArea.js +1102 -1090
  73. package/Tooltip.js +624 -581
  74. package/TransitionOpen.js +489 -422
  75. package/Typography.js +176 -153
  76. package/WaitSpinner.js +230 -206
  77. package/package.json +5 -5
  78. package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
  79. package/types/src/JSONTree/TreeNode.d.ts +5 -0
  80. package/useForceUpdate.js +112 -82
  81. package/useKeyPress.js +74 -71
  82. package/usePrevious.js +65 -65
  83. package/useRovingFocus.js +122 -138
package/TabLayout.js CHANGED
@@ -1,329 +1,413 @@
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
- Panel: () => (/* reexport */ TabLayout_Panel),
55
- "default": () => (/* reexport */ TabLayout_TabLayout)
56
- });
57
-
58
- ;// CONCATENATED MODULE: external "react"
59
- const external_react_namespaceObject = require("react");
60
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_namespaceObject);
61
- ;// CONCATENATED MODULE: external "prop-types"
62
- const external_prop_types_namespaceObject = require("prop-types");
63
- var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_namespaceObject);
64
- ;// CONCATENATED MODULE: external "lodash/has"
65
- const has_namespaceObject = require("lodash/has");
66
- var has_default = /*#__PURE__*/__webpack_require__.n(has_namespaceObject);
67
- ;// CONCATENATED MODULE: external "lodash/keys"
68
- const keys_namespaceObject = require("lodash/keys");
69
- var keys_default = /*#__PURE__*/__webpack_require__.n(keys_namespaceObject);
70
- ;// CONCATENATED MODULE: external "lodash/omit"
71
- const omit_namespaceObject = require("lodash/omit");
72
- var omit_default = /*#__PURE__*/__webpack_require__.n(omit_namespaceObject);
73
- ;// CONCATENATED MODULE: external "@splunk/ui-utils/id"
74
- const id_namespaceObject = require("@splunk/ui-utils/id");
75
- ;// CONCATENATED MODULE: external "@splunk/react-ui/TabBar"
76
- const TabBar_namespaceObject = require("@splunk/react-ui/TabBar");
77
- var TabBar_default = /*#__PURE__*/__webpack_require__.n(TabBar_namespaceObject);
78
- ;// CONCATENATED MODULE: external "styled-components"
79
- const external_styled_components_namespaceObject = require("styled-components");
80
- var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_namespaceObject);
81
- ;// CONCATENATED MODULE: external "@splunk/themes"
82
- const themes_namespaceObject = require("@splunk/themes");
83
- ;// CONCATENATED MODULE: ./src/TabLayout/TabLayoutStyles.ts
84
-
85
-
86
- var StyledPanel = external_styled_components_default().div.withConfig({
87
- displayName: "TabLayoutStyles__StyledPanel",
88
- componentId: "lf0quy-0"
89
- })(["", ""], themes_namespaceObject.mixins.reset('block'));
90
- var Styled = external_styled_components_default().div.withConfig({
91
- displayName: "TabLayoutStyles__Styled",
92
- componentId: "lf0quy-1"
93
- })(["text-align:center;margin-top:", ";", ""], themes_namespaceObject.variables.spacingLarge, function (_ref) {
94
- var $layout = _ref.$layout;
95
- return $layout === 'vertical' && (0,external_styled_components_namespaceObject.css)(["display:flex;& > [role='tablist']{flex:0 0 auto;}& > ", "{width:100%;}"],
96
- /* sc-sel */
97
- StyledPanel);
98
- });
99
-
100
- ;// CONCATENATED MODULE: ./src/TabLayout/Panel.tsx
101
- 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); }
102
-
103
- 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; }
104
-
105
- 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; }
106
-
107
-
108
-
109
-
110
-
111
- var propTypes = {
112
- children: (external_prop_types_default()).node,
113
- count: (external_prop_types_default()).number,
114
- disabled: (external_prop_types_default()).bool,
115
- elementRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
116
- icon: (external_prop_types_default()).node,
117
- label: external_prop_types_default().oneOfType([(external_prop_types_default()).string, (external_prop_types_default()).element]),
118
- panelId: (external_prop_types_default()).string.isRequired,
119
- tooltip: (external_prop_types_default()).node
120
- };
121
-
122
- function Panel(_ref) {
123
- var children = _ref.children,
124
- _ref$disabled = _ref.disabled,
125
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
126
- elementRef = _ref.elementRef,
127
- panelId = _ref.panelId,
128
- otherProps = _objectWithoutProperties(_ref, ["children", "disabled", "elementRef", "panelId"]);
129
-
130
- // @docs-props-type PanelPropsBase
131
- return /*#__PURE__*/external_react_default().createElement(StyledPanel, _extends({
132
- "data-test-panel-id": panelId,
133
- "data-test": "panel",
134
- ref: elementRef,
135
- role: "tabpanel"
136
- }, omit_default()(otherProps, ['icon', 'label', 'tooltip'])), children);
137
- }
138
-
139
- Panel.propTypes = propTypes;
140
- /* harmony default export */ const TabLayout_Panel = (Panel);
141
- ;// CONCATENATED MODULE: ./src/TabLayout/TabLayout.tsx
142
- 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); }
143
-
144
- function TabLayout_extends() { TabLayout_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 TabLayout_extends.apply(this, arguments); }
145
-
146
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
147
-
148
- 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); } }
149
-
150
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
151
-
152
- 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); }
153
-
154
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
155
-
156
- 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); }; }
157
-
158
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
159
-
160
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
161
-
162
- 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; } }
163
-
164
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
165
-
166
- 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; }
167
-
168
-
169
-
170
-
171
-
172
-
173
-
174
-
175
-
176
-
177
- var TabLayout_propTypes = {
178
- autoActivate: (external_prop_types_default()).bool,
179
- activePanelId: (external_prop_types_default()).string,
180
- appearance: external_prop_types_default().oneOf(['navigation', 'context']),
181
- children: (external_prop_types_default()).node,
182
- count: (external_prop_types_default()).number,
183
- defaultActivePanelId: (external_prop_types_default()).string,
184
- elementRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
185
- iconSize: external_prop_types_default().oneOf(['inline', 'small', 'large']),
186
- layout: external_prop_types_default().oneOf(['horizontal', 'vertical']),
187
- onChange: (external_prop_types_default()).func,
188
- tabWidth: (external_prop_types_default()).number
189
- };
190
- var defaultProps = {
191
- appearance: 'navigation',
192
- iconSize: 'inline',
193
- layout: 'horizontal'
194
- };
195
-
196
- /**
197
- * The `TabLayout` is a group of managed `Panels`. Only one panel can be open at a time.
198
- * `TabLayout` supports both the controlled and uncontrolled patterns.
199
- */
200
- var TabLayout = /*#__PURE__*/function (_Component) {
201
- _inherits(TabLayout, _Component);
202
-
203
- var _super = _createSuper(TabLayout);
204
-
205
- // @docs-props-type TabLayoutPropsBase
206
- function TabLayout(props) {
207
- var _this;
208
-
209
- _classCallCheck(this, TabLayout);
210
-
211
- _this = _super.call(this, props);
212
-
213
- _defineProperty(_assertThisInitialized(_this), "controlledExternally", void 0);
214
-
215
- _defineProperty(_assertThisInitialized(_this), "guid", void 0);
216
-
217
- _defineProperty(_assertThisInitialized(_this), "handleChange", function (e, data) {
218
- var _this$props$onChange, _this$props;
219
-
220
- var activePanelId = data.selectedTabId;
221
-
222
- if (!_this.isControlled()) {
223
- _this.setState({
224
- activePanelId: activePanelId
225
- });
226
- }
227
-
228
- (_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, e, {
229
- activePanelId: activePanelId
230
- });
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 n = t && t.__esModule ?
13
+ /******/ () => t["default"]
14
+ /******/ : () => t
15
+ /******/;
16
+ e.d(n, {
17
+ a: n
18
+ });
19
+ /******/ return n;
20
+ /******/ };
21
+ /******/ })();
22
+ /******/
23
+ /******/ /* webpack/runtime/define property getters */
24
+ /******/ (() => {
25
+ /******/ // define getter functions for harmony exports
26
+ /******/ e.d = (t, n) => {
27
+ /******/ for (var r in n) {
28
+ /******/ if (e.o(n, r) && !e.o(t, r)) {
29
+ /******/ Object.defineProperty(t, r, {
30
+ enumerable: true,
31
+ get: n[r]
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
+ Panel: () => /* reexport */ w,
65
+ default: () => /* reexport */ B
231
66
  });
232
-
233
- _this.controlledExternally = has_default()(props, 'activePanelId');
234
- _this.guid = (0,id_namespaceObject.createDOMID)();
235
-
236
- if (!_this.isControlled()) {
237
- _this.state = {
238
- activePanelId: props.defaultActivePanelId
239
- };
67
+ // CONCATENATED MODULE: external "react"
68
+ const n = require("react");
69
+ var r = e.n(n);
70
+ // CONCATENATED MODULE: external "prop-types"
71
+ const o = require("prop-types");
72
+ var a = e.n(o);
73
+ // CONCATENATED MODULE: external "lodash/has"
74
+ const i = require("lodash/has");
75
+ var l = e.n(i);
76
+ // CONCATENATED MODULE: external "lodash/keys"
77
+ const c = require("lodash/keys");
78
+ var u = e.n(c);
79
+ // CONCATENATED MODULE: external "lodash/omit"
80
+ const f = require("lodash/omit");
81
+ var s = e.n(f);
82
+ // CONCATENATED MODULE: external "@splunk/ui-utils/id"
83
+ const p = require("@splunk/ui-utils/id");
84
+ // CONCATENATED MODULE: external "@splunk/react-ui/TabBar"
85
+ const d = require("@splunk/react-ui/TabBar");
86
+ var y = e.n(d);
87
+ // CONCATENATED MODULE: external "styled-components"
88
+ const v = require("styled-components");
89
+ var b = e.n(v);
90
+ // CONCATENATED MODULE: external "@splunk/themes"
91
+ const h = require("@splunk/themes");
92
+ // CONCATENATED MODULE: ./src/TabLayout/TabLayoutStyles.ts
93
+ var m = b().div.withConfig({
94
+ displayName: "TabLayoutStyles__StyledPanel",
95
+ componentId: "lf0quy-0"
96
+ })([ "", "" ], h.mixins.reset("block"));
97
+ var g = b().div.withConfig({
98
+ displayName: "TabLayoutStyles__Styled",
99
+ componentId: "lf0quy-1"
100
+ })([ "text-align:center;margin-top:", ";", "" ], h.variables.spacingLarge, (function(e) {
101
+ var t = e.$layout;
102
+ return t === "vertical" && (0, v.css)([ "display:flex;& > [role='tablist']{flex:0 0 auto;}& > ", "{width:100%;}" ],
103
+ /* sc-sel */
104
+ m);
105
+ }));
106
+ // CONCATENATED MODULE: ./src/TabLayout/Panel.tsx
107
+ function O() {
108
+ O = Object.assign || function(e) {
109
+ for (var t = 1; t < arguments.length; t++) {
110
+ var n = arguments[t];
111
+ for (var r in n) {
112
+ if (Object.prototype.hasOwnProperty.call(n, r)) {
113
+ e[r] = n[r];
114
+ }
115
+ }
116
+ }
117
+ return e;
118
+ };
119
+ return O.apply(this, arguments);
120
+ }
121
+ function P(e, t) {
122
+ if (e == null) return {};
123
+ var n = I(e, t);
124
+ var r, o;
125
+ if (Object.getOwnPropertySymbols) {
126
+ var a = Object.getOwnPropertySymbols(e);
127
+ for (o = 0; o < a.length; o++) {
128
+ r = a[o];
129
+ if (t.indexOf(r) >= 0) continue;
130
+ if (!Object.prototype.propertyIsEnumerable.call(e, r)) continue;
131
+ n[r] = e[r];
132
+ }
133
+ }
134
+ return n;
135
+ }
136
+ function I(e, t) {
137
+ if (e == null) return {};
138
+ var n = {};
139
+ var r = Object.keys(e);
140
+ var o, a;
141
+ for (a = 0; a < r.length; a++) {
142
+ o = r[a];
143
+ if (t.indexOf(o) >= 0) continue;
144
+ n[o] = e[o];
145
+ }
146
+ return n;
240
147
  }
241
-
242
- if (false) {}
243
-
244
- return _this;
245
- }
246
-
247
- _createClass(TabLayout, [{
248
- key: "componentDidUpdate",
249
- value: function componentDidUpdate(prevProps) {
250
- if (false) {}
251
-
252
- if (false) {}
148
+ var S = {
149
+ children: a().node,
150
+ count: a().number,
151
+ disabled: a().bool,
152
+ elementRef: a().oneOfType([ a().func, a().object ]),
153
+ icon: a().node,
154
+ label: a().oneOfType([ a().string, a().element ]),
155
+ panelId: a().string.isRequired,
156
+ tooltip: a().node
157
+ };
158
+ function j(e) {
159
+ var t = e.children, n = e.disabled, o = n === void 0 ? false : n, a = e.elementRef, i = e.panelId, l = P(e, [ "children", "disabled", "elementRef", "panelId" ]);
160
+ // @docs-props-type PanelPropsBase
161
+
162
+ return r().createElement(m, O({
163
+ "data-test-panel-id": i,
164
+ "data-test": "panel",
165
+ ref: a,
166
+ role: "tabpanel"
167
+ }, s()(l, [ "icon", "label", "tooltip" ])), t);
168
+ }
169
+ j.propTypes = S;
170
+ /* harmony default export */ const w = j;
171
+ // CONCATENATED MODULE: ./src/TabLayout/TabLayout.tsx
172
+ function T(e) {
173
+ "@babel/helpers - typeof";
174
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
175
+ T = function e(t) {
176
+ return typeof t;
177
+ };
178
+ } else {
179
+ T = function e(t) {
180
+ return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
181
+ };
182
+ }
183
+ return T(e);
184
+ }
185
+ function _() {
186
+ _ = Object.assign || function(e) {
187
+ for (var t = 1; t < arguments.length; t++) {
188
+ var n = arguments[t];
189
+ for (var r in n) {
190
+ if (Object.prototype.hasOwnProperty.call(n, r)) {
191
+ e[r] = n[r];
192
+ }
193
+ }
194
+ }
195
+ return e;
196
+ };
197
+ return _.apply(this, arguments);
198
+ }
199
+ function C(e, t) {
200
+ if (!(e instanceof t)) {
201
+ throw new TypeError("Cannot call a class as a function");
202
+ }
203
+ }
204
+ function x(e, t) {
205
+ for (var n = 0; n < t.length; n++) {
206
+ var r = t[n];
207
+ r.enumerable = r.enumerable || false;
208
+ r.configurable = true;
209
+ if ("value" in r) r.writable = true;
210
+ Object.defineProperty(e, r.key, r);
211
+ }
253
212
  }
254
- }, {
255
- key: "isControlled",
256
- value: function isControlled() {
257
- return this.controlledExternally;
213
+ function E(e, t, n) {
214
+ if (t) x(e.prototype, t);
215
+ if (n) x(e, n);
216
+ return e;
258
217
  }
259
- }, {
260
- key: "render",
261
- value: function render() {
262
- var _this2 = this;
263
-
264
- var _this$props2 = this.props,
265
- children = _this$props2.children,
266
- layout = _this$props2.layout;
267
- var activePanelId = this.isControlled() ? this.props.activePanelId : this.state.activePanelId;
268
- var panel;
269
- var tabs = external_react_namespaceObject.Children.toArray(children).filter(external_react_namespaceObject.isValidElement).map(function (child) {
270
- var props = child.props;
271
- var id = "".concat(_this2.guid, "-").concat(props.panelId);
272
- var tabId = "".concat(_this2.guid, "-").concat(props.panelId, "-tab");
273
-
274
- if (props.panelId === activePanelId) {
275
- panel = /*#__PURE__*/(0,external_react_namespaceObject.cloneElement)(child, {
276
- 'aria-labelledby': tabId,
277
- id: id
278
- });
218
+ function q(e, t) {
219
+ if (typeof t !== "function" && t !== null) {
220
+ throw new TypeError("Super expression must either be null or a function");
279
221
  }
280
-
281
- return /*#__PURE__*/external_react_default().createElement((TabBar_default()).Tab, {
282
- count: props.count,
283
- icon: props.icon,
284
- key: props.panelId,
285
- label: props.label,
286
- tabId: props.panelId,
287
- id: tabId,
288
- ariaControls: id,
289
- tooltip: props.tooltip,
290
- disabled: props.disabled
222
+ e.prototype = Object.create(t && t.prototype, {
223
+ constructor: {
224
+ value: e,
225
+ writable: true,
226
+ configurable: true
227
+ }
291
228
  });
292
- });
293
-
294
- if (false) {}
295
-
296
- return /*#__PURE__*/external_react_default().createElement(Styled, TabLayout_extends({
297
- "data-test-active-panel-id": activePanelId,
298
- "data-test": "tab-layout",
299
- ref: this.props.elementRef,
300
- $layout: layout
301
- }, omit_default()(this.props, keys_default()(TabLayout.propTypes))), /*#__PURE__*/external_react_default().createElement((TabBar_default()), {
302
- autoActivate: this.props.autoActivate,
303
- activeTabId: activePanelId,
304
- appearance: this.props.appearance,
305
- iconSize: this.props.iconSize,
306
- layout: this.props.layout,
307
- onChange: this.handleChange,
308
- tabWidth: this.props.tabWidth
309
- }, tabs), panel);
229
+ if (t) R(e, t);
310
230
  }
311
- }]);
312
-
313
- return TabLayout;
314
- }(external_react_namespaceObject.Component);
315
-
316
- _defineProperty(TabLayout, "propTypes", TabLayout_propTypes);
317
-
318
- _defineProperty(TabLayout, "defaultProps", defaultProps);
319
-
320
- _defineProperty(TabLayout, "Panel", TabLayout_Panel);
321
-
322
- /* harmony default export */ const TabLayout_TabLayout = (TabLayout);
323
-
324
- ;// CONCATENATED MODULE: ./src/TabLayout/index.ts
325
-
326
-
327
- module.exports = __webpack_exports__;
328
- /******/ })()
329
- ;
231
+ function R(e, t) {
232
+ R = Object.setPrototypeOf || function e(t, n) {
233
+ t.__proto__ = n;
234
+ return t;
235
+ };
236
+ return R(e, t);
237
+ }
238
+ function k(e) {
239
+ var t = D();
240
+ return function n() {
241
+ var r = M(e), o;
242
+ if (t) {
243
+ var a = M(this).constructor;
244
+ o = Reflect.construct(r, arguments, a);
245
+ } else {
246
+ o = r.apply(this, arguments);
247
+ }
248
+ return z(this, o);
249
+ };
250
+ }
251
+ function z(e, t) {
252
+ if (t && (T(t) === "object" || typeof t === "function")) {
253
+ return t;
254
+ }
255
+ return A(e);
256
+ }
257
+ function A(e) {
258
+ if (e === void 0) {
259
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
260
+ }
261
+ return e;
262
+ }
263
+ function D() {
264
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
265
+ if (Reflect.construct.sham) return false;
266
+ if (typeof Proxy === "function") return true;
267
+ try {
268
+ Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
269
+ return true;
270
+ } catch (e) {
271
+ return false;
272
+ }
273
+ }
274
+ function M(e) {
275
+ M = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
276
+ return t.__proto__ || Object.getPrototypeOf(t);
277
+ };
278
+ return M(e);
279
+ }
280
+ function L(e, t, n) {
281
+ if (t in e) {
282
+ Object.defineProperty(e, t, {
283
+ value: n,
284
+ enumerable: true,
285
+ configurable: true,
286
+ writable: true
287
+ });
288
+ } else {
289
+ e[t] = n;
290
+ }
291
+ return e;
292
+ }
293
+ var W = {
294
+ autoActivate: a().bool,
295
+ activePanelId: a().string,
296
+ appearance: a().oneOf([ "navigation", "context" ]),
297
+ children: a().node,
298
+ count: a().number,
299
+ defaultActivePanelId: a().string,
300
+ elementRef: a().oneOfType([ a().func, a().object ]),
301
+ iconSize: a().oneOf([ "inline", "small", "large" ]),
302
+ layout: a().oneOf([ "horizontal", "vertical" ]),
303
+ onChange: a().func,
304
+ tabWidth: a().number
305
+ };
306
+ var N = {
307
+ appearance: "navigation",
308
+ iconSize: "inline",
309
+ layout: "horizontal"
310
+ };
311
+ /**
312
+ * The `TabLayout` is a group of managed `Panels`. Only one panel can be open at a time.
313
+ * `TabLayout` supports both the controlled and uncontrolled patterns.
314
+ */ var $ = function(e) {
315
+ q(o, e);
316
+ var t = k(o);
317
+ // @docs-props-type TabLayoutPropsBase
318
+ function o(e) {
319
+ var n;
320
+ C(this, o);
321
+ n = t.call(this, e);
322
+ L(A(n), "controlledExternally", void 0);
323
+ L(A(n), "guid", void 0);
324
+ L(A(n), "handleChange", (function(e, t) {
325
+ var r, o;
326
+ var a = t.selectedTabId;
327
+ if (!n.isControlled()) {
328
+ n.setState({
329
+ activePanelId: a
330
+ });
331
+ }
332
+ (r = (o = n.props).onChange) === null || r === void 0 ? void 0 : r.call(o, e, {
333
+ activePanelId: a
334
+ });
335
+ }));
336
+ n.controlledExternally = l()(e, "activePanelId");
337
+ n.guid = (0, p.createDOMID)();
338
+ if (!n.isControlled()) {
339
+ n.state = {
340
+ activePanelId: e.defaultActivePanelId
341
+ };
342
+ }
343
+ if (false) {}
344
+ return n;
345
+ }
346
+ E(o, [ {
347
+ key: "componentDidUpdate",
348
+ value: function e(t) {
349
+ if (false) {}
350
+ if (false) {}
351
+ }
352
+ }, {
353
+ key: "isControlled",
354
+ value: function e() {
355
+ return this.controlledExternally;
356
+ }
357
+ }, {
358
+ key: "render",
359
+ value: function e() {
360
+ var t = this;
361
+ var a = this.props, i = a.children, l = a.layout;
362
+ var c = this.isControlled() ? this.props.activePanelId : this.state.activePanelId;
363
+ var f;
364
+ var p = n.Children.toArray(i).filter(n.isValidElement).map((function(e) {
365
+ var o = e.props;
366
+ var a = "".concat(t.guid, "-").concat(o.panelId);
367
+ var i = "".concat(t.guid, "-").concat(o.panelId, "-tab");
368
+ if (o.panelId === c) {
369
+ f = (0, n.cloneElement)(e, {
370
+ "aria-labelledby": i,
371
+ id: a
372
+ });
373
+ }
374
+
375
+ return r().createElement(y().Tab, {
376
+ count: o.count,
377
+ icon: o.icon,
378
+ key: o.panelId,
379
+ label: o.label,
380
+ tabId: o.panelId,
381
+ id: i,
382
+ ariaControls: a,
383
+ tooltip: o.tooltip,
384
+ disabled: o.disabled
385
+ });
386
+ }));
387
+ if (false) {}
388
+
389
+ return r().createElement(g, _({
390
+ "data-test-active-panel-id": c,
391
+ "data-test": "tab-layout",
392
+ ref: this.props.elementRef,
393
+ $layout: l
394
+ }, s()(this.props, u()(o.propTypes))), r().createElement(y(), {
395
+ autoActivate: this.props.autoActivate,
396
+ activeTabId: c,
397
+ appearance: this.props.appearance,
398
+ iconSize: this.props.iconSize,
399
+ layout: this.props.layout,
400
+ onChange: this.handleChange,
401
+ tabWidth: this.props.tabWidth
402
+ }, p), f);
403
+ }
404
+ } ]);
405
+ return o;
406
+ }(n.Component);
407
+ L($, "propTypes", W);
408
+ L($, "defaultProps", N);
409
+ L($, "Panel", w);
410
+ /* harmony default export */ const B = $;
411
+ // CONCATENATED MODULE: ./src/TabLayout/index.ts
412
+ module.exports = t;
413
+ /******/})();