@splunk/react-ui 4.38.0 → 4.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/Accordion.js +131 -153
  2. package/Anchor.js +50 -58
  3. package/Animation.js +64 -59
  4. package/AnimationToggle.js +59 -61
  5. package/Box.js +59 -67
  6. package/Breadcrumbs.js +113 -127
  7. package/Button.js +151 -169
  8. package/ButtonGroup.js +41 -49
  9. package/ButtonSimple.js +264 -295
  10. package/CHANGELOG.md +49 -0
  11. package/Calendar.js +353 -414
  12. package/Card.js +186 -244
  13. package/CardLayout.js +86 -83
  14. package/Chip.js +136 -146
  15. package/Clickable.js +180 -198
  16. package/CloseButton.js +52 -60
  17. package/Code.js +24 -31
  18. package/CollapsiblePanel.js +172 -202
  19. package/Color.js +371 -412
  20. package/ColumnLayout.js +72 -96
  21. package/ComboBox.js +266 -303
  22. package/Concertina.js +406 -454
  23. package/ControlGroup.js +178 -210
  24. package/Date.js +116 -131
  25. package/DefinitionList.js +125 -149
  26. package/Divider.js +81 -79
  27. package/Dropdown.js +226 -237
  28. package/DualListbox.js +150 -186
  29. package/EventListener.js +4 -1
  30. package/File.js +1032 -955
  31. package/FormRows.js +281 -334
  32. package/Heading.js +27 -35
  33. package/Image.js +101 -116
  34. package/JSONTree.js +301 -344
  35. package/Layer.js +118 -126
  36. package/Link.js +141 -159
  37. package/List.js +61 -77
  38. package/MIGRATION.mdx +123 -38
  39. package/Markdown.js +288 -347
  40. package/Menu.js +506 -532
  41. package/Message.js +197 -207
  42. package/MessageBar.js +58 -66
  43. package/Modal.js +241 -290
  44. package/ModalLayer.js +130 -148
  45. package/Monogram.js +138 -138
  46. package/Multiselect.js +3137 -3433
  47. package/Number.js +164 -178
  48. package/Paginator.js +296 -335
  49. package/Paragraph.js +24 -32
  50. package/Popover.js +450 -442
  51. package/Progress.js +65 -75
  52. package/RadioBar.js +301 -303
  53. package/RadioList.js +77 -119
  54. package/Resize.js +105 -127
  55. package/ResultsMenu.js +373 -385
  56. package/ScreenReaderContent.js +50 -58
  57. package/Scroll.js +209 -244
  58. package/Search.js +379 -391
  59. package/Select.js +2085 -2345
  60. package/SidePanel.js +122 -142
  61. package/Slider.js +132 -145
  62. package/SlidingPanels.js +238 -270
  63. package/SplitButton.d.ts +2 -0
  64. package/SplitButton.js +222 -245
  65. package/StaticContent.js +68 -76
  66. package/StepBar.js +206 -205
  67. package/Switch.js +176 -205
  68. package/TabBar.js +235 -268
  69. package/TabLayout.js +122 -141
  70. package/Table.js +2103 -2261
  71. package/Text.js +379 -493
  72. package/TextArea.js +411 -441
  73. package/Tooltip.js +116 -132
  74. package/TransitionOpen.js +160 -178
  75. package/Tree.js +268 -287
  76. package/Typography.js +48 -52
  77. package/WaitSpinner.js +61 -69
  78. package/cypress/support/commands.ts +9 -0
  79. package/cypress/support/index.d.ts +6 -0
  80. package/cypress/tsconfig.cypress.json +1 -0
  81. package/docker-compose.yml +0 -1
  82. package/package.json +15 -15
  83. package/types/src/Button/Button.d.ts +5 -1
  84. package/types/src/ButtonSimple/ButtonSimple.d.ts +2 -2
  85. package/types/src/Card/Card.d.ts +1 -0
  86. package/types/src/Card/Footer.d.ts +1 -0
  87. package/types/src/Chip/Chip.d.ts +3 -6
  88. package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +1 -1
  89. package/types/src/Color/Color.d.ts +2 -2
  90. package/types/src/Color/Palette.d.ts +4 -2
  91. package/types/src/ComboBox/ComboBox.d.ts +1 -1
  92. package/types/src/ComboBox/Option.d.ts +1 -1
  93. package/types/src/ControlGroup/ControlGroup.d.ts +1 -2
  94. package/types/src/Date/Date.d.ts +2 -2
  95. package/types/src/File/File.d.ts +2 -3
  96. package/types/src/File/Retry.d.ts +1 -2
  97. package/types/src/Menu/Item.d.ts +18 -5
  98. package/types/src/Menu/Menu.d.ts +3 -3
  99. package/types/src/Menu/docs/examples/Adornments.d.ts +2 -0
  100. package/types/src/Menu/docs/examples/SelectableWithAdornments.d.ts +2 -0
  101. package/types/src/ModalLayer/ModalLayer.d.ts +1 -1
  102. package/types/src/Multiselect/Compact.d.ts +1 -1
  103. package/types/src/Multiselect/Multiselect.d.ts +1 -1
  104. package/types/src/Multiselect/Normal.d.ts +1 -1
  105. package/types/src/Multiselect/Option.d.ts +2 -0
  106. package/types/src/Number/Number.d.ts +3 -3
  107. package/types/src/Popover/Popover.d.ts +3 -4
  108. package/types/src/RadioBar/RadioBar.d.ts +2 -2
  109. package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.d.ts +1 -1
  110. package/types/src/ScrollContainerContext/ScrollContainerContext.d.ts +2 -2
  111. package/types/src/Search/Option.d.ts +9 -3
  112. package/types/src/Select/Option.d.ts +3 -1
  113. package/types/src/Select/OptionBase.d.ts +7 -5
  114. package/types/src/Select/Select.d.ts +4 -2
  115. package/types/src/Select/SelectAllOption.d.ts +4 -4
  116. package/types/src/Select/SelectBase.d.ts +104 -66
  117. package/types/src/Select/docs/examples/Appearance.d.ts +0 -2
  118. package/types/src/SidePanel/SidePanel.d.ts +1 -1
  119. package/types/src/Slider/Slider.d.ts +2 -2
  120. package/types/src/SlidingPanels/SlidingPanels.d.ts +1 -1
  121. package/types/src/StepBar/Step.d.ts +1 -2
  122. package/types/src/Switch/Switch.d.ts +0 -1
  123. package/types/src/TabBar/Tab.d.ts +1 -1
  124. package/types/src/TabBar/TabBar.d.ts +3 -1
  125. package/types/src/TabLayout/TabLayout.d.ts +2 -0
  126. package/types/src/Table/Cell.d.ts +0 -2
  127. package/types/src/Table/HeadDropdownCell.d.ts +2 -0
  128. package/types/src/Table/HeadInner.d.ts +5 -1
  129. package/types/src/Table/Table.d.ts +0 -1
  130. package/types/src/Table/docs/examples/StripeRows.d.ts +2 -0
  131. package/types/src/Text/IconOutlinedHide.d.ts +1 -2
  132. package/types/src/Text/IconOutlinedView.d.ts +1 -2
  133. package/types/src/Text/Text.d.ts +2 -2
  134. package/types/src/TextArea/TextArea.d.ts +2 -2
  135. package/types/src/Tooltip/Tooltip.d.ts +4 -4
  136. package/types/src/TransitionOpen/TransitionOpen.d.ts +1 -1
  137. package/types/src/WaitSpinner/WaitSpinner.d.ts +0 -1
  138. package/types/src/useControlled/index.d.ts +2 -0
  139. package/types/src/useControlled/useControlled.d.ts +21 -0
  140. package/types/src/useResizeObserver/index.d.ts +2 -0
  141. package/types/src/useResizeObserver/useResizeObserver.d.ts +12 -0
  142. package/useControlled.js +112 -0
  143. package/useForceUpdate.js +30 -32
  144. package/useKeyPress.d.ts +2 -0
  145. package/useKeyPress.js +1 -1
  146. package/useResizeObserver.d.ts +2 -0
  147. package/useResizeObserver.js +137 -0
  148. package/types/src/ButtonGroup/docs/examples/prisma/Basic.d.ts +0 -1
  149. package/types/src/Chip/docs/examples/Basic.d.ts +0 -2
  150. package/types/src/Chip/docs/examples/prisma/Appearance.d.ts +0 -2
  151. package/types/src/Color/docs/examples/prisma/Controlled.d.ts +0 -2
  152. package/types/src/Color/docs/examples/prisma/ThemeVariables.d.ts +0 -1
  153. package/types/src/Color/docs/examples/prisma/Uncontrolled.d.ts +0 -2
  154. package/types/src/Dropdown/docs/examples/prisma/Basic.d.ts +0 -2
  155. package/types/src/Dropdown/docs/examples/prisma/BasicMenu.d.ts +0 -2
  156. package/types/src/Dropdown/docs/examples/prisma/ControlledDropdown.d.ts +0 -2
  157. package/types/src/Dropdown/docs/examples/prisma/Dialog.d.ts +0 -2
  158. package/types/src/Dropdown/docs/examples/prisma/OtherToggles.d.ts +0 -2
  159. package/types/src/Dropdown/docs/examples/prisma/ScrollingMenu.d.ts +0 -2
  160. package/types/src/File/docs/examples/prisma/Disabled.d.ts +0 -12
  161. package/types/src/File/docs/examples/prisma/Error.d.ts +0 -1
  162. package/types/src/Menu/docs/examples/Icons.d.ts +0 -2
  163. package/types/src/Menu/docs/examples/SelectableWithIcons.d.ts +0 -2
  164. package/types/src/Message/docs/examples/prisma/Title.d.ts +0 -2
  165. package/types/src/TabBar/docs/examples/prisma/Context.d.ts +0 -2
  166. package/types/src/TabLayout/docs/examples/prisma/Context.d.ts +0 -2
  167. package/types/src/Table/docs/examples/prisma/Basic.d.ts +0 -2
  168. package/types/src/WaitSpinner/docs/examples/prisma/Basic.d.ts +0 -2
  169. /package/types/src/Color/docs/examples/{prisma/CustomizedPalette.d.ts → CustomizedPalette.d.ts} +0 -0
  170. /package/types/src/Color/docs/examples/{prisma/HideInput.d.ts → HideInput.d.ts} +0 -0
  171. /package/types/src/StepBar/docs/examples/{prisma/Error.d.ts → Error.d.ts} +0 -0
  172. /package/types/src/TabBar/docs/examples/{prisma/Disabled.d.ts → Disabled.d.ts} +0 -0
