@arnaudjnn/billing-tools 0.58.0 → 0.58.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui/address.d.ts +16 -3
- package/dist/ui/address.d.ts.map +1 -1
- package/dist/ui/address.js +10 -9
- package/dist/ui/address.js.map +1 -1
- package/package.json +1 -1
package/dist/ui/address.d.ts
CHANGED
|
@@ -11,19 +11,32 @@ export type AddressValue = {
|
|
|
11
11
|
country: string;
|
|
12
12
|
};
|
|
13
13
|
export declare function BillingAddressForm({ publishableKey, defaultValue, onChange, appearance, locale,
|
|
14
|
-
/**
|
|
15
|
-
* is
|
|
16
|
-
showName, googleMapsApiKey, currency, className, }: {
|
|
14
|
+
/** Label the name line as a person (`full`) rather than an organization.
|
|
15
|
+
* It is NOT a way to hide the field — Stripe always collects a name. */
|
|
16
|
+
showName, defaultName, googleMapsApiKey, currency, className, }: {
|
|
17
17
|
publishableKey: string;
|
|
18
18
|
defaultValue?: AddressValue | null;
|
|
19
19
|
/**
|
|
20
20
|
* Called on every edit. `null` while the address is incomplete, so a caller
|
|
21
21
|
* can disable Save until Stripe considers it valid for the chosen country.
|
|
22
|
+
*
|
|
23
|
+
* "Incomplete" includes an empty NAME, which is easy to miss: every address
|
|
24
|
+
* field can be filled and this still reports null. Pass `defaultName` so the
|
|
25
|
+
* caller's Save button isn't disabled by a field they never asked for.
|
|
22
26
|
*/
|
|
23
27
|
onChange: (address: AddressValue | null) => void;
|
|
24
28
|
appearance?: Appearance;
|
|
25
29
|
locale?: StripeElementLocale;
|
|
26
30
|
showName?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Prefill for the name field.
|
|
33
|
+
*
|
|
34
|
+
* Not cosmetic: Stripe ALWAYS collects a name here and will not report the
|
|
35
|
+
* address `complete` until it has one, so a form left with an empty name can
|
|
36
|
+
* never be saved. Pass the name you already hold (the invoice name, the
|
|
37
|
+
* account name) and the field starts satisfied.
|
|
38
|
+
*/
|
|
39
|
+
defaultName?: string;
|
|
27
40
|
/**
|
|
28
41
|
* Your own Google Maps Places key. Supplying it is the documented way to get
|
|
29
42
|
* autocomplete standalone, and skips the hidden Payment Element described
|
package/dist/ui/address.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/ui/address.tsx"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,UAAU,EAEf,KAAK,mBAAmB,EACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA6B/B;+DAC+D;AAC/D,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAYF,wBAAgB,kBAAkB,CAAC,EACjC,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,MAAM;AACN;
|
|
1
|
+
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/ui/address.tsx"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,UAAU,EAEf,KAAK,mBAAmB,EACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA6B/B;+DAC+D;AAC/D,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAYF,wBAAgB,kBAAkB,CAAC,EACjC,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,MAAM;AACN;yEACyE;AACzE,QAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,QAAgB,EAChB,SAAS,GACV,EAAE;IACD,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IACnC;;;;;;;OAOG;IACH,QAAQ,EAAE,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,KAAK,IAAI,CAAC;IACjD,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;mDAC+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,qBAmFA"}
|
package/dist/ui/address.js
CHANGED
|
@@ -13,9 +13,9 @@ function stripeFor(publishableKey) {
|
|
|
13
13
|
return p;
|
|
14
14
|
}
|
|
15
15
|
export function BillingAddressForm({ publishableKey, defaultValue, onChange, appearance, locale,
|
|
16
|
-
/**
|
|
17
|
-
* is
|
|
18
|
-
showName = false, googleMapsApiKey, currency = "eur", className, }) {
|
|
16
|
+
/** Label the name line as a person (`full`) rather than an organization.
|
|
17
|
+
* It is NOT a way to hide the field — Stripe always collects a name. */
|
|
18
|
+
showName = false, defaultName, googleMapsApiKey, currency = "eur", className, }) {
|
|
19
19
|
const stripe = React.useMemo(() => stripeFor(publishableKey), [publishableKey]);
|
|
20
20
|
// Read through a ref: callers pass inline arrows, and re-rendering the
|
|
21
21
|
// element on every keystroke would fight the user for the caret.
|
|
@@ -27,9 +27,10 @@ showName = false, googleMapsApiKey, currency = "eur", className, }) {
|
|
|
27
27
|
autocomplete: googleMapsApiKey
|
|
28
28
|
? { mode: "google_maps_api", apiKey: googleMapsApiKey }
|
|
29
29
|
: { mode: "automatic" },
|
|
30
|
-
|
|
31
|
-
? {
|
|
32
|
-
|
|
30
|
+
defaultValues: {
|
|
31
|
+
...(defaultName ? { name: defaultName } : {}),
|
|
32
|
+
...(defaultValue
|
|
33
|
+
? {
|
|
33
34
|
address: {
|
|
34
35
|
line1: defaultValue.line1,
|
|
35
36
|
line2: defaultValue.line2 ?? undefined,
|
|
@@ -38,9 +39,9 @@ showName = false, googleMapsApiKey, currency = "eur", className, }) {
|
|
|
38
39
|
postal_code: defaultValue.postal_code ?? undefined,
|
|
39
40
|
country: defaultValue.country,
|
|
40
41
|
},
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
}
|
|
43
|
+
: {}),
|
|
44
|
+
},
|
|
44
45
|
}),
|
|
45
46
|
// Mount-time only, deliberately: rebuilding the options mid-edit remounts
|
|
46
47
|
// the element and wipes what the user has typed. `defaultValue` is a
|
package/dist/ui/address.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src/ui/address.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,EACL,UAAU,GAIX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAwC/B,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkC,CAAC;AACxD,SAAS,SAAS,CAAC,cAAsB;IACvC,IAAI,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAClC,IAAI,CAAC,CAAC,EAAE,CAAC;QACP,CAAC,GAAG,UAAU,CAAC,cAAc,CAAC,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,EAChB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CACd,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAE,CAAC,CAAC,KAAK,CAAC,OAAwB,CAAC,CAAC,CAAC,IAAI,CAAC,GAE5E,EACD,CAAC,gBAAgB,IAAI;gBACpB,8DAA8D;gBAC9D,6DAA6D;gBAC7D,qEAAqE;gBACrE,qEAAqE;gBACrE,aAAa;gBACb,mCAEE,KAAK,QACL,KAAK,EAAE;wBACL,QAAQ,EAAE,UAAU;wBACpB,IAAI,EAAE,SAAS;wBACf,GAAG,EAAE,CAAC;wBACN,KAAK,EAAE,OAAO;wBACd,MAAM,EAAE,OAAO;wBACf,QAAQ,EAAE,QAAQ;wBAClB,aAAa,EAAE,MAAM;qBACtB,YAED,KAAC,cAAc,KAAG,GACd,CACP,IACG,GACG,CACZ,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arnaudjnn/billing-tools",
|
|
3
|
-
"version": "0.58.
|
|
3
|
+
"version": "0.58.1",
|
|
4
4
|
"description": "The get-paid engine for Stripe + WorkOS apps, for humans and AI agents. Drop-in API-key auth, token/credit + subscription billing, auth.md agent registration, and MPP machine payments, as MCP tools, a REST API, and a CLI. Framework-agnostic, storage-pluggable.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Arnaud Jeannin",
|