@arc-ui/components 12.0.0-beta.21 → 12.0.0-beta.22

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 (159) hide show
  1. package/lib/Alert/Alert.cjs +40 -14
  2. package/lib/Alert/Alert.mjs +41 -15
  3. package/lib/Alert/styles.css +1 -1
  4. package/lib/Align/styles.css +1 -1
  5. package/lib/AppButton/styles.css +1 -1
  6. package/lib/Avatar/styles.css +1 -1
  7. package/lib/AvatarGroup/styles.css +1 -1
  8. package/lib/Badge/styles.css +1 -1
  9. package/lib/Banner/Banner.cjs +1 -1
  10. package/lib/Banner/Banner.mjs +1 -1
  11. package/lib/Box/styles.css +1 -1
  12. package/lib/BrandLogo/styles.css +1 -1
  13. package/lib/Breadcrumbs/styles.css +1 -1
  14. package/lib/Button/styles.css +1 -1
  15. package/lib/ButtonGroup/styles.css +1 -1
  16. package/lib/ButtonV2/styles.css +1 -1
  17. package/lib/Calendar/Calendar.cjs +2 -2
  18. package/lib/Calendar/Calendar.mjs +2 -2
  19. package/lib/Calendar/styles.css +1 -1
  20. package/lib/CardFooter/styles.css +1 -1
  21. package/lib/CardHeading/styles.css +1 -1
  22. package/lib/Carousel/Carousel.cjs +1 -1
  23. package/lib/Carousel/Carousel.mjs +1 -1
  24. package/lib/Carousel/styles.css +1 -1
  25. package/lib/Checkbox/styles.css +1 -1
  26. package/lib/Columns/styles.css +1 -1
  27. package/lib/ComboBox/styles.css +1 -1
  28. package/lib/ContentSwitcher/ContentSwitcher.cjs +1 -1
  29. package/lib/ContentSwitcher/ContentSwitcher.mjs +1 -1
  30. package/lib/ContentSwitcher/styles.css +1 -1
  31. package/lib/ContentSwitcherDropdown/styles.css +1 -1
  32. package/lib/DatePicker/DatePicker.cjs +3 -3
  33. package/lib/DatePicker/DatePicker.mjs +4 -4
  34. package/lib/DatePicker/styles.css +1 -1
  35. package/lib/Disclosure/styles.css +1 -1
  36. package/lib/DisclosureMini/styles.css +1 -1
  37. package/lib/Download/styles.css +1 -1
  38. package/lib/Drawer/Drawer.cjs +58 -10
  39. package/lib/Drawer/Drawer.mjs +55 -7
  40. package/lib/Drawer/styles.css +1 -1
  41. package/lib/Elevation/styles.css +1 -1
  42. package/lib/Filter/styles.css +1 -1
  43. package/lib/FormControl/styles.css +1 -1
  44. package/lib/GhostedHeroBanner/styles.css +1 -1
  45. package/lib/GradientPageBackground/GradientPageBackground.cjs +1 -1
  46. package/lib/GradientPageBackground/GradientPageBackground.mjs +1 -1
  47. package/lib/GradientPageBackground/styles.css +1 -1
  48. package/lib/Grid/styles.css +1 -1
  49. package/lib/Group/styles.css +1 -1
  50. package/lib/Heading/styles.css +1 -1
  51. package/lib/HeroBanner/HeroBanner.cjs +1 -1
  52. package/lib/HeroBanner/HeroBanner.mjs +1 -1
  53. package/lib/HeroBanner/styles.css +1 -1
  54. package/lib/HeroButton/styles.css +1 -1
  55. package/lib/Hidden/styles.css +1 -1
  56. package/lib/HorizontalCard/styles.css +1 -1
  57. package/lib/Icon/styles.css +1 -1
  58. package/lib/Image/styles.css +1 -1
  59. package/lib/ImpactCard/styles.css +1 -1
  60. package/lib/InformationCard/InformationCard.cjs +2 -2
  61. package/lib/InformationCard/InformationCard.mjs +2 -2
  62. package/lib/InformationCard/styles.css +1 -1
  63. package/lib/Link/Link.cjs +8 -51
  64. package/lib/Link/Link.mjs +7 -54
  65. package/lib/Link/styles.css +1 -1
  66. package/lib/Markup/styles.css +1 -1
  67. package/lib/MediaCard/styles.css +1 -1
  68. package/lib/Menu/Menu.cjs +1 -1
  69. package/lib/Menu/Menu.mjs +1 -1
  70. package/lib/Menu/styles.css +1 -1
  71. package/lib/Modal/styles.css +1 -1
  72. package/lib/NavigationHeader/NavigationHeader.cjs +116 -51
  73. package/lib/NavigationHeader/NavigationHeader.mjs +112 -47
  74. package/lib/NavigationHeader/styles.css +1 -1
  75. package/lib/Pagination/styles.css +1 -1
  76. package/lib/PaginationSimple/styles.css +1 -1
  77. package/lib/Popover/styles.css +1 -1
  78. package/lib/Poster/styles.css +1 -1
  79. package/lib/ProgressBar/styles.css +1 -1
  80. package/lib/ProgressStepper/styles.css +1 -1
  81. package/lib/ProgressStepperOverflow/styles.css +1 -1
  82. package/lib/RadioCardGroup/styles.css +1 -1
  83. package/lib/RadioGroup/styles.css +1 -1
  84. package/lib/Rule/styles.css +1 -1
  85. package/lib/ScrollToTop/styles.css +1 -1
  86. package/lib/Section/styles.css +1 -1
  87. package/lib/Select/styles.css +1 -1
  88. package/lib/SiteFooter/SiteFooter.cjs +1 -1
  89. package/lib/SiteFooter/SiteFooter.mjs +1 -1
  90. package/lib/SiteFooter/styles.css +1 -1
  91. package/lib/SiteFooterV2/SiteFooterV2.cjs +1 -1
  92. package/lib/SiteFooterV2/SiteFooterV2.mjs +1 -1
  93. package/lib/SiteFooterV2/styles.css +1 -1
  94. package/lib/SiteHeaderV2/SiteHeaderV2.cjs +2 -2
  95. package/lib/SiteHeaderV2/SiteHeaderV2.mjs +3 -3
  96. package/lib/SiteHeaderV2/styles.css +1 -1
  97. package/lib/Skeleton/styles.css +1 -1
  98. package/lib/SkipLink/styles.css +1 -1
  99. package/lib/Spinner/styles.css +1 -1
  100. package/lib/Surface/styles.css +1 -1
  101. package/lib/Switch/styles.css +1 -1
  102. package/lib/TabbedBanner/TabbedBanner.cjs +22 -34
  103. package/lib/TabbedBanner/TabbedBanner.mjs +24 -36
  104. package/lib/TabbedBanner/styles.css +1 -1
  105. package/lib/Tabs/Tabs.cjs +2 -2
  106. package/lib/Tabs/Tabs.mjs +2 -2
  107. package/lib/Tabs/styles.css +1 -1
  108. package/lib/Tag/styles.css +1 -1
  109. package/lib/TemplateBanner/TemplateBanner.cjs +1 -1
  110. package/lib/TemplateBanner/TemplateBanner.mjs +1 -1
  111. package/lib/TemplateBanner/styles.css +1 -1
  112. package/lib/Text/styles.css +1 -1
  113. package/lib/TextArea/TextArea.cjs +6 -6
  114. package/lib/TextArea/TextArea.mjs +6 -6
  115. package/lib/TextArea/styles.css +1 -1
  116. package/lib/TextInput/styles.css +1 -1
  117. package/lib/Theme/Theme.cjs +1 -1
  118. package/lib/Theme/Theme.mjs +1 -1
  119. package/lib/Theme/styles.css +1 -1
  120. package/lib/ThemeIcon/styles.css +1 -1
  121. package/lib/ThumbnailSignpost/styles.css +1 -1
  122. package/lib/Toast/styles.css +1 -1
  123. package/lib/Tooltip/styles.css +1 -1
  124. package/lib/Truncate/styles.css +1 -1
  125. package/lib/TypographyCard/styles.css +1 -1
  126. package/lib/UniversalHeader/styles.css +1 -1
  127. package/lib/VerticalSpace/styles.css +1 -1
  128. package/lib/VideoPlayer/styles.css +1 -1
  129. package/lib/Visible/styles.css +1 -1
  130. package/lib/VisuallyHidden/styles.css +1 -1
  131. package/lib/_shared/cjs/{Calendar-BcNtpbeY.cjs → Calendar-B-va25n2.cjs} +1 -1
  132. package/lib/_shared/cjs/{ContentSwitcherList-NJN4H2Z-.cjs → ContentSwitcherList-bCEzIPN2.cjs} +2 -2
  133. package/lib/_shared/cjs/{DatePicker-Bdw9VFZ4.cjs → DatePicker-Dt4faA_N.cjs} +1 -1
  134. package/lib/_shared/cjs/Link-7xUgVf1I.cjs +48 -0
  135. package/lib/_shared/cjs/{SiteHeaderV2NavItemWithSubNav-Cd0f-Yof.cjs → SiteHeaderV2NavItemWithSubNav-CagFKPEa.cjs} +1 -1
  136. package/lib/_shared/cjs/{TemplateBanner-D2y2XmR2.cjs → TemplateBanner-CImrJ9ON.cjs} +13 -2
  137. package/lib/_shared/cjs/{arc-breakpoints--lzoExiR.cjs → arc-breakpoints-DWUgmeLA.cjs} +1 -1
  138. package/lib/_shared/cjs/{index.es-Th2hutNO.cjs → index.es-DlNskPlN.cjs} +1 -1
  139. package/lib/_shared/cjs/{kebabCase-CThj4IzG.cjs → kebabCase-D5yA6u-V.cjs} +8 -0
  140. package/lib/_shared/esm/{Calendar-ugZV8KxD.mjs → Calendar-Bd2_eT1Y.mjs} +1 -1
  141. package/lib/_shared/esm/{ContentSwitcherList-BN2jzXel.mjs → ContentSwitcherList-bCQz0qkU.mjs} +2 -2
  142. package/lib/_shared/esm/{DatePicker-CCctia-s.mjs → DatePicker-DT4OEzxP.mjs} +1 -1
  143. package/lib/_shared/esm/Link-Biyg9qBH.mjs +46 -0
  144. package/lib/_shared/esm/{SiteHeaderV2NavItemWithSubNav-XbvJNiSo.mjs → SiteHeaderV2NavItemWithSubNav-CxGwdV6u.mjs} +1 -1
  145. package/lib/_shared/esm/{TemplateBanner-C_mDNU5j.mjs → TemplateBanner-DeHjliNP.mjs} +13 -2
  146. package/lib/_shared/esm/{arc-breakpoints-DnWZ2-TX.mjs → arc-breakpoints-D5hR5m3t.mjs} +1 -1
  147. package/lib/_shared/esm/{index.es-Bo660IGW.mjs → index.es-C3WqfFKH.mjs} +2 -2
  148. package/lib/_shared/esm/{kebabCase-CHRdSZ4y.mjs → kebabCase-CCEMRBfd.mjs} +8 -1
  149. package/lib/index.cjs +568 -483
  150. package/lib/index.cjs.map +1 -1
  151. package/lib/index.d.cts +198 -128
  152. package/lib/index.d.mts +198 -128
  153. package/lib/index.js.map +1 -1
  154. package/lib/index.mjs +569 -484
  155. package/lib/index.mjs.map +1 -1
  156. package/lib/styles.css +12 -8
  157. package/package.json +8 -8
  158. package/lib/_shared/cjs/DrawerContent-DifTc6g9.cjs +0 -62
  159. package/lib/_shared/esm/DrawerContent-D6bAU8EQ.mjs +0 -58
package/lib/index.cjs CHANGED
@@ -356,6 +356,17 @@ var AlignItem = function (_a) {
356
356
  return React.createElement("div", { className: "arc-Align-item" }, children);
357
357
  };
358
358
 
359
+ /**
360
+ * Do not edit directly
361
+ * Generated on Fri, 15 Aug 2025 18:14:58 GMT
362
+ */
363
+ var ArcSizeBreakpointsXs = "320px";
364
+ var ArcSizeBreakpointsS = "636px";
365
+ var ArcSizeBreakpointsM = "768px";
366
+ var ArcSizeBreakpointsL = "1024px";
367
+ var ArcSizeBreakpointsXl = "1280px";
368
+ var ArcSizeBreakpointsXxl = "1440px";
369
+
359
370
  var defaultContext$3 = { surface: "light" };
