@arc-ui/components 1.1.0 → 1.2.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
@@ -347,6 +347,7 @@ const ArcIconSocialFacebook = "<svg viewBox=\"0 0 32 32\" xmlns=\"http://www.w3.
347
347
  const ArcIconSocialInstagram = "<svg viewBox=\"0 0 32 32\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M16 2c-3.803 0-4.278.018-5.771.084-1.491.07-2.506.305-3.399.651A6.856 6.856 0 004.35 4.35a6.83 6.83 0 00-1.615 2.48c-.346.893-.582 1.908-.651 3.399C2.014 11.722 2 12.197 2 16s.018 4.278.084 5.772c.07 1.49.305 2.506.651 3.398a6.86 6.86 0 001.615 2.48 6.846 6.846 0 002.48 1.615c.894.345 1.909.582 3.399.651 1.493.07 1.968.084 5.771.084s4.278-.017 5.772-.084c1.49-.07 2.506-.306 3.398-.65a6.881 6.881 0 002.48-1.616 6.836 6.836 0 001.615-2.48c.345-.892.582-1.909.651-3.398.07-1.494.084-1.969.084-5.772s-.017-4.278-.084-5.771c-.07-1.49-.306-2.508-.65-3.399a6.871 6.871 0 00-1.616-2.48 6.821 6.821 0 00-2.48-1.615c-.892-.346-1.909-.582-3.398-.651C20.278 2.014 19.803 2 16 2zm0 2.52c3.737 0 4.183.019 5.658.083 1.365.064 2.106.29 2.599.484.655.253 1.12.557 1.612 1.045.489.49.792.956 1.045 1.612.192.492.42 1.233.482 2.598.067 1.477.082 1.92.082 5.658 0 3.738-.018 4.183-.087 5.658-.07 1.365-.298 2.106-.49 2.599a4.445 4.445 0 01-1.05 1.612 4.368 4.368 0 01-1.61 1.045c-.49.192-1.242.42-2.607.482-1.486.067-1.924.082-5.669.082-3.746 0-4.184-.018-5.669-.087-1.366-.07-2.118-.298-2.608-.49a4.336 4.336 0 01-1.61-1.05 4.251 4.251 0 01-1.05-1.61c-.192-.49-.418-1.242-.49-2.607-.052-1.47-.07-1.924-.07-5.651 0-3.73.018-4.184.07-5.672.072-1.365.298-2.116.49-2.606.246-.665.56-1.12 1.05-1.611.49-.489.946-.804 1.61-1.048.49-.193 1.226-.421 2.59-.491 1.488-.052 1.926-.07 5.67-.07L16 4.52zm0 4.291A7.189 7.189 0 008.811 16 7.189 7.189 0 0016 23.19 7.189 7.189 0 0023.19 16 7.189 7.189 0 0016 8.811zm0 11.856A4.665 4.665 0 0111.333 16 4.665 4.665 0 0116 11.333 4.665 4.665 0 0120.667 16 4.665 4.665 0 0116 20.667zm9.154-12.14a1.681 1.681 0 01-3.36 0 1.68 1.68 0 013.36 0z\" fill=\"currentColor\"/></svg>";
348
348
  const ArcIconSocialLinkedin = "<svg viewBox=\"0 0 32 32\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M25.856 25.86H21.71v-6.496c0-1.55-.032-3.544-2.161-3.544-2.162 0-2.492 1.686-2.492 3.43v6.61H12.91V12.5h3.983v1.821h.053c.557-1.05 1.91-2.158 3.932-2.158 4.201 0 4.978 2.765 4.978 6.364v7.334zM8.226 10.673a2.406 2.406 0 01-2.406-2.41 2.408 2.408 0 112.407 2.41zm2.08 15.189H6.148V12.5h4.158v13.36zM27.929 2H4.066C2.924 2 2 2.903 2 4.017v23.966C2 29.098 2.924 30 4.066 30h23.86c1.14 0 2.074-.902 2.074-2.017V4.017C30 2.903 29.067 2 27.926 2h.003z\" fill=\"currentColor\"/></svg>";
