keystone-design-bootstrap 1.0.66 → 1.0.68
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/design_system/sections/index.js +42 -11
- package/dist/design_system/sections/index.js.map +1 -1
- package/dist/index.js +42 -11
- package/dist/index.js.map +1 -1
- package/dist/tracking/index.d.ts +6 -1
- package/dist/tracking/index.js +5 -3
- package/dist/tracking/index.js.map +1 -1
- package/package.json +1 -1
- package/src/design_system/portal/LoginForm.tsx +4 -7
- package/src/design_system/portal/LoginModalController.tsx +36 -12
- package/src/lib/cta-urls.ts +13 -2
package/dist/index.js
CHANGED
|
@@ -6287,7 +6287,7 @@ async function setPixelUserData(userData) {
|
|
|
6287
6287
|
getRegisteredPixelIds().forEach((id3) => fbq("init", id3, hashed));
|
|
6288
6288
|
}
|
|
6289
6289
|
}
|
|
6290
|
-
function firePixelEvent(event, params) {
|
|
6290
|
+
function firePixelEvent(event, params, eventId) {
|
|
6291
6291
|
const fbq = getFbq();
|
|
6292
6292
|
if (!fbq) {
|
|
6293
6293
|
console.debug("[MetaPixel] skipped \u2014 fbq not loaded", { event });
|
|
@@ -6297,8 +6297,10 @@ function firePixelEvent(event, params) {
|
|
|
6297
6297
|
const normalized = {};
|
|
6298
6298
|
if (params == null ? void 0 : params.contentName) normalized.content_name = params.contentName;
|
|
6299
6299
|
if (params == null ? void 0 : params.contentCategory) normalized.content_category = params.contentCategory;
|
|
6300
|
-
|
|
6301
|
-
|
|
6300
|
+
const customData = Object.keys(normalized).length > 0 ? normalized : void 0;
|
|
6301
|
+
const eventData = eventId ? { eventID: eventId } : void 0;
|
|
6302
|
+
console.debug("[MetaPixel]", event, normalized, eventId ? { eventID: eventId } : "");
|
|
6303
|
+
fbq("track", event, customData, eventData);
|
|
6302
6304
|
}
|
|
6303
6305
|
|
|
6304
6306
|
// src/next/contexts/form-definitions.tsx
|
|
@@ -6356,7 +6358,7 @@ var ContactSectionForm = ({
|
|
|
6356
6358
|
(_a = formRef.current) == null ? void 0 : _a.reset();
|
|
6357
6359
|
onSuccess == null ? void 0 : onSuccess();
|
|
6358
6360
|
await setPixelUserData({ email: data.email, phone: data.phone });
|
|
6359
|
-
firePixelEvent("Lead");
|
|
6361
|
+
firePixelEvent("Lead", void 0, result.eventId);
|
|
6360
6362
|
setTimeout(() => setSubmitStatus("idle"), 5e3);
|
|
6361
6363
|
} else {
|
|
6362
6364
|
setSubmitStatus("error");
|
|
@@ -6522,6 +6524,7 @@ var FooterHome = ({
|
|
|
6522
6524
|
// src/design_system/sections/header-navigation.tsx
|
|
6523
6525
|
import React22, { useRef as useRef7, useState as useState10 } from "react";
|
|
6524
6526
|
import Link4 from "next/link";
|
|
6527
|
+
import { usePathname } from "next/navigation";
|
|
6525
6528
|
import Image8 from "next/image";
|
|
6526
6529
|
import { ChevronDown as ChevronDown4 } from "@untitledui/icons";
|
|
6527
6530
|
import { Button as AriaButton8, Dialog as AriaDialog, DialogTrigger as AriaDialogTrigger, Popover as AriaPopover3 } from "react-aria-components";
|
|
@@ -6573,6 +6576,19 @@ var CONTACT_PATH = "/contact";
|
|
|
6573
6576
|
function isExternalCtaUrl(href) {
|
|
6574
6577
|
return href.startsWith("http://") || href.startsWith("https://");
|
|
6575
6578
|
}
|
|
6579
|
+
function resolvePortalPath(companyInformation) {
|
|
6580
|
+
var _a;
|
|
6581
|
+
const url = (_a = companyInformation == null ? void 0 : companyInformation.portal_url) == null ? void 0 : _a.trim();
|
|
6582
|
+
if (!url) return null;
|
|
6583
|
+
let pathname = null;
|
|
6584
|
+
try {
|
|
6585
|
+
pathname = new URL(url).pathname;
|
|
6586
|
+
} catch (e) {
|
|
6587
|
+
pathname = url.startsWith("/") ? url : null;
|
|
6588
|
+
}
|
|
6589
|
+
if (!pathname || pathname === "/") return null;
|
|
6590
|
+
return pathname.endsWith("/") ? pathname.slice(0, -1) : pathname;
|
|
6591
|
+
}
|
|
6576
6592
|
function resolveCtaUrls(companyInformation) {
|
|
6577
6593
|
var _a, _b, _c;
|
|
6578
6594
|
const portalUrl = ((_a = companyInformation == null ? void 0 : companyInformation.portal_url) == null ? void 0 : _a.trim()) || null;
|
|
@@ -6636,6 +6652,9 @@ function HeaderNavigation({
|
|
|
6636
6652
|
image: logoImage
|
|
6637
6653
|
};
|
|
6638
6654
|
const dynamicNavigation = navigation;
|
|
6655
|
+
const pathname = usePathname();
|
|
6656
|
+
const portalPath = resolvePortalPath(companyInformation);
|
|
6657
|
+
const isPortalPage = portalPath ? pathname == null ? void 0 : pathname.startsWith(portalPath) : false;
|
|
6639
6658
|
const getVariantClasses = () => {
|
|
6640
6659
|
switch (variant) {
|
|
6641
6660
|
case "minimal":
|
|
@@ -6843,7 +6862,7 @@ function HeaderNavigation({
|
|
|
6843
6862
|
(cta_button == null ? void 0 : cta_button.secondary_label) && ctaUrls.hasSecondary ? cta_button.secondary_label : (cta_button == null ? void 0 : cta_button.label) || "Get Started"
|
|
6844
6863
|
))))
|
|
6845
6864
|
))))
|
|
6846
|
-
), /* @__PURE__ */ React22.createElement("div", { className: "fixed bottom-0 left-0 right-0 z-40 md:hidden bg-fg-primary" }, /* @__PURE__ */ React22.createElement("div", { className: "flex gap-0" }, (cta_button == null ? void 0 : cta_button.secondary_label) && ctaUrls.hasSecondary && /* @__PURE__ */ React22.createElement(
|
|
6865
|
+
), !isPortalPage && /* @__PURE__ */ React22.createElement("div", { className: "fixed bottom-0 left-0 right-0 z-40 md:hidden bg-fg-primary" }, /* @__PURE__ */ React22.createElement("div", { className: "flex gap-0" }, (cta_button == null ? void 0 : cta_button.secondary_label) && ctaUrls.hasSecondary && /* @__PURE__ */ React22.createElement(
|
|
6847
6866
|
Button2,
|
|
6848
6867
|
{
|
|
6849
6868
|
href: ctaUrls.secondaryHref,
|
|
@@ -8617,6 +8636,7 @@ registerThemeVariant("hero-home", "aman", HeroHome2);
|
|
|
8617
8636
|
import React36, { useState as useState16, useRef as useRef9, useCallback as useCallback5 } from "react";
|
|
8618
8637
|
import Link6 from "next/link";
|
|
8619
8638
|
import Image11 from "next/image";
|
|
8639
|
+
import { usePathname as usePathname2 } from "next/navigation";
|
|
8620
8640
|
var MAX_DROPDOWN_ITEMS = 3;
|
|
8621
8641
|
function HeaderNavigation2({
|
|
8622
8642
|
props,
|
|
@@ -8652,6 +8672,9 @@ function HeaderNavigation2({
|
|
|
8652
8672
|
const companyName = logoTextOverride || (companyInformation == null ? void 0 : companyInformation.company_name) || ((_b = props == null ? void 0 : props.logo) == null ? void 0 : _b.text) || "";
|
|
8653
8673
|
const navigation = navigationOverride || ((_c = config == null ? void 0 : config.navigation) == null ? void 0 : _c.header) || [];
|
|
8654
8674
|
const ctaUrls = resolveCtaUrls(companyInformation);
|
|
8675
|
+
const pathname = usePathname2();
|
|
8676
|
+
const portalPath = resolvePortalPath(companyInformation);
|
|
8677
|
+
const isPortalPage = portalPath ? pathname == null ? void 0 : pathname.startsWith(portalPath) : false;
|
|
8655
8678
|
const cancelCloseTimeout = useCallback5(() => {
|
|
8656
8679
|
if (closeTimeoutRef.current) {
|
|
8657
8680
|
clearTimeout(closeTimeoutRef.current);
|
|
@@ -8869,7 +8892,7 @@ function HeaderNavigation2({
|
|
|
8869
8892
|
onClick: () => setIsMobileMenuOpen(false)
|
|
8870
8893
|
},
|
|
8871
8894
|
((_q = props == null ? void 0 : props.cta_button) == null ? void 0 : _q.secondary_label) && ctaUrls.hasSecondary ? props.cta_button.secondary_label : ((_r = props == null ? void 0 : props.cta_button) == null ? void 0 : _r.label) || "Contact"
|
|
8872
|
-
))))), /* @__PURE__ */ React36.createElement("div", { className: "fixed bottom-0 left-0 right-0 z-40 md:hidden bg-fg-primary" }, /* @__PURE__ */ React36.createElement("div", { className: "flex gap-0" }, ((_s = props == null ? void 0 : props.cta_button) == null ? void 0 : _s.secondary_label) && ctaUrls.hasSecondary && /* @__PURE__ */ React36.createElement(
|
|
8895
|
+
))))), !isPortalPage && /* @__PURE__ */ React36.createElement("div", { className: "fixed bottom-0 left-0 right-0 z-40 md:hidden bg-fg-primary" }, /* @__PURE__ */ React36.createElement("div", { className: "flex gap-0" }, ((_s = props == null ? void 0 : props.cta_button) == null ? void 0 : _s.secondary_label) && ctaUrls.hasSecondary && /* @__PURE__ */ React36.createElement(
|
|
8873
8896
|
Button2,
|
|
8874
8897
|
{
|
|
8875
8898
|
href: ctaUrls.secondaryHref,
|
|
@@ -9118,7 +9141,7 @@ var ContactSectionForm2 = ({
|
|
|
9118
9141
|
(_a = formRef.current) == null ? void 0 : _a.reset();
|
|
9119
9142
|
onSuccess == null ? void 0 : onSuccess();
|
|
9120
9143
|
await setPixelUserData({ email: data.email, phone: data.phone });
|
|
9121
|
-
firePixelEvent("Lead");
|
|
9144
|
+
firePixelEvent("Lead", void 0, result.eventId);
|
|
9122
9145
|
setTimeout(() => setSubmitStatus("idle"), 5e3);
|
|
9123
9146
|
} else {
|
|
9124
9147
|
setSubmitStatus("error");
|
|
@@ -17709,6 +17732,7 @@ registerThemeVariant("hero-home", "barelux", HeroHome3);
|
|
|
17709
17732
|
import React45, { useState as useState23, useRef as useRef14, useCallback as useCallback8 } from "react";
|
|
17710
17733
|
import Link8 from "next/link";
|
|
17711
17734
|
import Image12 from "next/image";
|
|
17735
|
+
import { usePathname as usePathname3 } from "next/navigation";
|
|
17712
17736
|
var MAX_DROPDOWN_ITEMS2 = 6;
|
|
17713
17737
|
function HeaderNavigation3({
|
|
17714
17738
|
props,
|
|
@@ -17734,6 +17758,9 @@ function HeaderNavigation3({
|
|
|
17734
17758
|
const companyName = logoTextOverride || (companyInformation == null ? void 0 : companyInformation.company_name) || ((_b = props == null ? void 0 : props.logo) == null ? void 0 : _b.text) || "";
|
|
17735
17759
|
const navigation = navigationOverride || ((_c = config == null ? void 0 : config.navigation) == null ? void 0 : _c.header) || [];
|
|
17736
17760
|
const ctaUrls = resolveCtaUrls(companyInformation);
|
|
17761
|
+
const pathname = usePathname3();
|
|
17762
|
+
const portalPath = resolvePortalPath(companyInformation);
|
|
17763
|
+
const isPortalPage = portalPath ? pathname == null ? void 0 : pathname.startsWith(portalPath) : false;
|
|
17737
17764
|
const cancelCloseTimeout = useCallback8(() => {
|
|
17738
17765
|
if (closeTimeoutRef.current) {
|
|
17739
17766
|
clearTimeout(closeTimeoutRef.current);
|
|
@@ -17925,7 +17952,7 @@ function HeaderNavigation3({
|
|
|
17925
17952
|
onClick: () => setIsMobileMenuOpen(false)
|
|
17926
17953
|
},
|
|
17927
17954
|
((_m = props == null ? void 0 : props.cta_button) == null ? void 0 : _m.label) || ""
|
|
17928
|
-
))))), /* @__PURE__ */ React45.createElement("div", { className: "fixed bottom-0 left-0 right-0 z-40 md:hidden bg-fg-primary" }, /* @__PURE__ */ React45.createElement("div", { className: "flex gap-0" }, ((_n = props == null ? void 0 : props.cta_button) == null ? void 0 : _n.secondary_label) && ctaUrls.hasSecondary && /* @__PURE__ */ React45.createElement(
|
|
17955
|
+
))))), !isPortalPage && /* @__PURE__ */ React45.createElement("div", { className: "fixed bottom-0 left-0 right-0 z-40 md:hidden bg-fg-primary" }, /* @__PURE__ */ React45.createElement("div", { className: "flex gap-0" }, ((_n = props == null ? void 0 : props.cta_button) == null ? void 0 : _n.secondary_label) && ctaUrls.hasSecondary && /* @__PURE__ */ React45.createElement(
|
|
17929
17956
|
Button2,
|
|
17930
17957
|
{
|
|
17931
17958
|
href: ctaUrls.secondaryHref,
|
|
@@ -18320,7 +18347,7 @@ var ContactSectionForm3 = ({
|
|
|
18320
18347
|
(_a = formRef.current) == null ? void 0 : _a.reset();
|
|
18321
18348
|
onSuccess == null ? void 0 : onSuccess();
|
|
18322
18349
|
await setPixelUserData({ email: data.email, phone: data.phone });
|
|
18323
|
-
firePixelEvent("Lead");
|
|
18350
|
+
firePixelEvent("Lead", void 0, result.eventId);
|
|
18324
18351
|
setTimeout(() => setSubmitStatus("idle"), 5e3);
|
|
18325
18352
|
} else {
|
|
18326
18353
|
setSubmitStatus("error");
|
|
@@ -18500,6 +18527,7 @@ registerThemeVariant("hero-home", "balance", HeroHome4);
|
|
|
18500
18527
|
import React53, { useState as useState27, useRef as useRef16, useCallback as useCallback9 } from "react";
|
|
18501
18528
|
import Link10 from "next/link";
|
|
18502
18529
|
import Image13 from "next/image";
|
|
18530
|
+
import { usePathname as usePathname4 } from "next/navigation";
|
|
18503
18531
|
function HeaderNavigation4({
|
|
18504
18532
|
props,
|
|
18505
18533
|
navigation: navigationOverride,
|
|
@@ -18524,6 +18552,9 @@ function HeaderNavigation4({
|
|
|
18524
18552
|
const companyName = logoTextOverride || (companyInformation == null ? void 0 : companyInformation.company_name) || ((_b = props == null ? void 0 : props.logo) == null ? void 0 : _b.text) || "";
|
|
18525
18553
|
const navigation = navigationOverride || ((_c = config == null ? void 0 : config.navigation) == null ? void 0 : _c.header) || [];
|
|
18526
18554
|
const ctaUrls = resolveCtaUrls(companyInformation);
|
|
18555
|
+
const pathname = usePathname4();
|
|
18556
|
+
const portalPath = resolvePortalPath(companyInformation);
|
|
18557
|
+
const isPortalPage = portalPath ? pathname == null ? void 0 : pathname.startsWith(portalPath) : false;
|
|
18527
18558
|
const cancelCloseTimeout = useCallback9(() => {
|
|
18528
18559
|
if (closeTimeoutRef.current) {
|
|
18529
18560
|
clearTimeout(closeTimeoutRef.current);
|
|
@@ -18685,7 +18716,7 @@ function HeaderNavigation4({
|
|
|
18685
18716
|
onClick: () => setIsMobileMenuOpen(false)
|
|
18686
18717
|
},
|
|
18687
18718
|
((_m = props == null ? void 0 : props.cta_button) == null ? void 0 : _m.label) || ""
|
|
18688
|
-
))))), /* @__PURE__ */ React53.createElement("div", { className: "fixed bottom-0 left-0 right-0 z-40 md:hidden", style: { backgroundColor: "rgb(148, 133, 84)" } }, /* @__PURE__ */ React53.createElement("div", { className: "flex gap-0" }, ((_n = props == null ? void 0 : props.cta_button) == null ? void 0 : _n.secondary_label) && ctaUrls.hasSecondary && /* @__PURE__ */ React53.createElement(
|
|
18719
|
+
))))), !isPortalPage && /* @__PURE__ */ React53.createElement("div", { className: "fixed bottom-0 left-0 right-0 z-40 md:hidden", style: { backgroundColor: "rgb(148, 133, 84)" } }, /* @__PURE__ */ React53.createElement("div", { className: "flex gap-0" }, ((_n = props == null ? void 0 : props.cta_button) == null ? void 0 : _n.secondary_label) && ctaUrls.hasSecondary && /* @__PURE__ */ React53.createElement(
|
|
18689
18720
|
Button2,
|
|
18690
18721
|
{
|
|
18691
18722
|
href: ctaUrls.secondaryHref,
|
|
@@ -18814,7 +18845,7 @@ var ContactSectionForm4 = ({
|
|
|
18814
18845
|
(_a = formRef.current) == null ? void 0 : _a.reset();
|
|
18815
18846
|
onSuccess == null ? void 0 : onSuccess();
|
|
18816
18847
|
await setPixelUserData({ email: data.email, phone: data.phone });
|
|
18817
|
-
firePixelEvent("Lead");
|
|
18848
|
+
firePixelEvent("Lead", void 0, result.eventId);
|
|
18818
18849
|
setTimeout(() => setSubmitStatus("idle"), 5e3);
|
|
18819
18850
|
} else {
|
|
18820
18851
|
setSubmitStatus("error");
|