360
371
  var Context$3 = React.createContext(defaultContext$3);
361
372
  var Provider$5 = Context$3.Provider;
@@ -400,6 +411,26 @@ var backgroundsShared = [
400
411
  var backgrounds = __spreadArray([], backgroundsShared, true);
401
412
  var backgroundsBT = __spreadArray([], backgroundsShared, true);
402
413
 
414
+ /**
415
+ * Use `Text` to display text.
416
+ */
417
+ var Text = function (_a) {
418
+ var _b;
419
+ var _c = _a.align, align = _c === void 0 ? "left" : _c, children = _a.children, id = _a.id, _d = _a.isInline, isInline = _d === void 0 ? false : _d, _e = _a.isMeasured, isMeasured = _e === void 0 ? false : _e, _f = _a.size, size = _f === void 0 ? "m" : _f, _g = _a.tone, tone = _g === void 0 ? "default" : _g, _h = _a.elementType, elementType = _h === void 0 ? "span" : _h, props = __rest(_a, ["align", "children", "id", "isInline", "isMeasured", "size", "tone", "elementType"]);
420
+ var surface = React.useContext(Context$3).surface;
421
+ var Element = elementType;
422
+ return (React.createElement(Element, __assign({ id: id, className: classNames((_b = {
423
+ "arc-Text": true
424
+ },
425
+ _b[suffixModifier("arc-Text--align", align)] = align !== "left",
426
+ _b["arc-Text--inline"] = isInline,
427
+ _b["arc-Text--measured"] = isMeasured,
428
+ _b["arc-Text--size".concat(size && size.toUpperCase())] = size && size !== "m",
429
+ _b["arc-Text--".concat(tone)] = tone !== "default",
430
+ _b["arc-Text--onDarkSurface"] = surface === "dark",
431
+ _b)) }, filterAttrs(props)), children));
432
+ };
433
+
403
434
  /**
404
435
  * Use `Icon` to display brand iconography.
405
436
  */
@@ -443,11 +474,256 @@ var ThemeIcon = function (_a) {
443
474
  _b)) }, filterAttrs(props))));
444
475
  };
445
476
 
477
+ /**
478
+ * Use `VisuallyHidden` to provide text for screen readers that is visually hidden on screen.
479
+ */
480
+ var VisuallyHidden$2 = function (_a) {
481
+ var children = _a.children, props = __rest(_a, ["children"]);
482
+ return (React.createElement("span", __assign({ "data-testid": "visually-hidden", className: "arc-VisuallyHidden" }, filterAttrs(props)), children));
483
+ };
484
+
485
+ /**
486
+ * Use `Link` to direct users to a new page or piece of information.
487
+ */
488
+ var Link = function (_a) {
489
+ var id = _a.id, href = _a.href, title = _a.title, rel = _a.rel, target = _a.target, children = _a.children, onClick = _a.onClick, screenReaderText = _a.screenReaderText, _b = _a.isButton, isButton = _b === void 0 ? false : _b, _c = _a.isImplied, isImplied = _c === void 0 ? false : _c, _d = _a.size, size = _d === void 0 ? "m" : _d, props = __rest(_a, ["id", "href", "title", "rel", "target", "children", "onClick", "screenReaderText", "isButton", "isImplied", "size"]);
490
+ var surface = React.useContext(Context$3).surface;
491
+ var isExternalLink = target === "_blank";
492
+ var textArray = children.split(" ");
493
+ var firstText = textArray.slice(0, -1).join(" ");
494
+ var lastWord = textArray[textArray.length - 1];
495
+ var commonProps = {
496
+ id: id,
497
+ onClick: onClick,
498
+ className: classNames("arc-Link", "arc-Link--".concat(size), {
499
+ "arc-Link--onDarkSurface": surface === "dark",
500
+ "arc-Link--onLightSurface": surface !== "dark",
501
+ "arc-Link--isImplied": isImplied,
502
+ }),
503
+ };
504
+ var elementProps = {
505
+ a: __assign(__assign({}, commonProps), { href: href, title: title, target: target, rel: rel }),
506
+ button: __assign({}, commonProps),
507
+ span: __assign({}, commonProps),
508
+ };
509
+ var LinkElement = isButton ? "button" : href ? "a" : "span";
510
+ return (React.createElement(LinkElement, __assign({}, elementProps[LinkElement], filterAttrs(props)),
511
+ React.createElement("div", { className: "arc-Link-wrapper" },
512
+ React.createElement(VisuallyHidden$2, null,
513
+ screenReaderText || children,
514
+ isExternalLink && " (Opens in new window)"),
515
+ firstText && (React.createElement("span", { "aria-hidden": true, className: "arc-Link-text" },
516
+ firstText,
517
+ "\u00A0")),
518
+ React.createElement("span", { className: "arc-Link-iconWrapper" },
519
+ React.createElement("span", { "aria-hidden": true, className: "arc-Link-text" }, lastWord),
520
+ isExternalLink && (React.createElement(ThemeIcon, { icon: "linkExternal", size: size === "s" ? 20 : 24 }))))));
521
+ };
522
+
523
+ /**
524
+ * Use `Heading` to display heading text.
525
+ */
526
+ var Heading = function (_a) {
527
+ var _b;
528
+ var _c = _a.align, align = _c === void 0 ? "left" : _c, _d = _a.casing, casing = _d === void 0 ? "auto" : _d, _e = _a.color, color = _e === void 0 ? "auto" : _e, children = _a.children, level = _a.level, isInline = _a.isInline, _f = _a.fontStyle, fontStyle = _f === void 0 ? "default" : _f, _g = _a.isResponsive, isResponsive = _g === void 0 ? true : _g, size = _a.size, id = _a.id, props = __rest(_a, ["align", "casing", "color", "children", "level", "isInline", "fontStyle", "isResponsive", "size", "id"]);
529
+ var surface = React.useContext(Context$3).surface;
530
+ var Element = "span";
531
+ if (level) {
532
+ Element = "h".concat(level);
533
+ }
534
+ return (React.createElement(Element, __assign({ id: id, className: classNames(" arc-Heading arc-Heading--".concat(camelcase(fontStyle)), (_b = {
535
+ "arc-Heading--inline": isInline,
536
+ "arc-Heading--fixedSize": isResponsive === false
537
+ },
538
+ _b[suffixModifier("arc-Heading--align", align)] = align && align !== "left",
539
+ _b["arc-Heading--size".concat(size && size.toUpperCase())] = size,
540
+ _b["arc-Heading--casingNone"] = casing === "none",
541
+ _b["arc-Heading--colorBrand"] = color === "brand",
542
+ _b["arc-Heading--onDarkSurface"] = surface === "dark",
543
+ _b["arc-Heading--isInline"] = isInline,
544
+ _b)) }, filterAttrs(props)), children));
545
+ };
546
+
547
+ /**
548
+ * Optionally define ariaDescribedBy if errorMessage or helper exist.
549
+ */
550
+ var useAriaDescribedby = function (_a) {
551
+ var id = _a.id, _b = _a.idError, idError = _b === void 0 ? "".concat(id, "-error") : _b, _c = _a.idHelper, idHelper = _c === void 0 ? "".concat(id, "-helper") : _c, _d = _a.idDisclosure, idDisclosure = _d === void 0 ? "".concat(id, "-disclosure") : _d, errorMessage = _a.errorMessage, helper = _a.helper, disclosureText = _a.disclosureText;
552
+ if (!id) {
553
+ return {
554
+ ariaDescribedby: undefined,
555
+ idHelper: undefined,
556
+ idError: undefined,
557
+ idDisclosure: undefined,
558
+ };
559
+ }
560
+ var ariaDescribedbyArr = [];
561
+ if (errorMessage) {
562
+ ariaDescribedbyArr.push(idError);
563
+ }
564
+ if (helper) {
565
+ ariaDescribedbyArr.push(idHelper);
566
+ }
567
+ if (disclosureText) {
568
+ ariaDescribedbyArr.push(idDisclosure);
569
+ }
570
+ var ariaDescribedby = ariaDescribedbyArr.length > 0 ? ariaDescribedbyArr.join(" ") : undefined;
571
+ return { ariaDescribedby: ariaDescribedby, idError: idError, idHelper: idHelper, idDisclosure: idDisclosure };
572
+ };
573
+
574
+ /**
575
+ * Detect interaction mode
576
+ */
577
+ var useInteractionMode = function () {
578
+ var _a = React.useState("pointer"), interactionMode = _a[0], setInteractionMode = _a[1];
579
+ React.useEffect(function () {
580
+ var onKeyDown = function (event) {
581
+ if (event.altKey || event.ctrlKey || event.metaKey) {
582
+ return;
583
+ }
584
+ setInteractionMode("keyboard");
585
+ };
586
+ var onPointerDown = function () {
587
+ setInteractionMode("pointer");
588
+ };
589
+ if (typeof window !== "undefined") {
590
+ document.addEventListener("keydown", onKeyDown, true);
591
+ document.addEventListener("click", onPointerDown, true);
592
+ }
593
+ return function () {
594
+ if (typeof window !== "undefined") {
595
+ document.removeEventListener("keydown", onKeyDown);
596
+ document.removeEventListener("click", onPointerDown);
597
+ }
598
+ };
599
+ }, []);
600
+ return { interactionMode: interactionMode };
601
+ };
602
+
603
+ /**
604
+ * Infer the correct inputMode, pattern and type if specifying a `number` type.
605
+ */
606
+ var useNumericInput = function (props) {
607
+ var type = props.type === "number" ? "text" : props.type;
608
+ var inputMode = props.inputMode;
609
+ if (!props.inputMode) {
610
+ if (props.type === "email") {
611
+ inputMode = "email";
612
+ }
613
+ else if (props.type === "number") {
614
+ inputMode = "numeric";
615
+ }
616
+ else if (props.type === "tel") {
617
+ inputMode = "tel";
618
+ }
619
+ else if (props.type === "url") {
620
+ inputMode = "url";
621
+ }
622
+ }
623
+ var pattern = props.pattern;
624
+ if (!props.pattern && props.type === "number") {
625
+ pattern = "[0-9]*";
626
+ }
627
+ return { inputMode: inputMode, pattern: pattern, type: type };
628
+ };
629
+
630
+ var usePagination = function (pageCount, selectedPage) {
631
+ var formatValues = function (range) {
632
+ return range.map(function (value) { return value.toString(); });
633
+ };
634
+ return React.useMemo(function () {
635
+ if (pageCount > 7 && selectedPage < 5) {
636
+ // show 1 - 5 the right dots are visible.
637
+ return formatValues(__spreadArray(__spreadArray([], Array.from({ length: 5 }, function (_value, index) { return index + 1; }), true), [
638
+ "...",
639
+ pageCount,
640
+ ], false));
641
+ }
642
+ if (pageCount > 7 && selectedPage >= pageCount - 3) {
643
+ // show numbers to the end but the left dots are visible
644
+ return formatValues(__spreadArray([
645
+ 1,
646
+ "..."
647
+ ], Array.from({ length: 5 }, function (_value, index) { return pageCount - index; }).reverse(), true));
648
+ }
649
+ if (pageCount > 7 && selectedPage >= 5 && selectedPage < pageCount - 3) {
650
+ // show selected page with one number either side and both the left and the right dots are visible.
651
+ return formatValues([
652
+ 1,
653
+ "...",
654
+ selectedPage - 1,
655
+ selectedPage,
656
+ selectedPage + 1,
657
+ "...",
658
+ pageCount,
659
+ ]);
660
+ }
661
+ // show all pages from pageCount
662
+ return formatValues(Array.from({ length: pageCount }, function (_value, index) { return index + 1; }));
663
+ }, [pageCount, selectedPage]);
664
+ };
665
+
666
+ var useThemeElement = function () {
667
+ var _a = React.useState(undefined), themeElement = _a[0], setElement = _a[1];
668
+ var setThemeElement = function (el) {
669
+ el &&
670
+ setElement(el.closest(".arc-ds-sys-theme") || undefined);
671
+ };
672
+ return [themeElement, setThemeElement];
673
+ };
674
+
675
+ var useUniqueString = function (value) {
676
+ var id = React.useId();
677
+ return "".concat(value, "-").concat(id);
678
+ };
679
+
680
+ /**
681
+ * @typedef MediaQueryOutputs
682
+ * @param {boolean} matches - does the document match the media query?
683
+ */
684
+ /**
685
+ * Handle with care!
686
+ *
687
+ * If you need to change something in the browser based on @media query, you
688
+ * probably don’t need this hook. Use CSS media queries instead.
689
+ *
690
+ * Sometimes UI requirements are not achievable with CSS media queries alone. In
691
+ * these rare cases, use this hook to make media query matches available
692
+ * to React JavaScript code.
693
+ *
694
+ * @param {string} mediaQuery - the media query to parse
695
+ * @returns {MediaQueryOutputs}
696
+ */
697
+ var useMediaQuery = function (mediaQuery) {
698
+ var mediaQueryList = typeof window !== "undefined" ? window.matchMedia(mediaQuery) : undefined;
699
+ var _a = React.useState(false), matches = _a[0], setMatches = _a[1];
700
+ React.useEffect(function () {
701
+ setMatches(typeof window !== "undefined"
702
+ ? window.matchMedia(mediaQuery).matches
703
+ : false);
704
+ }, [mediaQuery]);
705
+ React.useEffect(function () {
706
+ var onMatchMedia = function (event) { return setMatches(event.matches); };
707
+ // Using deprecated addListener methods here for IE & Safari 13 support
708
+ if (mediaQueryList) {
709
+ mediaQueryList.addListener(onMatchMedia);
710
+ }
711
+ return function () { return mediaQueryList && mediaQueryList.removeListener(onMatchMedia); };
712
+ }, [mediaQueryList]);
713
+ return matches;
714
+ };
715
+
446
716
  /** Use `Alert` to inform the user of important changes or actions. */
