@splunk/react-ui 5.8.0 → 5.9.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.
@@ -62,7 +62,7 @@
62
62
  // EXPORTS
63
63
  e.d(n, {
64
64
  SingleOpenPanelGroup: () => /* reexport */ ne,
65
- default: () => /* reexport */ he
65
+ default: () => /* reexport */ Se
66
66
  });
67
67
  // CONCATENATED MODULE: external "react"
68
68
  const t = require("react");
@@ -75,10 +75,10 @@
75
75
  var i = e.n(o);
76
76
  // CONCATENATED MODULE: external "@splunk/react-ui/useControlled"
77
77
  const s = require("@splunk/react-ui/useControlled");
78
- var c = e.n(s);
78
+ var u = e.n(s);
79
79
  // CONCATENATED MODULE: external "@splunk/react-ui/usePrevious"
80
- const u = require("@splunk/react-ui/usePrevious");
81
- var d = e.n(u);
80
+ const c = require("@splunk/react-ui/usePrevious");
81
+ var d = e.n(c);
82
82
  // CONCATENATED MODULE: external "@splunk/ui-utils/id"
83
83
  const p = require("@splunk/ui-utils/id");
84
84
  // CONCATENATED MODULE: external "styled-components"
@@ -104,13 +104,7 @@
104
104
  componentId: "sc-1phikbp-0"
105
105
  })([ "display:flex;flex-direction:column;flex-shrink:1;min-height:28px;background-color:", ";& + &{margin-top:1px;}" ], (0,
106
106
  P.pickVariant)("$appearance", {
107
- default: {
108
- prisma: P.variables.backgroundColorSection,
109
- enterprise: {
110
- dark: P.variables.gray22,
111
- light: P.variables.white
112
- }
113
- },
107
+ default: P.variables.backgroundColorSection,
114
108
  subtle: P.variables.transparent
115
109
  }));
