@arc-ui/components 3.1.0 → 4.0.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.
package/dist/index.js CHANGED
@@ -363,15 +363,17 @@ __spreadArray([], backgroundsShared, true);
363
363
  * Use `BrandLogo` to display the brand logo.
364
364
  */
365
365
  var BrandLogo = function (_a) {
366
- var _b = _a.color, color = _b === void 0 ? "auto" : _b, label = _a.label, _c = _a.size, size = _c === void 0 ? 40 : _c, props = __rest(_a, ["color", "label", "size"]);
366
+ var _b;
367
+ var _c = _a.color, color = _c === void 0 ? "auto" : _c, label = _a.label, _d = _a.size, size = _d === void 0 ? 34 : _d, subBrand = _a.subBrand, props = __rest(_a, ["color", "label", "size", "subBrand"]);
367
368
  var surface = React.useContext(Context$2).surface;
368
- return (React__default["default"].createElement("div", __assign({ className: classNames({
369
- "arc-BrandLogo": true,
370
- "arc-BrandLogo--colorBrand": color === "brand",
371
- "arc-BrandLogo--onDarkBackground": surface === "dark"
372
- }), style: {
373
- height: size !== 40 ? size : undefined,
374
- width: size !== 40 ? size : undefined
369
+ return (React__default["default"].createElement("div", __assign({ className: classNames((_b = {
370
+ "arc-BrandLogo": true,
371
+ "arc-BrandLogo--colorBrand": color === "brand",
372
+ "arc-BrandLogo--onDarkSurface": surface === "dark"
373
+ },
374
+ _b[suffixModifier("arc-BrandLogo--subBrand", subBrand || "")] = subBrand,
375
+ _b)), style: {
376
+ width: size !== 34 ? size : undefined
375
377
  } }, filterDataAttrs(props)), label ? React__default["default"].createElement("span", { className: "arc-BrandLogo-text" }, label) : null));
376
378
  };
377
379
 
@@ -644,10 +646,10 @@ var Icon = function (_a) {
644
646
  var surface = React.useContext(Context$2).surface;
645
647
  return (React__default["default"].createElement("span", __assign({ "aria-label": label, className: classNames((_b = {},
646
648
  _b["arc-Icon"] = true,
647
- _b[suffixModifier("arc-Icon--color", color || "")] = color !== "auto",
649
+ _b[suffixModifier("arc-Icon--color", color)] = color !== "auto",
648
650
  _b["arc-Icon--".concat(icon).concat(isSelected && iconsSelected.includes("".concat(icon, "Fill")) ? "Fill" : "")] = icon,
649
651
  _b["arc-Icon--inline"] = isInline,
650
- _b["arc-Icon--onDarkBackground"] = surface === "dark",
652
+ _b["arc-Icon--onDarkSurface"] = surface === "dark",
651
653
  _b)), role: label ? "img" : undefined, style: {
652
654
  height: size,
653
655
  width: size
@@ -663,11 +665,10 @@ var Button = React.forwardRef(function (_a, ref) {
663
665
  var surface = React.useContext(Context$2).surface;
664
666
  var buttonClasses = classNames((_b = {
665
667
  "arc-Button": true,
666
- "arc-Button--displayBlock": isDisplayBlock,
667
- "arc-Button--fillFlat": fill === "flat",
668
- "arc-Button--fillOutlined": fill === "outlined",
669
- "arc-Button--fullWidth": isFullWidth
668
+ "arc-Button--displayBlock": isDisplayBlock
670
669
  },
670
+ _b[suffixModifier("arc-Button--fill", fill)] = fill !== "solid",
671
+ _b["arc-Button--fullWidth"] = isFullWidth,
671
672
  _b[suffixModifier("arc-Button--icon", iconPosition.replace("icon", ""))] = (icon || fill === "flat") &&
672
673
  iconPosition &&
673
674
  iconPosition !== "afterText",
@@ -724,7 +725,7 @@ var Heading = function (_a) {
724
725
  return (React__default["default"].createElement(Element, __assign({ className: classNames((_b = {
725
726
  "arc-Heading": true
726
727
  },
727
- _b[suffixModifier("arc-Heading--align", align || "")] = align && align !== "left",
728
+ _b[suffixModifier("arc-Heading--align", align)] = align && align !== "left",
728
729
  _b["arc-Heading--size".concat(size && size.toUpperCase())] = size,
729
730
  _b["arc-Heading--casingNone"] = casing === "none",
730
731
  _b["arc-Heading--colorBrand"] = color === "brand",
@@ -854,25 +855,24 @@ var useNumericInput = function (props) {
854
855
  return { inputMode: inputMode, pattern: pattern, type: type };
855
856
  };
856
857
 
857
- var defaultActionLabel = "Read more";
858
858
  /**
859
859
  * Use `Card` to contain content and actions about a single subject.
860
860
  */
861
861
  var Card = function (_a) {
862
862
  var _b;
863
- var actionId = _a.actionId, _c = _a.actionLabel, actionLabel = _c === void 0 ? defaultActionLabel : _c, children = _a.children, _d = _a.fill, fill = _d === void 0 ? "solid" : _d, href = _a.href, imageAlt = _a.imageAlt, imageSrc = _a.imageSrc, imageSrcSet = _a.imageSrcSet, imageHeight = _a.imageHeight, minHeight = _a.minHeight, target = _a.target, title = _a.title, _e = _a.titleSize, titleSize = _e === void 0 ? "s" : _e, props = __rest(_a, ["actionId", "actionLabel", "children", "fill", "href", "imageAlt", "imageSrc", "imageSrcSet", "imageHeight", "minHeight", "target", "title", "titleSize"]);
863
+ var actionId = _a.actionId, _c = _a.actionLabel, actionLabel = _c === void 0 ? "Read more" : _c, children = _a.children, _d = _a.fill, fill = _d === void 0 ? "solid" : _d, href = _a.href, imageAlt = _a.imageAlt, imageSrc = _a.imageSrc, imageSrcSet = _a.imageSrcSet, imageHeight = _a.imageHeight, minHeight = _a.minHeight, target = _a.target, title = _a.title, _e = _a.titleSize, titleSize = _e === void 0 ? "s" : _e, props = __rest(_a, ["actionId", "actionLabel", "children", "fill", "href", "imageAlt", "imageSrc", "imageSrcSet", "imageHeight", "minHeight", "target", "title", "titleSize"]);
864
864
  var surface = React.useContext(Context$2).surface;
865
865
  var interactionMode = useInteractionMode().interactionMode;
866
866
  var Wrapper = function (_a) {
867
867
  var children = _a.children;
868
- return fill === "outlined" ? (React__default["default"].createElement("div", null, children)) : (React__default["default"].createElement(Surface, { background: surface === "dark" ? "white" : "darker" }, children));
868
+ return fill === "outlined" || fill === "neutral" ? (React__default["default"].createElement("div", null, children)) : (React__default["default"].createElement(Surface, { background: surface === "dark" ? "white" : "darker" }, children));
869
869
  };
870
870
  var coverImage = imageSrc && (React__default["default"].createElement(CardImage, { alt: imageAlt, src: imageSrc, srcSet: imageSrcSet, height: imageHeight }));
871
871
  return (React__default["default"].createElement("div", __assign({ className: classNames((_b = {
872
872
  "arc-Card": true,
873
- "arc-Card--onDarkSurface": surface === "dark",
874
- "arc-Card--fillOutlined": fill === "outlined"
873
+ "arc-Card--onDarkSurface": surface === "dark"
875
874
  },
875
+ _b[suffixModifier("arc-Card--fill", fill)] = fill !== "solid",
876
876
  _b["arc-is-".concat(interactionMode, "InteractionMode")] = interactionMode,
877
877
  _b)) }, filterDataAttrs(props)),
878
878
  React__default["default"].createElement(Wrapper, null,
@@ -880,12 +880,12 @@ var Card = function (_a) {
880
880
  React__default["default"].createElement("div", { className: "arc-Card-header" },
881
881
  React__default["default"].createElement("div", { className: "arc-Card-title" },
882
882
  React__default["default"].createElement(Heading, { size: titleSize },
883
- React__default["default"].createElement(CardLink, { actionId: actionId, href: href, stretch: true, target: target }, title))),
883
+ React__default["default"].createElement(CardLink, { actionId: actionId, fill: fill, href: href, stretch: true, target: target }, title))),
884
884
  coverImage),
885
885
  React__default["default"].createElement("div", { className: "arc-Card-children" },
886
886
  React__default["default"].createElement(Card.Block, null, children)),
887
887
  href && (React__default["default"].createElement(CardBlock, null,
888
- React__default["default"].createElement(CardLink, { href: href, actionId: actionId, isButton: true }, actionLabel || defaultActionLabel)))))));
888
+ React__default["default"].createElement(CardLink, { href: href, fill: fill, actionId: actionId, isButton: true }, actionLabel)))))));
889
889
  };
890
890
  /**
891
891
  * Internal `Card.Block` component to section blocks of content within a Card.
@@ -919,12 +919,12 @@ Card.Image = CardImage;
919
919
  * Internal `CardLink` component.
920
920
  */
921
921
  var CardLink = function (_a) {
922
- var actionId = _a.actionId, isButton = _a.isButton, children = _a.children, href = _a.href, stretch = _a.stretch, target = _a.target;
922
+ var actionId = _a.actionId, isButton = _a.isButton, children = _a.children, fill = _a.fill, href = _a.href, stretch = _a.stretch, target = _a.target;
923
923
  var surface = React.useContext(Context$2).surface;
924
924
  return (React__default["default"].createElement("a", { "aria-describedby": actionId, className: classNames({
925
925
  "arc-CardLink": true,
926
926
  "arc-CardLink--button": isButton,
927
- "arc-CardLink--onDarkSurface": surface === "dark",
927
+ "arc-CardLink--onDarkSurface": surface === "dark" && fill !== "neutral",
928
928
  "arc-CardLink--stretch": stretch
929
929
  }), href: href, rel: target === "_blank" ? "noopener noreferrer" : undefined, tabIndex: isButton ? -1 : undefined, target: target },
930
930
  React__default["default"].createElement("span", { className: "arc-CardLink-text" }, children),
@@ -1020,9 +1020,7 @@ var Col = function (_a) {
1020
1020
  var align = _a.align, children = _a.children, _c = _a.isDebugVisible, isDebugVisible = _c === void 0 ? false : _c, offset = _a.offset, offsetS = _a.offsetS, offsetM = _a.offsetM, offsetL = _a.offsetL, offsetXL = _a.offsetXL, span = _a.span, spanS = _a.spanS, spanM = _a.spanM, spanL = _a.spanL, spanXL = _a.spanXL, props = __rest(_a, ["align", "children", "isDebugVisible", "offset", "offsetS", "offsetM", "offsetL", "offsetXL", "span", "spanS", "spanM", "spanL", "spanXL"]);
1021
1021
  return (React__default["default"].createElement("div", __assign({ className: classNames((_b = {},
1022
1022
  _b["arc-Col"] = true,
1023
- _b["arc-Col--alignBottom"] = align === "bottom",
1024
- _b["arc-Col--alignCenter"] = align === "center",
1025
- _b["arc-Col--alignTop"] = align === "top",
1023
+ _b[suffixModifier("arc-Col--align", align || "")] = align,
1026
1024
  _b["arc-Col--".concat(span)] = typeof span !== "undefined",
1027
1025
  _b["arc-Col--S".concat(spanS)] = typeof spanS !== "undefined",
1028
1026
  _b["arc-Col--M".concat(spanM)] = typeof spanM !== "undefined",
@@ -1054,7 +1052,7 @@ var Curve = function (_a) {
1054
1052
  return (React__default["default"].createElement("div", __assign({ className: classNames((_b = {
1055
1053
  "arc-Curve": true
1056
1054
  },
1057
- _b[suffixModifier("arc-Curve--from", from || "")] = from && from !== "top",
1055
+ _b[suffixModifier("arc-Curve--from", from)] = from && from !== "top",
1058
1056
  _b["arc-Curve--size".concat(size && size.toUpperCase())] = size && size !== "m",
1059
1057
  _b[suffixModifier("arc-Curve--bottomColor", bottomColor || "")] = bottomColor,
1060
1058
  _b[suffixModifier("arc-Curve--topColor", topColor || "")] = topColor,
@@ -1352,10 +1350,8 @@ var SiteFooter = function (_a) {
1352
1350
  children && (React__default["default"].createElement("ul", { className: "arc-SiteFooter-secondaryItems" }, children)),
1353
1351
  React__default["default"].createElement("div", { className: "arc-SiteFooter-brand" },
1354
1352
  React__default["default"].createElement("div", { className: "arc-SiteFooter-copyright" },
1355
- React__default["default"].createElement("span", { className: "arc-SiteFooter-copyrightSymbol" }, "\u00A9"),
1356
- " ",
1357
- currentYear || new Date().getFullYear()),
1358
- React__default["default"].createElement(BrandLogo, { label: logoLabel, size: 32 }))))))));
1353
+ React__default["default"].createElement("span", { className: "arc-SiteFooter-copyrightSymbol" }, "\u00A9"), " ".concat(currentYear || new Date().getFullYear())),
1354
+ React__default["default"].createElement(BrandLogo, { label: logoLabel }))))))));
1359
1355
  };
1360
1356
  var SiteFooterItemGroup = function (_a) {
1361
1357
  var children = _a.children, title = _a.title;
@@ -1383,16 +1379,20 @@ SiteFooterItemGroup.displayName = "SiteFooter.ItemGroup";
1383
1379
  SiteFooter.ItemGroup = SiteFooterItemGroup;
1384
1380
 
1385
1381
  var SiteFooter_rehydrator = (function (el, rehydrateChildren) { return __awaiter(void 0, void 0, void 0, function () {
1386
- var children, props;
1387
- var _a;
1388
- return __generator(this, function (_b) {
1389
- switch (_b.label) {
1382
+ var children, titleElement, title, props;
1383
+ return __generator(this, function (_a) {
1384
+ switch (_a.label) {
1390
1385
  case 0: return [4 /*yield*/, rehydrateChildren(el.querySelector(".arc-SiteFooter-mainItems"))];
1391
1386
  case 1:
1392
- children = _b.sent();
1387
+ children = _a.sent();
1388
+ titleElement = el.querySelector(".arc-SiteFooter-title");
1389
+ title = "";
1390
+ if (titleElement) {
1391
+ title = titleElement.textContent || /* istanbul ignore next */ "";
1392
+ }
1393
1393
  props = {
1394
1394
  children: children,
1395
- title: ((_a = el.querySelector(".arc-SiteFooter-title")) === null || _a === void 0 ? void 0 : _a.textContent) || ""
1395
+ title: title
1396
1396
  };
1397
1397
  return [2 /*return*/, React__default["default"].createElement(SiteFooter.ItemGroup, __assign({}, props), children)];
1398
1398
  }
@@ -1410,7 +1410,8 @@ var Item = function (_a) {
1410
1410
  };
1411
1411
 
1412
1412
  var ItemGroup = function (_a) {
1413
- var children = _a.children, title = _a.title, props = __rest(_a, ["children", "title"]);
1413
+ var children = _a.children, href = _a.href, title = _a.title, viewAllTitle = _a.viewAllTitle, props = __rest(_a, ["children", "href", "title", "viewAllTitle"]);
1414
+ var _b = React.useState(false), hasClientSideJavaScript = _b[0], setHasClientSideJavaScript = _b[1];
1414
1415
  var isMinWidthArcBreakpointL = useMediaQuery("(min-width: ".concat(ArcBreakpointL, "px)"));
1415
1416
  React.useEffect(function () {
1416
1417
  React__default["default"].Children.map(children, function (item) {
@@ -1419,24 +1420,43 @@ var ItemGroup = function (_a) {
1419
1420
  }
1420
1421
  });
1421
1422
  }, [children]);
1423
+ React.useEffect(function () {
1424
+ // useEffect does not run in ReactDomServer renders
1425
+ setHasClientSideJavaScript(true);
1426
+ }, [setHasClientSideJavaScript]);
1422
1427
  return (React__default["default"].createElement("li", { className: "arc-SiteHeaderItemGroup" },
1423
1428
  React__default["default"].createElement("details", __assign({ className: "arc-SiteHeaderItemGroup-details", open: isMinWidthArcBreakpointL }, filterDataAttrs(props)),
1424
- React__default["default"].createElement("summary", { className: "arc-SiteHeaderItemGroup-summary", tabIndex: isMinWidthArcBreakpointL ? -1 : 0 },
1425
- React__default["default"].createElement("div", { className: "arc-SiteHeaderItemGroup-title" }, title)),
1426
- React__default["default"].createElement("ul", { className: "arc-SiteHeaderItemGroup-items" }, children))));
1429
+ React__default["default"].createElement("summary", { className: "arc-SiteHeaderItemGroup-summary", tabIndex: isMinWidthArcBreakpointL ? -1 : 0 }, href ? (React__default["default"].createElement("a", { className: "arc-SiteHeaderItemGroup-title", href: href, tabIndex: !hasClientSideJavaScript || isMinWidthArcBreakpointL ? 0 : -1 }, title)) : (React__default["default"].createElement("div", { className: "arc-SiteHeaderItemGroup-title" }, title))),
1430
+ React__default["default"].createElement("ul", { className: "arc-SiteHeaderItemGroup-items" },
1431
+ children,
1432
+ href ? (React__default["default"].createElement("li", { className: "arc-SiteHeaderItem arc-SiteHeaderItem--viewAll" },
1433
+ React__default["default"].createElement("a", { className: "arc-SiteHeaderItem-link", href: href }, viewAllTitle || "View all ".concat(title.toLowerCase())))) : null))));
1427
1434
  };
1428
1435
 
1429
1436
  var ItemGroupRehydrator = (function (el, hydrate) { return __awaiter(void 0, void 0, void 0, function () {
1430
- var children, props;
1431
- var _a;
1432
- return __generator(this, function (_b) {
1433
- switch (_b.label) {
1437
+ var children, titleElement, viewAllElement, title, href, viewAllTitle, props;
1438
+ return __generator(this, function (_a) {
1439
+ switch (_a.label) {
1434
1440
  case 0: return [4 /*yield*/, hydrate(el.querySelector(".arc-SiteHeaderItemGroup-items"))];
1435
1441
  case 1:
1436
- children = _b.sent();
1442
+ children = _a.sent();
1443
+ titleElement = el.querySelector(".arc-SiteHeaderItemGroup-title");
1444
+ viewAllElement = el.querySelector(".arc-SiteHeaderItem--viewAll");
1445
+ title = "";
1446
+ href = "";
1447
+ viewAllTitle = "";
1448
+ if (titleElement) {
1449
+ title = titleElement.textContent || /* istanbul ignore next */ "";
1450
+ href = titleElement.getAttribute("href") || /* istanbul ignore next */ "";
1451
+ }
1452
+ if (viewAllElement) {
1453
+ viewAllTitle = viewAllElement.textContent || /* istanbul ignore next */ "";
1454
+ }
1437
1455
  props = {
1438
1456
  children: children,
1439
- title: ((_a = el.querySelector(".arc-SiteHeaderItemGroup-title")) === null || _a === void 0 ? void 0 : _a.textContent) || ""
1457
+ href: href,
1458
+ title: title,
1459
+ viewAllTitle: viewAllTitle
1440
1460
  };
1441
1461
  return [2 /*return*/, React__default["default"].createElement(ItemGroup, __assign({}, props), children)];
1442
1462
  }
@@ -1466,7 +1486,7 @@ var BackButton = function (_a) {
1466
1486
 
1467
1487
  var Panel = function (_a) {
1468
1488
  var _b;
1469
- var children = _a.children, navItemRef = _a.navItemRef, _c = _a.open, open = _c === void 0 ? false : _c, promo = _a.promo, setOpen = _a.setOpen, subNavItemRef = _a.subNavItemRef, _d = _a.subNavLink, subNavLink = _d === void 0 ? "" : _d, title = _a.title, viewAll = _a.viewAll, withSubNav = _a.withSubNav, props = __rest(_a, ["children", "navItemRef", "open", "promo", "setOpen", "subNavItemRef", "subNavLink", "title", "viewAll", "withSubNav"]);
1489
+ var children = _a.children, navItemRef = _a.navItemRef, open = _a.open, promo = _a.promo, setOpen = _a.setOpen, subNavItemRef = _a.subNavItemRef, _c = _a.subNavLink, subNavLink = _c === void 0 ? "" : _c, title = _a.title, viewAll = _a.viewAll, withSubNav = _a.withSubNav, props = __rest(_a, ["children", "navItemRef", "open", "promo", "setOpen", "subNavItemRef", "subNavLink", "title", "viewAll", "withSubNav"]);
1470
1490
  var transparent = React.useContext(Context).transparent;
1471
1491
  React.useEffect(function () {
1472
1492
  // Where appropriate, close the Panel when clicking outside of it,
@@ -1576,7 +1596,7 @@ var NavItem = function (_a) {
1576
1596
  };
1577
1597
 
1578
1598
  var NavItemRehydrator = (function (el, hydrate) { return __awaiter(void 0, void 0, void 0, function () {
1579
- var children, promo, link, viewAll, props;
1599
+ var children, promo, link, viewAll, href, title, props;
1580
1600
  return __generator(this, function (_a) {
1581
1601
  switch (_a.label) {
1582
1602
  case 0:
@@ -1596,11 +1616,20 @@ var NavItemRehydrator = (function (el, hydrate) { return __awaiter(void 0, void
1596
1616
  case 4:
1597
1617
  link = el.querySelector(".arc-SiteHeaderNavItem-link");
1598
1618
  viewAll = el.querySelector(".arc-SiteHeaderPanel-viewAll");
1619
+ href = "";
1620
+ title = "";
1621
+ if (link) {
1622
+ title = link.textContent || /* istanbul ignore next */ "";
1623
+ href = link.getAttribute("href") || /* istanbul ignore next */ "";
1624
+ }
1625
+ if (viewAll) {
1626
+ href = viewAll.getAttribute("href") || /* istanbul ignore next */ "";
1627
+ }
1599
1628
  props = {
1600
- href: (link === null || link === void 0 ? void 0 : link.getAttribute("href")) || (viewAll === null || viewAll === void 0 ? void 0 : viewAll.getAttribute("href")) || undefined,
1629
+ href: href,
1601
1630
  isCurrent: el.classList.contains("arc-SiteHeaderNavItem--linkSelected") || undefined,
1602
1631
  promo: promo || undefined,
1603
- title: (link === null || link === void 0 ? void 0 : link.textContent) || "",
1632
+ title: title,
1604
1633
  viewAllTitle: (viewAll === null || viewAll === void 0 ? void 0 : viewAll.textContent) || undefined
1605
1634
  };
1606
1635
  return [2 /*return*/, React__default["default"].createElement(NavItem, __assign({}, props), children)];
@@ -1649,7 +1678,7 @@ var SubNavItem = function (_a) {
1649
1678
  };
1650
1679
 
1651
1680
  var SubNavItemRehydrator = (function (el, hydrate) { return __awaiter(void 0, void 0, void 0, function () {
1652
- var children, promo, link, props;
1681
+ var children, promo, link, href, title, props;
1653
1682
  return __generator(this, function (_a) {
1654
1683
  switch (_a.label) {
1655
1684
  case 0:
@@ -1668,11 +1697,17 @@ var SubNavItemRehydrator = (function (el, hydrate) { return __awaiter(void 0, vo
1668
1697
  _a.label = 4;
1669
1698
  case 4:
1670
1699
  link = el.querySelector(".arc-SiteHeaderSubNavItem-link");
1700
+ href = "";
1701
+ title = "";
1702
+ if (link) {
1703
+ href = link.getAttribute("href") || /* istanbul ignore next */ "";
1704
+ title = link.textContent || /* istanbul ignore next */ "";
1705
+ }
1671
1706
  props = {
1672
- href: (link === null || link === void 0 ? void 0 : link.getAttribute("href")) || "",
1707
+ href: href,
1673
1708
  isDefaultItem: Boolean(el.dataset.defaultItem),
1674
1709
  promo: promo || undefined,
1675
- title: (link === null || link === void 0 ? void 0 : link.textContent) || ""
1710
+ title: title
1676
1711
  };
1677
1712
  return [2 /*return*/, React__default["default"].createElement(SubNavItem, __assign({}, props), children)];
1678
1713
  }
@@ -1693,7 +1728,7 @@ var NavItemWithSubNav = function (_a) {
1693
1728
  if (item && item.type !== SubNavItem && item.type !== React.Fragment) {
1694
1729
  throw new Error("Illegal child passed to <SiteHeader.NavItemWithSubNav /> `slot1` prop. Ensure to only use <SiteHeader.SubNavItem />.");
1695
1730
  }
1696
- if (item === null || item === void 0 ? void 0 : item.props.isDefaultItem) {
1731
+ if (item.props.isDefaultItem) {
1697
1732
  setDefaultItem(false);
1698
1733
  }
1699
1734
  });
@@ -1701,7 +1736,7 @@ var NavItemWithSubNav = function (_a) {
1701
1736
  if (item && item.type !== SubNavItem && item.type !== React.Fragment) {
1702
1737
  throw new Error("Illegal child passed to <SiteHeader.NavItemWithSubNav /> `slot2` prop. Ensure to only use <SiteHeader.SubNavItem />.");
1703
1738
  }
1704
- if (item === null || item === void 0 ? void 0 : item.props.isDefaultItem) {
1739
+ if (item.props.isDefaultItem) {
1705
1740
  setDefaultItem(false);
1706
1741
  }
1707
1742
  });
@@ -1709,7 +1744,7 @@ var NavItemWithSubNav = function (_a) {
1709
1744
  if (item && item.type !== SubNavItem && item.type !== React.Fragment) {
1710
1745
  throw new Error("Illegal child passed to <SiteHeader.NavItemWithSubNav /> `slot3` prop. Ensure to only use <SiteHeader.SubNavItem />.");
1711
1746
  }
1712
- if (item === null || item === void 0 ? void 0 : item.props.isDefaultItem) {
1747
+ if (item.props.isDefaultItem) {
1713
1748
  setDefaultItem(false);
1714
1749
  }
1715
1750
  });
@@ -1739,7 +1774,7 @@ function wrap(el, wrapper) {
1739
1774
  wrapper.appendChild(el);
1740
1775
  }
1741
1776
  var NavItemWithSubNavRehydrator = (function (el, hydrate) { return __awaiter(void 0, void 0, void 0, function () {
1742
- var subNavItem1, subNavItem2, subNavItem3, div1, div2, slot1, slot2, slot3, div3, link, subTitle, viewAll, props;
1777
+ var subNavItem1, subNavItem2, subNavItem3, div1, div2, slot1, slot2, slot3, div3, link, subTitle, viewAll, title, props;
1743
1778
  return __generator(this, function (_a) {
1744
1779
  switch (_a.label) {
1745
1780
  case 0:
@@ -1770,13 +1805,17 @@ var NavItemWithSubNavRehydrator = (function (el, hydrate) { return __awaiter(voi
1770
1805
  link = el.querySelector(".arc-SiteHeaderNavItem-link");
1771
1806
  subTitle = el.querySelector(".arc-SiteHeaderPanel-title");
1772
1807
  viewAll = el.querySelector(".arc-SiteHeaderPanel-viewAll");
1808
+ title = "";
1809
+ if (link) {
1810
+ title = link.textContent || /* istanbul ignore next */ "";
1811
+ }
1773
1812
  props = {
1774
1813
  href: (viewAll === null || viewAll === void 0 ? void 0 : viewAll.getAttribute("href")) || undefined,
1775
- slot1: slot1 || undefined,
1776
- slot2: slot2 || undefined,
1814
+ slot1: slot1 || /* istanbul ignore next */ undefined,
1815
+ slot2: slot2 || /* istanbul ignore next */ undefined,
1777
1816
  slot3: slot3 || undefined,
1778
1817
  subTitle: (subTitle === null || subTitle === void 0 ? void 0 : subTitle.textContent) || undefined,
1779
- title: (link === null || link === void 0 ? void 0 : link.textContent) || "",
1818
+ title: title,
1780
1819
  viewAllTitle: (viewAll === null || viewAll === void 0 ? void 0 : viewAll.textContent) || undefined
1781
1820
  };
1782
1821
  return [2 /*return*/, React__default["default"].createElement(NavItemWithSubNav, __assign({}, props))];
@@ -1806,7 +1845,7 @@ var Provider = Context.Provider;
1806
1845
  */
1807
1846
  var SiteHeader = function (_a) {
1808
1847
  var _b;
1809
- var children = _a.children, _c = _a.basketHref, basketHref = _c === void 0 ? "/basket" : _c, _d = _a.hasBasket, hasBasket = _d === void 0 ? false : _d, _e = _a.hasLogin, hasLogin = _e === void 0 ? true : _e, _f = _a.isTransparent, isTransparent = _f === void 0 ? false : _f, _g = _a.loginHref, loginHref = _g === void 0 ? "/login" : _g, _h = _a.loginTitle, loginTitle = _h === void 0 ? "Login / Register" : _h, _j = _a.logoHref, logoHref = _j === void 0 ? "/" : _j, _k = _a.logoLabel, logoLabel = _k === void 0 ? "Home" : _k, search = _a.search, props = __rest(_a, ["children", "basketHref", "hasBasket", "hasLogin", "isTransparent", "loginHref", "loginTitle", "logoHref", "logoLabel", "search"]);
1848
+ var children = _a.children, _c = _a.basketHref, basketHref = _c === void 0 ? "/basket" : _c, _d = _a.hasBasket, hasBasket = _d === void 0 ? false : _d, _e = _a.hasLogin, hasLogin = _e === void 0 ? true : _e, _f = _a.isTransparent, isTransparent = _f === void 0 ? false : _f, _g = _a.loginHref, loginHref = _g === void 0 ? "/login" : _g, _h = _a.loginTitle, loginTitle = _h === void 0 ? "Login / Register" : _h, _j = _a.logoHref, logoHref = _j === void 0 ? "/" : _j, _k = _a.logoLabel, logoLabel = _k === void 0 ? "Home" : _k, search = _a.search, subBrand = _a.subBrand, props = __rest(_a, ["children", "basketHref", "hasBasket", "hasLogin", "isTransparent", "loginHref", "loginTitle", "logoHref", "logoLabel", "search", "subBrand"]);
1810
1849
  var _l = React.useState(false), hasClientSideJavaScript = _l[0], setHasClientSideJavaScript = _l[1];
1811
1850
  var _m = React.useState(false), menuOpen = _m[0], setMenuOpen = _m[1];
1812
1851
  var isMinWidthArcBreakpointL = useMediaQuery("(min-width: ".concat(ArcBreakpointL, "px)"));
@@ -1857,15 +1896,15 @@ var SiteHeader = function (_a) {
1857
1896
  : undefined },
1858
1897
  React__default["default"].createElement("div", { className: "arc-SiteHeader-inner" },
1859
1898
  React__default["default"].createElement("a", { className: "arc-SiteHeader-brand", href: logoHref },
1860
- React__default["default"].createElement(BrandLogo, { label: logoLabel, size: 34 })),
1861
- React__default["default"].createElement("nav", { className: "arc-SiteHeader-nav" }, children && (React__default["default"].createElement(React__default["default"].Fragment, null,
1899
+ React__default["default"].createElement(BrandLogo, { label: logoLabel, subBrand: subBrand })),
1900
+ children && (React__default["default"].createElement("nav", { className: "arc-SiteHeader-nav" },
1862
1901
  React__default["default"].createElement("div", { className: "arc-SiteHeader-menuButton" },
1863
1902
  React__default["default"].createElement(MenuButton, { menuOpen: menuOpen, setMenuOpen: setMenuOpen })),
1864
1903
  React__default["default"].createElement("div", { className: "arc-SiteHeader-main" },
1865
1904
  React__default["default"].createElement("ul", { className: "arc-SiteHeader-navItems" }, children),
1866
1905
  hasLogin && (React__default["default"].createElement("div", { className: "arc-SiteHeader-loginButton" },
1867
- React__default["default"].createElement(Button, { href: loginHref, isFullWidth: true, label: loginTitle }))))))),
1868
- (children || hasBasket || hasLogin || search) && (React__default["default"].createElement("div", { className: "arc-SiteHeader-secondary" },
1906
+ React__default["default"].createElement(Button, { href: loginHref, isFullWidth: true, label: loginTitle })))))),
1907
+ (hasBasket || hasLogin || search) && (React__default["default"].createElement("div", { className: "arc-SiteHeader-secondary" },
1869
1908
  search ? (React__default["default"].createElement("div", { className: "arc-SiteHeader-search" }, search)) : null,
1870
1909
  hasBasket ? (React__default["default"].createElement("a", { className: "arc-SiteHeader-basket", href: basketHref },
1871
1910
  React__default["default"].createElement(Icon, { icon: "btBasket", label: "Basket", size: 24 }))) : null,
@@ -1885,27 +1924,33 @@ SiteHeader.NavItemWithSubNav = NavItemWithSubNav;
1885
1924
  SiteHeader.SubNavItem = SubNavItem;
1886
1925
 
1887
1926
  var SiteHeaderRehydrator = function (el, hydrate) { return __awaiter(void 0, void 0, void 0, function () {
1888
- var children, search, basket, login, props;
1889
- var _a, _b;
1890
- return __generator(this, function (_c) {
1891
- switch (_c.label) {
1927
+ var children, search, basket, brand, login, logoHref, logoLabel, props;
1928
+ return __generator(this, function (_a) {
1929
+ switch (_a.label) {
1892
1930
  case 0:
1893
1931
  children = el.querySelector(".arc-SiteHeader-navItems");
1894
1932
  search = el.querySelector(".arc-SiteHeader-search");
1895
1933
  if (!children) return [3 /*break*/, 2];
1896
1934
  return [4 /*yield*/, hydrate(children)];
1897
1935
  case 1:
1898
- children = _c.sent();
1899
- _c.label = 2;
1936
+ children = _a.sent();
1937
+ _a.label = 2;
1900
1938
  case 2:
1901
1939
  if (!search) return [3 /*break*/, 4];
1902
1940
  return [4 /*yield*/, hydrate(search)];
1903
1941
  case 3:
1904
- search = _c.sent();
1905
- _c.label = 4;
1942
+ search = _a.sent();
1943
+ _a.label = 4;
1906
1944
  case 4:
1907
1945
  basket = el.querySelector(".arc-SiteHeader-basket");
1946
+ brand = el.querySelector(".arc-SiteHeader-brand");
1908
1947
  login = el.querySelector(".arc-SiteHeader-loginLink");
1948
+ logoHref = "";
1949
+ logoLabel = "";
1950
+ if (brand) {
1951
+ logoHref = brand.getAttribute("href") || /* istanbul ignore next */ "";
1952
+ logoLabel = brand.textContent || /* istanbul ignore next */ "";
1953
+ }
1909
1954
  props = {
1910
1955
  basketHref: (basket === null || basket === void 0 ? void 0 : basket.getAttribute("href")) || undefined,
1911
1956
  hasBasket: Boolean(basket),
@@ -1913,9 +1958,8 @@ var SiteHeaderRehydrator = function (el, hydrate) { return __awaiter(void 0, voi
1913
1958
  isTransparent: Boolean(el.dataset.transparent),
1914
1959
  loginHref: (login === null || login === void 0 ? void 0 : login.getAttribute("href")) || undefined,
1915
1960
  loginTitle: (login === null || login === void 0 ? void 0 : login.textContent) || undefined,
1916
- logoHref: ((_a = el.querySelector(".arc-SiteHeader-brand")) === null || _a === void 0 ? void 0 : _a.getAttribute("href")) ||
1917
- undefined,
1918
- logoLabel: ((_b = el.querySelector("arc-BrandLogo-text")) === null || _b === void 0 ? void 0 : _b.textContent) || undefined,
1961
+ logoHref: logoHref,
1962
+ logoLabel: logoLabel,
1919
1963
  search: search
1920
1964
  };
1921
1965
  return [2 /*return*/, React__default["default"].createElement(SiteHeader, __assign({}, props), children)];
@@ -1935,12 +1979,11 @@ var Text = function (_a) {
1935
1979
  var _c = _a.align, align = _c === void 0 ? "left" : _c, children = _a.children, _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, props = __rest(_a, ["align", "children", "isInline", "isMeasured", "size", "tone"]);
1936
1980
  var surface = React.useContext(Context$2).surface;
1937
1981
  return (React__default["default"].createElement("span", __assign({ className: classNames((_b = {
1938
- "arc-Text": true,
1939
- "arc-Text--alignCenter": align === "center",
1940
- "arc-Text--alignRight": align === "right",
1941
- "arc-Text--inline": isInline,
1942
- "arc-Text--measured": isMeasured
1982
+ "arc-Text": true
1943
1983
  },
1984
+ _b[suffixModifier("arc-Text--align", align)] = align !== "left",
1985
+ _b["arc-Text--inline"] = isInline,
1986
+ _b["arc-Text--measured"] = isMeasured,
1944
1987
  _b["arc-Text--size".concat(size && size.toUpperCase())] = size && size !== "m",
1945
1988
  _b["arc-Text--".concat(tone)] = tone !== "default",
1946
1989
  _b["arc-Text--onDarkSurface"] = surface === "dark",