447
717
  var Alert = function (_a) {
448
- var _b;
449
- var heading = _a.heading, description = _a.description, link = _a.link, linkText = _a.linkText, linkAriaLabel = _a.linkAriaLabel, _c = _a.status, status = _c === void 0 ? "general" : _c, isDismissable = _a.isDismissable, onDismiss = _a.onDismiss, onLinkClick = _a.onLinkClick, icon = _a.icon, props = __rest(_a, ["heading", "description", "link", "linkText", "linkAriaLabel", "status", "isDismissable", "onDismiss", "onLinkClick", "icon"]);
450
- var _d = React.useState(false), isDismissed = _d[0], setIsDismissed = _d[1];
718
+ var _b, _c;
719
+ var heading = _a.heading, headingLevel = _a.headingLevel, description = _a.description, links = _a.links, _d = _a.status, status = _d === void 0 ? "general" : _d, isDismissable = _a.isDismissable, onDismiss = _a.onDismiss, icon = _a.icon, _e = _a.isMeasured, isMeasured = _e === void 0 ? false : _e, _f = _a.autoFocusOnMount, autoFocusOnMount = _f === void 0 ? false : _f, props = __rest(_a, ["heading", "headingLevel", "description", "links", "status", "isDismissable", "onDismiss", "icon", "isMeasured", "autoFocusOnMount"]);
720
+ var _g = React.useState(false), isDismissed = _g[0], setIsDismissed = _g[1];
721
+ var alertRef = React.useRef(null);
722
+ React.useEffect(function () {
723
+ var _a;
724
+ autoFocusOnMount && ((_a = alertRef.current) === null || _a === void 0 ? void 0 : _a.focus());
725
+ }, [autoFocusOnMount]);
726
+ var isMinWidthArcBreakpointM = useMediaQuery("(min-width: ".concat(ArcSizeBreakpointsM, ")"));
451
727
  var onDismissHandler = function () {
452
728
  setIsDismissed(true);
453
729
  onDismiss && onDismiss();
@@ -458,32 +734,38 @@ var Alert = function (_a) {
458
734
  warning: "alertWarning",
459
735
  success: "alertSuccess",
460
736
  };
461
- var handleLinkClick = function (event) {
462
- event.preventDefault();
463
- onLinkClick && onLinkClick();
464
- };
465
737
  if (isDismissed) {
466
738
  return null;
467
739
  }
468
740
  return (React.createElement("div", __assign({ className: classNames("arc-Alert", (_b = {},
469
741
  _b["arc-Alert--".concat(status)] = status !== "general",
470
- _b)), role: "alert" }, (status === "warning" && { "aria-live": "assertive" }), filterAttrs(props)),
742
+ _b)), role: "alert", tabIndex: -1, "aria-labelledby": "alertHeading", "aria-describedby": "alertDescription", ref: alertRef }, filterAttrs(props)),
471
743
  React.createElement("div", { className: "arc-Alert-icon" }, icon ? (React.createElement(Icon$1, { size: 24, icon: icon })) : (React.createElement(ThemeIcon, { size: 24, icon: statusIcons[status] }))),
472
744
  React.createElement("div", { className: "arc-Alert-content" },
473
- React.createElement("div", { className: "arc-Alert-heading" }, heading),
474
- description ? (React.isValidElement(description) ? (description) : (React.createElement("div", { className: "arc-Alert-description" }, description))) : null,
475
- link && (React.createElement("a", __assign({ className: "arc-Alert-link", href: link, "aria-label": linkAriaLabel }, (onLinkClick && { onClick: handleLinkClick })), linkText))),
476
- isDismissable && (React.createElement(React.Fragment, null,
477
- React.createElement("button", { "aria-label": "dismiss alert", className: "arc-Alert-dismiss", onClick: onDismissHandler },
478
- React.createElement(ThemeIcon, { size: 24, icon: "alertDismiss" }))))));
479
- };
480
-
481
- /**
482
- * Use `VisuallyHidden` to provide text for screen readers that is visually hidden on screen.
483
- */
484
- var VisuallyHidden$2 = function (_a) {
485
- var children = _a.children, props = __rest(_a, ["children"]);
486
- return (React.createElement("span", __assign({ "data-testid": "visually-hidden", className: "arc-VisuallyHidden" }, filterAttrs(props)), children));
745
+ React.createElement("div", { className: classNames("arc-Alert-heading", (_c = {},
746
+ _c["arc-Alert-heading--isDismissable"] = isDismissable,
747
+ _c)) },
748
+ React.createElement(Heading, { level: headingLevel, id: "alertHeading", size: isMinWidthArcBreakpointM ? "s" : "xs" },
749
+ React.createElement(VisuallyHidden$2, null,
750
+ status,
751
+ " alert."),
752
+ heading)),
753
+ description ? (React.isValidElement(description) ? (React.createElement("div", { className: "arc-Alert-description", id: "alertDescription" }, description)) : (React.createElement("div", { className: "arc-Alert-description" },
754
+ React.createElement(Text, { isMeasured: isMeasured, size: "s", id: "alertDescription" }, description)))) : null,
755
+ React.createElement("div", { className: "arc-Alert-links" },
756
+ React.createElement("ul", null, links === null || links === void 0 ? void 0 : links.map(function (link, index) {
757
+ var _a;
758
+ return (React.createElement("li", { key: index },
759
+ React.createElement(Link, __assign({ href: link.href, "aria-label": link.screenReaderText, target: link.target, size: "s" }, (link.onClick && {
760
+ onClick: function (e) {
761
+ e.preventDefault();
762
+ link.onClick && link.onClick(e);
763
+ },
764
+ isButton: true,
765
+ })), (_a = link.children) !== null && _a !== void 0 ? _a : "")));
766
+ })))),
767
+ isDismissable && (React.createElement("button", { "aria-label": "dismiss alert", className: "arc-Alert-dismiss", onClick: onDismissHandler, tabIndex: 0 },
768
+ React.createElement(ThemeIcon, { size: 24, icon: "alertDismiss" })))));
487
769
  };
488
770
 
489
771
  var GooglePlayIcon = function () { return (React.createElement("svg", { "aria-hidden": true, role: "presentation", xmlns: "http://www.w3.org/2000/svg", id: "artwork", version: "1.1", height: "48", width: "162", viewBox: "0 0 135 40" },
@@ -577,41 +859,17 @@ var Image = function (_a) {
577
859
  _b["arc-Image--anchor".concat(anchor)] = fit === "cover",
578
860
  _b[suffixModifier("arc-Image--overlay", overlay || "")] = overlay,
579
861
  _b)), style: __assign(__assign(__assign({}, (fillColor && { backgroundColor: fillColor })), (fit === "cover" && height ? { height: "".concat(height, "px") } : null)), (fit === "cover" && width ? { width: "".concat(width, "px") } : null)) }, filterAttrs(props)), children ? (React.createElement("picture", null,
580
- children,
581
- " ",
582
- img)) : (React.createElement(React.Fragment, null, img))));
583
- };
584
- var ImageSource = function (_a) {
585
- var height = _a.height, media = _a.media, srcSet = _a.srcSet, sizes = _a.sizes, type = _a.type, props = __rest(_a, ["height", "media", "srcSet", "sizes", "type"]);
586
- return (React.createElement("source", __assign({ height: height, media: media, sizes: sizes, srcSet: srcSet, type: type }, filterAttrs(props))));
587
- };
588
- var fitOptions = ["cover"];
589
- var loadingOptions = ["eager", "lazy"];
590
- var overlayOptions = ["scrimBottomDark"];
591
-
592
- /**
593
- * Use `Heading` to display heading text.
594
- */
595
- var Heading = function (_a) {
596
- var _b;
597
- var _c = _a.align, align = _c === void 0 ? "left" : _c, _d = _a.casing, casing = _d === void 0 ? "auto" : _d, _e = _a.color, color = _e === void 0 ? "auto" : _e, children = _a.children, level = _a.level, isInline = _a.isInline, _f = _a.fontStyle, fontStyle = _f === void 0 ? "default" : _f, _g = _a.isResponsive, isResponsive = _g === void 0 ? true : _g, size = _a.size, id = _a.id, props = __rest(_a, ["align", "casing", "color", "children", "level", "isInline", "fontStyle", "isResponsive", "size", "id"]);
598
- var surface = React.useContext(Context$3).surface;
599
- var Element = "span";
600
- if (level) {
601
- Element = "h".concat(level);
602
- }
603
- return (React.createElement(Element, __assign({ id: id, className: classNames(" arc-Heading arc-Heading--".concat(camelcase(fontStyle)), (_b = {
604
- "arc-Heading--inline": isInline,
605
- "arc-Heading--fixedSize": isResponsive === false
606
- },
607
- _b[suffixModifier("arc-Heading--align", align)] = align && align !== "left",
608
- _b["arc-Heading--size".concat(size && size.toUpperCase())] = size,
609
- _b["arc-Heading--casingNone"] = casing === "none",
610
- _b["arc-Heading--colorBrand"] = color === "brand",
611
- _b["arc-Heading--onDarkSurface"] = surface === "dark",
612
- _b["arc-Heading--isInline"] = isInline,
613
- _b)) }, filterAttrs(props)), children));
862
+ children,
863
+ " ",
864
+ img)) : (React.createElement(React.Fragment, null, img))));
865
+ };
866
+ var ImageSource = function (_a) {
867
+ var height = _a.height, media = _a.media, srcSet = _a.srcSet, sizes = _a.sizes, type = _a.type, props = __rest(_a, ["height", "media", "srcSet", "sizes", "type"]);
868
+ return (React.createElement("source", __assign({ height: height, media: media, sizes: sizes, srcSet: srcSet, type: type }, filterAttrs(props))));
614
869
  };
870
+ var fitOptions = ["cover"];
871
+ var loadingOptions = ["eager", "lazy"];
872
+ var overlayOptions = ["scrimBottomDark"];
615
873
 
