@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/Modal.js CHANGED
@@ -1,805 +1,817 @@
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 = 175);
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
- /***/ 104:
105
- /***/ (function(module, exports) {
106
-
107
- module.exports = require("@splunk/react-ui/ModalLayer");
108
-
109
- /***/ }),
110
-
111
- /***/ 113:
112
- /***/ (function(module, exports) {
113
-
114
- module.exports = require("@splunk/react-ui/Divider");
115
-
116
- /***/ }),
117
-
118
- /***/ 175:
119
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
120
-
121
- "use strict";
122
- // ESM COMPAT FLAG
123
- __webpack_require__.r(__webpack_exports__);
124
-
125
- // EXPORTS
126
- __webpack_require__.d(__webpack_exports__, "default", function() { return /* reexport */ src_Modal_Modal; });
127
- __webpack_require__.d(__webpack_exports__, "Body", function() { return /* reexport */ Modal_Body; });
128
- __webpack_require__.d(__webpack_exports__, "Header", function() { return /* reexport */ Modal_Header; });
129
- __webpack_require__.d(__webpack_exports__, "Footer", function() { return /* reexport */ Modal_Footer; });
130
-
131
- // EXTERNAL MODULE: external "react"
132
- var external_react_ = __webpack_require__(2);
133
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
134
-
135
- // EXTERNAL MODULE: external "prop-types"
136
- var external_prop_types_ = __webpack_require__(1);
137
- var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
138
-
139
- // EXTERNAL MODULE: external "lodash/defer"
140
- var defer_ = __webpack_require__(58);
141
- var defer_default = /*#__PURE__*/__webpack_require__.n(defer_);
142
-
143
- // EXTERNAL MODULE: external "lodash/keys"
144
- var keys_ = __webpack_require__(9);
145
- var keys_default = /*#__PURE__*/__webpack_require__.n(keys_);
146
-
147
- // EXTERNAL MODULE: external "lodash/omit"
148
- var omit_ = __webpack_require__(5);
149
- var omit_default = /*#__PURE__*/__webpack_require__.n(omit_);
150
-
151
- // EXTERNAL MODULE: external "@splunk/react-ui/ModalLayer"
152
- var ModalLayer_ = __webpack_require__(104);
153
- var ModalLayer_default = /*#__PURE__*/__webpack_require__.n(ModalLayer_);
154
-
155
- // EXTERNAL MODULE: external "@splunk/ui-utils/focus"
156
- var focus_ = __webpack_require__(31);
157
-
158
- // EXTERNAL MODULE: external "@splunk/ui-utils/id"
159
- var id_ = __webpack_require__(8);
160
-
161
- // EXTERNAL MODULE: external "@splunk/react-ui/ScrollContainerContext"
162
- var ScrollContainerContext_ = __webpack_require__(53);
163
-
164
- // EXTERNAL MODULE: external "styled-components"
165
- var external_styled_components_ = __webpack_require__(3);
166
- var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
167
-
168
- // EXTERNAL MODULE: external "@splunk/react-ui/Box"
169
- var Box_ = __webpack_require__(6);
170
- var Box_default = /*#__PURE__*/__webpack_require__.n(Box_);
171
-
172
- // EXTERNAL MODULE: external "@splunk/themes"
173
- var themes_ = __webpack_require__(0);
174
-
175
- // CONCATENATED MODULE: ./src/Modal/BodyStyles.ts
176
-
177
-
178
-
179
- var StyledBox = external_styled_components_default()(Box_default.a).withConfig({
180
- displayName: "BodyStyles__StyledBox",
181
- componentId: "lv54z7-0"
182
- })(["background-color:", ";", " flex:0 1 auto;overflow:auto;@media all and (-ms-high-contrast:none){*::-ms-backdrop,&{max-height:calc(100vh - 180px);}}"], Object(themes_["pick"])({
183
- enterprise: themes_["variables"].backgroundColor,
184
- prisma: themes_["variables"].backgroundColorDialog
185
- }), Object(themes_["pick"])({
186
- enterprise: {
187
- comfortable: Object(external_styled_components_["css"])(["padding:28px;"]),
188
- compact: Object(external_styled_components_["css"])(["padding:24px;"])
189
- },
190
- prisma: {
191
- comfortable: Object(external_styled_components_["css"])(["padding:12px 24px;&:first-child{padding-top:36px;}&:last-child{padding-bottom:36px;}"]),
192
- compact: Object(external_styled_components_["css"])(["padding:8px 24px;&:first-child{padding-top:26px;}&:last-child{padding-bottom:26px;}"])
193
- }
194
- }));
195
-
196
- // CONCATENATED MODULE: ./src/Modal/Body.tsx
197
- 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); }
198
-
199
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
200
-
201
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
202
-
203
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
204
-
205
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
206
-
207
- function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
208
-
209
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
210
-
211
- 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; }
212
-
213
- 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; }
214
-
215
-
216
-
217
-
218
-
219
- var propTypes = {
220
- children: external_prop_types_default.a.node
221
- };
222
-
223
- /**
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
+ Body: () => /* reexport */ F,
65
+ Footer: () => /* reexport */ K,
66
+ Header: () => /* reexport */ ae,
67
+ default: () => /* reexport */ qe
68
+ });
69
+ // CONCATENATED MODULE: external "react"
70
+ const r = require("react");
71
+ var n = e.n(r);
72
+ // CONCATENATED MODULE: external "prop-types"
73
+ const o = require("prop-types");
74
+ var i = e.n(o);
75
+ // CONCATENATED MODULE: external "lodash/defer"
76
+ const a = require("lodash/defer");
77
+ var l = e.n(a);
78
+ // CONCATENATED MODULE: external "lodash/keys"
79
+ const c = require("lodash/keys");
80
+ var s = e.n(c);
81
+ // CONCATENATED MODULE: external "lodash/omit"
82
+ const u = require("lodash/omit");
83
+ var p = e.n(u);
84
+ // CONCATENATED MODULE: external "@splunk/react-ui/ModalLayer"
85
+ const f = require("@splunk/react-ui/ModalLayer");
86
+ var d = e.n(f);
87
+ // CONCATENATED MODULE: external "@splunk/ui-utils/focus"
88
+ const y = require("@splunk/ui-utils/focus");
89
+ // CONCATENATED MODULE: external "@splunk/ui-utils/id"
90
+ const b = require("@splunk/ui-utils/id");
91
+ // CONCATENATED MODULE: external "@splunk/react-ui/ScrollContainerContext"
92
+ const m = require("@splunk/react-ui/ScrollContainerContext");
93
+ // CONCATENATED MODULE: external "styled-components"
94
+ const v = require("styled-components");
95
+ var h = e.n(v);
96
+ // CONCATENATED MODULE: external "@splunk/react-ui/Box"
97
+ const g = require("@splunk/react-ui/Box");
98
+ var x = e.n(g);
99
+ // CONCATENATED MODULE: external "@splunk/themes"
100
+ const O = require("@splunk/themes");
101
+ // CONCATENATED MODULE: ./src/Modal/BodyStyles.ts
102
+ var w = h()(x()).withConfig({
103
+ displayName: "BodyStyles__StyledBox",
104
+ componentId: "lv54z7-0"
105
+ })([ "background-color:", ";", " flex:0 1 auto;overflow:auto;@media all and (-ms-high-contrast:none){*::-ms-backdrop,&{max-height:calc(100vh - 180px);}}" ], (0,
106
+ O.pick)({
107
+ enterprise: O.variables.backgroundColor,
108
+ prisma: O.variables.backgroundColorDialog
109
+ }), (0, O.pick)({
110
+ enterprise: {
111
+ comfortable: (0, v.css)([ "padding:28px;" ]),
112
+ compact: (0, v.css)([ "padding:24px;" ])
113
+ },
114
+ prisma: {
115
+ comfortable: (0, v.css)([ "padding:12px 24px;&:first-child{padding-top:36px;}&:last-child{padding-bottom:36px;}" ]),
116
+ compact: (0, v.css)([ "padding:8px 24px;&:first-child{padding-top:26px;}&:last-child{padding-bottom:26px;}" ])
117
+ }
118
+ }));
119
+ // CONCATENATED MODULE: ./src/Modal/Body.tsx
120
+ function S() {
121
+ S = Object.assign || function(e) {
122
+ for (var t = 1; t < arguments.length; t++) {
123
+ var r = arguments[t];
124
+ for (var n in r) {
125
+ if (Object.prototype.hasOwnProperty.call(r, n)) {
126
+ e[n] = r[n];
127
+ }
128
+ }
129
+ }
130
+ return e;
131
+ };
132
+ return S.apply(this, arguments);
133
+ }
134
+ function k(e, t) {
135
+ return _(e) || P(e, t) || C(e, t) || j();
136
+ }
137
+ function j() {
138
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
139
+ }
140
+ function C(e, t) {
141
+ if (!e) return;
142
+ if (typeof e === "string") return I(e, t);
143
+ var r = Object.prototype.toString.call(e).slice(8, -1);
144
+ if (r === "Object" && e.constructor) r = e.constructor.name;
145
+ if (r === "Map" || r === "Set") return Array.from(e);
146
+ if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return I(e, t);
147
+ }
148
+ function I(e, t) {
149
+ if (t == null || t > e.length) t = e.length;
150
+ for (var r = 0, n = new Array(t); r < t; r++) {
151
+ n[r] = e[r];
152
+ }
153
+ return n;
154
+ }
155
+ function P(e, t) {
156
+ if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(e))) return;
157
+ var r = [];
158
+ var n = true;
159
+ var o = false;
160
+ var i = undefined;
161
+ try {
162
+ for (var a = e[Symbol.iterator](), l; !(n = (l = a.next()).done); n = true) {
163
+ r.push(l.value);
164
+ if (t && r.length === t) break;
165
+ }
166
+ } catch (e) {
167
+ o = true;
168
+ i = e;
169
+ } finally {
170
+ try {
171
+ if (!n && a["return"] != null) a["return"]();
172
+ } finally {
173
+ if (o) throw i;
174
+ }
175
+ }
176
+ return r;
177
+ }
178
+ function _(e) {
179
+ if (Array.isArray(e)) return e;
180
+ }
181
+ function E(e, t) {
182
+ if (e == null) return {};
183
+ var r = T(e, t);
184
+ var n, o;
185
+ if (Object.getOwnPropertySymbols) {
186
+ var i = Object.getOwnPropertySymbols(e);
187
+ for (o = 0; o < i.length; o++) {
188
+ n = i[o];
189
+ if (t.indexOf(n) >= 0) continue;
190
+ if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
191
+ r[n] = e[n];
192
+ }
193
+ }
194
+ return r;
195
+ }
196
+ function T(e, t) {
197
+ if (e == null) return {};
198
+ var r = {};
199
+ var n = Object.keys(e);
200
+ var o, i;
201
+ for (i = 0; i < n.length; i++) {
202
+ o = n[i];
203
+ if (t.indexOf(o) >= 0) continue;
204
+ r[o] = e[o];
205
+ }
206
+ return r;
207
+ }
208
+ var M = {
209
+ children: i().node
210
+ };
211
+ /**
224
212
  * A styled container for `Modal` body content.
225
- */
226
- function Body(_ref) {
227
- var children = _ref.children,
228
- otherProps = _objectWithoutProperties(_ref, ["children"]);
229
-
230
- // @docs-props-type BodyPropsBase
231
- var _useState = Object(external_react_["useState"])(),
232
- _useState2 = _slicedToArray(_useState, 2),
233
- scrollContainer = _useState2[0],
234
- setScrollContainer = _useState2[1];
235
-
236
- var scrollContainerRef = Object(external_react_["useCallback"])(function (el) {
237
- setScrollContainer(el);
238
- }, []);
239
- return /*#__PURE__*/external_react_default.a.createElement(StyledBox, _extends({
240
- "data-test": "body"
241
- }, otherProps, {
242
- elementRef: scrollContainerRef
243
- }), /*#__PURE__*/external_react_default.a.createElement(ScrollContainerContext_["ScrollContainerProvider"], {
244
- value: scrollContainer
245
- }, children));
246
- }
247
-
248
- Body.propTypes = propTypes;
249
- /* harmony default export */ var Modal_Body = (Body);
250
- // EXTERNAL MODULE: external "@splunk/react-ui/Divider"
251
- var Divider_ = __webpack_require__(113);
252
- var Divider_default = /*#__PURE__*/__webpack_require__.n(Divider_);
253
-
254
- // CONCATENATED MODULE: ./src/Modal/FooterStyles.ts
255
-
256
-
257
-
258
- var FooterStyles_StyledBox = external_styled_components_default()(Box_default.a).withConfig({
259
- displayName: "FooterStyles__StyledBox",
260
- componentId: "yszcmv-0"
261
- })(["flex:0 0 auto;text-align:right;padding:", ";background-color:", ";& > button{min-width:80px;}"], Object(themes_["pick"])({
262
- enterprise: themes_["variables"].spacing,
263
- prisma: {
264
- comfortable: '24px',
265
- compact: '18px 24px'
266
- }
267
- }), Object(themes_["pick"])({
268
- enterprise: themes_["variables"].backgroundColor,
269
- prisma: themes_["variables"].backgroundColorDialog
270
- }));
271
-
272
- // CONCATENATED MODULE: ./src/Modal/ModalContext.tsx
273
-
274
- var ModalContext = /*#__PURE__*/Object(external_react_["createContext"])({});
275
- /* harmony default export */ var Modal_ModalContext = (ModalContext);
276
- // CONCATENATED MODULE: ./src/Modal/Footer.tsx
277
- function Footer_extends() { Footer_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 Footer_extends.apply(this, arguments); }
278
-
279
- function Footer_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Footer_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; }
280
-
281
- function Footer_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; }
282
-
283
-
284
-
285
-
286
-
287
-
288
- var Footer_propTypes = {
289
- children: external_prop_types_default.a.node
290
- };
291
-
292
- /**
213
+ */ function q(e) {
214
+ var t = e.children, o = E(e, [ "children" ]);
215
+ // @docs-props-type BodyPropsBase
216
+ var i = (0, r.useState)(), a = k(i, 2), l = a[0], c = a[1];
217
+ var s = (0, r.useCallback)((function(e) {
218
+ c(e);
219
+ }), []);
220
+
221
+ return n().createElement(w, S({
222
+ "data-test": "body"
223
+ }, o, {
224
+ elementRef: s
225
+ }), n().createElement(m.ScrollContainerProvider, {
226
+ value: l
227
+ }, t));
228
+ }
229
+ q.propTypes = M;
230
+ /* harmony default export */ const F = q;
231
+ // CONCATENATED MODULE: external "@splunk/react-ui/Divider"
232
+ const D = require("@splunk/react-ui/Divider");
233
+ var R = e.n(D);
234
+ // CONCATENATED MODULE: ./src/Modal/FooterStyles.ts
235
+ var A = h()(x()).withConfig({
236
+ displayName: "FooterStyles__StyledBox",
237
+ componentId: "yszcmv-0"
238
+ })([ "flex:0 0 auto;text-align:right;padding:", ";background-color:", ";& > button{min-width:80px;}" ], (0,
239
+ O.pick)({
240
+ enterprise: O.variables.spacing,
241
+ prisma: {
242
+ comfortable: "24px",
243
+ compact: "18px 24px"
244
+ }
245
+ }), (0, O.pick)({
246
+ enterprise: O.variables.backgroundColor,
247
+ prisma: O.variables.backgroundColorDialog
248
+ }));
249
+ // CONCATENATED MODULE: ./src/Modal/ModalContext.tsx
250
+ var B = (0, r.createContext)({});
251
+ /* harmony default export */ const H = B;
252
+ // CONCATENATED MODULE: ./src/Modal/Footer.tsx
253
+ function N() {
254
+ N = Object.assign || function(e) {
255
+ for (var t = 1; t < arguments.length; t++) {
256
+ var r = arguments[t];
257
+ for (var n in r) {
258
+ if (Object.prototype.hasOwnProperty.call(r, n)) {
259
+ e[n] = r[n];
260
+ }
261
+ }
262
+ }
263
+ return e;
264
+ };
265
+ return N.apply(this, arguments);
266
+ }
267
+ function z(e, t) {
268
+ if (e == null) return {};
269
+ var r = L(e, t);
270
+ var n, o;
271
+ if (Object.getOwnPropertySymbols) {
272
+ var i = Object.getOwnPropertySymbols(e);
273
+ for (o = 0; o < i.length; o++) {
274
+ n = i[o];
275
+ if (t.indexOf(n) >= 0) continue;
276
+ if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
277
+ r[n] = e[n];
278
+ }
279
+ }
280
+ return r;
281
+ }
282
+ function L(e, t) {
283
+ if (e == null) return {};
284
+ var r = {};
285
+ var n = Object.keys(e);
286
+ var o, i;
287
+ for (i = 0; i < n.length; i++) {
288
+ o = n[i];
289
+ if (t.indexOf(o) >= 0) continue;
290
+ r[o] = e[o];
291
+ }
292
+ return r;
293
+ }
294
+ var X = {
295
+ children: i().node
296
+ };
297
+ /**
293
298
  * A styled container for `Modal` footer content.
294
- */
295
- function Footer(_ref) {
296
- var children = _ref.children,
297
- otherProps = Footer_objectWithoutProperties(_ref, ["children"]);
298
-
299
- // @docs-props-type FooterPropsBase
300
- var _useContext = Object(external_react_["useContext"])(Modal_ModalContext),
301
- dividerContext = _useContext.divider;
302
-
303
- var hasDivider = dividerContext === 'both' || dividerContext === 'footer';
304
- return /*#__PURE__*/external_react_default.a.createElement(external_react_default.a.Fragment, null, hasDivider && /*#__PURE__*/external_react_default.a.createElement(Divider_default.a, {
305
- "aria-hidden": true
306
- }), /*#__PURE__*/external_react_default.a.createElement(FooterStyles_StyledBox, Footer_extends({
307
- "data-test": "footer"
308
- }, otherProps), children));
309
- }
310
-
311
- Footer.propTypes = Footer_propTypes;
312
- /* harmony default export */ var Modal_Footer = (Footer);
313
- // EXTERNAL MODULE: external "@splunk/react-ui/CloseButton"
314
- var CloseButton_ = __webpack_require__(92);
315
- var CloseButton_default = /*#__PURE__*/__webpack_require__.n(CloseButton_);
316
-
317
- // CONCATENATED MODULE: ./src/Modal/HeaderStyles.ts
318
-
319
-
320
-
321
- var HeaderStyles_StyledBox = external_styled_components_default()(Box_default.a).withConfig({
322
- displayName: "HeaderStyles__StyledBox",
323
- componentId: "sc-1y722ut-0"
324
- })(["", ";flex:0 0 auto;position:relative;min-height:", ";background-color:", ";padding:", ";align-items:center;padding-right:", ";"], themes_["mixins"].reset('flex'), Object(themes_["pick"])({
325
- enterprise: '30px',
326
- prisma: {
327
- comfortable: '60px',
328
- compact: '52px'
329
- }
330
- }), Object(themes_["pick"])({
331
- enterprise: themes_["variables"].backgroundColor,
332
- prisma: themes_["variables"].backgroundColorDialog
333
- }), Object(themes_["pick"])({
334
- enterprise: '25px 28px',
335
- prisma: {
336
- comfortable: '18px 24px',
337
- compact: '14px 24px'
338
- }
339
- }), function (_ref) {
340
- var $close = _ref.$close;
341
- return $close && Object(themes_["pick"])({
342
- enterprise: '54px',
343
- prisma: {
344
- comfortable: '64px',
345
- compact: '56px'
346
- }
347
- });
348
- });
349
- var StyledTitleWrapper = external_styled_components_default.a.div.withConfig({
350
- displayName: "HeaderStyles__StyledTitleWrapper",
351
- componentId: "sc-1y722ut-1"
352
- })(["", ";flex-direction:column;"], themes_["mixins"].reset('flex'));
353
- var StyledIcon = external_styled_components_default.a.div.withConfig({
354
- displayName: "HeaderStyles__StyledIcon",
355
- componentId: "sc-1y722ut-2"
356
- })(["", ";align-items:center;justify-content:center;margin-right:", ";", " width:", ";height:", ";flex-shrink:0;"], themes_["mixins"].reset('inline-flex'), themes_["variables"].spacingLarge, Object(themes_["pick"])({
357
- prisma: Object(external_styled_components_["css"])(["background-color:", ";"], themes_["variables"].transparent)
358
- }), Object(themes_["pick"])({
359
- comfortable: '40px',
360
- compact: '32px'
361
- }), Object(themes_["pick"])({
362
- comfortable: '40px',
363
- compact: '32px'
364
- }));
365
- var StyledTitle = external_styled_components_default.a.div.withConfig({
366
- displayName: "HeaderStyles__StyledTitle",
367
- componentId: "sc-1y722ut-3"
368
- })(["", ";font-size:20px;margin:0;overflow-wrap:break-word;font-weight:", ";", ""], themes_["mixins"].reset('block'), themes_["variables"].fontWeightSemiBold, Object(themes_["pick"])({
369
- enterprise: Object(external_styled_components_["css"])(["line-height:22px;"]),
370
- prisma: Object(external_styled_components_["css"])(["color:", ";line-height:24px;"], themes_["variables"].contentColorActive)
371
- }));
372
- var StyledSubtitle = external_styled_components_default.a.div.withConfig({
373
- displayName: "HeaderStyles__StyledSubtitle",
374
- componentId: "sc-1y722ut-4"
375
- })(["", ";font-size:14px;overflow-wrap:break-word;line-height:", ";"], themes_["mixins"].reset('block'), Object(themes_["pick"])({
376
- enterprise: themes_["variables"].lineHeight,
377
- prisma: '20px'
378
- }));
379
- var StyledButtonsWrapper = external_styled_components_default.a.div.withConfig({
380
- displayName: "HeaderStyles__StyledButtonsWrapper",
381
- componentId: "sc-1y722ut-5"
382
- })(["", ";position:absolute;top:", ";right:", ";bottom:50%;", " max-height:35px;transform-origin:bottom right;transform:rotate(-90deg) translateX(100%);"], themes_["mixins"].reset('block'), Object(themes_["pick"])({
383
- enterprise: 0,
384
- prisma: {
385
- comfortable: '-2px',
386
- compact: '-6px'
387
- }
388
- }), Object(themes_["pick"])({
389
- enterprise: 0,
390
- prisma: {
391
- comfortable: '-2px',
392
- compact: '-6px'
393
- }
394
- }), Object(themes_["pick"])({
395
- prisma: {
396
- comfortable: Object(external_styled_components_["css"])(["min-height:35px;"]),
397
- compact: Object(external_styled_components_["css"])(["min-height:30px;"])
398
- }
399
- }));
400
- var StyledClose = external_styled_components_default.a.div.withConfig({
401
- displayName: "HeaderStyles__StyledClose",
402
- componentId: "sc-1y722ut-6"
403
- })(["", ";position:absolute;right:0;top:0;transform:rotate(90deg) translate(-50%,-50%);"], themes_["mixins"].reset('block'));
404
-
405
- // CONCATENATED MODULE: ./src/Modal/Header.tsx
406
- function Header_extends() { Header_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 Header_extends.apply(this, arguments); }
407
-
408
- function Header_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Header_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; }
409
-
410
- function Header_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; }
411
-
412
-
413
-
414
-
415
-
416
-
417
-
418
- var Header_propTypes = {
419
- children: external_prop_types_default.a.node,
420
- icon: external_prop_types_default.a.node,
421
- onRequestClose: external_prop_types_default.a.func,
422
- subtitle: external_prop_types_default.a.node,
423
- title: external_prop_types_default.a.string
424
- };
425
-
426
- /**
299
+ */ function $(e) {
300
+ var t = e.children, o = z(e, [ "children" ]);
301
+ // @docs-props-type FooterPropsBase
302
+ var i = (0, r.useContext)(H), a = i.divider;
303
+ var l = a === "both" || a === "footer";
304
+
305
+ return n().createElement(n().Fragment, null, l && n().createElement(R(), {
306
+ "aria-hidden": true
307
+ }), n().createElement(A, N({
308
+ "data-test": "footer"
309
+ }, o), t));
310
+ }
311
+ $.propTypes = X;
312
+ /* harmony default export */ const K = $;
313
+ // CONCATENATED MODULE: external "@splunk/react-ui/CloseButton"
314
+ const U = require("@splunk/react-ui/CloseButton");
315
+ var W = e.n(U);
316
+ // CONCATENATED MODULE: ./src/Modal/HeaderStyles.ts
317
+ var V = h()(x()).withConfig({
318
+ displayName: "HeaderStyles__StyledBox",
319
+ componentId: "sc-1y722ut-0"
320
+ })([ "", ";flex:0 0 auto;position:relative;min-height:", ";background-color:", ";padding:", ";align-items:center;padding-right:", ";" ], O.mixins.reset("flex"), (0,
321
+ O.pick)({
322
+ enterprise: "30px",
323
+ prisma: {
324
+ comfortable: "60px",
325
+ compact: "52px"
326
+ }
327
+ }), (0, O.pick)({
328
+ enterprise: O.variables.backgroundColor,
329
+ prisma: O.variables.backgroundColorDialog
330
+ }), (0, O.pick)({
331
+ enterprise: "25px 28px",
332
+ prisma: {
333
+ comfortable: "18px 24px",
334
+ compact: "14px 24px"
335
+ }
336
+ }), (function(e) {
337
+ var t = e.$close;
338
+ return t && (0, O.pick)({
339
+ enterprise: "54px",
340
+ prisma: {
341
+ comfortable: "64px",
342
+ compact: "56px"
343
+ }
344
+ });
345
+ }));
346
+ var G = h().div.withConfig({
347
+ displayName: "HeaderStyles__StyledTitleWrapper",
348
+ componentId: "sc-1y722ut-1"
349
+ })([ "", ";flex-direction:column;" ], O.mixins.reset("flex"));
350
+ var J = h().div.withConfig({
351
+ displayName: "HeaderStyles__StyledIcon",
352
+ componentId: "sc-1y722ut-2"
353
+ })([ "", ";align-items:center;justify-content:center;margin-right:", ";", " width:", ";height:", ";flex-shrink:0;" ], O.mixins.reset("inline-flex"), O.variables.spacingLarge, (0,
354
+ O.pick)({
355
+ prisma: (0, v.css)([ "background-color:", ";" ], O.variables.transparent)
356
+ }), (0, O.pick)({
357
+ comfortable: "40px",
358
+ compact: "32px"
359
+ }), (0, O.pick)({
360
+ comfortable: "40px",
361
+ compact: "32px"
362
+ }));
363
+ var Q = h().div.withConfig({
364
+ displayName: "HeaderStyles__StyledTitle",
365
+ componentId: "sc-1y722ut-3"
366
+ })([ "", ";font-size:20px;margin:0;overflow-wrap:break-word;font-weight:", ";", "" ], O.mixins.reset("block"), O.variables.fontWeightSemiBold, (0,
367
+ O.pick)({
368
+ enterprise: (0, v.css)([ "line-height:22px;" ]),
369
+ prisma: (0, v.css)([ "color:", ";line-height:24px;" ], O.variables.contentColorActive)
370
+ }));
371
+ var Y = h().div.withConfig({
372
+ displayName: "HeaderStyles__StyledSubtitle",
373
+ componentId: "sc-1y722ut-4"
374
+ })([ "", ";font-size:14px;overflow-wrap:break-word;line-height:", ";" ], O.mixins.reset("block"), (0,
375
+ O.pick)({
376
+ enterprise: O.variables.lineHeight,
377
+ prisma: "20px"
378
+ }));
379
+ var Z = h().div.withConfig({
380
+ displayName: "HeaderStyles__StyledButtonsWrapper",
381
+ componentId: "sc-1y722ut-5"
382
+ })([ "", ";position:absolute;top:", ";right:", ";bottom:50%;", " max-height:35px;transform-origin:bottom right;transform:rotate(-90deg) translateX(100%);" ], O.mixins.reset("block"), (0,
383
+ O.pick)({
384
+ enterprise: 0,
385
+ prisma: {
386
+ comfortable: "-2px",
387
+ compact: "-6px"
388
+ }
389
+ }), (0, O.pick)({
390
+ enterprise: 0,
391
+ prisma: {
392
+ comfortable: "-2px",
393
+ compact: "-6px"
394
+ }
395
+ }), (0, O.pick)({
396
+ prisma: {
397
+ comfortable: (0, v.css)([ "min-height:35px;" ]),
398
+ compact: (0, v.css)([ "min-height:30px;" ])
399
+ }
400
+ }));
401
+ var ee = h().div.withConfig({
402
+ displayName: "HeaderStyles__StyledClose",
403
+ componentId: "sc-1y722ut-6"
404
+ })([ "", ";position:absolute;right:0;top:0;transform:rotate(90deg) translate(-50%,-50%);" ], O.mixins.reset("block"));
405
+ // CONCATENATED MODULE: ./src/Modal/Header.tsx
406
+ function te() {
407
+ te = Object.assign || function(e) {
408
+ for (var t = 1; t < arguments.length; t++) {
409
+ var r = arguments[t];
410
+ for (var n in r) {
411
+ if (Object.prototype.hasOwnProperty.call(r, n)) {
412
+ e[n] = r[n];
413
+ }
414
+ }
415
+ }
416
+ return e;
417
+ };
418
+ return te.apply(this, arguments);
419
+ }
420
+ function re(e, t) {
421
+ if (e == null) return {};
422
+ var r = ne(e, t);
423
+ var n, o;
424
+ if (Object.getOwnPropertySymbols) {
425
+ var i = Object.getOwnPropertySymbols(e);
426
+ for (o = 0; o < i.length; o++) {
427
+ n = i[o];
428
+ if (t.indexOf(n) >= 0) continue;
429
+ if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
430
+ r[n] = e[n];
431
+ }
432
+ }
433
+ return r;
434
+ }
435
+ function ne(e, t) {
436
+ if (e == null) return {};
437
+ var r = {};
438
+ var n = Object.keys(e);
439
+ var o, i;
440
+ for (i = 0; i < n.length; i++) {
441
+ o = n[i];
442
+ if (t.indexOf(o) >= 0) continue;
443
+ r[o] = e[o];
444
+ }
445
+ return r;
446
+ }
447
+ var oe = {
448
+ children: i().node,
449
+ icon: i().node,
450
+ onRequestClose: i().func,
451
+ subtitle: i().node,
452
+ title: i().string
453
+ };
454
+ /**
427
455
  * A styled container for `Modal` header content.
428
- */
429
- function Header(_ref) {
430
- var children = _ref.children,
431
- icon = _ref.icon,
432
- onRequestClose = _ref.onRequestClose,
433
- subtitle = _ref.subtitle,
434
- title = _ref.title,
435
- otherProps = Header_objectWithoutProperties(_ref, ["children", "icon", "onRequestClose", "subtitle", "title"]);
436
-
437
- // @docs-props-type StepPropsBase
438
- var _useContext = Object(external_react_["useContext"])(Modal_ModalContext),
439
- titleIdContext = _useContext.titleId,
440
- dividerContext = _useContext.divider;
441
-
442
- var hasDivider = dividerContext === 'both' || dividerContext === 'header';
443
- return /*#__PURE__*/external_react_default.a.createElement(external_react_default.a.Fragment, null, /*#__PURE__*/external_react_default.a.createElement(HeaderStyles_StyledBox, Header_extends({
444
- $close: !!onRequestClose,
445
- "data-test": "header"
446
- }, otherProps), icon && /*#__PURE__*/external_react_default.a.createElement(StyledIcon, null, icon), title ? /*#__PURE__*/external_react_default.a.createElement(StyledTitleWrapper, null, title && /*#__PURE__*/external_react_default.a.createElement(StyledTitle, {
447
- id: titleIdContext,
448
- "data-test": "title"
449
- }, title), subtitle && /*#__PURE__*/external_react_default.a.createElement(StyledSubtitle, {
450
- "data-test": "subtitle"
451
- }, subtitle)) : children, onRequestClose && /*#__PURE__*/external_react_default.a.createElement(StyledButtonsWrapper, null, onRequestClose && /*#__PURE__*/external_react_default.a.createElement(StyledClose, null, /*#__PURE__*/external_react_default.a.createElement(CloseButton_default.a, {
452
- onClick: onRequestClose,
453
- "data-test": "close"
454
- })))), hasDivider && /*#__PURE__*/external_react_default.a.createElement(Divider_default.a, {
455
- "aria-hidden": true
456
- }));
457
- }
458
-
459
- Header.propTypes = Header_propTypes;
460
- /* harmony default export */ var Modal_Header = (Header);
461
- // EXTERNAL MODULE: external "react-spring"
462
- var external_react_spring_ = __webpack_require__(24);
463
-
464
- // CONCATENATED MODULE: ./src/Modal/ModalStyles.ts
465
-
466
-
467
-
468
- var Styled = external_styled_components_default()(external_react_spring_["animated"].div).withConfig({
469
- displayName: "ModalStyles__Styled",
470
- componentId: "sc-5fn8ds-0"
471
- })(["", ";flex-direction:column;position:fixed;left:50%;transform:translateX(-50%);z-index:", ";", ""], themes_["mixins"].reset('flex'), themes_["variables"].zindexModal, Object(themes_["pick"])({
472
- enterprise: Object(external_styled_components_["css"])(["box-shadow:0 1px 5px ", ";max-height:calc(100vh - ", " * 4);max-width:calc(100vw - ", " * 4);"], themes_["variables"].black, themes_["variables"].spacing, themes_["variables"].spacing),
473
- prisma: Object(external_styled_components_["css"])(["box-shadow:", ";max-height:calc(100vh - ", " * 4);max-width:calc(100vw - ", " * 4);border-radius:", ";overflow:hidden;"], themes_["variables"].modalShadow, themes_["variables"].spacingXLarge, themes_["variables"].spacingXLarge, themes_["variables"].borderRadius)
474
- }));
475
-
476
- // CONCATENATED MODULE: ./src/Modal/Modal.tsx
477
- function Modal_extends() { Modal_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 Modal_extends.apply(this, arguments); }
478
-
479
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || Modal_unsupportedIterableToArray(arr) || _nonIterableSpread(); }
480
-
481
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
482
-
483
- function Modal_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Modal_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Modal_arrayLikeToArray(o, minLen); }
484
-
485
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
486
-
487
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return Modal_arrayLikeToArray(arr); }
488
-
489
- function Modal_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
490
-
491
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
492
-
493
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
494
-
495
- 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); }
496
-
497
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
498
-
499
- 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); } }
500
-
501
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
502
-
503
- 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); }
504
-
505
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
506
-
507
- 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); }; }
508
-
509
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
510
-
511
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
512
-
513
- 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; } }
514
-
515
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
516
-
517
- 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; }
518
-
519
-
520
-
521
-
522
-
523
-
524
-
525
-
526
-
527
-
528
-
529
-
530
-
531
-
532
- /** @public */
533
-
534
- var Modal_propTypes = {
535
- children: external_prop_types_default.a.node,
536
- initialFocus: external_prop_types_default.a.oneOfType([external_prop_types_default.a.object, external_prop_types_default.a.oneOf(['first', 'container'])]),
537
- onRequestClose: external_prop_types_default.a.func,
538
- open: external_prop_types_default.a.bool,
539
- divider: external_prop_types_default.a.oneOf(['header', 'footer', 'both', 'none'])
540
- };
541
- var defaultProps = {
542
- initialFocus: 'first',
543
- open: false,
544
- divider: 'both'
545
- };
546
-
547
- var Modal_Modal = /*#__PURE__*/function (_Component) {
548
- _inherits(Modal, _Component);
549
-
550
- var _super = _createSuper(Modal);
551
-
552
- // @docs-props-type ModalPropsBase
553
- // this timeout ensures that the Modal is finished rendering before setting the focus
554
- function Modal(props) {
555
- var _this;
556
-
557
- _classCallCheck(this, Modal);
558
-
559
- _this = _super.call(this, props);
560
-
561
- _defineProperty(_assertThisInitialized(_this), "el", null);
562
-
563
- _defineProperty(_assertThisInitialized(_this), "initialFocusTimeoutId", undefined);
564
-
565
- _defineProperty(_assertThisInitialized(_this), "initialFocus", null);
566
-
567
- _defineProperty(_assertThisInitialized(_this), "headerTitleId", void 0);
568
-
569
- _defineProperty(_assertThisInitialized(_this), "getDefaultMotionStyle", function () {
570
- return {
571
- top: 0
572
- };
573
- });
574
-
575
- _defineProperty(_assertThisInitialized(_this), "getMotionStyle", function () {
576
- if (_this.props.open) {
577
- return {
578
- top: 40
456
+ */ function ie(e) {
457
+ var t = e.children, o = e.icon, i = e.onRequestClose, a = e.subtitle, l = e.title, c = re(e, [ "children", "icon", "onRequestClose", "subtitle", "title" ]);
458
+ // @docs-props-type StepPropsBase
459
+ var s = (0, r.useContext)(H), u = s.titleId, p = s.divider;
460
+ var f = p === "both" || p === "header";
461
+
462
+ return n().createElement(n().Fragment, null, n().createElement(V, te({
463
+ $close: !!i,
464
+ "data-test": "header"
465
+ }, c), o && n().createElement(J, null, o), l ? n().createElement(G, null, l && n().createElement(Q, {
466
+ id: u,
467
+ "data-test": "title"
468
+ }, l), a && n().createElement(Y, {
469
+ "data-test": "subtitle"
470
+ }, a)) : t, i && n().createElement(Z, null, i && n().createElement(ee, null, n().createElement(W(), {
471
+ onClick: i,
472
+ "data-test": "close"
473
+ })))), f && n().createElement(R(), {
474
+ "aria-hidden": true
475
+ }));
476
+ }
477
+ ie.propTypes = oe;
478
+ /* harmony default export */ const ae = ie;
479
+ // CONCATENATED MODULE: external "react-spring"
480
+ const le = require("react-spring");
481
+ // CONCATENATED MODULE: ./src/Modal/ModalStyles.ts
482
+ var ce = h()(le.animated.div).withConfig({
483
+ displayName: "ModalStyles__Styled",
484
+ componentId: "sc-5fn8ds-0"
485
+ })([ "", ";flex-direction:column;position:fixed;left:50%;transform:translateX(-50%);z-index:", ";", "" ], O.mixins.reset("flex"), O.variables.zindexModal, (0,
486
+ O.pick)({
487
+ enterprise: (0, v.css)([ "box-shadow:0 1px 5px ", ";max-height:calc(100vh - ", " * 4);max-width:calc(100vw - ", " * 4);" ], O.variables.black, O.variables.spacing, O.variables.spacing),
488
+ prisma: (0, v.css)([ "box-shadow:", ";max-height:calc(100vh - ", " * 4);max-width:calc(100vw - ", " * 4);border-radius:", ";overflow:hidden;" ], O.variables.modalShadow, O.variables.spacingXLarge, O.variables.spacingXLarge, O.variables.borderRadius)
489
+ }));
490
+ // CONCATENATED MODULE: ./src/Modal/Modal.tsx
491
+ function se() {
492
+ se = Object.assign || function(e) {
493
+ for (var t = 1; t < arguments.length; t++) {
494
+ var r = arguments[t];
495
+ for (var n in r) {
496
+ if (Object.prototype.hasOwnProperty.call(r, n)) {
497
+ e[n] = r[n];
498
+ }
499
+ }
500
+ }
501
+ return e;
579
502
  };
580
- }
581
-
582
- return {
583
- top: 0
584
- };
585
- });
586
-
587
- _defineProperty(_assertThisInitialized(_this), "handleInitialFocus", function () {
588
- var _this$props = _this.props,
589
- initialFocus = _this$props.initialFocus,
590
- open = _this$props.open;
591
-
592
- if (open) {
593
- _this.initialFocusTimeoutId = defer_default()(function () {
594
- var focusTarget; // not using the takeFocus() util here because it
595
- // doesn't work for all values of "initialFocus"
596
- // and it has a nested defer() call, which we want to avoid
597
-
598
- if (_this.initialFocus !== initialFocus) {
599
- if (initialFocus === 'first') {
600
- if (_this.el) {
601
- /* eslint-disable prefer-destructuring */
602
-
603
- /* prefer-desturucting leads to harder-to-read syntax in this case */
604
- focusTarget = Object(focus_["getSortedTabbableElements"])(_this.el)[0];
605
- /* eslint-enable prefer-destructuring */
606
- }
607
- } else if (initialFocus === 'container') {
608
- focusTarget = _this.el;
609
- } else if (_typeof(initialFocus) === 'object') {
610
- focusTarget = initialFocus;
611
- } // Typescript isn't happy with optional chaining here
612
-
613
-
614
- if (focusTarget != null && 'focus' in focusTarget) {
615
- focusTarget.focus();
503
+ return se.apply(this, arguments);
504
+ }
505
+ function ue(e) {
506
+ return ye(e) || de(e) || fe(e) || pe();
507
+ }
508
+ function pe() {
509
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
510
+ }
511
+ function fe(e, t) {
512
+ if (!e) return;
513
+ if (typeof e === "string") return be(e, t);
514
+ var r = Object.prototype.toString.call(e).slice(8, -1);
515
+ if (r === "Object" && e.constructor) r = e.constructor.name;
516
+ if (r === "Map" || r === "Set") return Array.from(e);
517
+ if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return be(e, t);
518
+ }
519
+ function de(e) {
520
+ if (typeof Symbol !== "undefined" && Symbol.iterator in Object(e)) return Array.from(e);
521
+ }
522
+ function ye(e) {
523
+ if (Array.isArray(e)) return be(e);
524
+ }
525
+ function be(e, t) {
526
+ if (t == null || t > e.length) t = e.length;
527
+ for (var r = 0, n = new Array(t); r < t; r++) {
528
+ n[r] = e[r];
529
+ }
530
+ return n;
531
+ }
532
+ function me(e, t) {
533
+ var r = Object.keys(e);
534
+ if (Object.getOwnPropertySymbols) {
535
+ var n = Object.getOwnPropertySymbols(e);
536
+ if (t) n = n.filter((function(t) {
537
+ return Object.getOwnPropertyDescriptor(e, t).enumerable;
538
+ }));
539
+ r.push.apply(r, n);
540
+ }
541
+ return r;
542
+ }
543
+ function ve(e) {
544
+ for (var t = 1; t < arguments.length; t++) {
545
+ var r = arguments[t] != null ? arguments[t] : {};
546
+ if (t % 2) {
547
+ me(Object(r), true).forEach((function(t) {
548
+ _e(e, t, r[t]);
549
+ }));
550
+ } else if (Object.getOwnPropertyDescriptors) {
551
+ Object.defineProperties(e, Object.getOwnPropertyDescriptors(r));
552
+ } else {
553
+ me(Object(r)).forEach((function(t) {
554
+ Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
555
+ }));
556
+ }
557
+ }
558
+ return e;
559
+ }
560
+ function he(e) {
561
+ "@babel/helpers - typeof";
562
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
563
+ he = function e(t) {
564
+ return typeof t;
565
+ };
566
+ } else {
567
+ he = function e(t) {
568
+ return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
569
+ };
570
+ }
571
+ return he(e);
572
+ }
573
+ function ge(e, t) {
574
+ if (!(e instanceof t)) {
575
+ throw new TypeError("Cannot call a class as a function");
576
+ }
577
+ }
578
+ function xe(e, t) {
579
+ for (var r = 0; r < t.length; r++) {
580
+ var n = t[r];
581
+ n.enumerable = n.enumerable || false;
582
+ n.configurable = true;
583
+ if ("value" in n) n.writable = true;
584
+ Object.defineProperty(e, n.key, n);
585
+ }
586
+ }
587
+ function Oe(e, t, r) {
588
+ if (t) xe(e.prototype, t);
589
+ if (r) xe(e, r);
590
+ return e;
591
+ }
592
+ function we(e, t) {
593
+ if (typeof t !== "function" && t !== null) {
594
+ throw new TypeError("Super expression must either be null or a function");
595
+ }
596
+ e.prototype = Object.create(t && t.prototype, {
597
+ constructor: {
598
+ value: e,
599
+ writable: true,
600
+ configurable: true
616
601
  }
617
-
618
- _this.initialFocus = initialFocus;
619
- }
620
602
  });
621
- } else {
622
- _this.initialFocus = null;
623
- clearTimeout(_this.initialFocusTimeoutId);
624
- }
625
- });
626
-
627
- _defineProperty(_assertThisInitialized(_this), "handleModalMount", function (element) {
628
- _this.el = element;
629
- });
630
-
631
- _defineProperty(_assertThisInitialized(_this), "handleModalKeyDown", function (e) {
632
- if (_this.el !== null) {
633
- Object(focus_["handleTab"])(_this.el, e.nativeEvent);
634
- }
635
- });
636
-
637
- _defineProperty(_assertThisInitialized(_this), "handleRequestClose", function (e) {
638
- var _this$props$onRequest, _this$props2;
639
-
640
- _this.initialFocus = null;
641
- (_this$props$onRequest = (_this$props2 = _this.props).onRequestClose) === null || _this$props$onRequest === void 0 ? void 0 : _this$props$onRequest.call(_this$props2, e);
642
- });
643
-
644
- _defineProperty(_assertThisInitialized(_this), "renderModal", function (interpolatedStyle) {
645
- var _this$props3 = _this.props,
646
- style = _this$props3.style,
647
- children = _this$props3.children,
648
- divider = _this$props3.divider;
649
- var top = interpolatedStyle.top,
650
- opacity = interpolatedStyle.opacity;
651
- var clonedChildren = external_react_["Children"].toArray(children).filter(external_react_["isValidElement"]);
652
- return /*#__PURE__*/external_react_default.a.createElement(Styled // eslint-disable-line jsx-a11y/no-noninteractive-element-interactions
653
- , Modal_extends({
654
- ref: _this.handleModalMount,
655
- "data-test": "modal",
656
- style: _objectSpread(_objectSpread({}, style), {}, {
657
- top: top,
658
- opacity: opacity
659
- }),
660
- tabIndex: -1,
661
- onKeyDown: _this.handleModalKeyDown,
662
- role: "dialog",
663
- "aria-labelledby": _this.headerTitleId
664
- }, omit_default()(_this.props, [].concat(_toConsumableArray(keys_default()(Modal.propTypes)), ['style']))), /*#__PURE__*/external_react_default.a.createElement(Modal_ModalContext.Provider, {
665
- value: {
666
- titleId: _this.headerTitleId,
667
- divider: divider
603
+ if (t) Se(e, t);
604
+ }
605
+ function Se(e, t) {
606
+ Se = Object.setPrototypeOf || function e(t, r) {
607
+ t.__proto__ = r;
608
+ return t;
609
+ };
610
+ return Se(e, t);
611
+ }
612
+ function ke(e) {
613
+ var t = Ie();
614
+ return function r() {
615
+ var n = Pe(e), o;
616
+ if (t) {
617
+ var i = Pe(this).constructor;
618
+ o = Reflect.construct(n, arguments, i);
619
+ } else {
620
+ o = n.apply(this, arguments);
621
+ }
622
+ return je(this, o);
623
+ };
624
+ }
625
+ function je(e, t) {
626
+ if (t && (he(t) === "object" || typeof t === "function")) {
627
+ return t;
668
628
  }
669
- }, clonedChildren));
670
- });
671
-
672
- _this.headerTitleId = Object(id_["createDOMID"])('titleId');
673
- return _this;
674
- }
675
-
676
- _createClass(Modal, [{
677
- key: "componentDidMount",
678
- value: function componentDidMount() {
679
- this.handleInitialFocus();
680
- }
681
- }, {
682
- key: "componentDidUpdate",
683
- value: function componentDidUpdate(prevProps) {
684
- var initialFocus = this.props.initialFocus;
685
-
686
- if (prevProps.initialFocus !== initialFocus) {
687
- // cancel the defer() set up in handleInitialFocus()
688
- // so that focus won't jump around if "initialFocus" changes
689
- clearTimeout(this.initialFocusTimeoutId);
690
- }
691
-
692
- this.handleInitialFocus();
693
- }
694
- }, {
695
- key: "render",
696
- value: function render() {
697
- return /*#__PURE__*/external_react_default.a.createElement(ModalLayer_default.a, {
698
- open: this.props.open,
699
- getDefaultMotionStyle: this.getDefaultMotionStyle,
700
- renderModal: this.renderModal,
701
- getMotionStyle: this.getMotionStyle,
702
- onRequestClose: this.handleRequestClose
703
- });
704
- }
705
- }]);
706
-
707
- return Modal;
708
- }(external_react_["Component"]);
709
-
710
- _defineProperty(Modal_Modal, "propTypes", Modal_propTypes);
711
-
712
- _defineProperty(Modal_Modal, "defaultProps", defaultProps);
713
-
714
- _defineProperty(Modal_Modal, "Header", Modal_Header);
715
-
716
- _defineProperty(Modal_Modal, "Body", Modal_Body);
717
-
718
- _defineProperty(Modal_Modal, "Footer", Modal_Footer);
719
-
720
- /* harmony default export */ var src_Modal_Modal = (Modal_Modal);
721
-
722
- // CONCATENATED MODULE: ./src/Modal/index.ts
723
-
724
-
725
-
726
- /***/ }),
727
-
728
- /***/ 2:
729
- /***/ (function(module, exports) {
730
-
731
- module.exports = require("react");
732
-
733
- /***/ }),
734
-
735
- /***/ 24:
736
- /***/ (function(module, exports) {
737
-
738
- module.exports = require("react-spring");
739
-
740
- /***/ }),
741
-
742
- /***/ 3:
743
- /***/ (function(module, exports) {
744
-
745
- module.exports = require("styled-components");
746
-
747
- /***/ }),
748
-
749
- /***/ 31:
750
- /***/ (function(module, exports) {
751
-
752
- module.exports = require("@splunk/ui-utils/focus");
753
-
754
- /***/ }),
755
-
756
- /***/ 5:
757
- /***/ (function(module, exports) {
758
-
759
- module.exports = require("lodash/omit");
760
-
761
- /***/ }),
762
-
763
- /***/ 53:
764
- /***/ (function(module, exports) {
765
-
766
- module.exports = require("@splunk/react-ui/ScrollContainerContext");
767
-
768
- /***/ }),
769
-
770
- /***/ 58:
771
- /***/ (function(module, exports) {
772
-
773
- module.exports = require("lodash/defer");
774
-
775
- /***/ }),
776
-
777
- /***/ 6:
778
- /***/ (function(module, exports) {
779
-
780
- module.exports = require("@splunk/react-ui/Box");
781
-
782
- /***/ }),
783
-
784
- /***/ 8:
785
- /***/ (function(module, exports) {
786
-
787
- module.exports = require("@splunk/ui-utils/id");
788
-
789
- /***/ }),
790
-
791
- /***/ 9:
792
- /***/ (function(module, exports) {
793
-
794
- module.exports = require("lodash/keys");
795
-
796
- /***/ }),
797
-
798
- /***/ 92:
799
- /***/ (function(module, exports) {
800
-
801
- module.exports = require("@splunk/react-ui/CloseButton");
802
-
803
- /***/ })
804
-
805
- /******/ });
629
+ return Ce(e);
630
+ }
631
+ function Ce(e) {
632
+ if (e === void 0) {
633
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
634
+ }
635
+ return e;
636
+ }
637
+ function Ie() {
638
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
639
+ if (Reflect.construct.sham) return false;
640
+ if (typeof Proxy === "function") return true;
641
+ try {
642
+ Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
643
+ return true;
644
+ } catch (e) {
645
+ return false;
646
+ }
647
+ }
648
+ function Pe(e) {
649
+ Pe = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
650
+ return t.__proto__ || Object.getPrototypeOf(t);
651
+ };
652
+ return Pe(e);
653
+ }
654
+ function _e(e, t, r) {
655
+ if (t in e) {
656
+ Object.defineProperty(e, t, {
657
+ value: r,
658
+ enumerable: true,
659
+ configurable: true,
660
+ writable: true
661
+ });
662
+ } else {
663
+ e[t] = r;
664
+ }
665
+ return e;
666
+ }
667
+ /** @public */ var Ee = {
668
+ children: i().node,
669
+ initialFocus: i().oneOfType([ i().object, i().oneOf([ "first", "container" ]) ]),
670
+ onRequestClose: i().func,
671
+ open: i().bool,
672
+ divider: i().oneOf([ "header", "footer", "both", "none" ])
673
+ };
674
+ var Te = {
675
+ initialFocus: "first",
676
+ open: false,
677
+ divider: "both"
678
+ };
679
+ var Me = function(e) {
680
+ we(o, e);
681
+ var t = ke(o);
682
+ // @docs-props-type ModalPropsBase
683
+ // this timeout ensures that the Modal is finished rendering before setting the focus
684
+ function o(e) {
685
+ var i;
686
+ ge(this, o);
687
+ i = t.call(this, e);
688
+ _e(Ce(i), "el", null);
689
+ _e(Ce(i), "initialFocusTimeoutId", undefined);
690
+ _e(Ce(i), "initialFocus", null);
691
+ _e(Ce(i), "headerTitleId", void 0);
692
+ _e(Ce(i), "getDefaultMotionStyle", (function() {
693
+ return {
694
+ top: 0
695
+ };
696
+ }));
697
+ _e(Ce(i), "getMotionStyle", (function() {
698
+ if (i.props.open) {
699
+ return {
700
+ top: 40
701
+ };
702
+ }
703
+ return {
704
+ top: 0
705
+ };
706
+ }));
707
+ _e(Ce(i), "handleInitialFocus", (function() {
708
+ var e = i.props, t = e.initialFocus, r = e.open;
709
+ if (r) {
710
+ i.initialFocusTimeoutId = l()((function() {
711
+ var e;
712
+ // not using the takeFocus() util here because it
713
+ // doesn't work for all values of "initialFocus"
714
+ // and it has a nested defer() call, which we want to avoid
715
+ if (i.initialFocus !== t) {
716
+ if (t === "first") {
717
+ if (i.el) {
718
+ /* eslint-disable prefer-destructuring */
719
+ /* prefer-desturucting leads to harder-to-read syntax in this case */
720
+ e = (0, y.getSortedTabbableElements)(i.el)[0];
721
+ /* eslint-enable prefer-destructuring */ }
722
+ } else if (t === "container") {
723
+ e = i.el;
724
+ } else if (he(t) === "object") {
725
+ e = t;
726
+ }
727
+ // Typescript isn't happy with optional chaining here
728
+ if (e != null && "focus" in e) {
729
+ e.focus();
730
+ }
731
+ i.initialFocus = t;
732
+ }
733
+ }));
734
+ } else {
735
+ i.initialFocus = null;
736
+ clearTimeout(i.initialFocusTimeoutId);
737
+ }
738
+ }));
739
+ _e(Ce(i), "handleModalMount", (function(e) {
740
+ i.el = e;
741
+ }));
742
+ _e(Ce(i), "handleModalKeyDown", (function(e) {
743
+ if (i.el !== null) {
744
+ (0, y.handleTab)(i.el, e.nativeEvent);
745
+ }
746
+ }));
747
+ _e(Ce(i), "handleRequestClose", (function(e) {
748
+ var t, r;
749
+ i.initialFocus = null;
750
+ (t = (r = i.props).onRequestClose) === null || t === void 0 ? void 0 : t.call(r, e);
751
+ }));
752
+ _e(Ce(i), "renderModal", (function(e) {
753
+ var t = i.props, a = t.style, l = t.children, c = t.divider;
754
+ var u = e.top, f = e.opacity;
755
+ var d = r.Children.toArray(l).filter(r.isValidElement);
756
+
757
+ return n().createElement(ce, se({
758
+ ref: i.handleModalMount,
759
+ "data-test": "modal",
760
+ style: ve(ve({}, a), {}, {
761
+ top: u,
762
+ opacity: f
763
+ }),
764
+ tabIndex: -1,
765
+ onKeyDown: i.handleModalKeyDown,
766
+ role: "dialog",
767
+ "aria-labelledby": i.headerTitleId
768
+ }, p()(i.props, [].concat(ue(s()(o.propTypes)), [ "style" ]))), n().createElement(H.Provider, {
769
+ value: {
770
+ titleId: i.headerTitleId,
771
+ divider: c
772
+ }
773
+ }, d));
774
+ }));
775
+ i.headerTitleId = (0, b.createDOMID)("titleId");
776
+ return i;
777
+ }
778
+ Oe(o, [ {
779
+ key: "componentDidMount",
780
+ value: function e() {
781
+ this.handleInitialFocus();
782
+ }
783
+ }, {
784
+ key: "componentDidUpdate",
785
+ value: function e(t) {
786
+ var r = this.props.initialFocus;
787
+ if (t.initialFocus !== r) {
788
+ // cancel the defer() set up in handleInitialFocus()
789
+ // so that focus won't jump around if "initialFocus" changes
790
+ clearTimeout(this.initialFocusTimeoutId);
791
+ }
792
+ this.handleInitialFocus();
793
+ }
794
+ }, {
795
+ key: "render",
796
+ value: function e() {
797
+
798
+ return n().createElement(d(), {
799
+ open: this.props.open,
800
+ getDefaultMotionStyle: this.getDefaultMotionStyle,
801
+ renderModal: this.renderModal,
802
+ getMotionStyle: this.getMotionStyle,
803
+ onRequestClose: this.handleRequestClose
804
+ });
805
+ }
806
+ } ]);
807
+ return o;
808
+ }(r.Component);
809
+ _e(Me, "propTypes", Ee);
810
+ _e(Me, "defaultProps", Te);
811
+ _e(Me, "Header", ae);
812
+ _e(Me, "Body", F);
813
+ _e(Me, "Footer", K);
814
+ /* harmony default export */ const qe = Me;
815
+ // CONCATENATED MODULE: ./src/Modal/index.ts
816
+ module.exports = t;
817
+ /******/})();