349
349
  const ArcIconSocialTwitter = "<svg viewBox=\"0 0 32 32\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M29.945 7.331a11.667 11.667 0 01-3.295.905 5.784 5.784 0 002.523-3.177 11.856 11.856 0 01-3.648 1.381 5.74 5.74 0 00-9.93 3.918c0 .455.053.892.149 1.31-4.772-.224-9-2.515-11.83-5.98a5.625 5.625 0 00-.778 2.888 5.74 5.74 0 002.553 4.779 5.722 5.722 0 01-2.6-.719v.071a5.743 5.743 0 004.604 5.632 5.828 5.828 0 01-2.58.099 5.76 5.76 0 005.37 3.986 11.512 11.512 0 01-7.118 2.456c-.455 0-.909-.027-1.365-.078a16.327 16.327 0 008.816 2.577c10.563 0 16.332-8.745 16.332-16.317 0-.244 0-.49-.018-.735A11.59 11.59 0 0030 7.355l-.055-.024z\" fill=\"currentColor\"/></svg>";
350
+ const ArcIconSocialYouTube = "<svg viewBox=\"0 0 32 32\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M29.414 9.128a3.542 3.542 0 0 0-2.437-2.477c-2.18-.594-10.965-.594-10.965-.594s-8.76-.012-10.966.594A3.542 3.542 0 0 0 2.61 9.128 37.587 37.587 0 0 0 2 16.012c-.007 2.301.198 4.598.61 6.86a3.542 3.542 0 0 0 2.436 2.477c2.181.594 10.966.594 10.966.594s8.76 0 10.965-.594a3.542 3.542 0 0 0 2.437-2.477c.405-2.263.6-4.559.585-6.86a37.574 37.574 0 0 0-.585-6.884ZM13.21 20.272V11.74l7.31 4.272-7.31 4.26Z\" fill=\"currentColor\"/></svg>";
350
351
  const ArcColorBlack = "#000000";
351
352
  const ArcColorWhite = "#ffffff";
352
353
  const ArcColorDebug = "#cf3a8a";
@@ -1305,6 +1306,7 @@ const icons = [
1305
1306
  "arcSocialInstagram",
1306
1307
  "arcSocialLinkedin",
1307
1308
  "arcSocialTwitter",
1309
+ "arcSocialYouTube",
1308
1310
  "bt4G",
1309
1311
  "bt5G",
1310
1312
  "btAccessibility",
@@ -1797,7 +1799,7 @@ const BtGradientDarkPathwayBackgroundBrand = BtLinearGradient90;
1797
1799
 
1798
1800
  dist.ArcBreakpointL = ArcBreakpointL;
1799
1801
  dist.ArcBreakpointLPx = ArcBreakpointLPx;
1800
- dist.ArcBreakpointM = ArcBreakpointM;
1802
+ var ArcBreakpointM_1 = dist.ArcBreakpointM = ArcBreakpointM;
1801
1803
  dist.ArcBreakpointMPx = ArcBreakpointMPx;
1802
1804
  dist.ArcBreakpointS = ArcBreakpointS;
1803
1805
  dist.ArcBreakpointSPx = ArcBreakpointSPx;
@@ -1903,6 +1905,7 @@ dist.ArcIconSocialFacebook = ArcIconSocialFacebook;
1903
1905
  dist.ArcIconSocialInstagram = ArcIconSocialInstagram;
1904
1906
  dist.ArcIconSocialLinkedin = ArcIconSocialLinkedin;
1905
1907
  dist.ArcIconSocialTwitter = ArcIconSocialTwitter;
1908
+ dist.ArcIconSocialYouTube = ArcIconSocialYouTube;
1906
1909
  dist.ArcLeading = ArcLeading;
1907
1910
  dist.ArcLeadingPx = ArcLeadingPx;
1908
1911
  dist.ArcLineHeight01 = ArcLineHeight01;
@@ -3421,11 +3424,47 @@ var Section = function (_a) {
3421
3424
  }) }, filterDataAttrs(props)), children));
