@carlonicora/nextjs-jsonapi 2.5.0 → 3.0.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/{BlockNoteEditor-TIMGYKAA.js → BlockNoteEditor-3IZ7PMFM.js} +19 -19
- package/dist/{BlockNoteEditor-TIMGYKAA.js.map → BlockNoteEditor-3IZ7PMFM.js.map} +1 -1
- package/dist/{BlockNoteEditor-YFJMXJEU.mjs → BlockNoteEditor-G4XNDV2O.mjs} +4 -4
- package/dist/billing/index.d.mts +127 -46
- package/dist/billing/index.d.ts +127 -46
- package/dist/billing/index.js +1243 -1084
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +983 -824
- package/dist/billing/index.mjs.map +1 -1
- package/dist/{chunk-RTOC53EZ.js → chunk-53B6NPGA.js} +34 -4
- package/dist/chunk-53B6NPGA.js.map +1 -0
- package/dist/{chunk-7HKJNUW7.js → chunk-5GVBUTS4.js} +1142 -953
- package/dist/chunk-5GVBUTS4.js.map +1 -0
- package/dist/{chunk-OTEDZ6YW.js → chunk-JKGEJGSD.js} +7 -7
- package/dist/{chunk-OTEDZ6YW.js.map → chunk-JKGEJGSD.js.map} +1 -1
- package/dist/{chunk-DJWNNV52.mjs → chunk-PHEFWL6L.mjs} +2 -2
- package/dist/{chunk-FS4RVV3K.mjs → chunk-TWXKAY34.mjs} +33 -3
- package/dist/chunk-TWXKAY34.mjs.map +1 -0
- package/dist/{chunk-G4YS52SO.mjs → chunk-WCX4CLRJ.mjs} +1607 -1418
- package/dist/chunk-WCX4CLRJ.mjs.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 +17 -1
- package/dist/core/index.d.ts +17 -1
- package/dist/core/index.js +6 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +5 -1
- package/dist/features/help/index.js +37 -37
- package/dist/features/help/index.mjs +3 -3
- package/dist/features/tokenusage/index.js +101 -101
- package/dist/features/tokenusage/index.mjs +3 -3
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -2
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +1 -1
- package/package.json +1 -1
- package/src/client/index.ts +4 -0
- package/src/features/administration/components/AdminIndexContainer.tsx +1 -1
- package/src/features/administration/components/__tests__/AdminIndexContainer.spec.tsx +1 -1
- package/src/features/billing/contexts/PriceContext.tsx +202 -0
- package/src/features/billing/contexts/ProductContext.tsx +185 -0
- package/src/features/billing/contexts/__tests__/PriceContext.spec.tsx +89 -0
- package/src/features/billing/contexts/__tests__/ProductContext.spec.tsx +81 -0
- package/src/features/billing/contexts/index.ts +2 -1
- package/src/features/billing/i18n-keys.ts +88 -0
- package/src/features/billing/stripe-price/components/containers/PriceContainer.tsx +21 -0
- package/src/features/billing/stripe-price/components/containers/index.ts +1 -0
- package/src/features/billing/stripe-price/components/details/PriceDetails.tsx +131 -0
- package/src/features/billing/stripe-price/components/details/index.ts +1 -0
- package/src/features/billing/stripe-price/components/forms/PriceArchiver.tsx +55 -0
- package/src/features/billing/stripe-price/components/forms/PriceEditor.tsx +307 -374
- package/src/features/billing/stripe-price/components/forms/index.ts +3 -1
- package/src/features/billing/stripe-price/components/index.ts +2 -0
- package/src/features/billing/stripe-price/components/lists/PricesList.tsx +49 -267
- package/src/features/billing/stripe-price/data/index.ts +1 -0
- package/src/features/billing/stripe-price/data/stripe-price.fields.ts +8 -0
- package/src/features/billing/stripe-price/hooks/useStripePriceTableStructure.tsx +119 -0
- package/src/features/billing/stripe-price/stripe-price.module.ts +5 -1
- package/src/features/billing/stripe-product/components/containers/ProductContainer.tsx +45 -0
- package/src/features/billing/stripe-product/components/containers/ProductsListContainer.tsx +27 -0
- package/src/features/billing/stripe-product/components/containers/index.ts +2 -2
- package/src/features/billing/stripe-product/components/details/ProductDetails.tsx +45 -0
- package/src/features/billing/stripe-product/components/details/index.ts +1 -0
- package/src/features/billing/stripe-product/components/forms/ProductArchiver.tsx +55 -0
- package/src/features/billing/stripe-product/components/forms/ProductEditor.tsx +92 -81
- package/src/features/billing/stripe-product/components/forms/index.ts +3 -1
- package/src/features/billing/stripe-product/components/index.ts +1 -0
- package/src/features/billing/stripe-product/components/lists/ProductsList.tsx +45 -187
- package/src/features/billing/stripe-product/data/index.ts +1 -0
- package/src/features/billing/stripe-product/data/stripe-product.fields.ts +6 -0
- package/src/features/billing/stripe-product/hooks/useStripeProductTableStructure.tsx +80 -0
- package/src/features/billing/stripe-product/stripe-product.module.ts +5 -1
- package/src/features/user/components/forms/UserEditor.tsx +11 -2
- package/dist/chunk-7HKJNUW7.js.map +0 -1
- package/dist/chunk-FS4RVV3K.mjs.map +0 -1
- package/dist/chunk-G4YS52SO.mjs.map +0 -1
- package/dist/chunk-RTOC53EZ.js.map +0 -1
- package/src/features/billing/contexts/BillingContext.tsx +0 -95
- package/src/features/billing/stripe-product/components/containers/ProductsAdminContainer.tsx +0 -98
- package/src/features/billing/stripe-product/components/containers/ProductsAdminPageContainer.tsx +0 -27
- /package/dist/{BlockNoteEditor-YFJMXJEU.mjs.map → BlockNoteEditor-G4XNDV2O.mjs.map} +0 -0
- /package/dist/{chunk-DJWNNV52.mjs.map → chunk-PHEFWL6L.mjs.map} +0 -0
package/dist/billing/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { j as StripeSubscriptionInterface, P as PaymentMethodInterface, S as StripeCustomerInterface, a as StripeInvoiceInterface, M as MeterInterface, o as MeterSummaryInterface, d as StripePriceInterface,
|
|
4
|
-
import '../ApiDataInterface-BcZeXy5X.mjs';
|
|
3
|
+
import { j as StripeSubscriptionInterface, P as PaymentMethodInterface, S as StripeCustomerInterface, a as StripeInvoiceInterface, M as MeterInterface, o as MeterSummaryInterface, d as StripePriceInterface, f as StripePriceInput, g as StripeProductInterface, h as StripeProductInput, I as InvoiceStatus, b as ProrationPreviewInterface, i as SubscriptionStatus, n as StripeUsageInterface, q as PromotionCodeValidationResult } from '../stripe-promotion-code.interface-ClZ7DxS9.mjs';
|
|
4
|
+
import { J as JsonApiHydratedDataInterface } from '../ApiDataInterface-BcZeXy5X.mjs';
|
|
5
5
|
import '../feature.interface-CXb1-vNq.mjs';
|
|
6
6
|
|
|
7
7
|
type SubscriptionSummaryCardProps = {
|
|
@@ -89,35 +89,65 @@ type BillingAlertBannerProps = {
|
|
|
89
89
|
};
|
|
90
90
|
declare function BillingAlertBanner({ subscription, onUpdatePayment, onAddPayment }: BillingAlertBannerProps): React.JSX.Element | null;
|
|
91
91
|
|
|
92
|
-
interface
|
|
92
|
+
interface PriceContextType {
|
|
93
|
+
price: StripePriceInterface | undefined;
|
|
94
|
+
setPrice: (value: StripePriceInterface | undefined) => void;
|
|
95
|
+
reloadPrice: () => Promise<void>;
|
|
96
|
+
createPrice: (input: StripePriceInput) => Promise<StripePriceInterface>;
|
|
97
|
+
updatePrice: (input: StripePriceInput) => Promise<StripePriceInterface>;
|
|
98
|
+
archivePrice: (id?: string) => Promise<void>;
|
|
99
|
+
restorePrice: (id?: string) => Promise<void>;
|
|
100
|
+
/** Bumped by every mutation. Mounted lists re-fetch on it. */
|
|
101
|
+
priceVersion: number;
|
|
102
|
+
refreshPrices: () => void;
|
|
103
|
+
/** Product a newly created price attaches to. Set in list mode (prices tab). */
|
|
104
|
+
productId: string | undefined;
|
|
105
|
+
}
|
|
106
|
+
type PriceProviderProps = {
|
|
107
|
+
children: ReactNode;
|
|
108
|
+
dehydratedPrice?: JsonApiHydratedDataInterface;
|
|
93
109
|
/**
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
110
|
+
* Publish breadcrumbs + title into SharedProvider. Pass `false` when this
|
|
111
|
+
* provider is mounted INSIDE another entity's page (the prices tab mounts
|
|
112
|
+
* PriceProvider that way): SharedProvider replaces its value for the subtree
|
|
113
|
+
* rather than merging (SharedContext.tsx:35-37), so a nested provider that
|
|
114
|
+
* publishes chrome would blank the host page's title.
|
|
97
115
|
*/
|
|
98
|
-
|
|
99
|
-
|
|
116
|
+
publishChrome?: boolean;
|
|
117
|
+
/** Required in list mode (the prices tab) so new prices attach to the right product. */
|
|
118
|
+
productId?: string;
|
|
119
|
+
};
|
|
120
|
+
/** Human label for a price: its nickname, else amount + interval. */
|
|
121
|
+
declare function priceLabel(price: StripePriceInterface): string;
|
|
122
|
+
declare const PriceProvider: ({ children, dehydratedPrice, publishChrome, productId: productIdProp, }: PriceProviderProps) => React.JSX.Element;
|
|
123
|
+
declare const usePriceContext: () => PriceContextType;
|
|
124
|
+
|
|
125
|
+
interface ProductContextType {
|
|
126
|
+
product: StripeProductInterface | undefined;
|
|
127
|
+
setProduct: (value: StripeProductInterface | undefined) => void;
|
|
128
|
+
reloadProduct: () => Promise<void>;
|
|
129
|
+
createProduct: (input: StripeProductInput) => Promise<StripeProductInterface>;
|
|
130
|
+
updateProduct: (input: StripeProductInput) => Promise<StripeProductInterface>;
|
|
131
|
+
archiveProduct: (id?: string) => Promise<void>;
|
|
132
|
+
restoreProduct: (id?: string) => Promise<void>;
|
|
133
|
+
/** Bumped by every mutation. Mounted lists re-fetch on it. */
|
|
134
|
+
catalogueVersion: number;
|
|
135
|
+
refreshCatalogue: () => void;
|
|
100
136
|
}
|
|
101
|
-
type
|
|
137
|
+
type ProductProviderProps = {
|
|
102
138
|
children: ReactNode;
|
|
139
|
+
dehydratedProduct?: JsonApiHydratedDataInterface;
|
|
140
|
+
/**
|
|
141
|
+
* Publish breadcrumbs + title into SharedProvider. Pass `false` when this
|
|
142
|
+
* provider is mounted INSIDE another entity's page (the prices tab mounts
|
|
143
|
+
* PriceProvider that way): SharedProvider replaces its value for the subtree
|
|
144
|
+
* rather than merging (SharedContext.tsx:35-37), so a nested provider that
|
|
145
|
+
* publishes chrome would blank the host page's title.
|
|
146
|
+
*/
|
|
147
|
+
publishChrome?: boolean;
|
|
103
148
|
};
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
* and their credit allowances).
|
|
107
|
-
*
|
|
108
|
-
* Billing gets its own provider rather than borrowing AdministrationProvider so
|
|
109
|
-
* the page carries its own name — and, like CompanyProvider with CompanyEditor,
|
|
110
|
-
* it owns the page's ACTIONS: the create-product control is published through
|
|
111
|
-
* `title.functions`, which RoundPageContainerTitle renders in the header bar.
|
|
112
|
-
* That is where every other page in this codebase puts its primary action.
|
|
113
|
-
*/
|
|
114
|
-
declare const BillingProvider: ({ children }: BillingProviderProps) => React.JSX.Element;
|
|
115
|
-
declare const useBillingContext: () => BillingContextType;
|
|
116
|
-
/**
|
|
117
|
-
* Non-throwing variant. ProductsAdminContainer predates this provider and is
|
|
118
|
-
* still mounted bare by other consumers, so it must keep working without one.
|
|
119
|
-
*/
|
|
120
|
-
declare const useOptionalBillingContext: () => BillingContextType | undefined;
|
|
149
|
+
declare const ProductProvider: ({ children, dehydratedProduct, publishChrome }: ProductProviderProps) => React.JSX.Element;
|
|
150
|
+
declare const useProductContext: () => ProductContextType;
|
|
121
151
|
|
|
122
152
|
declare function PaymentMethodsContainer(): React.JSX.Element;
|
|
123
153
|
|
|
@@ -168,45 +198,96 @@ type InvoiceStatusBadgeProps = {
|
|
|
168
198
|
};
|
|
169
199
|
declare function InvoiceStatusBadge({ status }: InvoiceStatusBadgeProps): React.JSX.Element;
|
|
170
200
|
|
|
201
|
+
declare function PriceContainer(): React.JSX.Element | null;
|
|
202
|
+
|
|
203
|
+
declare function PriceDetails(): React.JSX.Element | null;
|
|
204
|
+
|
|
205
|
+
type PriceArchiverProps = {
|
|
206
|
+
price: StripePriceInterface;
|
|
207
|
+
};
|
|
208
|
+
/**
|
|
209
|
+
* Archive / restore control for a price. Built on ConfirmDialog, which is
|
|
210
|
+
* controlled and trigger-less by design — the caller owns the trigger button,
|
|
211
|
+
* so none of Base UI's trigger-composition pitfalls apply (no asChild, no
|
|
212
|
+
* nested <button>).
|
|
213
|
+
*/
|
|
214
|
+
declare function PriceArchiver({ price }: PriceArchiverProps): React.JSX.Element;
|
|
215
|
+
|
|
171
216
|
type PriceEditorProps = {
|
|
172
|
-
productId
|
|
217
|
+
productId?: string;
|
|
173
218
|
price?: StripePriceInterface;
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
219
|
+
propagateChanges?: (price: StripePriceInterface) => void;
|
|
220
|
+
onSuccess?: () => void | Promise<void>;
|
|
221
|
+
trigger?: ReactNode;
|
|
222
|
+
forceShow?: boolean;
|
|
223
|
+
onClose?: () => void;
|
|
224
|
+
dialogOpen?: boolean;
|
|
225
|
+
onDialogOpenChange?: (open: boolean) => void;
|
|
177
226
|
};
|
|
178
|
-
declare function PriceEditor(
|
|
227
|
+
declare function PriceEditor(props: PriceEditorProps): React.JSX.Element;
|
|
179
228
|
|
|
180
229
|
type PricesListProps = {
|
|
181
230
|
productId: string;
|
|
182
|
-
|
|
231
|
+
/**
|
|
232
|
+
* Only when the list IS the page's own content inside a `RoundPageContainer
|
|
233
|
+
* fullWidth`. Inside a tab panel leave it unset, or ContentListTable drops its
|
|
234
|
+
* own `rounded-md border` and the table floats borderless in the panel.
|
|
235
|
+
* Mirrors ThreatList, which is rendered both ways.
|
|
236
|
+
*/
|
|
237
|
+
fullWidth?: boolean;
|
|
183
238
|
};
|
|
184
|
-
declare function PricesList({ productId,
|
|
239
|
+
declare function PricesList({ productId, fullWidth }: PricesListProps): React.JSX.Element;
|
|
185
240
|
|
|
186
|
-
declare function
|
|
241
|
+
declare function ProductContainer(): React.JSX.Element | null;
|
|
187
242
|
|
|
188
243
|
/**
|
|
189
|
-
* Page
|
|
244
|
+
* Page container for the administrative product list.
|
|
190
245
|
*
|
|
191
246
|
* Client component by necessity: `module={Modules.StripeProduct}` is a registry
|
|
192
|
-
* entry
|
|
193
|
-
* across the boundary.
|
|
247
|
+
* entry carrying an icon component and methods, which a Server Component cannot
|
|
248
|
+
* pass across the boundary. Routes mount this container instead — the same
|
|
249
|
+
* shape as every other list page.
|
|
250
|
+
*
|
|
251
|
+
* No `forceHeader`: ContentListTable draws its own header row with the title
|
|
252
|
+
* and the create action, exactly as the company and user list pages do.
|
|
194
253
|
*/
|
|
195
|
-
declare function
|
|
254
|
+
declare function ProductsListContainer(): React.JSX.Element;
|
|
255
|
+
|
|
256
|
+
declare function ProductDetails(): React.JSX.Element | null;
|
|
257
|
+
|
|
258
|
+
type ProductArchiverProps = {
|
|
259
|
+
product: StripeProductInterface;
|
|
260
|
+
};
|
|
261
|
+
/**
|
|
262
|
+
* Archive / restore control for a product. Built on ConfirmDialog, which is
|
|
263
|
+
* controlled and trigger-less by design — the caller owns the trigger button,
|
|
264
|
+
* so none of Base UI's trigger-composition pitfalls apply (no asChild, no
|
|
265
|
+
* nested <button>).
|
|
266
|
+
*/
|
|
267
|
+
declare function ProductArchiver({ product }: ProductArchiverProps): React.JSX.Element;
|
|
196
268
|
|
|
197
269
|
type ProductEditorProps = {
|
|
198
270
|
product?: StripeProductInterface;
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
271
|
+
propagateChanges?: (product: StripeProductInterface) => void;
|
|
272
|
+
onSuccess?: () => void | Promise<void>;
|
|
273
|
+
trigger?: ReactNode;
|
|
274
|
+
forceShow?: boolean;
|
|
275
|
+
onClose?: () => void;
|
|
276
|
+
dialogOpen?: boolean;
|
|
277
|
+
onDialogOpenChange?: (open: boolean) => void;
|
|
202
278
|
};
|
|
203
|
-
declare function ProductEditor(
|
|
279
|
+
declare function ProductEditor(props: ProductEditorProps): React.JSX.Element;
|
|
204
280
|
|
|
205
281
|
type ProductsListProps = {
|
|
206
|
-
|
|
207
|
-
|
|
282
|
+
/**
|
|
283
|
+
* Pass this whenever the list is the page's own content inside a
|
|
284
|
+
* `RoundPageContainer fullWidth`. Without it ContentListTable wraps itself in
|
|
285
|
+
* `rounded-md border`, drawing a second bordered card inside the page's
|
|
286
|
+
* rounded shell.
|
|
287
|
+
*/
|
|
288
|
+
fullWidth?: boolean;
|
|
208
289
|
};
|
|
209
|
-
declare function ProductsList({
|
|
290
|
+
declare function ProductsList({ fullWidth }?: ProductsListProps): React.JSX.Element;
|
|
210
291
|
|
|
211
292
|
type SubscriptionsContainerProps = {
|
|
212
293
|
onOpenWizard?: (subscription?: StripeSubscriptionInterface) => void;
|
|
@@ -328,4 +409,4 @@ type PromoCodeInputProps = {
|
|
|
328
409
|
};
|
|
329
410
|
declare function PromoCodeInput({ appliedCode, isValidating, error, onApply, onRemove, disabled, }: PromoCodeInputProps): React.JSX.Element;
|
|
330
411
|
|
|
331
|
-
export { BillingAlertBanner, BillingDashboardContainer, BillingDetailModal, type BillingInterval,
|
|
412
|
+
export { BillingAlertBanner, BillingDashboardContainer, BillingDetailModal, type BillingInterval, BillingUsageSummaryCard, CancelSubscriptionDialog, 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, SubscriptionsContainer, SubscriptionsList, UsageContainer, UsageHistoryTable, UsageSummaryCard, UsageSummaryCards, formatCurrency, formatDate, formatInterval, isStripeConfigured, priceLabel, usePriceContext, useProductContext };
|
package/dist/billing/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { j as StripeSubscriptionInterface, P as PaymentMethodInterface, S as StripeCustomerInterface, a as StripeInvoiceInterface, M as MeterInterface, o as MeterSummaryInterface, d as StripePriceInterface,
|
|
4
|
-
import '../ApiDataInterface-BcZeXy5X.js';
|
|
3
|
+
import { j as StripeSubscriptionInterface, P as PaymentMethodInterface, S as StripeCustomerInterface, a as StripeInvoiceInterface, M as MeterInterface, o as MeterSummaryInterface, d as StripePriceInterface, f as StripePriceInput, g as StripeProductInterface, h as StripeProductInput, I as InvoiceStatus, b as ProrationPreviewInterface, i as SubscriptionStatus, n as StripeUsageInterface, q as PromotionCodeValidationResult } from '../stripe-promotion-code.interface-C3qqh3mi.js';
|
|
4
|
+
import { J as JsonApiHydratedDataInterface } from '../ApiDataInterface-BcZeXy5X.js';
|
|
5
5
|
import '../feature.interface-BO25VLlx.js';
|
|
6
6
|
|
|
7
7
|
type SubscriptionSummaryCardProps = {
|
|
@@ -89,35 +89,65 @@ type BillingAlertBannerProps = {
|
|
|
89
89
|
};
|
|
90
90
|
declare function BillingAlertBanner({ subscription, onUpdatePayment, onAddPayment }: BillingAlertBannerProps): React.JSX.Element | null;
|
|
91
91
|
|
|
92
|
-
interface
|
|
92
|
+
interface PriceContextType {
|
|
93
|
+
price: StripePriceInterface | undefined;
|
|
94
|
+
setPrice: (value: StripePriceInterface | undefined) => void;
|
|
95
|
+
reloadPrice: () => Promise<void>;
|
|
96
|
+
createPrice: (input: StripePriceInput) => Promise<StripePriceInterface>;
|
|
97
|
+
updatePrice: (input: StripePriceInput) => Promise<StripePriceInterface>;
|
|
98
|
+
archivePrice: (id?: string) => Promise<void>;
|
|
99
|
+
restorePrice: (id?: string) => Promise<void>;
|
|
100
|
+
/** Bumped by every mutation. Mounted lists re-fetch on it. */
|
|
101
|
+
priceVersion: number;
|
|
102
|
+
refreshPrices: () => void;
|
|
103
|
+
/** Product a newly created price attaches to. Set in list mode (prices tab). */
|
|
104
|
+
productId: string | undefined;
|
|
105
|
+
}
|
|
106
|
+
type PriceProviderProps = {
|
|
107
|
+
children: ReactNode;
|
|
108
|
+
dehydratedPrice?: JsonApiHydratedDataInterface;
|
|
93
109
|
/**
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
110
|
+
* Publish breadcrumbs + title into SharedProvider. Pass `false` when this
|
|
111
|
+
* provider is mounted INSIDE another entity's page (the prices tab mounts
|
|
112
|
+
* PriceProvider that way): SharedProvider replaces its value for the subtree
|
|
113
|
+
* rather than merging (SharedContext.tsx:35-37), so a nested provider that
|
|
114
|
+
* publishes chrome would blank the host page's title.
|
|
97
115
|
*/
|
|
98
|
-
|
|
99
|
-
|
|
116
|
+
publishChrome?: boolean;
|
|
117
|
+
/** Required in list mode (the prices tab) so new prices attach to the right product. */
|
|
118
|
+
productId?: string;
|
|
119
|
+
};
|
|
120
|
+
/** Human label for a price: its nickname, else amount + interval. */
|
|
121
|
+
declare function priceLabel(price: StripePriceInterface): string;
|
|
122
|
+
declare const PriceProvider: ({ children, dehydratedPrice, publishChrome, productId: productIdProp, }: PriceProviderProps) => React.JSX.Element;
|
|
123
|
+
declare const usePriceContext: () => PriceContextType;
|
|
124
|
+
|
|
125
|
+
interface ProductContextType {
|
|
126
|
+
product: StripeProductInterface | undefined;
|
|
127
|
+
setProduct: (value: StripeProductInterface | undefined) => void;
|
|
128
|
+
reloadProduct: () => Promise<void>;
|
|
129
|
+
createProduct: (input: StripeProductInput) => Promise<StripeProductInterface>;
|
|
130
|
+
updateProduct: (input: StripeProductInput) => Promise<StripeProductInterface>;
|
|
131
|
+
archiveProduct: (id?: string) => Promise<void>;
|
|
132
|
+
restoreProduct: (id?: string) => Promise<void>;
|
|
133
|
+
/** Bumped by every mutation. Mounted lists re-fetch on it. */
|
|
134
|
+
catalogueVersion: number;
|
|
135
|
+
refreshCatalogue: () => void;
|
|
100
136
|
}
|
|
101
|
-
type
|
|
137
|
+
type ProductProviderProps = {
|
|
102
138
|
children: ReactNode;
|
|
139
|
+
dehydratedProduct?: JsonApiHydratedDataInterface;
|
|
140
|
+
/**
|
|
141
|
+
* Publish breadcrumbs + title into SharedProvider. Pass `false` when this
|
|
142
|
+
* provider is mounted INSIDE another entity's page (the prices tab mounts
|
|
143
|
+
* PriceProvider that way): SharedProvider replaces its value for the subtree
|
|
144
|
+
* rather than merging (SharedContext.tsx:35-37), so a nested provider that
|
|
145
|
+
* publishes chrome would blank the host page's title.
|
|
146
|
+
*/
|
|
147
|
+
publishChrome?: boolean;
|
|
103
148
|
};
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
* and their credit allowances).
|
|
107
|
-
*
|
|
108
|
-
* Billing gets its own provider rather than borrowing AdministrationProvider so
|
|
109
|
-
* the page carries its own name — and, like CompanyProvider with CompanyEditor,
|
|
110
|
-
* it owns the page's ACTIONS: the create-product control is published through
|
|
111
|
-
* `title.functions`, which RoundPageContainerTitle renders in the header bar.
|
|
112
|
-
* That is where every other page in this codebase puts its primary action.
|
|
113
|
-
*/
|
|
114
|
-
declare const BillingProvider: ({ children }: BillingProviderProps) => React.JSX.Element;
|
|
115
|
-
declare const useBillingContext: () => BillingContextType;
|
|
116
|
-
/**
|
|
117
|
-
* Non-throwing variant. ProductsAdminContainer predates this provider and is
|
|
118
|
-
* still mounted bare by other consumers, so it must keep working without one.
|
|
119
|
-
*/
|
|
120
|
-
declare const useOptionalBillingContext: () => BillingContextType | undefined;
|
|
149
|
+
declare const ProductProvider: ({ children, dehydratedProduct, publishChrome }: ProductProviderProps) => React.JSX.Element;
|
|
150
|
+
declare const useProductContext: () => ProductContextType;
|
|
121
151
|
|
|
122
152
|
declare function PaymentMethodsContainer(): React.JSX.Element;
|
|
123
153
|
|
|
@@ -168,45 +198,96 @@ type InvoiceStatusBadgeProps = {
|
|
|
168
198
|
};
|
|
169
199
|
declare function InvoiceStatusBadge({ status }: InvoiceStatusBadgeProps): React.JSX.Element;
|
|
170
200
|
|
|
201
|
+
declare function PriceContainer(): React.JSX.Element | null;
|
|
202
|
+
|
|
203
|
+
declare function PriceDetails(): React.JSX.Element | null;
|
|
204
|
+
|
|
205
|
+
type PriceArchiverProps = {
|
|
206
|
+
price: StripePriceInterface;
|
|
207
|
+
};
|
|
208
|
+
/**
|
|
209
|
+
* Archive / restore control for a price. Built on ConfirmDialog, which is
|
|
210
|
+
* controlled and trigger-less by design — the caller owns the trigger button,
|
|
211
|
+
* so none of Base UI's trigger-composition pitfalls apply (no asChild, no
|
|
212
|
+
* nested <button>).
|
|
213
|
+
*/
|
|
214
|
+
declare function PriceArchiver({ price }: PriceArchiverProps): React.JSX.Element;
|
|
215
|
+
|
|
171
216
|
type PriceEditorProps = {
|
|
172
|
-
productId
|
|
217
|
+
productId?: string;
|
|
173
218
|
price?: StripePriceInterface;
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
219
|
+
propagateChanges?: (price: StripePriceInterface) => void;
|
|
220
|
+
onSuccess?: () => void | Promise<void>;
|
|
221
|
+
trigger?: ReactNode;
|
|
222
|
+
forceShow?: boolean;
|
|
223
|
+
onClose?: () => void;
|
|
224
|
+
dialogOpen?: boolean;
|
|
225
|
+
onDialogOpenChange?: (open: boolean) => void;
|
|
177
226
|
};
|
|
178
|
-
declare function PriceEditor(
|
|
227
|
+
declare function PriceEditor(props: PriceEditorProps): React.JSX.Element;
|
|
179
228
|
|
|
180
229
|
type PricesListProps = {
|
|
181
230
|
productId: string;
|
|
182
|
-
|
|
231
|
+
/**
|
|
232
|
+
* Only when the list IS the page's own content inside a `RoundPageContainer
|
|
233
|
+
* fullWidth`. Inside a tab panel leave it unset, or ContentListTable drops its
|
|
234
|
+
* own `rounded-md border` and the table floats borderless in the panel.
|
|
235
|
+
* Mirrors ThreatList, which is rendered both ways.
|
|
236
|
+
*/
|
|
237
|
+
fullWidth?: boolean;
|
|
183
238
|
};
|
|
184
|
-
declare function PricesList({ productId,
|
|
239
|
+
declare function PricesList({ productId, fullWidth }: PricesListProps): React.JSX.Element;
|
|
185
240
|
|
|
186
|
-
declare function
|
|
241
|
+
declare function ProductContainer(): React.JSX.Element | null;
|
|
187
242
|
|
|
188
243
|
/**
|
|
189
|
-
* Page
|
|
244
|
+
* Page container for the administrative product list.
|
|
190
245
|
*
|
|
191
246
|
* Client component by necessity: `module={Modules.StripeProduct}` is a registry
|
|
192
|
-
* entry
|
|
193
|
-
* across the boundary.
|
|
247
|
+
* entry carrying an icon component and methods, which a Server Component cannot
|
|
248
|
+
* pass across the boundary. Routes mount this container instead — the same
|
|
249
|
+
* shape as every other list page.
|
|
250
|
+
*
|
|
251
|
+
* No `forceHeader`: ContentListTable draws its own header row with the title
|
|
252
|
+
* and the create action, exactly as the company and user list pages do.
|
|
194
253
|
*/
|
|
195
|
-
declare function
|
|
254
|
+
declare function ProductsListContainer(): React.JSX.Element;
|
|
255
|
+
|
|
256
|
+
declare function ProductDetails(): React.JSX.Element | null;
|
|
257
|
+
|
|
258
|
+
type ProductArchiverProps = {
|
|
259
|
+
product: StripeProductInterface;
|
|
260
|
+
};
|
|
261
|
+
/**
|
|
262
|
+
* Archive / restore control for a product. Built on ConfirmDialog, which is
|
|
263
|
+
* controlled and trigger-less by design — the caller owns the trigger button,
|
|
264
|
+
* so none of Base UI's trigger-composition pitfalls apply (no asChild, no
|
|
265
|
+
* nested <button>).
|
|
266
|
+
*/
|
|
267
|
+
declare function ProductArchiver({ product }: ProductArchiverProps): React.JSX.Element;
|
|
196
268
|
|
|
197
269
|
type ProductEditorProps = {
|
|
198
270
|
product?: StripeProductInterface;
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
271
|
+
propagateChanges?: (product: StripeProductInterface) => void;
|
|
272
|
+
onSuccess?: () => void | Promise<void>;
|
|
273
|
+
trigger?: ReactNode;
|
|
274
|
+
forceShow?: boolean;
|
|
275
|
+
onClose?: () => void;
|
|
276
|
+
dialogOpen?: boolean;
|
|
277
|
+
onDialogOpenChange?: (open: boolean) => void;
|
|
202
278
|
};
|
|
203
|
-
declare function ProductEditor(
|
|
279
|
+
declare function ProductEditor(props: ProductEditorProps): React.JSX.Element;
|
|
204
280
|
|
|
205
281
|
type ProductsListProps = {
|
|
206
|
-
|
|
207
|
-
|
|
282
|
+
/**
|
|
283
|
+
* Pass this whenever the list is the page's own content inside a
|
|
284
|
+
* `RoundPageContainer fullWidth`. Without it ContentListTable wraps itself in
|
|
285
|
+
* `rounded-md border`, drawing a second bordered card inside the page's
|
|
286
|
+
* rounded shell.
|
|
287
|
+
*/
|
|
288
|
+
fullWidth?: boolean;
|
|
208
289
|
};
|
|
209
|
-
declare function ProductsList({
|
|
290
|
+
declare function ProductsList({ fullWidth }?: ProductsListProps): React.JSX.Element;
|
|
210
291
|
|
|
211
292
|
type SubscriptionsContainerProps = {
|
|
212
293
|
onOpenWizard?: (subscription?: StripeSubscriptionInterface) => void;
|
|
@@ -328,4 +409,4 @@ type PromoCodeInputProps = {
|
|
|
328
409
|
};
|
|
329
410
|
declare function PromoCodeInput({ appliedCode, isValidating, error, onApply, onRemove, disabled, }: PromoCodeInputProps): React.JSX.Element;
|
|
330
411
|
|
|
331
|
-
export { BillingAlertBanner, BillingDashboardContainer, BillingDetailModal, type BillingInterval,
|
|
412
|
+
export { BillingAlertBanner, BillingDashboardContainer, BillingDetailModal, type BillingInterval, BillingUsageSummaryCard, CancelSubscriptionDialog, 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, SubscriptionsContainer, SubscriptionsList, UsageContainer, UsageHistoryTable, UsageSummaryCard, UsageSummaryCards, formatCurrency, formatDate, formatInterval, isStripeConfigured, priceLabel, usePriceContext, useProductContext };
|