package/Concertina.js CHANGED
@@ -61,8 +61,8 @@
61
61
  e.r(t);
62
62
  // EXPORTS
63
63
  e.d(t, {
64
- Panel: () => /* reexport */ je,
65
- default: () => /* reexport */ Ve
64
+ Panel: () => /* reexport */ xe,
65
+ default: () => /* reexport */ Xe
66
66
  });
67
67
  // CONCATENATED MODULE: external "react"
68
68
  const n = require("react");
@@ -74,183 +74,168 @@
74
74
  const a = require("lodash/debounce");
75
75
  var l = e.n(a);
76
76
  // CONCATENATED MODULE: external "lodash/take"
77
- const s = require("lodash/take");
78
- var c = e.n(s);
77
+ const c = require("lodash/take");
78
+ var s = e.n(c);
79
79
  // CONCATENATED MODULE: external "lodash/takeRight"
80
80
  const u = require("lodash/takeRight");
81
- var f = e.n(u);
81
+ var p = e.n(u);
82
82
  // CONCATENATED MODULE: external "@splunk/react-ui/EventListener"
83
- const p = require("@splunk/react-ui/EventListener");
84
- var d = e.n(p);
83
+ const f = require("@splunk/react-ui/EventListener");
84
+ var d = e.n(f);
85
85
  // CONCATENATED MODULE: external "lodash/keys"
86
- const h = require("lodash/keys");
87
- var y = e.n(h);
86
+ const b = require("lodash/keys");
87
+ var h = e.n(b);
88
88
  // CONCATENATED MODULE: external "lodash/omit"
89
- const b = require("lodash/omit");
90
- var v = e.n(b);
89
+ const y = require("lodash/omit");
90
+ var v = e.n(y);
91
91
  // CONCATENATED MODULE: external "styled-components"
92
92
  const g = require("styled-components");
93
93
  var m = e.n(g);
94
94
  // CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
95
- const k = require("@splunk/react-ui/Clickable");
96
- var S = e.n(k);
95
+ const w = require("@splunk/react-ui/Clickable");
96
+ var O = e.n(w);
97
97
  // CONCATENATED MODULE: external "@splunk/themes"
98
- const w = require("@splunk/themes");
98
+ const S = require("@splunk/themes");
99
99
  // CONCATENATED MODULE: ./src/Concertina/HeadingStyles.ts
