@hook-sdk/template 0.9.0 → 0.9.1

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/index.js CHANGED
@@ -2225,6 +2225,8 @@ function DefaultPaywall() {
2225
2225
  const monthlyCents = plan.data?.priceCents ?? 0;
2226
2226
  const yearlyCents = plan.data?.yearlyPriceCents ?? null;
2227
2227
  const activeCents = cycle === "YEARLY" && yearlyCents ? monthlyEquivalent("YEARLY") : monthlyCents;
2228
+ const cycleValueCents = cycle === "YEARLY" && yearlyCents ? yearlyCents : monthlyCents;
2229
+ const cycleLabel = cycle === "YEARLY" ? "por ano" : "por m\xEAs";
2228
2230
  const pct = useMemo7(() => {
2229
2231
  if (!yearlyCents || !monthlyCents) return 0;
2230
2232
  const derived = Math.round((1 - yearlyCents / 12 / monthlyCents) * 100);
@@ -2581,6 +2583,50 @@ function DefaultPaywall() {
2581
2583
  )
2582
2584
  ] }),
2583
2585
  error && /* @__PURE__ */ jsx24("div", { role: "alert", style: { color: "#c00", marginBottom: 12 }, children: error.message }),
2586
+ method === "pix-auto" && /* @__PURE__ */ jsxs18(
2587
+ "div",
2588
+ {
2589
+ "data-testid": "paywall-pix-callout",
2590
+ style: {
2591
+ background: "rgba(0,0,0,0.04)",
2592
+ borderLeft: "3px solid var(--hook-color-primary)",
2593
+ padding: "10px 12px",
2594
+ marginBottom: 12,
2595
+ borderRadius: 4,
2596
+ fontSize: 12,
2597
+ lineHeight: 1.45,
2598
+ textAlign: "left"
2599
+ },
2600
+ children: [
2601
+ /* @__PURE__ */ jsx24("strong", { children: "Como funciona:" }),
2602
+ " no app do seu banco vai aparecer uma cobran\xE7a de",
2603
+ " ",
2604
+ /* @__PURE__ */ jsx24("strong", { children: "R$ 0,01" }),
2605
+ " \u2014 \xE9 simb\xF3lica, s\xF3 pra ativar o PIX Autom\xE1tico.",
2606
+ trialDays > 0 ? /* @__PURE__ */ jsxs18(Fragment6, { children: [
2607
+ " ",
2608
+ "Depois, ",
2609
+ /* @__PURE__ */ jsxs18("strong", { children: [
2610
+ trialDays,
2611
+ " dias gr\xE1tis"
2612
+ ] }),
2613
+ "; a cobran\xE7a de",
2614
+ " ",
2615
+ /* @__PURE__ */ jsx24("strong", { children: formatBRL(cycleValueCents) }),
2616
+ " ",
2617
+ cycleLabel,
2618
+ " s\xF3 come\xE7a depois."
2619
+ ] }) : /* @__PURE__ */ jsxs18(Fragment6, { children: [
2620
+ " ",
2621
+ "A cobran\xE7a de ",
2622
+ /* @__PURE__ */ jsx24("strong", { children: formatBRL(cycleValueCents) }),
2623
+ " ",
2624
+ cycleLabel,
2625
+ " vem em seguida."
2626
+ ] })
2627
+ ]
2628
+ }
2629
+ ),
2584
2630
  /* @__PURE__ */ jsx24(
2585
2631
  "button",
2586
2632
  {
@@ -2636,6 +2682,38 @@ function DefaultPaywall() {
2636
2682
  ] }) : /* @__PURE__ */ jsxs18(Fragment6, { children: [
2637
2683
  /* @__PURE__ */ jsx24("h2", { style: { marginTop: 0, fontSize: 18 }, children: "Pague com Pix Autom\xE1tico" }),
2638
2684
  /* @__PURE__ */ jsx24("p", { style: { fontSize: 13, opacity: 0.75 }, children: "Escaneie o QR Code no app do seu banco pra autorizar o d\xE9bito recorrente." }),
2685
+ /* @__PURE__ */ jsxs18(
2686
+ "p",
2687
+ {
2688
+ "data-testid": "pix-modal-explain",
2689
+ style: { fontSize: 12, opacity: 0.65, marginTop: 8, lineHeight: 1.4 },
2690
+ children: [
2691
+ "Seu banco vai mostrar uma cobran\xE7a de ",
2692
+ /* @__PURE__ */ jsx24("strong", { children: "R$ 0,01" }),
2693
+ " \u2014 \xE9 simb\xF3lica, s\xF3 pra ativar o PIX Autom\xE1tico.",
2694
+ trialDays > 0 ? /* @__PURE__ */ jsxs18(Fragment6, { children: [
2695
+ " ",
2696
+ "A cobran\xE7a de ",
2697
+ /* @__PURE__ */ jsx24("strong", { children: formatBRL(cycleValueCents) }),
2698
+ " ",
2699
+ cycleLabel,
2700
+ " come\xE7a depois dos ",
2701
+ /* @__PURE__ */ jsxs18("strong", { children: [
2702
+ trialDays,
2703
+ " dias gr\xE1tis"
2704
+ ] }),
2705
+ ", automaticamente."
2706
+ ] }) : /* @__PURE__ */ jsxs18(Fragment6, { children: [
2707
+ " ",
2708
+ "A cobran\xE7a de ",
2709
+ /* @__PURE__ */ jsx24("strong", { children: formatBRL(cycleValueCents) }),
2710
+ " ",
2711
+ cycleLabel,
2712
+ " vem logo em seguida."
2713
+ ] })
2714
+ ]
2715
+ }
2716
+ ),
2639
2717
  pixPending.qrCodeBase64 && /* @__PURE__ */ jsx24(
2640
2718
  "img",
2641
2719
  {