@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.es.js +73 -16
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +73 -16
- package/dist/index.js.map +1 -1
- package/dist/styles.bt.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.ee.css +1 -1
- package/dist/types/components/SiteFooter/SiteFooter.d.ts +19 -2
- package/dist/types/hooks/use-media-query.d.ts +19 -0
- package/package.json +3 -3
package/dist/index.es.js
CHANGED
|
@@ -339,6 +339,7 @@ const ArcIconSocialFacebook = "<svg viewBox=\"0 0 32 32\" xmlns=\"http://www.w3.
|
|
|
339
339
|
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>";
|
|
340
340
|
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>";
|
|
341
341
|
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>";
|
|
342
|
+
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>";
|
|
342
343
|
const ArcColorBlack = "#000000";
|
|
343
344
|
const ArcColorWhite = "#ffffff";
|
|
344
345
|
const ArcColorDebug = "#cf3a8a";
|
|
@@ -1297,6 +1298,7 @@ const icons = [
|
|
|
1297
1298
|
"arcSocialInstagram",
|
|
1298
1299
|
"arcSocialLinkedin",
|
|
1299
1300
|
"arcSocialTwitter",
|
|
1301
|
+
"arcSocialYouTube",
|
|
1300
1302
|
"bt4G",
|
|
1301
1303
|
"bt5G",
|
|
1302
1304
|
"btAccessibility",
|
|
@@ -1789,7 +1791,7 @@ const BtGradientDarkPathwayBackgroundBrand = BtLinearGradient90;
|
|
|
1789
1791
|
|
|
1790
1792
|
dist.ArcBreakpointL = ArcBreakpointL;
|
|
1791
1793
|
dist.ArcBreakpointLPx = ArcBreakpointLPx;
|
|
1792
|
-
dist.ArcBreakpointM = ArcBreakpointM;
|
|
1794
|
+
var ArcBreakpointM_1 = dist.ArcBreakpointM = ArcBreakpointM;
|
|
1793
1795
|
dist.ArcBreakpointMPx = ArcBreakpointMPx;
|
|
1794
1796
|
dist.ArcBreakpointS = ArcBreakpointS;
|
|
1795
1797
|
dist.ArcBreakpointSPx = ArcBreakpointSPx;
|
|
@@ -1895,6 +1897,7 @@ dist.ArcIconSocialFacebook = ArcIconSocialFacebook;
|
|
|
1895
1897
|
dist.ArcIconSocialInstagram = ArcIconSocialInstagram;
|
|
1896
1898
|
dist.ArcIconSocialLinkedin = ArcIconSocialLinkedin;
|
|
1897
1899
|
dist.ArcIconSocialTwitter = ArcIconSocialTwitter;
|
|
1900
|
+
dist.ArcIconSocialYouTube = ArcIconSocialYouTube;
|
|
1898
1901
|
dist.ArcLeading = ArcLeading;
|
|
1899
1902
|
dist.ArcLeadingPx = ArcLeadingPx;
|
|
1900
1903
|
dist.ArcLineHeight01 = ArcLineHeight01;
|
|
@@ -3413,11 +3416,47 @@ var Section = function (_a) {
|
|
|
3413
3416
|
}) }, filterDataAttrs(props)), children));
|
|
3414
3417
|
};
|
|
3415
3418
|
|
|
3419
|
+
/**
|
|
3420
|
+
* @typedef MediaQueryOutputs
|
|
3421
|
+
* @param {boolean} matches - does the document match the media query?
|
|
3422
|
+
*/
|
|
3423
|
+
/**
|
|
3424
|
+
* Handle with care!
|
|
3425
|
+
*
|
|
3426
|
+
* If you need to change something in the browser based on @media query, you
|
|
3427
|
+
* probably don’t need this hook. Use CSS media queries instead.
|
|
3428
|
+
*
|
|
3429
|
+
* Sometimes UI requirements are not achievable with CSS media queries alone. In
|
|
3430
|
+
* these rare cases, use this hook to make media query matches available
|
|
3431
|
+
* to React JavaScript code.
|
|
3432
|
+
*
|
|
3433
|
+
* @param {string} mediaQuery - the media query to parse
|
|
3434
|
+
* @returns {MediaQueryOutputs}
|
|
3435
|
+
*/
|
|
3436
|
+
var useMediaQuery = function (mediaQuery) {
|
|
3437
|
+
var mediaQueryList = typeof window !== "undefined" ? window.matchMedia(mediaQuery) : undefined;
|
|
3438
|
+
var _a = useState(false), matches = _a[0], setMatches = _a[1];
|
|
3439
|
+
useEffect(function () {
|
|
3440
|
+
setMatches(typeof window !== "undefined"
|
|
3441
|
+
? window.matchMedia(mediaQuery).matches
|
|
3442
|
+
: false);
|
|
3443
|
+
}, [mediaQuery]);
|
|
3444
|
+
useEffect(function () {
|
|
3445
|
+
var onMatchMedia = function (event) { return setMatches(event.matches); };
|
|
3446
|
+
// Using deprecated addListener methods here for IE & Safari 13 support
|
|
3447
|
+
if (mediaQueryList) {
|
|
3448
|
+
mediaQueryList.addListener(onMatchMedia);
|
|
3449
|
+
}
|
|
3450
|
+
return function () { return mediaQueryList && mediaQueryList.removeListener(onMatchMedia); };
|
|
3451
|
+
}, [mediaQueryList]);
|
|
3452
|
+
return matches;
|
|
3453
|
+
};
|
|
3454
|
+
|
|
3416
3455
|
/**
|
|
3417
3456
|
* Use `SiteFooter` to display information at the bottom of a page.
|
|
3418
3457
|
*/
|
|
3419
3458
|
var SiteFooter = function (_a) {
|
|
3420
|
-
var children = _a.children, currentYear = _a.currentYear, siteName = _a.siteName, props = __rest(_a, ["children", "currentYear", "siteName"]);
|
|
3459
|
+
var children = _a.children, currentYear = _a.currentYear, main = _a.main, siteName = _a.siteName, props = __rest(_a, ["children", "currentYear", "main", "siteName"]);
|
|
3421
3460
|
useEffect(function () {
|
|
3422
3461
|
React.Children.map(children, function (item) {
|
|
3423
3462
|
if (item && item.type !== SiteFooterItem) {
|
|
@@ -3426,21 +3465,37 @@ var SiteFooter = function (_a) {
|
|
|
3426
3465
|
});
|
|
3427
3466
|
}, [children]);
|
|
3428
3467
|
return (React.createElement(React.Fragment, null,
|
|
3429
|
-
React.createElement(Curve, { bottomColor: "brand", size: "s" }),
|
|
3430
|
-
React.createElement("
|
|
3431
|
-
React.createElement(Surface, { background: "brand", paddingVertical: "
|
|
3468
|
+
React.createElement(Curve, { bottomColor: "brand-flat", size: "s" }),
|
|
3469
|
+
React.createElement("footer", __assign({ className: "arc-SiteFooter" }, filterDataAttrs(props)),
|
|
3470
|
+
React.createElement(Surface, { background: "brand-flat", paddingVertical: "24" },
|
|
3471
|
+
React.createElement(Section, null,
|
|
3472
|
+
siteName && React.createElement("div", { className: "arc-SiteFooter-name" }, siteName),
|
|
3473
|
+
main && React.createElement("div", { className: "arc-SiteFooter-main" }, main)),
|
|
3474
|
+
(siteName || main) && React.createElement("hr", { className: "arc-SiteFooter-rule" }),
|
|
3432
3475
|
React.createElement(Section, null,
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
React.createElement(
|
|
3436
|
-
React.createElement("
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3476
|
+
React.createElement("div", { className: "arc-SiteFooter-secondary" },
|
|
3477
|
+
children && (React.createElement("ul", { className: "arc-SiteFooter-secondaryItems" }, children)),
|
|
3478
|
+
React.createElement("div", { className: "arc-SiteFooter-brand" },
|
|
3479
|
+
React.createElement("div", { className: "arc-SiteFooter-copyright" },
|
|
3480
|
+
React.createElement("span", { className: "arc-SiteFooter-copyrightSymbol" }, "\u00A9"),
|
|
3481
|
+
" ",
|
|
3482
|
+
currentYear || new Date().getFullYear()),
|
|
3483
|
+
React.createElement(BrandLogo, { size: 32 }))))))));
|
|
3484
|
+
};
|
|
3485
|
+
var SiteFooterItemGroup = function (_a) {
|
|
3486
|
+
var children = _a.children, title = _a.title;
|
|
3487
|
+
var isMinWidthArcBreakpointM = useMediaQuery("(min-width: " + ArcBreakpointM_1 + "px)");
|
|
3488
|
+
useEffect(function () {
|
|
3489
|
+
React.Children.map(children, function (item) {
|
|
3490
|
+
if (item && item.type !== SiteFooterItem) {
|
|
3491
|
+
throw new Error("Illegal child passed to <SiteFooterItemGroup />. Ensure to only use <SiteFooter.Item />.");
|
|
3492
|
+
}
|
|
3493
|
+
});
|
|
3494
|
+
}, [children]);
|
|
3495
|
+
return (React.createElement("details", { className: "arc-SiteFooter-disclosure", open: isMinWidthArcBreakpointM || typeof window === "undefined" },
|
|
3496
|
+
React.createElement("summary", { className: "arc-SiteFooter-summary", tabIndex: isMinWidthArcBreakpointM && typeof window !== "undefined" ? -1 : 0 },
|
|
3497
|
+
React.createElement("h2", { className: "arc-SiteFooter-title" }, title)),
|
|
3498
|
+
React.createElement("ul", { className: "arc-SiteFooter-mainItems" }, children)));
|
|
3444
3499
|
};
|
|
3445
3500
|
var SiteFooterItem = function (_a) {
|
|
3446
3501
|
var children = _a.children, href = _a.href, props = __rest(_a, ["children", "href"]);
|
|
@@ -3449,6 +3504,8 @@ var SiteFooterItem = function (_a) {
|
|
|
3449
3504
|
};
|
|
3450
3505
|
SiteFooterItem.displayName = "SiteFooter.Item";
|
|
3451
3506
|
SiteFooter.Item = SiteFooterItem;
|
|
3507
|
+
SiteFooterItemGroup.displayName = "SiteFooter.ItemGroup";
|
|
3508
|
+
SiteFooter.ItemGroup = SiteFooterItemGroup;
|
|
3452
3509
|
|
|
3453
3510
|
/**
|
|
3454
3511
|
* Use `SiteHeader` to display brand logo and navigation at the top of a page.
|