@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
@@ -0,0 +1,2 @@
1
+ export { default } from './types/src/SplitButton';
2
+ export * from './types/src/SplitButton';
package/SplitButton.js CHANGED
@@ -8,27 +8,27 @@
8
8
  /******/ /* webpack/runtime/compat get default export */
9
9
  /******/ (() => {
10
10
  /******/ // getDefaultExport function for compatibility with non-harmony modules
11
- /******/ e.n = t => {
12
- /******/ var r = t && t.__esModule ?
13
- /******/ () => t["default"]
14
- /******/ : () => t
11
+ /******/ e.n = r => {
12
+ /******/ var t = r && r.__esModule ?
13
+ /******/ () => r["default"]
14
+ /******/ : () => r
15
15
  /******/;
16
- e.d(r, {
17
- a: r
16
+ e.d(t, {
17
+ a: t
18
18
  });
19
- /******/ return r;
19
+ /******/ return t;
20
20
  /******/ };
21
21
  /******/ })();
22
22
  /******/
23
23
  /******/ /* webpack/runtime/define property getters */
24
24
  /******/ (() => {
25
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, {
26
+ /******/ e.d = (r, t) => {
27
+ /******/ for (var n in t) {
28
+ /******/ if (e.o(t, n) && !e.o(r, n)) {
29
+ /******/ Object.defineProperty(r, n, {
30
30
  enumerable: true,
31
- get: r[n]
31
+ get: t[n]
32
32
  });
33
33
  /******/ }
34
34
  /******/ }
@@ -37,7 +37,7 @@
37
37
  /******/
38
38
  /******/ /* webpack/runtime/hasOwnProperty shorthand */
39
39
  /******/ (() => {
40
- /******/ e.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)
40
+ /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r)
41
41
  /******/;
42
42
  })();
43
43
  /******/
@@ -56,23 +56,23 @@
56
56
  /******/ };
57
57
  /******/ })();
58
58
  /******/
59
- /************************************************************************/ var t = {};
59
+ /************************************************************************/ var r = {};
60
60
  // ESM COMPAT FLAG
61
- e.r(t);
61
+ e.r(r);
62
62
  // EXPORTS
63
- e.d(t, {
64
- Item: () => /* reexport */ F,
65
- default: () => /* reexport */ U
63
+ e.d(r, {
64
+ Item: () => /* reexport */ J,
65
+ default: () => /* reexport */ X
66
66
  });
67
67
  // CONCATENATED MODULE: external "react"
68
- const r = require("react");
69
- var n = e.n(r);
68
+ const t = require("react");
69
+ var n = e.n(t);
70
70
  // CONCATENATED MODULE: external "prop-types"
71
71
  const i = require("prop-types");
72
- var a = e.n(i);
72
+ var o = e.n(i);
73
73
  // CONCATENATED MODULE: external "@splunk/react-icons/enterprise/ChevronDown"
74
- const o = require("@splunk/react-icons/enterprise/ChevronDown");
75
- var l = e.n(o);
74
+ const a = require("@splunk/react-icons/enterprise/ChevronDown");
75
+ var l = e.n(a);
76
76
  // CONCATENATED MODULE: external "@splunk/react-ui/Dropdown"
77
77
  const c = require("@splunk/react-ui/Dropdown");
78
78
  var u = e.n(c);
@@ -83,26 +83,26 @@
83
83
  const f = require("@splunk/ui-utils/i18n");
84
84
  // CONCATENATED MODULE: external "styled-components"
85
85
  const d = require("styled-components");
86
- var v = e.n(d);
86
+ var b = e.n(d);
87
87
  // CONCATENATED MODULE: external "@splunk/react-ui/Button"
88
- const b = require("@splunk/react-ui/Button");
89
- var y = e.n(b);
88
+ const v = require("@splunk/react-ui/Button");
89
+ var y = e.n(v);
90
90
  // CONCATENATED MODULE: external "@splunk/react-ui/Box"
91
- const h = require("@splunk/react-ui/Box");
92
- var m = e.n(h);
91
+ const m = require("@splunk/react-ui/Box");
92
+ var h = e.n(m);
93
93
  // CONCATENATED MODULE: external "@splunk/themes"
94
94
  const g = require("@splunk/themes");
95
95
  // CONCATENATED MODULE: ./src/SplitButton/SplitButtonStyles.ts
96
- var O = v()(y()).withConfig({
96
+ var O = b()(y()).withConfig({
97
97
  displayName: "SplitButtonStyles__StyledButton",
98
98
  componentId: "sc-9igsyh-0"
99
99
  })([ "", "" ], (0, g.pick)({
100
- prisma: function e(t) {
101
- var r = t.appearance;
102
- return r === "default" && (0, d.css)([ "&:first-child{border-right:1px solid ", ";}" ], g.variables.interactiveColorBorder);
100
+ prisma: function e(r) {
101
+ var t = r.appearance;
102
+ return t === "default" && (0, d.css)([ "&:first-child{border-right:1px solid ", ";}" ], g.variables.interactiveColorBorder);
103
103
  }
104
104
  }));
105
- var k = v()(m()).withConfig({
105
+ var w = b()(h()).withConfig({
106
106
  displayName: "SplitButtonStyles__StyledSeparator",
107
107
  componentId: "sc-9igsyh-1"
108
108
  })([ "width:", ";height:", ";background-color:", ";" ], (0, g.pick)({
@@ -130,323 +130,300 @@
130
130
  }
131
131
  }
132
132
  }));
133
- var w = v()(m()).withConfig({
133
+ var k = b()(h()).withConfig({
134
134
  displayName: "SplitButtonStyles__StyledBox",
135
135
  componentId: "sc-9igsyh-2"
136
136
  })([ "", " [data-inline] + &{margin-left:", ";}" ], (function(e) {
137
- var t = e.$inline;
138
- return !t && (0, d.css)([ "width:100%;" ]);
137
+ var r = e.$inline;
138
+ return !r && (0, d.css)([ "width:100%;" ]);
139
139
  }), g.variables.spacingSmall);
140
140
  // CONCATENATED MODULE: external "lodash/omit"
141
141
  const S = require("lodash/omit");
142
142
  var j = e.n(S);
143
143
  // CONCATENATED MODULE: ./src/SplitButton/Item.tsx
144
- function _(e) {
144
+ function P(e) {
145
145
  "@babel/helpers - typeof";
146
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
147
- _ = function e(t) {
148
- return typeof t;
149
- };
150
- } else {
151
- _ = function e(t) {
152
- return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
153
- };
154
- }
155
- return _(e);
146
+ return P = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
147
+ return typeof e;
148
+ } : function(e) {
149
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
150
+ }, P(e);
156
151
  }
157
- function C() {
158
- C = Object.assign || function(e) {
159
- for (var t = 1; t < arguments.length; t++) {
160
- var r = arguments[t];
161
- for (var n in r) {
162
- if (Object.prototype.hasOwnProperty.call(r, n)) {
163
- e[n] = r[n];
164
- }
152
+ function _() {
153
+ return _ = Object.assign ? Object.assign.bind() : function(e) {
154
+ for (var r = 1; r < arguments.length; r++) {
155
+ var t = arguments[r];
156
+ for (var n in t) {
157
+ ({}).hasOwnProperty.call(t, n) && (e[n] = t[n]);
165
158
  }
166
159
  }
167
160
  return e;
168
- };
169
- return C.apply(this, arguments);
161
+ }, _.apply(null, arguments);
170
162
  }
171
- function P(e, t) {
172
- if (e == null) return {};
173
- var r = E(e, t);
174
- var n, i;
163
+ function C(e, r) {
164
+ if (null == e) return {};
165
+ var t, n, i = E(e, r);
175
166
  if (Object.getOwnPropertySymbols) {
176
- var a = Object.getOwnPropertySymbols(e);
177
- for (i = 0; i < a.length; i++) {
178
- n = a[i];
179
- if (t.indexOf(n) >= 0) continue;
180
- if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
181
- r[n] = e[n];
167
+ var o = Object.getOwnPropertySymbols(e);
168
+ for (n = 0; n < o.length; n++) {
169
+ t = o[n], r.includes(t) || {}.propertyIsEnumerable.call(e, t) && (i[t] = e[t]);
182
170
  }
183
171
  }
184
- return r;
172
+ return i;
185
173
  }
186
- function E(e, t) {
187
- if (e == null) return {};
188
- var r = {};
189
- var n = Object.keys(e);
190
- var i, a;
191
- for (a = 0; a < n.length; a++) {
192
- i = n[a];
193
- if (t.indexOf(i) >= 0) continue;
194
- r[i] = e[i];
174
+ function E(e, r) {
175
+ if (null == e) return {};
176
+ var t = {};
177
+ for (var n in e) {
178
+ if ({}.hasOwnProperty.call(e, n)) {
179
+ if (r.includes(n)) continue;
180
+ t[n] = e[n];
181
+ }
195
182
  }
196
- return r;
183
+ return t;
197
184
  }
198
- function x(e, t) {
199
- if (!(e instanceof t)) {
200
- throw new TypeError("Cannot call a class as a function");
201
- }
185
+ function I(e, r) {
186
+ if (!(e instanceof r)) throw new TypeError("Cannot call a class as a function");
202
187
  }
203
- function I(e, t) {
204
- for (var r = 0; r < t.length; r++) {
205
- var n = t[r];
206
- n.enumerable = n.enumerable || false;
207
- n.configurable = true;
208
- if ("value" in n) n.writable = true;
209
- Object.defineProperty(e, n.key, n);
188
+ function q(e, r) {
189
+ for (var t = 0; t < r.length; t++) {
190
+ var n = r[t];
191
+ n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
192
+ Object.defineProperty(e, A(n.key), n);
210
193
  }
211
194
  }
212
- function q(e, t, r) {
213
- if (t) I(e.prototype, t);
214
- if (r) I(e, r);
215
- return e;
195
+ function B(e, r, t) {
196
+ return r && q(e.prototype, r), t && q(e, t), Object.defineProperty(e, "prototype", {
197
+ writable: !1
198
+ }), e;
216
199
  }
217
- function R(e, t) {
218
- if (typeof t !== "function" && t !== null) {
219
- throw new TypeError("Super expression must either be null or a function");
220
- }
221
- e.prototype = Object.create(t && t.prototype, {
200
+ function x(e, r) {
201
+ if ("function" != typeof r && null !== r) throw new TypeError("Super expression must either be null or a function");
202
+ e.prototype = Object.create(r && r.prototype, {
222
203
  constructor: {
223
204
  value: e,
224
- writable: true,
225
- configurable: true
205
+ writable: !0,
206
+ configurable: !0
226
207
  }
227
- });
228
- if (t) M(e, t);
208
+ }), Object.defineProperty(e, "prototype", {
209
+ writable: !1
210
+ }), r && M(e, r);
229
211
  }
230
- function M(e, t) {
231
- M = Object.setPrototypeOf || function e(t, r) {
232
- t.__proto__ = r;
233
- return t;
234
- };
235
- return M(e, t);
212
+ function M(e, r) {
213
+ return M = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, r) {
214
+ return e.__proto__ = r, e;
215
+ }, M(e, r);
236
216
  }
237
- function B(e) {
238
- var t = V();
239
- return function r() {
240
- var n = $(e), i;
241
- if (t) {
242
- var a = $(this).constructor;
243
- i = Reflect.construct(n, arguments, a);
244
- } else {
245
- i = n.apply(this, arguments);
246
- }
247
- return T(this, i);
217
+ function T(e) {
218
+ var r = V();
219
+ return function() {
220
+ var t, n = $(e);
221
+ if (r) {
222
+ var i = $(this).constructor;
223
+ t = Reflect.construct(n, arguments, i);
224
+ } else t = n.apply(this, arguments);
225
+ return R(this, t);
248
226
  };
249
227
  }
250
- function T(e, t) {
251
- if (t && (_(t) === "object" || typeof t === "function")) {
252
- return t;
253
- }
228
+ function R(e, r) {
229
+ if (r && ("object" == P(r) || "function" == typeof r)) return r;
230
+ if (void 0 !== r) throw new TypeError("Derived constructors may only return object or undefined");
254
231
  return N(e);
255
232
  }
256
233
  function N(e) {
257
- if (e === void 0) {
258
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
259
- }
234
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
260
235
  return e;
261
236
  }
262
237
  function V() {
263
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
264
- if (Reflect.construct.sham) return false;
265
- if (typeof Proxy === "function") return true;
266
238
  try {
267
- Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
268
- return true;
269
- } catch (e) {
270
- return false;
271
- }
239
+ var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
240
+ } catch (e) {}
241
+ return (V = function r() {
242
+ return !!e;
243
+ })();
272
244
  }
273
245
  function $(e) {
274
- $ = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
275
- return t.__proto__ || Object.getPrototypeOf(t);
276
- };
277
- return $(e);
246
+ return $ = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
247
+ return e.__proto__ || Object.getPrototypeOf(e);
248
+ }, $(e);
278
249
  }
279
- function D(e, t, r) {
280
- if (t in e) {
281
- Object.defineProperty(e, t, {
282
- value: r,
283
- enumerable: true,
284
- configurable: true,
285
- writable: true
286
- });
287
- } else {
288
- e[t] = r;
250
+ function D(e, r, t) {
251
+ return (r = A(r)) in e ? Object.defineProperty(e, r, {
252
+ value: t,
253
+ enumerable: !0,
254
+ configurable: !0,
255
+ writable: !0
256
+ }) : e[r] = t, e;
257
+ }
258
+ function A(e) {
259
+ var r = H(e, "string");
260
+ return "symbol" == P(r) ? r : r + "";
261
+ }
262
+ function H(e, r) {
263
+ if ("object" != P(e) || !e) return e;
264
+ var t = e[Symbol.toPrimitive];
265
+ if (void 0 !== t) {
266
+ var n = t.call(e, r || "default");
267
+ if ("object" != P(n)) return n;
268
+ throw new TypeError("@@toPrimitive must return a primitive value.");
289
269
  }
290
- return e;
270
+ return ("string" === r ? String : Number)(e);
291
271
  }
292
- var A = {
293
- appearance: a().oneOf([ "default", "primary", "destructive" ]),
294
- children: a().node,
295
- disabled: a().bool,
296
- isMain: a().bool,
297
- onClick: a().func
272
+ var z = {
273
+ appearance: o().oneOf([ "default", "primary", "destructive" ]),
274
+ children: o().node,
275
+ disabled: o().bool,
276
+ isMain: o().bool,
277
+ onClick: o().func
298
278
  };
299
- var H = {
279
+ var F = {
300
280
  appearance: "default"
301
281
  };
302
282
  /**
303
283
  * An item within a `SplitButton`. This inherits from
304
284
  * [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
305
285
  * so any elements passed to it must also be pure.
306
- */ var z = function(e) {
307
- R(r, e);
308
- var t = B(r);
309
- function r() {
286
+ */ var G = function(e) {
287
+ x(t, e);
288
+ var r = T(t);
289
+ function t() {
310
290
  var e;
311
- x(this, r);
312
- for (var n = arguments.length, i = new Array(n), a = 0; a < n; a++) {
313
- i[a] = arguments[a];
291
+ I(this, t);
292
+ for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++) {
293
+ i[o] = arguments[o];
314
294
  }
315
- e = t.call.apply(t, [ this ].concat(i));
295
+ e = r.call.apply(r, [ this ].concat(i));
316
296
  D(N(e), "item", null);
317
- D(N(e), "handleClick", (function(t) {
318
- var r = e.props, n = r.disabled, i = r.onClick;
297
+ D(N(e), "handleClick", (function(r) {
298
+ var t = e.props, n = t.disabled, i = t.onClick;
319
299
  if (!n) {
320
- i === null || i === void 0 ? void 0 : i(t);
300
+ i === null || i === void 0 ? void 0 : i(r);
321
301
  }
322
302
  }));
323
303
  return e;
324
304
  }
325
- q(r, [ {
305
+ // @docs-props-type ItemPropsBase
306
+ B(t, [ {
326
307
  key: "scrollIntoViewIfNeeded",
308
+ // eslint-disable-next-line react/no-unused-class-component-methods
327
309
  value: function e() {
328
- var t;
329
- (t = this.item) === null || t === void 0 ? void 0 : t.scrollIntoViewIfNeeded();
310
+ var r;
311
+ (r = this.item) === null || r === void 0 ? void 0 : r.scrollIntoViewIfNeeded();
330
312
  }
331
313
  /**
332
314
  * Place focus on the item.
333
- */ }, {
315
+ */
316
+ // eslint-disable-next-line react/no-unused-class-component-methods
317
+ }, {
334
318
  key: "focus",
335
319
  value: function e() {
336
- var t;
337
- (t = this.item) === null || t === void 0 ? void 0 : t.focus();
320
+ var r;
321
+ (r = this.item) === null || r === void 0 ? void 0 : r.focus();
338
322
  }
339
323
  }, {
340
324
  key: "render",
341
325
  value: function e() {
342
- var t = this;
343
- var r = this.props, i = r.disabled, a = r.isMain, o = r.children, l = r.appearance, c = P(r, [ "disabled", "isMain", "children", "appearance" ]);
344
- if (a) {
326
+ var r = this;
327
+ var t = this.props, i = t.disabled, o = t.isMain, a = t.children, l = t.appearance, c = C(t, [ "disabled", "isMain", "children", "appearance" ]);
328
+ if (o) {
345
329
 
346
- return n().createElement(O, C({
330
+ return n().createElement(O, _({
347
331
  onClick: this.handleClick,
348
332
  disabled: i,
349
333
  append: true,
350
334
  appearance: l
351
- }, c), o);
335
+ }, c), a);
352
336
  }
353
337
 
354
- return n().createElement(p().Item, C({
355
- ref: function e(r) {
356
- t.item = r;
338
+ return n().createElement(p().Item, _({
339
+ ref: function e(t) {
340
+ r.item = t;
357
341
  },
358
342
  onClick: this.handleClick,
359
343
  disabled: i
360
- }, j()(c, [ "role" ])), o);
344
+ }, j()(c, [ "role" ])), a);
361
345
  }
362
346
  } ]);
363
- return r;
364
- }(r.PureComponent);
365
- D(z, "propTypes", A);
366
- D(z, "defaultProps", H);
367
- /* harmony default export */ const F = z;
347
+ return t;
348
+ }(t.PureComponent);
349
+ D(G, "propTypes", z);
350
+ D(G, "defaultProps", F);
351
+ /* harmony default export */ const J = G;
368
352
  // CONCATENATED MODULE: ./src/SplitButton/SplitButton.tsx
369
- function G() {
370
- G = Object.assign || function(e) {
371
- for (var t = 1; t < arguments.length; t++) {
372
- var r = arguments[t];
373
- for (var n in r) {
374
- if (Object.prototype.hasOwnProperty.call(r, n)) {
375
- e[n] = r[n];
376
- }
353
+ function K() {
354
+ return K = Object.assign ? Object.assign.bind() : function(e) {
355
+ for (var r = 1; r < arguments.length; r++) {
356
+ var t = arguments[r];
357
+ for (var n in t) {
358
+ ({}).hasOwnProperty.call(t, n) && (e[n] = t[n]);
377
359
  }
378
360
  }
379
361
  return e;
380
- };
381
- return G.apply(this, arguments);
362
+ }, K.apply(null, arguments);
382
363
  }
383
- function J(e, t) {
384
- if (e == null) return {};
385
- var r = K(e, t);
386
- var n, i;
364
+ function L(e, r) {
365
+ if (null == e) return {};
366
+ var t, n, i = Q(e, r);
387
367
  if (Object.getOwnPropertySymbols) {
388
- var a = Object.getOwnPropertySymbols(e);
389
- for (i = 0; i < a.length; i++) {
390
- n = a[i];
391
- if (t.indexOf(n) >= 0) continue;
392
- if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
393
- r[n] = e[n];
368
+ var o = Object.getOwnPropertySymbols(e);
369
+ for (n = 0; n < o.length; n++) {
370
+ t = o[n], r.includes(t) || {}.propertyIsEnumerable.call(e, t) && (i[t] = e[t]);
394
371
  }
395
372
  }
396
- return r;
373
+ return i;
397
374
  }
398
- function K(e, t) {
399
- if (e == null) return {};
400
- var r = {};
401
- var n = Object.keys(e);
402
- var i, a;
403
- for (a = 0; a < n.length; a++) {
404
- i = n[a];
405
- if (t.indexOf(i) >= 0) continue;
406
- r[i] = e[i];
375
+ function Q(e, r) {
376
+ if (null == e) return {};
377
+ var t = {};
378
+ for (var n in e) {
379
+ if ({}.hasOwnProperty.call(e, n)) {
380
+ if (r.includes(n)) continue;
381
+ t[n] = e[n];
382
+ }
407
383
  }
408
- return r;
384
+ return t;
409
385
  }
410
- var L = {
411
- appearance: a().oneOf([ "default", "primary", "destructive" ]),
412
- children: a().node,
413
- disabled: a().bool,
414
- elementRef: a().oneOfType([ a().func, a().object ]),
415
- onClick: a().func,
416
- inline: a().bool
386
+ var U = {
387
+ appearance: o().oneOf([ "default", "primary", "destructive" ]),
388
+ children: o().node,
389
+ disabled: o().bool,
390
+ elementRef: o().oneOfType([ o().func, o().object ]),
391
+ onClick: o().func,
392
+ inline: o().bool
417
393
  };
418
- function Q(e) {
419
- var t = e.appearance, i = t === void 0 ? "default" : t, a = e.children, o = e.disabled, c = e.elementRef, s = e.inline, d = s === void 0 ? true : s, v = e.onClick, b = J(e, [ "appearance", "children", "disabled", "elementRef", "inline", "onClick" ]);
420
- var y = r.Children.toArray(a).filter(r.isValidElement);
421
- var h = 0;
394
+ function W(e) {
395
+ var r = e.appearance, i = r === void 0 ? "default" : r, o = e.children, a = e.disabled, c = e.elementRef, s = e.inline, d = s === void 0 ? true : s, b = e.onClick, v = L(e, [ "appearance", "children", "disabled", "elementRef", "inline", "onClick" ]);
396
+ // @docs-props-type SplitButtonPropsBase
397
+ var y = t.Children.toArray(o).filter(t.isValidElement);
422
398
  var m = 0;
423
- y.forEach((function(e, t) {
424
- var r = e.props, n = r.disabled, i = r.isMain;
399
+ var h = 0;
400
+ y.forEach((function(e, r) {
401
+ var t = e.props, n = t.disabled, i = t.isMain;
425
402
  if (i) {
426
- h = t;
403
+ m = r;
427
404
  }
428
405
  if (n) {
429
- m += 1;
406
+ h += 1;
430
407
  }
431
408
  }));
432
- var g = (0, r.cloneElement)(y[h], {
409
+ var g = (0, t.cloneElement)(y[m], {
433
410
  isMain: true,
434
411
  appearance: i,
435
- disabled: o || y[h].props.disabled
412
+ disabled: a || y[m].props.disabled
436
413
  });
437
- // Remove mainButton from array of dropdown items
438
- y.splice(h, 1);
414
+ // Remove mainButton from array of dropdown items
415
+ y.splice(m, 1);
439
416
  var S = y;
440
417
  var j = n().createElement(O, {
441
418
  prepend: true,
442
- disabled: o || m === S.length,
419
+ disabled: a || h === S.length,
443
420
  appearance: i,
444
421
  "data-test": "split-button-toggle",
445
422
  "aria-label": (0, f._)("Open more options"),
446
423
  icon: n().createElement(l(), null)
447
424
  });
448
425
 
449
- return n().createElement(w, G({
426
+ return n().createElement(k, K({
450
427
  "aria-label": (0, f._)("Split button"),
451
428
  "data-inline": d || null,
452
429
  "data-test": "split-button-container",
@@ -455,17 +432,17 @@
455
432
  inline: true,
456
433
  flex: true,
457
434
  role: "group",
458
- onClick: o ? undefined : v
459
- }, b), g, i !== "default" && n().createElement(k, {
435
+ onClick: a ? undefined : b
436
+ }, v), g, i !== "default" && n().createElement(w, {
460
437
  inline: true,
461
438
  $appearance: i
462
439
  }), n().createElement("div", null, n().createElement(u(), {
463
440
  toggle: j
464
441
  }, n().createElement(p(), null, S))));
465
442
  }
466
- Q.propTypes = L;
467
- Q.Item = F;
468
- /* harmony default export */ const U = Q;
443
+ W.propTypes = U;
444
+ W.Item = J;
445
+ /* harmony default export */ const X = W;
469
446
  // CONCATENATED MODULE: ./src/SplitButton/index.ts
470
- module.exports = t;
447
+ module.exports = r;
471
448
  /******/})();