11---
22import { Building2 , Check , Gift , Rocket } from " lucide-astro" ;
33
4+ const polarCheckoutUrl =
5+ " https://buy.polar.sh/polar_cl_Lo2DzeNXDXbFkuvPr1ZDVREe9wXs9zsz3FvJF2ZjW9Z" ;
6+
47const proTiers = [
58 {
69 key: " solo" ,
10+ productId: " f522fac9-b6d5-4e60-8c6f-35c1c10827c9" ,
711 buttonLabel: " 1 dev" ,
812 name: " Solo" ,
913 price: " $149" ,
1014 cadence: " / year" ,
1115 description: " For solo devs and independent apps." ,
1216 cta: " Get Solo" ,
13- href: " mailto:sales@chartkit.io?subject=Chart%20Kit%20Pro%20Solo%20license " ,
17+ href: ` ${ polarCheckoutUrl }?product_id=f522fac9-b6d5-4e60-8c6f-35c1c10827c9 ` ,
1418 features: [
1519 " 1 developer" ,
1620 " 1 production app" ,
@@ -20,13 +24,14 @@ const proTiers = [
2024 },
2125 {
2226 key: " startup" ,
27+ productId: " f2a31f7f-5719-4103-8406-3caad5d14843" ,
2328 buttonLabel: " 2-3 devs" ,
2429 name: " Startup" ,
2530 price: " $399" ,
2631 cadence: " / year" ,
2732 description: " For small teams shipping one app." ,
2833 cta: " Get Startup" ,
29- href: " mailto:sales@chartkit.io?subject=Chart%20Kit%20Pro%20Startup%20license " ,
34+ href: ` ${ polarCheckoutUrl }?product_id=f2a31f7f-5719-4103-8406-3caad5d14843 ` ,
3035 features: [
3136 " Up to 3 developers" ,
3237 " 1 production app" ,
@@ -36,13 +41,14 @@ const proTiers = [
3641 },
3742 {
3843 key: " business" ,
44+ productId: " 54c32948-3865-400b-991f-f14ffd0692fb" ,
3945 buttonLabel: " 4-6 devs" ,
4046 name: " Business" ,
4147 price: " $1,499" ,
4248 cadence: " / year" ,
4349 description: " For growing teams and multiple apps." ,
4450 cta: " Get Business" ,
45- href: " mailto:sales@chartkit.io?subject=Chart%20Kit%20Pro%20Business%20license " ,
51+ href: ` ${ polarCheckoutUrl }?product_id=54c32948-3865-400b-991f-f14ffd0692fb ` ,
4652 features: [
4753 " Up to 6 developers" ,
4854 " Up to 2 production apps" ,
@@ -170,7 +176,7 @@ const proTiersByKey = Object.fromEntries(
170176 <span
171177 class =" inline-flex items-center rounded-full bg-white/[0.075] px-3 py-1.5 text-[11px] font-semibold text-white/78 transition-colors duration-300 [html[data-theme='light']_&]:bg-black/[0.055] [html[data-theme='light']_&]:text-black/70"
172178 >
173- Coming soon
179+ Annual
174180 </span >
175181 </div >
176182
@@ -250,7 +256,6 @@ const proTiersByKey = Object.fromEntries(
250256 <a
251257 href ={ defaultProTier .href }
252258 data-pro-cta
253- data-pro-coming-soon
254259 class =" inline-flex h-10 items-center justify-center rounded-full bg-white px-5 text-sm font-semibold text-black transition-colors hover:bg-white/88 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-white/45 [html[data-theme='light']_&]:bg-black [html[data-theme='light']_&]:text-white [html[data-theme='light']_&]:hover:bg-black/82 [html[data-theme='light']_&]:focus-visible:outline-black/40"
255260 >
256261 { defaultProTier .cta }
@@ -305,7 +310,6 @@ const proTiersByKey = Object.fromEntries(
305310
306311 <a
307312 href =" mailto:sales@chartkit.io?subject=Chart%20Kit%20Pro%20Enterprise"
308- data-pro-coming-soon
309313 class =" inline-flex h-10 items-center justify-center rounded-full border border-white/15 px-5 text-sm font-semibold text-white/78 transition-colors hover:border-white/28 hover:text-white focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-white/45 [html[data-theme='light']_&]:border-black/15 [html[data-theme='light']_&]:text-black/70 [html[data-theme='light']_&]:hover:border-black/28 [html[data-theme='light']_&]:hover:text-black [html[data-theme='light']_&]:focus-visible:outline-black/40"
310314 >
311315 Talk to sales
@@ -324,15 +328,6 @@ const proTiersByKey = Object.fromEntries(
324328 </a >
325329 </p >
326330 </div >
327- <div
328- data-pro-toast
329- data-visible =" false"
330- role =" status"
331- aria-live =" polite"
332- class =" pointer-events-none fixed bottom-5 left-1/2 z-[80] -translate-x-1/2 translate-y-2 rounded-full border border-white/12 bg-white/92 px-4 py-2 text-sm font-medium whitespace-nowrap text-black opacity-0 shadow-[0_18px_60px_rgba(0,0,0,0.28)] backdrop-blur-xl transition duration-200 data-[visible=true]:translate-y-0 data-[visible=true]:opacity-100 [html[data-theme='light']_&]:border-black/12 [html[data-theme='light']_&]:bg-black/90 [html[data-theme='light']_&]:text-white"
333- >
334- Pro version is coming soon
335- </div >
336331</section >
337332
338333<script
@@ -351,6 +346,7 @@ const proTiersByKey = Object.fromEntries(
351346 href: string;
352347 name: string;
353348 price: string;
349+ productId: string;
354350 };
355351
356352 const hydrateProPricing = () => {
@@ -377,8 +373,6 @@ const proTiersByKey = Object.fromEntries(
377373 const indicator = root.querySelector<HTMLElement>(
378374 "[data-pro-tier-indicator]"
379375 );
380- const toast = document.querySelector<HTMLElement>("[data-pro-toast]");
381- let toastTimer: number | undefined;
382376
383377 const renderFeature = (feature: string) => `
384378 <li class="flex items-center gap-3 text-sm font-medium text-white/62 transition-colors duration-300 [html[data-theme='light']_&]:text-black/62">
@@ -426,40 +420,11 @@ const proTiersByKey = Object.fromEntries(
426420 }
427421 };
428422
429- const showComingSoonToast = () => {
430- if (!toast) {
431- return;
432- }
433-
434- if (toastTimer) {
435- window.clearTimeout(toastTimer);
436- }
437-
438- toast.dataset.visible = "true";
439- toastTimer = window.setTimeout(() => {
440- toast.dataset.visible = "false";
441- }, 2200);
442- };
443-
444423 buttons.forEach((button) => {
445424 button.addEventListener("click", () =>
446425 selectTier(button.dataset.proTier)
447426 );
448427 });
449-
450- document
451- .querySelectorAll<HTMLAnchorElement>("[data-pro-coming-soon]")
452- .forEach((link) => {
453- if (link.dataset.proComingSoonBound === "true") {
454- return;
455- }
456-
457- link.dataset.proComingSoonBound = "true";
458- link.addEventListener("click", (event) => {
459- event.preventDefault();
460- showComingSoonToast();
461- });
462- });
463428 };
464429
465430 if (document.readyState === "loading") {
0 commit comments