@pontive/pontkit-core 1.43.0 → 1.44.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/README.md CHANGED
@@ -58,6 +58,7 @@ so forms, autofill and password managers work unchanged.
58
58
  | Theming integration on this side: `applyTheme` / `linkTheme`, fingerprint, preview screens | ✅ [12-theming-integration.md](docs/12-theming-integration.md) |
59
59
  | Dashboard branding page (`branding-v2`, in the dashboard repo) and `PREVIEW_SPECIMENS` | ✅ [14-dashboard-branding.md](docs/14-dashboard-branding.md) |
60
60
  | Account widgets: account menu, organization switcher, account settings, member management (injected `AccountClient`) | ✅ [kit/provider.md](docs/kit/provider.md) |
61
+ | Billing widgets (beta, needs the `billing` capability): checkout, billing portal | ✅ [kit/checkout.md](docs/kit/checkout.md), [kit/billing-portal.md](docs/kit/billing-portal.md) |
61
62
 
62
63
  ## Use it
63
64
 
package/catalog.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.43.0",
2
+ "version": "1.44.0",
3
3
  "elements": [
4
4
  {
5
5
  "tag": "pont-otp-resend",
@@ -44,3 +44,33 @@ export declare function calendarDaysBetween(date: Date, now: Date, timeZone?: st
44
44
  export declare function formatRelativeDay(value: DateInput, options?: FormatOptions): string;
45
45
  /** A number in the page's language ("1,234" / "1.234"). */
46
46
  export declare function formatNumber(value: number, options?: Pick<FormatOptions, "locale">): string;
47
+ /** An amount as the billing API sends it: a decimal string with an ISO 4217 currency beside it. */
48
+ export interface MoneyInput {
49
+ amount: string;
50
+ currency: string;
51
+ }
52
+ /** The parts of a decimal string, or `null` when it is not one. Never goes through a float. */
53
+ export declare function parseDecimal(value: string): {
54
+ negative: boolean;
55
+ integer: string;
56
+ fraction: string;
57
+ } | null;
58
+ /** The ISO 4217 minor unit of `currency` (2 for USD, 0 for JPY, 3 for KWD), as `Intl` knows it; 2 when it does not. */
59
+ export declare function currencyExponent(currency: string): number;
60
+ /**
61
+ * An amount in the page's language with its currency ("$1,234.50", "1.234,50 €"), from the API's
62
+ * decimal string, **never through a float**: the integer part is formatted as a `BigInt` (exact) and
63
+ * the fraction digits are copied from the string, with the language's decimal separator.
64
+ *
65
+ * At least the currency's ISO 4217 minor unit is shown; more digits are kept when the string has
66
+ * them and they are not zeros (a unit price of "0.0000025"). Nothing is rounded: the API's amounts
67
+ * are already rounded. A string that is not a decimal is returned as it is, with the currency code.
68
+ */
69
+ export declare function formatMoney(amount: string | MoneyInput, currency?: string, options?: Pick<FormatOptions, "locale">): string;
70
+ /**
71
+ * An amount in the currency's minor units as an integer ("12.50" USD → 1250, "500" JPY → 500), by
72
+ * its ISO 4217 exponent, with string arithmetic. What Stripe.js's Elements take when the API sends
73
+ * no `amount_provider_units` of its own. `null` when it is not a decimal, has more digits than the
74
+ * exponent, or is not a safe integer.
75
+ */
76
+ export declare function toMinorUnits(amount: string, currency: string): number | null;
@@ -165,6 +165,121 @@ export declare const KIT_MESSAGES_EN: {
165
165
  readonly sending_invitations: "Sending";
166
166
  readonly invite_failed: "We couldn't send the invitations. Please try again.";
167
167
  readonly revoke_invitation_notify: "Email the invitee that the invitation was revoked";
168
+ readonly billing_app_unavailable: "This app can't manage billing.";
169
+ readonly billing_unavailable: "Billing isn't available right now.";
170
+ readonly billing_forbidden: "You don't have permission to manage billing for this account.";
171
+ readonly billing_load_failed: "We couldn't load billing. Please try again.";
172
+ readonly billing_not_found: "We couldn't find this. Reload the page.";
173
+ readonly billing_nothing_to_manage: "There's nothing to manage yet.";
174
+ readonly billing_change_refused: "This change isn't allowed.";
175
+ readonly checkout_title: "Checkout";
176
+ readonly checkout_expired: "This checkout has expired.";
177
+ readonly checkout_failed: "We couldn't start the checkout. Please try again.";
178
+ readonly checkout_preview_failed: "We couldn't calculate the price. Please try again.";
179
+ readonly checkout_complete: "You're all set.";
180
+ readonly checkout_choose_plan: "Choose a plan";
181
+ readonly checkout_billing_frequency: "Billing frequency";
182
+ readonly checkout_summary: "Summary";
183
+ readonly checkout_trial_note: "You won't be charged until your trial ends.";
184
+ readonly frequency_monthly: "Monthly";
185
+ readonly frequency_quarterly: "Quarterly";
186
+ readonly frequency_annual: "Yearly";
187
+ readonly per_month: "per month";
188
+ readonly per_quarter: "per quarter";
189
+ readonly per_year: "per year";
190
+ readonly free_trial: "Free trial";
191
+ readonly billing_address: "Billing address";
192
+ readonly field_country: "Country";
193
+ readonly field_address_line1: "Address";
194
+ readonly field_address_line2: "Address line 2 (optional)";
195
+ readonly field_city: "City";
196
+ readonly field_postal_code: "Postal code";
197
+ readonly field_state: "State or region (optional)";
198
+ readonly field_tax_id: "Tax ID (optional)";
199
+ readonly field_required: "This field is required.";
200
+ readonly invoice_subtotal: "Subtotal";
201
+ readonly invoice_tax: "Tax";
202
+ readonly invoice_total: "Total";
203
+ readonly amount_due_today: "Due today";
204
+ readonly payment_details: "Payment details";
205
+ readonly action_continue: "Continue";
206
+ readonly action_back: "Back";
207
+ readonly action_pay: "Pay";
208
+ readonly action_start_trial: "Start trial";
209
+ readonly payment_confirming: "Payment received. Confirming…";
210
+ readonly payment_confirming_slow: "Your payment is being confirmed. This page updates when it is.";
211
+ readonly payment_method_confirming: "Payment method received. Confirming…";
212
+ readonly payment_declined: "The payment was declined.";
213
+ readonly payment_not_completed: "The payment was not completed. Try again or use another method.";
214
+ readonly payment_failed: "The payment could not be completed. Please try again.";
215
+ readonly payment_form_unavailable: "The payment form can't be shown right now. Reload the page to try again.";
216
+ readonly payment_in_progress: "A payment is already in progress.";
217
+ readonly payment_unavailable: "Payments aren't set up for this account yet.";
218
+ readonly preview_stale: "Something changed since the preview. Review the change again.";
219
+ readonly package_unavailable: "This plan isn't available.";
220
+ readonly payment_method_not_reusable: "This payment method can't be used for automatic payments.";
221
+ readonly invoice_not_payable: "This invoice can't be paid online now.";
222
+ readonly billing_portal_title: "Billing";
223
+ readonly billing_portal_subtitle: "Your plan, invoices and payment methods.";
224
+ readonly billing_account: "Account";
225
+ readonly billing_recovery_notice: "This organization is suspended for non-payment. You can pay its invoices, update its payment method, change its plan or keep it from ending.";
226
+ readonly plan_section: "Plan";
227
+ readonly plan_none: "No active plan.";
228
+ readonly plan_status_incomplete: "Incomplete";
229
+ readonly plan_status_scheduled: "Scheduled";
230
+ readonly plan_status_trialing: "Trial";
231
+ readonly plan_status_active: "Active";
232
+ readonly plan_status_ending: "Ending";
233
+ readonly plan_status_ended: "Ended";
234
+ readonly plan_renews_on: "Renews on";
235
+ readonly plan_ends_on: "Ends on";
236
+ readonly plan_trial_ends_on: "Trial ends on";
237
+ readonly plan_changes_on: "Changes on";
238
+ readonly plan_seats: "Seats";
239
+ readonly plan_seats_follow_members: "Follows the organization's members";
240
+ readonly plan_next_invoice: "Next invoice";
241
+ readonly action_change_plan: "Change plan";
242
+ readonly action_change_seats: "Change seats";
243
+ readonly action_cancel_plan: "Cancel plan";
244
+ readonly action_keep_plan: "Keep plan";
245
+ readonly action_review_change: "Review change";
246
+ readonly action_confirm_change: "Confirm change";
247
+ readonly action_confirm_cancel: "Cancel plan";
248
+ readonly change_due_now: "Due now";
249
+ readonly change_failed: "We couldn't change the plan. Please try again.";
250
+ readonly change_preview_failed: "We couldn't preview this change. Please try again.";
251
+ readonly cancel_plan_confirm: "Cancel this plan? It stays active until the end of the current period.";
252
+ readonly cancel_failed: "We couldn't cancel the plan. Please try again.";
253
+ readonly revoke_failed: "We couldn't keep the plan. Please try again.";
254
+ readonly invoices_section: "Invoices";
255
+ readonly invoices_empty: "No invoices yet.";
256
+ readonly column_number: "Number";
257
+ readonly column_date: "Date";
258
+ readonly column_amount: "Amount";
259
+ readonly column_status: "Status";
260
+ readonly invoice_status_draft: "Draft";
261
+ readonly invoice_status_open: "Open";
262
+ readonly invoice_status_paid: "Paid";
263
+ readonly invoice_status_void: "Void";
264
+ readonly invoice_status_uncollectible: "Uncollectible";
265
+ readonly action_view: "View";
266
+ readonly action_download_pdf: "PDF";
267
+ readonly pay_invoice_title: "Pay invoice";
268
+ readonly pay_with_saved: "Pay with";
269
+ readonly pay_with_new: "Pay with another method";
270
+ readonly pdf_failed: "We couldn't download the PDF. Please try again.";
271
+ readonly credit_notes_section: "Credit notes";
272
+ readonly payment_methods_section: "Payment methods";
273
+ readonly payment_methods_empty: "No payment methods saved.";
274
+ readonly payment_method_default: "Default";
275
+ readonly payment_method_expiring: "Expiring";
276
+ readonly payment_method_expired: "Expired";
277
+ readonly payment_method_expires: "Expires";
278
+ readonly action_make_default: "Make default";
279
+ readonly action_add_payment_method: "Add payment method";
280
+ readonly remove_payment_method_confirm: "Remove this payment method?";
281
+ readonly payment_method_required_warning: "Add another payment method, or your next payment can't be collected automatically.";
282
+ readonly payment_method_failed: "We couldn't update the payment method. Please try again.";
168
283
  };
169
284
  export type KitMessageCode = keyof typeof KIT_MESSAGES_EN;
170
285
  /**