116
110
  var k = b()(g()).withConfig({
@@ -130,7 +124,7 @@
130
124
  var x = b().div.withConfig({
131
125
  displayName: "CollapsiblePanelStyles__StyledActions",
132
126
  componentId: "sc-1phikbp-3"
133
- })([ "display:flex;flex-shrink:0;border-bottom:0;gap:", ";position:relative;padding:", " ", ";transition:background-color 0.2s,border 0.2s,box-shadow 0.2s;color:", ";background-color:", ";", "" ], P.variables.spacingSmall, P.variables.spacingXSmall, P.variables.spacingLarge, P.variables.contentColorActive, (0,
127
+ })([ "display:flex;flex-shrink:0;gap:", ";padding:", " ", ";transition:background-color 0.2s,border 0.2s,box-shadow 0.2s;color:", ";background-color:", ";", "" ], P.variables.spacingSmall, P.variables.spacingXSmall, P.variables.spacingLarge, P.variables.contentColorActive, (0,
134
128
  P.pickVariant)("$appearance", {
135
129
  default: P.variables.neutral100,
136
130
  subtle: P.variables.transparent
@@ -141,11 +135,11 @@
141
135
  var E = b()(S()).withConfig({
142
136
  displayName: "CollapsiblePanelStyles__StyledToggleButton",
143
137
  componentId: "sc-1phikbp-4"
144
- })([ "flex:0 auto;padding:0;min-width:28px;line-height:", ";" ], P.variables.lineHeight);
138
+ })([ "flex:0 0 auto;align-self:flex-start;width:", ";height:", ";" ], P.variables.inputHeight, P.variables.inputHeight);
145
139
  var _ = b()(C()).withConfig({
146
140
  displayName: "CollapsiblePanelStyles__StyledTitleClickable",
147
141
  componentId: "sc-1phikbp-5"
148
- })([ "width:100%;flex-shrink:0;border-bottom:0;gap:", ";cursor:pointer;position:relative;display:flex;transition:background-color 0.2s,border 0.2s,box-shadow 0.2s;padding:", " ", ";color:", ";background-color:", ";&[disabled],&[aria-disabled='true']{cursor:not-allowed;color:", ";}&:focus:not([disabled]),&:active:not([disabled],[aria-disabled='true']){box-shadow:", ";z-index:1;}&:hover:not([disabled],[aria-disabled='true']){background-color:", ";}" ], P.variables.spacingSmall, P.variables.spacingXSmall, P.variables.spacingLarge, P.variables.contentColorActive, (0,
142
+ })([ "width:100%;flex-shrink:0;gap:", ";cursor:pointer;display:flex;transition:background-color 0.2s,border 0.2s,box-shadow 0.2s;padding:", " ", ";color:", ";background-color:", ";&[disabled],&[aria-disabled='true']{cursor:not-allowed;color:", ";}&:focus:not([disabled]),&:active:not([disabled],[aria-disabled='true']){box-shadow:", ";z-index:1;}&:hover:not([disabled],[aria-disabled='true']){background-color:", ";}" ], P.variables.spacingSmall, P.variables.spacingXSmall, P.variables.spacingLarge, P.variables.contentColorActive, (0,
149
143
  P.pickVariant)("$appearance", {
150
144
  default: P.variables.neutral100,
151
145
  subtle: P.variables.transparent
@@ -157,25 +151,25 @@
157
151
  var n = e.$disabled;
158
152
  return n && (0, f.css)([ "color:", ";" ], P.variables.contentColorDisabled);
159
153
  }));
160
- var $ = b().span.withConfig({
154
+ var D = b().span.withConfig({
161
155
  displayName: "CollapsiblePanelStyles__StyledHeadingActions",
162
156
  componentId: "sc-1phikbp-7"
163
157
  })([ "min-height:", ";" ], P.variables.inputHeight);
164
- var N = b().span.withConfig({
158
+ var $ = b().span.withConfig({
165
159
  displayName: "CollapsiblePanelStyles__StyledDescription",
166
160
  componentId: "sc-1phikbp-8"
167
161
  })([ "color:", ";font-size:", ";margin-left:", ";line-height:1.8;", "" ], P.variables.contentColorDefault, P.variables.fontSizeSmall, P.variables.spacingSmall, (function(e) {
168
162
  var n = e.$disabled;
169
163
  return n && (0, f.css)([ "color:", ";" ], P.variables.contentColorDisabled);
170
164
  }));
171
- var q = b().div.withConfig({
165
+ var N = b().div.withConfig({
172
166
  displayName: "CollapsiblePanelStyles__StyledInsetWrapper",
173
167
  componentId: "sc-1phikbp-9"
174
- })([ "", ";gap:", ";", "" ], P.mixins.reset("block"), P.variables.spacingSmall, (function(e) {
168
+ })([ "", ";", "" ], P.mixins.reset("block"), (function(e) {
175
169
  var n = e.$inset;
176
170
  return n && (0, f.css)([ "padding:", ";" ], P.variables.spacingLarge);
177
171
  }));
178
- var D = b()(y()).withConfig({
172
+ var q = b()(y()).withConfig({
179
173
  displayName: "CollapsiblePanelStyles__StyledExpandPanelIcon",
180
174
  componentId: "sc-1phikbp-10"
181
175
  })([ "transition:transform 200ms;", " width:100%;vertical-align:text-bottom;" ], (function(e) {
@@ -184,13 +178,13 @@
184
178
  }));
185
179
  // CONCATENATED MODULE: external "lodash/omit"
186
180
  const T = require("lodash/omit");
187
- var M = e.n(T);
181
+ var V = e.n(T);
188
182
  // CONCATENATED MODULE: ./src/CollapsiblePanel/SingleOpenPanelGroupContext.tsx
189
- var B = (0, t.createContext)({});
190
- /* harmony default export */ const R = B;
183
+ var M = (0, t.createContext)({});
184
+ /* harmony default export */ const B = M;
191
185
  // CONCATENATED MODULE: ./src/CollapsiblePanel/SingleOpenPanelGroup.tsx
192
- function L() {
193
- return L = Object.assign ? Object.assign.bind() : function(e) {
186
+ function R() {
187
+ return R = Object.assign ? Object.assign.bind() : function(e) {
194
188
  for (var n = 1; n < arguments.length; n++) {
195
189
  var t = arguments[n];
196
190
  for (var r in t) {
@@ -198,15 +192,15 @@
198
192
  }
199
193
  }
200
194
  return e;
201
- }, L.apply(null, arguments);
195
+ }, R.apply(null, arguments);
202
196
  }
203
- function W(e) {
204
- return G(e) || V(e) || X(e) || H();
197
+ function H(e) {
198
+ return G(e) || W(e) || X(e) || L();
205
199
  }
206
- function H() {
200
+ function L() {
207
201
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
208
202
  }
209
- function V(e) {
203
+ function W(e) {
210
204
  if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
211
205
  }
212
206
  function G(e) {
@@ -235,7 +229,7 @@
235
229
  function J(e, n) {
236
230
  var t = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
237
231
  if (null != t) {
238
- var r, a, l, o, i = [], s = !0, c = !1;
232
+ var r, a, l, o, i = [], s = !0, u = !1;
239
233
  try {
240
234
  if (l = (t = t.call(e)).next, 0 === n) {
241
235
  if (Object(t) !== t) return;
@@ -243,12 +237,12 @@
243
237
  } else for (;!(s = (r = l.call(t)).done) && (i.push(r.value), i.length !== n); s = !0) {
244
238
  }
245
239
  } catch (e) {
246
- c = !0, a = e;
240
+ u = !0, a = e;
247
241
  } finally {
248
242
  try {
249
243
  if (!s && null != t["return"] && (o = t["return"](), Object(o) !== o)) return;
250
244
  } finally {
251
- if (c) throw a;
245
+ if (u) throw a;
252
246
  }
253
247
  }
254
248
  return i;
@@ -288,9 +282,9 @@
288
282
  openPanelId: l().any
289
283
  };
290
284
  function ee(e) {
291
- var n = e.children, a = e.defaultOpenPanelId, l = e.elementRef, o = e.inset, i = o === void 0 ? true : o, s = e.onChange, u = e.openPanelId, d = Q(e, [ "children", "defaultOpenPanelId", "elementRef", "inset", "onChange", "openPanelId" ]);
285
+ var n = e.children, a = e.defaultOpenPanelId, l = e.elementRef, o = e.inset, i = o === void 0 ? true : o, s = e.onChange, c = e.openPanelId, d = Q(e, [ "children", "defaultOpenPanelId", "elementRef", "inset", "onChange", "openPanelId" ]);
292
286
  // @docs-props-type SingleOpenPanelGroupPropsBase
293
- var p = c()({
287
+ var p = u()({
294
288
  componentName: "SingleOpenPanelGroup",
295
289
  /* eslint-disable-next-line prefer-rest-params */
296
290
  componentProps: arguments[0],
@@ -302,44 +296,86 @@
302
296
  var b = (0, t.useState)(f), v = U(b, 2), y = v[0], m = v[1];
303
297
  var g = (0, t.useCallback)((function(e, n) {
304
298
  var t = n.panelId;
305
- var r = p ? u : y;
299
+ var r = p ? c : y;
306
300
  var a = r === t ? null : t;
307
301
  if (!p) {
308
302
  m(a);
309
303
  }
310
304
  s === null || s === void 0 ? void 0 : s(e, n);
311
- }), [ p, u, y, s ]);
305
+ }), [ p, c, y, s ]);
312
306
  var h = t.Children.toArray(n).filter(t.isValidElement);
313
307
  // remove false, null, 0, etc
314
308
  var S = (0, t.useMemo)((function() {
315
309
  return {
316
310
  onChange: g,
317
- openPanelId: p ? u : y,
311
+ openPanelId: p ? c : y,
318
312
  inset: i
319
313
  };
320
- }), [ g, i, p, u, y ]);
314
+ }), [ g, i, p, c, y ]);
321
315
 
322
- return r().createElement(k, L({
316
+ return r().createElement(k, R({
323
317
  "data-test": "single-open-panel-group",
324
- "data-test-open-panel-id": u,
318
+ "data-test-open-panel-id": c,
325
319
  ref: l
326
- }, M().apply(void 0, [ d ].concat(W(Object.keys(Z))))), r().createElement(R.Provider, {
320
+ }, V().apply(void 0, [ d ].concat(H(Object.keys(Z))))), r().createElement(B.Provider, {
327
321
  value: S
328
322
  }, h));
329
323
  }
330
324
  ee.propTypes = Z;
331
325
  /* harmony default export */ const ne = ee;
332
- // CONCATENATED MODULE: ./src/CollapsiblePanel/CollapsiblePanel.tsx
326
+ // CONCATENATED MODULE: ./src/utils/disabled.ts
327
+ /**
328
+ * Normalizes the disabled prop and returns both the boolean state and normalized string value.
329
+ * Use this function to ensure consistent handling of disabled prop across components.
330
+ *
331
+ * @param disabled - The disabled prop value
332
+ * @param defaultWhenBooleanTrue - Optional normalization override for disabled={true}
333
+ * @returns Object with isDisabled boolean|undefined and disabledValue string
334
+ *
335
+ * TODO (SUI-8600): `disabled` prop should default to 'dimmed' for data entry components
336
+ */
333
337
  function te(e) {
338
+ var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "dimmed";
339
+ if (e === "dimmed") {
340
+ return {
341
+ isDisabled: true,
342
+ disabledValue: "dimmed"
343
+ };
344
+ }
345
+ if (e === true) {
346
+ return {
347
+ isDisabled: true,
348
+ disabledValue: n
349
+ };
350
+ }
351
+ if (e === "disabled") {
352
+ return {
353
+ isDisabled: true,
354
+ disabledValue: "disabled"
355
+ };
356
+ }
357
+ if (e === false) {
358
+ return {
359
+ isDisabled: false,
360
+ disabledValue: undefined
361
+ };
362
+ }
363
+ return {
364
+ isDisabled: undefined,
365
+ disabledValue: undefined
366
+ };
367
+ }
368
+ // CONCATENATED MODULE: ./src/CollapsiblePanel/CollapsiblePanel.tsx
369
+ function re(e) {
334
370
  "@babel/helpers - typeof";
335
- return te = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
371
+ return re = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
336
372
  return typeof e;
337
373
  } : function(e) {
338
374
  return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
339
- }, te(e);
375
+ }, re(e);
340
376
  }
341
- function re() {
342
- return re = Object.assign ? Object.assign.bind() : function(e) {
377
+ function ae() {
378
+ return ae = Object.assign ? Object.assign.bind() : function(e) {
343
379
  for (var n = 1; n < arguments.length; n++) {
344
380
  var t = arguments[n];
345
381
  for (var r in t) {
@@ -347,9 +383,9 @@
347
383
  }
348
384
  }
349
385
  return e;
350
- }, re.apply(null, arguments);
386
+ }, ae.apply(null, arguments);
351
387
  }
352
- function ae(e, n) {
388
+ function le(e, n) {
353
389
  var t = Object.keys(e);
354
390
  if (Object.getOwnPropertySymbols) {
355
391
  var r = Object.getOwnPropertySymbols(e);
@@ -359,63 +395,63 @@
359
395
  }
360
396
  return t;
361
397
  }
362
- function le(e) {
398
+ function oe(e) {
363
399
  for (var n = 1; n < arguments.length; n++) {
364
400
  var t = null != arguments[n] ? arguments[n] : {};
365
- n % 2 ? ae(Object(t), !0).forEach((function(n) {
366
- oe(e, n, t[n]);
367
- })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ae(Object(t)).forEach((function(n) {
401
+ n % 2 ? le(Object(t), !0).forEach((function(n) {
402
+ ie(e, n, t[n]);
403
+ })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : le(Object(t)).forEach((function(n) {
368
404
  Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(t, n));
369
405
  }));
370
406
  }
371
407
  return e;
372
408
  }
373
- function oe(e, n, t) {
374
- return (n = ie(n)) in e ? Object.defineProperty(e, n, {
409
+ function ie(e, n, t) {
410
+ return (n = se(n)) in e ? Object.defineProperty(e, n, {
375
411
  value: t,
376
412
  enumerable: !0,
377
413
  configurable: !0,
378
414
  writable: !0
379
415
  }) : e[n] = t, e;
380
416
  }
381
- function ie(e) {
382
- var n = se(e, "string");
383
- return "symbol" == te(n) ? n : n + "";
417
+ function se(e) {
418
+ var n = ue(e, "string");
419
+ return "symbol" == re(n) ? n : n + "";
384
420
  }
385
- function se(e, n) {
386
- if ("object" != te(e) || !e) return e;
421
+ function ue(e, n) {
422
+ if ("object" != re(e) || !e) return e;
387
423
  var t = e[Symbol.toPrimitive];
388
424
  if (void 0 !== t) {
389
425
  var r = t.call(e, n || "default");
390
- if ("object" != te(r)) return r;
426
+ if ("object" != re(r)) return r;
391
427
  throw new TypeError("@@toPrimitive must return a primitive value.");
392
428
  }
393
429
  return ("string" === n ? String : Number)(e);
394
430
  }
395
431
  function ce(e, n) {
396
- return be(e) || fe(e, n) || de(e, n) || ue();
432
+ return ve(e) || be(e, n) || pe(e, n) || de();
397
433
  }
398
- function ue() {
434
+ function de() {
399
435
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
400
436
  }
401
- function de(e, n) {
437
+ function pe(e, n) {
402
438
  if (e) {
403
- if ("string" == typeof e) return pe(e, n);
439
+ if ("string" == typeof e) return fe(e, n);
404
440
  var t = {}.toString.call(e).slice(8, -1);
405
- return "Object" === t && e.constructor && (t = e.constructor.name), "Map" === t || "Set" === t ? Array.from(e) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? pe(e, n) : void 0;
441
+ return "Object" === t && e.constructor && (t = e.constructor.name), "Map" === t || "Set" === t ? Array.from(e) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? fe(e, n) : void 0;
406
442
  }
407
443
  }
408
- function pe(e, n) {
444
+ function fe(e, n) {
409
445
  (null == n || n > e.length) && (n = e.length);
410
446
  for (var t = 0, r = Array(n); t < n; t++) {
411
447
  r[t] = e[t];
412
448
  }
413
449
  return r;
414
450
  }
415
- function fe(e, n) {
451
+ function be(e, n) {
416
452
  var t = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
417
453
  if (null != t) {
418
- var r, a, l, o, i = [], s = !0, c = !1;
454
+ var r, a, l, o, i = [], s = !0, u = !1;
419
455
  try {
420
456
  if (l = (t = t.call(e)).next, 0 === n) {
421
457
  if (Object(t) !== t) return;
@@ -423,23 +459,23 @@
423
459
  } else for (;!(s = (r = l.call(t)).done) && (i.push(r.value), i.length !== n); s = !0) {
424
460
  }
425
461
  } catch (e) {
426
- c = !0, a = e;
462
+ u = !0, a = e;
427
463
  } finally {
428
464
  try {
429
465
  if (!s && null != t["return"] && (o = t["return"](), Object(o) !== o)) return;
430
466
  } finally {
431
- if (c) throw a;
467
+ if (u) throw a;
432
468
  }
433
469
  }
434
470
  return i;
435
471
  }
436
472
  }
437
- function be(e) {
473
+ function ve(e) {
438
474
  if (Array.isArray(e)) return e;
439
475
  }
440
- function ve(e, n) {
476
+ function ye(e, n) {
441
477
  if (null == e) return {};
442
- var t, r, a = ye(e, n);
478
+ var t, r, a = me(e, n);
443
479
  if (Object.getOwnPropertySymbols) {
444
480
  var l = Object.getOwnPropertySymbols(e);
445
481
  for (r = 0; r < l.length; r++) {
@@ -448,7 +484,7 @@
448
484
  }
449
485
  return a;
450
486
  }
451
- function ye(e, n) {
487
+ function me(e, n) {
452
488
  if (null == e) return {};
453
489
  var t = {};
454
490
  for (var r in e) {
@@ -459,7 +495,7 @@
459
495
  }
460
496
  return t;
461
497
  }
462
- /** @public */ var me = {
498
+ /** @public */ var ge = {
463
499
  innerBodyStyles: l().object,
464
500
  actions: l().node,
465
501
  appearance: l().oneOf([ "default", "subtle" ]),
@@ -477,12 +513,12 @@
477
513
  renderChildrenWhenCollapsed: l().bool,
478
514
  title: l().node.isRequired
479
515
  };
480
- function ge(e) {
481
- var n = e.innerBodyStyles, a = e.actions, l = e.appearance, o = l === void 0 ? "default" : l, s = e.children, u = e.defaultOpen, f = u === void 0 ? undefined : u, b = e.description, v = e.disabled, y = e.elementRef, m = e.headingLevel, g = e.onChange, h = e.open, S = e.overflow, O = S === void 0 ? "auto" : S, C = e.panelId, P = e.renderChildrenWhenCollapsed, k = e.title, I = e.inset, T = I === void 0 ? true : I, M = ve(e, [ "innerBodyStyles", "actions", "appearance", "children", "defaultOpen", "description", "disabled", "elementRef", "headingLevel", "onChange", "open", "overflow", "panelId", "renderChildrenWhenCollapsed", "title", "inset" ]);
516
+ function he(e) {
517
+ var n = e.innerBodyStyles, a = e.actions, l = e.appearance, o = l === void 0 ? "default" : l, s = e.children, c = e.defaultOpen, f = c === void 0 ? undefined : c, b = e.description, v = e.disabled, y = e.elementRef, m = e.headingLevel, g = e.onChange, h = e.open, S = e.overflow, O = S === void 0 ? "auto" : S, C = e.panelId, P = e.renderChildrenWhenCollapsed, k = e.title, I = e.inset, T = I === void 0 ? true : I, V = ye(e, [ "innerBodyStyles", "actions", "appearance", "children", "defaultOpen", "description", "disabled", "elementRef", "headingLevel", "onChange", "open", "overflow", "panelId", "renderChildrenWhenCollapsed", "title", "inset" ]);
482
518
  // @docs-props-type CollapsiblePanelPropsBase
483
- var B = (0, t.useContext)(R);
484
- var L = Object.keys(B).length !== 0;
485
- var W = c()({
519
+ var M = (0, t.useContext)(B);
520
+ var R = Object.keys(M).length !== 0;
521
+ var H = u()({
486
522
  componentName: "CollapsiblePanel",
487
523
  /* eslint-disable-next-line prefer-rest-params */
488
524
  componentProps: arguments[0],
@@ -490,127 +526,129 @@
490
526
  defaultValuePropName: "defaultOpen",
491
527
  valuePropName: "open"
492
528
  });
493
- var H = (0, t.useState)("container-".concat((0, p.createGUID)())), V = ce(H, 1), G = V[0];
529
+ var L = (0, t.useState)("container-".concat((0, p.createGUID)())), W = ce(L, 1), G = W[0];
494
530
  var U = (0, t.useState)("toggle-".concat((0, p.createGUID)())), z = ce(U, 1), X = z[0];
495
531
  var F = d()(h);
496
- var J = !W ? f || false : undefined;
532
+ var J = !H ? f || false : undefined;
497
533
  var K = (0, t.useState)(J), Q = ce(K, 2), Y = Q[0], Z = Q[1];
498
- var ee = (0, t.useState)(false), ne = ce(ee, 2), te = ne[0], ae = ne[1];
499
- var oe = (0, t.useMemo)((function() {
500
- if (L) {
534
+ var ee = (0, t.useState)(false), ne = ce(ee, 2), re = ne[0], le = ne[1];
535
+ var ie = (0, t.useMemo)((function() {
536
+ if (R) {
501
537
  /**
502
538
  * SingleOpenPanelGroup already takes into account if it is controlled or not in determining openPanelId
503
539
  * so context.openPanelId is used for both the controlled and uncontrolled case.
504
540
  */
505
- return B.openPanelId === C;
541
+ return M.openPanelId === C;
506
542
  }
507
- return W ? h : Y;
508
- }), [ B.openPanelId, L, W, h, Y, C ]);
543
+ return H ? h : Y;
544
+ }), [ M.openPanelId, R, H, h, Y, C ]);
509
545
  // SUI-7877 Must initialize openPanel with value to avoid re-render animation bug
510
- var ie = (0, t.useState)(oe), se = ce(ie, 2), ue = se[0], de = se[1];
546
+ var se = (0, t.useState)(ie), ue = ce(se, 2), de = ue[0], pe = ue[1];
511
547
  (0, t.useEffect)((function() {
512
- de(oe);
513
- }), [ oe ]);
548
+ pe(ie);
549
+ }), [ ie ]);
514
550
  // Only testing this in the scenario of a SingleOpenPanelGroup.
515
551
  (0, t.useEffect)((function() {
516
552
  if (false) {}
517
- }), [ f, L, h ]);
553
+ }), [ f, R, h ]);
518
554
  (0, t.useEffect)((function() {
519
555
  if (F != null && h !== F) {
520
- ae(true);
556
+ le(true);
521
557
  }
522
558
  }), [ h, F ]);
523
- var pe = (0, t.useCallback)((function(e) {
559
+ var fe = (0, t.useCallback)((function(e) {
524
560
  var n;
525
- if (!W) {
526
- ae(true);
527
- Z(!ue);
561
+ if (!H) {
562
+ le(true);
563
+ Z(!de);
528
564
  }
529
- var t = ue ? "close" : "open";
565
+ var t = de ? "close" : "open";
530
566
  g === null || g === void 0 ? void 0 : g(e, {
531
567
  panelId: C,
532
568
  reason: "toggleClick",
533
569
  action: t
534
570
  });
535
- (n = B.onChange) === null || n === void 0 ? void 0 : n.call(B, e, {
571
+ (n = M.onChange) === null || n === void 0 ? void 0 : n.call(M, e, {
536
572
  panelId: C,
537
573
  reason: "toggleClick",
538
574
  action: t
539
575
  });
540
- }), [ B, W, ue, g, C ]);
541
- var fe = (0, t.useCallback)((function() {
542
- ae(false);
576
+ }), [ M, H, de, g, C ]);
577
+ var be = (0, t.useCallback)((function() {
578
+ le(false);
543
579
  }), []);
544
- var be = (0, p.createDOMID)("panel-toggle");
545
- var ye = {
580
+ var ve = (0, p.createDOMID)("panel-toggle");
581
+ var me = te(v), ge = me.isDisabled, he = me.disabledValue;
582
+ var Se = {
546
583
  disabled: v,
547
- onClick: pe,
584
+ onClick: fe,
548
585
  id: X,
549
586
  "aria-controls": G,
550
- "aria-expanded": ue,
551
- "data-test": "toggle"
587
+ "aria-expanded": de,
588
+ "data-test": "toggle",
589
+ "data-test-disabled": he
552
590
  };
553
- var me = (0, t.useMemo)((function() {
591
+ var Oe = (0, t.useMemo)((function() {
554
592
  return {
555
- overflow: te ? "hidden" : O
593
+ overflow: re ? "hidden" : O
556
594
  };
557
- }), [ te, O ]);
558
- var ge = (0, t.useMemo)((function() {
559
- return le({
595
+ }), [ re, O ]);
596
+ var Ce = (0, t.useMemo)((function() {
597
+ return oe({
560
598
  tableLayout: "fixed"
561
599
  }, n);
562
600
  }), [ n ]);
563
601
 
564
- return r().createElement(w, re({
602
+ return r().createElement(w, ae({
565
603
  "data-test": "collapsible-panel",
566
604
  ref: y,
567
605
  $appearance: o
568
- }, M), a != null ? r().createElement(x, {
606
+ }, V), a != null ? r().createElement(x, {
569
607
  $appearance: o,
570
- $disabled: !!v
571
- }, r().createElement(E, re({
608
+ $disabled: !!ge
609
+ }, r().createElement(E, ae({
572
610
  appearance: "secondary",
573
- "aria-labelledby": be
574
- }, ye), r().createElement(D, {
575
- $open: !!ue
611
+ "aria-labelledby": ve
612
+ }, Se), r().createElement(q, {
613
+ $open: !!de
576
614
  })), r().createElement(A, {
577
- $disabled: !!v,
615
+ $disabled: !!ge,
578
616
  "data-test": "title",
579
- id: be
580
- }, k), r().createElement($, null, a)) :
617
+ id: ve
618
+ }, k), r().createElement(D, null, a)) :
581
619
 
582
620
  /* Clickable component is not allowed to have role="heading" so it is wrapped with a span */
583
621
  r().createElement("span", {
584
622
  "data-test": "heading",
585
623
  role: m ? "heading" : undefined,
586
624
  "aria-level": m
587
- }, r().createElement(_, re({
625
+ }, r().createElement(_, ae({
588
626
  $appearance: o
589
- }, ye), r().createElement(j, null, r().createElement(D, {
590
- $open: !!ue
627
+ }, Se), r().createElement(j, null, r().createElement(q, {
628
+ $open: !!de
591
629
  })), r().createElement(A, {
592
- $disabled: !!v
630
+ $disabled: !!ge
593
631
  }, r().createElement("span", {
594
632
  "data-test": "title"
595
- }, k), b && r().createElement(N, {
596
- $disabled: !!v,
633
+ }, k), b && r().createElement($, {
634
+ $disabled: !!ge,
597
635
  "data-test": "description"
598
636
  }, b)))), r().createElement(i(), {
599
637
  outerId: G,
600
638
  "aria-labelledby": X,
601
639
  "data-test": "body",
602
- outerStyle: me,
603
- innerStyle: ge,
604
- open: ue,
605
- onAnimationEnd: fe,
640
+ outerStyle: Oe,
641
+ innerStyle: Ce,
642
+ open: de,
643
+ onAnimationEnd: be,
606
644
  role: a != null ? "region" : undefined,
607
645
  renderChildrenWhenCollapsed: P
608
- }, r().createElement(q, {
646
+ }, r().createElement(N, {
609
647
  $inset: T
610
648
  }, s)));
611
649
  }
612
- ge.propTypes = me;
613
- /* harmony default export */ const he = ge;
650
+ he.propTypes = ge;
651
+ /* harmony default export */ const Se = he;
614
652
  // CONCATENATED MODULE: ./src/CollapsiblePanel/index.ts
615
653
  module.exports = n;
616
654
  /******/})();
package/ComboBox.js CHANGED
@@ -578,6 +578,7 @@
578
578
  switch (o) {
579
579
  case "Enter":
580
580
  {
581
+ e.preventDefault();
581
582
  if (t) {
582
583
  Ye(e, {
583
584
  value: t