@carrierllc/mcp 0.2.19 → 0.2.20
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/README.md +22 -1
- package/dist/chunk-NHQDO2E7.js +461 -0
- package/dist/chunk-NHQDO2E7.js.map +1 -0
- package/dist/cli.js +822 -105
- package/dist/cli.js.map +1 -1
- package/dist/index.js +144 -315
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/plugin/carrier/commands/storefront.md +24 -12
- package/plugin/carrier/skills/carrier-operations/SKILL.md +4 -1
- package/templates/storefront/{next.config.ts → next.config.mjs} +2 -6
- package/templates/storefront/public/brand/logo.svg +13 -0
- package/templates/storefront/src/app/activate/[orderId]/ActivateClient.tsx +12 -12
- package/templates/storefront/src/app/checkout/[templateId]/CheckoutClient.tsx +5 -5
- package/templates/storefront/src/app/checkout/success/CheckoutSuccessClient.tsx +29 -29
- package/templates/storefront/src/app/checkout/success/page.tsx +1 -1
- package/templates/storefront/src/app/contact/page.tsx +33 -25
- package/templates/storefront/src/app/dashboard/page.tsx +7 -4
- package/templates/storefront/src/app/globals.css +72 -82
- package/templates/storefront/src/app/help/page.tsx +22 -17
- package/templates/storefront/src/app/layout.tsx +15 -4
- package/templates/storefront/src/app/page.tsx +16 -7
- package/templates/storefront/src/app/shop/ShopClient.tsx +7 -3
- package/templates/storefront/src/app/sign-in/[[...sign-in]]/page.tsx +1 -1
- package/templates/storefront/src/app/sign-up/[[...sign-up]]/StorefrontSignUpClient.tsx +16 -16
- package/templates/storefront/src/app/sign-up/[[...sign-up]]/page.tsx +1 -1
- package/templates/storefront/src/brand.config.ts +3 -3
- package/templates/storefront/src/components/faq/FaqSection.tsx +23 -26
- package/templates/storefront/src/components/footer/StorefrontFooter.tsx +37 -22
- package/templates/storefront/src/components/landing/FinalCTA.tsx +28 -0
- package/templates/storefront/src/components/landing/HeroSection.tsx +57 -24
- package/templates/storefront/src/components/landing/HowItWorks.tsx +44 -0
- package/templates/storefront/src/components/landing/PlanCard.tsx +58 -28
- package/templates/storefront/src/components/nav/StorefrontNav.tsx +59 -24
- package/templates/storefront/src/components/theme/BrandStyles.tsx +8 -0
- package/templates/storefront/src/components/theme/ThemeToggle.tsx +27 -0
- package/templates/storefront/src/components/theme/clerk-appearance.ts +33 -35
- package/templates/storefront/src/components/theme/theme-provider.tsx +25 -32
- package/templates/storefront/src/components/theme/theme-script.tsx +4 -7
- package/templates/storefront/src/lib/complete-email-sign-up.ts +3 -3
- package/templates/storefront/src/vendor/ui/brand.ts +6 -6
|
@@ -16,13 +16,11 @@ type ThemeContextValue = {
|
|
|
16
16
|
|
|
17
17
|
const ThemeContext = React.createContext<ThemeContextValue | null>(null);
|
|
18
18
|
|
|
19
|
-
function systemTheme(): Theme {
|
|
20
|
-
if (typeof window === "undefined") return "dark";
|
|
21
|
-
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
22
|
-
}
|
|
23
|
-
|
|
24
19
|
function resolve(pref: ThemePreference): Theme {
|
|
25
|
-
|
|
20
|
+
if (pref === "system" && typeof window !== "undefined") {
|
|
21
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
22
|
+
}
|
|
23
|
+
return pref === "dark" ? "dark" : "light";
|
|
26
24
|
}
|
|
27
25
|
|
|
28
26
|
function applyToDocument(theme: Theme) {
|
|
@@ -32,46 +30,41 @@ function applyToDocument(theme: Theme) {
|
|
|
32
30
|
}
|
|
33
31
|
|
|
34
32
|
export function ThemeProvider({ children }: { children: React.ReactNode }) {
|
|
35
|
-
const [preference, setPreferenceState] = React.useState<ThemePreference>(
|
|
36
|
-
|
|
33
|
+
const [preference, setPreferenceState] = React.useState<ThemePreference>("light");
|
|
34
|
+
const [theme, setTheme] = React.useState<Theme>("light");
|
|
35
|
+
|
|
36
|
+
React.useEffect(() => {
|
|
37
37
|
try {
|
|
38
38
|
const stored = window.localStorage.getItem(STORAGE_KEY);
|
|
39
|
-
if (stored === "light" || stored === "dark" || stored === "system")
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
39
|
+
if (stored === "light" || stored === "dark" || stored === "system") {
|
|
40
|
+
setPreferenceState(stored);
|
|
41
|
+
const next = resolve(stored);
|
|
42
|
+
setTheme(next);
|
|
43
|
+
applyToDocument(next);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
} catch {
|
|
47
|
+
/* private mode */
|
|
48
|
+
}
|
|
49
|
+
applyToDocument("light");
|
|
50
|
+
}, []);
|
|
50
51
|
|
|
51
52
|
const setPreference = React.useCallback((pref: ThemePreference) => {
|
|
52
53
|
setPreferenceState(pref);
|
|
53
54
|
const next = resolve(pref);
|
|
54
55
|
setTheme(next);
|
|
55
56
|
applyToDocument(next);
|
|
56
|
-
try {
|
|
57
|
+
try {
|
|
58
|
+
window.localStorage.setItem(STORAGE_KEY, pref);
|
|
59
|
+
} catch {
|
|
60
|
+
/* ignore */
|
|
61
|
+
}
|
|
57
62
|
}, []);
|
|
58
63
|
|
|
59
64
|
const toggle = React.useCallback(() => {
|
|
60
65
|
setPreference(theme === "dark" ? "light" : "dark");
|
|
61
66
|
}, [theme, setPreference]);
|
|
62
67
|
|
|
63
|
-
React.useEffect(() => {
|
|
64
|
-
if (preference !== "system") return;
|
|
65
|
-
const mql = window.matchMedia("(prefers-color-scheme: dark)");
|
|
66
|
-
const onChange = () => {
|
|
67
|
-
const next = mql.matches ? "dark" : "light";
|
|
68
|
-
setTheme(next);
|
|
69
|
-
applyToDocument(next);
|
|
70
|
-
};
|
|
71
|
-
mql.addEventListener("change", onChange);
|
|
72
|
-
return () => mql.removeEventListener("change", onChange);
|
|
73
|
-
}, [preference]);
|
|
74
|
-
|
|
75
68
|
const value = React.useMemo<ThemeContextValue>(
|
|
76
69
|
() => ({ theme, preference, setPreference, toggle }),
|
|
77
70
|
[theme, preference, setPreference, toggle],
|
|
@@ -4,17 +4,14 @@ const themeScript = `
|
|
|
4
4
|
(function () {
|
|
5
5
|
try {
|
|
6
6
|
var pref = localStorage.getItem("${STORAGE_KEY}");
|
|
7
|
-
var theme
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} else {
|
|
11
|
-
theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
12
|
-
}
|
|
7
|
+
var theme = (pref === "light" || pref === "dark")
|
|
8
|
+
? pref
|
|
9
|
+
: "light";
|
|
13
10
|
var root = document.documentElement;
|
|
14
11
|
root.setAttribute("data-theme", theme);
|
|
15
12
|
root.style.colorScheme = theme;
|
|
16
13
|
} catch (e) {
|
|
17
|
-
document.documentElement.setAttribute("data-theme", "
|
|
14
|
+
document.documentElement.setAttribute("data-theme", "light");
|
|
18
15
|
}
|
|
19
16
|
})();
|
|
20
17
|
`;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
type SignUpVerificationResult = {
|
|
2
|
-
status: string;
|
|
2
|
+
status: string | null;
|
|
3
3
|
createdSessionId: string | null;
|
|
4
4
|
};
|
|
5
5
|
|
|
6
6
|
type SignUpForEmailVerify = {
|
|
7
|
-
missingFields?: string[];
|
|
8
|
-
unverifiedFields?: string[];
|
|
7
|
+
missingFields?: readonly string[] | null;
|
|
8
|
+
unverifiedFields?: readonly string[] | null;
|
|
9
9
|
update: (params: Record<string, never>) => Promise<SignUpVerificationResult>;
|
|
10
10
|
};
|
|
11
11
|
|
|
@@ -7,24 +7,24 @@ export const BRAND = {
|
|
|
7
7
|
name: brand.name,
|
|
8
8
|
legalName: brand.legalName,
|
|
9
9
|
tagline: brand.tagline,
|
|
10
|
-
description: `Unlimited data in 200+ countries. Instant QR activation.
|
|
10
|
+
description: `Unlimited data in 200+ countries. Instant QR activation. WhatsApp support.`,
|
|
11
11
|
domain: brand.domain,
|
|
12
12
|
support: {
|
|
13
13
|
email: brand.supportEmail,
|
|
14
14
|
whatsapp: brand.supportWhatsapp,
|
|
15
15
|
sms: brand.supportWhatsapp,
|
|
16
16
|
statusUrl: brand.supportUrl,
|
|
17
|
-
hoursLocal: "
|
|
17
|
+
hoursLocal: "24/7",
|
|
18
18
|
responseTimeMinutes: 5,
|
|
19
19
|
},
|
|
20
20
|
social: brand.social,
|
|
21
21
|
} as const;
|
|
22
22
|
|
|
23
23
|
export const GRADIENTS = {
|
|
24
|
-
hero: "bg-gradient-to-br from-
|
|
25
|
-
heroText: "bg-
|
|
26
|
-
card: "bg-gradient-to-br from-
|
|
27
|
-
glow: "bg-gradient-to-r from-[
|
|
24
|
+
hero: "bg-gradient-to-br from-sand-50 via-white to-sand-100",
|
|
25
|
+
heroText: "bg-clip-text text-transparent",
|
|
26
|
+
card: "bg-gradient-to-br from-white to-sand-50",
|
|
27
|
+
glow: "bg-gradient-to-r from-[var(--brand-accent)]/20 via-[var(--brand-accent)]/30 to-[var(--brand-accent-light)]/20",
|
|
28
28
|
} as const;
|
|
29
29
|
|
|
30
30
|
export type SupportChannel = "whatsapp" | "sms" | "email";
|