@splunk/react-ui 5.7.1 → 5.8.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 (138) hide show
  1. package/Accordion.js +6 -6
  2. package/Box.js +83 -34
  3. package/CHANGELOG.md +29 -0
  4. package/CollapsiblePanel.js +11 -11
  5. package/ComboBox.js +31 -27
  6. package/ControlGroup.js +92 -91
  7. package/DefinitionList.js +9 -9
  8. package/Drawer.d.ts +2 -0
  9. package/Drawer.js +679 -0
  10. package/DualListbox.js +1 -1
  11. package/JSONTree.js +73 -72
  12. package/Link.js +2 -2
  13. package/MIGRATION.md +10 -0
  14. package/Menu.js +338 -240
  15. package/Modal.js +127 -109
  16. package/Multiselect.js +437 -351
  17. package/Paginator.js +14 -12
  18. package/Popover.js +4 -1
  19. package/README.md +11 -0
  20. package/RadioBar.js +1 -1
  21. package/Search.js +103 -88
  22. package/Select.js +42 -40
  23. package/SelectBase.js +374 -328
  24. package/SidePanel.js +346 -167
  25. package/SlidingPanels.js +11 -11
  26. package/StepBar.js +7 -7
  27. package/Switch.js +5 -5
  28. package/Text.js +24 -24
  29. package/TextArea.js +7 -7
  30. package/TransitionOpen.js +188 -169
  31. package/docs-llm/Accordion.md +267 -0
  32. package/docs-llm/Anchor Menu.md +115 -0
  33. package/docs-llm/Anchor.md +54 -0
  34. package/docs-llm/AnimationToggle.md +254 -0
  35. package/docs-llm/Avatar.md +298 -0
  36. package/docs-llm/Badge.md +212 -0
  37. package/docs-llm/Breadcrumbs.md +306 -0
  38. package/docs-llm/Button Group.md +53 -0
  39. package/docs-llm/Button.md +361 -0
  40. package/docs-llm/Card Layout.md +286 -0
  41. package/docs-llm/Card.md +619 -0
  42. package/docs-llm/Checkbox.md +218 -0
  43. package/docs-llm/Chip.md +291 -0
  44. package/docs-llm/Clickable.md +160 -0
  45. package/docs-llm/Code.md +292 -0
  46. package/docs-llm/Collapsible Panel.md +744 -0
  47. package/docs-llm/Color.md +253 -0
  48. package/docs-llm/Column Layout.md +391 -0
  49. package/docs-llm/Combo Box.md +540 -0
  50. package/docs-llm/Control Group.md +594 -0
  51. package/docs-llm/Date.md +270 -0
  52. package/docs-llm/Definition List.md +278 -0
  53. package/docs-llm/Divider.md +216 -0
  54. package/docs-llm/Drawer.md +414 -0
  55. package/docs-llm/Dropdown.md +472 -0
  56. package/docs-llm/Dual Listbox.md +325 -0
  57. package/docs-llm/File.md +653 -0
  58. package/docs-llm/Form Rows.md +374 -0
  59. package/docs-llm/Heading.md +179 -0
  60. package/docs-llm/Image.md +109 -0
  61. package/docs-llm/JSON Tree.md +260 -0
  62. package/docs-llm/Layer.md +74 -0
  63. package/docs-llm/Layout.md +50 -0
  64. package/docs-llm/Link.md +318 -0
  65. package/docs-llm/List.md +189 -0
  66. package/docs-llm/Markdown.md +179 -0
  67. package/docs-llm/Menu.md +735 -0
  68. package/docs-llm/Message Bar.md +236 -0
  69. package/docs-llm/Message.md +248 -0
  70. package/docs-llm/Modal.md +443 -0
  71. package/docs-llm/Monogram.md +159 -0
  72. package/docs-llm/Multiselect.md +937 -0
  73. package/docs-llm/Number.md +298 -0
  74. package/docs-llm/Paginator.md +395 -0
  75. package/docs-llm/Paragraph.md +148 -0
  76. package/docs-llm/Phone Number.md +254 -0
  77. package/docs-llm/Popover.md +166 -0
  78. package/docs-llm/Progress.md +141 -0
  79. package/docs-llm/Radio Bar.md +303 -0
  80. package/docs-llm/Radio List.md +350 -0
  81. package/docs-llm/Resize.md +362 -0
  82. package/docs-llm/Screen Reader Content.md +73 -0
  83. package/docs-llm/Scroll Container Context.md +155 -0
  84. package/docs-llm/Scroll.md +152 -0
  85. package/docs-llm/Search.md +381 -0
  86. package/docs-llm/Select.md +985 -0
  87. package/docs-llm/Side Panel.md +777 -0
  88. package/docs-llm/Slider.md +339 -0
  89. package/docs-llm/Sliding Panels.md +340 -0
  90. package/docs-llm/Split Button.md +295 -0
  91. package/docs-llm/Static Content.md +90 -0
  92. package/docs-llm/Step Bar.md +292 -0
  93. package/docs-llm/Switch.md +268 -0
  94. package/docs-llm/Tab Bar.md +439 -0
  95. package/docs-llm/Tab Layout.md +398 -0
  96. package/docs-llm/Table.md +2642 -0
  97. package/docs-llm/Text Area.md +253 -0
  98. package/docs-llm/Text.md +339 -0
  99. package/docs-llm/Tooltip.md +325 -0
  100. package/docs-llm/Transition Open.md +406 -0
  101. package/docs-llm/Tree.md +586 -0
  102. package/docs-llm/Typography.md +125 -0
  103. package/docs-llm/Wait Spinner.md +121 -0
  104. package/docs-llm/llms.txt +97 -0
  105. package/package.json +6 -5
  106. package/types/src/Box/Box.d.ts +2 -10
  107. package/types/src/Drawer/Body.d.ts +17 -0
  108. package/types/src/Drawer/Drawer.d.ts +114 -0
  109. package/types/src/Drawer/DrawerContext.d.ts +11 -0
  110. package/types/src/Drawer/Footer.d.ts +25 -0
  111. package/types/src/Drawer/Header.d.ts +41 -0
  112. package/types/src/Drawer/docs/examples/Basic.d.ts +6 -0
  113. package/types/src/Drawer/docs/examples/ContainerPosition.d.ts +7 -0
  114. package/types/src/Drawer/docs/examples/InitialFocus.d.ts +9 -0
  115. package/types/src/Drawer/docs/examples/InlinePosition.d.ts +7 -0
  116. package/types/src/Drawer/docs/examples/PagePosition.d.ts +7 -0
  117. package/types/src/Drawer/index.d.ts +2 -0
  118. package/types/src/JSONTree/JSONTree.d.ts +12 -5
  119. package/types/src/JSONTree/renderTreeItems.d.ts +2 -1
  120. package/types/src/Menu/Item.d.ts +2 -1
  121. package/types/src/Menu/docs/examples/SelectableCheckbox.d.ts +7 -0
  122. package/types/src/Modal/Modal.d.ts +1 -2
  123. package/types/src/Select/Option.d.ts +6 -3
  124. package/types/src/Select/Select.d.ts +8 -5
  125. package/types/src/Select/docs/examples/Dimmed.d.ts +7 -0
  126. package/types/src/SelectBase/OptionBase.d.ts +6 -3
  127. package/types/src/SelectBase/SelectBase.d.ts +8 -3
  128. package/types/src/SidePanel/SidePanel.d.ts +43 -2
  129. package/types/src/SidePanel/docs/examples/DockLayout.d.ts +17 -0
  130. package/types/src/SidePanel/docs/examples/InitialFocus.d.ts +9 -0
  131. package/types/src/TransitionOpen/TransitionOpen.d.ts +29 -4
  132. package/types/src/useKeyPress/index.d.ts +9 -2
  133. package/types/src/useOnClickOutside/index.d.ts +2 -0
  134. package/types/src/useOnClickOutside/useOnClickOutside.d.ts +4 -0
  135. package/useKeyPress.js +23 -18
  136. package/useOnClickOutside.d.ts +2 -0
  137. package/useOnClickOutside.js +79 -0
  138. package/types/src/RadioList/docs/examples/Row.d.ts +0 -6