616
874
  var AvatarContent = function (_a) {
617
875
  var img = _a.img, initials = _a.initials, _b = _a.size, size = _b === void 0 ? "xl" : _b;
@@ -769,7 +1027,7 @@ var BannerRow = function (_a) {
769
1027
  };
770
1028
 
771
1029
  var TemplateBanner = function (_a) {
772
- var heading = _a.heading, label = _a.label, text = _a.text, img = _a.img, _b = _a.contentRatio, contentRatio = _b === void 0 ? "1/1" : _b, children = _a.children, _c = _a.alignment, alignment = _c === void 0 ? "center" : _c, additionalTopMargin = _a.additionalTopMargin, _d = _a.minHeight, minHeight = _d === void 0 ? 454 : _d, _e = _a.headingSize, headingSize = _e === void 0 ? "xl" : _e, _f = _a.isReversed, isReversed = _f === void 0 ? false : _f, _g = _a.isElevated, isElevated = _g === void 0 ? false : _g, _h = _a.headingLevel, headingLevel = _h === void 0 ? "2" : _h, _j = _a.type, type = _j === void 0 ? "light" : _j, props = __rest(_a, ["heading", "label", "text", "img", "contentRatio", "children", "alignment", "additionalTopMargin", "minHeight", "headingSize", "isReversed", "isElevated", "headingLevel", "type"]);
1030
+ var heading = _a.heading, label = _a.label, text = _a.text, img = _a.img, _b = _a.contentRatio, contentRatio = _b === void 0 ? "1/1" : _b, children = _a.children, _c = _a.alignment, alignment = _c === void 0 ? "center" : _c, additionalTopMargin = _a.additionalTopMargin, _d = _a.minHeight, minHeight = _d === void 0 ? 454 : _d, minHeightM = _a.minHeightM, minHeightL = _a.minHeightL, minHeightXL = _a.minHeightXL, _e = _a.headingSize, headingSize = _e === void 0 ? "xl" : _e, _f = _a.isReversed, isReversed = _f === void 0 ? false : _f, _g = _a.isElevated, isElevated = _g === void 0 ? false : _g, _h = _a.headingLevel, headingLevel = _h === void 0 ? "2" : _h, _j = _a.type, type = _j === void 0 ? "light" : _j, props = __rest(_a, ["heading", "label", "text", "img", "contentRatio", "children", "alignment", "additionalTopMargin", "minHeight", "minHeightM", "minHeightL", "minHeightXL", "headingSize", "isReversed", "isElevated", "headingLevel", "type"]);
773
1031
  var backgrounds = {
774
1032
  dark: "dark-brand-02",
775
1033
  light: "light-white",
@@ -787,8 +1045,19 @@ var TemplateBanner = function (_a) {
787
1045
  "2/3": 8,
788
1046
  "1/1": 6,
789
1047
  };
790
- return (React.createElement("div", __assign({ style: { minHeight: minHeight }, className: classNames("arc-TemplateBanner arc-TemplateBanner-background--".concat(type), {
1048
+ var templateBannerStyles = {
1049
+ "--template-banner-min-height": "".concat(minHeight, "px"),
1050
+ "--template-banner-min-height-m": minHeightM ? "".concat(minHeightM, "px") : "auto",
1051
+ "--template-banner-min-height-l": minHeightL ? "".concat(minHeightL, "px") : "auto",
1052
+ "--template-banner-min-height-xl": minHeightXL
1053
+ ? "".concat(minHeightXL, "px")
1054
+ : "auto",
1055
+ };
1056
+ return (React.createElement("div", __assign({ style: templateBannerStyles, className: classNames("arc-TemplateBanner arc-TemplateBanner-background--".concat(type), {
791
1057
  "arc-TemplateBanner--elevation": isElevated,
1058
+ "arc-TemplateBanner--minHeightM": minHeightM,
1059
+ "arc-TemplateBanner--minHeightL": minHeightL,
1060
+ "arc-TemplateBanner--minHeightXL": minHeightXL,
792
1061
  }) }, filterAttrs(props)),
793
1062
  React.createElement(Box, { isBorderRadius: true, "data-testid": "arc-TemplateBanner-box", borderWidth: borderWidth, surface: backgrounds[type], isSurfaceTransparent: !isContained },
794
1063
  React.createElement(Grid, { isGutterless: true, isFluid: true },
@@ -1785,302 +2054,122 @@ function toDate(argument) {
1785
2054
  } else {
1786
2055
  if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
1787
2056
  // eslint-disable-next-line no-console
1788
- console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
1789
- // eslint-disable-next-line no-console
1790
- console.warn(new Error().stack);
1791
- }
1792
- return new Date(NaN);
1793
- }
1794
- }
1795
-
1796
- /**
1797
- * @name addMonths
1798
- * @category Month Helpers
1799
- * @summary Add the specified number of months to the given date.
1800
- *
1801
- * @description
1802
- * Add the specified number of months to the given date.
1803
- *
1804
- * @param {Date|Number} date - the date to be changed
1805
- * @param {Number} amount - the amount of months to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
1806
- * @returns {Date} the new date with the months added
1807
- * @throws {TypeError} 2 arguments required
1808
- *
1809
- * @example
1810
- * // Add 5 months to 1 September 2014:
1811
- * const result = addMonths(new Date(2014, 8, 1), 5)
1812
- * //=> Sun Feb 01 2015 00:00:00
1813
- */
1814
- function addMonths(dirtyDate, dirtyAmount) {
1815
- requiredArgs(2, arguments);
1816
- var date = toDate(dirtyDate);
1817
- var amount = toInteger(dirtyAmount);
1818
- if (isNaN(amount)) {
1819
- return new Date(NaN);
1820
- }
1821
- if (!amount) {
1822
- // If 0 months, no-op to avoid changing times in the hour before end of DST
1823
- return date;
1824
- }
1825
- var dayOfMonth = date.getDate();
1826
-
1827
- // The JS Date object supports date math by accepting out-of-bounds values for
1828
- // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and
1829
- // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we
1830
- // want except that dates will wrap around the end of a month, meaning that
1831
- // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So
1832
- // we'll default to the end of the desired month by adding 1 to the desired
1833
- // month and using a date of 0 to back up one day to the end of the desired
1834
- // month.
1835
- var endOfDesiredMonth = new Date(date.getTime());
1836
- endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0);
1837
- var daysInMonth = endOfDesiredMonth.getDate();
1838
- if (dayOfMonth >= daysInMonth) {
1839
- // If we're already at the end of the month, then this is the correct date
1840
- // and we're done.
1841
- return endOfDesiredMonth;
1842
- } else {
1843
- // Otherwise, we now know that setting the original day-of-month value won't
1844
- // cause an overflow, so set the desired day-of-month. Note that we can't
1845
- // just set the date of `endOfDesiredMonth` because that object may have had
1846
- // its time changed in the unusual case where where a DST transition was on
1847
- // the last day of the month and its local time was in the hour skipped or
1848
- // repeated next to a DST transition. So we use `date` instead which is
1849
- // guaranteed to still have the original time.
1850
- date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);
1851
- return date;
1852
- }
1853
- }
1854
-
1855
- /**
1856
- * @name subMonths
1857
- * @category Month Helpers
1858
- * @summary Subtract the specified number of months from the given date.
1859
- *
1860
- * @description
1861
- * Subtract the specified number of months from the given date.
1862
- *
1863
- * @param {Date|Number} date - the date to be changed
1864
- * @param {Number} amount - the amount of months to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
1865
- * @returns {Date} the new date with the months subtracted
1866
- * @throws {TypeError} 2 arguments required
1867
- *
1868
- * @example
1869
- * // Subtract 5 months from 1 February 2015:
1870
- * const result = subMonths(new Date(2015, 1, 1), 5)
1871
- * //=> Mon Sep 01 2014 00:00:00
1872
- */
1873
- function subMonths(dirtyDate, dirtyAmount) {
1874
- requiredArgs(2, arguments);
1875
- var amount = toInteger(dirtyAmount);
1876
- return addMonths(dirtyDate, -amount);
1877
- }
1878
-
1879
- /**
1880
- * @name startOfMonth
1881
- * @category Month Helpers
1882
- * @summary Return the start of a month for the given date.
1883
- *
1884
- * @description
1885
- * Return the start of a month for the given date.
1886
- * The result will be in the local timezone.
1887
- *
1888
- * @param {Date|Number} date - the original date
1889
- * @returns {Date} the start of a month
1890
- * @throws {TypeError} 1 argument required
1891
- *
1892
- * @example
1893
- * // The start of a month for 2 September 2014 11:55:00:
1894
- * const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))
1895
- * //=> Mon Sep 01 2014 00:00:00
1896
- */
1897
- function startOfMonth(dirtyDate) {
1898
- requiredArgs(1, arguments);
1899
- var date = toDate(dirtyDate);
1900
- date.setDate(1);
1901
- date.setHours(0, 0, 0, 0);
1902
- return date;
1903
- }
1904
-
1905
- /**
1906
- * Do not edit directly
1907
- * Generated on Fri, 25 Jul 2025 07:43:07 GMT
1908
- */
1909
- var ArcSizeBreakpointsXs = "320px";
1910
- var ArcSizeBreakpointsS = "636px";
1911
- var ArcSizeBreakpointsM = "768px";
1912
- var ArcSizeBreakpointsL = "1024px";
1913
- var ArcSizeBreakpointsXl = "1280px";
1914
- var ArcSizeBreakpointsXxl = "1440px";
1915
-
1916
- /**
1917
- * Optionally define ariaDescribedBy if errorMessage or helper exist.
1918
- */
1919
- var useAriaDescribedby = function (_a) {
1920
- var id = _a.id, _b = _a.idError, idError = _b === void 0 ? "".concat(id, "-error") : _b, _c = _a.idHelper, idHelper = _c === void 0 ? "".concat(id, "-helper") : _c, _d = _a.idDisclosure, idDisclosure = _d === void 0 ? "".concat(id, "-disclosure") : _d, errorMessage = _a.errorMessage, helper = _a.helper, disclosureText = _a.disclosureText;
1921
- if (!id) {
1922
- return {
1923
- ariaDescribedby: undefined,
1924
- idHelper: undefined,
1925
- idError: undefined,
1926
- idDisclosure: undefined,
1927
- };
1928
- }
1929
- var ariaDescribedbyArr = [];
1930
- if (errorMessage) {
1931
- ariaDescribedbyArr.push(idError);
1932
- }
1933
- if (helper) {
1934
- ariaDescribedbyArr.push(idHelper);
1935
- }
1936
- if (disclosureText) {
1937
- ariaDescribedbyArr.push(idDisclosure);
1938
- }
1939
- var ariaDescribedby = ariaDescribedbyArr.length > 0 ? ariaDescribedbyArr.join(" ") : undefined;
1940
- return { ariaDescribedby: ariaDescribedby, idError: idError, idHelper: idHelper, idDisclosure: idDisclosure };
1941
- };
1942
-
1943
- /**
1944
- * Detect interaction mode
1945
- */
1946
- var useInteractionMode = function () {
1947
- var _a = React.useState("pointer"), interactionMode = _a[0], setInteractionMode = _a[1];
1948
- React.useEffect(function () {
1949
- var onKeyDown = function (event) {
1950
- if (event.altKey || event.ctrlKey || event.metaKey) {
1951
- return;
1952
- }
1953
- setInteractionMode("keyboard");
1954
- };
1955
- var onPointerDown = function () {
1956
- setInteractionMode("pointer");
1957
- };
1958
- if (typeof window !== "undefined") {
1959
- document.addEventListener("keydown", onKeyDown, true);
1960
- document.addEventListener("click", onPointerDown, true);
1961
- }
1962
- return function () {
1963
- if (typeof window !== "undefined") {
1964
- document.removeEventListener("keydown", onKeyDown);
1965
- document.removeEventListener("click", onPointerDown);
1966
- }
1967
- };
1968
- }, []);
1969
- return { interactionMode: interactionMode };
1970
- };
1971
-
1972
- /**
1973
- * Infer the correct inputMode, pattern and type if specifying a `number` type.
1974
- */
1975
- var useNumericInput = function (props) {
1976
- var type = props.type === "number" ? "text" : props.type;
1977
- var inputMode = props.inputMode;
1978
- if (!props.inputMode) {
1979
- if (props.type === "email") {
1980
- inputMode = "email";
1981
- }
1982
- else if (props.type === "number") {
1983
- inputMode = "numeric";
1984
- }
1985
- else if (props.type === "tel") {
1986
- inputMode = "tel";
1987
- }
1988
- else if (props.type === "url") {
1989
- inputMode = "url";
1990
- }
1991
- }
1992
- var pattern = props.pattern;
1993
- if (!props.pattern && props.type === "number") {
1994
- pattern = "[0-9]*";
1995
- }
1996
- return { inputMode: inputMode, pattern: pattern, type: type };
1997
- };
1998
-
1999
- var usePagination = function (pageCount, selectedPage) {
2000
- var formatValues = function (range) {
2001
- return range.map(function (value) { return value.toString(); });
2002
- };
2003
- return React.useMemo(function () {
2004
- if (pageCount > 7 && selectedPage < 5) {
2005
- // show 1 - 5 the right dots are visible.
2006
- return formatValues(__spreadArray(__spreadArray([], Array.from({ length: 5 }, function (_value, index) { return index + 1; }), true), [
2007
- "...",
2008
- pageCount,
2009
- ], false));
2010
- }
2011
- if (pageCount > 7 && selectedPage >= pageCount - 3) {
2012
- // show numbers to the end but the left dots are visible
2013
- return formatValues(__spreadArray([
2014
- 1,
2015
- "..."
2016
- ], Array.from({ length: 5 }, function (_value, index) { return pageCount - index; }).reverse(), true));
2017
- }
2018
- if (pageCount > 7 && selectedPage >= 5 && selectedPage < pageCount - 3) {
2019
- // show selected page with one number either side and both the left and the right dots are visible.
2020
- return formatValues([
2021
- 1,
2022
- "...",
2023
- selectedPage - 1,
2024
- selectedPage,
2025
- selectedPage + 1,
2026
- "...",
2027
- pageCount,
2028
- ]);
2029
- }
2030
- // show all pages from pageCount
2031
- return formatValues(Array.from({ length: pageCount }, function (_value, index) { return index + 1; }));
2032
- }, [pageCount, selectedPage]);
2033
- };
2057
+ console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
2058
+ // eslint-disable-next-line no-console
2059
+ console.warn(new Error().stack);
2060
+ }
2061
+ return new Date(NaN);
2062
+ }
2063
+ }
2034
2064
 
2035
- var useThemeElement = function () {
2036
- var _a = React.useState(undefined), themeElement = _a[0], setElement = _a[1];
2037
- var setThemeElement = function (el) {
2038
- el &&
2039
- setElement(el.closest(".arc-ds-sys-theme") || undefined);
2040
- };
2041
- return [themeElement, setThemeElement];
2042
- };
2065
+ /**
2066
+ * @name addMonths
2067
+ * @category Month Helpers
2068
+ * @summary Add the specified number of months to the given date.
2069
+ *
2070
+ * @description
2071
+ * Add the specified number of months to the given date.
2072
+ *
2073
+ * @param {Date|Number} date - the date to be changed
2074
+ * @param {Number} amount - the amount of months to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
2075
+ * @returns {Date} the new date with the months added
2076
+ * @throws {TypeError} 2 arguments required
2077
+ *
2078
+ * @example
2079
+ * // Add 5 months to 1 September 2014:
2080
+ * const result = addMonths(new Date(2014, 8, 1), 5)
2081
+ * //=> Sun Feb 01 2015 00:00:00
2082
+ */
2083
+ function addMonths(dirtyDate, dirtyAmount) {
2084
+ requiredArgs(2, arguments);
2085
+ var date = toDate(dirtyDate);
2086
+ var amount = toInteger(dirtyAmount);
2087
+ if (isNaN(amount)) {
2088
+ return new Date(NaN);
2089
+ }
2090
+ if (!amount) {
2091
+ // If 0 months, no-op to avoid changing times in the hour before end of DST
2092
+ return date;
2093
+ }
2094
+ var dayOfMonth = date.getDate();
2043
2095
 
2044
- var useUniqueString = function (value) {
2045
- var id = React.useId();
2046
- return "".concat(value, "-").concat(id);
2047
- };
2096
+ // The JS Date object supports date math by accepting out-of-bounds values for
2097
+ // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and
2098
+ // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we
2099
+ // want except that dates will wrap around the end of a month, meaning that
2100
+ // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So
2101
+ // we'll default to the end of the desired month by adding 1 to the desired
2102
+ // month and using a date of 0 to back up one day to the end of the desired
2103
+ // month.
2104
+ var endOfDesiredMonth = new Date(date.getTime());
2105
+ endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0);
2106
+ var daysInMonth = endOfDesiredMonth.getDate();
2107
+ if (dayOfMonth >= daysInMonth) {
2108
+ // If we're already at the end of the month, then this is the correct date
2109
+ // and we're done.
2110
+ return endOfDesiredMonth;
2111
+ } else {
2112
+ // Otherwise, we now know that setting the original day-of-month value won't
2113
+ // cause an overflow, so set the desired day-of-month. Note that we can't
2114
+ // just set the date of `endOfDesiredMonth` because that object may have had
2115
+ // its time changed in the unusual case where where a DST transition was on
2116
+ // the last day of the month and its local time was in the hour skipped or
2117
+ // repeated next to a DST transition. So we use `date` instead which is
2118
+ // guaranteed to still have the original time.
2119
+ date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);
2120
+ return date;
2121
+ }
2122
+ }
2048
2123
 
2049
2124
  /**
2050
- * @typedef MediaQueryOutputs
2051
- * @param {boolean} matches - does the document match the media query?
2125
+ * @name subMonths
2126
+ * @category Month Helpers
2127
+ * @summary Subtract the specified number of months from the given date.
2128
+ *
2129
+ * @description
2130
+ * Subtract the specified number of months from the given date.
2131
+ *
2132
+ * @param {Date|Number} date - the date to be changed
2133
+ * @param {Number} amount - the amount of months to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
2134
+ * @returns {Date} the new date with the months subtracted
2135
+ * @throws {TypeError} 2 arguments required
2136
+ *
2137
+ * @example
2138
+ * // Subtract 5 months from 1 February 2015:
2139
+ * const result = subMonths(new Date(2015, 1, 1), 5)
2140
+ * //=> Mon Sep 01 2014 00:00:00
2052
2141
  */
2142
+ function subMonths(dirtyDate, dirtyAmount) {
2143
+ requiredArgs(2, arguments);
2144
+ var amount = toInteger(dirtyAmount);
2145
+ return addMonths(dirtyDate, -amount);
2146
+ }
2147
+
2053
2148
  /**
2054
- * Handle with care!
2149
+ * @name startOfMonth
2150
+ * @category Month Helpers
2151
+ * @summary Return the start of a month for the given date.
2055
2152
  *
2056
- * If you need to change something in the browser based on @media query, you
2057
- * probably don’t need this hook. Use CSS media queries instead.
2153
+ * @description
2154
+ * Return the start of a month for the given date.
2155
+ * The result will be in the local timezone.
2058
2156
  *
2059
- * Sometimes UI requirements are not achievable with CSS media queries alone. In
2060
- * these rare cases, use this hook to make media query matches available
2061
- * to React JavaScript code.
2157
+ * @param {Date|Number} date - the original date
2158
+ * @returns {Date} the start of a month
2159
+ * @throws {TypeError} 1 argument required
2062
2160
  *
2063
- * @param {string} mediaQuery - the media query to parse
2064
- * @returns {MediaQueryOutputs}
2161
+ * @example
2162
+ * // The start of a month for 2 September 2014 11:55:00:
2163
+ * const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))
2164
+ * //=> Mon Sep 01 2014 00:00:00
2065
2165
  */
2066
- var useMediaQuery = function (mediaQuery) {
2067
- var mediaQueryList = typeof window !== "undefined" ? window.matchMedia(mediaQuery) : undefined;
2068
- var _a = React.useState(false), matches = _a[0], setMatches = _a[1];
2069
- React.useEffect(function () {
2070
- setMatches(typeof window !== "undefined"
2071
- ? window.matchMedia(mediaQuery).matches
2072
- : false);
2073
- }, [mediaQuery]);
2074
- React.useEffect(function () {
2075
- var onMatchMedia = function (event) { return setMatches(event.matches); };
2076
- // Using deprecated addListener methods here for IE & Safari 13 support
2077
- if (mediaQueryList) {
2078
- mediaQueryList.addListener(onMatchMedia);
2079
- }
2080
- return function () { return mediaQueryList && mediaQueryList.removeListener(onMatchMedia); };
2081
- }, [mediaQueryList]);
2082
- return matches;
2083
- };
2166
+ function startOfMonth(dirtyDate) {
2167
+ requiredArgs(1, arguments);
2168
+ var date = toDate(dirtyDate);
2169
+ date.setDate(1);
2170
+ date.setHours(0, 0, 0, 0);
2171
+ return date;
2172
+ }
2084
2173
 
2085
2174
  var containsDate = function (dates, compareDate) {
2086
2175
  return dates.map(function (date) { return date.getTime(); }).includes(compareDate.getTime());
@@ -5130,26 +5219,6 @@ function cleanEscapedString(input) {
5130
5219
  return matched[1].replace(doubleQuoteRegExp, "'");
5131
5220
  }
5132
5221
 
5133
- /**
5134
- * Use `Text` to display text.
5135
- */
5136
- var Text = function (_a) {
5137
- var _b;
5138
- var _c = _a.align, align = _c === void 0 ? "left" : _c, children = _a.children, id = _a.id, _d = _a.isInline, isInline = _d === void 0 ? false : _d, _e = _a.isMeasured, isMeasured = _e === void 0 ? false : _e, _f = _a.size, size = _f === void 0 ? "m" : _f, _g = _a.tone, tone = _g === void 0 ? "default" : _g, _h = _a.elementType, elementType = _h === void 0 ? "span" : _h, props = __rest(_a, ["align", "children", "id", "isInline", "isMeasured", "size", "tone", "elementType"]);
5139
- var surface = React.useContext(Context$3).surface;
5140
- var Element = elementType;
5141
- return (React.createElement(Element, __assign({ id: id, className: classNames((_b = {
5142
- "arc-Text": true
5143
- },
5144
- _b[suffixModifier("arc-Text--align", align)] = align !== "left",
5145
- _b["arc-Text--inline"] = isInline,
5146
- _b["arc-Text--measured"] = isMeasured,
5147
- _b["arc-Text--size".concat(size && size.toUpperCase())] = size && size !== "m",
5148
- _b["arc-Text--".concat(tone)] = tone !== "default",
5149
- _b["arc-Text--onDarkSurface"] = surface === "dark",
5150
- _b)) }, filterAttrs(props)), children));
5151
- };
5152
-
5153
5222
  var ArcCalendarContext = React.createContext(null);
5154
5223
 
5155
5224
  var CalendarDayNumber = React.forwardRef(function (_a, autoFocusRef) {
@@ -13783,8 +13852,8 @@ var ContentSwitcherTab = React.forwardRef(function (_a, ref) {
13783
13852
  });
13784
13853
 
13785
13854
  var ContentSwitcherContent = function (_a) {
13786
- var children = _a.children, value = _a.value;
13787
- return (React.createElement($69cb30bb0017df05$export$7c6e2c02157bb7d2, { className: "arc-ContentSwitcherContent", value: value, tabIndex: -1 },
13855
+ var children = _a.children, value = _a.value, _b = _a.hidden, hidden = _b === void 0 ? undefined : _b, _c = _a.forceMount, forceMount = _c === void 0 ? true : _c, props = __rest(_a, ["children", "value", "hidden", "forceMount"]);
13856
+ return (React.createElement($69cb30bb0017df05$export$7c6e2c02157bb7d2, __assign({ className: "arc-ContentSwitcherContent", value: value, tabIndex: -1, forceMount: forceMount ? true : undefined, hidden: hidden }, filterAttrs(props)),
13788
13857
  React.createElement("div", { className: "arc-ContentSwitcherContent-wrapper" }, children)));
13789
13858
  };
13790
13859
 
@@ -16903,52 +16972,6 @@ var InformationCard = function (_a) {
16903
16972
  React.createElement(Image, __assign({}, footerLogo)))))))))));
16904
16973
  };
