@arc-ui/components 6.3.0 → 7.1.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
@@ -775,7 +775,7 @@ var useAriaDescribedby = function (_a) {
775
775
  * Detect interaction mode
776
776
  */
777
777
  var useInteractionMode = function () {
778
- var _a = React.useState(""), interactionMode = _a[0], setInteractionMode = _a[1];
778
+ var _a = React.useState("pointer"), interactionMode = _a[0], setInteractionMode = _a[1];
779
779
  React.useEffect(function () {
780
780
  var onKeyDown = function (event) {
781
781
  if (event.altKey || event.ctrlKey || event.metaKey) {
@@ -868,7 +868,7 @@ var useNumericInput = function (props) {
868
868
  */
869
869
  var Card = function (_a) {
870
870
  var _b;
871
- 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"]);
871
+ 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, linkData = _a.linkData, 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", "linkData", "minHeight", "target", "title", "titleSize"]);
872
872
  var surface = React.useContext(Context$3).surface;
873
873
  var interactionMode = useInteractionMode().interactionMode;
874
874
  var Wrapper = function (_a) {
@@ -888,7 +888,7 @@ var Card = function (_a) {
888
888
  React__default["default"].createElement("div", { className: "arc-Card-header" },
889
889
  React__default["default"].createElement("div", { className: "arc-Card-title" },
890
890
  React__default["default"].createElement(Heading, { size: titleSize },
891
- React__default["default"].createElement(CardLink, { actionId: actionId, fill: fill, href: href, stretch: true, target: target }, title))),
891
+ React__default["default"].createElement(CardLink, { actionId: actionId, fill: fill, href: href, linkData: linkData, stretch: true, target: target }, title))),
892
892
  coverImage),
893
893
  React__default["default"].createElement("div", { className: "arc-Card-children" },
894
894
  React__default["default"].createElement(Card.Block, null, children)),
@@ -915,11 +915,11 @@ Card.Block = CardBlock;
915
915
  * Internal `Card.Image` component to show an image within a Card.
916
916
  */
917
917
  var CardImage = function (_a) {
918
- var _b = _a.alt, alt = _b === void 0 ? "" : _b, _c = _a.height, height = _c === void 0 ? 176 : _c, src = _a.src, srcSet = _a.srcSet;
918
+ var _b = _a.alt, alt = _b === void 0 ? "" : _b, _c = _a.height, height = _c === void 0 ? 176 : _c, sizes = _a.sizes, src = _a.src, srcSet = _a.srcSet;
919
919
  return (React__default["default"].createElement("div", { className: classNames({
920
920
  "arc-Card-image": true
921
921
  }) },
922
- React__default["default"].createElement(Image, { alt: alt, fit: "cover", src: src, srcSet: srcSet, height: height })));
922
+ React__default["default"].createElement(Image, { alt: alt, fit: "cover", sizes: sizes, src: src, srcSet: srcSet, height: height })));
923
923
  };
924
924
  CardImage.displayName = "Card.Image";
925
925
  Card.Image = CardImage;
@@ -927,14 +927,14 @@ Card.Image = CardImage;
927
927
  * Internal `CardLink` component.
928
928
  */
929
929
  var CardLink = function (_a) {
930
- var actionId = _a.actionId, isButton = _a.isButton, children = _a.children, fill = _a.fill, href = _a.href, stretch = _a.stretch, target = _a.target;
930
+ var actionId = _a.actionId, isButton = _a.isButton, children = _a.children, fill = _a.fill, href = _a.href, _b = _a.linkData, linkData = _b === void 0 ? {} : _b, stretch = _a.stretch, target = _a.target;
931
931
  var surface = React.useContext(Context$3).surface;
932
- return (React__default["default"].createElement("a", { "aria-describedby": actionId, className: classNames({
932
+ return (React__default["default"].createElement("a", __assign({ "aria-describedby": actionId, className: classNames({
933
933
  "arc-Card-link": true,
934
934
  "arc-Card-link--button": isButton,
935
935
  "arc-Card-link--onDarkSurface": surface === "dark" && fill !== "neutral",
936
936
  "arc-Card-link--stretch": stretch
937
- }), href: href, rel: target === "_blank" ? "noopener noreferrer" : undefined, tabIndex: isButton ? -1 : undefined, target: target },
937
+ }), href: href, rel: target === "_blank" ? "noopener noreferrer" : undefined, tabIndex: isButton ? -1 : undefined, target: target }, filterDataAttrs(linkData)),
938
938
  React__default["default"].createElement("span", { className: "arc-Card-linkText" }, children),
939
939
  isButton && (React__default["default"].createElement("span", { className: "arc-Card-linkIcon" },
940
940
  React__default["default"].createElement(Icon, { icon: "btChevronRight2px", size: 8 })))));
@@ -1339,7 +1339,7 @@ var Section = function (_a) {
1339
1339
  * Use `SiteFooter` to display information at the bottom of a page.
1340
1340
  */
1341
1341
  var SiteFooter = function (_a) {
1342
- var children = _a.children, currentYear = _a.currentYear, logoLabel = _a.logoLabel, main = _a.main, siteName = _a.siteName, props = __rest(_a, ["children", "currentYear", "logoLabel", "main", "siteName"]);
1342
+ var children = _a.children, currentYear = _a.currentYear, _b = _a.curve, curve = _b === void 0 ? true : _b, logoLabel = _a.logoLabel, main = _a.main, siteName = _a.siteName, props = __rest(_a, ["children", "currentYear", "curve", "logoLabel", "main", "siteName"]);
1343
1343
  React.useEffect(function () {
1344
1344
  React__default["default"].Children.map(children, function (item) {
1345
1345
  if (item && item.type !== SiteFooterItem) {
@@ -1348,7 +1348,7 @@ var SiteFooter = function (_a) {
1348
1348
  });
1349
1349
  }, [children]);
1350
1350
  return (React__default["default"].createElement(React__default["default"].Fragment, null,
1351
- React__default["default"].createElement(Curve, { bottomColor: "brand-flat", from: "topLeft", size: "s" }),
1351
+ curve ? (React__default["default"].createElement(Curve, { bottomColor: "brand-flat", from: "topLeft", size: "s" })) : null,
1352
1352
  React__default["default"].createElement("footer", __assign({ className: "arc-SiteFooter" }, filterDataAttrs(props)),
1353
1353
  React__default["default"].createElement(Surface, { background: "brand-flat", paddingVertical: "24" },
1354
1354
  (siteName || main) && (React__default["default"].createElement(React__default["default"].Fragment, null,
@@ -1435,12 +1435,16 @@ var ItemGroup = function (_a) {
1435
1435
  // useEffect does not run in ReactDomServer renders
1436
1436
  setHasClientSideJavaScript(true);
1437
1437
  }, [setHasClientSideJavaScript]);
1438
+ var ElementType = "div";
1439
+ if (title) {
1440
+ ElementType = "details";
1441
+ }
1438
1442
  return (React__default["default"].createElement("li", { className: "arc-SiteHeaderItemGroup" },
1439
- React__default["default"].createElement("details", __assign({ className: "arc-SiteHeaderItemGroup-details", open: isMinWidthArcBreakpointL }, filterDataAttrs(props)),
1440
- 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))),
1443
+ React__default["default"].createElement(ElementType, __assign({ className: "arc-SiteHeaderItemGroup-details", open: Boolean(title && isMinWidthArcBreakpointL) }, filterDataAttrs(props)),
1444
+ title ? (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)))) : null,
1441
1445
  React__default["default"].createElement("ul", { className: "arc-SiteHeaderItemGroup-items" },
1442
1446
  children,
1443
- href ? (React__default["default"].createElement("li", { className: "arc-SiteHeaderItem arc-SiteHeaderItem--viewAll" },
1447
+ href && title ? (React__default["default"].createElement("li", { className: "arc-SiteHeaderItem arc-SiteHeaderItem--viewAll" },
1444
1448
  React__default["default"].createElement("a", { className: "arc-SiteHeaderItem-link", href: href }, viewAllTitle || "View all ".concat(title.toLowerCase())))) : null))));
1445
1449
  };
1446
1450