package/Modal.js CHANGED
@@ -64,7 +64,7 @@
64
64
  Body: () => /* reexport */ D,
65
65
  Footer: () => /* reexport */ V,
66
66
  Header: () => /* reexport */ ue,
67
- default: () => /* reexport */ Ie
67
+ default: () => /* reexport */ _e
68
68
  });
69
69
  // CONCATENATED MODULE: external "react"
70
70
  const t = require("react");
@@ -85,11 +85,11 @@
85
85
  const d = require("@splunk/react-ui/usePrevious");
86
86
  var p = e.n(d);
87
87
  // CONCATENATED MODULE: external "@splunk/ui-utils/focus"
88
- const v = require("@splunk/ui-utils/focus");
88
+ const y = require("@splunk/ui-utils/focus");
89
89
  // CONCATENATED MODULE: external "@splunk/ui-utils/id"
90
- const b = require("@splunk/ui-utils/id");
90
+ const v = require("@splunk/ui-utils/id");
91
91
  // CONCATENATED MODULE: external "@splunk/react-ui/ScrollContainerContext"
92
- const y = require("@splunk/react-ui/ScrollContainerContext");
92
+ const b = require("@splunk/react-ui/ScrollContainerContext");
93
93
  // CONCATENATED MODULE: external "styled-components"