100
- var C = m()(S()).withConfig({
100
+ var k = m()(O()).withConfig({
101
101
  displayName: "HeadingStyles__StyledClickable",
102
102
  componentId: "sc-1h92oaj-0"
103
- })([ "display:block;width:100%;cursor:pointer;position:relative;padding:6px ", ";line-height:", ";border-radius:0;color:", ";", " &:focus:not([disabled]){box-shadow:", ";}", "" ], w.variables.spacingLarge, w.variables.lineHeight, w.variables.textColor, (0,
104
- w.pickVariant)("$inner", {
105
- true: (0, g.css)([ "*:not(:first-child) > &&{border-top:2px solid ", ";}*:not(:last-child) > &&{border-bottom:2px solid ", ";}" ], w.variables.backgroundColor, w.variables.backgroundColor),
106
- false: (0, g.css)([ "& + &&{border-top:2px solid ", ";}" ], w.variables.backgroundColor)
107
- }), w.variables.focusShadowInset, (0, w.pickVariant)("$status", {
103
+ })([ "display:block;width:100%;cursor:pointer;position:relative;padding:6px ", ";line-height:", ";border-radius:0;color:", ";", " &:focus:not([disabled]){box-shadow:", ";}", "" ], S.variables.spacingLarge, S.variables.lineHeight, S.variables.textColor, (0,
104
+ S.pickVariant)("$inner", {
105
+ true: (0, g.css)([ "*:not(:first-child) > &&{border-top:2px solid ", ";}*:not(:last-child) > &&{border-bottom:2px solid ", ";}" ], S.variables.backgroundColor, S.variables.backgroundColor),
106
+ false: (0, g.css)([ "& + &&{border-top:2px solid ", ";}" ], S.variables.backgroundColor)
107
+ }), S.variables.focusShadowInset, (0, S.pickVariant)("$status", {
108
108
  normal: (0, g.css)([ "background-color:", ";&:hover:not([disabled]){background-color:", ";}" ], (0,
109
- w.pick)({
110
- dark: w.variables.gray45,
111
- light: w.variables.gray96
112
- }), (0, w.pick)({
113
- dark: w.variables.gray30,
114
- light: w.variables.gray92
109
+ S.pick)({
110
+ dark: S.variables.gray45,
111
+ light: S.variables.gray96
112
+ }), (0, S.pick)({
113
+ dark: S.variables.gray30,
114
+ light: S.variables.gray92
115
115
  })),
116
- disabled: (0, g.css)([ "background-color:", ";" ], (0, w.pick)({
117
- dark: w.variables.gray80,
118
- light: w.variables.gray96
116
+ disabled: (0, g.css)([ "background-color:", ";" ], (0, S.pick)({
117
+ dark: S.variables.gray80,
118
+ light: S.variables.gray96
119
119
  })),
120
- error: (0, g.css)([ "background-color:", ";color:", ";&:hover:not([disabled]){background-color:", ";}" ], w.variables.errorColor, w.variables.white, w.variables.errorColorD10),
121
- warning: (0, g.css)([ "background-color:", ";color:", ";&:hover:not([disabled]){background-color:", ";box-shadow:none;}" ], w.variables.warningColor, w.variables.white, w.variables.warningColorD10)
120
+ error: (0, g.css)([ "background-color:", ";color:", ";&:hover:not([disabled]){background-color:", ";}" ], S.variables.errorColor, S.variables.white, S.variables.errorColorD10),
121
+ warning: (0, g.css)([ "background-color:", ";color:", ";&:hover:not([disabled]){background-color:", ";box-shadow:none;}" ], S.variables.warningColor, S.variables.white, S.variables.warningColorD10)
122
122
  }));
123
- var O = m().span.withConfig({
123
+ var C = m().span.withConfig({
124
124
  displayName: "HeadingStyles__StyledHeadingContent",
125
125
  componentId: "sc-1h92oaj-1"
126
126
  })([ "display:flex;justify-content:space-between;" ]);
127
- var P = m().span.withConfig({
127
+ var j = m().span.withConfig({
128
128
  displayName: "HeadingStyles__StyledDescription",
129
129
  componentId: "sc-1h92oaj-2"
130
- })([ "font-size:", ";" ], w.variables.fontSizeSmall);
130
+ })([ "font-size:", ";" ], S.variables.fontSizeSmall);
131
131
  // CONCATENATED MODULE: ./src/Concertina/Heading.tsx
132
- function j(e) {
132
+ function P(e) {
133
133
  "@babel/helpers - typeof";
134
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
135
- j = function e(t) {
136
- return typeof t;
137
- };
138
- } else {
139
- j = function e(t) {
140
- return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
141
- };
142
- }
143
- return j(e);
134
+ return P = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
135
+ return typeof e;
136
+ } : function(e) {
137
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
138
+ }, P(e);
144
139
  }
145
140
  function E() {
146
- E = Object.assign || function(e) {
141
+ return E = Object.assign ? Object.assign.bind() : function(e) {
147
142
  for (var t = 1; t < arguments.length; t++) {
148
143
  var n = arguments[t];
149
144
  for (var r in n) {
150
- if (Object.prototype.hasOwnProperty.call(n, r)) {
151
- e[r] = n[r];
152
- }
145
+ ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
153
146
  }
154
147
  }
155
148
  return e;
156
- };
157
- return E.apply(this, arguments);
158
- }
159
- function x(e, t) {
160
- if (!(e instanceof t)) {
161
- throw new TypeError("Cannot call a class as a function");
162
- }
149
+ }, E.apply(null, arguments);
163
150
  }
164
151
  function _(e, t) {
152
+ if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
153
+ }
154
+ function T(e, t) {
165
155
  for (var n = 0; n < t.length; n++) {
166
156
  var r = t[n];
167
- r.enumerable = r.enumerable || false;
168
- r.configurable = true;
169
- if ("value" in r) r.writable = true;
170
- Object.defineProperty(e, r.key, r);
157
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0),
158
+ Object.defineProperty(e, A(r.key), r);
171
159
  }
172
160
  }
173
- function H(e, t, n) {
174
- if (t) _(e.prototype, t);
175
- if (n) _(e, n);
176
- return e;
161
+ function x(e, t, n) {
162
+ return t && T(e.prototype, t), n && T(e, n), Object.defineProperty(e, "prototype", {
163
+ writable: !1
164
+ }), e;
177
165
  }
178
- function T(e, t) {
179
- if (typeof t !== "function" && t !== null) {
180
- throw new TypeError("Super expression must either be null or a function");
181
- }
166
+ function H(e, t) {
167
+ if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
182
168
  e.prototype = Object.create(t && t.prototype, {
183
169
  constructor: {
184
170
  value: e,
185
- writable: true,
186
- configurable: true
171
+ writable: !0,
172
+ configurable: !0
187
173
  }
188
- });
189
- if (t) R(e, t);
190
- }
191
- function R(e, t) {
192
- R = Object.setPrototypeOf || function e(t, n) {
193
- t.__proto__ = n;
194
- return t;
195
- };
196
- return R(e, t);
197
- }
198
- function I(e) {
199
- var t = M();
200
- return function n() {
201
- var r = A(e), o;
174
+ }), Object.defineProperty(e, "prototype", {
175
+ writable: !1
176
+ }), t && I(e, t);
177
+ }
178
+ function I(e, t) {
179
+ return I = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
180
+ return e.__proto__ = t, e;
181
+ }, I(e, t);
182
+ }
183
+ function R(e) {
184
+ var t = z();
185
+ return function() {
186
+ var n, r = M(e);
202
187
  if (t) {
203
- var i = A(this).constructor;
204
- o = Reflect.construct(r, arguments, i);
205
- } else {
206
- o = r.apply(this, arguments);
207
- }
208
- return q(this, o);
188
+ var o = M(this).constructor;
189
+ n = Reflect.construct(r, arguments, o);
190
+ } else n = r.apply(this, arguments);
191
+ return q(this, n);
209
192
  };
210
193
  }
211
194
  function q(e, t) {
212
- if (t && (j(t) === "object" || typeof t === "function")) {
213
- return t;
214
- }
215
- return z(e);
195
+ if (t && ("object" == P(t) || "function" == typeof t)) return t;
196
+ if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
197
+ return B(e);
216
198
  }
217
- function z(e) {
218
- if (e === void 0) {
219
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
220
- }
199
+ function B(e) {
200
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
221
201
  return e;
222
202
  }
223
- function M() {
224
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
225
- if (Reflect.construct.sham) return false;
226
- if (typeof Proxy === "function") return true;
203
+ function z() {
227
204
  try {
228
- Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
229
- return true;
230
- } catch (e) {
231
- return false;
232
- }
205
+ var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
206
+ } catch (e) {}
207
+ return (z = function t() {
208
+ return !!e;
209
+ })();
210
+ }
211
+ function M(e) {
212
+ return M = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
213
+ return e.__proto__ || Object.getPrototypeOf(e);
214
+ }, M(e);
215
+ }
216
+ function N(e, t, n) {
217
+ return (t = A(t)) in e ? Object.defineProperty(e, t, {
218
+ value: n,
219
+ enumerable: !0,
220
+ configurable: !0,
221
+ writable: !0
222
+ }) : e[t] = n, e;
233
223
  }
234
224
  function A(e) {
235
- A = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
236
- return t.__proto__ || Object.getPrototypeOf(t);
237
- };
238
- return A(e);
239
- }
240
- function W(e, t, n) {
241
- if (t in e) {
242
- Object.defineProperty(e, t, {
243
- value: n,
244
- enumerable: true,
245
- configurable: true,
246
- writable: true
247
- });
248
- } else {
249
- e[t] = n;
225
+ var t = W(e, "string");
226
+ return "symbol" == P(t) ? t : t + "";
227
+ }
228
+ function W(e, t) {
229
+ if ("object" != P(e) || !e) return e;
230
+ var n = e[Symbol.toPrimitive];
231
+ if (void 0 !== n) {
232
+ var r = n.call(e, t || "default");
233
+ if ("object" != P(r)) return r;
234
+ throw new TypeError("@@toPrimitive must return a primitive value.");
250
235
  }
251
- return e;
236
+ return ("string" === t ? String : Number)(e);
252
237
  }
253
- var B = {
238
+ var D = {
254
239
  children: i().node.isRequired,
255
240
  description: i().node,
256
241
  /** @private */
@@ -263,21 +248,21 @@
263
248
  position: i().oneOf([ "top", "inner", "bottom" ]),
264
249
  status: i().oneOf([ "normal", "warning", "error", "disabled" ])
265
250
  };
266
- var D = {
251
+ var $ = {
267
252
  position: "inner"
268
253
  };
269
- var N = function(e) {
270
- T(n, e);
271
- var t = I(n);
254
+ var U = function(e) {
255
+ H(n, e);
256
+ var t = R(n);
272
257
  function n() {
273
258
  var e;
274
- x(this, n);
259
+ _(this, n);
275
260
  for (var r = arguments.length, o = new Array(r), i = 0; i < r; i++) {
276
261
  o[i] = arguments[i];
277
262
  }
278
263
  e = t.call.apply(t, [ this ].concat(o));
279
- W(z(e), "container", null);
280
- W(z(e), "handleClick", (function(t) {
264
+ N(B(e), "container", null);
265
+ N(B(e), "handleClick", (function(t) {
281
266
  var n, r;
282
267
  (n = (r = e.props).onClick) === null || n === void 0 ? void 0 : n.call(r, t, {
283
268
  index: e.props.index,
@@ -285,13 +270,14 @@
285
270
  position: e.props.position
286
271
  });
287
272
  }));
288
- W(z(e), "handleMount", (function(t) {
273
+ N(B(e), "handleMount", (function(t) {
289
274
  e.container = t;
290
275
  }));
291
276
  return e;
292
277
  }
293
- H(n, [ {
278
+ x(n, [ {
294
279
  key: "focus",
280
+ // eslint-disable-next-line react/no-unused-class-component-methods
295
281
  value: function e() {
296
282
  var t;
297
283
  (t = this.container) === null || t === void 0 ? void 0 : t.focus();
@@ -299,66 +285,66 @@
299
285
  }, {
300
286
  key: "render",
301
287
  value: function e() {
302
- var t = this.props, o = t.children, i = t.description, a = t.panelId, l = t.position, s = t.status;
288
+ var t = this.props, o = t.children, i = t.description, a = t.panelId, l = t.position, c = t.status;
303
289
 
304
- return r().createElement(C, E({
305
- disabled: s === "disabled",
290
+ return r().createElement(k, E({
291
+ disabled: c === "disabled",
306
292
  $inner: l === "inner",
307
- $status: s,
293
+ $status: c,
308
294
  onClick: this.handleClick,
309
295
  ref: this.handleMount,
310
296
  "data-test": "heading",
311
297
  "data-test-panel-id": a
312
- }, v()(this.props, y()(n.propTypes))), r().createElement(O, null, r().createElement("span", {
298
+ }, v()(this.props, h()(n.propTypes))), r().createElement(C, null, r().createElement("span", {
313
299
  "data-concertina-role": "title"
314
- }, o), i && r().createElement(P, {
300
+ }, o), i && r().createElement(j, {
315
301
  "data-concertina-role": "description"
316
302
  }, i)));
317
303
  }
318
304
  } ]);
319
305
  return n;
320
306
  }(n.Component);
321
- W(N, "propTypes", B);
322
- W(N, "defaultProps", D);
323
- /* harmony default export */ const $ = N;
307
+ N(U, "propTypes", D);
308
+ N(U, "defaultProps", $);
309
+ /* harmony default export */ const L = U;
324
310
  // CONCATENATED MODULE: external "lodash/throttle"
325
- const U = require("lodash/throttle");
326
- var L = e.n(U);
327
- // CONCATENATED MODULE: external "@splunk/react-ui/Box"
328
- const V = require("@splunk/react-ui/Box");
311
+ const V = require("lodash/throttle");
329
312
  var F = e.n(V);
330
- // CONCATENATED MODULE: external "@splunk/react-ui/Scroll"
331
- const G = require("@splunk/react-ui/Scroll");
313
+ // CONCATENATED MODULE: external "@splunk/react-ui/Box"
314
+ const G = require("@splunk/react-ui/Box");
332
315
  var J = e.n(G);
316
+ // CONCATENATED MODULE: external "@splunk/react-ui/Scroll"
317
+ const K = require("@splunk/react-ui/Scroll");
318
+ var Q = e.n(K);
333
319
  // CONCATENATED MODULE: ./src/Concertina/ConcertinaStyles.ts
334
- var K = (0, g.css)([ "position:absolute;left:0;top:0;right:0;bottom:0;" ]);
335
- var Q = m()(J()).withConfig({
320
+ var X = (0, g.css)([ "position:absolute;left:0;top:0;right:0;bottom:0;" ]);
321
+ var Y = m()(Q()).withConfig({
336
322
  displayName: "ConcertinaStyles__StyledScroll",
337
323
  componentId: "sc-1fzuh39-0"
338
- })([ "", "" ], K);
339
- var X = m()(F()).withConfig({
324
+ })([ "", "" ], X);
325
+ var Z = m()(J()).withConfig({
340
326
  displayName: "ConcertinaStyles__StyledBox",
341
327
  componentId: "sc-1fzuh39-1"
342
- })([ "", " overflow:hidden;" ], K);
343
- var Y = m().div.withConfig({
328
+ })([ "", " overflow:hidden;" ], X);
329
+ var ee = m().div.withConfig({
344
330
  displayName: "ConcertinaStyles__StyledTop",
345
331
  componentId: "sc-1fzuh39-2"
346
- })([ "position:absolute;left:0;top:0;right:0;z-index:1;background-color:", ";&::after{content:'';position:absolute;bottom:-10px;height:10px;left:0;right:0;background-image:linear-gradient(180deg,rgba(0,0,0,0.15),rgba(0,0,0,0));}" ], w.variables.backgroundColor);
347
- var Z = m().div.withConfig({
332
+ })([ "position:absolute;left:0;top:0;right:0;z-index:1;background-color:", ";&::after{content:'';position:absolute;bottom:-10px;height:10px;left:0;right:0;background-image:linear-gradient(180deg,rgba(0,0,0,0.15),rgba(0,0,0,0));}" ], S.variables.backgroundColor);
333
+ var te = m().div.withConfig({
348
334
  displayName: "ConcertinaStyles__StyledBottom",
349
335
  componentId: "sc-1fzuh39-3"
350
- })([ "position:absolute;left:0;bottom:0;right:0;background-color:", ";&::before{content:'';position:absolute;top:-5px;height:5px;left:0;right:0;background-image:linear-gradient(0deg,rgba(0,0,0,0.15),rgba(0,0,0,0));}" ], w.variables.backgroundColor);
351
- var ee = m().div.withConfig({
336
+ })([ "position:absolute;left:0;bottom:0;right:0;background-color:", ";&::before{content:'';position:absolute;top:-5px;height:5px;left:0;right:0;background-image:linear-gradient(0deg,rgba(0,0,0,0.15),rgba(0,0,0,0));}" ], S.variables.backgroundColor);
337
+ var ne = m().div.withConfig({
352
338
  displayName: "ConcertinaStyles__StyledPanelBody",
353
339
  componentId: "sc-1fzuh39-4"
354
- })([ "", "" ], (0, w.pickVariant)("$status", {
340
+ })([ "", "" ], (0, S.pickVariant)("$status", {
355
341
  error: {
356
- dark: (0, g.css)([ "background-color:", ";" ], w.mixins.colorWithAlpha(w.variables.errorColor, .5)),
357
- light: (0, g.css)([ "background-color:", ";" ], w.variables.errorColorL50)
342
+ dark: (0, g.css)([ "background-color:", ";" ], S.mixins.colorWithAlpha(S.variables.errorColor, .5)),
343
+ light: (0, g.css)([ "background-color:", ";" ], S.variables.errorColorL50)
358
344
  },
359
345
  warning: {
360
- dark: (0, g.css)([ "background-color:", ";" ], w.mixins.colorWithAlpha(w.variables.warningColor, .5)),
361
- light: (0, g.css)([ "background-color:", ";" ], w.variables.warningColorL50)
346
+ dark: (0, g.css)([ "background-color:", ";" ], S.mixins.colorWithAlpha(S.variables.warningColor, .5)),
347
+ light: (0, g.css)([ "background-color:", ";" ], S.variables.warningColorL50)
362
348
  },
363
349
  disabled: (0, g.css)([ "display:none;" ])
364
350
  }));
@@ -369,7 +355,7 @@
369
355
  * @param ref - The React callback or object ref. Can be `null` or `undefined`.
370
356
  * @param current - The new value of the ref.
371
357
  */
372
- function te(e, t) {
358
+ function re(e, t) {
373
359
  if (e) {
374
360
  if (typeof e === "function") {
375
361
  e(t);
@@ -382,159 +368,143 @@
382
368
  }
383
369
  }
384
370
  // CONCATENATED MODULE: ./src/Concertina/ConcertinaContext.tsx
385
- var ne = (0, n.createContext)({});
386
- ne.displayName = "Concertina";
387
- /* harmony default export */ const re = ne;
371
+ var oe = (0, n.createContext)({});
372
+ oe.displayName = "Concertina";
373
+ /* harmony default export */ const ie = oe;
388
374
  // CONCATENATED MODULE: ./src/Concertina/Panel.tsx
389
- function oe(e) {
375
+ function ae(e) {
390
376
  "@babel/helpers - typeof";
391
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
392
- oe = function e(t) {
393
- return typeof t;
394
- };
395
- } else {
396
- oe = function e(t) {
397
- return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
398
- };
399
- }
400
- return oe(e);
377
+ return ae = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
378
+ return typeof e;
379
+ } : function(e) {
380
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
381
+ }, ae(e);
401
382
  }
402
- function ie() {
403
- ie = Object.assign || function(e) {
383
+ function le() {
384
+ return le = Object.assign ? Object.assign.bind() : function(e) {
404
385
  for (var t = 1; t < arguments.length; t++) {
405
386
  var n = arguments[t];
406
387
  for (var r in n) {
407
- if (Object.prototype.hasOwnProperty.call(n, r)) {
408
- e[r] = n[r];
409
- }
388
+ ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
410
389
  }
411
390
  }
412
391
  return e;
413
- };
414
- return ie.apply(this, arguments);
392
+ }, le.apply(null, arguments);
415
393
  }
416
- function ae(e) {
417
- return ue(e) || ce(e) || se(e) || le();
394
+ function ce(e) {
395
+ return fe(e) || pe(e) || ue(e) || se();
418
396
  }
419
- function le() {
397
+ function se() {
420
398
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
421
399
  }
422
- function se(e, t) {
423
- if (!e) return;
424
- if (typeof e === "string") return fe(e, t);
425
- var n = Object.prototype.toString.call(e).slice(8, -1);
426
- if (n === "Object" && e.constructor) n = e.constructor.name;
427
- if (n === "Map" || n === "Set") return Array.from(e);
428
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return fe(e, t);
400
+ function ue(e, t) {
401
+ if (e) {
402
+ if ("string" == typeof e) return de(e, t);
403
+ var n = {}.toString.call(e).slice(8, -1);
404
+ return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? de(e, t) : void 0;
405
+ }
429
406
  }
430
- function ce(e) {
431
- if (typeof Symbol !== "undefined" && Symbol.iterator in Object(e)) return Array.from(e);
407
+ function pe(e) {
408
+ if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
432
409
  }
433
- function ue(e) {
434
- if (Array.isArray(e)) return fe(e);
410
+ function fe(e) {
411
+ if (Array.isArray(e)) return de(e);
435
412
  }
436
- function fe(e, t) {
437
- if (t == null || t > e.length) t = e.length;
438
- for (var n = 0, r = new Array(t); n < t; n++) {
413
+ function de(e, t) {
414
+ (null == t || t > e.length) && (t = e.length);
415
+ for (var n = 0, r = Array(t); n < t; n++) {
439
416
  r[n] = e[n];
440
417
  }
441
418
  return r;
442
419
  }
443
- function pe(e, t) {
444
- if (!(e instanceof t)) {
445
- throw new TypeError("Cannot call a class as a function");
446
- }
420
+ function be(e, t) {
421
+ if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
447
422
  }
448
- function de(e, t) {
423
+ function he(e, t) {
449
424
  for (var n = 0; n < t.length; n++) {
450
425
  var r = t[n];
451
- r.enumerable = r.enumerable || false;
452
- r.configurable = true;
453
- if ("value" in r) r.writable = true;
454
- Object.defineProperty(e, r.key, r);
426
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0),
427
+ Object.defineProperty(e, je(r.key), r);
455
428
  }
456
429
  }
457
- function he(e, t, n) {
458
- if (t) de(e.prototype, t);
459
- if (n) de(e, n);
460
- return e;
430
+ function ye(e, t, n) {
431
+ return t && he(e.prototype, t), n && he(e, n), Object.defineProperty(e, "prototype", {
432
+ writable: !1
433
+ }), e;
461
434
  }
462
- function ye(e, t) {
463
- if (typeof t !== "function" && t !== null) {
464
- throw new TypeError("Super expression must either be null or a function");
465
- }
435
+ function ve(e, t) {
436
+ if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
466
437
  e.prototype = Object.create(t && t.prototype, {
467
438
  constructor: {
468
439
  value: e,
469
- writable: true,
470
- configurable: true
440
+ writable: !0,
441
+ configurable: !0
471
442
  }
472
- });
473
- if (t) be(e, t);
443
+ }), Object.defineProperty(e, "prototype", {
444
+ writable: !1
445
+ }), t && ge(e, t);
474
446
  }
475
- function be(e, t) {
476
- be = Object.setPrototypeOf || function e(t, n) {
477
- t.__proto__ = n;
478
- return t;
479
- };
480
- return be(e, t);
447
+ function ge(e, t) {
448
+ return ge = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
449
+ return e.__proto__ = t, e;
450
+ }, ge(e, t);
481
451
  }
482
- function ve(e) {
483
- var t = ke();
484
- return function n() {
485
- var r = Se(e), o;
452
+ function me(e) {
453
+ var t = Se();
454
+ return function() {
455
+ var n, r = ke(e);
486
456
  if (t) {
487
- var i = Se(this).constructor;
488
- o = Reflect.construct(r, arguments, i);
489
- } else {
490
- o = r.apply(this, arguments);
491
- }
492
- return ge(this, o);
457
+ var o = ke(this).constructor;
458
+ n = Reflect.construct(r, arguments, o);
459
+ } else n = r.apply(this, arguments);
460
+ return we(this, n);
493
461
  };
494
462
  }
495
- function ge(e, t) {
496
- if (t && (oe(t) === "object" || typeof t === "function")) {
497
- return t;
498
- }
499
- return me(e);
463
+ function we(e, t) {
464
+ if (t && ("object" == ae(t) || "function" == typeof t)) return t;
465
+ if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
466
+ return Oe(e);
500
467
  }
501
- function me(e) {
502
- if (e === void 0) {
503
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
504
- }
468
+ function Oe(e) {
469
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
505
470
  return e;
506
471
  }
507
- function ke() {
508
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
509
- if (Reflect.construct.sham) return false;
510
- if (typeof Proxy === "function") return true;
472
+ function Se() {
511
473
  try {
512
- Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
513
- return true;
514
- } catch (e) {
515
- return false;
474
+ var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
475
+ } catch (e) {}
476
+ return (Se = function t() {
477
+ return !!e;
478
+ })();
479
+ }
480
+ function ke(e) {
481
+ return ke = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
482
+ return e.__proto__ || Object.getPrototypeOf(e);
483
+ }, ke(e);
484
+ }
485
+ function Ce(e, t, n) {
486
+ return (t = je(t)) in e ? Object.defineProperty(e, t, {
487
+ value: n,
488
+ enumerable: !0,
489
+ configurable: !0,
490
+ writable: !0
491
+ }) : e[t] = n, e;
492
+ }
493
+ function je(e) {
494
+ var t = Pe(e, "string");
495
+ return "symbol" == ae(t) ? t : t + "";
496
+ }
497
+ function Pe(e, t) {
498
+ if ("object" != ae(e) || !e) return e;
499
+ var n = e[Symbol.toPrimitive];
500
+ if (void 0 !== n) {
501
+ var r = n.call(e, t || "default");
502
+ if ("object" != ae(r)) return r;
503
+ throw new TypeError("@@toPrimitive must return a primitive value.");
516
504
  }
505
+ return ("string" === t ? String : Number)(e);
517
506
  }
518
- function Se(e) {
519
- Se = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
520
- return t.__proto__ || Object.getPrototypeOf(t);
521
- };
522
- return Se(e);
523
- }
524
- function we(e, t, n) {
525
- if (t in e) {
526
- Object.defineProperty(e, t, {
527
- value: n,
528
- enumerable: true,
529
- configurable: true,
530
- writable: true
531
- });
532
- } else {
533
- e[t] = n;
534
- }
535
- return e;
536
- }
537
- var Ce = {
507
+ var Ee = {
538
508
  children: i().node,
539
509
  description: i().node,
540
510
  elementRef: i().oneOfType([ i().func, i().object ]),
@@ -544,19 +514,19 @@
544
514
  status: i().oneOf([ "normal", "warning", "error", "disabled" ]),
545
515
  title: i().node.isRequired
546
516
  };
547
- var Oe = {
517
+ var _e = {
548
518
  status: "normal"
549
519
  };
550
- var Pe = function(e) {
551
- ye(n, e);
552
- var t = ve(n);
520
+ var Te = function(e) {
521
+ ve(n, e);
522
+ var t = me(n);
553
523
  // @docs-props-type PanelPropsBase
554
524
  function n(e) {
555
525
  var r;
556
- pe(this, n);
526
+ be(this, n);
557
527
  r = t.call(this, e);
558
- we(me(r), "lastHeight", void 0);
559
- we(me(r), "measureHeight", (function(e) {
528
+ Ce(Oe(r), "lastHeight", void 0);
529
+ Ce(Oe(r), "measureHeight", (function(e) {
560
530
  var t, n, o;
561
531
  if (!r.state.containerEl || !r.state.bodyEl) {
562
532
  return;
@@ -574,19 +544,19 @@
574
544
  r.lastHeight = i;
575
545
  (n = (o = r.context).onChange) === null || n === void 0 ? void 0 : n.call(o, e, a);
576
546
  }));
577
- we(me(r), "handleResize", L()(r.measureHeight, 300));
578
- we(me(r), "handleMount", (function(e) {
547
+ Ce(Oe(r), "handleResize", F()(r.measureHeight, 300));
548
+ Ce(Oe(r), "handleMount", (function(e) {
579
549
  r.setState({
580
550
  containerEl: e
581
551
  });
582
- te(r.props.elementRef, e);
552
+ re(r.props.elementRef, e);
583
553
  }));
584
- we(me(r), "handleHeadingMount", (function(e) {
554
+ Ce(Oe(r), "handleHeadingMount", (function(e) {
585
555
  r.setState({
586
556
  heading: e
587
557
  });
588
558
  }));
589
- we(me(r), "handleBodyMount", (function(e) {
559
+ Ce(Oe(r), "handleBodyMount", (function(e) {
590
560
  r.setState({
591
561
  bodyEl: e
592
562
  });
@@ -598,7 +568,7 @@
598
568
  };
599
569
  return r;
600
570
  }
601
- he(n, [ {
571
+ ye(n, [ {
602
572
  key: "componentDidUpdate",
603
573
  value: function e(t, n) {
604
574
  if (this.props.children !== t.children || !n.containerEl) {
@@ -612,6 +582,7 @@
612
582
  }
613
583
  }, {
614
584
  key: "focus",
585
+ // eslint-disable-next-line react/no-unused-class-component-methods
615
586
  value: function e() {
616
587
  var t;
617
588
  (t = this.state.heading) === null || t === void 0 ? void 0 : t.focus();
@@ -619,206 +590,186 @@
619
590
  }, {
620
591
  key: "render",
621
592
  value: function e() {
622
- var t = this.props, o = t.children, i = t.description, a = t.index, l = t.panelId, s = t.status, c = t.style, u = t.title;
623
- var f = this.context.onHeadingClick;
593
+ var t = this.props, o = t.children, i = t.description, a = t.index, l = t.panelId, c = t.status, s = t.style, u = t.title;
594
+ var p = this.context.onHeadingClick;
624
595
 
625
- return r().createElement("div", ie({
596
+ return r().createElement("div", le({
626
597
  ref: this.handleMount,
627
598
  "data-test": "panel",
628
599
  "data-test-panel-id": l || "".concat(a)
629
- }, v()(this.props, [].concat(ae(y()(n.propTypes)), [ "style" ]))), r().createElement($, {
630
- onClick: f,
600
+ }, v()(this.props, [].concat(ce(h()(n.propTypes)), [ "style" ]))), r().createElement(L, {
601
+ onClick: p,
631
602
  ref: this.handleHeadingMount,
632
603
  description: i,
633
604
  index: a !== null && a !== void 0 ? a : 0,
634
605
  panelId: l || "".concat(a),
635
606
  position: "inner",
636
- status: s
607
+ status: c
637
608
  }, u), r().createElement(d(), {
638
609
  target: window,
639
610
  eventType: "resize",
640
611
  listener: this.handleResize
641
- }), r().createElement(ee, {
642
- $status: s,
612
+ }), r().createElement(ne, {
613
+ $status: c,
643
614
  "data-test": "body",
644
- style: c,
615
+ style: s,
645
616
  ref: this.handleBodyMount
646
617
  }, o));
647
618
  }
648
619
  } ]);
649
620
  return n;
650
621
  }(n.Component);
651
- we(Pe, "propTypes", Ce);
652
- we(Pe, "defaultProps", Oe);
653
- we(Pe, "contextType", re);
654
- /* harmony default export */ const je = Pe;
622
+ Ce(Te, "propTypes", Ee);
623
+ Ce(Te, "defaultProps", _e);
624
+ Ce(Te, "contextType", ie);
625
+ /* harmony default export */ const xe = Te;
655
626
  // CONCATENATED MODULE: ./src/Concertina/Concertina.tsx
656
- function Ee(e) {
627
+ function He(e) {
657
628
  "@babel/helpers - typeof";
658
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
659
- Ee = function e(t) {
660
- return typeof t;
661
- };
662
- } else {
663
- Ee = function e(t) {
664
- return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
665
- };
666
- }
667
- return Ee(e);
668
- }
669
- function xe() {
670
- xe = Object.assign || function(e) {
629
+ return He = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
630
+ return typeof e;
631
+ } : function(e) {
632
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
633
+ }, He(e);
634
+ }
635
+ function Ie() {
636
+ return Ie = Object.assign ? Object.assign.bind() : function(e) {
671
637
  for (var t = 1; t < arguments.length; t++) {
672
638
  var n = arguments[t];
673
639
  for (var r in n) {
674
- if (Object.prototype.hasOwnProperty.call(n, r)) {
675
- e[r] = n[r];
676
- }
640
+ ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
677
641
  }
678
642
  }
679
643
  return e;
680
- };
681
- return xe.apply(this, arguments);
644
+ }, Ie.apply(null, arguments);
682
645
  }
683
- function _e(e, t) {
684
- if (e == null) return {};
685
- var n = He(e, t);
686
- var r, o;
646
+ function Re(e, t) {
647
+ if (null == e) return {};
648
+ var n, r, o = qe(e, t);
687
649
  if (Object.getOwnPropertySymbols) {
688
650
  var i = Object.getOwnPropertySymbols(e);
689
- for (o = 0; o < i.length; o++) {
690
- r = i[o];
691
- if (t.indexOf(r) >= 0) continue;
692
- if (!Object.prototype.propertyIsEnumerable.call(e, r)) continue;
693
- n[r] = e[r];
651
+ for (r = 0; r < i.length; r++) {
652
+ n = i[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (o[n] = e[n]);
694
653
  }
695
654
  }
696
- return n;
655
+ return o;
697
656
  }
698
- function He(e, t) {
699
- if (e == null) return {};
657
+ function qe(e, t) {
658
+ if (null == e) return {};
700
659
  var n = {};
701
- var r = Object.keys(e);
702
- var o, i;
703
- for (i = 0; i < r.length; i++) {
704
- o = r[i];
705
- if (t.indexOf(o) >= 0) continue;
706
- n[o] = e[o];
660
+ for (var r in e) {
661
+ if ({}.hasOwnProperty.call(e, r)) {
662
+ if (t.includes(r)) continue;
663
+ n[r] = e[r];
664
+ }
707
665
  }
708
666
  return n;
709
667
  }
710
- function Te(e, t) {
711
- if (!(e instanceof t)) {
712
- throw new TypeError("Cannot call a class as a function");
713
- }
668
+ function Be(e, t) {
669
+ if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
714
670
  }
715
- function Re(e, t) {
671
+ function ze(e, t) {
716
672
  for (var n = 0; n < t.length; n++) {
717
673
  var r = t[n];
718
- r.enumerable = r.enumerable || false;
719
- r.configurable = true;
720
- if ("value" in r) r.writable = true;
721
- Object.defineProperty(e, r.key, r);
674
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0),
675
+ Object.defineProperty(e, Fe(r.key), r);
722
676
  }
723
677
  }
724
- function Ie(e, t, n) {
725
- if (t) Re(e.prototype, t);
726
- if (n) Re(e, n);
727
- return e;
678
+ function Me(e, t, n) {
679
+ return t && ze(e.prototype, t), n && ze(e, n), Object.defineProperty(e, "prototype", {
680
+ writable: !1
681
+ }), e;
728
682
  }
729
- function qe(e, t) {
730
- if (typeof t !== "function" && t !== null) {
731
- throw new TypeError("Super expression must either be null or a function");
732
- }
683
+ function Ne(e, t) {
684
+ if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
733
685
  e.prototype = Object.create(t && t.prototype, {
734
686
  constructor: {
735
687
  value: e,
736
- writable: true,
737
- configurable: true
688
+ writable: !0,
689
+ configurable: !0
738
690
  }
739
- });
740
- if (t) ze(e, t);
691
+ }), Object.defineProperty(e, "prototype", {
692
+ writable: !1
693
+ }), t && Ae(e, t);
741
694
  }
742
- function ze(e, t) {
743
- ze = Object.setPrototypeOf || function e(t, n) {
744
- t.__proto__ = n;
745
- return t;
746
- };
747
- return ze(e, t);
695
+ function Ae(e, t) {
696
+ return Ae = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
697
+ return e.__proto__ = t, e;
698
+ }, Ae(e, t);
748
699
  }
749
- function Me(e) {
750
- var t = Be();
751
- return function n() {
752
- var r = De(e), o;
700
+ function We(e) {
701
+ var t = Ue();
702
+ return function() {
703
+ var n, r = Le(e);
753
704
  if (t) {
754
- var i = De(this).constructor;
755
- o = Reflect.construct(r, arguments, i);
756
- } else {
757
- o = r.apply(this, arguments);
758
- }
759
- return Ae(this, o);
705
+ var o = Le(this).constructor;
706
+ n = Reflect.construct(r, arguments, o);
707
+ } else n = r.apply(this, arguments);
708
+ return De(this, n);
760
709
  };
761
710
  }
762
- function Ae(e, t) {
763
- if (t && (Ee(t) === "object" || typeof t === "function")) {
764
- return t;
765
- }
766
- return We(e);
711
+ function De(e, t) {
712
+ if (t && ("object" == He(t) || "function" == typeof t)) return t;
713
+ if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
714
+ return $e(e);
767
715
  }
768
- function We(e) {
769
- if (e === void 0) {
770
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
771
- }
716
+ function $e(e) {
717
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
772
718
  return e;
773
719
  }
774
- function Be() {
775
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
776
- if (Reflect.construct.sham) return false;
777
- if (typeof Proxy === "function") return true;
720
+ function Ue() {
778
721
  try {
779
- Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
780
- return true;
781
- } catch (e) {
782
- return false;
783
- }
784
- }
785
- function De(e) {
786
- De = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
787
- return t.__proto__ || Object.getPrototypeOf(t);
788
- };
789
- return De(e);
790
- }
791
- function Ne(e, t, n) {
792
- if (t in e) {
793
- Object.defineProperty(e, t, {
794
- value: n,
795
- enumerable: true,
796
- configurable: true,
797
- writable: true
798
- });
799
- } else {
800
- e[t] = n;
722
+ var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
723
+ } catch (e) {}
724
+ return (Ue = function t() {
725
+ return !!e;
726
+ })();
727
+ }
728
+ function Le(e) {
729
+ return Le = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
730
+ return e.__proto__ || Object.getPrototypeOf(e);
731
+ }, Le(e);
732
+ }
733
+ function Ve(e, t, n) {
734
+ return (t = Fe(t)) in e ? Object.defineProperty(e, t, {
735
+ value: n,
736
+ enumerable: !0,
737
+ configurable: !0,
738
+ writable: !0
739
+ }) : e[t] = n, e;
740
+ }
741
+ function Fe(e) {
742
+ var t = Ge(e, "string");
743
+ return "symbol" == He(t) ? t : t + "";
744
+ }
745
+ function Ge(e, t) {
746
+ if ("object" != He(e) || !e) return e;
747
+ var n = e[Symbol.toPrimitive];
748
+ if (void 0 !== n) {
749
+ var r = n.call(e, t || "default");
750
+ if ("object" != He(r)) return r;
751
+ throw new TypeError("@@toPrimitive must return a primitive value.");
801
752
  }
802
- return e;
753
+ return ("string" === t ? String : Number)(e);
803
754
  }
804
- var $e = {
755
+ var Je = {
805
756
  children: i().node,
806
757
  elementRef: i().oneOfType([ i().func, i().object ])
807
758
  };
808
- var Ue = {};
759
+ var Ke = {};
809
760
  /**
810
761
  * @deprecated
811
762
  * Concertina has been deprecated and will be removed in a future major version.
812
- */ var Le = function(e) {
813
- qe(o, e);
814
- var t = Me(o);
763
+ */ var Qe = function(e) {
764
+ Ne(o, e);
765
+ var t = We(o);
815
766
  // @docs-props-type ConcertinaPropsBase
816
767
  function o(e) {
817
768
  var n;
818
- Te(this, o);
769
+ Be(this, o);
819
770
  n = t.call(this, e);
820
- Ne(We(n), "panelPositions", void 0);
821
- Ne(We(n), "handleUpdate", (function(e, t) {
771
+ Ve($e(n), "panelPositions", void 0);
772
+ Ve($e(n), "handleUpdate", (function(e, t) {
822
773
  n.panelPositions[t.index] = t;
823
774
  var r = 0;
824
775
  n.panelPositions.forEach((function(e) {
@@ -828,11 +779,11 @@
828
779
  }));
829
780
  n.updateHeadings();
830
781
  }));
831
- Ne(We(n), "handleElementMount", (function(e) {
782
+ Ve($e(n), "handleElementMount", (function(e) {
832
783
  n.setState({
833
784
  scrollEl: e
834
785
  });
835
- // The scrollEl gets unmounted during the animation, it's necessary to cache the
786
+ // The scrollEl gets unmounted during the animation, it's necessary to cache the
836
787
  // recorded height until it is remounted.
837
788
  if (e) {
838
789
  n.setState({
@@ -840,7 +791,7 @@
840
791
  });
841
792
  }
842
793
  }));
843
- Ne(We(n), "handleResize", (function() {
794
+ Ve($e(n), "handleResize", (function() {
844
795
  n.setState((function(e) {
845
796
  var t;
846
797
  return {
@@ -848,52 +799,52 @@
848
799
  };
849
800
  }));
850
801
  }));
851
- Ne(We(n), "handleScroll", (function() {
802
+ Ve($e(n), "handleScroll", (function() {
852
803
  n.updateHeadings();
853
804
  }));
854
- Ne(We(n), "handleScrollComplete", (function() {
805
+ Ve($e(n), "handleScrollComplete", (function() {
855
806
  n.setState({
856
807
  targetTop: undefined
857
808
  });
858
809
  }));
859
- Ne(We(n), "handleClick", (function(e, t) {
810
+ Ve($e(n), "handleClick", (function(e, t) {
860
811
  var r;
861
812
  var o = t.index, i = t.position;
862
813
  var a = n.state.scrollEl;
863
814
  if (!a) {
864
815
  return;
865
816
  }
866
- var l = c()(n.panelPositions, o).map((function(e) {
817
+ var l = s()(n.panelPositions, o).map((function(e) {
867
818
  return e.headingHeight;
868
819
  })).reduce((function(e, t) {
869
820
  return e + t;
870
821
  }), 0);
871
822
  // sum the heights
872
- var s = f()(n.panelPositions, n.panelPositions.length - o - 1).map((function(e) {
823
+ var c = p()(n.panelPositions, n.panelPositions.length - o - 1).map((function(e) {
873
824
  return e.headingHeight;
874
825
  })).reduce((function(e, t) {
875
826
  return e + t;
876
827
  }), 0);
877
828
  // sum the heights
878
- var u = a.clientHeight - l - s;
879
- var p = n.panelPositions[o].height;
829
+ var u = a.clientHeight - l - c;
830
+ var f = n.panelPositions[o].height;
880
831
  var d = ((r = n.panelPositions[o].offsetTop) !== null && r !== void 0 ? r : 0) - l;
881
- var h = d - (u - p);
882
- var y = u > p && (i === "bottom" || i === "inner");
883
- // if the entire panel is in view, do nothing
884
- if (y && h < a.scrollTop) {
832
+ var b = d - (u - f);
833
+ var h = u > f && (i === "bottom" || i === "inner");
834
+ // if the entire panel is in view, do nothing
835
+ if (h && b < a.scrollTop) {
885
836
  return;
886
837
  }
887
- var b = y ? h : d;
888
- // handleRest will shift focus;
838
+ var y = h ? b : d;
839
+ // handleRest will shift focus;
889
840
  if (i !== "inner") {
890
841
  e.currentTarget.blur();
891
842
  }
892
843
  n.setState({
893
- targetTop: b
844
+ targetTop: y
894
845
  });
895
846
  }));
896
- Ne(We(n), "updateHeadingsImpl", (function() {
847
+ Ve($e(n), "updateHeadingsImpl", (function() {
897
848
  var e = n.state.scrollEl;
898
849
  if (!e) {
899
850
  return;
@@ -919,7 +870,7 @@
919
870
  panelsBottomCount: n.panelPositions.reduceRight(i, 0)
920
871
  });
921
872
  }));
922
- Ne(We(n), "updateHeadings", l()(n.updateHeadingsImpl, 0));
873
+ Ve($e(n), "updateHeadings", l()(n.updateHeadingsImpl, 0));
923
874
  n.state = {
924
875
  innerWidth: "100%",
925
876
  panelsBottomCount: 0,
@@ -929,7 +880,7 @@
929
880
  n.panelPositions = [];
930
881
  return n;
931
882
  }
932
- Ie(o, [ {
883
+ Me(o, [ {
933
884
  key: "componentWillUnmount",
934
885
  value: function e() {
935
886
  this.updateHeadings.cancel();
@@ -941,7 +892,7 @@
941
892
  var i = t.map((function(e) {
942
893
  var t;
943
894
 
944
- return r().createElement($, {
895
+ return r().createElement(L, {
945
896
  onClick: o.handleClick,
946
897
  description: e.props.description,
947
898
  panelId: e.props.panelId,
@@ -958,28 +909,28 @@
958
909
  key: "render",
959
910
  value: function e() {
960
911
  if (false) {}
961
- var t = this.props, o = t.children, i = _e(t, [ "children" ]);
912
+ var t = this.props, o = t.children, i = Re(t, [ "children" ]);
962
913
  var a = n.Children.toArray(o).filter(n.isValidElement).map((function(e, t) {
963
914
 
964
915
  return (0, n.cloneElement)(e, {
965
916
  index: t
966
917
  });
967
918
  }));
968
- var l = c()(a, this.state.panelsTopCount);
969
- var s = f()(a, this.state.panelsBottomCount);
919
+ var l = s()(a, this.state.panelsTopCount);
920
+ var c = p()(a, this.state.panelsBottomCount);
970
921
 
971
- return r().createElement(X, xe({
922
+ return r().createElement(Z, Ie({
972
923
  "data-test": "concertina"
973
924
  }, i), r().createElement(d(), {
974
925
  target: window,
975
926
  eventType: "resize",
976
927
  listener: this.handleResize
977
- }), this.state.panelsTopCount > 0 && r().createElement(Y, {
928
+ }), this.state.panelsTopCount > 0 && r().createElement(ee, {
978
929
  style: {
979
930
  width: this.state.innerWidth
980
931
  },
981
932
  "data-test": "dock-top"
982
- }, this.renderHeadings(l, "top")), r().createElement(Q, {
933
+ }, this.renderHeadings(l, "top")), r().createElement(Y, {
983
934
  onScroll: this.handleScroll,
984
935
  stopScrollPropagation: true,
985
936
  key: "scroll-container",
@@ -987,25 +938,26 @@
987
938
  "data-test": "scroll",
988
939
  top: this.state.targetTop,
989
940
  onScrollComplete: this.handleScrollComplete
990
- }, r().createElement(re.Provider, {
941
+ }, r().createElement(ie.Provider, {
942
+ // eslint-disable-next-line react/jsx-no-constructed-context-values
991
943
  value: {
992
944
  onHeadingClick: this.handleClick,
993
945
  onChange: this.handleUpdate
994
946
  }
995
- }, a)), this.state.panelsBottomCount > 0 && r().createElement(Z, {
947
+ }, a)), this.state.panelsBottomCount > 0 && r().createElement(te, {
996
948
  style: {
997
949
  width: this.state.innerWidth
998
950
  },
999
951
  "data-test": "dock-bottom"
1000
- }, this.renderHeadings(s, "bottom")));
952
+ }, this.renderHeadings(c, "bottom")));
1001
953
  }
1002
954
  } ]);
1003
955
  return o;
1004
956
  }(n.Component);
1005
- Ne(Le, "propTypes", $e);
1006
- Ne(Le, "defaultProps", Ue);
1007
- Ne(Le, "Panel", je);
1008
- /* harmony default export */ const Ve = Le;
957
+ Ve(Qe, "propTypes", Je);
958
+ Ve(Qe, "defaultProps", Ke);
959
+ Ve(Qe, "Panel", xe);
960
+ /* harmony default export */ const Xe = Qe;
1009
961
  // CONCATENATED MODULE: ./src/Concertina/index.ts
1010
962
  module.exports = t;
1011
963
  /******/})();