@xyo-network/react-footer 2.64.9 → 2.65.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/package.json +6 -6
- package/dist/browser/AlwaysLinks.cjs +0 -64
- package/dist/browser/AlwaysLinks.cjs.map +0 -1
- package/dist/browser/AlwaysLinks.js +0 -43
- package/dist/browser/AlwaysLinks.js.map +0 -1
- package/dist/browser/Footer.cjs +0 -94
- package/dist/browser/Footer.cjs.map +0 -1
- package/dist/browser/Footer.js +0 -73
- package/dist/browser/Footer.js.map +0 -1
- package/dist/browser/Link.cjs +0 -53
- package/dist/browser/Link.cjs.map +0 -1
- package/dist/browser/Link.js +0 -32
- package/dist/browser/Link.js.map +0 -1
- package/dist/browser/Links.cjs +0 -35
- package/dist/browser/Links.cjs.map +0 -1
- package/dist/browser/Links.js +0 -14
- package/dist/browser/Links.js.map +0 -1
- package/dist/browser/Xyo/AlwaysLinks.cjs +0 -104
- package/dist/browser/Xyo/AlwaysLinks.cjs.map +0 -1
- package/dist/browser/Xyo/AlwaysLinks.js +0 -81
- package/dist/browser/Xyo/AlwaysLinks.js.map +0 -1
- package/dist/browser/Xyo/DeveloperLinks.cjs +0 -76
- package/dist/browser/Xyo/DeveloperLinks.cjs.map +0 -1
- package/dist/browser/Xyo/DeveloperLinks.js +0 -53
- package/dist/browser/Xyo/DeveloperLinks.js.map +0 -1
- package/dist/browser/Xyo/Footer.cjs +0 -213
- package/dist/browser/Xyo/Footer.cjs.map +0 -1
- package/dist/browser/Xyo/Footer.js +0 -192
- package/dist/browser/Xyo/Footer.js.map +0 -1
- package/dist/browser/Xyo/MoreLinks.cjs +0 -74
- package/dist/browser/Xyo/MoreLinks.cjs.map +0 -1
- package/dist/browser/Xyo/MoreLinks.js +0 -51
- package/dist/browser/Xyo/MoreLinks.js.map +0 -1
- package/dist/browser/Xyo/NetworkLinks.cjs +0 -75
- package/dist/browser/Xyo/NetworkLinks.cjs.map +0 -1
- package/dist/browser/Xyo/NetworkLinks.js +0 -52
- package/dist/browser/Xyo/NetworkLinks.js.map +0 -1
- package/dist/browser/Xyo/SocialLinks.cjs +0 -84
- package/dist/browser/Xyo/SocialLinks.cjs.map +0 -1
- package/dist/browser/Xyo/SocialLinks.js +0 -63
- package/dist/browser/Xyo/SocialLinks.js.map +0 -1
- package/dist/browser/Xyo/SupportLinks.cjs +0 -73
- package/dist/browser/Xyo/SupportLinks.cjs.map +0 -1
- package/dist/browser/Xyo/SupportLinks.js +0 -50
- package/dist/browser/Xyo/SupportLinks.js.map +0 -1
- package/dist/browser/Xyo/TokenLinks.cjs +0 -76
- package/dist/browser/Xyo/TokenLinks.cjs.map +0 -1
- package/dist/browser/Xyo/TokenLinks.js +0 -53
- package/dist/browser/Xyo/TokenLinks.js.map +0 -1
- package/dist/browser/Xyo/index.cjs +0 -253
- package/dist/browser/Xyo/index.cjs.map +0 -1
- package/dist/browser/Xyo/index.js +0 -230
- package/dist/browser/Xyo/index.js.map +0 -1
- package/dist/browser/lib/copyrightLinkTitle.cjs +0 -29
- package/dist/browser/lib/copyrightLinkTitle.cjs.map +0 -1
- package/dist/browser/lib/copyrightLinkTitle.js +0 -8
- package/dist/browser/lib/copyrightLinkTitle.js.map +0 -1
- package/dist/browser/lib/index.cjs +0 -31
- package/dist/browser/lib/index.cjs.map +0 -1
- package/dist/browser/lib/index.js +0 -8
- package/dist/browser/lib/index.js.map +0 -1
- package/dist/docs.json +0 -71093
- package/dist/node/AlwaysLinks.cjs +0 -68
- package/dist/node/AlwaysLinks.cjs.map +0 -1
- package/dist/node/AlwaysLinks.js +0 -43
- package/dist/node/AlwaysLinks.js.map +0 -1
- package/dist/node/Footer.cjs +0 -98
- package/dist/node/Footer.cjs.map +0 -1
- package/dist/node/Footer.js +0 -73
- package/dist/node/Footer.js.map +0 -1
- package/dist/node/Link.cjs +0 -57
- package/dist/node/Link.cjs.map +0 -1
- package/dist/node/Link.js +0 -32
- package/dist/node/Link.js.map +0 -1
- package/dist/node/Links.cjs +0 -39
- package/dist/node/Links.cjs.map +0 -1
- package/dist/node/Links.js +0 -14
- package/dist/node/Links.js.map +0 -1
- package/dist/node/Xyo/AlwaysLinks.cjs +0 -109
- package/dist/node/Xyo/AlwaysLinks.cjs.map +0 -1
- package/dist/node/Xyo/AlwaysLinks.js +0 -81
- package/dist/node/Xyo/AlwaysLinks.js.map +0 -1
- package/dist/node/Xyo/DeveloperLinks.cjs +0 -80
- package/dist/node/Xyo/DeveloperLinks.cjs.map +0 -1
- package/dist/node/Xyo/DeveloperLinks.js +0 -53
- package/dist/node/Xyo/DeveloperLinks.js.map +0 -1
- package/dist/node/Xyo/Footer.cjs +0 -217
- package/dist/node/Xyo/Footer.cjs.map +0 -1
- package/dist/node/Xyo/Footer.js +0 -192
- package/dist/node/Xyo/Footer.js.map +0 -1
- package/dist/node/Xyo/MoreLinks.cjs +0 -78
- package/dist/node/Xyo/MoreLinks.cjs.map +0 -1
- package/dist/node/Xyo/MoreLinks.js +0 -51
- package/dist/node/Xyo/MoreLinks.js.map +0 -1
- package/dist/node/Xyo/NetworkLinks.cjs +0 -79
- package/dist/node/Xyo/NetworkLinks.cjs.map +0 -1
- package/dist/node/Xyo/NetworkLinks.js +0 -52
- package/dist/node/Xyo/NetworkLinks.js.map +0 -1
- package/dist/node/Xyo/SocialLinks.cjs +0 -88
- package/dist/node/Xyo/SocialLinks.cjs.map +0 -1
- package/dist/node/Xyo/SocialLinks.js +0 -63
- package/dist/node/Xyo/SocialLinks.js.map +0 -1
- package/dist/node/Xyo/SupportLinks.cjs +0 -77
- package/dist/node/Xyo/SupportLinks.cjs.map +0 -1
- package/dist/node/Xyo/SupportLinks.js +0 -50
- package/dist/node/Xyo/SupportLinks.js.map +0 -1
- package/dist/node/Xyo/TokenLinks.cjs +0 -80
- package/dist/node/Xyo/TokenLinks.cjs.map +0 -1
- package/dist/node/Xyo/TokenLinks.js +0 -53
- package/dist/node/Xyo/TokenLinks.js.map +0 -1
- package/dist/node/Xyo/index.cjs +0 -265
- package/dist/node/Xyo/index.cjs.map +0 -1
- package/dist/node/Xyo/index.js +0 -230
- package/dist/node/Xyo/index.js.map +0 -1
- package/dist/node/lib/copyrightLinkTitle.cjs +0 -33
- package/dist/node/lib/copyrightLinkTitle.cjs.map +0 -1
- package/dist/node/lib/copyrightLinkTitle.js +0 -8
- package/dist/node/lib/copyrightLinkTitle.js.map +0 -1
- package/dist/node/lib/index.cjs +0 -35
- package/dist/node/lib/index.cjs.map +0 -1
- package/dist/node/lib/index.js +0 -8
- package/dist/node/lib/index.js.map +0 -1
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/AlwaysLinks.tsx
|
|
21
|
-
var AlwaysLinks_exports = {};
|
|
22
|
-
__export(AlwaysLinks_exports, {
|
|
23
|
-
FooterAlwaysLinks: () => FooterAlwaysLinks
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(AlwaysLinks_exports);
|
|
26
|
-
var import_icons_material = require("@mui/icons-material");
|
|
27
|
-
var import_react_flexbox = require("@xylabs/react-flexbox");
|
|
28
|
-
|
|
29
|
-
// src/Link.tsx
|
|
30
|
-
var import_assert = require("@xylabs/assert");
|
|
31
|
-
var import_react_link = require("@xylabs/react-link");
|
|
32
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
-
var convertToBetaIfNeeded = (url, currentUrl = new URL(document.location.href)) => {
|
|
34
|
-
const urlObj = typeof url === "string" ? new URL(url) : url;
|
|
35
|
-
const currentUrlObj = typeof currentUrl === "string" ? new URL(currentUrl) : currentUrl;
|
|
36
|
-
const currentHostnameParts = currentUrlObj.hostname.split(".");
|
|
37
|
-
const beta = currentHostnameParts.shift() === "beta";
|
|
38
|
-
if (beta) {
|
|
39
|
-
const currentHostnameWithoutBeta = currentHostnameParts.join(".");
|
|
40
|
-
if (currentHostnameWithoutBeta === urlObj.hostname) {
|
|
41
|
-
urlObj.hostname = currentUrlObj.hostname;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return urlObj;
|
|
45
|
-
};
|
|
46
|
-
var FooterLink = ({ target, href, margin = 0.5, variant = "body2", ...props }) => {
|
|
47
|
-
const url = new URL((0, import_assert.assertEx)(href, "href not set"));
|
|
48
|
-
(0, import_assert.assertEx)(url.hostname, "Hostname is required in href");
|
|
49
|
-
const convertedUrl = convertToBetaIfNeeded(url);
|
|
50
|
-
if (document.location.hostname === convertedUrl.hostname) {
|
|
51
|
-
const to = url.search.length > 0 ? `${convertedUrl.pathname}${convertedUrl.search}` : url.pathname;
|
|
52
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_link.LinkEx, { margin, to, target, variant, ...props });
|
|
53
|
-
} else {
|
|
54
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_link.LinkEx, { margin, href, target: target ?? "_blank", variant, ...props });
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
// src/AlwaysLinks.tsx
|
|
59
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
60
|
-
var FooterAlwaysLinks = ({ style, footerLinks, onMore, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react_flexbox.FlexRow, { flexWrap: "wrap", textTransform: "uppercase", style: { opacity: 0.6, ...style }, ...props, children: [
|
|
61
|
-
footerLinks == null ? void 0 : footerLinks.map((footerLink, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(FooterLink, { noWrap: true, paddingX: 1, margin: 0, ...footerLink, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: footerLink.title }) }, index)),
|
|
62
|
-
onMore ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_flexbox.FlexRow, { style: { cursor: "pointer" }, paddingX: 0.5, onClick: onMore, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.MoreHoriz, { color: "primary", fontSize: "small" }) }) : null
|
|
63
|
-
] });
|
|
64
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
65
|
-
0 && (module.exports = {
|
|
66
|
-
FooterAlwaysLinks
|
|
67
|
-
});
|
|
68
|
-
//# sourceMappingURL=AlwaysLinks.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/AlwaysLinks.tsx","../../src/Link.tsx"],"sourcesContent":["import { MoreHoriz as MoreHorizIcon } from '@mui/icons-material'\nimport { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'\nimport { LinkExProps } from '@xylabs/react-link'\n\nimport { FooterLink } from './Link'\n\nexport interface FooterAlwaysLinksProps extends FlexBoxProps {\n footerLinks?: LinkExProps[]\n onMore?: () => void\n}\n\nexport const FooterAlwaysLinks: React.FC<FooterAlwaysLinksProps> = ({ style, footerLinks, onMore, ...props }) => (\n <FlexRow flexWrap=\"wrap\" textTransform=\"uppercase\" style={{ opacity: 0.6, ...style }} {...props}>\n {footerLinks?.map((footerLink, index) => (\n <FooterLink noWrap key={index} paddingX={1} margin={0} {...footerLink}>\n <small>{footerLink.title}</small>\n </FooterLink>\n ))}\n {onMore ? (\n <FlexRow style={{ cursor: 'pointer' }} paddingX={0.5} onClick={onMore}>\n <MoreHorizIcon color=\"primary\" fontSize=\"small\" />\n </FlexRow>\n ) : null}\n </FlexRow>\n)\n","import { assertEx } from '@xylabs/assert'\nimport { LinkEx, LinkExProps } from '@xylabs/react-link'\n\n/**\n * @description\n * FooterLink automatically uses a local To if the link is to the current domain\n * If the link is not local, it defaults to target being _blank\n * In the case of 'beta' domains, it navigates correctly\n */\n\nconst convertToBetaIfNeeded = (url: string | URL, currentUrl = new URL(document.location.href)) => {\n const urlObj = typeof url === 'string' ? new URL(url) : url\n const currentUrlObj = typeof currentUrl === 'string' ? new URL(currentUrl) : currentUrl\n const currentHostnameParts = currentUrlObj.hostname.split('.')\n const beta = currentHostnameParts.shift() === 'beta'\n if (beta) {\n const currentHostnameWithoutBeta = currentHostnameParts.join('.')\n if (currentHostnameWithoutBeta === urlObj.hostname) {\n urlObj.hostname = currentUrlObj.hostname\n }\n }\n return urlObj\n}\n\nexport const FooterLink: React.FC<LinkExProps> = ({ target, href, margin = 0.5, variant = 'body2', ...props }) => {\n const url = new URL(assertEx(href, 'href not set'))\n assertEx(url.hostname, 'Hostname is required in href')\n const convertedUrl = convertToBetaIfNeeded(url)\n if (document.location.hostname === convertedUrl.hostname) {\n const to = url.search.length > 0 ? `${convertedUrl.pathname}${convertedUrl.search}` : url.pathname\n return <LinkEx margin={margin} to={to} target={target} variant={variant} {...props} />\n } else {\n return <LinkEx margin={margin} href={href} target={target ?? '_blank'} variant={variant} {...props} />\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA2C;AAC3C,2BAAsC;;;ACDtC,oBAAyB;AACzB,wBAAoC;AA6BzB;AApBX,IAAM,wBAAwB,CAAC,KAAmB,aAAa,IAAI,IAAI,SAAS,SAAS,I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,SACC,6CAAC,gCAAQ,OAAO,EAAE,QAAQ,UAAU,GAAG,UAAU,KAAK,SAAS,QAC7D,uDAAC,sBAAAC,WAAA,EAAc,OAAM,WAAU,UAAS,SAAQ,GAClD,IACE;AAAA,GACN;","names":["import_jsx_runtime","MoreHorizIcon"]}
|
package/dist/node/AlwaysLinks.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
// src/AlwaysLinks.tsx
|
|
2
|
-
import { MoreHoriz as MoreHorizIcon } from "@mui/icons-material";
|
|
3
|
-
import { FlexRow } from "@xylabs/react-flexbox";
|
|
4
|
-
|
|
5
|
-
// src/Link.tsx
|
|
6
|
-
import { assertEx } from "@xylabs/assert";
|
|
7
|
-
import { LinkEx } from "@xylabs/react-link";
|
|
8
|
-
import { jsx } from "react/jsx-runtime";
|
|
9
|
-
var convertToBetaIfNeeded = (url, currentUrl = new URL(document.location.href)) => {
|
|
10
|
-
const urlObj = typeof url === "string" ? new URL(url) : url;
|
|
11
|
-
const currentUrlObj = typeof currentUrl === "string" ? new URL(currentUrl) : currentUrl;
|
|
12
|
-
const currentHostnameParts = currentUrlObj.hostname.split(".");
|
|
13
|
-
const beta = currentHostnameParts.shift() === "beta";
|
|
14
|
-
if (beta) {
|
|
15
|
-
const currentHostnameWithoutBeta = currentHostnameParts.join(".");
|
|
16
|
-
if (currentHostnameWithoutBeta === urlObj.hostname) {
|
|
17
|
-
urlObj.hostname = currentUrlObj.hostname;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return urlObj;
|
|
21
|
-
};
|
|
22
|
-
var FooterLink = ({ target, href, margin = 0.5, variant = "body2", ...props }) => {
|
|
23
|
-
const url = new URL(assertEx(href, "href not set"));
|
|
24
|
-
assertEx(url.hostname, "Hostname is required in href");
|
|
25
|
-
const convertedUrl = convertToBetaIfNeeded(url);
|
|
26
|
-
if (document.location.hostname === convertedUrl.hostname) {
|
|
27
|
-
const to = url.search.length > 0 ? `${convertedUrl.pathname}${convertedUrl.search}` : url.pathname;
|
|
28
|
-
return /* @__PURE__ */ jsx(LinkEx, { margin, to, target, variant, ...props });
|
|
29
|
-
} else {
|
|
30
|
-
return /* @__PURE__ */ jsx(LinkEx, { margin, href, target: target ?? "_blank", variant, ...props });
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
// src/AlwaysLinks.tsx
|
|
35
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
36
|
-
var FooterAlwaysLinks = ({ style, footerLinks, onMore, ...props }) => /* @__PURE__ */ jsxs(FlexRow, { flexWrap: "wrap", textTransform: "uppercase", style: { opacity: 0.6, ...style }, ...props, children: [
|
|
37
|
-
footerLinks == null ? void 0 : footerLinks.map((footerLink, index) => /* @__PURE__ */ jsx2(FooterLink, { noWrap: true, paddingX: 1, margin: 0, ...footerLink, children: /* @__PURE__ */ jsx2("small", { children: footerLink.title }) }, index)),
|
|
38
|
-
onMore ? /* @__PURE__ */ jsx2(FlexRow, { style: { cursor: "pointer" }, paddingX: 0.5, onClick: onMore, children: /* @__PURE__ */ jsx2(MoreHorizIcon, { color: "primary", fontSize: "small" }) }) : null
|
|
39
|
-
] });
|
|
40
|
-
export {
|
|
41
|
-
FooterAlwaysLinks
|
|
42
|
-
};
|
|
43
|
-
//# sourceMappingURL=AlwaysLinks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/AlwaysLinks.tsx","../../src/Link.tsx"],"sourcesContent":["import { MoreHoriz as MoreHorizIcon } from '@mui/icons-material'\nimport { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'\nimport { LinkExProps } from '@xylabs/react-link'\n\nimport { FooterLink } from './Link'\n\nexport interface FooterAlwaysLinksProps extends FlexBoxProps {\n footerLinks?: LinkExProps[]\n onMore?: () => void\n}\n\nexport const FooterAlwaysLinks: React.FC<FooterAlwaysLinksProps> = ({ style, footerLinks, onMore, ...props }) => (\n <FlexRow flexWrap=\"wrap\" textTransform=\"uppercase\" style={{ opacity: 0.6, ...style }} {...props}>\n {footerLinks?.map((footerLink, index) => (\n <FooterLink noWrap key={index} paddingX={1} margin={0} {...footerLink}>\n <small>{footerLink.title}</small>\n </FooterLink>\n ))}\n {onMore ? (\n <FlexRow style={{ cursor: 'pointer' }} paddingX={0.5} onClick={onMore}>\n <MoreHorizIcon color=\"primary\" fontSize=\"small\" />\n </FlexRow>\n ) : null}\n </FlexRow>\n)\n","import { assertEx } from '@xylabs/assert'\nimport { LinkEx, LinkExProps } from '@xylabs/react-link'\n\n/**\n * @description\n * FooterLink automatically uses a local To if the link is to the current domain\n * If the link is not local, it defaults to target being _blank\n * In the case of 'beta' domains, it navigates correctly\n */\n\nconst convertToBetaIfNeeded = (url: string | URL, currentUrl = new URL(document.location.href)) => {\n const urlObj = typeof url === 'string' ? new URL(url) : url\n const currentUrlObj = typeof currentUrl === 'string' ? new URL(currentUrl) : currentUrl\n const currentHostnameParts = currentUrlObj.hostname.split('.')\n const beta = currentHostnameParts.shift() === 'beta'\n if (beta) {\n const currentHostnameWithoutBeta = currentHostnameParts.join('.')\n if (currentHostnameWithoutBeta === urlObj.hostname) {\n urlObj.hostname = currentUrlObj.hostname\n }\n }\n return urlObj\n}\n\nexport const FooterLink: React.FC<LinkExProps> = ({ target, href, margin = 0.5, variant = 'body2', ...props }) => {\n const url = new URL(assertEx(href, 'href not set'))\n assertEx(url.hostname, 'Hostname is required in href')\n const convertedUrl = convertToBetaIfNeeded(url)\n if (document.location.hostname === convertedUrl.hostname) {\n const to = url.search.length > 0 ? `${convertedUrl.pathname}${convertedUrl.search}` : url.pathname\n return <LinkEx margin={margin} to={to} target={target} variant={variant} {...props} />\n } else {\n return <LinkEx margin={margin} href={href} target={target ?? '_blank'} variant={variant} {...props} />\n }\n}\n"],"mappings":";AAAA,SAAS,aAAa,qBAAqB;AAC3C,SAAuB,eAAe;;;ACDtC,SAAS,gBAAgB;AACzB,SAAS,cAA2B;AA6BzB;AApBX,IAAM,wBAAwB,CAA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0BAAAA,KAAC,WAAO,qBAAW,OAAM,KADH,KAExB;AAAA,EAED,SACC,gBAAAA,KAAC,WAAQ,OAAO,EAAE,QAAQ,UAAU,GAAG,UAAU,KAAK,SAAS,QAC7D,0BAAAA,KAAC,iBAAc,OAAM,WAAU,UAAS,SAAQ,GAClD,IACE;AAAA,GACN;","names":["jsx"]}
|
package/dist/node/Footer.cjs
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/Footer.tsx
|
|
21
|
-
var Footer_exports = {};
|
|
22
|
-
__export(Footer_exports, {
|
|
23
|
-
Footer: () => Footer
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(Footer_exports);
|
|
26
|
-
var import_material = require("@mui/material");
|
|
27
|
-
var import_react_flexbox2 = require("@xylabs/react-flexbox");
|
|
28
|
-
var import_react = require("react");
|
|
29
|
-
|
|
30
|
-
// src/AlwaysLinks.tsx
|
|
31
|
-
var import_icons_material = require("@mui/icons-material");
|
|
32
|
-
var import_react_flexbox = require("@xylabs/react-flexbox");
|
|
33
|
-
|
|
34
|
-
// src/Link.tsx
|
|
35
|
-
var import_assert = require("@xylabs/assert");
|
|
36
|
-
var import_react_link = require("@xylabs/react-link");
|
|
37
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
38
|
-
var convertToBetaIfNeeded = (url, currentUrl = new URL(document.location.href)) => {
|
|
39
|
-
const urlObj = typeof url === "string" ? new URL(url) : url;
|
|
40
|
-
const currentUrlObj = typeof currentUrl === "string" ? new URL(currentUrl) : currentUrl;
|
|
41
|
-
const currentHostnameParts = currentUrlObj.hostname.split(".");
|
|
42
|
-
const beta = currentHostnameParts.shift() === "beta";
|
|
43
|
-
if (beta) {
|
|
44
|
-
const currentHostnameWithoutBeta = currentHostnameParts.join(".");
|
|
45
|
-
if (currentHostnameWithoutBeta === urlObj.hostname) {
|
|
46
|
-
urlObj.hostname = currentUrlObj.hostname;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return urlObj;
|
|
50
|
-
};
|
|
51
|
-
var FooterLink = ({ target, href, margin = 0.5, variant = "body2", ...props }) => {
|
|
52
|
-
const url = new URL((0, import_assert.assertEx)(href, "href not set"));
|
|
53
|
-
(0, import_assert.assertEx)(url.hostname, "Hostname is required in href");
|
|
54
|
-
const convertedUrl = convertToBetaIfNeeded(url);
|
|
55
|
-
if (document.location.hostname === convertedUrl.hostname) {
|
|
56
|
-
const to = url.search.length > 0 ? `${convertedUrl.pathname}${convertedUrl.search}` : url.pathname;
|
|
57
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_link.LinkEx, { margin, to, target, variant, ...props });
|
|
58
|
-
} else {
|
|
59
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_link.LinkEx, { margin, href, target: target ?? "_blank", variant, ...props });
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
// src/AlwaysLinks.tsx
|
|
64
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
65
|
-
var FooterAlwaysLinks = ({ style, footerLinks, onMore, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react_flexbox.FlexRow, { flexWrap: "wrap", textTransform: "uppercase", style: { opacity: 0.6, ...style }, ...props, children: [
|
|
66
|
-
footerLinks == null ? void 0 : footerLinks.map((footerLink, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(FooterLink, { noWrap: true, paddingX: 1, margin: 0, ...footerLink, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: footerLink.title }) }, index)),
|
|
67
|
-
onMore ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_flexbox.FlexRow, { style: { cursor: "pointer" }, paddingX: 0.5, onClick: onMore, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.MoreHoriz, { color: "primary", fontSize: "small" }) }) : null
|
|
68
|
-
] });
|
|
69
|
-
|
|
70
|
-
// src/Footer.tsx
|
|
71
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
72
|
-
var Footer = ({ alwaysFooterLinksProps, children, container, dynamicHeight = false, ...props }) => {
|
|
73
|
-
const [more, setMore] = (0, import_react.useState)(false);
|
|
74
|
-
const onMore = () => {
|
|
75
|
-
setMore(!more);
|
|
76
|
-
};
|
|
77
|
-
const theme = (0, import_material.useTheme)();
|
|
78
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
79
|
-
import_react_flexbox2.FlexCol,
|
|
80
|
-
{
|
|
81
|
-
alignItems: "stretch",
|
|
82
|
-
onMouseLeave: () => {
|
|
83
|
-
setMore(false);
|
|
84
|
-
},
|
|
85
|
-
...props,
|
|
86
|
-
children: [
|
|
87
|
-
more && dynamicHeight ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_flexbox2.FlexCol, { alignItems: "stretch", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_flexbox2.FlexRow, { bottom: -1, position: "absolute", width: "100%", bgcolor: theme.palette.background.default, children: container && container !== "none" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material.Container, { children }) : children }) }) : null,
|
|
88
|
-
!dynamicHeight ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_flexbox2.FlexCol, { alignItems: "stretch", children: container && container !== "none" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material.Container, { children }) : children }) : null,
|
|
89
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_flexbox2.FlexRow, { children: container && container !== "none" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material.Container, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FooterAlwaysLinks, { ...alwaysFooterLinksProps, onMore: dynamicHeight ? onMore : void 0 }) }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FooterAlwaysLinks, { ...alwaysFooterLinksProps, onMore: dynamicHeight ? onMore : void 0 }) })
|
|
90
|
-
]
|
|
91
|
-
}
|
|
92
|
-
);
|
|
93
|
-
};
|
|
94
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
95
|
-
0 && (module.exports = {
|
|
96
|
-
Footer
|
|
97
|
-
});
|
|
98
|
-
//# sourceMappingURL=Footer.cjs.map
|
package/dist/node/Footer.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Footer.tsx","../../src/AlwaysLinks.tsx","../../src/Link.tsx"],"sourcesContent":["import { Container, ContainerProps, useTheme } from '@mui/material'\nimport { FlexBoxProps, FlexCol, FlexRow } from '@xylabs/react-flexbox'\nimport { useState } from 'react'\n\nimport { FooterAlwaysLinks, FooterAlwaysLinksProps } from './AlwaysLinks'\n\nexport interface FooterProps extends FlexBoxProps {\n alwaysFooterLinksProps?: FooterAlwaysLinksProps\n container?: ContainerProps['maxWidth'] | 'none'\n dynamicHeight?: boolean\n}\n\nexport const Footer: React.FC<FooterProps> = ({ alwaysFooterLinksProps, children, container, dynamicHeight = false, ...props }) => {\n const [more, setMore] = useState(false)\n const onMore = () => {\n setMore(!more)\n }\n\n const theme = useTheme()\n\n return (\n <FlexCol\n alignItems=\"stretch\"\n onMouseLeave={() => {\n setMore(false)\n }}\n {...props}\n >\n {more && dynamicHeight ? (\n <FlexCol alignItems=\"stretch\">\n <FlexRow bottom={-1} position=\"absolute\" width=\"100%\" bgcolor={theme.palette.background.default}>\n {container && container !== 'none' ? <Container>{children}</Container> : children}\n </FlexRow>\n </FlexCol>\n ) : null}\n {!dynamicHeight ? (\n <FlexCol alignItems=\"stretch\">{container && container !== 'none' ? <Container>{children}</Container> : children}</FlexCol>\n ) : null}\n <FlexRow>\n {container && container !== 'none' ? (\n <Container>\n <FooterAlwaysLinks {...alwaysFooterLinksProps} onMore={dynamicHeight ? onMore : undefined} />\n </Container>\n ) : (\n <FooterAlwaysLinks {...alwaysFooterLinksProps} onMore={dynamicHeight ? onMore : undefined} />\n )}\n </FlexRow>\n </FlexCol>\n )\n}\n","import { MoreHoriz as MoreHorizIcon } from '@mui/icons-material'\nimport { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'\nimport { LinkExProps } from '@xylabs/react-link'\n\nimport { FooterLink } from './Link'\n\nexport interface FooterAlwaysLinksProps extends FlexBoxProps {\n footerLinks?: LinkExProps[]\n onMore?: () => void\n}\n\nexport const FooterAlwaysLinks: React.FC<FooterAlwaysLinksProps> = ({ style, footerLinks, onMore, ...props }) => (\n <FlexRow flexWrap=\"wrap\" textTransform=\"uppercase\" style={{ opacity: 0.6, ...style }} {...props}>\n {footerLinks?.map((footerLink, index) => (\n <FooterLink noWrap key={index} paddingX={1} margin={0} {...footerLink}>\n <small>{footerLink.title}</small>\n </FooterLink>\n ))}\n {onMore ? (\n <FlexRow style={{ cursor: 'pointer' }} paddingX={0.5} onClick={onMore}>\n <MoreHorizIcon color=\"primary\" fontSize=\"small\" />\n </FlexRow>\n ) : null}\n </FlexRow>\n)\n","import { assertEx } from '@xylabs/assert'\nimport { LinkEx, LinkExProps } from '@xylabs/react-link'\n\n/**\n * @description\n * FooterLink automatically uses a local To if the link is to the current domain\n * If the link is not local, it defaults to target being _blank\n * In the case of 'beta' domains, it navigates correctly\n */\n\nconst convertToBetaIfNeeded = (url: string | URL, currentUrl = new URL(document.location.href)) => {\n const urlObj = typeof url === 'string' ? new URL(url) : url\n const currentUrlObj = typeof currentUrl === 'string' ? new URL(currentUrl) : currentUrl\n const currentHostnameParts = currentUrlObj.hostname.split('.')\n const beta = currentHostnameParts.shift() === 'beta'\n if (beta) {\n const currentHostnameWithoutBeta = currentHostnameParts.join('.')\n if (currentHostnameWithoutBeta === urlObj.hostname) {\n urlObj.hostname = currentUrlObj.hostname\n }\n }\n return urlObj\n}\n\nexport const FooterLink: React.FC<LinkExProps> = ({ target, href, margin = 0.5, variant = 'body2', ...props }) => {\n const url = new URL(assertEx(href, 'href not set'))\n assertEx(url.hostname, 'Hostname is required in href')\n const convertedUrl = convertToBetaIfNeeded(url)\n if (document.location.hostname === convertedUrl.hostname) {\n const to = url.search.length > 0 ? `${convertedUrl.pathname}${convertedUrl.search}` : url.pathname\n return <LinkEx margin={margin} to={to} target={target} variant={variant} {...props} />\n } else {\n return <LinkEx margin={margin} href={href} target={target ?? '_blank'} variant={variant} {...props} />\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAoD;AACpD,IAAAA,wBAA+C;AAC/C,mBAAyB;;;ACFzB,4BAA2C;AAC3C,2BAAsC;;;ACDtC,oBAAyB;AACzB,wBAAoC;AA6BzB;AApBX,IAAM,wBAAwB,CAAC,KAAmB,aAAa,IAAI,IAAI,SAAS,SAAS,IAAI,MAAM;AACjG,QAAM,SAAS,OAAO,QAAQ,WAAW,IAAI,IAAI,GAAG,IAAI;AACxD,QAAM,gBAAgB,OAAO,eAAe,WAAW,IAAI,IAAI,UAAU,IAAI;AA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IACE;AAAA,GACN;;;ADFE,IAAAC,sBAAA;AATG,IAAM,SAAgC,CAAC,EAAE,wBAAwB,UAAU,WAAW,gBAAgB,OAAO,GAAG,MAAM,MAAM;AACjI,QAAM,CAAC,MAAM,OAAO,QAAI,uBAAS,KAAK;AACtC,QAAM,SAAS,MAAM;AACnB,YAAQ,CAAC,IAAI;AAAA,EACf;AAEA,QAAM,YAAQ,0BAAS;AAEvB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,YAAW;AAAA,MACX,cAAc,MAAM;AAClB,gBAAQ,KAAK;AAAA,MACf;AAAA,MACC,GAAG;AAAA,MAEH;AAAA,gBAAQ,gBACP,6CAAC,iCAAQ,YAAW,WAClB,uDAAC,iCAAQ,QAAQ,IAAI,UAAS,YAAW,OAAM,QAAO,SAAS,MAAM,QAAQ,WAAW,SACrF,uBAAa,cAAc,SAAS,6CAAC,6BAAW,UAAS,IAAe,UAC3E,GACF,IACE;AAAA,QACH,CAAC,gBACA,6CAAC,iCAAQ,YAAW,WAAW,uBAAa,cAAc,SAAS,6CAAC,6BAAW,UAAS,IAAe,UAAS,IAC9G;AAAA,QACJ,6CAAC,iCACE,uBAAa,cAAc,SAC1B,6CAAC,6BACC,uDAAC,qBAAmB,GAAG,wBAAwB,QAAQ,gBAAgB,SAAS,QAAW,GAC7F,IAEA,6CAAC,qBAAmB,GAAG,wBAAwB,QAAQ,gBAAgB,SAAS,QAAW,GAE/F;AAAA;AAAA;AAAA,EACF;AAEJ;","names":["import_react_flexbox","import_jsx_runtime","MoreHorizIcon","import_jsx_runtime"]}
|
package/dist/node/Footer.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
// src/Footer.tsx
|
|
2
|
-
import { Container, useTheme } from "@mui/material";
|
|
3
|
-
import { FlexCol, FlexRow as FlexRow2 } from "@xylabs/react-flexbox";
|
|
4
|
-
import { useState } from "react";
|
|
5
|
-
|
|
6
|
-
// src/AlwaysLinks.tsx
|
|
7
|
-
import { MoreHoriz as MoreHorizIcon } from "@mui/icons-material";
|
|
8
|
-
import { FlexRow } from "@xylabs/react-flexbox";
|
|
9
|
-
|
|
10
|
-
// src/Link.tsx
|
|
11
|
-
import { assertEx } from "@xylabs/assert";
|
|
12
|
-
import { LinkEx } from "@xylabs/react-link";
|
|
13
|
-
import { jsx } from "react/jsx-runtime";
|
|
14
|
-
var convertToBetaIfNeeded = (url, currentUrl = new URL(document.location.href)) => {
|
|
15
|
-
const urlObj = typeof url === "string" ? new URL(url) : url;
|
|
16
|
-
const currentUrlObj = typeof currentUrl === "string" ? new URL(currentUrl) : currentUrl;
|
|
17
|
-
const currentHostnameParts = currentUrlObj.hostname.split(".");
|
|
18
|
-
const beta = currentHostnameParts.shift() === "beta";
|
|
19
|
-
if (beta) {
|
|
20
|
-
const currentHostnameWithoutBeta = currentHostnameParts.join(".");
|
|
21
|
-
if (currentHostnameWithoutBeta === urlObj.hostname) {
|
|
22
|
-
urlObj.hostname = currentUrlObj.hostname;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return urlObj;
|
|
26
|
-
};
|
|
27
|
-
var FooterLink = ({ target, href, margin = 0.5, variant = "body2", ...props }) => {
|
|
28
|
-
const url = new URL(assertEx(href, "href not set"));
|
|
29
|
-
assertEx(url.hostname, "Hostname is required in href");
|
|
30
|
-
const convertedUrl = convertToBetaIfNeeded(url);
|
|
31
|
-
if (document.location.hostname === convertedUrl.hostname) {
|
|
32
|
-
const to = url.search.length > 0 ? `${convertedUrl.pathname}${convertedUrl.search}` : url.pathname;
|
|
33
|
-
return /* @__PURE__ */ jsx(LinkEx, { margin, to, target, variant, ...props });
|
|
34
|
-
} else {
|
|
35
|
-
return /* @__PURE__ */ jsx(LinkEx, { margin, href, target: target ?? "_blank", variant, ...props });
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
// src/AlwaysLinks.tsx
|
|
40
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
41
|
-
var FooterAlwaysLinks = ({ style, footerLinks, onMore, ...props }) => /* @__PURE__ */ jsxs(FlexRow, { flexWrap: "wrap", textTransform: "uppercase", style: { opacity: 0.6, ...style }, ...props, children: [
|
|
42
|
-
footerLinks == null ? void 0 : footerLinks.map((footerLink, index) => /* @__PURE__ */ jsx2(FooterLink, { noWrap: true, paddingX: 1, margin: 0, ...footerLink, children: /* @__PURE__ */ jsx2("small", { children: footerLink.title }) }, index)),
|
|
43
|
-
onMore ? /* @__PURE__ */ jsx2(FlexRow, { style: { cursor: "pointer" }, paddingX: 0.5, onClick: onMore, children: /* @__PURE__ */ jsx2(MoreHorizIcon, { color: "primary", fontSize: "small" }) }) : null
|
|
44
|
-
] });
|
|
45
|
-
|
|
46
|
-
// src/Footer.tsx
|
|
47
|
-
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
48
|
-
var Footer = ({ alwaysFooterLinksProps, children, container, dynamicHeight = false, ...props }) => {
|
|
49
|
-
const [more, setMore] = useState(false);
|
|
50
|
-
const onMore = () => {
|
|
51
|
-
setMore(!more);
|
|
52
|
-
};
|
|
53
|
-
const theme = useTheme();
|
|
54
|
-
return /* @__PURE__ */ jsxs2(
|
|
55
|
-
FlexCol,
|
|
56
|
-
{
|
|
57
|
-
alignItems: "stretch",
|
|
58
|
-
onMouseLeave: () => {
|
|
59
|
-
setMore(false);
|
|
60
|
-
},
|
|
61
|
-
...props,
|
|
62
|
-
children: [
|
|
63
|
-
more && dynamicHeight ? /* @__PURE__ */ jsx3(FlexCol, { alignItems: "stretch", children: /* @__PURE__ */ jsx3(FlexRow2, { bottom: -1, position: "absolute", width: "100%", bgcolor: theme.palette.background.default, children: container && container !== "none" ? /* @__PURE__ */ jsx3(Container, { children }) : children }) }) : null,
|
|
64
|
-
!dynamicHeight ? /* @__PURE__ */ jsx3(FlexCol, { alignItems: "stretch", children: container && container !== "none" ? /* @__PURE__ */ jsx3(Container, { children }) : children }) : null,
|
|
65
|
-
/* @__PURE__ */ jsx3(FlexRow2, { children: container && container !== "none" ? /* @__PURE__ */ jsx3(Container, { children: /* @__PURE__ */ jsx3(FooterAlwaysLinks, { ...alwaysFooterLinksProps, onMore: dynamicHeight ? onMore : void 0 }) }) : /* @__PURE__ */ jsx3(FooterAlwaysLinks, { ...alwaysFooterLinksProps, onMore: dynamicHeight ? onMore : void 0 }) })
|
|
66
|
-
]
|
|
67
|
-
}
|
|
68
|
-
);
|
|
69
|
-
};
|
|
70
|
-
export {
|
|
71
|
-
Footer
|
|
72
|
-
};
|
|
73
|
-
//# sourceMappingURL=Footer.js.map
|
package/dist/node/Footer.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Footer.tsx","../../src/AlwaysLinks.tsx","../../src/Link.tsx"],"sourcesContent":["import { Container, ContainerProps, useTheme } from '@mui/material'\nimport { FlexBoxProps, FlexCol, FlexRow } from '@xylabs/react-flexbox'\nimport { useState } from 'react'\n\nimport { FooterAlwaysLinks, FooterAlwaysLinksProps } from './AlwaysLinks'\n\nexport interface FooterProps extends FlexBoxProps {\n alwaysFooterLinksProps?: FooterAlwaysLinksProps\n container?: ContainerProps['maxWidth'] | 'none'\n dynamicHeight?: boolean\n}\n\nexport const Footer: React.FC<FooterProps> = ({ alwaysFooterLinksProps, children, container, dynamicHeight = false, ...props }) => {\n const [more, setMore] = useState(false)\n const onMore = () => {\n setMore(!more)\n }\n\n const theme = useTheme()\n\n return (\n <FlexCol\n alignItems=\"stretch\"\n onMouseLeave={() => {\n setMore(false)\n }}\n {...props}\n >\n {more && dynamicHeight ? (\n <FlexCol alignItems=\"stretch\">\n <FlexRow bottom={-1} position=\"absolute\" width=\"100%\" bgcolor={theme.palette.background.default}>\n {container && container !== 'none' ? <Container>{children}</Container> : children}\n </FlexRow>\n </FlexCol>\n ) : null}\n {!dynamicHeight ? (\n <FlexCol alignItems=\"stretch\">{container && container !== 'none' ? <Container>{children}</Container> : children}</FlexCol>\n ) : null}\n <FlexRow>\n {container && container !== 'none' ? (\n <Container>\n <FooterAlwaysLinks {...alwaysFooterLinksProps} onMore={dynamicHeight ? onMore : undefined} />\n </Container>\n ) : (\n <FooterAlwaysLinks {...alwaysFooterLinksProps} onMore={dynamicHeight ? onMore : undefined} />\n )}\n </FlexRow>\n </FlexCol>\n )\n}\n","import { MoreHoriz as MoreHorizIcon } from '@mui/icons-material'\nimport { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'\nimport { LinkExProps } from '@xylabs/react-link'\n\nimport { FooterLink } from './Link'\n\nexport interface FooterAlwaysLinksProps extends FlexBoxProps {\n footerLinks?: LinkExProps[]\n onMore?: () => void\n}\n\nexport const FooterAlwaysLinks: React.FC<FooterAlwaysLinksProps> = ({ style, footerLinks, onMore, ...props }) => (\n <FlexRow flexWrap=\"wrap\" textTransform=\"uppercase\" style={{ opacity: 0.6, ...style }} {...props}>\n {footerLinks?.map((footerLink, index) => (\n <FooterLink noWrap key={index} paddingX={1} margin={0} {...footerLink}>\n <small>{footerLink.title}</small>\n </FooterLink>\n ))}\n {onMore ? (\n <FlexRow style={{ cursor: 'pointer' }} paddingX={0.5} onClick={onMore}>\n <MoreHorizIcon color=\"primary\" fontSize=\"small\" />\n </FlexRow>\n ) : null}\n </FlexRow>\n)\n","import { assertEx } from '@xylabs/assert'\nimport { LinkEx, LinkExProps } from '@xylabs/react-link'\n\n/**\n * @description\n * FooterLink automatically uses a local To if the link is to the current domain\n * If the link is not local, it defaults to target being _blank\n * In the case of 'beta' domains, it navigates correctly\n */\n\nconst convertToBetaIfNeeded = (url: string | URL, currentUrl = new URL(document.location.href)) => {\n const urlObj = typeof url === 'string' ? new URL(url) : url\n const currentUrlObj = typeof currentUrl === 'string' ? new URL(currentUrl) : currentUrl\n const currentHostnameParts = currentUrlObj.hostname.split('.')\n const beta = currentHostnameParts.shift() === 'beta'\n if (beta) {\n const currentHostnameWithoutBeta = currentHostnameParts.join('.')\n if (currentHostnameWithoutBeta === urlObj.hostname) {\n urlObj.hostname = currentUrlObj.hostname\n }\n }\n return urlObj\n}\n\nexport const FooterLink: React.FC<LinkExProps> = ({ target, href, margin = 0.5, variant = 'body2', ...props }) => {\n const url = new URL(assertEx(href, 'href not set'))\n assertEx(url.hostname, 'Hostname is required in href')\n const convertedUrl = convertToBetaIfNeeded(url)\n if (document.location.hostname === convertedUrl.hostname) {\n const to = url.search.length > 0 ? `${convertedUrl.pathname}${convertedUrl.search}` : url.pathname\n return <LinkEx margin={margin} to={to} target={target} variant={variant} {...props} />\n } else {\n return <LinkEx margin={margin} href={href} target={target ?? '_blank'} variant={variant} {...props} />\n }\n}\n"],"mappings":";AAAA,SAAS,WAA2B,gBAAgB;AACpD,SAAuB,SAAS,WAAAA,gBAAe;AAC/C,SAAS,gBAAgB;;;ACFzB,SAAS,aAAa,qBAAqB;AAC3C,SAAuB,eAAe;;;ACDtC,SAAS,gBAAgB;AACzB,SAAS,cAA2B;AA6BzB;AApBX,IAAM,wBAAwB,CAAC,KAAmB,aAAa,IAAI,IAAI,SAAS,SAAS,IAAI,MAAM;AACjG,QAAM,SAAS,OAAO,QAAQ,WAAW,IAAI,IAAI,GAAG,IAAI;AACxD,QAAM,gBAAgB,OAAO,eAAe,WAAW,IAAI,IAAI,UAAU,IAAI;AAC7E,QAAM,uBAAuB,cAAc,SAAS,MAAM,GAAG;AAC7D,QAAM,OAAO,qBAAqB,MAAM,MAAM;AAC9C,MAAI,MAAM;AACR,UAAM,6BAA6B,qBAAqB,KAAK,GAAG;AAChE,QAAI,+BAA+B,OAAO,UAAU;AAClD,aAAO,WAAW,cAAc;AAAA,IAClC;AAAA,EACF;AACA,SAAO;AACT;AAEO,IAAM,aAAoC,CAAC,EAAE,QAAQ,MAAM,SAAS,KAAK,UAAU,SAAS,GAAG,MAAM,MAAM;AAChH,QAAM,MAAM,IAAI,IAAI,SAAS,MAAM,cAAc,CAAC;AAClD,WAAS,IAAI,UAAU,8BAA8B;AACrD,QAAM,eAAe,sBAAsB,GAAG;AAC9C,MAAI,SAAS,SA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AQ,YAAW,WAClB,0BAAAA,KAACE,UAAA,EAAQ,QAAQ,IAAI,UAAS,YAAW,OAAM,QAAO,SAAS,MAAM,QAAQ,WAAW,SACrF,uBAAa,cAAc,SAAS,gBAAAF,KAAC,aAAW,UAAS,IAAe,UAC3E,GACF,IACE;AAAA,QACH,CAAC,gBACA,gBAAAA,KAAC,WAAQ,YAAW,WAAW,uBAAa,cAAc,SAAS,gBAAAA,KAAC,aAAW,UAAS,IAAe,UAAS,IAC9G;AAAA,QACJ,gBAAAA,KAACE,UAAA,EACE,uBAAa,cAAc,SAC1B,gBAAAF,KAAC,aACC,0BAAAA,KAAC,qBAAmB,GAAG,wBAAwB,QAAQ,gBAAgB,SAAS,QAAW,GAC7F,IAEA,gBAAAA,KAAC,qBAAmB,GAAG,wBAAwB,QAAQ,gBAAgB,SAAS,QAAW,GAE/F;AAAA;AAAA;AAAA,EACF;AAEJ;","names":["FlexRow","jsx","jsx","jsxs","FlexRow"]}
|
package/dist/node/Link.cjs
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/Link.tsx
|
|
21
|
-
var Link_exports = {};
|
|
22
|
-
__export(Link_exports, {
|
|
23
|
-
FooterLink: () => FooterLink
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(Link_exports);
|
|
26
|
-
var import_assert = require("@xylabs/assert");
|
|
27
|
-
var import_react_link = require("@xylabs/react-link");
|
|
28
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
-
var convertToBetaIfNeeded = (url, currentUrl = new URL(document.location.href)) => {
|
|
30
|
-
const urlObj = typeof url === "string" ? new URL(url) : url;
|
|
31
|
-
const currentUrlObj = typeof currentUrl === "string" ? new URL(currentUrl) : currentUrl;
|
|
32
|
-
const currentHostnameParts = currentUrlObj.hostname.split(".");
|
|
33
|
-
const beta = currentHostnameParts.shift() === "beta";
|
|
34
|
-
if (beta) {
|
|
35
|
-
const currentHostnameWithoutBeta = currentHostnameParts.join(".");
|
|
36
|
-
if (currentHostnameWithoutBeta === urlObj.hostname) {
|
|
37
|
-
urlObj.hostname = currentUrlObj.hostname;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return urlObj;
|
|
41
|
-
};
|
|
42
|
-
var FooterLink = ({ target, href, margin = 0.5, variant = "body2", ...props }) => {
|
|
43
|
-
const url = new URL((0, import_assert.assertEx)(href, "href not set"));
|
|
44
|
-
(0, import_assert.assertEx)(url.hostname, "Hostname is required in href");
|
|
45
|
-
const convertedUrl = convertToBetaIfNeeded(url);
|
|
46
|
-
if (document.location.hostname === convertedUrl.hostname) {
|
|
47
|
-
const to = url.search.length > 0 ? `${convertedUrl.pathname}${convertedUrl.search}` : url.pathname;
|
|
48
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_link.LinkEx, { margin, to, target, variant, ...props });
|
|
49
|
-
} else {
|
|
50
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_link.LinkEx, { margin, href, target: target ?? "_blank", variant, ...props });
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
54
|
-
0 && (module.exports = {
|
|
55
|
-
FooterLink
|
|
56
|
-
});
|
|
57
|
-
//# sourceMappingURL=Link.cjs.map
|
package/dist/node/Link.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Link.tsx"],"sourcesContent":["import { assertEx } from '@xylabs/assert'\nimport { LinkEx, LinkExProps } from '@xylabs/react-link'\n\n/**\n * @description\n * FooterLink automatically uses a local To if the link is to the current domain\n * If the link is not local, it defaults to target being _blank\n * In the case of 'beta' domains, it navigates correctly\n */\n\nconst convertToBetaIfNeeded = (url: string | URL, currentUrl = new URL(document.location.href)) => {\n const urlObj = typeof url === 'string' ? new URL(url) : url\n const currentUrlObj = typeof currentUrl === 'string' ? new URL(currentUrl) : currentUrl\n const currentHostnameParts = currentUrlObj.hostname.split('.')\n const beta = currentHostnameParts.shift() === 'beta'\n if (beta) {\n const currentHostnameWithoutBeta = currentHostnameParts.join('.')\n if (currentHostnameWithoutBeta === urlObj.hostname) {\n urlObj.hostname = currentUrlObj.hostname\n }\n }\n return urlObj\n}\n\nexport const FooterLink: React.FC<LinkExProps> = ({ target, href, margin = 0.5, variant = 'body2', ...props }) => {\n const url = new URL(assertEx(href, 'href not set'))\n assertEx(url.hostname, 'Hostname is required in href')\n const convertedUrl = convertToBetaIfNeeded(url)\n if (document.location.hostname === convertedUrl.hostname) {\n const to = url.search.length > 0 ? `${convertedUrl.pathname}${convertedUrl.search}` : url.pathname\n return <LinkEx margin={margin} to={to} target={target} variant={variant} {...props} />\n } else {\n return <LinkEx margin={margin} href={href} target={target ?? '_blank'} variant={variant} {...props} />\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAyB;AACzB,wBAAoC;AA6BzB;AApBX,IAAM,wBAAwB,CAAC,KAAmB,aAAa,IAAI,IAAI,SAAS,SAAS,IAAI,MAAM;AACjG,QAAM,SAAS,OAAO,QAAQ,WAAW,IAAI,IAAI,GAAG,IAAI;AACxD,QAAM,gBAAgB,OAAO,eAAe,WAAW,IAAI,IAAI,UAAU,IAAI;AAC7E,QAAM,uBAAuB,cAAc,SAAS,MAAM,GAAG;AAC7D,QAAM,OAAO,qBAAqB,MAAM,MAAM;AAC9C,MAAI,MAAM;AACR,UAAM,6BAA6B,qBAAqB,KAAK,GAAG;AAChE,QAAI,+BAA+B,OAAO,UAAU;AAClD,aAAO,WAAW,cAAc;AAAA,IAClC;AAAA,EACF;AACA,SAAO;AACT;AAEO,IAAM,aAAoC,CAAC,EAAE,QAAQ,MAAM,SAAS,KAAK,UAAU,SAAS,GAAG,MAAM,MAAM;AAChH,QAAM,MAAM,IAAI,QAAI,wBAAS,MAAM,cAAc,CAAC;AAClD,8BAAS,IAAI,UAAU,8BAA8B;AACrD,QAAM,eAAe,sBAAsB,GAAG;AAC9C,MAAI,SAAS,SAAS,aAAa,aAAa,UAAU;AACxD,UAAM,KAAK,IAAI,OAAO,SAAS,IAAI,GAAG,aAAa,QAAQ,GAAG,aAAa,MAAM,KAAK,IAAI;AAC1F,WAAO,4CAAC,4BAAO,QAAgB,IAAQ,QAAgB,SAAmB,GAAG,OAAO;AAAA,EACtF,OAAO;AACL,WAAO,4CAAC,4BAAO,QAAgB,MAAY,QAAQ,UAAU,UAAU,SAAmB,GAAG,OAAO;AAAA,EACtG;AACF;","names":[]}
|
package/dist/node/Link.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
// src/Link.tsx
|
|
2
|
-
import { assertEx } from "@xylabs/assert";
|
|
3
|
-
import { LinkEx } from "@xylabs/react-link";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
var convertToBetaIfNeeded = (url, currentUrl = new URL(document.location.href)) => {
|
|
6
|
-
const urlObj = typeof url === "string" ? new URL(url) : url;
|
|
7
|
-
const currentUrlObj = typeof currentUrl === "string" ? new URL(currentUrl) : currentUrl;
|
|
8
|
-
const currentHostnameParts = currentUrlObj.hostname.split(".");
|
|
9
|
-
const beta = currentHostnameParts.shift() === "beta";
|
|
10
|
-
if (beta) {
|
|
11
|
-
const currentHostnameWithoutBeta = currentHostnameParts.join(".");
|
|
12
|
-
if (currentHostnameWithoutBeta === urlObj.hostname) {
|
|
13
|
-
urlObj.hostname = currentUrlObj.hostname;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return urlObj;
|
|
17
|
-
};
|
|
18
|
-
var FooterLink = ({ target, href, margin = 0.5, variant = "body2", ...props }) => {
|
|
19
|
-
const url = new URL(assertEx(href, "href not set"));
|
|
20
|
-
assertEx(url.hostname, "Hostname is required in href");
|
|
21
|
-
const convertedUrl = convertToBetaIfNeeded(url);
|
|
22
|
-
if (document.location.hostname === convertedUrl.hostname) {
|
|
23
|
-
const to = url.search.length > 0 ? `${convertedUrl.pathname}${convertedUrl.search}` : url.pathname;
|
|
24
|
-
return /* @__PURE__ */ jsx(LinkEx, { margin, to, target, variant, ...props });
|
|
25
|
-
} else {
|
|
26
|
-
return /* @__PURE__ */ jsx(LinkEx, { margin, href, target: target ?? "_blank", variant, ...props });
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
export {
|
|
30
|
-
FooterLink
|
|
31
|
-
};
|
|
32
|
-
//# sourceMappingURL=Link.js.map
|
package/dist/node/Link.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Link.tsx"],"sourcesContent":["import { assertEx } from '@xylabs/assert'\nimport { LinkEx, LinkExProps } from '@xylabs/react-link'\n\n/**\n * @description\n * FooterLink automatically uses a local To if the link is to the current domain\n * If the link is not local, it defaults to target being _blank\n * In the case of 'beta' domains, it navigates correctly\n */\n\nconst convertToBetaIfNeeded = (url: string | URL, currentUrl = new URL(document.location.href)) => {\n const urlObj = typeof url === 'string' ? new URL(url) : url\n const currentUrlObj = typeof currentUrl === 'string' ? new URL(currentUrl) : currentUrl\n const currentHostnameParts = currentUrlObj.hostname.split('.')\n const beta = currentHostnameParts.shift() === 'beta'\n if (beta) {\n const currentHostnameWithoutBeta = currentHostnameParts.join('.')\n if (currentHostnameWithoutBeta === urlObj.hostname) {\n urlObj.hostname = currentUrlObj.hostname\n }\n }\n return urlObj\n}\n\nexport const FooterLink: React.FC<LinkExProps> = ({ target, href, margin = 0.5, variant = 'body2', ...props }) => {\n const url = new URL(assertEx(href, 'href not set'))\n assertEx(url.hostname, 'Hostname is required in href')\n const convertedUrl = convertToBetaIfNeeded(url)\n if (document.location.hostname === convertedUrl.hostname) {\n const to = url.search.length > 0 ? `${convertedUrl.pathname}${convertedUrl.search}` : url.pathname\n return <LinkEx margin={margin} to={to} target={target} variant={variant} {...props} />\n } else {\n return <LinkEx margin={margin} href={href} target={target ?? '_blank'} variant={variant} {...props} />\n }\n}\n"],"mappings":";AAAA,SAAS,gBAAgB;AACzB,SAAS,cAA2B;AA6BzB;AApBX,IAAM,wBAAwB,CAAC,KAAmB,aAAa,IAAI,IAAI,SAAS,SAAS,IAAI,MAAM;AACjG,QAAM,SAAS,OAAO,QAAQ,WAAW,IAAI,IAAI,GAAG,IAAI;AACxD,QAAM,gBAAgB,OAAO,eAAe,WAAW,IAAI,IAAI,UAAU,IAAI;AAC7E,QAAM,uBAAuB,cAAc,SAAS,MAAM,GAAG;AAC7D,QAAM,OAAO,qBAAqB,MAAM,MAAM;AAC9C,MAAI,MAAM;AACR,UAAM,6BAA6B,qBAAqB,KAAK,GAAG;AAChE,QAAI,+BAA+B,OAAO,UAAU;AAClD,aAAO,WAAW,cAAc;AAAA,IAClC;AAAA,EACF;AACA,SAAO;AACT;AAEO,IAAM,aAAoC,CAAC,EAAE,QAAQ,MAAM,SAAS,KAAK,UAAU,SAAS,GAAG,MAAM,MAAM;AAChH,QAAM,MAAM,IAAI,IAAI,SAAS,MAAM,cAAc,CAAC;AAClD,WAAS,IAAI,UAAU,8BAA8B;AACrD,QAAM,eAAe,sBAAsB,GAAG;AAC9C,MAAI,SAAS,SAAS,aAAa,aAAa,UAAU;AACxD,UAAM,KAAK,IAAI,OAAO,SAAS,IAAI,GAAG,aAAa,QAAQ,GAAG,aAAa,MAAM,KAAK,IAAI;AAC1F,WAAO,oBAAC,UAAO,QAAgB,IAAQ,QAAgB,SAAmB,GAAG,OAAO;AAAA,EACtF,OAAO;AACL,WAAO,oBAAC,UAAO,QAAgB,MAAY,QAAQ,UAAU,UAAU,SAAmB,GAAG,OAAO;AAAA,EACtG;AACF;","names":[]}
|
package/dist/node/Links.cjs
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/Links.tsx
|
|
21
|
-
var Links_exports = {};
|
|
22
|
-
__export(Links_exports, {
|
|
23
|
-
FooterLinks: () => FooterLinks
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(Links_exports);
|
|
26
|
-
var import_material = require("@mui/material");
|
|
27
|
-
var import_react_flexbox = require("@xylabs/react-flexbox");
|
|
28
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
-
var FooterLinks = ({ children, title, ...props }) => {
|
|
30
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_flexbox.FlexCol, { margin: 1, justifyContent: "flex-start", title, ...props, children: [
|
|
31
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { margin: 0.5, variant: "h6", noWrap: true, children: title }),
|
|
32
|
-
children
|
|
33
|
-
] });
|
|
34
|
-
};
|
|
35
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
-
0 && (module.exports = {
|
|
37
|
-
FooterLinks
|
|
38
|
-
});
|
|
39
|
-
//# sourceMappingURL=Links.cjs.map
|
package/dist/node/Links.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Links.tsx"],"sourcesContent":["import { Typography } from '@mui/material'\nimport { FlexBoxProps, FlexCol } from '@xylabs/react-flexbox'\n\nexport const FooterLinks: React.FC<FlexBoxProps> = ({ children, title, ...props }) => {\n return (\n <FlexCol margin={1} justifyContent=\"flex-start\" title={title} {...props}>\n <Typography margin={0.5} variant=\"h6\" noWrap>\n {title}\n </Typography>\n {children}\n </FlexCol>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA2B;AAC3B,2BAAsC;AAIlC;AAFG,IAAM,cAAsC,CAAC,EAAE,UAAU,OAAO,GAAG,MAAM,MAAM;AACpF,SACE,6CAAC,gCAAQ,QAAQ,GAAG,gBAAe,cAAa,OAAe,GAAG,OAChE;AAAA,gDAAC,8BAAW,QAAQ,KAAK,SAAQ,MAAK,QAAM,MACzC,iBACH;AAAA,IACC;AAAA,KACH;AAEJ;","names":[]}
|
package/dist/node/Links.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// src/Links.tsx
|
|
2
|
-
import { Typography } from "@mui/material";
|
|
3
|
-
import { FlexCol } from "@xylabs/react-flexbox";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
var FooterLinks = ({ children, title, ...props }) => {
|
|
6
|
-
return /* @__PURE__ */ jsxs(FlexCol, { margin: 1, justifyContent: "flex-start", title, ...props, children: [
|
|
7
|
-
/* @__PURE__ */ jsx(Typography, { margin: 0.5, variant: "h6", noWrap: true, children: title }),
|
|
8
|
-
children
|
|
9
|
-
] });
|
|
10
|
-
};
|
|
11
|
-
export {
|
|
12
|
-
FooterLinks
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=Links.js.map
|
package/dist/node/Links.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Links.tsx"],"sourcesContent":["import { Typography } from '@mui/material'\nimport { FlexBoxProps, FlexCol } from '@xylabs/react-flexbox'\n\nexport const FooterLinks: React.FC<FlexBoxProps> = ({ children, title, ...props }) => {\n return (\n <FlexCol margin={1} justifyContent=\"flex-start\" title={title} {...props}>\n <Typography margin={0.5} variant=\"h6\" noWrap>\n {title}\n </Typography>\n {children}\n </FlexCol>\n )\n}\n"],"mappings":";AAAA,SAAS,kBAAkB;AAC3B,SAAuB,eAAe;AAIlC,SACE,KADF;AAFG,IAAM,cAAsC,CAAC,EAAE,UAAU,OAAO,GAAG,MAAM,MAAM;AACpF,SACE,qBAAC,WAAQ,QAAQ,GAAG,gBAAe,cAAa,OAAe,GAAG,OAChE;AAAA,wBAAC,cAAW,QAAQ,KAAK,SAAQ,MAAK,QAAM,MACzC,iBACH;AAAA,IACC;AAAA,KACH;AAEJ;","names":[]}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/Xyo/AlwaysLinks.tsx
|
|
21
|
-
var AlwaysLinks_exports = {};
|
|
22
|
-
__export(AlwaysLinks_exports, {
|
|
23
|
-
Copyright: () => Copyright,
|
|
24
|
-
XyoFooterAlwaysLinks: () => XyoFooterAlwaysLinks
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(AlwaysLinks_exports);
|
|
27
|
-
|
|
28
|
-
// src/AlwaysLinks.tsx
|
|
29
|
-
var import_icons_material = require("@mui/icons-material");
|
|
30
|
-
var import_react_flexbox = require("@xylabs/react-flexbox");
|
|
31
|
-
|
|
32
|
-
// src/Link.tsx
|
|
33
|
-
var import_assert = require("@xylabs/assert");
|
|
34
|
-
var import_react_link = require("@xylabs/react-link");
|
|
35
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
-
var convertToBetaIfNeeded = (url, currentUrl = new URL(document.location.href)) => {
|
|
37
|
-
const urlObj = typeof url === "string" ? new URL(url) : url;
|
|
38
|
-
const currentUrlObj = typeof currentUrl === "string" ? new URL(currentUrl) : currentUrl;
|
|
39
|
-
const currentHostnameParts = currentUrlObj.hostname.split(".");
|
|
40
|
-
const beta = currentHostnameParts.shift() === "beta";
|
|
41
|
-
if (beta) {
|
|
42
|
-
const currentHostnameWithoutBeta = currentHostnameParts.join(".");
|
|
43
|
-
if (currentHostnameWithoutBeta === urlObj.hostname) {
|
|
44
|
-
urlObj.hostname = currentUrlObj.hostname;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return urlObj;
|
|
48
|
-
};
|
|
49
|
-
var FooterLink = ({ target, href, margin = 0.5, variant = "body2", ...props }) => {
|
|
50
|
-
const url = new URL((0, import_assert.assertEx)(href, "href not set"));
|
|
51
|
-
(0, import_assert.assertEx)(url.hostname, "Hostname is required in href");
|
|
52
|
-
const convertedUrl = convertToBetaIfNeeded(url);
|
|
53
|
-
if (document.location.hostname === convertedUrl.hostname) {
|
|
54
|
-
const to = url.search.length > 0 ? `${convertedUrl.pathname}${convertedUrl.search}` : url.pathname;
|
|
55
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_link.LinkEx, { margin, to, target, variant, ...props });
|
|
56
|
-
} else {
|
|
57
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_link.LinkEx, { margin, href, target: target ?? "_blank", variant, ...props });
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
// src/AlwaysLinks.tsx
|
|
62
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
63
|
-
var FooterAlwaysLinks = ({ style, footerLinks, onMore, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react_flexbox.FlexRow, { flexWrap: "wrap", textTransform: "uppercase", style: { opacity: 0.6, ...style }, ...props, children: [
|
|
64
|
-
footerLinks == null ? void 0 : footerLinks.map((footerLink, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(FooterLink, { noWrap: true, paddingX: 1, margin: 0, ...footerLink, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: footerLink.title }) }, index)),
|
|
65
|
-
onMore ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_flexbox.FlexRow, { style: { cursor: "pointer" }, paddingX: 0.5, onClick: onMore, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.MoreHoriz, { color: "primary", fontSize: "small" }) }) : null
|
|
66
|
-
] });
|
|
67
|
-
|
|
68
|
-
// src/lib/copyrightLinkTitle.ts
|
|
69
|
-
var copyrightLinkTitle = (entity) => {
|
|
70
|
-
return `Copyright \xA9 ${(/* @__PURE__ */ new Date()).getFullYear()} ${entity}`;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
// src/Xyo/AlwaysLinks.tsx
|
|
74
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
75
|
-
var XyoFooterAlwaysLinks = (props) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
76
|
-
FooterAlwaysLinks,
|
|
77
|
-
{
|
|
78
|
-
footerLinks: [
|
|
79
|
-
{
|
|
80
|
-
href: "https://xylabs.com/",
|
|
81
|
-
title: copyrightLinkTitle("XY Labs, Inc.")
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
href: "https://xyo.network/",
|
|
85
|
-
title: "XYO Foundation"
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
href: "https://xylabs.com/privacy/",
|
|
89
|
-
title: "Privacy"
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
href: "https://xylabs.com/terms/",
|
|
93
|
-
title: "Terms"
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
href: "https://xylabs.com/jobs",
|
|
97
|
-
title: "Careers"
|
|
98
|
-
}
|
|
99
|
-
],
|
|
100
|
-
...props
|
|
101
|
-
}
|
|
102
|
-
);
|
|
103
|
-
var Copyright = FooterAlwaysLinks;
|
|
104
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
105
|
-
0 && (module.exports = {
|
|
106
|
-
Copyright,
|
|
107
|
-
XyoFooterAlwaysLinks
|
|
108
|
-
});
|
|
109
|
-
//# sourceMappingURL=AlwaysLinks.cjs.map
|