@carlonicora/nextjs-jsonapi 5.6.0 → 5.7.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/{BlockNoteEditor-NEYG5L6W.mjs → BlockNoteEditor-R3WXUFHX.mjs} +4 -4
- package/dist/{BlockNoteEditor-AE3ZTEEH.js → BlockNoteEditor-ZHXXFWUJ.js} +19 -19
- package/dist/{BlockNoteEditor-AE3ZTEEH.js.map → BlockNoteEditor-ZHXXFWUJ.js.map} +1 -1
- package/dist/{BlockNoteViewer-3OUT5UFY.mjs → BlockNoteViewer-BVVN6D3T.mjs} +2 -2
- package/dist/{BlockNoteViewer-4CFKQM7U.js → BlockNoteViewer-SD3ZFIXD.js} +3 -3
- package/dist/{BlockNoteViewer-4CFKQM7U.js.map → BlockNoteViewer-SD3ZFIXD.js.map} +1 -1
- package/dist/billing/index.d.mts +33 -43
- package/dist/billing/index.d.ts +33 -43
- package/dist/billing/index.js +590 -574
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +28 -12
- package/dist/billing/index.mjs.map +1 -1
- package/dist/{chunk-3I5AAJXV.js → chunk-2TXE57LE.js} +3 -3
- package/dist/{chunk-3I5AAJXV.js.map → chunk-2TXE57LE.js.map} +1 -1
- package/dist/{chunk-HKZAESS6.js → chunk-5TH2DSAH.js} +17 -12
- package/dist/chunk-5TH2DSAH.js.map +1 -0
- package/dist/{chunk-SFYPXCK4.mjs → chunk-CFB6FHIY.mjs} +638 -536
- package/dist/{chunk-SFYPXCK4.mjs.map → chunk-CFB6FHIY.mjs.map} +1 -1
- package/dist/{chunk-EYA2F6AN.mjs → chunk-FK26NX3S.mjs} +16 -11
- package/dist/chunk-FK26NX3S.mjs.map +1 -0
- package/dist/{chunk-53BAULDP.js → chunk-IJME5SAM.js} +4 -4
- package/dist/{chunk-53BAULDP.js.map → chunk-IJME5SAM.js.map} +1 -1
- package/dist/{chunk-KQHBONL4.mjs → chunk-OKCV4GPJ.mjs} +2 -2
- package/dist/{chunk-BTPUYUQ3.mjs → chunk-RGQYFSJF.mjs} +2 -2
- package/dist/{chunk-Y7RR57EW.mjs → chunk-WCHLCOZG.mjs} +2 -2
- package/dist/{chunk-RL3PL3KV.js → chunk-XOSC3FFP.js} +8 -8
- package/dist/{chunk-RL3PL3KV.js.map → chunk-XOSC3FFP.js.map} +1 -1
- package/dist/{chunk-LQ4DK4JF.js → chunk-ZCOPOO7T.js} +1314 -1212
- package/dist/chunk-ZCOPOO7T.js.map +1 -0
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/index.js +4 -4
- package/dist/components/index.mjs +3 -3
- package/dist/contexts/index.js +4 -4
- package/dist/contexts/index.mjs +3 -3
- package/dist/core/index.d.mts +9 -3
- package/dist/core/index.d.ts +9 -3
- package/dist/core/index.js +10 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +9 -1
- package/dist/{format-options-D6c7FNDi.d.mts → currency-DT_dveBx.d.mts} +41 -8
- package/dist/{format-options-BtX3o0Yu.d.ts → currency-pK9eRYRC.d.ts} +41 -8
- package/dist/email-automations/index.js +92 -92
- package/dist/email-automations/index.mjs +3 -3
- package/dist/features/analytics/index.js +121 -121
- package/dist/features/analytics/index.mjs +4 -4
- package/dist/features/analytics/server.js +4 -4
- package/dist/features/analytics/server.mjs +2 -2
- package/dist/features/blog/index.js +150 -150
- package/dist/features/blog/index.mjs +3 -3
- package/dist/features/blog/server.js +16 -16
- package/dist/features/blog/server.mjs +1 -1
- package/dist/features/help/index.js +37 -37
- package/dist/features/help/index.mjs +3 -3
- package/dist/features/tokenusage/index.js +124 -124
- package/dist/features/tokenusage/index.mjs +4 -4
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -2
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +2 -2
- package/package.json +1 -1
- package/src/core/index.ts +3 -0
- package/src/features/billing/contexts/CouponContext.tsx +0 -2
- package/src/features/billing/stripe-coupon/components/details/CouponDetails.tsx +5 -2
- package/src/features/billing/stripe-coupon/components/forms/CouponCodeEditor.tsx +6 -5
- package/src/features/billing/stripe-coupon/components/forms/CouponCodeFields.tsx +67 -45
- package/src/features/billing/stripe-coupon/components/forms/CouponEditor.tsx +304 -212
- package/src/features/billing/stripe-coupon/components/widgets/CouponCodeActions.tsx +4 -3
- package/src/features/billing/stripe-coupon/data/stripe-coupon.interface.ts +11 -7
- package/src/features/billing/stripe-coupon/data/stripe-coupon.ts +6 -4
- package/src/features/billing/stripe-coupon/hooks/useStripeCouponCodeTableStructure.tsx +14 -7
- package/src/features/billing/stripe-coupon/hooks/useStripeCouponTableStructure.tsx +2 -2
- package/src/features/billing/stripe-coupon/stripe-coupon-code.module.ts +3 -2
- package/src/features/billing/stripe-coupon/stripe-coupon.module.ts +11 -4
- package/src/features/billing/stripe-promotion-code/components/PromoCodeInput.tsx +1 -1
- package/src/features/billing/stripe-subscription/hooks/wizard-promotion.ts +15 -8
- package/dist/chunk-EYA2F6AN.mjs.map +0 -1
- package/dist/chunk-HKZAESS6.js.map +0 -1
- package/dist/chunk-LQ4DK4JF.js.map +0 -1
- /package/dist/{BlockNoteEditor-NEYG5L6W.mjs.map → BlockNoteEditor-R3WXUFHX.mjs.map} +0 -0
- /package/dist/{BlockNoteViewer-3OUT5UFY.mjs.map → BlockNoteViewer-BVVN6D3T.mjs.map} +0 -0
- /package/dist/{chunk-KQHBONL4.mjs.map → chunk-OKCV4GPJ.mjs.map} +0 -0
- /package/dist/{chunk-BTPUYUQ3.mjs.map → chunk-RGQYFSJF.mjs.map} +0 -0
- /package/dist/{chunk-Y7RR57EW.mjs.map → chunk-WCHLCOZG.mjs.map} +0 -0
package/dist/billing/index.d.mts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { k as StripeSubscriptionInterface, P as PaymentMethodInterface, S as StripeCustomerInterface, a as StripeInvoiceInterface, M as MeterInterface, p as MeterSummaryInterface,
|
|
4
|
-
export {
|
|
3
|
+
import { k as StripeSubscriptionInterface, P as PaymentMethodInterface, S as StripeCustomerInterface, a as StripeInvoiceInterface, M as MeterInterface, p as MeterSummaryInterface, F as BillingFormatOptions, r as PromotionCodeValidationResult, u as StripeCouponInterface, x as StripeCouponInput, y as StripeCouponRenameInput, A as StripeCouponCodeInput, z as StripeCouponCodeInterface, B as StripeCouponCodeFlagsInput, d as StripePriceInterface, f as StripePriceInput, g as StripeProductInterface, h as StripeProductInput, I as InvoiceStatus, b as ProrationPreviewInterface, i as SubscriptionStatus, o as StripeUsageInterface } from '../currency-DT_dveBx.mjs';
|
|
4
|
+
export { G as BillingTranslator, D as formatCurrency, E as formatFixed, C as formatInterval } from '../currency-DT_dveBx.mjs';
|
|
5
5
|
import { J as JsonApiHydratedDataInterface } from '../ApiDataInterface-BcZeXy5X.mjs';
|
|
6
|
+
import { FieldValues, UseFormReturn } from 'react-hook-form';
|
|
6
7
|
import { z } from 'zod';
|
|
7
8
|
import '../feature.interface-CXb1-vNq.mjs';
|
|
8
9
|
|
|
@@ -63,27 +64,6 @@ declare function StripeProvider({ children }: {
|
|
|
63
64
|
}): React.JSX.Element;
|
|
64
65
|
declare function isStripeConfigured(): boolean;
|
|
65
66
|
|
|
66
|
-
/**
|
|
67
|
-
* Format price recurring interval for display
|
|
68
|
-
* @param price - Stripe price object
|
|
69
|
-
* @param options - `t` translates the interval words; without it the output is English
|
|
70
|
-
* @returns Formatted interval string (e.g., "/month", "/year", "/2 weeks", "one-time")
|
|
71
|
-
*/
|
|
72
|
-
declare function formatInterval(price: StripePriceInterface, options?: BillingFormatOptions): string;
|
|
73
|
-
/**
|
|
74
|
-
* Format currency amount from cents to localized currency string
|
|
75
|
-
* @param amount - Amount in cents
|
|
76
|
-
* @param currency - Currency code (e.g., "USD", "EUR", "GBP")
|
|
77
|
-
* @param options - `locale` drives number formatting; defaults to "en-US"
|
|
78
|
-
* @returns Formatted currency string (e.g., "$9.99", "€9,99")
|
|
79
|
-
*/
|
|
80
|
-
declare function formatCurrency(amount: number | undefined, currency: string, options?: BillingFormatOptions): string;
|
|
81
|
-
/**
|
|
82
|
-
* `value.toFixed(digits)` with the locale's decimal separator ("12.5" in English,
|
|
83
|
-
* "12,5" in Italian). No grouping, so English output matches `toFixed` exactly.
|
|
84
|
-
*/
|
|
85
|
-
declare function formatFixed(value: number, locale: string | undefined, digits: number): string;
|
|
86
|
-
|
|
87
67
|
/**
|
|
88
68
|
* Format a date to a localized date string
|
|
89
69
|
* @param date - Date object or ISO string
|
|
@@ -392,54 +372,64 @@ declare function CouponContainer(): React.JSX.Element | null;
|
|
|
392
372
|
declare function CouponDetails(): React.JSX.Element | null;
|
|
393
373
|
|
|
394
374
|
/**
|
|
395
|
-
*
|
|
396
|
-
*
|
|
397
|
-
*
|
|
375
|
+
* What a number or decimal `<FormInput>` holds: "" until something is typed, a
|
|
376
|
+
* number from `type="number"` (`+""` is 0 when cleared, NaN on garbage), a
|
|
377
|
+
* string from `type="decimal"` (may use a comma as the separator).
|
|
378
|
+
*
|
|
379
|
+
* The schemas below validate this raw value and never transform it, so the
|
|
380
|
+
* form's values have one type before and after validation. The `parse*`
|
|
381
|
+
* functions turn it into the number that is sent, on submit.
|
|
398
382
|
*/
|
|
399
|
-
|
|
383
|
+
type RawNumber = string | number | null | undefined;
|
|
400
384
|
/**
|
|
401
|
-
* Optional
|
|
402
|
-
*
|
|
403
|
-
* exactly as PriceEditor does (`Math.round(value * 100)`).
|
|
385
|
+
* Optional whole number of at least 1. 0, "" and NaN all mean "not set": every
|
|
386
|
+
* limit here has a floor of 1.
|
|
404
387
|
*/
|
|
405
|
-
declare
|
|
406
|
-
/**
|
|
388
|
+
declare function parseOptionalPositiveInt(value: RawNumber): number | undefined;
|
|
389
|
+
/**
|
|
390
|
+
* Optional decimal in MAJOR units. Converted to minor units on submit, exactly
|
|
391
|
+
* as PriceEditor does (`Math.round(value * 100)`).
|
|
392
|
+
*/
|
|
393
|
+
declare function parseOptionalDecimal(value: RawNumber): number | undefined;
|
|
394
|
+
declare const optionalPositiveInt: () => z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
395
|
+
declare const optionalDecimal: () => z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
407
396
|
/**
|
|
408
397
|
* Optional point in time from `<FormDateTime allowEmpty>`, which writes "" when
|
|
409
398
|
* the value is cleared (FormDateTime.tsx:136, :241).
|
|
410
399
|
*/
|
|
411
|
-
declare const optionalDate: () => z.
|
|
400
|
+
declare const optionalDate: () => z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodDate, z.ZodLiteral<"">]>>>;
|
|
401
|
+
/** Mirrors StripeCouponCodePostAttributesDTO. */
|
|
412
402
|
declare const couponCodeSchema: (t: (key: string) => string) => z.ZodObject<{
|
|
413
403
|
code: z.ZodOptional<z.ZodString>;
|
|
414
404
|
firstTimeTransaction: z.ZodBoolean;
|
|
415
|
-
minimumAmount: z.
|
|
405
|
+
minimumAmount: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
416
406
|
minimumAmountCurrency: z.ZodString;
|
|
417
407
|
stripeCustomerId: z.ZodOptional<z.ZodString>;
|
|
418
|
-
expiresAt: z.
|
|
419
|
-
maxRedemptions: z.
|
|
408
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodDate, z.ZodLiteral<"">]>>>;
|
|
409
|
+
maxRedemptions: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
420
410
|
automatic: z.ZodBoolean;
|
|
421
411
|
}, z.core.$strip>;
|
|
422
412
|
type CouponCodeFormValues = z.infer<ReturnType<typeof couponCodeSchema>>;
|
|
423
413
|
/**
|
|
424
414
|
* Every text/number input starts as "" (never undefined): FormInput spreads
|
|
425
415
|
* `field.value` onto a Base UI input, and undefined → value flips it from
|
|
426
|
-
* uncontrolled to controlled (console warning). The
|
|
427
|
-
*
|
|
416
|
+
* uncontrolled to controlled (console warning). The parse functions map ""
|
|
417
|
+
* to undefined, so empty fields are still sent as absent.
|
|
428
418
|
*/
|
|
429
|
-
declare const couponCodeDefaults: () =>
|
|
419
|
+
declare const couponCodeDefaults: () => CouponCodeFormValues;
|
|
430
420
|
/** Form values → the code attributes the models serialise. Unset fields are left out. */
|
|
431
421
|
declare const toCouponCodeInput: (values: CouponCodeFormValues) => Omit<StripeCouponCodeInput, "id" | "couponId">;
|
|
432
422
|
declare const couponCurrencyOptions: {
|
|
433
423
|
id: string;
|
|
434
424
|
text: string;
|
|
435
425
|
}[];
|
|
436
|
-
type CouponCodeFieldsProps = {
|
|
437
|
-
form:
|
|
426
|
+
type CouponCodeFieldsProps<T extends FieldValues> = {
|
|
427
|
+
form: UseFormReturn<T>;
|
|
438
428
|
/** "" for CouponCodeEditor, "firstCode." when nested inside CouponEditor. */
|
|
439
429
|
prefix?: string;
|
|
440
430
|
};
|
|
441
431
|
/** The fields of a customer-facing code, shared by CouponEditor (first code) and CouponCodeEditor. */
|
|
442
|
-
declare function CouponCodeFields({ form, prefix }: CouponCodeFieldsProps): React.JSX.Element;
|
|
432
|
+
declare function CouponCodeFields<T extends FieldValues>({ form, prefix }: CouponCodeFieldsProps<T>): React.JSX.Element;
|
|
443
433
|
|
|
444
434
|
type CouponRefresherProps = {
|
|
445
435
|
coupon: StripeCouponInterface;
|
|
@@ -686,4 +676,4 @@ type PromoCodeInputProps = {
|
|
|
686
676
|
};
|
|
687
677
|
declare function PromoCodeInput({ appliedCode, isValidating, error, onApply, onRemove, disabled, }: PromoCodeInputProps): React.JSX.Element;
|
|
688
678
|
|
|
689
|
-
export { BillingAlertBanner, BillingDashboardContainer, BillingDetailModal, type BillingDiscount, BillingFormatOptions, type BillingInterval, BillingUsageSummaryCard, CancelSubscriptionDialog, CouponCodeActions, CouponCodeEditor, type CouponCodeEditorProps, CouponCodeFields, type CouponCodeFormValues, CouponCodesList, CouponContainer, type CouponContextType, CouponDetails, CouponEditor, type CouponEditorProps, CouponProvider, type CouponProviderProps, CouponRefresher, CouponsList, CustomerInfoCard, IntervalToggle, type IntervalToggleProps, InvoiceDetails, InvoiceStatusBadge, InvoicesContainer, InvoicesList, InvoicesSummaryCard, PaymentMethodCard, PaymentMethodEditor, PaymentMethodForm, PaymentMethodSummaryCard, PaymentMethodsContainer, PaymentMethodsList, PriceArchiver, PriceContainer, type PriceContextType, PriceDetails, PriceEditor, type PriceEditorProps, PriceProvider, type PriceProviderProps, PricesList, PricingCard, type PricingCardProps, ProductArchiver, ProductContainer, type ProductContextType, ProductDetails, ProductEditor, type ProductEditorProps, ProductPricingList, type ProductPricingListProps, ProductPricingRow, type ProductPricingRowProps, ProductProvider, type ProductProviderProps, ProductsList, ProductsListContainer, PromoCodeInput, ProrationPreview, StripeProvider, SubscriptionConfirmation, SubscriptionDetails, SubscriptionStatusBadge, SubscriptionSummaryCard, SubscriptionWizard, type SubscriptionWizardProps, SubscriptionsContainer, SubscriptionsList, UsageContainer, UsageHistoryTable, UsageSummaryCard, UsageSummaryCards, WizardProgressIndicator, WizardStepPaymentMethod, WizardStepPlanSelection, WizardStepReview, applyDiscount, couponCodeDefaults, couponCodeSchema, couponCurrencyOptions,
|
|
679
|
+
export { BillingAlertBanner, BillingDashboardContainer, BillingDetailModal, type BillingDiscount, BillingFormatOptions, type BillingInterval, BillingUsageSummaryCard, CancelSubscriptionDialog, CouponCodeActions, CouponCodeEditor, type CouponCodeEditorProps, CouponCodeFields, type CouponCodeFormValues, CouponCodesList, CouponContainer, type CouponContextType, CouponDetails, CouponEditor, type CouponEditorProps, CouponProvider, type CouponProviderProps, CouponRefresher, CouponsList, CustomerInfoCard, IntervalToggle, type IntervalToggleProps, InvoiceDetails, InvoiceStatusBadge, InvoicesContainer, InvoicesList, InvoicesSummaryCard, PaymentMethodCard, PaymentMethodEditor, PaymentMethodForm, PaymentMethodSummaryCard, PaymentMethodsContainer, PaymentMethodsList, PriceArchiver, PriceContainer, type PriceContextType, PriceDetails, PriceEditor, type PriceEditorProps, PriceProvider, type PriceProviderProps, PricesList, PricingCard, type PricingCardProps, ProductArchiver, ProductContainer, type ProductContextType, ProductDetails, ProductEditor, type ProductEditorProps, ProductPricingList, type ProductPricingListProps, ProductPricingRow, type ProductPricingRowProps, ProductProvider, type ProductProviderProps, ProductsList, ProductsListContainer, PromoCodeInput, ProrationPreview, StripeProvider, SubscriptionConfirmation, SubscriptionDetails, SubscriptionStatusBadge, SubscriptionSummaryCard, SubscriptionWizard, type SubscriptionWizardProps, SubscriptionsContainer, SubscriptionsList, UsageContainer, UsageHistoryTable, UsageSummaryCard, UsageSummaryCards, WizardProgressIndicator, WizardStepPaymentMethod, WizardStepPlanSelection, WizardStepReview, applyDiscount, couponCodeDefaults, couponCodeSchema, couponCurrencyOptions, formatDate, isStripeConfigured, optionalDate, optionalDecimal, optionalPositiveInt, parseOptionalDecimal, parseOptionalPositiveInt, priceLabel, promotionCodeDiscount, subscriptionDiscount, toCouponCodeInput, useBillingFormatOptions, useCouponContext, usePriceContext, useProductContext };
|
package/dist/billing/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { k as StripeSubscriptionInterface, P as PaymentMethodInterface, S as StripeCustomerInterface, a as StripeInvoiceInterface, M as MeterInterface, p as MeterSummaryInterface,
|
|
4
|
-
export {
|
|
3
|
+
import { k as StripeSubscriptionInterface, P as PaymentMethodInterface, S as StripeCustomerInterface, a as StripeInvoiceInterface, M as MeterInterface, p as MeterSummaryInterface, F as BillingFormatOptions, r as PromotionCodeValidationResult, u as StripeCouponInterface, x as StripeCouponInput, y as StripeCouponRenameInput, A as StripeCouponCodeInput, z as StripeCouponCodeInterface, B as StripeCouponCodeFlagsInput, d as StripePriceInterface, f as StripePriceInput, g as StripeProductInterface, h as StripeProductInput, I as InvoiceStatus, b as ProrationPreviewInterface, i as SubscriptionStatus, o as StripeUsageInterface } from '../currency-pK9eRYRC.js';
|
|
4
|
+
export { G as BillingTranslator, D as formatCurrency, E as formatFixed, C as formatInterval } from '../currency-pK9eRYRC.js';
|
|
5
5
|
import { J as JsonApiHydratedDataInterface } from '../ApiDataInterface-BcZeXy5X.js';
|
|
6
|
+
import { FieldValues, UseFormReturn } from 'react-hook-form';
|
|
6
7
|
import { z } from 'zod';
|
|
7
8
|
import '../feature.interface-BO25VLlx.js';
|
|
8
9
|
|
|
@@ -63,27 +64,6 @@ declare function StripeProvider({ children }: {
|
|
|
63
64
|
}): React.JSX.Element;
|
|
64
65
|
declare function isStripeConfigured(): boolean;
|
|
65
66
|
|
|
66
|
-
/**
|
|
67
|
-
* Format price recurring interval for display
|
|
68
|
-
* @param price - Stripe price object
|
|
69
|
-
* @param options - `t` translates the interval words; without it the output is English
|
|
70
|
-
* @returns Formatted interval string (e.g., "/month", "/year", "/2 weeks", "one-time")
|
|
71
|
-
*/
|
|
72
|
-
declare function formatInterval(price: StripePriceInterface, options?: BillingFormatOptions): string;
|
|
73
|
-
/**
|
|
74
|
-
* Format currency amount from cents to localized currency string
|
|
75
|
-
* @param amount - Amount in cents
|
|
76
|
-
* @param currency - Currency code (e.g., "USD", "EUR", "GBP")
|
|
77
|
-
* @param options - `locale` drives number formatting; defaults to "en-US"
|
|
78
|
-
* @returns Formatted currency string (e.g., "$9.99", "€9,99")
|
|
79
|
-
*/
|
|
80
|
-
declare function formatCurrency(amount: number | undefined, currency: string, options?: BillingFormatOptions): string;
|
|
81
|
-
/**
|
|
82
|
-
* `value.toFixed(digits)` with the locale's decimal separator ("12.5" in English,
|
|
83
|
-
* "12,5" in Italian). No grouping, so English output matches `toFixed` exactly.
|
|
84
|
-
*/
|
|
85
|
-
declare function formatFixed(value: number, locale: string | undefined, digits: number): string;
|
|
86
|
-
|
|
87
67
|
/**
|
|
88
68
|
* Format a date to a localized date string
|
|
89
69
|
* @param date - Date object or ISO string
|
|
@@ -392,54 +372,64 @@ declare function CouponContainer(): React.JSX.Element | null;
|
|
|
392
372
|
declare function CouponDetails(): React.JSX.Element | null;
|
|
393
373
|
|
|
394
374
|
/**
|
|
395
|
-
*
|
|
396
|
-
*
|
|
397
|
-
*
|
|
375
|
+
* What a number or decimal `<FormInput>` holds: "" until something is typed, a
|
|
376
|
+
* number from `type="number"` (`+""` is 0 when cleared, NaN on garbage), a
|
|
377
|
+
* string from `type="decimal"` (may use a comma as the separator).
|
|
378
|
+
*
|
|
379
|
+
* The schemas below validate this raw value and never transform it, so the
|
|
380
|
+
* form's values have one type before and after validation. The `parse*`
|
|
381
|
+
* functions turn it into the number that is sent, on submit.
|
|
398
382
|
*/
|
|
399
|
-
|
|
383
|
+
type RawNumber = string | number | null | undefined;
|
|
400
384
|
/**
|
|
401
|
-
* Optional
|
|
402
|
-
*
|
|
403
|
-
* exactly as PriceEditor does (`Math.round(value * 100)`).
|
|
385
|
+
* Optional whole number of at least 1. 0, "" and NaN all mean "not set": every
|
|
386
|
+
* limit here has a floor of 1.
|
|
404
387
|
*/
|
|
405
|
-
declare
|
|
406
|
-
/**
|
|
388
|
+
declare function parseOptionalPositiveInt(value: RawNumber): number | undefined;
|
|
389
|
+
/**
|
|
390
|
+
* Optional decimal in MAJOR units. Converted to minor units on submit, exactly
|
|
391
|
+
* as PriceEditor does (`Math.round(value * 100)`).
|
|
392
|
+
*/
|
|
393
|
+
declare function parseOptionalDecimal(value: RawNumber): number | undefined;
|
|
394
|
+
declare const optionalPositiveInt: () => z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
395
|
+
declare const optionalDecimal: () => z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
407
396
|
/**
|
|
408
397
|
* Optional point in time from `<FormDateTime allowEmpty>`, which writes "" when
|
|
409
398
|
* the value is cleared (FormDateTime.tsx:136, :241).
|
|
410
399
|
*/
|
|
411
|
-
declare const optionalDate: () => z.
|
|
400
|
+
declare const optionalDate: () => z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodDate, z.ZodLiteral<"">]>>>;
|
|
401
|
+
/** Mirrors StripeCouponCodePostAttributesDTO. */
|
|
412
402
|
declare const couponCodeSchema: (t: (key: string) => string) => z.ZodObject<{
|
|
413
403
|
code: z.ZodOptional<z.ZodString>;
|
|
414
404
|
firstTimeTransaction: z.ZodBoolean;
|
|
415
|
-
minimumAmount: z.
|
|
405
|
+
minimumAmount: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
416
406
|
minimumAmountCurrency: z.ZodString;
|
|
417
407
|
stripeCustomerId: z.ZodOptional<z.ZodString>;
|
|
418
|
-
expiresAt: z.
|
|
419
|
-
maxRedemptions: z.
|
|
408
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodDate, z.ZodLiteral<"">]>>>;
|
|
409
|
+
maxRedemptions: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
420
410
|
automatic: z.ZodBoolean;
|
|
421
411
|
}, z.core.$strip>;
|
|
422
412
|
type CouponCodeFormValues = z.infer<ReturnType<typeof couponCodeSchema>>;
|
|
423
413
|
/**
|
|
424
414
|
* Every text/number input starts as "" (never undefined): FormInput spreads
|
|
425
415
|
* `field.value` onto a Base UI input, and undefined → value flips it from
|
|
426
|
-
* uncontrolled to controlled (console warning). The
|
|
427
|
-
*
|
|
416
|
+
* uncontrolled to controlled (console warning). The parse functions map ""
|
|
417
|
+
* to undefined, so empty fields are still sent as absent.
|
|
428
418
|
*/
|
|
429
|
-
declare const couponCodeDefaults: () =>
|
|
419
|
+
declare const couponCodeDefaults: () => CouponCodeFormValues;
|
|
430
420
|
/** Form values → the code attributes the models serialise. Unset fields are left out. */
|
|
431
421
|
declare const toCouponCodeInput: (values: CouponCodeFormValues) => Omit<StripeCouponCodeInput, "id" | "couponId">;
|
|
432
422
|
declare const couponCurrencyOptions: {
|
|
433
423
|
id: string;
|
|
434
424
|
text: string;
|
|
435
425
|
}[];
|
|
436
|
-
type CouponCodeFieldsProps = {
|
|
437
|
-
form:
|
|
426
|
+
type CouponCodeFieldsProps<T extends FieldValues> = {
|
|
427
|
+
form: UseFormReturn<T>;
|
|
438
428
|
/** "" for CouponCodeEditor, "firstCode." when nested inside CouponEditor. */
|
|
439
429
|
prefix?: string;
|
|
440
430
|
};
|
|
441
431
|
/** The fields of a customer-facing code, shared by CouponEditor (first code) and CouponCodeEditor. */
|
|
442
|
-
declare function CouponCodeFields({ form, prefix }: CouponCodeFieldsProps): React.JSX.Element;
|
|
432
|
+
declare function CouponCodeFields<T extends FieldValues>({ form, prefix }: CouponCodeFieldsProps<T>): React.JSX.Element;
|
|
443
433
|
|
|
444
434
|
type CouponRefresherProps = {
|
|
445
435
|
coupon: StripeCouponInterface;
|
|
@@ -686,4 +676,4 @@ type PromoCodeInputProps = {
|
|
|
686
676
|
};
|
|
687
677
|
declare function PromoCodeInput({ appliedCode, isValidating, error, onApply, onRemove, disabled, }: PromoCodeInputProps): React.JSX.Element;
|
|
688
678
|
|
|
689
|
-
export { BillingAlertBanner, BillingDashboardContainer, BillingDetailModal, type BillingDiscount, BillingFormatOptions, type BillingInterval, BillingUsageSummaryCard, CancelSubscriptionDialog, CouponCodeActions, CouponCodeEditor, type CouponCodeEditorProps, CouponCodeFields, type CouponCodeFormValues, CouponCodesList, CouponContainer, type CouponContextType, CouponDetails, CouponEditor, type CouponEditorProps, CouponProvider, type CouponProviderProps, CouponRefresher, CouponsList, CustomerInfoCard, IntervalToggle, type IntervalToggleProps, InvoiceDetails, InvoiceStatusBadge, InvoicesContainer, InvoicesList, InvoicesSummaryCard, PaymentMethodCard, PaymentMethodEditor, PaymentMethodForm, PaymentMethodSummaryCard, PaymentMethodsContainer, PaymentMethodsList, PriceArchiver, PriceContainer, type PriceContextType, PriceDetails, PriceEditor, type PriceEditorProps, PriceProvider, type PriceProviderProps, PricesList, PricingCard, type PricingCardProps, ProductArchiver, ProductContainer, type ProductContextType, ProductDetails, ProductEditor, type ProductEditorProps, ProductPricingList, type ProductPricingListProps, ProductPricingRow, type ProductPricingRowProps, ProductProvider, type ProductProviderProps, ProductsList, ProductsListContainer, PromoCodeInput, ProrationPreview, StripeProvider, SubscriptionConfirmation, SubscriptionDetails, SubscriptionStatusBadge, SubscriptionSummaryCard, SubscriptionWizard, type SubscriptionWizardProps, SubscriptionsContainer, SubscriptionsList, UsageContainer, UsageHistoryTable, UsageSummaryCard, UsageSummaryCards, WizardProgressIndicator, WizardStepPaymentMethod, WizardStepPlanSelection, WizardStepReview, applyDiscount, couponCodeDefaults, couponCodeSchema, couponCurrencyOptions,
|
|
679
|
+
export { BillingAlertBanner, BillingDashboardContainer, BillingDetailModal, type BillingDiscount, BillingFormatOptions, type BillingInterval, BillingUsageSummaryCard, CancelSubscriptionDialog, CouponCodeActions, CouponCodeEditor, type CouponCodeEditorProps, CouponCodeFields, type CouponCodeFormValues, CouponCodesList, CouponContainer, type CouponContextType, CouponDetails, CouponEditor, type CouponEditorProps, CouponProvider, type CouponProviderProps, CouponRefresher, CouponsList, CustomerInfoCard, IntervalToggle, type IntervalToggleProps, InvoiceDetails, InvoiceStatusBadge, InvoicesContainer, InvoicesList, InvoicesSummaryCard, PaymentMethodCard, PaymentMethodEditor, PaymentMethodForm, PaymentMethodSummaryCard, PaymentMethodsContainer, PaymentMethodsList, PriceArchiver, PriceContainer, type PriceContextType, PriceDetails, PriceEditor, type PriceEditorProps, PriceProvider, type PriceProviderProps, PricesList, PricingCard, type PricingCardProps, ProductArchiver, ProductContainer, type ProductContextType, ProductDetails, ProductEditor, type ProductEditorProps, ProductPricingList, type ProductPricingListProps, ProductPricingRow, type ProductPricingRowProps, ProductProvider, type ProductProviderProps, ProductsList, ProductsListContainer, PromoCodeInput, ProrationPreview, StripeProvider, SubscriptionConfirmation, SubscriptionDetails, SubscriptionStatusBadge, SubscriptionSummaryCard, SubscriptionWizard, type SubscriptionWizardProps, SubscriptionsContainer, SubscriptionsList, UsageContainer, UsageHistoryTable, UsageSummaryCard, UsageSummaryCards, WizardProgressIndicator, WizardStepPaymentMethod, WizardStepPlanSelection, WizardStepReview, applyDiscount, couponCodeDefaults, couponCodeSchema, couponCurrencyOptions, formatDate, isStripeConfigured, optionalDate, optionalDecimal, optionalPositiveInt, parseOptionalDecimal, parseOptionalPositiveInt, priceLabel, promotionCodeDiscount, subscriptionDiscount, toCouponCodeInput, useBillingFormatOptions, useCouponContext, usePriceContext, useProductContext };
|