94
94
  const m = require("styled-components");
95
95
  var g = e.n(m);
@@ -97,16 +97,16 @@
97
97
  const h = require("@splunk/react-ui/Box");
98
98
  var O = e.n(h);
99
99
  // CONCATENATED MODULE: external "@splunk/themes"
100
- const w = require("@splunk/themes");
100
+ const S = require("@splunk/themes");
101
101
  // CONCATENATED MODULE: ./src/Modal/BodyStyles.ts
102
- var S = g()(O()).withConfig({
102
+ var w = g()(O()).withConfig({
103
103
  displayName: "BodyStyles__StyledBox",
104
104
  componentId: "lv54z7-0"
105
105
  })([ "background-color:", ";padding:", " ", ";flex:0 1 auto;overflow:auto;" ], (0,
106
- w.pick)({
107
- enterprise: w.variables.backgroundColor,
108
- prisma: w.variables.backgroundColorDialog
109
- }), w.variables.spacingMedium, w.variables.spacingXLarge);
106
+ S.pick)({
107
+ enterprise: S.variables.backgroundColor,
108
+ prisma: S.variables.backgroundColorDialog
109
+ }), S.variables.spacingMedium, S.variables.spacingXLarge);
110
110
  // CONCATENATED MODULE: ./src/Modal/Body.tsx
111
111
  function x() {
112
112
  return x = Object.assign ? Object.assign.bind() : function(e) {
@@ -199,11 +199,11 @@
199
199
  u(e);
200
200
  }), []);
201
201
 