3422
3425
  };
3423
3426
 
3427
+ /**
3428
+ * @typedef MediaQueryOutputs
3429
+ * @param {boolean} matches - does the document match the media query?
3430
+ */
3431
+ /**
3432
+ * Handle with care!
3433
+ *
3434
+ * If you need to change something in the browser based on @media query, you
3435
+ * probably don’t need this hook. Use CSS media queries instead.
3436
+ *
3437
+ * Sometimes UI requirements are not achievable with CSS media queries alone. In
3438
+ * these rare cases, use this hook to make media query matches available
3439
+ * to React JavaScript code.
3440
+ *
3441
+ * @param {string} mediaQuery - the media query to parse
3442
+ * @returns {MediaQueryOutputs}
3443
+ */
3444
+ var useMediaQuery = function (mediaQuery) {
3445
+ var mediaQueryList = typeof window !== "undefined" ? window.matchMedia(mediaQuery) : undefined;
3446
+ var _a = React.useState(false), matches = _a[0], setMatches = _a[1];
3447
+ React.useEffect(function () {
3448
+ setMatches(typeof window !== "undefined"
3449
+ ? window.matchMedia(mediaQuery).matches
3450
+ : false);
3451
+ }, [mediaQuery]);
3452
+ React.useEffect(function () {
3453
+ var onMatchMedia = function (event) { return setMatches(event.matches); };
3454
+ // Using deprecated addListener methods here for IE & Safari 13 support
3455
+ if (mediaQueryList) {
3456
+ mediaQueryList.addListener(onMatchMedia);
3457
+ }
3458
+ return function () { return mediaQueryList && mediaQueryList.removeListener(onMatchMedia); };
3459
+ }, [mediaQueryList]);
3460
+ return matches;
3461
+ };
3462
+
3424
3463
  /**
3425
3464
  * Use `SiteFooter` to display information at the bottom of a page.
3426
3465
  */
