@schematichq/schematic-components 2.33.0 → 2.34.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/schematic-components-elements.cjs.js +1634 -133
- package/dist/schematic-components-elements.d.ts +431 -1
- package/dist/schematic-components-elements.esm.js +1631 -120
- package/dist/schematic-components.browser.cjs.js +601 -172
- package/dist/schematic-components.browser.esm.js +601 -172
- package/dist/schematic-components.cjs.js +601 -172
- package/dist/schematic-components.esm.js +601 -172
- package/package.json +8 -8
|
@@ -4,11 +4,16 @@ import { BillingDataProvider } from '@schematichq/schematic-react';
|
|
|
4
4
|
import { BillingDataProviderProps } from '@schematichq/schematic-react';
|
|
5
5
|
import { BillingDataStatus } from '@schematichq/schematic-react';
|
|
6
6
|
import { BillingResourceName } from '@schematichq/schematic-react';
|
|
7
|
+
import { Company } from '@schematichq/schematic-react';
|
|
8
|
+
import { CompanyPlan } from '@schematichq/schematic-react';
|
|
9
|
+
import { CompanySubscription } from '@schematichq/schematic-react';
|
|
10
|
+
import { CreditAutoTopup } from '@schematichq/schematic-react';
|
|
7
11
|
import { CreditBalanceEntry } from '@schematichq/schematic-react';
|
|
8
12
|
import { CreditComposition } from '@schematichq/schematic-react';
|
|
9
13
|
import { CreditGrant } from '@schematichq/schematic-react';
|
|
10
14
|
import { CreditUserUsage } from '@schematichq/schematic-react';
|
|
11
15
|
import { CreditUserUsageRow } from '@schematichq/schematic-react';
|
|
16
|
+
import { CustomPlanBilling } from '@schematichq/schematic-react';
|
|
12
17
|
import { Discount } from '@schematichq/schematic-react';
|
|
13
18
|
import { FEATURE_USER_USAGE_LIMIT } from '@schematichq/schematic-react';
|
|
14
19
|
import { FeatureUsage } from '@schematichq/schematic-react';
|
|
@@ -25,13 +30,16 @@ import { PerLicenseCreditGrant } from '@schematichq/schematic-react';
|
|
|
25
30
|
import { default as React_2 } from 'react';
|
|
26
31
|
import { ResourceHandle } from '@schematichq/schematic-react';
|
|
27
32
|
import { ResourceState } from '@schematichq/schematic-react';
|
|
33
|
+
import { ScheduledDowngrade } from '@schematichq/schematic-react';
|
|
28
34
|
import { SchematicI18nConfig } from '@schematichq/schematic-react';
|
|
29
35
|
import { SchematicI18nProvider } from '@schematichq/schematic-react';
|
|
30
36
|
import { SchematicI18nProviderProps } from '@schematichq/schematic-react';
|
|
31
37
|
import { SetupIntent } from '@schematichq/schematic-react';
|
|
32
38
|
import { SetupIntentHandle } from '@schematichq/schematic-react';
|
|
33
39
|
import type { Translate } from '@schematichq/schematic-react';
|
|
40
|
+
import { UnsubscribeHandle } from '@schematichq/schematic-react';
|
|
34
41
|
import { UpcomingInvoice } from '@schematichq/schematic-react';
|
|
42
|
+
import { useCompany } from '@schematichq/schematic-react';
|
|
35
43
|
import { useCreditBalances } from '@schematichq/schematic-react';
|
|
36
44
|
import { useCreditUserUsage } from '@schematichq/schematic-react';
|
|
37
45
|
import { useFeatureUsage } from '@schematichq/schematic-react';
|
|
@@ -45,8 +53,21 @@ import { useSchematicLocale } from '@schematichq/schematic-react';
|
|
|
45
53
|
import { useSchematicStrings } from '@schematichq/schematic-react';
|
|
46
54
|
import { useSchematicTranslate } from '@schematichq/schematic-react';
|
|
47
55
|
import { useSetupIntent } from '@schematichq/schematic-react';
|
|
56
|
+
import { useUnsubscribe } from '@schematichq/schematic-react';
|
|
48
57
|
import { useUpcomingInvoice } from '@schematichq/schematic-react';
|
|
49
58
|
|
|
59
|
+
export declare type AutoTopupLine = {
|
|
60
|
+
kind: "disabled";
|
|
61
|
+
creditId: string;
|
|
62
|
+
unit: string;
|
|
63
|
+
} | {
|
|
64
|
+
kind: "adds";
|
|
65
|
+
creditId: string;
|
|
66
|
+
amount: string;
|
|
67
|
+
unit: string;
|
|
68
|
+
threshold: string;
|
|
69
|
+
};
|
|
70
|
+
|
|
50
71
|
export { BillingActions }
|
|
51
72
|
|
|
52
73
|
export { BillingData }
|
|
@@ -73,6 +94,14 @@ export declare interface BillLine {
|
|
|
73
94
|
amountText: string;
|
|
74
95
|
}
|
|
75
96
|
|
|
97
|
+
export { Company }
|
|
98
|
+
|
|
99
|
+
export { CompanyPlan }
|
|
100
|
+
|
|
101
|
+
export { CompanySubscription }
|
|
102
|
+
|
|
103
|
+
export { CreditAutoTopup }
|
|
104
|
+
|
|
76
105
|
export { CreditBalanceEntry }
|
|
77
106
|
|
|
78
107
|
export { CreditComposition }
|
|
@@ -105,6 +134,19 @@ export { CreditGrant }
|
|
|
105
134
|
/** Why credits were granted, as the ledger words it. */
|
|
106
135
|
export declare type CreditGrantKind = "plan" | "bundle" | "autoTopup" | "promotional";
|
|
107
136
|
|
|
137
|
+
/** Grants of one credit from one bundle, or one grant outside a bundle. */
|
|
138
|
+
export declare interface CreditGroupRow {
|
|
139
|
+
key: string;
|
|
140
|
+
/** Live grants in the group. */
|
|
141
|
+
count: number;
|
|
142
|
+
bundleName: string | null;
|
|
143
|
+
/** The newest grant's quantity. */
|
|
144
|
+
quantity: string;
|
|
145
|
+
creditName: string;
|
|
146
|
+
/** Credits spent; `null` at 0, which shows nothing. */
|
|
147
|
+
used: string | null;
|
|
148
|
+
}
|
|
149
|
+
|
|
108
150
|
export declare interface CreditLedgerRow {
|
|
109
151
|
id: string;
|
|
110
152
|
kind: CreditGrantKind;
|
|
@@ -203,6 +245,8 @@ export { CreditUserUsageRow }
|
|
|
203
245
|
*/
|
|
204
246
|
export declare function currentTier(row: FeatureUsage): TierRange | null;
|
|
205
247
|
|
|
248
|
+
export { CustomPlanBilling }
|
|
249
|
+
|
|
206
250
|
/**
|
|
207
251
|
* The English copy, and the fallback for anything a host does not answer.
|
|
208
252
|
* It is a plain resource bundle, so it can be registered as one:
|
|
@@ -280,6 +324,34 @@ export declare interface DerivePaymentMethodsOptions {
|
|
|
280
324
|
now?: Date;
|
|
281
325
|
}
|
|
282
326
|
|
|
327
|
+
export declare function derivePlanManager(data: {
|
|
328
|
+
company: Company;
|
|
329
|
+
creditBalances: CreditBalanceEntry[];
|
|
330
|
+
featureUsage: FeatureUsage[];
|
|
331
|
+
}, options: DerivePlanManagerOptions): PlanManagerView;
|
|
332
|
+
|
|
333
|
+
export declare interface DerivePlanManagerOptions extends UsageLimitOptions {
|
|
334
|
+
locale: string;
|
|
335
|
+
/** What "Trial ends in" counts down from. Default now. */
|
|
336
|
+
now?: Date;
|
|
337
|
+
/** Credit-burning features' "credits per use". Default true. */
|
|
338
|
+
showCredits?: boolean;
|
|
339
|
+
/** A plan priced at zero reads "Free". Default false. */
|
|
340
|
+
showZeroPriceAsFree?: boolean;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Whether there is a subscription to cancel, when access ends, and what
|
|
345
|
+
* cancelling stops charging for.
|
|
346
|
+
*/
|
|
347
|
+
export declare function deriveUnsubscribe(company: Company, featureUsage: FeatureUsage[], options: DeriveUnsubscribeOptions): UnsubscribeView;
|
|
348
|
+
|
|
349
|
+
export declare interface DeriveUnsubscribeOptions {
|
|
350
|
+
locale: string;
|
|
351
|
+
/** Used when the next bill date is unknown. Defaults to now. */
|
|
352
|
+
now?: Date;
|
|
353
|
+
}
|
|
354
|
+
|
|
283
355
|
export declare function deriveUpcomingInvoice(invoice: UpcomingInvoice, options: DeriveUpcomingInvoiceOptions): UpcomingBillSummary;
|
|
284
356
|
|
|
285
357
|
export declare interface DeriveUpcomingInvoiceOptions {
|
|
@@ -438,6 +510,66 @@ export declare type ElementStrings = {
|
|
|
438
510
|
creditUsagePerLicense: string;
|
|
439
511
|
creditUsageCompanyGrant: string;
|
|
440
512
|
creditUsageRenewsOn: string;
|
|
513
|
+
planManagerLoading: string;
|
|
514
|
+
planManagerError: string;
|
|
515
|
+
planManagerUnavailable: string;
|
|
516
|
+
planManagerTrialEndsIn: string;
|
|
517
|
+
planManagerTrialEndsSoon: string;
|
|
518
|
+
planManagerTrialEnded: string;
|
|
519
|
+
planManagerDays: string;
|
|
520
|
+
planManagerHours: string;
|
|
521
|
+
planManagerMinutes: string;
|
|
522
|
+
planManagerCanceled: string;
|
|
523
|
+
planManagerAccessEnds: string;
|
|
524
|
+
planManagerPlanFallback: string;
|
|
525
|
+
planManagerCustomAwaiting: string;
|
|
526
|
+
planManagerCustomAwaitingDescription: string;
|
|
527
|
+
planManagerCustomDue: string;
|
|
528
|
+
planManagerCustomDueDescription: string;
|
|
529
|
+
planManagerYourPlan: string;
|
|
530
|
+
planManagerPayNow: string;
|
|
531
|
+
planManagerDowngradeScheduled: string;
|
|
532
|
+
planManagerUsageBased: string;
|
|
533
|
+
planManagerFree: string;
|
|
534
|
+
planManagerAddOns: string;
|
|
535
|
+
planManagerAdditional: string;
|
|
536
|
+
planManagerTierBased: string;
|
|
537
|
+
planManagerCreditsInPlan: string;
|
|
538
|
+
planManagerCreditsError: string;
|
|
539
|
+
planManagerCreditsLoading: string;
|
|
540
|
+
planManagerTopUps: string;
|
|
541
|
+
planManagerCreditBundles: string;
|
|
542
|
+
planManagerPromotionalCredits: string;
|
|
543
|
+
planManagerChangePlan: string;
|
|
544
|
+
planManagerCredits: string;
|
|
545
|
+
planManagerCreditsPerPeriod: string;
|
|
546
|
+
planManagerCreditsPerLicense: string;
|
|
547
|
+
planManagerCreditsPlusPerPeriod: string;
|
|
548
|
+
planManagerLicensesTimesCredits: string;
|
|
549
|
+
planManagerLicensesTimesCreditsPlusCompany: string;
|
|
550
|
+
planManagerUsed: string;
|
|
551
|
+
planManagerAutoTopup: string;
|
|
552
|
+
planManagerAutoTopupDisabled: string;
|
|
553
|
+
planManagerAutoTopupAdds: string;
|
|
554
|
+
planManagerAutoTopupTip: string;
|
|
555
|
+
planManagerEdit: string;
|
|
556
|
+
planManagerSeeAll: string;
|
|
557
|
+
planManagerHideAll: string;
|
|
558
|
+
unsubscribeButton: string;
|
|
559
|
+
unsubscribeTitle: string;
|
|
560
|
+
unsubscribeAccessUntil: string;
|
|
561
|
+
unsubscribeNotReady: string;
|
|
562
|
+
unsubscribeManagePlan: string;
|
|
563
|
+
unsubscribePlan: string;
|
|
564
|
+
unsubscribeAddOns: string;
|
|
565
|
+
unsubscribeMonthlyTotal: string;
|
|
566
|
+
unsubscribeQuarterlyTotal: string;
|
|
567
|
+
unsubscribeYearlyTotal: string;
|
|
568
|
+
unsubscribeConfirm: string;
|
|
569
|
+
unsubscribeFailed: string;
|
|
570
|
+
unsubscribeClose: string;
|
|
571
|
+
unsubscribeError: string;
|
|
572
|
+
unsubscribeUnavailable: string;
|
|
441
573
|
usageByUserHeader: string;
|
|
442
574
|
usageByUserTotal: string;
|
|
443
575
|
usageByUserError: string;
|
|
@@ -468,6 +600,11 @@ export declare type ElementStrings = {
|
|
|
468
600
|
periodMonthShort: string;
|
|
469
601
|
periodQuarterShort: string;
|
|
470
602
|
periodYearShort: string;
|
|
603
|
+
periodDay: string;
|
|
604
|
+
periodWeek: string;
|
|
605
|
+
periodMonth: string;
|
|
606
|
+
periodQuarter: string;
|
|
607
|
+
periodYear: string;
|
|
471
608
|
};
|
|
472
609
|
|
|
473
610
|
/**
|
|
@@ -585,7 +722,7 @@ export declare function formatPercent(fraction: number, locale: string): string;
|
|
|
585
722
|
export declare function formatShortDate(date: Date, locale: string): string;
|
|
586
723
|
|
|
587
724
|
/** Heading level an element's own heading renders at. Default 2. */
|
|
588
|
-
export declare type HeadingLevel = 2 | 3 | 4 | 5 | 6;
|
|
725
|
+
export declare type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
589
726
|
|
|
590
727
|
/**
|
|
591
728
|
* The HTTP status behind a failed billing read, or `undefined` for anything
|
|
@@ -1098,6 +1235,199 @@ export declare interface PerLicenseCredits {
|
|
|
1098
1235
|
licenseName: string;
|
|
1099
1236
|
}
|
|
1100
1237
|
|
|
1238
|
+
export declare interface PlanAddOnRow {
|
|
1239
|
+
id: string;
|
|
1240
|
+
name: string;
|
|
1241
|
+
/** `null` when the add-on is not billed. */
|
|
1242
|
+
price: {
|
|
1243
|
+
amount: string;
|
|
1244
|
+
/** A period key, or "one-time". */
|
|
1245
|
+
period: string;
|
|
1246
|
+
} | null;
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
export declare interface PlanCreditRow {
|
|
1250
|
+
creditId: string;
|
|
1251
|
+
text: {
|
|
1252
|
+
kind: "perLicense";
|
|
1253
|
+
amount: string;
|
|
1254
|
+
creditName: string;
|
|
1255
|
+
licenseName: string;
|
|
1256
|
+
/** The flat company grant on top, per period; `null` without one. */
|
|
1257
|
+
plus: {
|
|
1258
|
+
amount: string;
|
|
1259
|
+
creditName: string;
|
|
1260
|
+
period: string;
|
|
1261
|
+
} | null;
|
|
1262
|
+
} | {
|
|
1263
|
+
kind: "total";
|
|
1264
|
+
amount: string;
|
|
1265
|
+
creditName: string;
|
|
1266
|
+
/** A period key; `null` without a subscription. */
|
|
1267
|
+
period: string | null;
|
|
1268
|
+
};
|
|
1269
|
+
/** Credits spent; `null` at 0, which shows nothing. */
|
|
1270
|
+
used: string | null;
|
|
1271
|
+
/** The tip on the used count when the credit tops itself up. */
|
|
1272
|
+
autoTopup: {
|
|
1273
|
+
amount: string;
|
|
1274
|
+
threshold: string;
|
|
1275
|
+
} | null;
|
|
1276
|
+
/** "12 Seats × 10 = 120 credits/mo". */
|
|
1277
|
+
composition: {
|
|
1278
|
+
quantity: string;
|
|
1279
|
+
licenseName: string;
|
|
1280
|
+
perUnit: string;
|
|
1281
|
+
/** The flat company grant; `null` without one. */
|
|
1282
|
+
fixed: string | null;
|
|
1283
|
+
total: string;
|
|
1284
|
+
creditName: string;
|
|
1285
|
+
/** A period key: "day", "week", "month" or "year". */
|
|
1286
|
+
period: string;
|
|
1287
|
+
} | null;
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
/**
|
|
1291
|
+
* The company's plan: a notice about where its subscription is headed, the
|
|
1292
|
+
* plan and its price, its add-ons, its usage-based features, and the
|
|
1293
|
+
* credits the plan and the company's purchases bring.
|
|
1294
|
+
*
|
|
1295
|
+
* It reads the company, its usage and its credits. It waits for the company
|
|
1296
|
+
* and its usage, and for its credits unless `showCredits` is off. A 404
|
|
1297
|
+
* means the account is not enabled for company reads, and the card says so.
|
|
1298
|
+
* Credits that fail to load cost only the credit sections, which show the
|
|
1299
|
+
* error in their place.
|
|
1300
|
+
*/
|
|
1301
|
+
export declare function PlanManager({ changePlanTarget, changePlanUrl, className, editAutoTopupTarget, editAutoTopupUrl, headingLevel, locale: localeProp, onChangePlan, onEditAutoTopup, showAddOns, showCredits, showDescription, showHardLimit, showHeader, showLabels, showNotice, showPrice, showUsageBased, showWarningThresholdAsLimit, showZeroPriceAsFree, strings, }: PlanManagerProps): JSX.Element;
|
|
1302
|
+
|
|
1303
|
+
export declare namespace PlanManager {
|
|
1304
|
+
var resources: readonly ["company", "featureUsage", "creditBalances"];
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
export declare interface PlanManagerProps extends ElementProps {
|
|
1308
|
+
/** Heading level of the plan's name. Default 2. */
|
|
1309
|
+
headingLevel?: HeadingLevel;
|
|
1310
|
+
/**
|
|
1311
|
+
* The notice above the plan: a trial, a cancellation, a custom plan's
|
|
1312
|
+
* invoice or a scheduled downgrade. Default true.
|
|
1313
|
+
*/
|
|
1314
|
+
showNotice?: boolean;
|
|
1315
|
+
/** The plan's name, description and price. Default true. */
|
|
1316
|
+
showHeader?: boolean;
|
|
1317
|
+
/** The plan's description. Default true. */
|
|
1318
|
+
showDescription?: boolean;
|
|
1319
|
+
/** The plan's price. Default true. */
|
|
1320
|
+
showPrice?: boolean;
|
|
1321
|
+
/** The add-ons the company holds. Default true. */
|
|
1322
|
+
showAddOns?: boolean;
|
|
1323
|
+
/** The usage-based features and their prices. Default true. */
|
|
1324
|
+
showUsageBased?: boolean;
|
|
1325
|
+
/**
|
|
1326
|
+
* Every credit section — the plan's credits, top-ups, bundles and
|
|
1327
|
+
* promotional credits — and the "credits per use" on credit-burning
|
|
1328
|
+
* features. Default true.
|
|
1329
|
+
*/
|
|
1330
|
+
showCredits?: boolean;
|
|
1331
|
+
/** Each section's label. Default true. */
|
|
1332
|
+
showLabels?: boolean;
|
|
1333
|
+
/** A plan priced at zero reads "Free". Default false. */
|
|
1334
|
+
showZeroPriceAsFree?: boolean;
|
|
1335
|
+
/** An info tip with the hard limit on features billed past it. Default false. */
|
|
1336
|
+
showHardLimit?: boolean;
|
|
1337
|
+
/**
|
|
1338
|
+
* Show an entitlement's warning threshold in place of its limit, where one
|
|
1339
|
+
* is configured. Default false.
|
|
1340
|
+
*/
|
|
1341
|
+
showWarningThresholdAsLimit?: boolean;
|
|
1342
|
+
/** "Change plan" calls this. Without it or `changePlanUrl` there is no button. */
|
|
1343
|
+
onChangePlan?: () => void;
|
|
1344
|
+
/** "Change plan" links here when there is no `onChangePlan`. */
|
|
1345
|
+
changePlanUrl?: string;
|
|
1346
|
+
/** `target` for `changePlanUrl`. */
|
|
1347
|
+
changePlanTarget?: string;
|
|
1348
|
+
/**
|
|
1349
|
+
* "Edit" on the auto top-up settings calls this. Without it or
|
|
1350
|
+
* `editAutoTopupUrl` there is no button.
|
|
1351
|
+
*/
|
|
1352
|
+
onEditAutoTopup?: () => void;
|
|
1353
|
+
/** "Edit" links here when there is no `onEditAutoTopup`. */
|
|
1354
|
+
editAutoTopupUrl?: string;
|
|
1355
|
+
/** `target` for `editAutoTopupUrl`. */
|
|
1356
|
+
editAutoTopupTarget?: string;
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
export declare interface PlanManagerView {
|
|
1360
|
+
notice: PlanNotice | null;
|
|
1361
|
+
/** `null` when the company has no plan. */
|
|
1362
|
+
plan: {
|
|
1363
|
+
name: string;
|
|
1364
|
+
description: string | null;
|
|
1365
|
+
/** `null` when the plan is not billed. */
|
|
1366
|
+
price: PlanPrice | null;
|
|
1367
|
+
} | null;
|
|
1368
|
+
addOns: PlanAddOnRow[];
|
|
1369
|
+
usageBased: UsageBasedRow[];
|
|
1370
|
+
planCredits: PlanCreditRow[];
|
|
1371
|
+
/** The self-service auto top-up box; `null` when no plan credit offers it. */
|
|
1372
|
+
autoTopup: {
|
|
1373
|
+
lines: AutoTopupLine[];
|
|
1374
|
+
} | null;
|
|
1375
|
+
topUps: CreditGroupRow[];
|
|
1376
|
+
bundles: CreditGroupRow[];
|
|
1377
|
+
promotional: CreditGroupRow[];
|
|
1378
|
+
/** A custom plan awaiting payment to activate has no plan to change yet. */
|
|
1379
|
+
canChangePlan: boolean;
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
/**
|
|
1383
|
+
* `derivePlanManager`: the company, its usage and its credits as the plan
|
|
1384
|
+
* manager shows them. The wording is the element's, keyed by `kind`;
|
|
1385
|
+
* numbers, names and dates are formatted here.
|
|
1386
|
+
*/
|
|
1387
|
+
export declare type PlanNotice = {
|
|
1388
|
+
kind: "trial";
|
|
1389
|
+
/**
|
|
1390
|
+
* Whole days, else hours or minutes; `"soon"` inside the last minute,
|
|
1391
|
+
* which a rendered page would not count down; `"ended"` once the end
|
|
1392
|
+
* has passed but the subscription still reads as trialing (a late
|
|
1393
|
+
* webhook, stale data, a page left open); `null` without an end.
|
|
1394
|
+
*/
|
|
1395
|
+
endsIn: {
|
|
1396
|
+
amount: number;
|
|
1397
|
+
unit: TrialUnit;
|
|
1398
|
+
} | "soon" | "ended" | null;
|
|
1399
|
+
} | {
|
|
1400
|
+
kind: "canceled";
|
|
1401
|
+
/** The plan's name; `null` when the company has none. */
|
|
1402
|
+
planName: string | null;
|
|
1403
|
+
/** "October 1, 2026"; `null` without a cancellation date. */
|
|
1404
|
+
date: string | null;
|
|
1405
|
+
} | {
|
|
1406
|
+
kind: "customPlanBilling";
|
|
1407
|
+
/** The plan activates on payment, rather than ending without it. */
|
|
1408
|
+
awaitingActivation: boolean;
|
|
1409
|
+
planName: string | null;
|
|
1410
|
+
date: string;
|
|
1411
|
+
invoiceUrl: string | null;
|
|
1412
|
+
} | {
|
|
1413
|
+
kind: "scheduledDowngrade";
|
|
1414
|
+
fromPlanName: string;
|
|
1415
|
+
toPlanName: string;
|
|
1416
|
+
/** When the current period ends; `null` when it is not known. */
|
|
1417
|
+
date: string | null;
|
|
1418
|
+
};
|
|
1419
|
+
|
|
1420
|
+
export declare type PlanPrice = {
|
|
1421
|
+
kind: "usageBased";
|
|
1422
|
+
} | {
|
|
1423
|
+
kind: "free";
|
|
1424
|
+
} | {
|
|
1425
|
+
kind: "amount";
|
|
1426
|
+
amount: string;
|
|
1427
|
+
/** A period key: "month", "quarter", "year"; `null` when free or unknown. */
|
|
1428
|
+
period: string | null;
|
|
1429
|
+
};
|
|
1430
|
+
|
|
1101
1431
|
/**
|
|
1102
1432
|
* `other` is required because every language has it. Supply whichever other
|
|
1103
1433
|
* categories the language uses: Polish needs `one`, `few`, and `many`;
|
|
@@ -1144,6 +1474,8 @@ export { ResourceHandle }
|
|
|
1144
1474
|
|
|
1145
1475
|
export { ResourceState }
|
|
1146
1476
|
|
|
1477
|
+
export { ScheduledDowngrade }
|
|
1478
|
+
|
|
1147
1479
|
/**
|
|
1148
1480
|
* Every token the stylesheet can reference, with the value used when the
|
|
1149
1481
|
* host sets none. Adding a token here is what makes it usable in the CSS;
|
|
@@ -1226,9 +1558,59 @@ export { Translate }
|
|
|
1226
1558
|
|
|
1227
1559
|
export declare type Translator = (key: StringKey, vars?: StringVars) => string;
|
|
1228
1560
|
|
|
1561
|
+
export declare type TrialUnit = "day" | "hour" | "minute";
|
|
1562
|
+
|
|
1229
1563
|
/** A unit's price in minor units, the provider's decimal where it has one. */
|
|
1230
1564
|
export declare function unitPrice(price: MeteredPrice): number;
|
|
1231
1565
|
|
|
1566
|
+
/**
|
|
1567
|
+
* Cancels the subscription at period end after a confirmation dialog.
|
|
1568
|
+
*
|
|
1569
|
+
* Renders nothing until the company and its usage load, or once there is no
|
|
1570
|
+
* subscription left to cancel.
|
|
1571
|
+
*/
|
|
1572
|
+
export declare function UnsubscribeButton({ className, locale: localeProp, managePlanTarget, managePlanUrl, onManagePlan, onUnsubscribed, strings, }: UnsubscribeButtonProps): JSX.Element | null;
|
|
1573
|
+
|
|
1574
|
+
export declare namespace UnsubscribeButton {
|
|
1575
|
+
var resources: readonly ["company", "featureUsage"];
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
export declare interface UnsubscribeButtonProps extends ElementProps {
|
|
1579
|
+
/**
|
|
1580
|
+
* Handles "Manage plan" in the dialog. Without this or `managePlanUrl`,
|
|
1581
|
+
* the dialog hides "Manage plan".
|
|
1582
|
+
*/
|
|
1583
|
+
onManagePlan?: () => void;
|
|
1584
|
+
/** "Manage plan" links here when there is no `onManagePlan`. */
|
|
1585
|
+
managePlanUrl?: string;
|
|
1586
|
+
/** `target` for the `managePlanUrl` link. */
|
|
1587
|
+
managePlanTarget?: string;
|
|
1588
|
+
/** Called once the subscription is set to cancel. */
|
|
1589
|
+
onUnsubscribed?: () => void;
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
export { UnsubscribeHandle }
|
|
1593
|
+
|
|
1594
|
+
export declare interface UnsubscribeView {
|
|
1595
|
+
/** A subscription exists and is not already set to end. */
|
|
1596
|
+
canUnsubscribe: boolean;
|
|
1597
|
+
accessEndsOn: string;
|
|
1598
|
+
period: string;
|
|
1599
|
+
plan: {
|
|
1600
|
+
name: string;
|
|
1601
|
+
price: string | null;
|
|
1602
|
+
} | null;
|
|
1603
|
+
addOns: {
|
|
1604
|
+
id: string;
|
|
1605
|
+
name: string;
|
|
1606
|
+
price: string;
|
|
1607
|
+
/** Left out of the recurring total. */
|
|
1608
|
+
oneTime: boolean;
|
|
1609
|
+
}[];
|
|
1610
|
+
/** Recurring cost per `period`: the plan, recurring add-ons, and pay-in-advance usage. */
|
|
1611
|
+
total: string;
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1232
1614
|
/**
|
|
1233
1615
|
* The company's next bill: what it will be charged and when, and the
|
|
1234
1616
|
* account balance and discounts that shaped the figure.
|
|
@@ -1301,6 +1683,50 @@ export declare interface UpcomingInvoiceFormatters {
|
|
|
1301
1683
|
amount?: (amountMinor: number, currency: string, locale: string) => string;
|
|
1302
1684
|
}
|
|
1303
1685
|
|
|
1686
|
+
export declare interface UsageBasedRow {
|
|
1687
|
+
featureId: string;
|
|
1688
|
+
name: string;
|
|
1689
|
+
/** The limit the feature is shown against; `null` shows the name alone. */
|
|
1690
|
+
quantity: {
|
|
1691
|
+
amount: string;
|
|
1692
|
+
units: string;
|
|
1693
|
+
} | null;
|
|
1694
|
+
/** Overage: the price is for usage past the limit. */
|
|
1695
|
+
additional: boolean;
|
|
1696
|
+
tierBased: boolean;
|
|
1697
|
+
/** Pay-as-you-go and overage: the price of a unit, or of a package. */
|
|
1698
|
+
unitPrice: {
|
|
1699
|
+
cost: string;
|
|
1700
|
+
/** More than one unit to a package; `null` for a single unit. */
|
|
1701
|
+
packageSize: string | null;
|
|
1702
|
+
units: string;
|
|
1703
|
+
/** A period key for a trait-based feature; `null` otherwise. */
|
|
1704
|
+
period: string | null;
|
|
1705
|
+
} | null;
|
|
1706
|
+
/** Credit burndown: credits consumed per use. */
|
|
1707
|
+
perUse: {
|
|
1708
|
+
amount: string;
|
|
1709
|
+
units: string;
|
|
1710
|
+
} | null;
|
|
1711
|
+
/** Paid in advance: what the allocation costs per period. */
|
|
1712
|
+
cost: {
|
|
1713
|
+
amount: string;
|
|
1714
|
+
period: string | null;
|
|
1715
|
+
} | null;
|
|
1716
|
+
tiers: {
|
|
1717
|
+
currency: string;
|
|
1718
|
+
mode: "graduated" | "volume" | null;
|
|
1719
|
+
period: string | null;
|
|
1720
|
+
ranges: TierRange[];
|
|
1721
|
+
unit: string;
|
|
1722
|
+
} | null;
|
|
1723
|
+
hardLimit: {
|
|
1724
|
+
amount: string;
|
|
1725
|
+
units: string;
|
|
1726
|
+
} | null;
|
|
1727
|
+
source: FeatureUsage;
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1304
1730
|
/**
|
|
1305
1731
|
* The number a row's usage is shown against: the allocation for a row with
|
|
1306
1732
|
* no price behavior or one paid in advance, the soft limit for overage, or
|
|
@@ -1358,6 +1784,8 @@ export declare type UsageSummary = {
|
|
|
1358
1784
|
amount: string;
|
|
1359
1785
|
};
|
|
1360
1786
|
|
|
1787
|
+
export { useCompany }
|
|
1788
|
+
|
|
1361
1789
|
export { useCreditBalances }
|
|
1362
1790
|
|
|
1363
1791
|
export { useCreditUserUsage }
|
|
@@ -1405,6 +1833,8 @@ export { useSetupIntent }
|
|
|
1405
1833
|
*/
|
|
1406
1834
|
export declare function useTranslator(overrides?: StringOverrides, locale?: string): Translator;
|
|
1407
1835
|
|
|
1836
|
+
export { useUnsubscribe }
|
|
1837
|
+
|
|
1408
1838
|
export { useUpcomingInvoice }
|
|
1409
1839
|
|
|
1410
1840
|
/** Not for a server render or its hydration; `useResolvedLocale` reads it
|