202
- return n().createElement(S, x({
202
+ return n().createElement(w, x({
203
203
  "data-test": "body"
204
204
  }, o, {
205
- elementRef: c
206
- }), n().createElement(y.ScrollContainerProvider, {
205
+ ref: c
206
+ }), n().createElement(b.ScrollContainerProvider, {
207
207
  value: l
208
208
  }, r));
209
209
  }
@@ -216,9 +216,9 @@
216
216
  var B = g().div.withConfig({
217
217
  displayName: "FooterStyles__StyledDiv",
218
218
  componentId: "yszcmv-0"
219
- })([ "flex:0 0 auto;padding:", " ", ";background-color:", ";& >:is(button,a){min-width:80px;}", "" ], w.variables.spacingLarge, w.variables.spacingXLarge, w.variables.backgroundColorDialog, (0,
220
- w.pickVariant)("$layout", {
221
- auto: (0, m.css)([ "display:flex;align-items:center;justify-content:flex-end;gap:", ";& > *:is(button,a,*){flex:0 0 auto;}& >:not(button,a){margin-right:auto;}&:has(:is(button,a) +:is(button,a) +:is(button,a)) >:is(button,a):first-child{margin-right:auto;}" ], w.variables.spacingSmall),
219
+ })([ "flex:0 0 auto;padding:", " ", ";background-color:", ";& >:is(button,a){min-width:80px;}", "" ], S.variables.spacingLarge, S.variables.spacingXLarge, S.variables.backgroundColorDialog, (0,
220
+ S.pickVariant)("$layout", {
221
+ auto: (0, m.css)([ "display:flex;align-items:center;justify-content:flex-end;gap:", ";& > *:is(button,a,*){flex:0 0 auto;}& >:not(button,a){margin-right:auto;}&:has(:is(button,a) +:is(button,a) +:is(button,a)) >:is(button,a):first-child{margin-right:auto;}" ], S.variables.spacingSmall),
222
222
  none: (0, m.css)([ "text-align:right;" ])
223
223
  }));
224
224
  // CONCATENATED MODULE: ./src/Modal/ModalContext.tsx
@@ -292,29 +292,29 @@
292
292
  var Q = g()(O()).withConfig({
293
293
  displayName: "HeaderStyles__Styled",
294
294
  componentId: "sc-1y722ut-0"
295
- })([ "", ";flex:0 0 auto;position:relative;min-height:", ";background-color:", ";padding:", " ", ";gap:", ";" ], w.mixins.reset("flex"), (0,
296
- w.pick)({
295
+ })([ "", ";flex:0 0 auto;position:relative;min-height:", ";background-color:", ";padding:", " ", ";gap:", ";" ], S.mixins.reset("flex"), (0,
296
+ S.pick)({
297
297
  enterprise: "30px",
298
298
  prisma: {
299
299
  comfortable: "60px",
300
300
  compact: "52px"
301
301
  }
302
- }), (0, w.pick)({
303
- enterprise: w.variables.backgroundColor,
304
- prisma: w.variables.backgroundColorDialog
305
- }), w.variables.spacingLarge, w.variables.spacingXLarge, w.variables.spacingSmall);
302
+ }), (0, S.pick)({
303
+ enterprise: S.variables.backgroundColor,
304
+ prisma: S.variables.backgroundColorDialog
305
+ }), S.variables.spacingLarge, S.variables.spacingXLarge, S.variables.spacingSmall);
306
306
  var Y = g().div.withConfig({
307
307
  displayName: "HeaderStyles__StyledTitleWrapper",
308
308
  componentId: "sc-1y722ut-1"
309
- })([ "", ";flex-direction:column;align-self:center;margin-right:auto;" ], w.mixins.reset("flex"));
309
+ })([ "", ";flex-direction:column;align-self:center;margin-right:auto;" ], S.mixins.reset("flex"));
310
310
  var Z = g().h2.withConfig({
311
311
  displayName: "HeaderStyles__StyledTitle",
312
312
  componentId: "sc-1y722ut-2"
313
- })([ "", ";", " margin:0;overflow-wrap:break-word;" ], w.mixins.reset("block"), w.mixins.typography("title3"));
313
+ })([ "", ";", " margin:0;overflow-wrap:break-word;" ], S.mixins.reset("block"), S.mixins.typography("title3"));
314
314
  var ee = g().p.withConfig({
315
315
  displayName: "HeaderStyles__StyledSubtitle",
316
316
  componentId: "sc-1y722ut-3"
317
- })([ "", ";overflow-wrap:break-word;" ], w.mixins.reset("block"));
317
+ })([ "", ";overflow-wrap:break-word;" ], S.mixins.reset("block"));
318
318
  var re = g()(J()).withConfig({
319
319
  displayName: "HeaderStyles__StyledButton",
320
320
  componentId: "sc-1y722ut-4"
@@ -369,34 +369,34 @@
369
369
  */ function le(e) {
370
370
  var r = e.children, o = e.icon, i = e.hideCloseButton, a = i === void 0 ? false : i, l = e.title, u = e.subtitle, c = ne(e, [ "children", "icon", "hideCloseButton", "title", "subtitle" ]);
371
371
  // @docs-props-type HeaderPropsBase
372
- var s = (0, t.useContext)(N), f = s.titleId, d = s.subtitleId, p = s.divider, v = s.onRequestClose;
373
- var b = p === "both" || p === "header";
374
- var y = (0, t.isValidElement)(o) && (0, t.cloneElement)(o, {
372
+ var s = (0, t.useContext)(N), f = s.titleId, d = s.subtitleId, p = s.divider, y = s.onRequestClose;
373
+ var v = p === "both" || p === "header";
374
+ var b = (0, t.isValidElement)(o) && (0, t.cloneElement)(o, {
375
375
  width: o.props.width || "48px",
376
376
  height: o.props.height || "48px"
377
377
  });
378
378
  var m = (0, t.useCallback)((function(e) {
379
- v === null || v === void 0 ? void 0 : v({
379
+ y === null || y === void 0 ? void 0 : y({
380
380
  event: e,
381
381
  reason: "clickCloseButton"
382
382
  });
383
- }), [ v ]);
383
+ }), [ y ]);
384
384
 
385
385
  return n().createElement(n().Fragment, null, n().createElement(Q, te({
386
386
  "data-test": "header"
387
- }, c), y, l ? n().createElement(Y, null, l && n().createElement(Z, {
387
+ }, c), b, l ? n().createElement(Y, null, l && n().createElement(Z, {
388
388
  id: f,
389
389
  "data-test": "title"
390
390
  }, l), u && n().createElement(ee, {
391
391
  id: d,
392
392
  "data-test": "subtitle"
393
- }, u)) : r, !a && v && n().createElement(re, {
393
+ }, u)) : r, !a && y && n().createElement(re, {
394
394
  appearance: "subtle",
395
395
  "aria-label": (0, W._)("Close"),
396
396
  "data-test": "close",
397
397
  icon: ae,
398
398
  onClick: m
399
- })), b && n().createElement(R(), {
399
+ })), v && n().createElement(R(), {
400
400
  appearance: "weak",
401
401
  decorative: true
402
402
  }));
@@ -409,7 +409,36 @@
409
409
  var se = g()(ce.animated.div).withConfig({
410
410
  displayName: "ModalStyles__Styled",
411
411
  componentId: "sc-5fn8ds-0"
412
- })([ "", ";flex-direction:column;position:fixed;left:50%;transform:translateX(-50%);z-index:", ";box-shadow:", ";max-height:calc(100vh - ", " * 4);max-width:calc(100vw - ", " * 4);border-radius:", ";overflow:hidden;" ], w.mixins.reset("flex"), w.variables.zindexModal, w.variables.modalShadow, w.variables.spacingXLarge, w.variables.spacingXLarge, w.variables.borderRadius);
412
+ })([ "", ";flex-direction:column;position:fixed;left:50%;transform:translateX(-50%);z-index:", ";box-shadow:", ";max-height:calc(100vh - ", " * 4);max-width:calc(100vw - ", " * 4);border-radius:", ";overflow:hidden;" ], S.mixins.reset("flex"), S.variables.zindexModal, S.variables.modalShadow, S.variables.spacingXLarge, S.variables.spacingXLarge, S.variables.borderRadius);
413
+ // CONCATENATED MODULE: ./src/utils/resolveInitialFocusTarget.ts
414
+ function fe(e) {
415
+ "@babel/helpers - typeof";
416
+ return fe = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
417
+ return typeof e;
418
+ } : function(e) {
419
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
420
+ }, fe(e)
421
+ /**
422
+ * Resolves the initial focus target based on the initialFocus prop value.
423
+ *
424
+ * @param initialFocus - The initialFocus prop value ('first', 'container', HTMLElement, or React.Component with focus method)
425
+ * @param containerEl - The container element to use for 'first' and 'container' options
426
+ * @returns The element or component to focus, or null if none found
427
+ */;
428
+ }
429
+ function de(e, r) {
430
+ if (e === "first" && r) {
431
+ var t;
432
+ return (t = (0, y.getSortedTabbableElements)(r)[0]) !== null && t !== void 0 ? t : null;
433
+ }
434
+ if (e === "container") {
435
+ return r;
436
+ }
437
+ if (fe(e) === "object") {
438
+ return e;
439
+ }
440
+ return null;
441
+ }
413
442
  // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