3427
3466
  var SiteFooter = function (_a) {
3428
- var children = _a.children, currentYear = _a.currentYear, siteName = _a.siteName, props = __rest(_a, ["children", "currentYear", "siteName"]);
3467
+ var children = _a.children, currentYear = _a.currentYear, main = _a.main, siteName = _a.siteName, props = __rest(_a, ["children", "currentYear", "main", "siteName"]);
3429
3468
  React.useEffect(function () {
3430
3469
  React__default['default'].Children.map(children, function (item) {
3431
3470
  if (item && item.type !== SiteFooterItem) {
@@ -3434,21 +3473,37 @@ var SiteFooter = function (_a) {
3434
3473
  });
3435
3474
  }, [children]);
3436
3475
  return (React__default['default'].createElement(React__default['default'].Fragment, null,
3437
- React__default['default'].createElement(Curve, { bottomColor: "brand", size: "s" }),
3438
- React__default['default'].createElement("div", __assign({ className: "arc-SiteFooter" }, filterDataAttrs(props)),
3439
- React__default['default'].createElement(Surface, { background: "brand", paddingVertical: "16" },
3476
+ React__default['default'].createElement(Curve, { bottomColor: "brand-flat", size: "s" }),
3477
+ React__default['default'].createElement("footer", __assign({ className: "arc-SiteFooter" }, filterDataAttrs(props)),
3478
+ React__default['default'].createElement(Surface, { background: "brand-flat", paddingVertical: "24" },
3479
+ React__default['default'].createElement(Section, null,
3480
+ siteName && React__default['default'].createElement("div", { className: "arc-SiteFooter-name" }, siteName),
3481
+ main && React__default['default'].createElement("div", { className: "arc-SiteFooter-main" }, main)),
3482
+ (siteName || main) && React__default['default'].createElement("hr", { className: "arc-SiteFooter-rule" }),
3440
3483
  React__default['default'].createElement(Section, null,
3441
- children && React__default['default'].createElement("ul", { className: "arc-SiteFooter-items" }, children),
3442
- React__default['default'].createElement(Columns, null,
3443
- React__default['default'].createElement(Columns.Col, { span: 5 }, siteName && (React__default['default'].createElement(Align, { vertical: "center" },
3444
- React__default['default'].createElement("strong", null, siteName)))),
3445
- React__default['default'].createElement(Columns.Col, { span: 7 },
3446
- React__default['default'].createElement("div", { className: "arc-SiteFooter-brand" },
3447
- React__default['default'].createElement("div", { className: "arc-SiteFooter-copyright" },
3448
- React__default['default'].createElement("span", { className: "arc-SiteFooter-copyrightSymbol" }, "\u00A9"),
3449
- " ",
3450
- currentYear || new Date().getFullYear()),
3451
- React__default['default'].createElement(BrandLogo, { size: 32 })))))))));
3484
+ React__default['default'].createElement("div", { className: "arc-SiteFooter-secondary" },
3485
+ children && (React__default['default'].createElement("ul", { className: "arc-SiteFooter-secondaryItems" }, children)),
3486
+ React__default['default'].createElement("div", { className: "arc-SiteFooter-brand" },
3487
+ React__default['default'].createElement("div", { className: "arc-SiteFooter-copyright" },
3488
+ React__default['default'].createElement("span", { className: "arc-SiteFooter-copyrightSymbol" }, "\u00A9"),
3489
+ " ",
3490
+ currentYear || new Date().getFullYear()),
3491
+ React__default['default'].createElement(BrandLogo, { size: 32 }))))))));
3492
+ };
3493
+ var SiteFooterItemGroup = function (_a) {
3494
+ var children = _a.children, title = _a.title;
3495
+ var isMinWidthArcBreakpointM = useMediaQuery("(min-width: " + ArcBreakpointM_1 + "px)");
3496
+ React.useEffect(function () {
3497
+ React__default['default'].Children.map(children, function (item) {
3498
+ if (item && item.type !== SiteFooterItem) {
3499
+ throw new Error("Illegal child passed to <SiteFooterItemGroup />. Ensure to only use <SiteFooter.Item />.");
3500
+ }
3501
+ });
3502
+ }, [children]);
3503
+ return (React__default['default'].createElement("details", { className: "arc-SiteFooter-disclosure", open: isMinWidthArcBreakpointM || typeof window === "undefined" },
3504
+ React__default['default'].createElement("summary", { className: "arc-SiteFooter-summary", tabIndex: isMinWidthArcBreakpointM && typeof window !== "undefined" ? -1 : 0 },
3505
+ React__default['default'].createElement("h2", { className: "arc-SiteFooter-title" }, title)),
3506
+ React__default['default'].createElement("ul", { className: "arc-SiteFooter-mainItems" }, children)));
3452
3507
  };
3453
3508
  var SiteFooterItem = function (_a) {
3454
3509
  var children = _a.children, href = _a.href, props = __rest(_a, ["children", "href"]);
@@ -3457,6 +3512,8 @@ var SiteFooterItem = function (_a) {
3457
3512
  };
3458
3513
  SiteFooterItem.displayName = "SiteFooter.Item";
3459
3514
  SiteFooter.Item = SiteFooterItem;
3515
+ SiteFooterItemGroup.displayName = "SiteFooter.ItemGroup";
3516
+ SiteFooter.ItemGroup = SiteFooterItemGroup;
3460
3517
 
3461
3518
  /**
3462
3519
  * Use `SiteHeader` to display brand logo and navigation at the top of a page.