@usethrottle/auth 0.12.0 → 0.13.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 +10 -0
- package/dist/{AccountModal-B5Y6DXYQ.js → AccountModal-4GF7X5X4.js} +2 -2
- package/dist/{chunk-MC7TAQYZ.js → chunk-37RG635A.js} +4 -17
- package/dist/{chunk-MC7TAQYZ.js.map → chunk-37RG635A.js.map} +1 -1
- package/dist/chunk-PTREZIKS.js +31 -0
- package/dist/chunk-PTREZIKS.js.map +1 -0
- package/dist/{chunk-4HUBLJQC.js → chunk-X4IZ7RC6.js} +2 -2
- package/dist/{chunk-IQXKFRVX.js → chunk-YRJFGH6J.js} +9 -6
- package/dist/{chunk-IQXKFRVX.js.map → chunk-YRJFGH6J.js.map} +1 -1
- package/dist/{client-7LVKfuXO.d.ts → client-BripyQad.d.ts} +5 -3
- package/dist/{hooks-DkpLrEiC.d.ts → hooks-q2sYQa7f.d.ts} +1 -1
- package/dist/index.cjs +38 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.js +27 -1
- package/dist/index.js.map +1 -1
- package/dist/react/components/account/index.d.ts +3 -2
- package/dist/react/components/account/index.js +1 -1
- package/dist/react/components/auth/index.js +2 -2
- package/dist/react/components/index.cjs +71 -39
- package/dist/react/components/index.cjs.map +1 -1
- package/dist/react/components/index.d.cts +13 -5
- package/dist/react/components/index.d.ts +15 -7
- package/dist/react/components/index.js +25 -4
- package/dist/react/components/index.js.map +1 -1
- package/dist/react/components/provider.d.ts +2 -1
- package/dist/react/components/provider.js +1 -1
- package/dist/react/index.cjs +36 -0
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +7 -3
- package/dist/react/index.d.ts +7 -4
- package/dist/react/index.js +24 -1
- package/dist/styles.css +7 -4
- package/package.json +4 -1
- package/dist/chunk-ETYOOYYV.js +0 -2
- package/dist/chunk-ETYOOYYV.js.map +0 -1
- /package/dist/{AccountModal-B5Y6DXYQ.js.map → AccountModal-4GF7X5X4.js.map} +0 -0
- /package/dist/{chunk-4HUBLJQC.js.map → chunk-X4IZ7RC6.js.map} +0 -0
package/README.md
CHANGED
|
@@ -597,6 +597,16 @@ vague by design.
|
|
|
597
597
|
| `cart_already_claimed` | `claimCart` targeted a cart already bound to a different customer. |
|
|
598
598
|
| `not_found` | The address/card/session/order/invoice/subscription id doesn't belong to this buyer. |
|
|
599
599
|
|
|
600
|
+
## Money
|
|
601
|
+
|
|
602
|
+
Amounts are integers in the record's minor unit. Show them with
|
|
603
|
+
`formatMoney(amount, record.currency)`. The root and `/react` entries
|
|
604
|
+
re-export `@usethrottle/money` as `money`, `formatMoney` by name (two
|
|
605
|
+
arguments) and the `CurrencyCode` and `MoneyValue` types. The
|
|
606
|
+
`@usethrottle/auth/components` entry keeps its own three-argument
|
|
607
|
+
`formatMoney(minor, currency, locale?)`, which is deprecated: it ignores the
|
|
608
|
+
locale and prints what `@usethrottle/money` prints.
|
|
609
|
+
|
|
600
610
|
## Security notes
|
|
601
611
|
|
|
602
612
|
- The **access token lives in memory only** — this package never writes it to
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
AccountModal
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-37RG635A.js";
|
|
5
5
|
import "./chunk-UFGW76AZ.js";
|
|
6
6
|
import "./chunk-QPVS6JXP.js";
|
|
7
7
|
import "./chunk-CUNMJ2PH.js";
|
|
@@ -10,4 +10,4 @@ import "./chunk-TDQC3LMQ.js";
|
|
|
10
10
|
export {
|
|
11
11
|
AccountModal
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=AccountModal-
|
|
13
|
+
//# sourceMappingURL=AccountModal-4GF7X5X4.js.map
|
|
@@ -788,23 +788,10 @@ function PaymentMethodsPanel(props) {
|
|
|
788
788
|
import { useEffect as useEffect3, useState as useState7 } from "react";
|
|
789
789
|
|
|
790
790
|
// src/react/components/format.ts
|
|
791
|
+
import { formatMoney as formatMinor } from "@usethrottle/money";
|
|
791
792
|
function formatMoney(minorUnits, currency, locale) {
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
try {
|
|
795
|
-
digits = new Intl.NumberFormat("en-US", { style: "currency", currency: code }).resolvedOptions().maximumFractionDigits ?? 2;
|
|
796
|
-
} catch {
|
|
797
|
-
}
|
|
798
|
-
const major = minorUnits / 10 ** digits;
|
|
799
|
-
try {
|
|
800
|
-
return new Intl.NumberFormat(locale, { style: "currency", currency: code }).format(major);
|
|
801
|
-
} catch {
|
|
802
|
-
try {
|
|
803
|
-
return new Intl.NumberFormat("en-US", { style: "currency", currency: code }).format(major);
|
|
804
|
-
} catch {
|
|
805
|
-
return `${code} ${major.toFixed(digits)}`;
|
|
806
|
-
}
|
|
807
|
-
}
|
|
793
|
+
void locale;
|
|
794
|
+
return formatMinor(minorUnits, currency);
|
|
808
795
|
}
|
|
809
796
|
function formatDate(value, locale) {
|
|
810
797
|
const date = value instanceof Date ? value : new Date(value);
|
|
@@ -2072,4 +2059,4 @@ export {
|
|
|
2072
2059
|
AccountDashboard,
|
|
2073
2060
|
AccountModal
|
|
2074
2061
|
};
|
|
2075
|
-
//# sourceMappingURL=chunk-
|
|
2062
|
+
//# sourceMappingURL=chunk-37RG635A.js.map
|