@hook-sdk/template 0.25.0 → 0.26.0
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.cjs +1047 -975
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +105 -331
- package/dist/index.d.ts +105 -331
- package/dist/index.js +912 -823
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { ReactNode, ComponentType, Component } from 'react';
|
|
4
4
|
import * as _hook_sdk_sdk from '@hook-sdk/sdk';
|
|
5
|
-
import { HookContextValue, CheckoutMethod as CheckoutMethod$1, CheckoutCycle, CheckoutCardData, CheckoutHolderInfo,
|
|
5
|
+
import { HookContextValue, SubscribeAnonymousResult, CheckoutMethod as CheckoutMethod$1, CheckoutCycle, CheckoutResult, CheckoutCardData, CheckoutHolderInfo, PlanState, ReminderSlot } from '@hook-sdk/sdk';
|
|
6
6
|
export { PlanInfo, PlanState, useTrackOnboardingStep } from '@hook-sdk/sdk';
|
|
7
7
|
import { z } from 'zod';
|
|
8
8
|
|
|
@@ -14,6 +14,16 @@ type AuthFlowConfig = {
|
|
|
14
14
|
googleOAuth: boolean;
|
|
15
15
|
postAuthLanding: string;
|
|
16
16
|
preAuthRoutes: string[];
|
|
17
|
+
/**
|
|
18
|
+
* Plan-V — where in the funnel does account creation happen?
|
|
19
|
+
* - 'pre_signup' (default, legacy): user signs up before paywall via
|
|
20
|
+
* /api/auth/signup. Existing behavior — preserves backwards-compat.
|
|
21
|
+
* - 'pay_first': checkout creates the account in one shot via
|
|
22
|
+
* /api/app/:appSlug/payments/checkout/subscribe. AppRoot does NOT mount
|
|
23
|
+
* the /signup route; PreAuthFlow ends at /paywall/checkout.
|
|
24
|
+
* See docs/superpowers/specs/2026-05-13-pay-first-signup-design.md.
|
|
25
|
+
*/
|
|
26
|
+
signupMode?: 'pre_signup' | 'pay_first';
|
|
17
27
|
};
|
|
18
28
|
type PaywallConfig = {
|
|
19
29
|
mode: 'free';
|
|
@@ -323,6 +333,10 @@ declare class ErrorBoundary extends Component<Props, State> {
|
|
|
323
333
|
render(): string | number | boolean | Iterable<ReactNode> | react_jsx_runtime.JSX.Element;
|
|
324
334
|
}
|
|
325
335
|
|
|
336
|
+
declare function CheckoutPageDefault(): react_jsx_runtime.JSX.Element;
|
|
337
|
+
|
|
338
|
+
declare function PixWaitingPageDefault(): react_jsx_runtime.JSX.Element | null;
|
|
339
|
+
|
|
326
340
|
/**
|
|
327
341
|
* Reads `?token=` from the URL on mount + on location change. When present and
|
|
328
342
|
* the current pathname is `/`, redirects to the configured deep-link path
|
|
@@ -335,7 +349,7 @@ declare function DeepLinkHandler({ deepLinks }: {
|
|
|
335
349
|
deepLinks?: DeepLinks;
|
|
336
350
|
}): null;
|
|
337
351
|
|
|
338
|
-
type AuthFormErrorCode = 'invalid_credentials' | 'rate_limited' | 'email_unverified' | '
|
|
352
|
+
type AuthFormErrorCode = 'invalid_credentials' | 'rate_limited' | 'email_unverified' | 'account_locked' | 'network' | 'server';
|
|
339
353
|
interface AuthFormError {
|
|
340
354
|
code: AuthFormErrorCode;
|
|
341
355
|
message: string;
|
|
@@ -466,6 +480,68 @@ interface UseResetFormResult {
|
|
|
466
480
|
*/
|
|
467
481
|
declare function useResetForm(): UseResetFormResult;
|
|
468
482
|
|
|
483
|
+
type CheckoutFormCycle = 'MONTHLY' | 'YEARLY';
|
|
484
|
+
type CheckoutFormMethod = 'card' | 'pix-auto';
|
|
485
|
+
interface CheckoutCardInput {
|
|
486
|
+
number: string;
|
|
487
|
+
expiryMonth: string;
|
|
488
|
+
expiryYear: string;
|
|
489
|
+
ccv: string;
|
|
490
|
+
holderName: string;
|
|
491
|
+
}
|
|
492
|
+
interface UseCheckoutFormResult {
|
|
493
|
+
name: string;
|
|
494
|
+
setName: (v: string) => void;
|
|
495
|
+
email: string;
|
|
496
|
+
setEmail: (v: string) => void;
|
|
497
|
+
emailConfirm: string;
|
|
498
|
+
setEmailConfirm: (v: string) => void;
|
|
499
|
+
phone: string;
|
|
500
|
+
setPhone: (v: string) => void;
|
|
501
|
+
cpf: string;
|
|
502
|
+
setCpf: (v: string) => void;
|
|
503
|
+
method: CheckoutFormMethod;
|
|
504
|
+
setMethod: (m: CheckoutFormMethod) => void;
|
|
505
|
+
cycle: CheckoutFormCycle;
|
|
506
|
+
setCycle: (c: CheckoutFormCycle) => void;
|
|
507
|
+
card: CheckoutCardInput;
|
|
508
|
+
setCard: (patch: Partial<CheckoutCardInput>) => void;
|
|
509
|
+
nameError: string | null;
|
|
510
|
+
emailError: string | null;
|
|
511
|
+
emailConfirmError: string | null;
|
|
512
|
+
phoneError: string | null;
|
|
513
|
+
cpfError: string | null;
|
|
514
|
+
markNameTouched: () => void;
|
|
515
|
+
markEmailTouched: () => void;
|
|
516
|
+
markEmailConfirmTouched: () => void;
|
|
517
|
+
markPhoneTouched: () => void;
|
|
518
|
+
markCpfTouched: () => void;
|
|
519
|
+
/**
|
|
520
|
+
* Result of the debounced server-side email-exists check, used to swap
|
|
521
|
+
* the CTA into "Email já cadastrado · Entrar" on the checkout form.
|
|
522
|
+
*/
|
|
523
|
+
emailStatus: 'idle' | 'checking' | 'exists' | 'available';
|
|
524
|
+
/**
|
|
525
|
+
* Submit the form. Calls `auth.subscribeAnonymous`. Returns the result on
|
|
526
|
+
* success, null on validation failure, or throws on payment failure (caller
|
|
527
|
+
* should display a banner). EmailTakenError is caught + translated into
|
|
528
|
+
* `emailStatus='exists'` + `emailTaken=true` so the caller can redirect.
|
|
529
|
+
*/
|
|
530
|
+
submit: () => Promise<SubscribeAnonymousResult | null>;
|
|
531
|
+
submitting: boolean;
|
|
532
|
+
canSubmit: boolean;
|
|
533
|
+
formSubmitAttempted: boolean;
|
|
534
|
+
error: AuthFormError | null;
|
|
535
|
+
/** True after a 409 collision; caller redirects to /login?email=… */
|
|
536
|
+
emailTaken: boolean;
|
|
537
|
+
loginUrl: string | null;
|
|
538
|
+
}
|
|
539
|
+
interface UseCheckoutFormArgs {
|
|
540
|
+
defaultMethod: CheckoutFormMethod;
|
|
541
|
+
defaultCycle: CheckoutFormCycle;
|
|
542
|
+
}
|
|
543
|
+
declare function useCheckoutForm(args: UseCheckoutFormArgs): UseCheckoutFormResult;
|
|
544
|
+
|
|
469
545
|
type SubscriptionStatus = 'active' | 'trialing' | 'expired' | 'canceled' | 'past_due' | 'pending' | 'none';
|
|
470
546
|
type PaymentMethod = CheckoutMethod$1;
|
|
471
547
|
interface PaywallError {
|
|
@@ -533,9 +609,7 @@ interface PaywallPlanDerived {
|
|
|
533
609
|
* - `availableMethods` mirrors `methods`
|
|
534
610
|
* - `opening` mirrors `submitting`
|
|
535
611
|
* - `checkout(args)` takes legacy args + validates card/holderInfo presence
|
|
536
|
-
* - `dismissPix`
|
|
537
|
-
* resolves G154; was no-op pre-0.24 and apps had to maintain a local
|
|
538
|
-
* `pixActive` flag to bridge the gap).
|
|
612
|
+
* - `dismissPix` no-op (SDK polling auto-clears pixPending on settle)
|
|
539
613
|
* - `monthlyEquivalent(cycle)` helper
|
|
540
614
|
*/
|
|
541
615
|
declare function usePaywallState(): {
|
|
@@ -970,11 +1044,15 @@ declare const AppConfigSchema: z.ZodObject<{
|
|
|
970
1044
|
googleOAuth: z.ZodBoolean;
|
|
971
1045
|
postAuthLanding: z.ZodString;
|
|
972
1046
|
preAuthRoutes: z.ZodArray<z.ZodString>;
|
|
1047
|
+
signupMode: z.ZodOptional<z.ZodEnum<{
|
|
1048
|
+
pre_signup: "pre_signup";
|
|
1049
|
+
pay_first: "pay_first";
|
|
1050
|
+
}>>;
|
|
973
1051
|
}, z.core.$strip>;
|
|
974
1052
|
paywall: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
975
1053
|
mode: z.ZodEnum<{
|
|
976
|
-
trial: "trial";
|
|
977
1054
|
pay_first: "pay_first";
|
|
1055
|
+
trial: "trial";
|
|
978
1056
|
}>;
|
|
979
1057
|
trialDays: z.ZodOptional<z.ZodNumber>;
|
|
980
1058
|
trialDaysCard: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1137,114 +1215,30 @@ type PaywallProps = {
|
|
|
1137
1215
|
* Composed top-level paywall component. Apps wrap it in their `PaywallOffer.tsx`
|
|
1138
1216
|
* (or `Offer.tsx`) and pass copy + themeClasses + slots. Logic + telemetry live
|
|
1139
1217
|
* here. To customize layout entirely, drop down to the primitives.
|
|
1140
|
-
*
|
|
1141
|
-
* Internally wraps a `<PaywallProvider>` so the refactored primitives can read
|
|
1142
|
-
* state from context. Apps wanting Level 2 / Level 3 composition can use
|
|
1143
|
-
* `<PaywallProvider>` + Lego blocks directly without going through `<Paywall>`.
|
|
1144
1218
|
*/
|
|
1145
1219
|
declare function Paywall({ copy, themeClasses, slots, onBeforeCheckout, }: PaywallProps): react_jsx_runtime.JSX.Element;
|
|
1146
1220
|
|
|
1147
1221
|
type PaywallMethodTabsProps = {
|
|
1148
|
-
|
|
1222
|
+
methods: readonly CheckoutMethod[];
|
|
1223
|
+
selected: CheckoutMethod;
|
|
1224
|
+
onSelect: (m: CheckoutMethod) => void;
|
|
1149
1225
|
labels: Partial<Record<CheckoutMethod, string>>;
|
|
1150
|
-
/** Wrapper className. */
|
|
1151
1226
|
className?: string;
|
|
1152
|
-
/** Individual tab className. */
|
|
1153
1227
|
tabClassName?: string;
|
|
1154
|
-
/** Individual tab className when active. */
|
|
1155
1228
|
tabActiveClassName?: string;
|
|
1156
1229
|
};
|
|
1157
|
-
declare function PaywallMethodTabs({ labels, className, tabClassName, tabActiveClassName, }: PaywallMethodTabsProps): react_jsx_runtime.JSX.Element | null;
|
|
1230
|
+
declare function PaywallMethodTabs({ methods, selected, onSelect, labels, className, tabClassName, tabActiveClassName, }: PaywallMethodTabsProps): react_jsx_runtime.JSX.Element | null;
|
|
1158
1231
|
|
|
1159
1232
|
type PaywallMethodContentProps = {
|
|
1160
|
-
|
|
1161
|
-
* App-provided copy keyed by method. `pix` covers both `pix-auto` and
|
|
1162
|
-
* `pix-once`. `cardConsumedTrial` is used when the active method is `card`
|
|
1163
|
-
* AND `hasConsumedTrial` (read from context) is true.
|
|
1164
|
-
*/
|
|
1233
|
+
method: CheckoutMethod;
|
|
1165
1234
|
copy: Pick<PaywallCopy, 'pix' | 'card'> & {
|
|
1166
1235
|
cardConsumedTrial?: PaywallCopy['cardConsumedTrial'];
|
|
1167
1236
|
};
|
|
1168
|
-
|
|
1237
|
+
hasConsumedTrial?: boolean;
|
|
1169
1238
|
className?: string;
|
|
1170
|
-
/** Per-row className. */
|
|
1171
1239
|
rowClassName?: string;
|
|
1172
1240
|
};
|
|
1173
|
-
declare function PaywallMethodContent({ copy, className, rowClassName }: PaywallMethodContentProps): react_jsx_runtime.JSX.Element;
|
|
1174
|
-
|
|
1175
|
-
/**
|
|
1176
|
-
* Full return shape of `usePaywallState()`. Apps consuming via
|
|
1177
|
-
* `usePaywallContext()` get the same fields they'd get from the headless
|
|
1178
|
-
* hook directly — no internal-only fields hidden.
|
|
1179
|
-
*
|
|
1180
|
-
* This is the "Level 3" escape-hatch contract: any app can drop down to raw
|
|
1181
|
-
* context and render an entirely custom paywall, with the template still
|
|
1182
|
-
* owning state + telemetry + checkout dispatch.
|
|
1183
|
-
*/
|
|
1184
|
-
type PaywallContextValue = ReturnType<typeof usePaywallState>;
|
|
1185
|
-
/**
|
|
1186
|
-
* Context that carries the full paywall state down to Lego blocks. Null
|
|
1187
|
-
* outside `<PaywallProvider>`. Consumer hook `usePaywallContext()` throws on
|
|
1188
|
-
* null to surface mis-mounted blocks early.
|
|
1189
|
-
*/
|
|
1190
|
-
declare const PaywallContext: react.Context<{
|
|
1191
|
-
status: SubscriptionStatus;
|
|
1192
|
-
hasAccess: boolean | null;
|
|
1193
|
-
daysLeftInTrial: number | null;
|
|
1194
|
-
initialLoadComplete: boolean;
|
|
1195
|
-
plan: PaywallPlanDerived | null;
|
|
1196
|
-
cycle: _hook_sdk_sdk.CheckoutCycle;
|
|
1197
|
-
setCycle: react.Dispatch<react.SetStateAction<_hook_sdk_sdk.CheckoutCycle>>;
|
|
1198
|
-
methods: readonly _hook_sdk_sdk.CheckoutMethod[];
|
|
1199
|
-
selectedMethod: _hook_sdk_sdk.CheckoutMethod;
|
|
1200
|
-
setSelectedMethod: react.Dispatch<react.SetStateAction<_hook_sdk_sdk.CheckoutMethod>>;
|
|
1201
|
-
hasConsumedTrial: boolean;
|
|
1202
|
-
currentPriceCents: number;
|
|
1203
|
-
currentMonthlyEquivCents: number;
|
|
1204
|
-
anchorPriceCents: number | null;
|
|
1205
|
-
selectMethod: (next: _hook_sdk_sdk.CheckoutMethod) => void;
|
|
1206
|
-
selectCycle: (next: _hook_sdk_sdk.CheckoutCycle) => void;
|
|
1207
|
-
isFree: boolean;
|
|
1208
|
-
trialDaysForMethod: (method: _hook_sdk_sdk.CheckoutMethod) => number;
|
|
1209
|
-
trialDaysCard: number;
|
|
1210
|
-
trialDaysPix: number;
|
|
1211
|
-
cpfState: CpfState;
|
|
1212
|
-
cardState: CardFormStateWithSetter;
|
|
1213
|
-
submit: () => Promise<_hook_sdk_sdk.CheckoutResult | undefined>;
|
|
1214
|
-
checkout: (args: PaywallCheckoutArgs) => Promise<void>;
|
|
1215
|
-
cancel: () => Promise<void>;
|
|
1216
|
-
pixPending: PixPending | null;
|
|
1217
|
-
error: PaywallError | null;
|
|
1218
|
-
submitting: boolean;
|
|
1219
|
-
opening: boolean;
|
|
1220
|
-
availableMethods: readonly _hook_sdk_sdk.CheckoutMethod[];
|
|
1221
|
-
monthlyEquivalent: (c: _hook_sdk_sdk.CheckoutCycle) => number;
|
|
1222
|
-
dismissPix: () => void;
|
|
1223
|
-
refreshPlan: () => void;
|
|
1224
|
-
} | null>;
|
|
1225
|
-
type PaywallProviderProps = {
|
|
1226
|
-
children: ReactNode;
|
|
1227
|
-
};
|
|
1228
|
-
/**
|
|
1229
|
-
* Owns the headless paywall state for one paywall surface. All Lego blocks
|
|
1230
|
-
* (PriceHeadline, AnchorPrice, FinePrint, refactored primitives) and the
|
|
1231
|
-
* composed `<Paywall>` read state via this provider.
|
|
1232
|
-
*
|
|
1233
|
-
* Multiple compositions can share state by sharing one `<PaywallProvider>`
|
|
1234
|
-
* parent (e.g. side-by-side variants on a dev/test page). Multiple
|
|
1235
|
-
* providers in the same tree get independent state.
|
|
1236
|
-
*/
|
|
1237
|
-
declare function PaywallProvider({ children }: PaywallProviderProps): react_jsx_runtime.JSX.Element;
|
|
1238
|
-
|
|
1239
|
-
/**
|
|
1240
|
-
* Consumer hook for the paywall context. Returns the non-null state object
|
|
1241
|
-
* (same shape as `usePaywallState()`) when called inside `<PaywallProvider>`.
|
|
1242
|
-
*
|
|
1243
|
-
* Throws `"usePaywallContext must be used within <PaywallProvider>"` when the
|
|
1244
|
-
* provider is missing — surfaces mis-mounted Lego blocks at render time
|
|
1245
|
-
* instead of silently rendering with stale or default state.
|
|
1246
|
-
*/
|
|
1247
|
-
declare function usePaywallContext(): PaywallContextValue;
|
|
1241
|
+
declare function PaywallMethodContent({ method, copy, hasConsumedTrial, className, rowClassName, }: PaywallMethodContentProps): react_jsx_runtime.JSX.Element;
|
|
1248
1242
|
|
|
1249
1243
|
type CycleLabels = {
|
|
1250
1244
|
annualLabel: string;
|
|
@@ -1252,257 +1246,37 @@ type CycleLabels = {
|
|
|
1252
1246
|
annualSuffix: string;
|
|
1253
1247
|
monthlySuffix: string;
|
|
1254
1248
|
};
|
|
1255
|
-
|
|
1256
|
-
type PaywallCyclePickerVariant = 'default' | 'premium-gold' | 'pink-pill';
|
|
1257
|
-
/** State passed to the optional `render` escape hatch. */
|
|
1258
|
-
type PaywallCyclePickerRenderArgs = {
|
|
1249
|
+
type PaywallCyclePickerProps = {
|
|
1259
1250
|
cycles: readonly Cycle[];
|
|
1260
1251
|
selected: Cycle;
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1252
|
+
onSelect: (c: Cycle) => void;
|
|
1253
|
+
/** Raw price for the cycle (used to show full annual/monthly). */
|
|
1254
|
+
priceCentsByCycle: Record<Cycle, number>;
|
|
1255
|
+
/** Anchor strikethrough price, null when not set. */
|
|
1256
|
+
anchorCentsByCycle: Record<Cycle, number | null>;
|
|
1257
|
+
/** Monthly-equiv for YEARLY (priceCents / 12). Same as priceCentsByCycle for MONTHLY. */
|
|
1258
|
+
monthlyEquivByCycle: Record<Cycle, number>;
|
|
1266
1259
|
labels: CycleLabels;
|
|
1267
|
-
/** Root wrapper className. */
|
|
1268
1260
|
className?: string;
|
|
1269
|
-
/** Per-card base className. */
|
|
1270
1261
|
cardClassName?: string;
|
|
1271
|
-
/** Applied when the card is selected (in addition to `cardClassName`). */
|
|
1272
1262
|
cardSelectedClassName?: string;
|
|
1273
|
-
/** Anchor strikethrough className inside the card. */
|
|
1274
1263
|
anchorClassName?: string;
|
|
1275
|
-
/** Visual variant. Variants are sugar for className combos. */
|
|
1276
|
-
variant?: PaywallCyclePickerVariant;
|
|
1277
|
-
/**
|
|
1278
|
-
* Render-prop escape hatch. When provided, the picker returns the prop's
|
|
1279
|
-
* output wrapped in a root element with the configured `className`. State
|
|
1280
|
-
* plumbing stays; visual is 100% the app's.
|
|
1281
|
-
*/
|
|
1282
|
-
render?: (state: PaywallCyclePickerRenderArgs) => ReactNode;
|
|
1283
1264
|
};
|
|
1284
|
-
declare function PaywallCyclePicker({ labels, className, cardClassName, cardSelectedClassName, anchorClassName,
|
|
1265
|
+
declare function PaywallCyclePicker({ cycles, selected, onSelect, priceCentsByCycle, anchorCentsByCycle, monthlyEquivByCycle, labels, className, cardClassName, cardSelectedClassName, anchorClassName, }: PaywallCyclePickerProps): react_jsx_runtime.JSX.Element | null;
|
|
1285
1266
|
|
|
1286
1267
|
type PaywallCtaProps = {
|
|
1287
|
-
/** Already-interpolated CTA label (e.g. "Pagar R$ 19,90 com PIX"). */
|
|
1288
1268
|
ctaLabel: string;
|
|
1289
|
-
/** Label shown while `submitting === true`. Defaults to `ctaLabel`. */
|
|
1290
1269
|
loadingLabel?: string;
|
|
1291
|
-
/**
|
|
1292
|
-
* Switch-hint copy shown under the CTA when the other method is available.
|
|
1293
|
-
* Caller decides visibility (typically only when `methods.length > 1`).
|
|
1294
|
-
*/
|
|
1295
1270
|
switchHint?: string;
|
|
1296
|
-
/** Trust line under the CTA / switch hint. */
|
|
1297
1271
|
trustLine: string;
|
|
1298
|
-
|
|
1272
|
+
onClick: () => void;
|
|
1273
|
+
disabled?: boolean;
|
|
1274
|
+
loading?: boolean;
|
|
1299
1275
|
className?: string;
|
|
1300
|
-
/** Button className. */
|
|
1301
1276
|
buttonClassName?: string;
|
|
1302
|
-
/** Switch-hint paragraph className. */
|
|
1303
1277
|
switchHintClassName?: string;
|
|
1304
|
-
/** Trust-line paragraph className. */
|
|
1305
1278
|
trustClassName?: string;
|
|
1306
1279
|
};
|
|
1307
|
-
|
|
1308
|
-
* CTA button + switch hint + trust line. Reads `submit` + `submitting` from
|
|
1309
|
-
* context — the button dispatches the checkout on click and disables itself
|
|
1310
|
-
* while submitting. Apps wanting a different action (e.g. open a CPF modal
|
|
1311
|
-
* first) should compose via `<Paywall onBeforeCheckout>` or use raw context
|
|
1312
|
-
* with their own button.
|
|
1313
|
-
*/
|
|
1314
|
-
declare function PaywallCta({ ctaLabel, loadingLabel, switchHint, trustLine, className, buttonClassName, switchHintClassName, trustClassName, }: PaywallCtaProps): react_jsx_runtime.JSX.Element;
|
|
1315
|
-
|
|
1316
|
-
type PaywallEyebrowProps = {
|
|
1317
|
-
text: string;
|
|
1318
|
-
className?: string;
|
|
1319
|
-
};
|
|
1320
|
-
declare function PaywallEyebrow({ text, className }: PaywallEyebrowProps): react_jsx_runtime.JSX.Element;
|
|
1321
|
-
|
|
1322
|
-
type PaywallHeroRenderState = {
|
|
1323
|
-
src: string;
|
|
1324
|
-
headline?: string;
|
|
1325
|
-
};
|
|
1326
|
-
type PaywallHeroProps = {
|
|
1327
|
-
src: string;
|
|
1328
|
-
alt?: string;
|
|
1329
|
-
headline?: string;
|
|
1330
|
-
aspectRatio?: string;
|
|
1331
|
-
gradientClassName?: string;
|
|
1332
|
-
className?: string;
|
|
1333
|
-
headlineClassName?: string;
|
|
1334
|
-
imgClassName?: string;
|
|
1335
|
-
render?: (state: PaywallHeroRenderState) => ReactNode;
|
|
1336
|
-
};
|
|
1337
|
-
declare function PaywallHero({ src, alt, headline, aspectRatio, gradientClassName, className, headlineClassName, imgClassName, render, }: PaywallHeroProps): react_jsx_runtime.JSX.Element;
|
|
1338
|
-
|
|
1339
|
-
type PaywallHeadlineProps = {
|
|
1340
|
-
text: string;
|
|
1341
|
-
className?: string;
|
|
1342
|
-
as?: 'h1' | 'h2';
|
|
1343
|
-
};
|
|
1344
|
-
declare function PaywallHeadline({ text, className, as }: PaywallHeadlineProps): react_jsx_runtime.JSX.Element;
|
|
1345
|
-
|
|
1346
|
-
type PaywallPriceHeadlineProps = {
|
|
1347
|
-
/**
|
|
1348
|
-
* Copy template. Supported substitutions:
|
|
1349
|
-
* - `{pricePerDay}` → daily price formatted (BRL), derived from yearly.
|
|
1350
|
-
* - `{currentMonthlyEquiv}` → formatted monthly-equivalent BRL.
|
|
1351
|
-
* - `{cycle}` → human-readable cycle ("mensal" | "anual").
|
|
1352
|
-
*
|
|
1353
|
-
* Example: `"Comece hoje por {pricePerDay} por dia"`.
|
|
1354
|
-
*/
|
|
1355
|
-
template: string;
|
|
1356
|
-
className?: string;
|
|
1357
|
-
as?: 'h1' | 'h2' | 'h3';
|
|
1358
|
-
render?: (state: {
|
|
1359
|
-
pricePerDay: string;
|
|
1360
|
-
currentMonthlyEquivCents: number;
|
|
1361
|
-
cycle: string;
|
|
1362
|
-
}) => ReactNode;
|
|
1363
|
-
};
|
|
1364
|
-
declare function PaywallPriceHeadline({ template, className, as, render, }: PaywallPriceHeadlineProps): react_jsx_runtime.JSX.Element;
|
|
1365
|
-
|
|
1366
|
-
type PaywallCountdownRenderState = {
|
|
1367
|
-
h: number;
|
|
1368
|
-
m: number;
|
|
1369
|
-
s: number;
|
|
1370
|
-
expired: boolean;
|
|
1371
|
-
};
|
|
1372
|
-
type PaywallCountdownDeadline = Date | string | {
|
|
1373
|
-
sessionStorageKey: string;
|
|
1374
|
-
durationMs: number;
|
|
1375
|
-
};
|
|
1376
|
-
type PaywallCountdownProps = {
|
|
1377
|
-
deadline: PaywallCountdownDeadline;
|
|
1378
|
-
format?: 'h:m:s' | 'm:s';
|
|
1379
|
-
onExpire?: () => void;
|
|
1380
|
-
className?: string;
|
|
1381
|
-
render?: (state: PaywallCountdownRenderState) => ReactNode;
|
|
1382
|
-
};
|
|
1383
|
-
declare function PaywallCountdown({ deadline, format, onExpire, className, render, }: PaywallCountdownProps): react_jsx_runtime.JSX.Element;
|
|
1384
|
-
|
|
1385
|
-
type PaywallFeaturesRenderState = {
|
|
1386
|
-
items: readonly string[];
|
|
1387
|
-
};
|
|
1388
|
-
type PaywallFeaturesProps = {
|
|
1389
|
-
items: readonly string[];
|
|
1390
|
-
IconComponent?: ComponentType<{
|
|
1391
|
-
className?: string;
|
|
1392
|
-
}>;
|
|
1393
|
-
className?: string;
|
|
1394
|
-
itemClassName?: string;
|
|
1395
|
-
iconClassName?: string;
|
|
1396
|
-
render?: (state: PaywallFeaturesRenderState) => ReactNode;
|
|
1397
|
-
renderItem?: (item: string, idx: number) => ReactNode;
|
|
1398
|
-
};
|
|
1399
|
-
declare function PaywallFeatures({ items, IconComponent, className, itemClassName, iconClassName, render, renderItem, }: PaywallFeaturesProps): react_jsx_runtime.JSX.Element;
|
|
1400
|
-
|
|
1401
|
-
type PaywallFeaturesCardProps = {
|
|
1402
|
-
title?: string;
|
|
1403
|
-
items: readonly string[];
|
|
1404
|
-
className?: string;
|
|
1405
|
-
cardClassName?: string;
|
|
1406
|
-
titleClassName?: string;
|
|
1407
|
-
itemClassName?: string;
|
|
1408
|
-
renderItem?: (item: string, idx: number) => ReactNode;
|
|
1409
|
-
};
|
|
1410
|
-
declare function PaywallFeaturesCard({ title, items, className, cardClassName, titleClassName, itemClassName, renderItem, }: PaywallFeaturesCardProps): react_jsx_runtime.JSX.Element;
|
|
1411
|
-
|
|
1412
|
-
type PaywallTrophyBadgeRenderState = {
|
|
1413
|
-
text: string;
|
|
1414
|
-
};
|
|
1415
|
-
type PaywallTrophyBadgeProps = {
|
|
1416
|
-
text: string;
|
|
1417
|
-
className?: string;
|
|
1418
|
-
iconClassName?: string;
|
|
1419
|
-
floating?: boolean;
|
|
1420
|
-
render?: (state: PaywallTrophyBadgeRenderState) => ReactNode;
|
|
1421
|
-
};
|
|
1422
|
-
declare function PaywallTrophyBadge({ text, className, iconClassName, floating, render, }: PaywallTrophyBadgeProps): react_jsx_runtime.JSX.Element;
|
|
1423
|
-
|
|
1424
|
-
type PaywallAnchorPriceProps = {
|
|
1425
|
-
className?: string;
|
|
1426
|
-
render?: (state: {
|
|
1427
|
-
anchorCents: number;
|
|
1428
|
-
formatted: string;
|
|
1429
|
-
}) => ReactNode;
|
|
1430
|
-
};
|
|
1431
|
-
declare function PaywallAnchorPrice({ className, render, }: PaywallAnchorPriceProps): react_jsx_runtime.JSX.Element | null;
|
|
1432
|
-
|
|
1433
|
-
type PaywallTestimonial = {
|
|
1434
|
-
name: string;
|
|
1435
|
-
avatar?: string;
|
|
1436
|
-
stars: number;
|
|
1437
|
-
quote: string;
|
|
1438
|
-
};
|
|
1439
|
-
type PaywallTestimonialsProps = {
|
|
1440
|
-
items: readonly PaywallTestimonial[];
|
|
1441
|
-
className?: string;
|
|
1442
|
-
cardClassName?: string;
|
|
1443
|
-
avatarClassName?: string;
|
|
1444
|
-
quoteClassName?: string;
|
|
1445
|
-
nameClassName?: string;
|
|
1446
|
-
starsClassName?: string;
|
|
1447
|
-
renderItem?: (item: PaywallTestimonial, idx: number) => ReactNode;
|
|
1448
|
-
};
|
|
1449
|
-
declare function PaywallTestimonials({ items, className, cardClassName, avatarClassName, quoteClassName, nameClassName, starsClassName, renderItem, }: PaywallTestimonialsProps): react_jsx_runtime.JSX.Element;
|
|
1450
|
-
|
|
1451
|
-
type PaywallStat = {
|
|
1452
|
-
value: string;
|
|
1453
|
-
label: string;
|
|
1454
|
-
icon?: ReactNode;
|
|
1455
|
-
};
|
|
1456
|
-
type PaywallStatsRowProps = {
|
|
1457
|
-
stats: readonly PaywallStat[];
|
|
1458
|
-
className?: string;
|
|
1459
|
-
cellClassName?: string;
|
|
1460
|
-
valueClassName?: string;
|
|
1461
|
-
labelClassName?: string;
|
|
1462
|
-
renderCell?: (stat: PaywallStat, idx: number) => ReactNode;
|
|
1463
|
-
};
|
|
1464
|
-
declare function PaywallStatsRow({ stats, className, cellClassName, valueClassName, labelClassName, renderCell, }: PaywallStatsRowProps): react_jsx_runtime.JSX.Element;
|
|
1465
|
-
|
|
1466
|
-
type PaywallFinePrintProps = {
|
|
1467
|
-
/**
|
|
1468
|
-
* Copy template. Supported substitutions:
|
|
1469
|
-
* - `{price}` → formatted current price (BRL).
|
|
1470
|
-
* - `{trialDays}` → method-specific trial days (card vs pix).
|
|
1471
|
-
* - `{cycle}` → human-readable cycle ("mensal" | "anual").
|
|
1472
|
-
*/
|
|
1473
|
-
template: string;
|
|
1474
|
-
className?: string;
|
|
1475
|
-
render?: (state: {
|
|
1476
|
-
currentPriceCents: number;
|
|
1477
|
-
cycle: string;
|
|
1478
|
-
trialDays: number;
|
|
1479
|
-
selectedMethod: string;
|
|
1480
|
-
}) => ReactNode;
|
|
1481
|
-
};
|
|
1482
|
-
declare function PaywallFinePrint({ template, className, render, }: PaywallFinePrintProps): react_jsx_runtime.JSX.Element;
|
|
1483
|
-
|
|
1484
|
-
type PaywallTrustLineItem = {
|
|
1485
|
-
icon: ReactNode;
|
|
1486
|
-
text: string;
|
|
1487
|
-
};
|
|
1488
|
-
type PaywallTrustLineProps = {
|
|
1489
|
-
items: readonly PaywallTrustLineItem[];
|
|
1490
|
-
className?: string;
|
|
1491
|
-
itemClassName?: string;
|
|
1492
|
-
renderItem?: (item: PaywallTrustLineItem, idx: number) => ReactNode;
|
|
1493
|
-
};
|
|
1494
|
-
declare function PaywallTrustLine({ items, className, itemClassName, renderItem, }: PaywallTrustLineProps): react_jsx_runtime.JSX.Element;
|
|
1495
|
-
|
|
1496
|
-
type PaywallStickyFooterProps = {
|
|
1497
|
-
children: ReactNode;
|
|
1498
|
-
className?: string;
|
|
1499
|
-
/**
|
|
1500
|
-
* When true (default), appends `pb-[env(safe-area-inset-bottom)]` so the
|
|
1501
|
-
* footer clears the home-indicator on iOS. Set false for footers that
|
|
1502
|
-
* already opt into their own safe-area handling (e.g. inside a sheet).
|
|
1503
|
-
*/
|
|
1504
|
-
safeAreaInsets?: boolean;
|
|
1505
|
-
};
|
|
1506
|
-
declare function PaywallStickyFooter({ children, className, safeAreaInsets, }: PaywallStickyFooterProps): react_jsx_runtime.JSX.Element;
|
|
1280
|
+
declare function PaywallCta({ ctaLabel, loadingLabel, switchHint, trustLine, onClick, disabled, loading, className, buttonClassName, switchHintClassName, trustClassName, }: PaywallCtaProps): react_jsx_runtime.JSX.Element;
|
|
1507
1281
|
|
|
1508
|
-
export { type AndroidBrowser, type AppConfig, AppConfigProvider, AppConfigSchema, AppRoot, type AppRootProps, type AppRootSlots, type AuthFlowConfig, type AuthFormError, type AuthFormErrorCode, type AuthScreenProps, type CheckoutMethod, type Cycle, type CycleLabels, DeepLinkHandler, type DeepLinks, DevSkipOnboardingFab, EmptyState, ErrorBoundary, type I18nConfig, I18nProvider, type I18nProviderProps, type IOSBrowser, type InAppApp, type InstallActions, InstallGate, InstallSplash, type InstallState, type InstallVariant, LanguageSwitcher, type LanguageSwitcherProps, LoadingState, type OnboardingConfig, OnboardingFlow, type OnboardingFlowProps, type OnboardingStep, type OnboardingStepCtx, type OnboardingStepDef, type PaymentMethod, PaymentReturnHandler, Paywall,
|
|
1282
|
+
export { type AndroidBrowser, type AppConfig, AppConfigProvider, AppConfigSchema, AppRoot, type AppRootProps, type AppRootSlots, type AuthFlowConfig, type AuthFormError, type AuthFormErrorCode, type AuthScreenProps, type CheckoutCardInput, type CheckoutFormCycle, type CheckoutFormMethod, type CheckoutMethod, CheckoutPageDefault, type Cycle, type CycleLabels, DeepLinkHandler, type DeepLinks, DevSkipOnboardingFab, EmptyState, ErrorBoundary, type I18nConfig, I18nProvider, type I18nProviderProps, type IOSBrowser, type InAppApp, type InstallActions, InstallGate, InstallSplash, type InstallState, type InstallVariant, LanguageSwitcher, type LanguageSwitcherProps, LoadingState, type OnboardingConfig, OnboardingFlow, type OnboardingFlowProps, type OnboardingStep, type OnboardingStepCtx, type OnboardingStepDef, type PaymentMethod, PaymentReturnHandler, Paywall, type PaywallConfig, type PaywallCopy, PaywallCta, type PaywallCtaProps, PaywallCyclePicker, type PaywallCyclePickerProps, PaywallMethodContent, type PaywallMethodContentProps, type PaywallMethodCopy, PaywallMethodTabs, type PaywallMethodTabsProps, type PaywallProps, type PaywallSlots, type PaywallThemeClasses, type PersistedKey, PersistenceRegistry, type PersistenceRegistryProps, type PixPending, PixWaitingPageDefault, type Platform, PreAuthShell, type PreAuthShellProps, PushPrompt, type PushPromptProps, type PushPromptTexts, type PushUiState, RouteBoundary, type RouteBoundaryProps, type SkipDefaults, type SubscriptionStatus, type ToastItem, type UseCheckoutFormArgs, type UseCheckoutFormResult, type UseLoginFormResult, type UseResetFormResult, asaasErrorMessage, computeAnchorCents, dailyFromYearly, detectAndroidBrowser, detectIOSBrowser, detectInAppApp, detectPlatform, detectStandalone, discountPercent, formatBRL, isDevToolsEnabled, monthlyFromYearly, parseAppConfig, shouldBlockInstall, shouldShowPermanentOption, skipOnboarding, useAppConfig, useAuth, useAuthPrimitives, useCheckoutForm, useFeature, useForgotForm, useInstallPrompt, useLoginForm, useOnboardingStep, usePaywallState, usePlan, usePush, useReminders, useResetForm, useSignupForm, useSubscription, useToast };
|