414
443
  /**
415
444
  * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
@@ -417,7 +446,7 @@
417
446
  * @param ref - The React callback or object ref. Can be `null` or `undefined`.
418
447
  * @param current - The new value of the ref.
419
448
  */
420
- function fe(e, r) {
449
+ function pe(e, r) {
421
450
  if (e) {
422
451
  if (typeof e === "function") {
423
452
  e(r);
@@ -430,8 +459,16 @@
430
459
  }
431
460
  }
432
461
  // CONCATENATED MODULE: ./src/Modal/Modal.tsx
433
- function de() {
434
- return de = Object.assign ? Object.assign.bind() : function(e) {
462
+ function ye(e) {
463
+ "@babel/helpers - typeof";
464
+ return ye = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
465
+ return typeof e;
466
+ } : function(e) {
467
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
468
+ }, ye(e);
469
+ }
470
+ function ve() {
471
+ return ve = Object.assign ? Object.assign.bind() : function(e) {
435
472
  for (var r = 1; r < arguments.length; r++) {
436
473
  var t = arguments[r];
437
474
  for (var n in t) {
@@ -439,9 +476,9 @@
439
476
  }
440
477
  }
441
478
  return e;
442
- }, de.apply(null, arguments);
479
+ }, ve.apply(null, arguments);
443
480
  }
444
- function pe(e, r) {
481
+ function be(e, r) {
445
482
  var t = Object.keys(e);
446
483
  if (Object.getOwnPropertySymbols) {
447
484
  var n = Object.getOwnPropertySymbols(e);
@@ -451,68 +488,60 @@
451
488
  }
452
489
  return t;
453
490
  }
454
- function ve(e) {
491
+ function me(e) {
455
492
  for (var r = 1; r < arguments.length; r++) {
456
493
  var t = null != arguments[r] ? arguments[r] : {};
457
- r % 2 ? pe(Object(t), !0).forEach((function(r) {
458
- be(e, r, t[r]);
459
- })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : pe(Object(t)).forEach((function(r) {
494
+ r % 2 ? be(Object(t), !0).forEach((function(r) {
495
+ ge(e, r, t[r]);
496
+ })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : be(Object(t)).forEach((function(r) {
460
497
  Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
461
498
  }));
462
499
  }
463
500
  return e;
464
501
  }
465
- function be(e, r, t) {
466
- return (r = ye(r)) in e ? Object.defineProperty(e, r, {
502
+ function ge(e, r, t) {
503
+ return (r = he(r)) in e ? Object.defineProperty(e, r, {
467
504
  value: t,
468
505
  enumerable: !0,
469
506
  configurable: !0,
470
507
  writable: !0
471
508
  }) : e[r] = t, e;
472
509
  }
473
- function ye(e) {
474
- var r = me(e, "string");
475
- return "symbol" == ge(r) ? r : r + "";
510
+ function he(e) {
511
+ var r = Oe(e, "string");
512
+ return "symbol" == ye(r) ? r : r + "";
476
513
  }
477
- function me(e, r) {
478
- if ("object" != ge(e) || !e) return e;
514
+ function Oe(e, r) {
515
+ if ("object" != ye(e) || !e) return e;
479
516
  var t = e[Symbol.toPrimitive];
480
517
  if (void 0 !== t) {
481
518
  var n = t.call(e, r || "default");
482
- if ("object" != ge(n)) return n;
519
+ if ("object" != ye(n)) return n;
483
520
  throw new TypeError("@@toPrimitive must return a primitive value.");
484
521
  }
485
522
  return ("string" === r ? String : Number)(e);
486
523
  }
487
- function ge(e) {
488
- "@babel/helpers - typeof";
489
- return ge = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
490
- return typeof e;
491
- } : function(e) {
492
- return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
493
- }, ge(e);
494
- }
495
- function he(e, r) {
496
- return je(e) || xe(e, r) || we(e, r) || Oe();
524
+ function Se(e, r) {
525
+ return ke(e) || Ce(e, r) || xe(e, r) || we();
497
526
  }
498
- function Oe() {
527
+ function we() {
499
528
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
500
529
  }
501
- function we(e, r) {
530
+ function xe(e, r) {
502
531
  if (e) {
503
- if ("string" == typeof e) return Se(e, r);
532
+ if ("string" == typeof e) return je(e, r);
504
533
  var t = {}.toString.call(e).slice(8, -1);
505
- 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) ? Se(e, r) : void 0;
534
+ 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) ? je(e, r) : void 0;
506
535
  }
507
536
  }
508
- function Se(e, r) {
537
+ function je(e, r) {
509
538
  (null == r || r > e.length) && (r = e.length);
510
539
  for (var t = 0, n = Array(r); t < r; t++) {
511
540
  n[t] = e[t];
512
541
  }
513
542
  return n;
514
543
  }
515
- function xe(e, r) {
544
+ function Ce(e, r) {
516
545
  var t = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
517
546
  if (null != t) {
518
547
  var n, o, i, a, l = [], u = !0, c = !1;
@@ -534,12 +563,12 @@
534
563
  return l;
535
564
  }
536
565
  }
537
- function je(e) {
566
+ function ke(e) {
538
567
  if (Array.isArray(e)) return e;
539
568
  }
540
- function Ce(e, r) {
569
+ function Pe(e, r) {
541
570
  if (null == e) return {};
542
- var t, n, o = ke(e, r);
571
+ var t, n, o = Ee(e, r);
543
572
  if (Object.getOwnPropertySymbols) {
544
573
  var i = Object.getOwnPropertySymbols(e);
545
574
  for (n = 0; n < i.length; n++) {
@@ -548,7 +577,7 @@
548
577
  }
549
578
  return o;
550
579
  }
551
- function ke(e, r) {
580
+ function Ee(e, r) {
552
581
  if (null == e) return {};
553
582
  var t = {};
554
583
  for (var n in e) {
@@ -559,7 +588,7 @@
559
588
  }
560
589
  return t;
561
590
  }
562
- /** @public */ var Pe = {
591
+ /** @public */ var Ie = {
563
592
  children: c().node,
564
593
  closeOnClickAway: c().bool,
565
594
  divider: c().oneOf([ "header", "footer", "both", "none" ]),
@@ -569,20 +598,20 @@
569
598
  open: c().bool,
570
599
  returnFocus: c().oneOfType([ c().func, c().object ]).isRequired
571
600
  };
572
- function Ee(e) {
573
- var r = e.children, o = e.closeOnClickAway, a = e.elementRef, u = e.divider, c = u === void 0 ? "both" : u, s = e.initialFocus, d = s === void 0 ? "first" : s, y = e.onRequestClose, m = e.open, g = m === void 0 ? false : m, h = e.returnFocus, O = e.style, w = Ce(e, [ "children", "closeOnClickAway", "elementRef", "divider", "initialFocus", "onRequestClose", "open", "returnFocus", "style" ]);
601
+ function qe(e) {
602
+ var r = e.children, o = e.closeOnClickAway, a = e.elementRef, u = e.divider, c = u === void 0 ? "both" : u, s = e.initialFocus, d = s === void 0 ? "first" : s, b = e.onRequestClose, m = e.open, g = m === void 0 ? false : m, h = e.returnFocus, O = e.style, S = Pe(e, [ "children", "closeOnClickAway", "elementRef", "divider", "initialFocus", "onRequestClose", "open", "returnFocus", "style" ]);
574
603
  // @docs-props-type ModalPropsBase
575
- var S = (0, t.useRef)(null);
604
+ var w = (0, t.useRef)(null);
576
605
  // this timeout ensures that the Modal is finished rendering before setting the focus
577
606
  var x;
578
607
  var j = (0, t.useRef)(undefined);
579
608
  var C = (0, t.useRef)(null);
580
609
  var k = (0, t.useState)((function() {
581
610
  return {
582
- headerTitleId: (0, b.createDOMID)("titleId"),
583
- headerSubtitleId: (0, b.createDOMID)("subtitleId")
611
+ headerTitleId: (0, v.createDOMID)("titleId"),
612
+ headerSubtitleId: (0, v.createDOMID)("subtitleId")
584
613
  };
585
- })), P = he(k, 1), E = P[0], I = E.headerTitleId, q = E.headerSubtitleId;
614
+ })), P = Se(k, 1), E = P[0], I = E.headerTitleId, q = E.headerSubtitleId;
586
615
  var _ = p()(g);
587
616
  var T = (0, t.useCallback)((function() {
588
617
  return {
@@ -602,22 +631,11 @@
602
631
  var D = (0, t.useCallback)((function(e) {
603
632
  if (g) {
604
633
  j.current = i()((function() {
605
- var e;
606
634
  // not using the takeFocus() util here because it
607
635
  // doesn't work for all values of "initialFocus"
608
636
  // and it has a nested defer() call, which we want to avoid
609
- if (C.current !== d) {
610
- if (d === "first") {
611
- if (S.current) {
612
- /* eslint-disable prefer-destructuring */
613
- /* prefer-desturucting leads to harder-to-read syntax in this case */
614
- e = (0, v.getSortedTabbableElements)(S.current)[0];
615
- /* eslint-enable prefer-destructuring */ }
616
- } else if (d === "container") {
617
- e = S.current;
618
- } else if (ge(d) === "object") {
619
- e = d;
620
- }
637
+ if (C.current !== d) {
638
+ var e = de(d, w.current);
621
639
  // Typescript isn't happy with optional chaining here
622
640
  if (e != null && "focus" in e) {
623
641
  e.focus();
@@ -655,29 +673,29 @@
655
673
  D(_);
656
674
  }), [ D, d, g, x, _ ]);
657
675
  var M = (0, t.useCallback)((function(e) {
658
- S.current = e;
659
- fe(a, e);
660
- }), [ a, S ]);
676
+ w.current = e;
677
+ pe(a, e);
678
+ }), [ a, w ]);
661
679
  var R = function e(r) {
662
- if (S.current !== null) {
663
- (0, v.handleTab)(S.current, r.nativeEvent);
680
+ if (w.current !== null) {
681
+ (0, y.handleTab)(w.current, r.nativeEvent);
664
682
  }
665
683
  };
666
684
  var B = (0, t.useCallback)((function(e) {
667
685
  C.current = null;
668
- y === null || y === void 0 ? void 0 : y(e);
669
- }), [ y ]);
686
+ b === null || b === void 0 ? void 0 : b(e);
687
+ }), [ b ]);
670
688
  var F = (0, t.useMemo)((function() {
671
689
  return {
672
690
  divider: c,
673
- onRequestClose: y,
691
+ onRequestClose: b,
674
692
  subtitleId: q,
675
693
  titleId: I
676
694
  };
677
- }), [ c, y, I, q ]);
695
+ }), [ c, b, I, q ]);
678
696
  var L = l()((function(e) {
679
697
  var r = e.opacity, t = e.modalStyle, n = e.top;
680
- return ve(ve({}, t), {}, {
698
+ return me(me({}, t), {}, {
681
699
  opacity: r,
682
700
  top: n
683
701
  });
@@ -686,7 +704,7 @@
686
704
  var o = e.top, i = e.opacity;
687
705
  var a = t.Children.toArray(r).filter(t.isValidElement);
688
706
 
689
- return n().createElement(se, de({
707
+ return n().createElement(se, ve({
690
708
  ref: M,
691
709
  "data-test": "modal",
692
710
  style: L({
@@ -699,10 +717,10 @@
699
717
  role: "dialog",
700
718
  "aria-labelledby": I,
701
719
  "aria-describedby": q
702
- }, w), n().createElement(N.Provider, {
720
+ }, S), n().createElement(N.Provider, {
703
721
  value: F
704
722
  }, a));
705
- }), [ r, L, M, I, q, w, O, F ]);
723
+ }), [ r, L, M, I, q, S, O, F ]);
706
724
  var X = o ? "interactive" : "visible";
707
725
 
708
726
  return n().createElement(f(), {
@@ -714,11 +732,11 @@
714
732
  scrim: X
715
733
  });
716
734
  }
717
- Ee.propTypes = Pe;
718
- Ee.Header = ue;
719
- Ee.Footer = V;
720
- Ee.Body = D;
721
- /* harmony default export */ const Ie = Ee;
735
+ qe.propTypes = Ie;
736
+ qe.Header = ue;
737
+ qe.Footer = V;
738
+ qe.Body = D;
739
+ /* harmony default export */ const _e = qe;
722
740
  // CONCATENATED MODULE: ./src/Modal/index.ts
723
741
  module.exports = r;
724
742
  /******/})();