16905
16974
 
16906
- /**
16907
- * Do not edit directly
16908
- * Generated file
16909
- */
16910
-
16911
- const BtIconNewWindow =
16912
- "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3e%3cpath d='M24.702 7.018a.5.5 0 0 0-.191-.039h-7.005a.5.5 0 0 0 0 1h5.798l-8.16 8.16a.5.5 0 1 0 .708.707l8.159-8.16v5.774a.5.5 0 1 0 1 0V7.48a.5.5 0 0 0-.31-.462'/%3e%3cpath d='M26.852 3.99H5.184a1.2 1.2 0 0 0-1.2 1.201v21.7a1.104 1.104 0 0 0 1.102 1.103h21.766a1.18 1.18 0 0 0 1.178-1.18V5.17a1.18 1.18 0 0 0-1.178-1.178m.178 22.825a.18.18 0 0 1-.178.179H5.086a.104.104 0 0 1-.103-.103V5.19a.2.2 0 0 1 .2-.2h21.669a.18.18 0 0 1 .178.178Z'/%3e%3c/svg%3e";
16913
-
16914
- /**
16915
- * Use `Link` to direct users to a new page or piece of information.
16916
- */
16917
- var Link = function (_a) {
16918
- var id = _a.id, href = _a.href, title = _a.title, rel = _a.rel, target = _a.target, children = _a.children, onClick = _a.onClick, screenReaderText = _a.screenReaderText, _b = _a.isButton, isButton = _b === void 0 ? false : _b, _c = _a.isImplied, isImplied = _c === void 0 ? false : _c, _d = _a.size, size = _d === void 0 ? "m" : _d, props = __rest(_a, ["id", "href", "title", "rel", "target", "children", "onClick", "screenReaderText", "isButton", "isImplied", "size"]);
16919
- var surface = React.useContext(Context$3).surface;
16920
- var isExternalLink = target === "_blank";
16921
- var textArray = children.split(" ");
16922
- var firstText = textArray.slice(0, -1).join(" ");
16923
- var lastWord = textArray[textArray.length - 1];
16924
- var commonProps = {
16925
- id: id,
16926
- onClick: onClick,
16927
- className: classNames("arc-Link", "arc-Link--".concat(size), {
16928
- "arc-Link--onDarkSurface": surface === "dark",
16929
- "arc-Link--onLightSurface": surface !== "dark",
16930
- "arc-Link--isImplied": isImplied,
16931
- }),
16932
- };
16933
- var elementProps = {
16934
- a: __assign(__assign({}, commonProps), { href: href, title: title, target: target, rel: rel }),
16935
- button: __assign({}, commonProps),
16936
- span: __assign({}, commonProps),
16937
- };
16938
- var LinkElement = isButton ? "button" : href ? "a" : "span";
16939
- return (React.createElement(LinkElement, __assign({}, elementProps[LinkElement], filterAttrs(props)),
16940
- React.createElement("div", { className: "arc-Link-wrapper" },
16941
- React.createElement(VisuallyHidden$2, null,
16942
- screenReaderText || children,
16943
- isExternalLink && " (Opens in new window)"),
16944
- firstText && (React.createElement("span", { "aria-hidden": true, className: "arc-Link-text" },
16945
- firstText,
16946
- "\u00A0")),
16947
- React.createElement("span", { className: "arc-Link-iconWrapper" },
16948
- React.createElement("span", { "aria-hidden": true, className: "arc-Link-text" }, lastWord),
16949
- isExternalLink && (React.createElement(Icon$1, { icon: BtIconNewWindow, size: size === "s" ? 20 : 24 }))))));
16950
- };
16951
-
16952
16975
  /**
16953
16976
  * Use `Markup` to display HTML-formatted text.
16954
16977
  */
