@salesmind-ai/design-system 0.1.7 → 0.1.9
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/audit-CiyPkxk1.d.cts +194 -0
- package/dist/audit-CiyPkxk1.d.ts +194 -0
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.css.map +1 -1
- package/dist/core/index.d.cts +5 -4
- package/dist/core/index.d.ts +5 -4
- package/dist/core/index.js +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +426 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +66 -21
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +30 -2
- package/dist/index.d.ts +30 -2
- package/dist/index.js +405 -14
- package/dist/index.js.map +1 -1
- package/dist/marketing/index.cjs +136 -12
- package/dist/marketing/index.cjs.map +1 -1
- package/dist/marketing/index.css +26 -1
- package/dist/marketing/index.css.map +1 -1
- package/dist/marketing/index.js +138 -14
- package/dist/marketing/index.js.map +1 -1
- package/dist/report/index.cjs +1 -1
- package/dist/report/index.cjs.map +1 -1
- package/dist/report/index.css.map +1 -1
- package/dist/report/index.js +1 -1
- package/dist/report/index.js.map +1 -1
- package/dist/styles/styles.css +7 -4
- package/dist/web/index.cjs +427 -10
- package/dist/web/index.cjs.map +1 -1
- package/dist/web/index.css.map +1 -1
- package/dist/web/index.d.cts +28 -2
- package/dist/web/index.d.ts +28 -2
- package/dist/web/index.js +405 -12
- package/dist/web/index.js.map +1 -1
- package/package.json +14 -12
package/dist/marketing/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React47, { forwardRef, useState, useRef, useEffect, useMemo, useCallback,
|
|
1
|
+
import React47, { forwardRef, useState, useRef, useEffect, createContext, useMemo, useCallback, useContext } from 'react';
|
|
2
2
|
import clsx39 from 'clsx';
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import { motion, useInView } from 'framer-motion';
|
|
5
5
|
import { Slot } from '@radix-ui/react-slot';
|
|
6
6
|
import { Input } from '@base-ui/react/input';
|
|
7
|
-
import { ArrowRight, Clock, X, Check } from 'lucide-react';
|
|
7
|
+
import { ArrowRight, FileText, Clock, X, Check } from 'lucide-react';
|
|
8
8
|
import { Dialog as Dialog$1 } from '@base-ui/react/dialog';
|
|
9
9
|
import { Tabs as Tabs$1 } from '@base-ui/react/tabs';
|
|
10
10
|
import { useIntl } from 'react-intl';
|
|
@@ -560,23 +560,138 @@ var PlatformBadge = forwardRef(
|
|
|
560
560
|
}
|
|
561
561
|
);
|
|
562
562
|
PlatformBadge.displayName = "PlatformBadge";
|
|
563
|
+
var UtmContext = createContext(null);
|
|
564
|
+
|
|
565
|
+
// src/web/utm/useUtmDefaults.ts
|
|
566
|
+
function useUtmDefaults() {
|
|
567
|
+
return useContext(UtmContext);
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
// src/web/utm/builders.ts
|
|
571
|
+
var PLACEHOLDER_ORIGIN = "https://__placeholder__.internal";
|
|
572
|
+
function buildUtmUrl(baseUrl, params) {
|
|
573
|
+
const isRelative = baseUrl.startsWith("/");
|
|
574
|
+
let url;
|
|
575
|
+
try {
|
|
576
|
+
url = isRelative ? new URL(baseUrl, PLACEHOLDER_ORIGIN) : new URL(baseUrl);
|
|
577
|
+
} catch {
|
|
578
|
+
return baseUrl;
|
|
579
|
+
}
|
|
580
|
+
const existingParams = [];
|
|
581
|
+
url.searchParams.forEach((value, key) => {
|
|
582
|
+
existingParams.push([key, value]);
|
|
583
|
+
});
|
|
584
|
+
for (const [key] of existingParams) {
|
|
585
|
+
url.searchParams.delete(key);
|
|
586
|
+
}
|
|
587
|
+
for (const [key, value] of existingParams) {
|
|
588
|
+
if (!key.startsWith("utm_")) {
|
|
589
|
+
url.searchParams.set(key, value);
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
url.searchParams.set("utm_source", params.source);
|
|
593
|
+
url.searchParams.set("utm_medium", params.medium);
|
|
594
|
+
url.searchParams.set("utm_campaign", params.campaign);
|
|
595
|
+
if (params.term !== void 0) {
|
|
596
|
+
url.searchParams.set("utm_term", params.term);
|
|
597
|
+
}
|
|
598
|
+
if (params.content !== void 0) {
|
|
599
|
+
url.searchParams.set("utm_content", params.content);
|
|
600
|
+
}
|
|
601
|
+
if (isRelative) {
|
|
602
|
+
return url.href.replace(PLACEHOLDER_ORIGIN, "");
|
|
603
|
+
}
|
|
604
|
+
return url.href;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
// src/web/utm/classifiers.ts
|
|
608
|
+
var INTERNAL_PATTERNS = [
|
|
609
|
+
/^\/(?!\/)/,
|
|
610
|
+
// Relative paths
|
|
611
|
+
/^https?:\/\/(www\.)?sales-mind\.ai/i,
|
|
612
|
+
// Marketing site
|
|
613
|
+
/^https?:\/\/app\.sales-mind\.ai/i,
|
|
614
|
+
// Web app
|
|
615
|
+
/^https?:\/\/apps\.sales-mind\.ai/i,
|
|
616
|
+
// Web app (legacy)
|
|
617
|
+
/^https?:\/\/meet\.sales-mind\.ai/i,
|
|
618
|
+
// Booking
|
|
619
|
+
/^https?:\/\/docs\.sales-mind\.ai/i
|
|
620
|
+
// Docs
|
|
621
|
+
];
|
|
622
|
+
var SYSTEM_PATTERNS = [
|
|
623
|
+
/^https?:\/\/.*\/api\//i,
|
|
624
|
+
// API endpoints
|
|
625
|
+
/^https?:\/\/.*\/webhook/i,
|
|
626
|
+
// Webhooks
|
|
627
|
+
/^https?:\/\/.*\/oauth/i,
|
|
628
|
+
// OAuth callbacks
|
|
629
|
+
/^https?:\/\/.*\/callback/i,
|
|
630
|
+
// Callbacks
|
|
631
|
+
/^https?:\/\/.*\.supabase\.(co|com)/i,
|
|
632
|
+
// Supabase
|
|
633
|
+
/^https?:\/\/.*\.firebaseapp\.com/i,
|
|
634
|
+
// Firebase
|
|
635
|
+
/^https?:\/\/.*\.cloudfunctions\.net/i
|
|
636
|
+
// Cloud Functions
|
|
637
|
+
];
|
|
638
|
+
var ASSET_PATTERNS = [
|
|
639
|
+
/\.(css|js|mjs|map|woff2?|ttf|eot|svg|png|jpe?g|gif|webp|avif|ico|pdf)(\?.*)?$/i
|
|
640
|
+
];
|
|
641
|
+
var CONVERSION_PATTERNS = [
|
|
642
|
+
/^https?:\/\/(www\.)?calendly\.com/i,
|
|
643
|
+
/^https?:\/\/(checkout\.)?stripe\.com/i,
|
|
644
|
+
/^https?:\/\/buy\.stripe\.com/i,
|
|
645
|
+
/^https?:\/\/chromewebstore\.google\.com/i,
|
|
646
|
+
/^https?:\/\/meet\.sales-mind\.ai/i
|
|
647
|
+
];
|
|
648
|
+
var PROTOCOL_EXEMPT = [
|
|
649
|
+
/^mailto:/i,
|
|
650
|
+
/^tel:/i,
|
|
651
|
+
/^#/,
|
|
652
|
+
/^javascript:/i
|
|
653
|
+
];
|
|
654
|
+
function classifyUrl(url) {
|
|
655
|
+
if (PROTOCOL_EXEMPT.some((p) => p.test(url))) return "protocol";
|
|
656
|
+
if (ASSET_PATTERNS.some((p) => p.test(url))) return "asset";
|
|
657
|
+
if (SYSTEM_PATTERNS.some((p) => p.test(url))) return "system";
|
|
658
|
+
if (CONVERSION_PATTERNS.some((p) => p.test(url))) return "conversion";
|
|
659
|
+
if (INTERNAL_PATTERNS.some((p) => p.test(url))) return "internal";
|
|
660
|
+
return "external";
|
|
661
|
+
}
|
|
563
662
|
|
|
564
663
|
// src/components/OutboundLink/outbound-link-utils.ts
|
|
565
|
-
var
|
|
664
|
+
var LEGACY_UTM_SOURCE = "salesmind";
|
|
566
665
|
var EXEMPT_PATTERNS = [
|
|
567
666
|
/^https?:\/\/(www\.)?(stripe\.com|checkout\.stripe\.com|paypal\.com)/i,
|
|
568
667
|
/^https?:\/\/(www\.)?github\.com\/login\/oauth/i
|
|
569
668
|
];
|
|
570
669
|
var isExemptUrl = (urlStr) => {
|
|
571
670
|
if (urlStr.startsWith("mailto:") || urlStr.startsWith("tel:")) return true;
|
|
671
|
+
const classification = classifyUrl(urlStr);
|
|
672
|
+
if (classification === "system" || classification === "protocol" || classification === "asset") {
|
|
673
|
+
return true;
|
|
674
|
+
}
|
|
572
675
|
return EXEMPT_PATTERNS.some((pattern) => pattern.test(urlStr));
|
|
573
676
|
};
|
|
677
|
+
var appendGovernedUTMs = (href, params, preserveExisting = true) => {
|
|
678
|
+
try {
|
|
679
|
+
const url = new URL(href);
|
|
680
|
+
if (preserveExisting) {
|
|
681
|
+
const hasAll = url.searchParams.has("utm_source") && url.searchParams.has("utm_medium") && url.searchParams.has("utm_campaign");
|
|
682
|
+
if (hasAll) return href;
|
|
683
|
+
}
|
|
684
|
+
return buildUtmUrl(href, params);
|
|
685
|
+
} catch {
|
|
686
|
+
return href;
|
|
687
|
+
}
|
|
688
|
+
};
|
|
574
689
|
var appendUTMs = (href, context, pageSlug, options) => {
|
|
575
690
|
try {
|
|
576
691
|
const url = new URL(href);
|
|
577
692
|
const { mediumOverride = "outbound_link", campaignOverride, preserveExisting = true } = options;
|
|
578
693
|
const utms = {
|
|
579
|
-
utm_source:
|
|
694
|
+
utm_source: LEGACY_UTM_SOURCE,
|
|
580
695
|
utm_medium: mediumOverride,
|
|
581
696
|
utm_campaign: campaignOverride || pageSlug,
|
|
582
697
|
utm_content: context
|
|
@@ -603,10 +718,13 @@ var OutboundLink = forwardRef(
|
|
|
603
718
|
preserveExistingUTM = true,
|
|
604
719
|
openInNewTab = true,
|
|
605
720
|
disableTracking = false,
|
|
721
|
+
utmParams,
|
|
606
722
|
onClick,
|
|
607
723
|
children,
|
|
608
724
|
...props
|
|
609
725
|
}, ref) => {
|
|
726
|
+
const contextParams = useUtmDefaults();
|
|
727
|
+
const resolvedUtmParams = utmParams ?? contextParams;
|
|
610
728
|
let hostname = "";
|
|
611
729
|
try {
|
|
612
730
|
const url = new URL(href);
|
|
@@ -631,16 +749,20 @@ var OutboundLink = forwardRef(
|
|
|
631
749
|
}
|
|
632
750
|
const isExempt = isExemptUrl(href) || disableTracking;
|
|
633
751
|
if (isExternal && !isExempt) {
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
752
|
+
if (resolvedUtmParams) {
|
|
753
|
+
setFinalHref(appendGovernedUTMs(href, resolvedUtmParams, preserveExistingUTM));
|
|
754
|
+
} else {
|
|
755
|
+
const pageSlug = window.location.pathname.replace(/^\/|\/$/g, "") || "home";
|
|
756
|
+
setFinalHref(appendUTMs(href, context, pageSlug, {
|
|
757
|
+
mediumOverride: currentMedium,
|
|
758
|
+
campaignOverride,
|
|
759
|
+
preserveExisting: preserveExistingUTM
|
|
760
|
+
}));
|
|
761
|
+
}
|
|
640
762
|
} else {
|
|
641
763
|
setFinalHref(href);
|
|
642
764
|
}
|
|
643
|
-
}, [href, context, mediumOverride, campaignOverride, preserveExistingUTM, disableTracking]);
|
|
765
|
+
}, [href, context, mediumOverride, campaignOverride, preserveExistingUTM, disableTracking, resolvedUtmParams]);
|
|
644
766
|
const handleClick = (e) => {
|
|
645
767
|
if (typeof window === "undefined" || disableTracking) {
|
|
646
768
|
onClick?.(e);
|
|
@@ -2161,7 +2283,7 @@ var ArticleCard = forwardRef(
|
|
|
2161
2283
|
onClick: handleClick,
|
|
2162
2284
|
...props,
|
|
2163
2285
|
children: [
|
|
2164
|
-
imageUrl
|
|
2286
|
+
imageUrl ? /* @__PURE__ */ jsxs("div", { className: "ds-article-card__image-wrapper", children: [
|
|
2165
2287
|
/* @__PURE__ */ jsx(
|
|
2166
2288
|
"img",
|
|
2167
2289
|
{
|
|
@@ -2172,9 +2294,11 @@ var ArticleCard = forwardRef(
|
|
|
2172
2294
|
}
|
|
2173
2295
|
),
|
|
2174
2296
|
category && /* @__PURE__ */ jsx("span", { className: "ds-article-card__category-badge", children: category })
|
|
2297
|
+
] }) : /* @__PURE__ */ jsxs("div", { className: "ds-article-card__placeholder", children: [
|
|
2298
|
+
/* @__PURE__ */ jsx(FileText, { className: "ds-article-card__placeholder-icon", "aria-hidden": "true" }),
|
|
2299
|
+
category && /* @__PURE__ */ jsx("span", { className: "ds-article-card__category-badge", children: category })
|
|
2175
2300
|
] }),
|
|
2176
2301
|
/* @__PURE__ */ jsxs("div", { className: "ds-article-card__content", children: [
|
|
2177
|
-
!imageUrl && category && /* @__PURE__ */ jsx("span", { className: "ds-article-card__category-text", children: category }),
|
|
2178
2302
|
/* @__PURE__ */ jsx("h3", { className: "ds-article-card__title", children: title }),
|
|
2179
2303
|
/* @__PURE__ */ jsx("p", { className: "ds-article-card__excerpt", children: excerpt }),
|
|
2180
2304
|
/* @__PURE__ */ jsxs("div", { className: "ds-article-card__meta", children: [
|
|
@@ -3769,5 +3893,5 @@ var IntentCTA = forwardRef(
|
|
|
3769
3893
|
IntentCTA.displayName = "IntentCTA";
|
|
3770
3894
|
|
|
3771
3895
|
export { AnnouncementBar, ArchitectureDiagram, ArticleCard, ArticleLayout, AuthorBio, BeforeAfterBlock, BookingEmbed, BrowserFrame, CTASection, CaseStudyCard, CaseStudySection, ComparisonTable, CompetitorDiff, ComplianceGrid, ExitIntentOverlay, FeatureSection, GuaranteeHighlight, HeroSection, ICPFilter, IntegrationShowcase, IntentCTA, LeadCaptureForm, ManifestoBlock, MetricCounter, MotionContainer, MotionText, ObjectionFAQ, PricingCard, PricingSection, PricingToggle, ProblemAgitation, ProcessTimeline, ROICalculator, RelatedContent, SecurityBlock, SegmentSwitch, SocialProof, SocialProofCard, SocialProofCarousel, SocialProofFeatured, SocialProofGrid, SocialProofLogos, StakeholderTabs, StatsSection, StickyActionBar, TableOfContents, ValueAnchor, VerticalVideoGrid, VideoEmbed };
|
|
3772
|
-
//# sourceMappingURL=
|
|
3896
|
+
//# sourceMappingURL=out.js.map
|
|
3773
3897
|
//# sourceMappingURL=index.js.map
|