@openrails/billing-ui 0.0.0-stage → 0.230.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/CHANGELOG.md +257 -0
- package/LICENSE +21 -0
- package/README.md +211 -2
- package/dist/account/account-billing.d.ts +19 -0
- package/dist/account/cancel-dialog.d.ts +18 -0
- package/dist/account/change-card-dialog.d.ts +14 -0
- package/dist/account/format.d.ts +25 -0
- package/dist/account/notice.d.ts +3 -0
- package/dist/account/payment-history.d.ts +8 -0
- package/dist/account/payment-methods-panel.d.ts +19 -0
- package/dist/account/section.d.ts +25 -0
- package/dist/account/status-badge.d.ts +8 -0
- package/dist/account/subscriptions-panel.d.ts +19 -0
- package/dist/appearance.d.ts +23 -0
- package/dist/authenticate.d.ts +8 -0
- package/dist/checkout-frame.d.ts +17 -0
- package/dist/checkout-page.d.ts +16 -0
- package/dist/checkout.d.ts +24 -0
- package/dist/client/client.d.ts +167 -0
- package/dist/client/errors.d.ts +26 -0
- package/dist/client/generated/openrails-routes.d.ts +2 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/types.d.ts +754 -0
- package/dist/client-DhG2jv34.js +771 -0
- package/dist/client-DhG2jv34.js.map +1 -0
- package/dist/client.js +3 -0
- package/dist/components/billing-fields.d.ts +39 -0
- package/dist/components/card-brands.d.ts +6 -0
- package/dist/components/card-fields.d.ts +29 -0
- package/dist/components/ccbill-fields.d.ts +8 -0
- package/dist/components/methods.d.ts +13 -0
- package/dist/components/pay-button.d.ts +6 -0
- package/dist/components/qr.d.ts +6 -0
- package/dist/components/saved-methods.d.ts +9 -0
- package/dist/components/states.d.ts +10 -0
- package/dist/components/stripe-card.d.ts +17 -0
- package/dist/components/summary.d.ts +12 -0
- package/dist/components/ui/alert-dialog.d.ts +18 -0
- package/dist/components/ui/badge.d.ts +7 -0
- package/dist/components/ui/button.d.ts +8 -0
- package/dist/components/ui/card.d.ts +11 -0
- package/dist/components/ui/dialog.d.ts +17 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/label.d.ts +3 -0
- package/dist/components/ui/radio-group.d.ts +5 -0
- package/dist/components/ui/separator.d.ts +3 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/spinner.d.ts +3 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/dist-CslWupfi.js +3311 -0
- package/dist/dist-CslWupfi.js.map +1 -0
- package/dist/errors-T-PRm3vV.js +54 -0
- package/dist/errors-T-PRm3vV.js.map +1 -0
- package/dist/fixtures.d.ts +9 -0
- package/dist/frame.d.ts +47 -0
- package/dist/hooks-DLFF-zx5.js +285 -0
- package/dist/hooks-DLFF-zx5.js.map +1 -0
- package/dist/i18n/context.d.ts +4 -0
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/messages.d.ts +58 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +4182 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/billing.d.ts +25 -0
- package/dist/lib/card-brands.d.ts +2 -0
- package/dist/lib/card-entry.d.ts +46 -0
- package/dist/lib/ccbill.d.ts +8 -0
- package/dist/lib/collect.d.ts +51 -0
- package/dist/lib/money.d.ts +9 -0
- package/dist/lib/period.d.ts +15 -0
- package/dist/lib/rail-meta.d.ts +15 -0
- package/dist/lib/redirect.d.ts +2 -0
- package/dist/lib/stripe-appearance.d.ts +2 -0
- package/dist/lib/stripe.d.ts +2 -0
- package/dist/locales/de.d.ts +2 -0
- package/dist/locales/de.js +204 -0
- package/dist/locales/de.js.map +1 -0
- package/dist/locales/en.d.ts +201 -0
- package/dist/locales/en.js +204 -0
- package/dist/locales/en.js.map +1 -0
- package/dist/locales/es.d.ts +2 -0
- package/dist/locales/es.js +204 -0
- package/dist/locales/es.js.map +1 -0
- package/dist/locales/ja.d.ts +2 -0
- package/dist/locales/ja.js +195 -0
- package/dist/locales/ja.js.map +1 -0
- package/dist/locales/ko.d.ts +2 -0
- package/dist/locales/ko.js +195 -0
- package/dist/locales/ko.js.map +1 -0
- package/dist/locales/zh.d.ts +2 -0
- package/dist/locales/zh.js +195 -0
- package/dist/locales/zh.js.map +1 -0
- package/dist/modal.d.ts +12 -0
- package/dist/provider.d.ts +18 -0
- package/dist/psp.d.ts +46 -0
- package/dist/react/context.d.ts +38 -0
- package/dist/react/hooks.d.ts +76 -0
- package/dist/react/index.d.ts +3 -0
- package/dist/react/provider.d.ts +18 -0
- package/dist/react/remote.d.ts +11 -0
- package/dist/react.js +37 -0
- package/dist/react.js.map +1 -0
- package/dist/save-payment-method.d.ts +26 -0
- package/dist/scope-context.d.ts +17 -0
- package/dist/scope.d.ts +6 -0
- package/dist/source.d.ts +14 -0
- package/dist/styles.css +3 -0
- package/dist/tokenized-card-form.d.ts +24 -0
- package/dist/types.d.ts +191 -0
- package/docs/1055-nmi-host-integration.md +28 -0
- package/docs/payment-form-contract.md +153 -0
- package/package.json +112 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-DhG2jv34.js","names":[],"sources":["../src/lib/money.ts","../src/types.ts","../src/client/generated/openrails-routes.ts","../src/client/types.ts","../src/client/client.ts"],"sourcesContent":["// Exact money. Every amount the host serves is a signed int64 decimal string\n// of the plan currency's native unit; plan.unit_decimals is that currency's\n// registered scale (OpenRails' currency registry, GET /v1/currencies). Nothing\n// here converts an amount to a JS number: values are scaled with BigInt and\n// only the exact major-unit decimal is handed to Intl.\n\n// Amount is an int64 decimal string, e.g. \"99000000\" (99 USD at 6 decimals).\nexport type Amount = string\n\nconst INT64_MIN = -(1n << 63n)\nconst INT64_MAX = (1n << 63n) - 1n\nexport const MAX_UNIT_DECIMALS = 18\n\n// amountUnits parses an exact int64 decimal string, or null.\nexport function amountUnits(amount: unknown): bigint | null {\n if (typeof amount !== \"string\" || !/^-?\\d{1,19}$/.test(amount)) return null\n const value = BigInt(amount)\n return value < INT64_MIN || value > INT64_MAX ? null : value\n}\n\nexport function isAmount(value: unknown): value is Amount {\n return amountUnits(value) !== null\n}\n\nexport function isUnitDecimals(value: unknown): value is number {\n return (\n typeof value === \"number\" &&\n Number.isInteger(value) &&\n value >= 0 &&\n value <= MAX_UNIT_DECIMALS\n )\n}\n\n// addAmounts sums exact amounts; null when an input or the sum leaves int64.\nexport function addAmounts(...amounts: Amount[]): Amount | null {\n let total = 0n\n for (const amount of amounts) {\n const units = amountUnits(amount)\n if (units === null) return null\n total += units\n }\n return total < INT64_MIN || total > INT64_MAX ? null : total.toString()\n}\n\n// Intl.NumberFormat formats a decimal string exactly only since ECMA-402 2023\n// (Chrome/Edge 106, Firefox 116, Safari 15.4); older engines coerce it through\n// Number. Probed once with 2^53 + 1, which a Number cannot hold.\nexport const intlFormatsDecimalStringsExactly: boolean = (() => {\n try {\n return (\n new Intl.NumberFormat(\"en\", { useGrouping: false }).format(\n \"9007199254740993\" as `${number}`\n ) === \"9007199254740993\"\n )\n } catch {\n return false\n }\n})()\n\n// Below 10^15 native units a Number-coerced decimal still rounds back to the\n// exact digits at every registry scale; from 10^15 the coerced value can differ\n// in the last digit, so a legacy engine refuses instead of misformatting.\nconst LEGACY_EXACT_UNITS = 10n ** 15n\n\nfunction decimalFromUnits(value: bigint, decimals: number): string {\n const absolute = value < 0n ? -value : value\n const scale = 10n ** BigInt(decimals)\n const fraction = (absolute % scale)\n .toString()\n .padStart(decimals, \"0\")\n .replace(/0+$/, \"\")\n return `${value < 0n ? \"-\" : \"\"}${absolute / scale}${fraction ? `.${fraction}` : \"\"}`\n}\n\n// amountToDecimal renders native units as the exact major-unit decimal with\n// trailing zeros trimmed (\"99000000\" at 6 -> \"99\", \"1234567\" -> \"1.234567\"),\n// or null when the amount or scale is invalid.\nexport function amountToDecimal(\n amount: Amount,\n decimals: number\n): string | null {\n const units = amountUnits(amount)\n if (units === null || !isUnitDecimals(decimals)) return null\n return decimalFromUnits(units, decimals)\n}\n\n// formatAmount renders an exact amount in its currency for the buyer. It never\n// passes money through a JS number; an amount it cannot show exactly is\n// refused with a visible notice rather than a rounded figure.\nexport function formatAmount(\n amount: Amount | null | undefined,\n currency: string,\n decimals: number,\n locale?: string\n): string {\n const code = currency.trim().toUpperCase()\n const units = amountUnits(amount)\n if (units === null || !isUnitDecimals(decimals))\n return `${code} amount exceeds the exact display range`\n if (\n !intlFormatsDecimalStringsExactly &&\n (units >= LEGACY_EXACT_UNITS || units <= -LEGACY_EXACT_UNITS)\n )\n return `${code} amount exceeds this browser's exact display range`\n const decimal = decimalFromUnits(units, decimals) as `${number}`\n try {\n return new Intl.NumberFormat(locale, {\n style: \"currency\",\n currency: code,\n maximumFractionDigits: decimals,\n }).format(decimal)\n } catch {\n return `${decimal} ${code}`\n }\n}\n","// Wire types for the hosted checkout session surface, validated at runtime\n// with zod so a drifting API fails loudly at the boundary instead of rendering\n// garbage. OpenRails serves the session (GET /v1/checkout-sessions/{id}) and\n// publishes the same document as Go types (billing.HostedCheckoutSession) and\n// a canonical fixture\n// (testdata/wire/hosted_checkout_session.json) that src/types.test.ts decodes.\nimport { z } from \"zod\"\n\nimport { isAmount, isUnitDecimals, MAX_UNIT_DECIMALS } from \"./lib/money\"\n\n// Money is an exact signed int64 decimal string of the plan currency's native\n// unit (\"99000000\" is 99 USD at unit_decimals 6). A JSON number is refused:\n// it cannot carry every int64 and a scale must never be assumed.\nexport const amountSchema = z\n .string()\n .refine(isAmount, \"amount must be an int64 decimal string\")\n\n// The currency's registered scale from OpenRails' currency registry\n// (openrails.LookupCurrency / GET /v1/currencies), stamped by the host.\nexport const unitDecimalsSchema = z\n .number()\n .refine(\n isUnitDecimals,\n `unit_decimals must be an integer from 0 to ${MAX_UNIT_DECIMALS}`\n )\n\nconst httpsURLSchema = z\n .string()\n .url()\n .refine((value) => {\n try {\n const parsed = new URL(value)\n return (\n parsed.protocol === \"https:\" && !parsed.username && !parsed.password\n )\n } catch {\n return false\n }\n }, \"redirect URL must be HTTPS\")\n\nconst returnURLSchema = z\n .string()\n .url()\n .refine((value) => {\n try {\n const parsed = new URL(value)\n return (\n (parsed.protocol === \"https:\" || parsed.protocol === \"http:\") &&\n !parsed.username &&\n !parsed.password\n )\n } catch {\n return false\n }\n }, \"return URL must be HTTP(S)\")\n\nexport const checkoutSessionStatusSchema = z.enum([\n \"created\",\n \"requires_action\",\n \"processing\",\n \"succeeded\",\n \"failed\",\n \"blocked\",\n \"expired\",\n \"canceled\",\n])\nexport type CheckoutSessionStatus = z.infer<typeof checkoutSessionStatusSchema>\n\n// A definite decline, normalized by OpenRails. `field` places the message\n// next to the card field it concerns (\"\" = the card as a whole).\nexport const paymentFailureSchema = z.object({\n reason: z.string(),\n message: z.string(),\n field: z.string().nullish(),\n})\nexport type PaymentFailure = z.infer<typeof paymentFailureSchema>\n\n// The accepted payment operation; `requires_action` sessions authenticate it.\nexport const checkoutOperationSchema = z.object({\n id: z.string(),\n status: z.string(),\n})\n\nexport const paymentRailOptionSchema = z.object({\n id: z.string().min(1),\n rail: z.string(),\n mode: z.enum([\"one_off\", \"subscription\"]),\n // card: the PSP takes cards on OpenRails itself (card_entry: server); the\n // page posts the card and loads no gateway script.\n driver: z.enum([\n \"collect_js\",\n \"card\",\n \"stripe_elements\",\n \"redirect\",\n \"solana_pay\",\n ]),\n /** The PSP's checkout key; saving a new card names it. */\n psp_key: z.string().optional(),\n // Browser-safe rail config the host serves (nmi: Collect.js\n // tokenization_key + tokenization_url; stripe: publishable_key; driver\n // card: none).\n public_config: z.record(z.string(), z.string()).optional(),\n})\nexport type PaymentRailOption = z.infer<typeof paymentRailOptionSchema>\n\n// A card the session's customer has already stored with this merchant. Display\n// data only — paying with one sends its id, which the host resolves.\nexport const savedPaymentMethodSchema = z.object({\n id: z.string(),\n option_id: z.string(),\n rail: z.string(),\n brand: z.string().optional(),\n last_four: z.string().optional(),\n exp_month: z.number().optional(),\n exp_year: z.number().optional(),\n // Pre-selected in the picker; paying still sends this id explicitly.\n default: z.boolean().optional(),\n})\nexport type SavedPaymentMethod = z.infer<typeof savedPaymentMethodSchema>\n\n// Amounts are in the plan's currency at the plan's unit_decimals.\nexport const checkoutLineItemSchema = z.object({\n label: z.string(),\n sublabel: z.string().optional(),\n amount: amountSchema,\n})\nexport type CheckoutLineItem = z.infer<typeof checkoutLineItemSchema>\n\nexport const checkoutPlanSchema = z.object({\n display_name: z.string(),\n unit_amount: amountSchema,\n currency: z.string().min(1),\n unit_decimals: unitDecimalsSchema,\n period_hours: z.number().nullish(),\n automatically_renews: z.boolean(),\n})\nexport type CheckoutPlan = z.infer<typeof checkoutPlanSchema>\n\nexport const checkoutSessionSchema = z.object({\n id: z.string(),\n status: checkoutSessionStatusSchema,\n merchant: z.object({ display_name: z.string() }),\n plan: checkoutPlanSchema,\n line_items: z.array(checkoutLineItemSchema).optional(),\n tax: amountSchema.optional(),\n due_today: amountSchema.optional(),\n rails: z.array(paymentRailOptionSchema),\n saved_methods: z.array(savedPaymentMethodSchema).optional(),\n transaction_url: z.string().startsWith(\"solana:\").optional(),\n payment_id: z.string().optional(),\n subscription_id: z.string().optional(),\n failure_message: z.string().optional(),\n failure: paymentFailureSchema.nullish(),\n operation: checkoutOperationSchema.nullish(),\n // Present on hosted-page reads so the page host can redirect on success.\n success_url: returnURLSchema.optional(),\n // The origin of the app that framed the payment page: the only origin the\n // page exchanges frame messages with.\n embed_origin: z.string().url().optional(),\n expires_at: z.string().nullish(),\n})\nexport type CheckoutSession = z.infer<typeof checkoutSessionSchema>\n\nexport const payRequestSchema = z.object({\n option_id: z.string(),\n payment_token: z.string().optional(),\n payment_method_id: z.string().optional(),\n // Canonical billing identity. The compact card paths send only their\n // required fields; optional address fields remain available to an explicit\n // provider-specific source that models them.\n email: z.string().optional(),\n name_on_card: z.string().optional(),\n address1: z.string().optional(),\n city: z.string().optional(),\n state: z.string().optional(),\n zip: z.string().optional(),\n country: z.string().optional(),\n // A new card for a rail whose driver is card; never beside payment_token.\n card: z\n .object({\n number: z.string(),\n exp_month: z.number(),\n exp_year: z.number(),\n cvc: z.string(),\n })\n .optional(),\n // Collect.js display metadata for a new card (never the PAN).\n last_four: z.string().optional(),\n card_type: z.string().optional(),\n expiry_date: z.string().optional(),\n token_symbol: z.string().optional(),\n})\nexport type PayRequest = z.infer<typeof payRequestSchema>\n\nexport const payResultSchema = z.object({\n status: checkoutSessionStatusSchema,\n redirect_url: httpsURLSchema.optional(),\n transaction_url: z.string().startsWith(\"solana:\").optional(),\n payment_id: z.string().optional(),\n subscription_id: z.string().optional(),\n failure_message: z.string().optional(),\n failure: paymentFailureSchema.nullish(),\n /** The payment operation to authenticate when status is requires_action. */\n operation_id: z.string().optional(),\n})\nexport type PayResult = z.infer<typeof payResultSchema>\n\n// The lifecycle phases the Checkout component moves through. Superset of\n// session statuses: load/ready concerns are the component's, not the wire's.\nexport type CheckoutPhase =\n | \"loading\"\n | \"ready\"\n | \"processing\"\n | \"succeeded\"\n | \"failed\"\n | \"blocked\"\n | \"expired\"\n | \"unavailable\"\n | \"error\"\n","// Generated by `pnpm contract` from the in-repo OpenRails. Do not edit.\n\nexport type OpenRailsCustomerRoute =\n | \"GET /billing/v1/me/balance\"\n | \"POST /billing/v1/me/billing-portal\"\n | \"POST /billing/v1/me/checkout\"\n | \"POST /billing/v1/me/checkout/sessions\"\n | \"GET /billing/v1/me/checkout/{id}\"\n | \"POST /billing/v1/me/checkout/{id}/confirm\"\n | \"PUT /billing/v1/me/collection-payment-method\"\n | \"PUT /billing/v1/me/default-payment-method\"\n | \"GET /billing/v1/me/entitlements/active\"\n | \"GET /billing/v1/me/invoices\"\n | \"GET /billing/v1/me/invoices/{id}\"\n | \"POST /billing/v1/me/invoices/{id}/pay-now\"\n | \"GET /billing/v1/me/notifications\"\n | \"GET /billing/v1/me/notifications/unread-count\"\n | \"POST /billing/v1/me/notifications/{id}/read\"\n | \"GET /billing/v1/me/payment-methods\"\n | \"POST /billing/v1/me/payment-methods\"\n | \"POST /billing/v1/me/payment-methods/stripe-setup\"\n | \"GET /billing/v1/me/payment-methods/stripe-setup/{id}\"\n | \"POST /billing/v1/me/payment-methods/stripe-setup/{id}/confirm\"\n | \"DELETE /billing/v1/me/payment-methods/{id}\"\n | \"PUT /billing/v1/me/payment-methods/{id}\"\n | \"GET /billing/v1/me/payment-operations/{id}/authentication\"\n | \"POST /billing/v1/me/payment-operations/{id}/authentication/confirm\"\n | \"GET /billing/v1/me/payments\"\n | \"GET /billing/v1/me/products\"\n | \"GET /billing/v1/me/products/{product_id}/access\"\n | \"GET /billing/v1/me/spend-limits\"\n | \"GET /billing/v1/me/status\"\n | \"GET /billing/v1/me/subscriptions\"\n | \"GET /billing/v1/me/subscriptions/{id}\"\n | \"POST /billing/v1/me/subscriptions/{id}/cancel\"\n | \"POST /billing/v1/me/subscriptions/{id}/change-tier\"\n | \"POST /billing/v1/me/subscriptions/{id}/change-tier/preview\"\n | \"PUT /billing/v1/me/subscriptions/{id}/payment-method\"\n | \"GET /billing/v1/me/subscriptions/{id}/provider-cutover\"\n | \"POST /billing/v1/me/subscriptions/{id}/provider-cutover\"\n | \"POST /billing/v1/me/subscriptions/{id}/provider-cutover/preview\"\n | \"POST /billing/v1/me/subscriptions/{id}/resume\"\n | \"POST /billing/v1/me/subscriptions/{id}/retry-now\"\n | \"POST /billing/v1/me/subscriptions/{id}/solana-cancel\"\n | \"POST /billing/v1/me/subscriptions/{id}/solana-cancel-tx\"\n | \"POST /billing/v1/me/subscriptions/{id}/solana-tier-change\"\n | \"POST /billing/v1/me/subscriptions/{id}/solana-tier-change/confirm\"\n | \"GET /billing/v1/me/tier\"\n | \"GET /billing/v1/me/transactions\"\n | \"GET /billing/v1/me/usage\"\n\n// Currency code to native-unit decimals (openrails.Currencies()).\nexport const OPENRAILS_CURRENCY_SCALES: Readonly<Record<string, number>> = {\n EUR: 6,\n JPY: 4,\n USD: 6,\n}\n","// Wire types of the OpenRails customer surface (`/billing/v1/me/*`) and public\n// catalog, validated at the boundary. Money is an int64 string in the\n// currency's native unit; its scale comes from GET /currencies. Fixtures:\n// src/test/fixtures/wire.\nimport { z } from \"zod\"\n\nimport type { CardEntry } from \"../lib/card-entry\"\nimport { isAmount } from \"../lib/money\"\n\nconst amount = z.string().refine(isAmount, \"amount must be an int64 string\")\nconst time = z.string()\n\nexport const pageSchema = <T extends z.ZodType>(item: T) =>\n z.object({\n data: z\n .array(item)\n .nullish()\n .transform((v) => v ?? []),\n total: z.number().nullish(),\n limit: z.number().nullish(),\n offset: z.number().nullish(),\n has_more: z.boolean().nullish(),\n })\n\nexport interface Page<T> {\n data: T[]\n total?: number | null\n limit?: number | null\n offset?: number | null\n has_more?: boolean | null\n}\n\nexport const subscriptionStatusSchema = z.string()\n/** `pending | active | past_due | awaiting_method | unverified | cancelled`; kept open for new values. */\nexport type SubscriptionStatus =\n | \"pending\"\n | \"active\"\n | \"past_due\"\n | \"awaiting_method\"\n | \"unverified\"\n | \"cancelled\"\n | (string & {})\n\nexport const subscriptionPriceSchema = z.object({\n id: z.string(),\n key: z.string().nullish(),\n product_id: z.string().nullish(),\n unit_amount: amount,\n currency: z.string(),\n auto_renew: z.boolean().nullish(),\n access_duration_hours: z.number().nullish(),\n})\nexport type SubscriptionPrice = z.infer<typeof subscriptionPriceSchema>\n\nexport const subscriptionProductSchema = z.object({\n id: z.string(),\n key: z.string().nullish(),\n display_name: z.string().nullish(),\n description: z.string().nullish(),\n tier_group: z.string().nullish(),\n tier_rank: z.number().nullish(),\n})\nexport type SubscriptionProduct = z.infer<typeof subscriptionProductSchema>\n\nexport const cardSummarySchema = z.object({\n brand: z.string().nullish(),\n last4: z.string().nullish(),\n exp_month: z.number().nullish(),\n exp_year: z.number().nullish(),\n})\nexport type CardSummary = z.infer<typeof cardSummarySchema>\n\nexport const paymentOperationSchema = z.object({\n id: z.string(),\n status: z.string(),\n})\nexport type PaymentOperation = z.infer<typeof paymentOperationSchema>\n\nexport const paymentRecoverySchema = z.object({\n last_failure_reason: z.string().nullish(),\n retryable: z.boolean(),\n blocked_reason: z.string().nullish(),\n operation: paymentOperationSchema.nullish(),\n})\nexport type PaymentRecovery = z.infer<typeof paymentRecoverySchema>\n\nexport const subscriptionSchema = z.object({\n id: z.string(),\n status: subscriptionStatusSchema,\n rail: z.string().nullish(),\n product_id: z.string().nullish(),\n price_id: z.string().nullish(),\n psp_id: z.string().nullish(),\n payment_method_id: z.string().nullish(),\n started_at: time.nullish(),\n ended_at: time.nullish(),\n current_period_starts_at: time.nullish(),\n current_period_ends_at: time.nullish(),\n cancelled_at: time.nullish(),\n cancel_type: z.string().nullish(),\n resumable: z.boolean().nullish(),\n cancel_scheduled: z.boolean().nullish(),\n /** `reversible | destructive | external_portal` */\n cancel_mode: z.string().nullish(),\n cancel_portal_url: z.string().nullish(),\n grace_ends_at: time.nullish(),\n next_retry_at: time.nullish(),\n price: subscriptionPriceSchema.nullish(),\n product: subscriptionProductSchema.nullish(),\n scheduled_price: subscriptionPriceSchema.nullish(),\n scheduled_product: subscriptionProductSchema.nullish(),\n card: cardSummarySchema.nullish(),\n recovery: paymentRecoverySchema.nullish(),\n created_at: time.nullish(),\n updated_at: time.nullish(),\n})\nexport type Subscription = z.infer<typeof subscriptionSchema> & {\n status: SubscriptionStatus\n}\n\nexport const paymentMethodSchema = z.object({\n id: z.string(),\n type: z.string().nullish(),\n rail: z.string().nullish(),\n psp_id: z.string().nullish(),\n card: cardSummarySchema.nullish(),\n billing_details: z\n .object({ name: z.string().nullish(), email: z.string().nullish() })\n .nullish(),\n health: z\n .object({\n /** `valid | expiring_soon | expired` */\n expiry_status: z.string().nullish(),\n last_charged_at: time.nullish(),\n last_charge_outcome: z.string().nullish(),\n active: z.boolean().nullish(),\n })\n .nullish(),\n subscriptions: z\n .array(\n z.object({\n id: z.string(),\n display_name: z.string().nullish(),\n })\n )\n .nullish(),\n /** The customer's default card: pre-selected, never charged implicitly. */\n default: z.boolean().nullish(),\n /** Currencies whose invoices collect from this method by default. */\n collection_default_currencies: z.array(z.string()).nullish(),\n created_at: time.nullish(),\n})\nexport type PaymentMethod = z.infer<typeof paymentMethodSchema>\n\nexport const paymentSchema = z.object({\n id: z.string(),\n /** `charge | refund` */\n object: z.string().nullish(),\n /** `succeeded | pending | failed | refunded | partially_refunded` */\n status: z.string().nullish(),\n amount: amount,\n amount_refunded: amount.nullish(),\n currency: z.string(),\n subscription_id: z.string().nullish(),\n rail: z.string().nullish(),\n refunded: z.boolean().nullish(),\n created_at: time,\n price: z\n .object({\n id: z.string().nullish(),\n key: z.string().nullish(),\n product: z.string().nullish(),\n /** `one_time | recurring` */\n type: z.string().nullish(),\n /** Exact hours, e.g. `\"720h\"`. */\n recurring: z.object({ interval: z.string().nullish() }).nullish(),\n })\n .nullish(),\n /** What was bought; OpenRails newer than v0.160.0. */\n product: subscriptionProductSchema.nullish(),\n card: cardSummarySchema.nullish(),\n /** Normalized decline of a failed payment. */\n failure: z\n .object({\n reason: z.string(),\n message: z.string(),\n field: z.string().nullish(),\n })\n .nullish(),\n})\nexport type Payment = z.infer<typeof paymentSchema>\n\nexport const invoiceSchema = z.object({\n id: z.string(),\n currency: z.string(),\n invoice_number: z.string().nullish(),\n period_from: time,\n period_to: time,\n total_amount: amount,\n amount_paid: amount,\n amount_due: amount,\n status: z.string(),\n issued_at: time.nullish(),\n due_at: time.nullish(),\n paid_at: time.nullish(),\n recovery: paymentRecoverySchema.nullish(),\n created_at: time,\n})\nexport type Invoice = z.infer<typeof invoiceSchema>\n\nexport const invoicePageSchema = z.object({\n invoices: z\n .array(invoiceSchema)\n .nullish()\n .transform((v) => v ?? []),\n total: z.number().nullish(),\n limit: z.number().nullish(),\n offset: z.number().nullish(),\n})\n\nexport const billingStatusSchema = z.object({\n has_active_subscription: z.boolean(),\n subscription: subscriptionSchema.nullish(),\n next_renewal_at: time.nullish(),\n entitlements: z\n .array(\n z.object({\n entitlement: z.string(),\n start_at: time.nullish(),\n end_at: time.nullish(),\n revoked_at: time.nullish(),\n })\n )\n .nullish(),\n})\nexport type BillingStatus = z.infer<typeof billingStatusSchema>\n\n/** Currency code (upper case) to its native-unit scale. */\nexport type CurrencyScales = Readonly<Record<string, number>>\n\nexport const currencySchema = z.object({\n code: z.string(),\n /** Native-unit decimals of every amount on the wire. */\n decimals: z.number(),\n /** Decimals the provider settles in. */\n minor_decimals: z.number().nullish(),\n})\nexport type Currency = z.infer<typeof currencySchema>\n\nexport const currencyRegistrySchema = z.object({\n currencies: z.array(currencySchema),\n})\n\n/** A catalog price (`GET /prices`, embedded in `GET /products`). */\nexport const priceSchema = z.object({\n id: z.string(),\n key: z.string().nullish(),\n unit_amount: amount,\n currency: z.string(),\n /** `one_time | recurring` */\n type: z.string().nullish(),\n /** Exact hours, e.g. `\"720h\"`; absent on a one-time price. */\n recurring: z.object({ interval: z.string() }).nullish(),\n /** Product id. */\n product: z.string().nullish(),\n active: z.boolean().nullish(),\n /** PSP keys the price is linked to. */\n providers: z.array(z.string()).nullish(),\n metadata: z.record(z.string(), z.string()).nullish(),\n created_at: time.nullish(),\n})\nexport type Price = z.infer<typeof priceSchema>\n\nexport const productSchema = z.object({\n id: z.string(),\n key: z.string().nullish(),\n name: z.string(),\n description: z.string().nullish(),\n /** Keyed by the entitlements the product grants. */\n entitlements_spec: z.record(z.string(), z.number().nullable()).nullish(),\n /** Products sharing a group are tiers a subscription can change between. */\n tier_group: z.string().nullish(),\n tier_rank: z.number().nullish(),\n active: z.boolean().nullish(),\n metadata: z.record(z.string(), z.string()).nullish(),\n created_at: time.nullish(),\n updated_at: time.nullish(),\n prices: z\n .array(priceSchema)\n .nullish()\n .transform((v) => v ?? []),\n})\nexport type Product = z.infer<typeof productSchema>\n\nexport const tierChangePreviewSchema = z.object({\n /** `upgrade | downgrade` */\n action: z.string(),\n price_id: z.string(),\n rail: z.string().nullish(),\n currency: z.string(),\n /** Charged immediately; `\"0\"` for a downgrade. */\n amount_due_now: amount,\n /** The new price, charged at the next renewal. */\n next_charge_amount: amount,\n next_charge_date: time.nullish(),\n /** `now | period_end` */\n effective: z.string(),\n /** The rail finalizes the exact amount (Stripe upgrades). */\n is_estimate: z.boolean().nullish(),\n message: z.string().nullish(),\n})\nexport type TierChangePreview = z.infer<typeof tierChangePreviewSchema>\n\nexport const tierChangeSchema = z.object({\n /** `succeeded | processing | requires_action | blocked` */\n status: z.string(),\n /** `upgrade | downgrade` */\n action: z.string().nullish(),\n /** `now | period_end` */\n effective: z.string().nullish(),\n price_id: z.string().nullish(),\n /** The subscription now carrying the plan (an upgrade may open a successor). */\n subscription_id: z.string().nullish(),\n url: z.string().nullish(),\n next_action: z\n .object({\n /** `payment_authentication` uses `operation_id`. */\n type: z.string(),\n redirect_to_url: z.object({ url: z.string().nullish() }).nullish(),\n })\n .nullish(),\n /** When a scheduled downgrade takes effect. */\n delayed_start: time.nullish(),\n currency: z.string().nullish(),\n amount_due_now: amount.nullish(),\n next_charge_amount: amount.nullish(),\n next_charge_date: time.nullish(),\n message: z.string().nullish(),\n /** The durable operation: unresolved while `processing`, the payment to authenticate on `requires_action`. */\n operation_id: z.string().nullish(),\n})\nexport type TierChange = z.infer<typeof tierChangeSchema>\n\nexport const solanaCancelTxSchema = z.object({\n transaction: z.string().min(1),\n subscription_pda: z.string().nullish(),\n})\n\nconst tokenUnits = z.string().regex(/^\\d+$/, \"units must be a uint64 string\")\n\nexport const solanaTokenSchema = z.object({\n symbol: z.string(),\n name: z.string().nullish(),\n mint: z.string(),\n decimals: z.number(),\n /** USD price as an exact decimal string; absent without a feed quote. */\n price: z.string().nullish(),\n /** The stablecoin to present first. */\n preferred: z.boolean().nullish(),\n /** Can back a recurring subscription, not only a one-off payment. */\n recurring_eligible: z.boolean().nullish(),\n /** What the requested price costs in this token. */\n quote: z\n .object({\n /** Display decimal of `units`. */\n amount: z.string(),\n /** Exact on-chain base units. */\n units: tokenUnits,\n token_price_usd: z.string().nullish(),\n fx_rate: z.string().nullish(),\n fx_currency: z.string().nullish(),\n quoted_at: time.nullish(),\n expires_at: time.nullish(),\n })\n .nullish(),\n /** The requested wallet's holding. */\n balance: z\n .object({\n amount: z.string(),\n units: tokenUnits,\n /** Covers `quote`. */\n sufficient: z.boolean().nullish(),\n })\n .nullish(),\n})\nexport type SolanaToken = z.infer<typeof solanaTokenSchema>\n\nexport const solanaTokensSchema = z.object({\n tokens: z\n .array(solanaTokenSchema)\n .nullish()\n .transform((v) => v ?? []),\n})\n\nexport const solanaConfigSchema = z.object({\n /** `mainnet | devnet | testnet` */\n network: z.string(),\n /** `solana:<network>` */\n chain: z.string().nullish(),\n /** Never set by OpenRails: wallets bring their own RPC. */\n rpcUrl: z.string().nullish(),\n /** Explorer `?cluster=` value; absent on mainnet. */\n explorerCluster: z.string().nullish(),\n preferredToken: z.string().nullish(),\n tokens: z\n .array(solanaTokenSchema)\n .nullish()\n .transform((v) => v ?? []),\n features: z\n .object({\n solanaPay: z.boolean().nullish(),\n recurringSubscriptions: z.boolean().nullish(),\n solanaPayRecurringSubscriptions: z.boolean().nullish(),\n })\n .nullish(),\n})\nexport type SolanaConfig = z.infer<typeof solanaConfigSchema>\n\nexport const solanaTierChangeTxSchema = z.object({\n /** Base64; partially signed for an upgrade, unsigned for a downgrade. */\n transaction: z.string().min(1),\n /** `upgrade | downgrade` */\n kind: z.string().nullish(),\n new_subscription_pda: z.string().nullish(),\n})\nexport type SolanaTierChangeTx = z.infer<typeof solanaTierChangeTxSchema>\n\nexport const solanaTierChangeSchema = z.object({\n /** The subscription now carrying the plan. */\n subscription_id: z.string().nullish(),\n new_subscription_id: z.string().nullish(),\n /** `upgrade | downgrade` */\n kind: z.string().nullish(),\n status: z.string().nullish(),\n /** An earlier confirm already recorded this change. */\n already_confirmed: z.boolean().nullish(),\n})\nexport type SolanaTierChange = z.infer<typeof solanaTierChangeSchema>\n\n/** An in-page card setup; `payment_method_id` is set once the card is saved. */\nexport const cardSetupSchema = z.object({\n id: z.string(),\n status: z.string(),\n client_secret: z.string().nullish(),\n payment_method_id: z.string().nullish(),\n})\nexport type CardSetup = z.infer<typeof cardSetupSchema>\n\nexport const paymentAuthenticationSchema = z.object({\n client_secret: z.string().nullish(),\n})\nexport type PaymentAuthentication = z.infer<typeof paymentAuthenticationSchema>\n\n/** What a card setup hands the server: tokenized data only, never a PAN. */\ninterface NewCardFields {\n /** OpenRails PSP key the card is saved with (e.g. \"nmi\"); required. */\n provider: string\n name_on_card?: string\n country?: string\n zip?: string\n email?: string\n /** Collect.js display metadata: last four digits, brand, MM/YY. */\n last_four?: string\n card_type?: string\n expiry_date?: string\n}\n\n/**\n * A card to save: a token from the PSP's own fields (`payment_token`), or,\n * for a PSP whose card_entry is server (`cardSetupDriver` \"card\"), the card\n * itself, posted to OpenRails and never kept by this package.\n */\nexport type NewCard = NewCardFields &\n (\n | { payment_token: string; card?: never }\n | { card: CardEntry; payment_token?: never }\n )\n\n/**\n * A minted hosted checkout session. `id` reads and pays it with no other\n * credential (`client.checkoutSource(id)`); hand it to this customer's\n * browser only. `url` is the shared payment page (`<CheckoutFrame url>`),\n * absent when the app renders `<Checkout>` itself.\n */\nexport const hostedCheckoutLinkSchema = z.object({\n id: z.string().startsWith(\"ocs_\"),\n url: z.string().url().optional(),\n expires_at: time,\n})\nexport type HostedCheckoutLink = z.infer<typeof hostedCheckoutLinkSchema>\n","import type { z } from \"zod\"\n\nimport type { CheckoutSource } from \"../source\"\nimport {\n checkoutSessionSchema,\n payResultSchema,\n type PayRequest,\n type PayResult,\n} from \"../types\"\nimport {\n BillingError,\n isBillingError,\n localError,\n readBillingError,\n} from \"./errors\"\nimport { OPENRAILS_CURRENCY_SCALES } from \"./generated/openrails-routes\"\nimport {\n billingStatusSchema,\n cardSetupSchema,\n currencyRegistrySchema,\n hostedCheckoutLinkSchema,\n paymentAuthenticationSchema,\n invoicePageSchema,\n invoiceSchema,\n pageSchema,\n paymentMethodSchema,\n paymentSchema,\n priceSchema,\n productSchema,\n solanaCancelTxSchema,\n solanaConfigSchema,\n solanaTierChangeSchema,\n solanaTierChangeTxSchema,\n solanaTokensSchema,\n subscriptionSchema,\n tierChangePreviewSchema,\n tierChangeSchema,\n type BillingStatus,\n type CardSetup,\n type Currency,\n type HostedCheckoutLink,\n type PaymentAuthentication,\n type CurrencyScales,\n type Invoice,\n type NewCard,\n type Page,\n type Payment,\n type PaymentMethod,\n type Price,\n type Product,\n type SolanaConfig,\n type SolanaTierChange,\n type SolanaTierChangeTx,\n type SolanaToken,\n type Subscription,\n type TierChange,\n type TierChangePreview,\n} from \"./types\"\n\nexport interface BillingClientOptions {\n /** OpenRails embedded mount. Default \"/billing/v1\". */\n baseUrl?: string\n /**\n * Transport. Pass an authenticating fetch (auth-ui's `client.authFetch`)\n * or combine the default with `getToken`.\n */\n fetch?: (input: string, init: RequestInit) => Promise<Response>\n /** Bearer for each request; omit when `fetch` authenticates. */\n getToken?: () =>\n string | null | undefined | Promise<string | null | undefined>\n /** Sent as Accept-Language. */\n language?: () => string | null | undefined\n /**\n * Extra or overriding currency scales (code -> native-unit decimals). The\n * pinned OpenRails registry is built in; `/me` amounts carry no scale.\n */\n currencies?: CurrencyScales\n}\n\nexport interface ListOptions {\n limit?: number\n offset?: number\n signal?: AbortSignal\n}\n\nexport type SolanaCancelStage = \"preparing\" | \"signing\" | \"confirming\"\n\n/**\n * Signs and submits a base64 transaction with the customer's wallet and\n * returns its signature. Throw `WalletRejectedError` when the user declines.\n */\nexport type SendSolanaTransaction = (\n transactionBase64: string\n) => Promise<string>\n\nexport class WalletRejectedError extends Error {\n constructor(message = \"The wallet request was declined.\") {\n super(message)\n this.name = \"WalletRejectedError\"\n }\n}\n\nexport const CANCEL_FEEDBACK_MIN = 4\nexport const CANCEL_FEEDBACK_MAX = 500\n\ntype Query = Record<string, string | number | undefined>\n\ninterface RequestOptions {\n method?: string\n query?: Query\n body?: unknown\n signal?: AbortSignal\n headers?: Record<string, string>\n /** Sends no bearer: the hosted checkout session id is the credential. */\n anonymous?: boolean\n}\n\n/** Total wait a GET may spend on its one retry. */\nexport const RETRY_BUDGET_MS = 2_000\nconst RETRY_DELAY_MS = 300\n\n// The wait before retrying a GET answered with res, or null if it is final.\nfunction retryDelay(res: Response): number | null {\n const retryAfter = parseRetryAfter(res.headers.get(\"Retry-After\"))\n switch (res.status) {\n case 429:\n return retryAfter\n case 503:\n return retryAfter ?? RETRY_DELAY_MS\n case 502:\n case 504:\n return RETRY_DELAY_MS\n default:\n return null\n }\n}\n\nfunction parseRetryAfter(value: string | null): number | null {\n if (!value) return null\n if (/^\\d+$/.test(value.trim())) return Number(value.trim()) * 1000\n const at = Date.parse(value)\n return Number.isNaN(at) ? null : Math.max(0, at - Date.now())\n}\n\nfunction pause(ms: number, signal?: AbortSignal): Promise<number> {\n return new Promise((resolve, reject) => {\n if (signal?.aborted) return reject(signal.reason)\n const timer = setTimeout(() => {\n signal?.removeEventListener(\"abort\", abort)\n resolve(ms)\n }, ms)\n const abort = () => {\n clearTimeout(timer)\n reject(signal?.reason)\n }\n signal?.addEventListener(\"abort\", abort, { once: true })\n })\n}\n\nexport function createBillingClient(options: BillingClientOptions = {}) {\n const base = (options.baseUrl ?? \"/billing/v1\").replace(/\\/+$/, \"\")\n const doFetch =\n options.fetch ?? ((input: string, init: RequestInit) => fetch(input, init))\n const currencies = normalizeScales({\n ...OPENRAILS_CURRENCY_SCALES,\n ...options.currencies,\n })\n\n function url(path: string, query?: Query): string {\n const qs = new URLSearchParams()\n for (const [k, v] of Object.entries(query ?? {}))\n if (v !== undefined && v !== \"\") qs.set(k, String(v))\n const q = qs.toString()\n return `${base}${path}${q ? `?${q}` : \"\"}`\n }\n\n async function send(\n path: string,\n opts: RequestOptions = {}\n ): Promise<Response> {\n const headers = new Headers({ Accept: \"application/json\", ...opts.headers })\n if (opts.body !== undefined) headers.set(\"Content-Type\", \"application/json\")\n const token = opts.anonymous ? undefined : await options.getToken?.()\n if (token) headers.set(\"Authorization\", `Bearer ${token}`)\n const lang = options.language?.()\n if (lang) headers.set(\"Accept-Language\", lang)\n const method = opts.method ?? \"GET\"\n const init = {\n method,\n headers,\n body: opts.body === undefined ? undefined : JSON.stringify(opts.body),\n signal: opts.signal,\n }\n // Only a GET is retried: once, on a network error or 502/503/504 (and a\n // 429 that names its wait), within RETRY_BUDGET_MS. Writes never are.\n const retries = method === \"GET\" ? 1 : 0\n let waited = 0\n for (let attempt = 0; ; attempt++) {\n let res: Response\n try {\n res = await doFetch(url(path, opts.query), init)\n } catch (cause) {\n const delay = RETRY_DELAY_MS\n if (\n attempt >= retries ||\n opts.signal?.aborted ||\n !(cause instanceof TypeError) ||\n waited + delay > RETRY_BUDGET_MS\n )\n throw cause\n waited += await pause(delay, opts.signal)\n continue\n }\n if (res.ok) return res\n const delay = retryDelay(res)\n if (\n attempt >= retries ||\n delay === null ||\n waited + delay > RETRY_BUDGET_MS\n )\n throw await readBillingError(res)\n await res.body?.cancel().catch(() => undefined)\n waited += await pause(delay, opts.signal)\n }\n }\n\n async function json<S extends z.ZodType>(\n schema: S,\n path: string,\n opts?: RequestOptions\n ): Promise<z.output<S>> {\n const res = await send(path, opts)\n let body: unknown\n try {\n body = await res.json()\n } catch {\n throw localError(\"invalid_response\", `${path}: body is not JSON`)\n }\n const parsed = schema.safeParse(body)\n if (!parsed.success)\n throw localError(\n \"invalid_response\",\n `${path}: ${parsed.error.issues[0]?.path.join(\".\")} ${parsed.error.issues[0]?.message}`\n )\n return parsed.data\n }\n\n const id = (value: string) => encodeURIComponent(value)\n const subscriptionPage = pageSchema(subscriptionSchema)\n const methodPage = pageSchema(paymentMethodSchema)\n const paymentPage = pageSchema(paymentSchema)\n const productPage = pageSchema(productSchema)\n const pricePage = pageSchema(priceSchema)\n\n return {\n baseUrl: base,\n\n listSubscriptions(\n opts: ListOptions & { status?: string } = {}\n ): Promise<Page<Subscription>> {\n return json(subscriptionPage, \"/me/subscriptions\", {\n query: {\n status: opts.status ?? \"all\",\n limit: opts.limit ?? 100,\n offset: opts.offset,\n },\n signal: opts.signal,\n })\n },\n\n /** Includes `recovery` (list rows do not). */\n getSubscription(\n subscriptionId: string,\n signal?: AbortSignal\n ): Promise<Subscription> {\n return json(\n subscriptionSchema,\n `/me/subscriptions/${id(subscriptionId)}`,\n {\n signal,\n }\n )\n },\n\n /**\n * Queues the cancellation (202). Access and resumability follow the\n * rail's cancel mode; re-read the subscription to observe the result.\n */\n async cancelSubscription(\n subscriptionId: string,\n input: { feedback: string }\n ): Promise<void> {\n await send(`/me/subscriptions/${id(subscriptionId)}/cancel`, {\n method: \"POST\",\n body: { feedback: input.feedback.trim() },\n })\n },\n\n /** Queues the resumption (202). */\n async resumeSubscription(subscriptionId: string): Promise<void> {\n await send(`/me/subscriptions/${id(subscriptionId)}/resume`, {\n method: \"POST\",\n body: {},\n })\n },\n\n async setSubscriptionPaymentMethod(\n subscriptionId: string,\n paymentMethodId: string\n ): Promise<void> {\n await send(`/me/subscriptions/${id(subscriptionId)}/payment-method`, {\n method: \"PUT\",\n body: { payment_method_id: paymentMethodId },\n })\n },\n\n /** What `changeTier` would charge now and at the next renewal. */\n previewTierChange(\n subscriptionId: string,\n priceId: string,\n signal?: AbortSignal\n ): Promise<TierChangePreview> {\n return json(\n tierChangePreviewSchema,\n `/me/subscriptions/${id(subscriptionId)}/change-tier/preview`,\n { method: \"POST\", body: { price_id: priceId }, signal }\n )\n },\n\n /**\n * Moves the subscription to another price of its tier group: an upgrade\n * charges the saved card now, a downgrade applies at period end.\n * `idempotencyKey` identifies this attempt; reuse it until the change\n * resolves (`processing`, a `tier_change_in_flight` refusal or a lost\n * response) so the stored result replays instead of charging twice.\n */\n changeTier(\n subscriptionId: string,\n input: { priceId: string; idempotencyKey: string }\n ): Promise<TierChange> {\n return json(\n tierChangeSchema,\n `/me/subscriptions/${id(subscriptionId)}/change-tier`,\n {\n method: \"POST\",\n body: { price_id: input.priceId },\n headers: { \"Idempotency-Key\": input.idempotencyKey },\n }\n )\n },\n\n /**\n * Solana rail: the tier-change transaction for the wallet to sign and\n * send. Pass the resulting signature to `confirmSolanaTierChange`.\n */\n prepareSolanaTierChange(\n subscriptionId: string,\n newPriceId: string\n ): Promise<SolanaTierChangeTx> {\n return json(\n solanaTierChangeTxSchema,\n `/me/subscriptions/${id(subscriptionId)}/solana-tier-change`,\n { method: \"POST\", body: { new_price_id: newPriceId } }\n )\n },\n\n /**\n * Records the landed transaction. Keep the signature until this succeeds:\n * confirming it again replays the result (`already_confirmed`).\n */\n confirmSolanaTierChange(\n subscriptionId: string,\n input: { signature: string; newPriceId: string }\n ): Promise<SolanaTierChange> {\n return json(\n solanaTierChangeSchema,\n `/me/subscriptions/${id(subscriptionId)}/solana-tier-change/confirm`,\n {\n method: \"POST\",\n body: { signature: input.signature, new_price_id: input.newPriceId },\n }\n )\n },\n\n /**\n * On-chain cancellation for the solana rail: the server prepares an\n * unsigned transaction, the wallet signs and submits it, the server\n * verifies the signature and records the cancel.\n */\n async cancelSubscriptionOnChain(\n subscriptionId: string,\n sendTransaction: SendSolanaTransaction,\n onStage?: (stage: SolanaCancelStage) => void\n ): Promise<void> {\n onStage?.(\"preparing\")\n const { transaction } = await json(\n solanaCancelTxSchema,\n `/me/subscriptions/${id(subscriptionId)}/solana-cancel-tx`,\n { method: \"POST\", body: {} }\n )\n onStage?.(\"signing\")\n let signature: string\n try {\n signature = await sendTransaction(transaction)\n } catch (err) {\n if (isWalletRejection(err))\n throw localError(\n \"wallet_rejected\",\n \"The wallet request was declined.\"\n )\n throw err\n }\n if (!signature)\n throw localError(\n \"wallet_no_signature\",\n \"The wallet returned no signature.\"\n )\n onStage?.(\"confirming\")\n await send(`/me/subscriptions/${id(subscriptionId)}/solana-cancel`, {\n method: \"POST\",\n body: { signature },\n })\n },\n\n listPaymentMethods(opts: ListOptions = {}): Promise<Page<PaymentMethod>> {\n return json(methodPage, \"/me/payment-methods\", {\n query: { limit: opts.limit ?? 100, offset: opts.offset },\n signal: opts.signal,\n })\n },\n\n /**\n * Stores a card entered in the page: a Collect.js token\n * (`cardSetupDriver` \"collect_js\") or the card itself (\"card\").\n */\n addPaymentMethod(card: NewCard): Promise<PaymentMethod> {\n return json(paymentMethodSchema, \"/me/payment-methods\", {\n method: \"POST\",\n body: card,\n })\n },\n\n /**\n * Starts an in-page card setup with a PSP whose browser SDK collects the\n * card (see `cardSetupDriver`). `idempotencyKey` identifies this attempt.\n */\n createCardSetup(input: {\n pspId: string\n idempotencyKey: string\n }): Promise<CardSetup> {\n return json(cardSetupSchema, \"/me/payment-methods/stripe-setup\", {\n method: \"POST\",\n body: { psp_id: input.pspId, consent: true },\n headers: { \"Idempotency-Key\": input.idempotencyKey },\n })\n },\n\n getCardSetup(setupId: string, signal?: AbortSignal): Promise<CardSetup> {\n return json(\n cardSetupSchema,\n `/me/payment-methods/stripe-setup/${id(setupId)}`,\n { signal }\n )\n },\n\n /** Verifies the setup with the provider; `payment_method_id` once saved. */\n confirmCardSetup(setupId: string): Promise<CardSetup> {\n return json(\n cardSetupSchema,\n `/me/payment-methods/stripe-setup/${id(setupId)}/confirm`,\n { method: \"POST\", body: {} }\n )\n },\n\n /** The provider challenge a pending payment operation is waiting on. */\n getPaymentAuthentication(\n operationId: string\n ): Promise<PaymentAuthentication> {\n return json(\n paymentAuthenticationSchema,\n `/me/payment-operations/${id(operationId)}/authentication`\n )\n },\n\n async confirmPaymentAuthentication(operationId: string): Promise<void> {\n await send(\n `/me/payment-operations/${id(operationId)}/authentication/confirm`,\n { method: \"POST\", body: {} }\n )\n },\n\n /** `pending` when the provider is still converging (202). */\n async removePaymentMethod(\n paymentMethodId: string\n ): Promise<\"removed\" | \"pending\"> {\n const res = await send(`/me/payment-methods/${id(paymentMethodId)}`, {\n method: \"DELETE\",\n })\n return res.status === 202 ? \"pending\" : \"removed\"\n },\n\n /** Makes the method the default collector for one currency's invoices. */\n async setDefaultPaymentMethod(input: {\n currency: string\n paymentMethodId: string\n }): Promise<void> {\n await send(\"/me/collection-payment-method\", {\n method: \"PUT\",\n body: {\n currency: input.currency.toUpperCase(),\n payment_method_id: input.paymentMethodId,\n },\n })\n },\n\n /** Charges and refunds, newest first. `rail` filters by rail. */\n listPayments(\n opts: ListOptions & { rail?: string } = {}\n ): Promise<Page<Payment>> {\n return json(paymentPage, \"/me/payments\", {\n query: {\n limit: opts.limit ?? 20,\n offset: opts.offset,\n type: opts.rail,\n },\n signal: opts.signal,\n })\n },\n\n async listInvoices(opts: ListOptions = {}): Promise<Page<Invoice>> {\n const page = await json(invoicePageSchema, \"/me/invoices\", {\n query: { limit: opts.limit ?? 20, offset: opts.offset },\n signal: opts.signal,\n })\n const offset = page.offset ?? opts.offset ?? 0\n return {\n data: page.invoices,\n total: page.total,\n limit: page.limit,\n offset,\n has_more:\n page.total != null\n ? offset + page.invoices.length < page.total\n : null,\n }\n },\n\n getInvoice(invoiceId: string, signal?: AbortSignal): Promise<Invoice> {\n return json(invoiceSchema, `/me/invoices/${id(invoiceId)}`, { signal })\n },\n\n getStatus(signal?: AbortSignal): Promise<BillingStatus> {\n return json(billingStatusSchema, \"/me/status\", { signal })\n },\n\n /** Active products with their active prices. */\n listProducts(opts: ListOptions = {}): Promise<Page<Product>> {\n return json(productPage, \"/products\", {\n query: { limit: opts.limit ?? 100, offset: opts.offset },\n signal: opts.signal,\n })\n },\n\n /** Active prices. `product` is a `prod_` id; `type` is `recurring | one_time`. */\n listPrices(\n opts: ListOptions & {\n currency?: string\n product?: string\n type?: string\n } = {}\n ): Promise<Page<Price>> {\n return json(pricePage, \"/prices\", {\n query: {\n currency: opts.currency,\n product: opts.product,\n type: opts.type,\n limit: opts.limit ?? 100,\n offset: opts.offset,\n },\n signal: opts.signal,\n })\n },\n\n /** The server's currency registry; `currencies` is the pinned copy. */\n async listCurrencies(signal?: AbortSignal): Promise<Currency[]> {\n const registry = await json(currencyRegistrySchema, \"/currencies\", {\n signal,\n })\n return registry.currencies\n },\n\n /**\n * Mints a hosted checkout session for the signed-in customer and one\n * price. Render it with `<CheckoutFrame url>` when the session has a\n * `url`, else with `<Checkout source={client.checkoutSource(id)}>`.\n * `successUrl` brings the buyer back from a redirect rail; it must be on\n * one of this app's return origins.\n */\n createCheckoutSession(input: {\n priceKey?: string\n priceId?: string\n successUrl?: string\n }): Promise<HostedCheckoutLink> {\n if (!input.priceKey === !input.priceId)\n return Promise.reject(\n localError(\n \"invalid_request\",\n \"Pass exactly one of priceKey or priceId.\"\n )\n )\n return json(hostedCheckoutLinkSchema, \"/me/checkout/sessions\", {\n method: \"POST\",\n body: {\n price_key: input.priceKey,\n price_id: input.priceId,\n success_url: input.successUrl,\n },\n })\n },\n\n /**\n * Reads and pays one hosted checkout session. The id is the only\n * credential: no bearer is sent. A refusal the buyer can answer (an\n * invalid card form, too many attempts) resolves as `failed`; an expired\n * or unknown session as `expired`.\n */\n checkoutSource(sessionId: string): CheckoutSource {\n const path = `/checkout-sessions/${id(sessionId)}`\n return {\n getSession: () =>\n json(checkoutSessionSchema, path, { anonymous: true }),\n async pay(request: PayRequest): Promise<PayResult> {\n try {\n return await json(payResultSchema, `${path}/pay`, {\n method: \"POST\",\n body: request,\n anonymous: true,\n })\n } catch (err) {\n if (!isBillingError(err)) throw err\n switch (err.status) {\n case 404:\n case 410:\n return { status: \"expired\" }\n case 403:\n return { status: \"blocked\", failure_message: err.message }\n case 422:\n case 429:\n return { status: \"failed\", failure_message: err.message }\n }\n throw err\n }\n },\n }\n },\n\n /** Network and accepted tokens; served only with a Solana PSP. */\n getSolanaConfig(signal?: AbortSignal): Promise<SolanaConfig> {\n return json(solanaConfigSchema, \"/solana/config\", { signal })\n },\n\n /**\n * Accepted tokens with live prices. `priceId` or `checkoutSessionId` adds\n * each token's `quote`; `wallet` adds its `balance`.\n */\n async listSolanaTokens(\n opts: {\n priceId?: string\n checkoutSessionId?: string\n wallet?: string\n signal?: AbortSignal\n } = {}\n ): Promise<SolanaToken[]> {\n const { tokens } = await json(solanaTokensSchema, \"/solana/tokens\", {\n query: {\n price_id: opts.priceId,\n checkout_session_id: opts.checkoutSessionId,\n wallet: opts.wallet,\n },\n signal: opts.signal,\n })\n return tokens\n },\n\n /** Currency code (upper case) to native-unit decimals. */\n currencies,\n }\n}\n\nfunction normalizeScales(scales: CurrencyScales): CurrencyScales {\n return Object.fromEntries(\n Object.entries(scales).map(([code, decimals]) => [\n code.toUpperCase(),\n decimals,\n ])\n )\n}\n\nexport type BillingClient = ReturnType<typeof createBillingClient>\n\nexport const isWalletRejection = (error: unknown): boolean =>\n error instanceof WalletRejectedError ||\n (error instanceof Error && error.name === \"WalletRejectedError\") ||\n (error instanceof BillingError && error.code === \"wallet_rejected\")\n"],"mappings":";;;AASA,IAAM,IAAY,EAAE,MAAM,MACpB,KAAa,MAAM,OAAO;AAIhC,SAAgB,EAAY,GAAgC;CAC1D,IAAI,OAAO,KAAW,YAAY,CAAC,eAAe,KAAK,CAAM,GAAG,OAAO;CACvE,IAAM,IAAQ,OAAO,CAAM;CAC3B,OAAO,IAAQ,KAAa,IAAQ,IAAY,OAAO;AACzD;AAEA,SAAgB,EAAS,GAAiC;CACxD,OAAO,EAAY,CAAK,MAAM;AAChC;AAEA,SAAgB,EAAe,GAAiC;CAC9D,OACE,OAAO,KAAU,YACjB,OAAO,UAAU,CAAK,KACtB,KAAS,KACT,KAAA;AAEJ;AAGA,SAAgB,EAAW,GAAG,GAAkC;CAC9D,IAAI,IAAQ;CACZ,KAAK,IAAM,KAAU,GAAS;EAC5B,IAAM,IAAQ,EAAY,CAAM;EAChC,IAAI,MAAU,MAAM,OAAO;EAC3B,KAAS;CACX;CACA,OAAO,IAAQ,KAAa,IAAQ,IAAY,OAAO,EAAM,SAAS;AACxE;AAKA,IAAa,WAAmD;CAC9D,IAAI;EACF,OACE,IAAI,KAAK,aAAa,MAAM,EAAE,aAAa,GAAM,CAAC,CAAC,CAAC,OAClD,kBACF,MAAM;CAEV,QAAQ;EACN,OAAO;CACT;AACF,EAAA,CAAG,GAKG,IAAqB,OAAO;AAElC,SAAS,EAAiB,GAAe,GAA0B;CACjE,IAAM,IAAW,IAAQ,KAAK,CAAC,IAAQ,GACjC,IAAQ,OAAO,OAAO,CAAQ,GAC9B,KAAY,IAAW,EAAA,CAC1B,SAAS,CAAC,CACV,SAAS,GAAU,GAAG,CAAC,CACvB,QAAQ,OAAO,EAAE;CACpB,OAAO,GAAG,IAAQ,K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AE,QAAQ,UAAU;OAC7B,KAAK,KACH,OAAO;QAAE,QAAQ;QAAW,iBAAiB,EAAI;OAAQ;OAC3D,KAAK;OACL,KAAK,KACH,OAAO;QAAE,QAAQ;QAAU,iBAAiB,EAAI;OAAQ;MAC5D;MACA,MAAM;KACR;IACF;GACF;EACF;EAGA,gBAAgB,GAA6C;GAC3D,OAAO,EAAK,IAAoB,kBAAkB,EAAE,UAAO,CAAC;EAC9D;EAMA,MAAM,iBACJ,IAKI,CAAC,GACmB;GACxB,IAAM,EAAE,cAAW,MAAM,EAAK,IAAoB,kBAAkB;IAClE,OAAO;KACL,UAAU,EAAK;KACf,qBAAqB,EAAK;KAC1B,QAAQ,EAAK;IACf;IACA,QAAQ,EAAK;GACf,CAAC;GACD,OAAO;EACT;EAGA;CACF;AACF;AAEA,SAAS,GAAgB,GAAwC;CAC/D,OAAO,OAAO,YACZ,OAAO,QAAQ,CAAM,CAAC,CAAC,KAAK,CAAC,GAAM,OAAc,CAC/C,EAAK,YAAY,GACjB,CACF,CAAC,CACH;AACF;AAIA,IAAa,KAAqB,MAChC,aAAiB,KAChB,aAAiB,SAAS,EAAM,SAAS,yBACzC,aAAiB,KAAgB,EAAM,SAAS"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { a as e, n as t, o as n, r, t as i } from "./errors-T-PRm3vV.js";
|
|
2
|
+
import { a, b as o, i as s, n as c, o as l, r as u, t as d, y as f } from "./client-DhG2jv34.js";
|
|
3
|
+
export { i as BillingError, d as CANCEL_FEEDBACK_MAX, c as CANCEL_FEEDBACK_MIN, u as RETRY_BUDGET_MS, s as WalletRejectedError, f as amountToDecimal, a as createBillingClient, o as formatAmount, t as isBillingError, r as isServerError, l as isWalletRejection, e as readBillingError, n as toBillingError };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { NMIBilling } from '../lib/billing';
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
export declare function BillingTextField({ id, name, label, value, onChange, autoComplete, placeholder, disabled, maxLength, required, type, inputMode, pattern, }: {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
onChange: (value: string) => void;
|
|
9
|
+
autoComplete: string;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
maxLength?: number;
|
|
13
|
+
required?: boolean;
|
|
14
|
+
type?: React.HTMLInputTypeAttribute;
|
|
15
|
+
inputMode?: React.HTMLAttributes<HTMLInputElement>["inputMode"];
|
|
16
|
+
pattern?: string;
|
|
17
|
+
}): React.JSX.Element;
|
|
18
|
+
export declare function CountryField({ id, value, onChange, disabled, }: {
|
|
19
|
+
id: string;
|
|
20
|
+
value: string;
|
|
21
|
+
onChange: (value: string) => void;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
}): React.JSX.Element;
|
|
24
|
+
export declare function PostalField({ id, value, country, onChange, disabled, required, error, }: {
|
|
25
|
+
id: string;
|
|
26
|
+
value: string;
|
|
27
|
+
country: string;
|
|
28
|
+
onChange: (value: string) => void;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
required: boolean;
|
|
31
|
+
error?: string;
|
|
32
|
+
}): React.JSX.Element;
|
|
33
|
+
export declare function CardBillingFields({ idPrefix, value, onChange, disabled, postalError, }: {
|
|
34
|
+
idPrefix: string;
|
|
35
|
+
value: NMIBilling;
|
|
36
|
+
onChange: (next: NMIBilling) => void;
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
postalError?: string;
|
|
39
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CardEntryState } from '../lib/card-entry';
|
|
2
|
+
import { CollectFieldErrors } from '../lib/collect';
|
|
3
|
+
import type * as React from "react";
|
|
4
|
+
export interface CardFieldIds {
|
|
5
|
+
number: string;
|
|
6
|
+
expiry: string;
|
|
7
|
+
cvv: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function CardFields({ ids, preview, error, fieldErrors, hidden, }: {
|
|
10
|
+
ids: CardFieldIds;
|
|
11
|
+
preview: boolean;
|
|
12
|
+
error?: string;
|
|
13
|
+
/** Inline per-field errors (gateway validation or a decline). */
|
|
14
|
+
fieldErrors?: CollectFieldErrors;
|
|
15
|
+
hidden?: boolean;
|
|
16
|
+
}): React.JSX.Element;
|
|
17
|
+
/**
|
|
18
|
+
* Card entry for a PSP that takes cards on OpenRails itself (driver "card"):
|
|
19
|
+
* plain inputs in the same layout as the Collect.js containers. The card is
|
|
20
|
+
* posted to OpenRails; no gateway script is loaded.
|
|
21
|
+
*/
|
|
22
|
+
export declare function NativeCardFields({ ids, card, fieldErrors, disabled, hidden, }: {
|
|
23
|
+
ids: CardFieldIds;
|
|
24
|
+
card: CardEntryState;
|
|
25
|
+
/** Inline errors beyond the form's own (a decline naming a field). */
|
|
26
|
+
fieldErrors?: CollectFieldErrors;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
hidden?: boolean;
|
|
29
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CCBillBilling } from '../lib/ccbill';
|
|
2
|
+
export declare function CCBillFields({ idPrefix, value, onChange, disabled, error, }: {
|
|
3
|
+
idPrefix: string;
|
|
4
|
+
value: CCBillBilling;
|
|
5
|
+
onChange: (next: CCBillBilling) => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
error?: string;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PaymentRailOption } from '../types';
|
|
2
|
+
export declare function MethodList({ rails, selected, onSelect, disabled, idPrefix, renderBody, }: {
|
|
3
|
+
rails: PaymentRailOption[];
|
|
4
|
+
selected: string;
|
|
5
|
+
onSelect: (optionID: string) => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
idPrefix: string;
|
|
8
|
+
renderBody: (option: PaymentRailOption, active: boolean) => React.ReactNode;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
export declare function MethodBody({ children, hidden, }: {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
hidden?: boolean;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SavedPaymentMethod } from '../types';
|
|
2
|
+
export declare const NEW_CARD_VALUE = "new";
|
|
3
|
+
export declare function SavedMethods({ methods, value, onChange, disabled, idPrefix, }: {
|
|
4
|
+
methods: SavedPaymentMethod[];
|
|
5
|
+
value: string;
|
|
6
|
+
onChange: (value: string) => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
idPrefix: string;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function LoadingSkeleton(): import("react").JSX.Element;
|
|
2
|
+
export declare function SucceededView({ merchantName, embedded, }: {
|
|
3
|
+
merchantName: string;
|
|
4
|
+
embedded: boolean;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
6
|
+
export declare function TerminalView({ merchantName, headline, sub, }: {
|
|
7
|
+
merchantName: string;
|
|
8
|
+
headline: string;
|
|
9
|
+
sub?: string;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BillingClient } from '../client/client';
|
|
2
|
+
import { PspConfig } from '../psp';
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
export interface StripeCardHandle {
|
|
5
|
+
/** Confirms the setup and returns the saved payment method id. */
|
|
6
|
+
save(): Promise<string>;
|
|
7
|
+
}
|
|
8
|
+
export declare const StripeCardEntry: React.ForwardRefExoticComponent<{
|
|
9
|
+
psp: PspConfig;
|
|
10
|
+
client: BillingClient;
|
|
11
|
+
returnURL?: (setupId: string) => string;
|
|
12
|
+
defaultCountry?: string;
|
|
13
|
+
/** Completeness of the entered card, from the element's change events. */
|
|
14
|
+
onCompleteChange?: (complete: boolean) => void;
|
|
15
|
+
unavailableMessage: string;
|
|
16
|
+
verificationPendingMessage: string;
|
|
17
|
+
} & React.RefAttributes<StripeCardHandle>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CheckoutSession } from '../types';
|
|
2
|
+
export declare function Eyebrow({ children, className, }: {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
6
|
+
export declare function OrderSummary({ session }: {
|
|
7
|
+
session: CheckoutSession;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
export declare function CompactSummary({ session, className, }: {
|
|
10
|
+
session: CheckoutSession;
|
|
11
|
+
className?: string;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AlertDialog as AlertDialogPrimitive } from '@base-ui/react/alert-dialog';
|
|
2
|
+
import { Button } from './button';
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
declare function AlertDialog({ ...props }: AlertDialogPrimitive.Root.Props): React.JSX.Element;
|
|
5
|
+
declare function AlertDialogTrigger({ ...props }: AlertDialogPrimitive.Trigger.Props): React.JSX.Element;
|
|
6
|
+
declare function AlertDialogPortal({ ...props }: AlertDialogPrimitive.Portal.Props): React.JSX.Element;
|
|
7
|
+
declare function AlertDialogOverlay({ className, ...props }: AlertDialogPrimitive.Backdrop.Props): React.JSX.Element;
|
|
8
|
+
declare function AlertDialogContent({ className, size, ...props }: AlertDialogPrimitive.Popup.Props & {
|
|
9
|
+
size?: "default" | "sm";
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function AlertDialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
12
|
+
declare function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
13
|
+
declare function AlertDialogMedia({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
14
|
+
declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>): React.JSX.Element;
|
|
15
|
+
declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Description>): React.JSX.Element;
|
|
16
|
+
declare function AlertDialogAction({ className, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
|
|
17
|
+
declare function AlertDialogCancel({ className, variant, size, ...props }: AlertDialogPrimitive.Close.Props & Pick<React.ComponentProps<typeof Button>, "variant" | "size">): React.JSX.Element;
|
|
18
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const badgeVariants: (props?: ({
|
|
4
|
+
variant?: "destructive" | "link" | "default" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
declare function Badge({ className, variant, render, ...props }: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
|
|
7
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Button as ButtonPrimitive } from '@base-ui/react/button';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "destructive" | "link" | "default" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
5
|
+
size?: "default" | "icon" | "xs" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
declare function Button({ className, variant, size, ...props }: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>): import("react").JSX.Element;
|
|
8
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function Card({ className, size, ...props }: React.ComponentProps<"div"> & {
|
|
3
|
+
size?: "default" | "sm";
|
|
4
|
+
}): React.JSX.Element;
|
|
5
|
+
declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
6
|
+
declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
7
|
+
declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
8
|
+
declare function CardAction({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
9
|
+
declare function CardContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
10
|
+
declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
11
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function Dialog({ ...props }: DialogPrimitive.Root.Props): React.JSX.Element;
|
|
4
|
+
declare function DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props): React.JSX.Element;
|
|
5
|
+
declare function DialogPortal({ ...props }: DialogPrimitive.Portal.Props): React.JSX.Element;
|
|
6
|
+
declare function DialogClose({ ...props }: DialogPrimitive.Close.Props): React.JSX.Element;
|
|
7
|
+
declare function DialogOverlay({ className, ...props }: DialogPrimitive.Backdrop.Props): React.JSX.Element;
|
|
8
|
+
declare function DialogContent({ className, children, showCloseButton, ...props }: DialogPrimitive.Popup.Props & {
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
12
|
+
declare function DialogFooter({ className, showCloseButton, children, ...props }: React.ComponentProps<"div"> & {
|
|
13
|
+
showCloseButton?: boolean;
|
|
14
|
+
}): React.JSX.Element;
|
|
15
|
+
declare function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props): React.JSX.Element;
|
|
16
|
+
declare function DialogDescription({ className, ...props }: DialogPrimitive.Description.Props): React.JSX.Element;
|
|
17
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Radio as RadioPrimitive } from '@base-ui/react/radio';
|
|
2
|
+
import { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group';
|
|
3
|
+
declare function RadioGroup({ className, ...props }: RadioGroupPrimitive.Props): import("react").JSX.Element;
|
|
4
|
+
declare function RadioGroupItem({ className, ...props }: RadioPrimitive.Root.Props): import("react").JSX.Element;
|
|
5
|
+
export { RadioGroup, RadioGroupItem };
|