@@ -18361,7 +18384,7 @@ var MenuHeader = function (_a) {
18361
18384
  var MenuItem = function (_a) {
18362
18385
  var leadingIcon = _a.leadingIcon, supportingText = _a.supportingText, keyCommands = _a.keyCommands, trailingIcon = _a.trailingIcon, children = _a.children, onClick = _a.onClick, _b = _a.shouldKeepOpen, shouldKeepOpen = _b === void 0 ? true : _b, isDisabled = _a.isDisabled, href = _a.href, ariaLabel = _a.ariaLabel, props = __rest(_a, ["leadingIcon", "supportingText", "keyCommands", "trailingIcon", "children", "onClick", "shouldKeepOpen", "isDisabled", "href", "ariaLabel"]);
18363
18386
  var Component = href ? "a" : "div";
18364
- return (React.createElement(Item2, __assign({ className: "arc-MenuItem", asChild: true, "aria-label": ariaLabel, onClick: onClick, onSelect: function (event) {
18387
+ return (React.createElement(Item2, __assign({ className: "arc-MenuItem", asChild: true, "aria-label": ariaLabel, onClick: isDisabled ? undefined : onClick, onSelect: function (event) {
18365
18388
  if (shouldKeepOpen) {
18366
18389
  event.preventDefault();
18367
18390
  }
@@ -19252,7 +19275,7 @@ var SiteFooterItemDisclosure = function (_a) {
19252
19275
  var SiteFooterItemGroup = function (props) { return (React.createElement(React.Fragment, null,
19253
19276
  React.createElement(Visible, { "data-testid": "mobile-disclosure", xs: true, s: true },
19254
19277
  React.createElement(SiteFooterItemDisclosure, __assign({}, props, { tabIndex: 0 }))),
19255
- React.createElement(Visible, { "data-testid": "desktop-disclosure", m: true, l: true, xl: true },
19278
+ React.createElement(Visible, { "data-testid": "desktop-disclosure", m: true, l: true, xl: true, xxl: true },
19256
19279
  React.createElement(SiteFooterItemDisclosure, __assign({}, props, { open: true, tabIndex: -1 }))))); };
19257
19280
  var SiteFooterItem = function (_a) {
19258
19281
  var children = _a.children, href = _a.href, onClick = _a.onClick, props = __rest(_a, ["children", "href", "onClick"]);
@@ -19299,7 +19322,7 @@ var SiteFooterV2ItemGroup = function (_a) {
19299
19322
  return (React.createElement("div", null,
19300
19323
  React.createElement(Visible, { "data-testid": "mobile-disclosure", xs: !hideDisclosure, s: !hideDisclosure },
19301
19324
  React.createElement(SiteFooterV2ItemDisclosure, __assign({}, props, { tabIndex: 0 }))),
19302
- React.createElement(Visible, { "data-testid": "desktop-disclosure", m: true, l: true, xl: true },
19325
+ React.createElement(Visible, { "data-testid": "desktop-disclosure", m: true, l: true, xl: true, xxl: true },
19303
19326
  React.createElement(SiteFooterV2ItemDisclosure, __assign({}, props, { open: true, tabIndex: -1 })),
19304
19327
  React.createElement(VerticalSpace, { size: "12" }))));
19305
19328
  };
@@ -20155,38 +20178,27 @@ var Switch = function (_a) {
20155
20178
 
20156
20179
  var TabbedBanner = function (_a) {
20157
20180
  var _b;
20158
- var tabs = _a.tabs, defaultValue = _a.defaultValue, minHeight = _a.minHeight, minHeightM = _a.minHeightM;
20181
+ var tabs = _a.tabs, defaultValue = _a.defaultValue, minHeight = _a.minHeight, minHeightM = _a.minHeightM, minHeightL = _a.minHeightL, minHeightXL = _a.minHeightXL, props = __rest(_a, ["tabs", "defaultValue", "minHeight", "minHeightM", "minHeightL", "minHeightXL"]);
20159
20182
  var initialTab = defaultValue !== null && defaultValue !== void 0 ? defaultValue : (_b = tabs[0]) === null || _b === void 0 ? void 0 : _b.value;
20160
20183
  var _c = React.useState(initialTab), selectedTab = _c[0], setSelectedTab = _c[1];
20161
- var _d = React.useState(window.innerWidth < parseInt(ArcSizeBreakpointsM)), isBelowArcSizeBreakpointsM = _d[0], SetIsBelowArcSizeBreakpointsM = _d[1];
20162
- var handleResize = debounce(function () {
20163
- SetIsBelowArcSizeBreakpointsM(window.innerWidth < parseInt(ArcSizeBreakpointsM));
20164
- }, 100);
20165
- React.useEffect(function () {
20166
- handleResize();
20167
- window.addEventListener("resize", handleResize);
20168
- return function () {
20169
- window.removeEventListener("resize", handleResize);
20170
- handleResize.cancel();
20171
- };
20172
- }, [isBelowArcSizeBreakpointsM]);
20173
- return (React.createElement("div", { className: "arc-TabbedBanner" }, !isBelowArcSizeBreakpointsM ? (React.createElement("div", null,
20174
- React.createElement(ContentSwitcher, { value: selectedTab, onValueChange: function (value) { return setSelectedTab(value); } },
20175
- React.createElement(ContentSwitcherList, { isInset: true }, tabs.map(function (_a, index) {
20176
- var label = _a.label, value = _a.value;
20177
- return (React.createElement(ContentSwitcherTab, { label: label, value: value, key: "".concat(index, "-").concat(value) }));
20178
- })),
20179
- tabs.map(function (_a, index) {
20184
+ return (React.createElement("div", __assign({ className: "arc-TabbedBanner" }, filterAttrs(props)),
20185
+ React.createElement("div", { className: "arc-TabbedBanner--desktop" },
20186
+ React.createElement(ContentSwitcher, { value: selectedTab, onValueChange: function (value) { return setSelectedTab(value); } },
20187
+ React.createElement(ContentSwitcherList, { isInset: true }, tabs.map(function (_a, index) {
20188
+ var label = _a.label, value = _a.value;
20189
+ return (React.createElement(ContentSwitcherTab, { label: label, value: value, key: "".concat(index, "-").concat(value) }));
20190
+ })),
20191
+ tabs.map(function (_a, index) {
20192
+ var value = _a.value, content = _a.content;
20193
+ return (React.createElement(ContentSwitcherContent, { value: value, key: index, hidden: value !== selectedTab },
20194
+ React.createElement(TemplateBanner, __assign({ alignment: "start", headingSize: "m", additionalTopMargin: true, minHeight: minHeight, minHeightM: minHeightM, minHeightL: minHeightL, minHeightXL: minHeightXL }, content))));
20195
+ }))),
20196
+ React.createElement("div", { className: "arc-TabbedBanner--mobile" },
20197
+ React.createElement(ContentSwitcherDropdown, { value: selectedTab, tabs: tabs, isInset: true, isFluid: true, onValueChange: function (value) { return setSelectedTab(value); } }, tabs.map(function (_a, index) {
20180
20198
  var value = _a.value, content = _a.content;
20181
- return (React.createElement(ContentSwitcherContent, { value: value, key: index },
20182
- React.createElement(TemplateBanner, __assign({ alignment: "start", headingSize: "m", additionalTopMargin: true, minHeight: minHeight }, content))));
20183
- })))) : (React.createElement("div", null,
20184
- React.createElement(ContentSwitcherDropdown, { value: selectedTab, tabs: tabs, isInset: true, isFluid: true, onValueChange: function (value) { return setSelectedTab(value); } }, tabs.map(function (_a, index) {
20185
- var value = _a.value, content = _a.content;
20186
- return (React.createElement(ContentSwitcherDropdownContent, { value: value, key: "".concat(index, "-").concat(value) },
20187
- React.createElement(TemplateBanner, __assign({ alignment: "start", headingSize: "m", additionalTopMargin: !(window.innerHeight < parseInt(ArcSizeBreakpointsM) &&
20188
- content.type === "contained"), minHeight: minHeightM }, content))));
20189
- }))))));
20199
+ return (React.createElement(ContentSwitcherDropdownContent, { value: value, key: "".concat(index, "-").concat(value) },
20200
+ React.createElement(TemplateBanner, __assign({ alignment: "start", headingSize: "m", additionalTopMargin: true }, content))));
20201
+ })))));
20190
20202
  };
20191
20203
 
20192
20204
  /** Use `Tabs` to allow users to navigate between different sections of relevant content. */
@@ -20210,8 +20222,8 @@ var TabsItem = function (_a) {
20210
20222
  };
20211
20223
 
20212
20224
  var TabsContent = function (_a) {
20213
- var children = _a.children, value = _a.value, props = __rest(_a, ["children", "value"]);
20214
- return (React.createElement($69cb30bb0017df05$export$7c6e2c02157bb7d2, __assign({ className: "arc-Tabs-content", value: value }, filterAttrs(props)), children));
20225
+ var children = _a.children, value = _a.value, _b = _a.hidden, hidden = _b === void 0 ? undefined : _b, _c = _a.forceMount, forceMount = _c === void 0 ? true : _c, props = __rest(_a, ["children", "value", "hidden", "forceMount"]);
20226
+ return (React.createElement($69cb30bb0017df05$export$7c6e2c02157bb7d2, __assign({ className: "arc-Tabs-content", value: value, forceMount: forceMount ? true : undefined, hidden: hidden }, filterAttrs(props)), children));
20215
20227
  };
20216
20228
 
20217
20229
  var TabsList = function (_a) {
@@ -20350,7 +20362,7 @@ var TextArea = React.forwardRef(function (_a, ref) {
20350
20362
  var package_default = {
20351
20363
  name: "@arc-ui/helpers",
20352
20364
  private: true,
20353
- version: "12.0.0-beta.21",
20365
+ version: "12.0.0-beta.22",
20354
20366
  type: "module",
20355
20367
  homepage: "https://ui.digital-ent-int.bt.com",
20356
20368
  author: "BT Enterprise Digital UI Team <ui-digital-ent-int@bt.com>",
@@ -26012,7 +26024,8 @@ var BtRedcareLogo = function () { return (React.createElement("svg", { xmlns: "h
26012
26024
  React.createElement("path", { d: "M25 0C11.285 0 0 11.285 0 25s11.285 25 25 25 25-11.285 25-25C49.995 11.287 38.713.005 25 0Zm0 46.92h-.005c-12.028 0-21.925-9.897-21.925-21.925S12.967 3.07 24.995 3.07 46.92 12.967 46.92 24.995V25C46.911 37.022 37.022 46.911 25 46.92Zm95.636-16.632-2.683-2.44-.153.19a5.93 5.93 0 0 1-1.965 1.626 5.484 5.484 0 0 1-2.415.508 4.314 4.314 0 0 1-2.323-.65 4.609 4.609 0 0 1-1.653-1.828 6.386 6.386 0 0 1 0-5.456 4.627 4.627 0 0 1 1.642-1.824 4.267 4.267 0 0 1 2.31-.65 5.014 5.014 0 0 1 2.317.521c.746.411 1.4.97 1.923 1.642l.153.187 2.686-2.436-.142-.176a9.26 9.26 0 0 0-3.09-2.47 8.886 8.886 0 0 0-3.84-.802 9.082 9.082 0 0 0-3.428.644 8.536 8.536 0 0 0-2.798 1.824 8.35 8.35 0 0 0-1.871 2.785 9.462 9.462 0 0 0 0 6.978 8.36 8.36 0 0 0 4.672 4.6 9.204 9.204 0 0 0 3.44.642 9.37 9.37 0 0 0 3.909-.788 9.195 9.195 0 0 0 3.16-2.457l.15-.17h-.001ZM22.8 24.626a4.224 4.224 0 0 0 1.625-3.4c0-3.075-2.224-4.751-5.5-4.751h-6.77v17h7.248c3.25 0 5.526-1.774 5.526-5-.003-1.875-.979-3.175-2.129-3.849Zm3.425-4.501H30.4v13.35h4.1v-13.35h4.175v-3.65h-12.45v3.65Zm126.251 4.57a5.193 5.193 0 0 0 .866-2.976 5.303 5.303 0 0 0-.68-2.7 4.818 4.818 0 0 0-1.98-1.861c-.857-.448-1.915-.676-3.143-.676h-8.354v16.992h4.097v-6.336h2.984l3.235 6.329h4.586l-3.86-7.028a4.777 4.777 0 0 0 2.25-1.744h-.001Zm-75.218 1.947h6.115V23.16h-6.115v-3.2h8.714v-3.484H73.16v16.992h13.048v-3.484h-8.95v-3.342Zm-6.888-1.947a5.193 5.193 0 0 0 .866-2.976 5.306 5.306 0 0 0-.68-2.707 4.825 4.825 0 0 0-1.98-1.861c-.86-.448-1.916-.676-3.135-.676H57.08v16.992h4.095v-6.33h2.983l3.235 6.33h4.586l-3.86-7.028a4.787 4.787 0 0 0 2.252-1.744h-.001Zm28.995-7.144c-1.436-.706-3.175-1.076-5.193-1.076h-6.228v16.992h6.228c2.01 0 3.757-.353 5.193-1.074a7.914 7.914 0 0 0 3.33-3 8.457 8.457 0 0 0 1.154-4.409 8.44 8.44 0 0 0-1.154-4.41 7.894 7.894 0 0 0-3.33-3.023Zm32.205-1.076h-4.279l-6.816 16.992h4.234l1.41-3.683h6.527l1.411 3.683h4.358l-6.786-16.847-.06-.145h.001Zm27.747 13.508v-3.34h6.117v-3.485h-6.117v-3.2h8.715v-3.483h-12.81v16.992h13.047v-3.484h-8.952Zm-140.367.042v.008-.001H16.2v-3.557h2.75c1.15 0 1.825.725 1.825 1.8 0 1.025-.666 1.75-1.825 1.75Zm80.711-5.054c0 1.534-.469 2.765-1.395 3.66-.926.897-2.309 1.356-4.094 1.356h-2.13V19.959h2.13c1.787 0 3.163.458 4.09 1.363.928.905 1.4 2.138 1.4 3.65l-.001-.001Zm27.694 1.588 2.029-5.335 2.05 5.335h-4.079Zm-60.312-4.744a2.02 2.02 0 0 1-.494 1.437c-.323.353-.834.53-1.519.53h-3.856v-3.919h3.856c.706 0 1.216.177 1.53.53.337.392.51.898.483 1.414v.008Zm82.108 0a2.024 2.024 0 0 1-.494 1.437c-.322.353-.833.53-1.52.53h-3.855v-3.919h3.855c.705 0 1.215.177 1.53.53.337.391.51.898.484 1.414v.008ZM16.2 19.932h2.526c.973 0 1.548.625 1.548 1.526 0 .949-.575 1.575-1.548 1.575H16.2v-3.101Z", fill: "currentColor" }))); };
26013
26025
 
26014
26026
  var NavigationHeaderLogo = function (_a) {
26015
- var _b = _a.brand, brand = _b === void 0 ? "bt" : _b, _c = _a.href, href = _c === void 0 ? "/" : _c, _d = _a.ariaLabel, ariaLabel = _d === void 0 ? "Home" : _d, svg = _a.svg, onClick = _a.onClick;
26027
+ var _b;
26028
+ var _c = _a.brand, brand = _c === void 0 ? "bt" : _c, _d = _a.href, href = _d === void 0 ? "/" : _d, _e = _a.ariaLabel, ariaLabel = _e === void 0 ? "Home" : _e, _f = _a.isSurfaceSensitive, isSurfaceSensitive = _f === void 0 ? true : _f, svg = _a.svg, onClick = _a.onClick;
26016
26029
  var surface = React.useContext(Context$3).surface;
26017
26030
  var logos = {
26018
26031
  bt: BtLogo,
@@ -26023,7 +26036,11 @@ var NavigationHeaderLogo = function (_a) {
26023
26036
  btWholesale: BtWholesaleLogo,
26024
26037
  };
26025
26038
  var icon = svg || React.createElement(logos[brand]);
26026
- return (React.createElement("a", { className: classNames("arc-NavigationHeaderLogo", suffixModifier("arc-NavigationHeaderLogo--on", surface)), "aria-label": ariaLabel, onClick: onClick, href: href }, icon));
26039
+ return (React.createElement("a", { className: classNames("arc-NavigationHeaderLogo", (_b = {
26040
+ "arc-NavigationHeaderLogo--staticColor": !isSurfaceSensitive
26041
+ },
26042
+ _b[suffixModifier("arc-NavigationHeaderLogo--on", surface)] = isSurfaceSensitive,
26043
+ _b)), "aria-label": ariaLabel, onClick: onClick, href: href }, icon));
26027
26044
  };
26028
26045
 
26029
26046
  // src/check-element-visibility/check-element-visibility.ts
@@ -26036,6 +26053,14 @@ var checkElementVisibility = (element) => {
26036
26053
  }
26037
26054
  };
26038
26055
 
26056
+ var NavigationHeaderInlineAction = function (_a) {
26057
+ var icon = _a.icon, text = _a.text, href = _a.href, onClick = _a.onClick;
26058
+ return (React.createElement(ConditionalWrapper, { condition: Boolean(href), wrapper: function (children) { return (React.createElement("a", { "aria-label": text, className: classNames("arc-NavigationHeaderInlineAction", "arc-NavigationHeaderInlineAction-link"), href: href, onClick: onClick }, children)); }, fallback: function (children) { return (React.createElement("button", { "aria-label": text, className: classNames("arc-NavigationHeaderInlineAction", "arc-NavigationHeaderInlineAction-button"), onClick: onClick }, children)); } },
26059
+ React.createElement("div", { className: "arc-NavigationHeaderInlineAction-content" },
26060
+ React.createElement(Icon$1, { "aria-hidden": true, icon: icon, size: 28 }),
26061
+ React.createElement(Text, { size: "l" }, text))));
26062
+ };
26063
+
26039
26064
  var NavigationHeaderButton = React.forwardRef(function (_a, ref) {
26040
26065
  var isActive = _a.isActive, children = _a.children, onClick = _a.onClick, _b = _a.isPadded, isPadded = _b === void 0 ? true : _b, props = __rest(_a, ["isActive", "children", "onClick", "isPadded"]);
26041
26066
  var surface = React.useContext(Context$3).surface;
@@ -26045,18 +26070,66 @@ var NavigationHeaderButton = React.forwardRef(function (_a, ref) {
26045
26070
  }) }), children));
26046
26071
  });
26047
26072
 
26048
- var NavigationHeaderNavLink = function (_a) {
26049
- var text = _a.text, onClick = _a.onClick, href = _a.href, _b = _a.borderRadiusSize, borderRadiusSize = _b === void 0 ? "s" : _b;
26050
- var surface = React.useContext(Context$3).surface;
26051
- return (React.createElement("a", { href: href, onClick: onClick, className: classNames("arc-NavigationHeaderNavLink", suffixModifier("arc-NavigationHeaderNavLink--borderRadiusSize", borderRadiusSize), suffixModifier("arc-NavigationHeaderNavLink--on", surface)) },
26052
- React.createElement(Text, null, text)));
26073
+ var NavigationHeaderDisclosure = function (_a) {
26074
+ var heading = _a.heading, children = _a.children;
26075
+ var _b = React.useState(false), isOpen = _b[0], setIsOpen = _b[1];
26076
+ var containerRef = React.useRef(null);
26077
+ var handleOnClick = function (e) {
26078
+ e.preventDefault();
26079
+ setIsOpen(function (isOpen) { return !isOpen; });
26080
+ };
26081
+ React.useEffect(function () {
26082
+ if (containerRef.current && containerRef.current.firstChild && isOpen) {
26083
+ containerRef.current.firstChild.focus();
26084
+ }
26085
+ }, [isOpen, containerRef.current]);
26086
+ return (React.createElement("details", { className: "arc-NavigationHeaderDisclosure", open: isOpen },
26087
+ React.createElement("summary", { "aria-expanded": isOpen, onClick: handleOnClick, className: "arc-NavigationHeaderDisclosure-summary" },
26088
+ React.createElement("span", { className: "arc-NavigationHeaderDisclosure-heading" }, heading),
26089
+ React.createElement("span", { className: "arc-NavigationHeaderDisclosure-icon" },
26090
+ React.createElement(ThemeIcon, { size: 28, icon: "navigationHeaderDisclosure" }))),
26091
+ React.createElement("div", { ref: containerRef, className: "arc-NavigationHeaderDisclosure-details" }, children)));
26092
+ };
26093
+
26094
+ var NavigationHeaderMenuLink = function (_a) {
26095
+ var href = _a.href, onClick = _a.onClick, text = _a.text, _b = _a.size, size = _b === void 0 ? "l" : _b;
26096
+ var icons = {
26097
+ s: {
26098
+ icon: "navigationHeaderMenuLinkSmall",
26099
+ size: 24,
26100
+ },
26101
+ l: {
26102
+ icon: "navigationHeaderMenuLinkLarge",
26103
+ size: 28,
26104
+ },
26105
+ };
26106
+ return (React.createElement("a", { "aria-label": text, href: href, onClick: onClick, className: classNames("arc-NavigationHeaderMenuLink", suffixModifier("arc-NavigationHeaderMenuLink--size", size)) },
26107
+ React.createElement("div", { className: "arc-NavigationHeaderMenuLink-text" }, text),
26108
+ React.createElement("span", { className: "arc-NavigationHeaderMenuLink-icon" },
26109
+ React.createElement(ThemeIcon, __assign({}, icons[size])))));
26053
26110
  };
26054
26111
 
26112
+ var NavigationHeaderCloseButton = React.forwardRef(function (_a, ref) {
26113
+ var onClick = _a.onClick, props = __rest(_a, ["onClick"]);
26114
+ return (React.createElement("button", __assign({}, props, { ref: ref, "aria-label": "close", onClick: onClick, className: "arc-NavigationHeaderCloseButton" }),
26115
+ React.createElement(ThemeIcon, { size: 32, icon: "navigationHeaderClose" })));
26116
+ });
26117
+
26055
26118
  var NavigationHeaderBurgerMenu = function (_a) {
26056
- var navItems = _a.navItems, topContent = _a.topContent, bottomContent = _a.bottomContent;
26119
+ var navItems = _a.navItems, actions = _a.actions, header = _a.header, footer = _a.footer, logo = _a.logo;
26057
26120
  var id = React.useId();
26058
26121
  var _b = React.useState(false), isOpen = _b[0], setIsOpen = _b[1];
26059
26122
  var triggerRef = React.useRef(null);
26123
+ var interactionMode = useInteractionMode().interactionMode;
26124
+ var _c = useThemeElement(), themeElement = _c[0], setThemeElement = _c[1];
26125
+ var closeMenu = function () {
26126
+ setIsOpen(false);
26127
+ };
26128
+ var focusTriggerElement = function () {
26129
+ if (triggerRef.current && interactionMode === "keyboard") {
26130
+ triggerRef.current.focus();
26131
+ }
26132
+ };
26060
26133
  // Close the menu if the nav or trigger is hidden
26061
26134
  React.useEffect(function () {
26062
26135
  var resizeObserver = new ResizeObserver(function (entries) {
@@ -26077,34 +26150,46 @@ var NavigationHeaderBurgerMenu = function (_a) {
26077
26150
  return (React.createElement(React.Fragment, null,
26078
26151
  React.createElement(Tooltip, { asChild: true, delayDuration: 0, title: "Menu", side: "bottom" },
26079
26152
  React.createElement(NavigationHeaderButton, { ref: triggerRef, isPadded: false, "aria-expanded": isOpen, "aria-label": isOpen ? "close menu" : "open menu", onClick: function () { return setIsOpen(!isOpen); } },
26080
- React.createElement("div", { className: "arc-NavigationHeaderBurgerMenu-buttonContent" },
26153
+ React.createElement("div", { className: "arc-NavigationHeaderBurgerMenu-trigger" },
26081
26154
  React.createElement(ThemeIcon, { icon: "siteHeaderBurger", size: 24 })),
26082
26155
  React.createElement(VisuallyHidden$2, null, isOpen ? "close menu" : "open menu"))),
26083
- React.createElement(Drawer, { isOpen: isOpen, "aria-describedby": undefined, onRequestClose: function () { return setIsOpen(false); } },
26084
- React.createElement(Surface, { isTransparent: true, background: "light-white" },
26085
- React.createElement(DrawerHeader, { title: "Menu" }),
26086
- React.createElement("div", { className: "arc-NavigationHeaderBurgerMenu-content" },
26087
- topContent && (React.createElement("div", { className: "arc-NavigationHeaderBurgerMenu-topContent" },
26088
- React.createElement(VerticalSpace, null),
26089
- React.createElement(Rule, null),
26090
- React.createElement(VerticalSpace, null),
26091
- topContent,
26092
- React.createElement(VerticalSpace, null))),
26093
- navItems && (React.createElement(DrawerContent, null,
26094
- React.createElement("ul", { className: "arc-NavigationHeaderBurgerMenu-list" }, navItems.map(function (navItem, navItemIndex) { return (React.createElement(React.Fragment, { key: "".concat(id, "-burger-nav-item-").concat(navItemIndex) },
26095
- React.createElement("li", null,
26096
- (navItem.type === "link" ||
26097
- navItem.type === "meatball") && (React.createElement(NavigationHeaderNavLink, __assign({}, navItem))),
26098
- (navItem.type === "subnav" ||
26099
- navItem.type === "dropdown") &&
26100
- navItem.items.map(function (subNavItem, subNavItemIndex) { return (React.createElement(NavigationHeaderNavLink, __assign({ key: "".concat(id, "-").concat(navItemIndex, "-burger-sub-nav-item-").concat(subNavItemIndex) }, subNavItem))); })))); })))),
26101
- bottomContent && (React.createElement(React.Fragment, null,
26102
- React.createElement("div", { className: "arc-NavigationHeaderBurgerMenu-bottomContent" },
26103
- React.createElement(VerticalSpace, null),
26104
- React.createElement(Rule, null),
26105
- React.createElement(VerticalSpace, null),
26106
- bottomContent,
26107
- React.createElement(VerticalSpace, null)))))))));
26156
+ React.createElement("div", { ref: setThemeElement },
26157
+ React.createElement(Root$3, { open: isOpen },
26158
+ React.createElement(Portal$3, { container: themeElement },
26159
+ React.createElement(Overlay, { className: "arc-NavigationHeaderBurgerMenu-overlay" },
26160
+ React.createElement(Content$1, { "aria-describedby": undefined, className: "arc-NavigationHeaderBurgerMenu-slider", onCloseAutoFocus: focusTriggerElement, onEscapeKeyDown: closeMenu, onInteractOutside: closeMenu, "aria-modal": "true" },
26161
+ React.createElement("div", { className: "arc-NavigationHeaderBurgerMenu-container" },
26162
+ React.createElement("div", { className: "arc-NavigationHeaderBurgerMenu-mainContent" },
26163
+ React.createElement("div", { className: "arc-NavigationHeaderBurgerMenu-header" },
26164
+ React.createElement(Title, null,
26165
+ React.createElement(VisuallyHidden$2, null, "Menu")),
26166
+ React.createElement("div", { className: "arc-NavigationHeaderBurgerMenu-logoContainer" },
26167
+ React.createElement("div", { className: "arc-NavigationHeaderBurgerMenu-logoWrapper" },
26168
+ React.createElement(NavigationHeaderLogo, __assign({}, logo, { isSurfaceSensitive: false })))),
26169
+ React.createElement("div", { className: "arc-NavigationHeaderBurgerMenu-closeButtonContainer" },
26170
+ React.createElement(Tooltip, { asChild: true, delayDuration: 0, title: "Close menu", side: "left" },
26171
+ React.createElement(NavigationHeaderCloseButton, { onClick: closeMenu })))),
26172
+ header && (React.createElement("div", { className: "arc-NavigationHeaderBurgerMenu-topContent" }, header)),
26173
+ (navItems || actions) && (React.createElement("div", { className: "arc-NavigationHeaderBurgerMenu-navigationContent" },
26174
+ navItems && (React.createElement("ul", { className: "arc-NavigationHeaderBurgerMenu-list" }, navItems.map(function (navItem, navItemIndex) { return (React.createElement(React.Fragment, { key: "".concat(id, "-burger-nav-item-").concat(navItemIndex) },
26175
+ React.createElement("li", { className: "arc-NavigationHeaderBurgerMenu-listItem" },
26176
+ React.createElement("div", { className: "arc-NavigationHeaderBurgerMenu-listItemContent" },
26177
+ (navItem.type === "link" ||
26178
+ navItem.type === "meatball") && (React.createElement(NavigationHeaderMenuLink, { href: navItem.href, onClick: navItem.onClick, text: navItem.text })),
26179
+ (navItem.type === "subnav" ||
26180
+ navItem.type === "dropdown") && (React.createElement(NavigationHeaderDisclosure, { heading: navItem.text }, navItem.items.map(function (subNavItem, subNavItemIndex) { return (React.createElement(NavigationHeaderMenuLink, { size: "s", key: "".concat(id, "-").concat(navItemIndex, "-burger-sub-nav-item-").concat(subNavItemIndex), href: subNavItem.href, onClick: subNavItem.onClick, text: subNavItem.text })); }))))))); }))),
26181
+ actions && (React.createElement("div", { className: classNames("arc-NavigationHeaderBurgerMenu-actionsContainer", {
26182
+ "arc-NavigationHeaderBurgerMenu-actionsContainer--seperator": navItems && actions,
26183
+ }) }, actions.map(function (props, i) { return (React.createElement(NavigationHeaderInlineAction, __assign({ key: "".concat(id, "-action-{").concat(i, "}") }, props))); })))))),
26184
+ footer && (React.createElement("div", { className: "arc-NavigationHeaderBurgerMenu-footer" },
26185
+ React.createElement(Surface, { isTransparent: true, background: "dark-black" }, footer)))))))))));
26186
+ };
26187
+
26188
+ var NavigationHeaderNavLink = function (_a) {
26189
+ var text = _a.text, onClick = _a.onClick, href = _a.href, _b = _a.borderRadiusSize, borderRadiusSize = _b === void 0 ? "s" : _b;
26190
+ var surface = React.useContext(Context$3).surface;
26191
+ return (React.createElement("a", { href: href, onClick: onClick, className: classNames("arc-NavigationHeaderNavLink", suffixModifier("arc-NavigationHeaderNavLink--borderRadiusSize", borderRadiusSize), suffixModifier("arc-NavigationHeaderNavLink--on", surface)) },
26192
+ React.createElement(Text, null, text)));
26108
26193
  };
26109
26194
 
26110
26195
  // src/get-focusable-elements/get-focusable-elements.ts
@@ -27196,7 +27281,7 @@ var defaultHeaderVisibility = {
27196
27281
  };
27197
27282
 
27198
27283
  var NavigationHeader = function (_a) {
27199
- var leftSlot = _a.leftSlot, middleSlot = _a.middleSlot, rightSlot = _a.rightSlot, isPill = _a.isPill, isExtended = _a.isExtended, isFluid = _a.isFluid, logo = _a.logo, navItems = _a.navItems, background = _a.background, meatballMenuTooltip = _a.meatballMenuTooltip, burgerMenuBottomContent = _a.burgerMenuBottomContent, burgerMenuTopContent = _a.burgerMenuTopContent, burgerMenuVisibility = _a.burgerMenuVisibility, navMenuVisibility = _a.navMenuVisibility;
27284
+ var leftSlot = _a.leftSlot, middleSlot = _a.middleSlot, rightSlot = _a.rightSlot, isPill = _a.isPill, isExtended = _a.isExtended, isFluid = _a.isFluid, logo = _a.logo, navItems = _a.navItems, background = _a.background, meatballMenuTooltip = _a.meatballMenuTooltip, burgerMenuActions = _a.burgerMenuActions, burgerMenuFooter = _a.burgerMenuFooter, burgerMenuHeader = _a.burgerMenuHeader, burgerMenuVisibility = _a.burgerMenuVisibility, navMenuVisibility = _a.navMenuVisibility;
27200
27285
  var navBarPortalRef = React.useRef(null);
27201
27286
  var _b = React.useState(false), isSubMenuItemActive = _b[0], setIsSubMenuItemActive = _b[1];
27202
27287
  var navBarBackground = isSubMenuItemActive ? "lightElevated" : background;
@@ -27221,7 +27306,7 @@ var NavigationHeader = function (_a) {
27221
27306
  rightSlot && (React.createElement("div", { className: "arc-NavigationHeader-rightSlot" }, rightSlot)),
27222
27307
  React.createElement(Visible, __assign({}, burgerMenuVisibilityProps),
27223
27308
  React.createElement("div", { className: "arc-NavigationHeader-burgerMenuSlot" },
27224
- React.createElement(NavigationHeaderBurgerMenu, { navItems: navItems, topContent: burgerMenuTopContent, bottomContent: burgerMenuBottomContent })))))));
27309
+ React.createElement(NavigationHeaderBurgerMenu, { logo: logo, navItems: navItems, actions: burgerMenuActions, header: burgerMenuHeader, footer: burgerMenuFooter })))))));
27225
27310
  };
27226
27311
 
27227
27312
  var NavigationHeaderAction = function (_a) {