@usethrottle/auth 0.12.1 → 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.
Files changed (38) hide show
  1. package/README.md +10 -0
  2. package/dist/{AccountModal-KA54WUFW.js → AccountModal-4GF7X5X4.js} +2 -2
  3. package/dist/{chunk-6WN3J5MM.js → chunk-37RG635A.js} +4 -17
  4. package/dist/{chunk-6WN3J5MM.js.map → chunk-37RG635A.js.map} +1 -1
  5. package/dist/chunk-PTREZIKS.js +31 -0
  6. package/dist/chunk-PTREZIKS.js.map +1 -0
  7. package/dist/{chunk-VDK23T6L.js → chunk-X4IZ7RC6.js} +2 -2
  8. package/dist/{chunk-RCNUWITB.js → chunk-YRJFGH6J.js} +2 -2
  9. package/dist/{client-7LVKfuXO.d.ts → client-BripyQad.d.ts} +5 -3
  10. package/dist/{hooks-DkpLrEiC.d.ts → hooks-q2sYQa7f.d.ts} +1 -1
  11. package/dist/index.cjs +38 -2
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.cts +8 -3
  14. package/dist/index.d.ts +8 -3
  15. package/dist/index.js +27 -1
  16. package/dist/index.js.map +1 -1
  17. package/dist/react/components/account/index.d.ts +3 -2
  18. package/dist/react/components/account/index.js +1 -1
  19. package/dist/react/components/auth/index.js +2 -2
  20. package/dist/react/components/index.cjs +55 -35
  21. package/dist/react/components/index.cjs.map +1 -1
  22. package/dist/react/components/index.d.cts +12 -4
  23. package/dist/react/components/index.d.ts +14 -6
  24. package/dist/react/components/index.js +25 -4
  25. package/dist/react/components/index.js.map +1 -1
  26. package/dist/react/components/provider.d.ts +2 -1
  27. package/dist/react/components/provider.js +1 -1
  28. package/dist/react/index.cjs +36 -0
  29. package/dist/react/index.cjs.map +1 -1
  30. package/dist/react/index.d.cts +7 -3
  31. package/dist/react/index.d.ts +7 -4
  32. package/dist/react/index.js +24 -1
  33. package/package.json +4 -1
  34. package/dist/chunk-ETYOOYYV.js +0 -2
  35. package/dist/chunk-ETYOOYYV.js.map +0 -1
  36. /package/dist/{AccountModal-KA54WUFW.js.map → AccountModal-4GF7X5X4.js.map} +0 -0
  37. /package/dist/{chunk-VDK23T6L.js.map → chunk-X4IZ7RC6.js.map} +0 -0
  38. /package/dist/{chunk-RCNUWITB.js.map → chunk-YRJFGH6J.js.map} +0 -0
@@ -2,6 +2,9 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ComponentType, ReactNode } from 'react';
3
3
  import { ThrottleAuthConfig, ThrottleAuth } from '../index.cjs';
4
4
  export { Address, AddressInput, AuthSnapshot, AuthStatus, AuthStorage, Customer, DeviceSession, Invoice, OpenCart, Order, Page, PaymentMethod, ProfilePatch, Resource, Session, Subscription, SubscriptionShippingAddress, ThrottleAccount, ThrottleAuthError, ThrottleAuthProvider, ThrottleAuthProviderProps, UseAuthResult, createAccount, createThrottleAuth, localStorageAdapter, memoryStorage, useAddresses, useAuth, useAuthContext, useCustomer, useInvoice, useInvoices, useOrder, useOrders, useSavedCards, useSubscriptions } from '../index.cjs';
5
+ import * as money from '@usethrottle/money';
6
+ export { money };
7
+ export { CURRENCIES, CurrencyCode, MoneyValue, UnknownCurrencyError, currencySymbol, isKnownCurrency, minorUnitsOf, moneyValue, parseMoney, toDecimalString, toMinor } from '@usethrottle/money';
5
8
 
6
9
  type ThrottleThemeName = 'light' | 'dark' | 'auto';
7
10
  declare const VARIABLE_PROPERTY: {
@@ -538,10 +541,15 @@ declare const THROTTLE_STYLE_ID = "throttle-auth-styles";
538
541
  declare const THROTTLE_STYLES = "\n.throttle-root {\n --throttle-color-primary: #18181b;\n --throttle-color-primary-foreground: #ffffff;\n --throttle-color-background: #ffffff;\n --throttle-color-surface: #f8fafc;\n --throttle-color-foreground: #0e1116;\n --throttle-color-muted: #eceef2;\n --throttle-color-muted-foreground: #5b6472;\n --throttle-color-border: #e2e8f0;\n /* The boundary of an INTERACTIVE control, which WCAG 1.4.11 requires to\n reach 3:1 against its adjacent colour \u2014 an input identified only by a\n 1.23:1 hairline is not identifiable at all. Decorative separators (card\n edges, table rules, dividers) keep --throttle-color-border: they do not\n identify a control, so the requirement does not apply and darkening\n them would only add noise. */\n /* The account dashboard paints nothing by default so it can drop into a\n merchant's page without fighting their background. The accountSurface and\n accountPadding appearance variables opt back into a card.\n No backticks in this comment: the sheet is a TS template literal. */\n --throttle-card-width: 400px;\n --throttle-color-account-surface: transparent;\n --throttle-account-padding: 0;\n --throttle-color-border-control: #8b93a1;\n --throttle-color-danger: #c2321f;\n --throttle-color-danger-surface: #fef2f2;\n --throttle-color-danger-border: #fecaca;\n --throttle-color-success: #127a4a;\n --throttle-color-success-surface: #ecfdf5;\n --throttle-color-success-border: #a7f3d0;\n --throttle-color-warning: #92400e;\n --throttle-color-warning-surface: #fffbeb;\n --throttle-color-warning-border: #fde68a;\n --throttle-font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif;\n --throttle-font-size: 16px;\n --throttle-font-size-xs: 12px;\n --throttle-font-size-sm: 14px;\n --throttle-font-size-lg: 20px;\n --throttle-font-size-xl: 24px;\n --throttle-line-height: 1.5;\n --throttle-line-height-tight: 1.25;\n --throttle-radius: 12px;\n --throttle-radius-sm: 8px;\n --throttle-radius-full: 999px;\n --throttle-border-width: 1px;\n --throttle-spacing: 8px;\n --throttle-space-1: 4px;\n --throttle-space-2: var(--throttle-spacing);\n --throttle-space-3: 12px;\n --throttle-space-4: 16px;\n --throttle-space-5: 24px;\n --throttle-space-6: 32px;\n --throttle-control-height: 48px;\n --throttle-control-padding-x: 16px;\n --throttle-shadow-card: 0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);\n --throttle-shadow-popover: 0 10px 24px rgba(15,23,42,.12), 0 2px 6px rgba(15,23,42,.06);\n --throttle-transition: 150ms cubic-bezier(.2,0,.2,1);\n --throttle-z-modal: 2147483000;\n --throttle-z-popover: 2147482000;\n font-family: var(--throttle-font-family);\n font-size: var(--throttle-font-size);\n line-height: var(--throttle-line-height);\n color: var(--throttle-color-foreground);\n box-sizing: border-box;\n}\n.throttle-root *, .throttle-root *::before, .throttle-root *::after { box-sizing: inherit; }\n\n.throttle-root[data-throttle-theme=\"dark\"] {\n --throttle-color-primary: #e6edf3;\n --throttle-color-primary-foreground: #0d1117;\n --throttle-color-background: #0d1117;\n --throttle-color-surface: #1c2129;\n --throttle-color-foreground: #e6edf3;\n --throttle-color-muted: #21262d;\n --throttle-color-muted-foreground: #9aa4b2;\n --throttle-color-border: #30363d;\n --throttle-color-border-control: #5c6570;\n --throttle-color-danger: #ff6b58;\n --throttle-color-danger-surface: #2a1513;\n --throttle-color-danger-border: #5c2b25;\n --throttle-color-success: #45c08a;\n --throttle-color-success-surface: #0f2419;\n --throttle-color-success-border: #1f4d36;\n --throttle-color-warning: #e0a53a;\n --throttle-color-warning-surface: #2a2113;\n --throttle-color-warning-border: #5c4a25;\n --throttle-shadow-card: 0 1px 3px rgba(0,0,0,.6), 0 1px 2px rgba(0,0,0,.4);\n --throttle-shadow-popover: 0 10px 24px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.35);\n}\n@media (prefers-color-scheme: dark) {\n .throttle-root[data-throttle-theme=\"auto\"] {\n --throttle-color-primary: #e6edf3;\n --throttle-color-primary-foreground: #0d1117;\n --throttle-color-background: #0d1117;\n --throttle-color-surface: #1c2129;\n --throttle-color-foreground: #e6edf3;\n --throttle-color-muted: #21262d;\n --throttle-color-muted-foreground: #9aa4b2;\n --throttle-color-border: #30363d;\n --throttle-color-border-control: #5c6570;\n --throttle-color-danger: #ff6b58;\n --throttle-color-danger-surface: #2a1513;\n --throttle-color-danger-border: #5c2b25;\n --throttle-color-success: #45c08a;\n --throttle-color-success-surface: #0f2419;\n --throttle-color-success-border: #1f4d36;\n --throttle-color-warning: #e0a53a;\n --throttle-color-warning-surface: #2a2113;\n --throttle-color-warning-border: #5c4a25;\n --throttle-shadow-card: 0 1px 3px rgba(0,0,0,.6), 0 1px 2px rgba(0,0,0,.4);\n --throttle-shadow-popover: 0 10px 24px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.35);\n }\n}\n\n.throttle-card {\n background: var(--throttle-color-background);\n border: var(--throttle-border-width) solid var(--throttle-color-border);\n border-radius: var(--throttle-radius);\n box-shadow: var(--throttle-shadow-card);\n padding: var(--throttle-space-5);\n width: 100%;\n max-width: var(--throttle-card-width);\n margin-inline: auto;\n}\n/* Inside a Modal the dialog already provides the surface \u2014 background, radius\n and elevation. A card that draws its own on top is the \"box inside a box\":\n two shadowed rounded rectangles nested, with the card's max-width stranding\n it in the middle of a much wider dialog. */\n.throttle-card--bare { border: none; box-shadow: none; background: none; max-width: none; }\n.throttle-card__header { margin-bottom: var(--throttle-space-4); }\n.throttle-card__header--branded { text-align: center; }\n.throttle-card__logo { display: flex; justify-content: center; margin-bottom: var(--throttle-space-3); }\n.throttle-card__title { font-size: var(--throttle-font-size-xl); line-height: var(--throttle-line-height-tight); font-weight: 600; letter-spacing: -0.02em; margin: 0; }\n.throttle-card__title--branded { font-size: var(--throttle-font-size-xl); }\n.throttle-card__description { color: var(--throttle-color-muted-foreground); margin: var(--throttle-space-1) 0 0; }\n.throttle-card__body { display: flex; flex-direction: column; gap: var(--throttle-space-3); }\n.throttle-card__footer { margin-top: var(--throttle-space-4); text-align: center; }\n.throttle-card__footer--ruled { border-top: var(--throttle-border-width) solid var(--throttle-color-border); padding-top: var(--throttle-space-4); }\n\n.throttle-field { display: flex; flex-direction: column; gap: var(--throttle-space-1); }\n.throttle-field__labelrow { display: flex; align-items: baseline; justify-content: space-between; gap: var(--throttle-space-2); }\n.throttle-field__label { font-weight: 500; }\n.throttle-field__input {\n font: inherit;\n font-size: var(--throttle-font-size);\n color: var(--throttle-color-foreground);\n background: var(--throttle-color-background);\n border: var(--throttle-border-width) solid var(--throttle-color-border-control);\n border-radius: var(--throttle-radius-sm);\n /* padding-block stays 0 so min-height alone owns the height, exactly as\n .throttle-button does. With 12px vertical padding the box computed to\n 50px against the button's 48px \u2014 a 2px mismatch, measured in a browser\n across 19 controls. An input element centres its own text vertically. */\n padding-block: 0;\n padding-inline: var(--throttle-control-padding-x);\n min-height: var(--throttle-control-height);\n width: 100%;\n transition: border-color var(--throttle-transition), box-shadow var(--throttle-transition);\n}\n.throttle-field__input:focus-visible {\n outline: none;\n border-color: var(--throttle-color-primary);\n box-shadow: 0 0 0 2px var(--throttle-color-background), 0 0 0 4px var(--throttle-color-primary);\n}\n.throttle-field__input:disabled { background: var(--throttle-color-muted); color: var(--throttle-color-muted-foreground); cursor: not-allowed; }\n.throttle-field__input::placeholder { color: var(--throttle-color-muted-foreground); opacity: 1; }\n.throttle-field__input--grouped { border: none; border-radius: 0; padding-inline: 0; }\n.throttle-field__hint { color: var(--throttle-color-muted-foreground); font-size: var(--throttle-font-size-xs); }\n/* Always mounted, so it reserves its line whether or not there is an error:\n an error appearing on submit must not push the submit button out from\n under the buyer's pointer. */\n.throttle-field__error { color: var(--throttle-color-danger); font-size: var(--throttle-font-size-xs); line-height: 1rem; }\n/* Reserved a full line under EVERY input even with nothing to say, which\n with the stack gap put 28px of dead space beneath each field, on every\n form and all seven account panels. The element stays mounted when empty\n because role=alert only announces changes to a live region that was\n already there; it just stops occupying a line. */\n.throttle-field__error:empty { display: none; }\n\n.throttle-field-group {\n display: flex;\n flex-direction: column;\n border: var(--throttle-border-width) solid var(--throttle-color-border);\n border-radius: var(--throttle-radius-sm);\n overflow: hidden;\n}\n.throttle-field-group__item { padding: var(--throttle-space-3) var(--throttle-control-padding-x); }\n.throttle-field-group__divider { height: var(--throttle-border-width); background: var(--throttle-color-border); }\n.throttle-field-group__forgot { margin-left: auto; }\n\n.throttle-button {\n font: inherit;\n font-weight: 500;\n border-radius: var(--throttle-radius-sm);\n border: var(--throttle-border-width) solid transparent;\n padding-inline: var(--throttle-control-padding-x);\n padding-block: 0;\n min-height: var(--throttle-control-height);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n /* A label that wraps turns a control into a two-line block of text. */\n white-space: nowrap;\n transition: opacity var(--throttle-transition), background-color var(--throttle-transition), border-color var(--throttle-transition), filter var(--throttle-transition), box-shadow var(--throttle-transition);\n}\n.throttle-button:disabled { opacity: .55; cursor: not-allowed; }\n.throttle-button:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--throttle-color-background), 0 0 0 4px var(--throttle-color-primary); }\n.throttle-button--primary { background: var(--throttle-color-primary); color: var(--throttle-color-primary-foreground); width: var(--throttle-button-width, 100%); }\n.throttle-button--primary:hover:not(:disabled) { filter: brightness(0.92); }\n.throttle-button--secondary { background: var(--throttle-color-surface); color: var(--throttle-color-foreground); border-color: var(--throttle-color-border-control); }\n.throttle-button--secondary:hover:not(:disabled) { background: var(--throttle-color-muted); }\n.throttle-button--danger { background: transparent; color: var(--throttle-color-danger); border-color: var(--throttle-color-border); }\n.throttle-button--danger:hover:not(:disabled) { background: color-mix(in srgb, var(--throttle-color-danger) 10%, transparent); }\n/* Link-style actions are the rows panel default, and they carry Delete,\n Remove, Cancel and Sign out. Zero padding with min-height 0 made those\n roughly 20px tall and ~8px apart \u2014 a mis-tap on a phone lands on something\n irreversible. The target is expanded with vertical padding and pulled back\n with an equal negative margin, so the hit box clears 44px while the text\n sits exactly where it did. Collapsing this back to zero padding shrinks the\n target again. */\n.throttle-button--link { background: none; border: none; color: var(--throttle-color-primary); padding-inline: 0; padding-block: var(--throttle-space-3); margin-block: calc(var(--throttle-space-3) * -1); min-height: 0; text-decoration: underline; width: auto; }\n.throttle-button--link:hover:not(:disabled) { opacity: .8; }\n.throttle-button--linkDanger { background: none; border: none; color: var(--throttle-color-danger); padding-inline: 0; padding-block: var(--throttle-space-3); margin-block: calc(var(--throttle-space-3) * -1); min-height: 0; text-decoration: underline; width: auto; }\n.throttle-button--linkDanger:hover:not(:disabled) { opacity: .8; }\n.throttle-button--xs { font-size: var(--throttle-font-size-xs); }\n\n.throttle-alert { border-radius: var(--throttle-radius-sm); padding: var(--throttle-space-3); font-size: var(--throttle-font-size-sm); }\n.throttle-alert--error { background: var(--throttle-color-danger-surface); border: var(--throttle-border-width) solid var(--throttle-color-danger-border); color: var(--throttle-color-danger); }\n.throttle-alert--success { background: var(--throttle-color-success-surface); border: var(--throttle-border-width) solid var(--throttle-color-success-border); color: var(--throttle-color-success); }\n.throttle-alert--info { background: var(--throttle-color-surface); color: var(--throttle-color-muted-foreground); }\n\n.throttle-spinner {\n display: inline-block; width: 1em; height: 1em;\n border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;\n animation: throttle-spin 700ms linear infinite;\n}\n@keyframes throttle-spin { to { transform: rotate(360deg); } }\n.throttle-button--loading { position: relative; }\n.throttle-button__label { display: inline-flex; align-items: center; justify-content: center; gap: var(--throttle-space-2); }\n.throttle-button__label--hidden { visibility: hidden; }\n.throttle-spinner--centred { position: absolute; top: 50%; left: 50%; margin: -0.5em 0 0 -0.5em; }\n\n@media (prefers-reduced-motion: reduce) { .throttle-spinner { animation-duration: 2.4s; } }\n\n.throttle-skeleton {\n background: var(--throttle-color-muted);\n border-radius: var(--throttle-radius-sm);\n animation: throttle-pulse 1.4s ease-in-out infinite; height: 2.5em; }\n@keyframes throttle-pulse { 50% { opacity: .5; } }\n@media (prefers-reduced-motion: reduce) { .throttle-skeleton { animation: none; } }\n\n.throttle-modal__overlay {\n position: fixed; inset: 0; z-index: var(--throttle-z-modal);\n background: rgba(14,17,22,.45);\n display: flex; align-items: center; justify-content: center;\n padding: var(--throttle-space-4);\n overflow-y: auto;\n}\n.throttle-modal__container {\n background: var(--throttle-color-background);\n border-radius: var(--throttle-radius);\n box-shadow: var(--throttle-shadow-popover);\n max-width: 720px; width: 100%; max-height: 90vh; overflow-y: auto;\n position: relative;\n}\n/* After the base rule on purpose: both are single-class, so equal specificity\n means source order decides. Declared before it, this silently lost. */\n.throttle-modal__container--compact { max-width: 440px; }\n.throttle-modal__close {\n position: absolute; top: var(--throttle-space-3); right: var(--throttle-space-3);\n background: none; border: none; cursor: pointer; font-size: var(--throttle-font-size-lg);\n color: var(--throttle-color-muted-foreground);\n transition: color var(--throttle-transition);\n}\n.throttle-modal__close:hover { color: var(--throttle-color-foreground); }\n.throttle-modal__header { padding: var(--throttle-space-4) var(--throttle-space-4) 0; }\n.throttle-modal__title { font-size: var(--throttle-font-size-lg); line-height: var(--throttle-line-height-tight); font-weight: 600; margin: 0; }\n.throttle-modal__body { padding: var(--throttle-space-4); }\n\n.throttle-dropdown__trigger { background: none; border: none; cursor: pointer; padding: 0; border-radius: var(--throttle-radius-full); transition: background-color var(--throttle-transition); }\n.throttle-dropdown__trigger:hover { background: var(--throttle-color-surface); }\n.throttle-dropdown__trigger:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: 2px; }\n.throttle-dropdown__menu {\n position: absolute; right: 0; top: calc(100% + var(--throttle-space-2));\n z-index: var(--throttle-z-popover);\n min-width: 260px;\n background: var(--throttle-color-background);\n border: var(--throttle-border-width) solid var(--throttle-color-border);\n border-radius: var(--throttle-radius);\n box-shadow: var(--throttle-shadow-popover);\n padding: var(--throttle-space-1);\n}\n.throttle-dropdown__item {\n display: flex; align-items: center; gap: var(--throttle-space-2);\n width: 100%; text-align: left; font: inherit; color: inherit;\n background: none; border: none; cursor: pointer;\n padding: var(--throttle-space-3);\n border-radius: var(--throttle-radius-sm);\n text-decoration: none;\n transition: background-color var(--throttle-transition);\n}\n.throttle-dropdown__item:hover { background: var(--throttle-color-surface); }\n.throttle-dropdown__item:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: -2px; }\n.throttle-dropdown__separator { height: 1px; background: var(--throttle-color-border); margin: var(--throttle-space-1) 0; border: 0; }\n\n.throttle-tabs__list {\n display: flex; gap: var(--throttle-space-1);\n border-bottom: var(--throttle-border-width) solid var(--throttle-color-border);\n overflow-x: auto; scrollbar-width: thin;\n}\n.throttle-tabs__tab {\n font: inherit; background: none; border: none; cursor: pointer; white-space: nowrap;\n padding: var(--throttle-space-3);\n color: var(--throttle-color-muted-foreground);\n border-bottom: 2px solid transparent;\n transition: color var(--throttle-transition), border-color var(--throttle-transition);\n}\n.throttle-tabs__tab:hover { color: var(--throttle-color-foreground); }\n.throttle-tabs__tab--active { color: var(--throttle-color-foreground); border-bottom-color: var(--throttle-color-primary); }\n.throttle-tabs__panel { padding-top: var(--throttle-space-4); }\n\n/* Paints its own ground. A UserButton in a navbar should stay transparent, but\n the dashboard is a large surface of themed text: in dark theme its foreground\n is near-white, so on a light host page it was rendering white-on-white. */\n.throttle-cardframe { width: 100%; min-height: 420px; border: 0; display: block; }\n.throttle-centre { display: flex; align-items: center; justify-content: center; min-height: 160px; }\n.throttle-fieldrow { display: grid; grid-template-columns: 1fr 1fr; gap: var(--throttle-space-4); align-items: start; }\n.throttle-section__title { font-size: var(--throttle-font-size-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--throttle-color-muted-foreground); margin: 0 0 var(--throttle-space-2); font-weight: 600; }\n.throttle-addresses { display: grid; grid-template-columns: 1fr 1fr; gap: var(--throttle-space-5); }\n.throttle-addressblock__line { margin: 0 0 2px; }\n.throttle-timeline { display: flex; flex-direction: column; gap: var(--throttle-space-2); }\n.throttle-timeline__row { display: flex; align-items: center; gap: var(--throttle-space-2); }\n.throttle-timeline__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--throttle-color-border-control); flex: none; }\n.throttle-timeline__label { flex: 1; }\n.throttle-account-root { container-type: inline-size; background: var(--throttle-color-account-surface); color: var(--throttle-color-foreground); padding: var(--throttle-account-padding); }\n.throttle-account { display: flex; gap: var(--throttle-space-5); align-items: flex-start; }\n.throttle-account__content { flex: 1; min-width: 0; }\n.throttle-tabs__rail { flex: none; width: 220px; display: flex; flex-direction: column; gap: 2px; }\n.throttle-tabs__railitem {\n font: inherit;\n font-size: var(--throttle-font-size-sm);\n display: flex;\n align-items: center;\n gap: var(--throttle-space-3);\n width: 100%;\n text-align: left;\n background: none;\n border: none;\n border-radius: var(--throttle-radius-sm);\n padding: 0 var(--throttle-space-3);\n min-height: var(--throttle-control-height);\n color: var(--throttle-color-muted-foreground);\n cursor: pointer;\n transition: background var(--throttle-transition), color var(--throttle-transition);\n}\n.throttle-tabs__railitem:hover { background: var(--throttle-color-surface); color: var(--throttle-color-foreground); }\n.throttle-tabs__railitem:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: -2px; }\n.throttle-tabs__tab:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: -2px; }\n.throttle-tabs__railitem--active { background: var(--throttle-color-surface); color: var(--throttle-color-foreground); font-weight: 500; }\n.throttle-tabs__railicon { flex: none; opacity: .75; }\n\n/* A CONTAINER query, not a viewport one: these components render inside a\n merchant's page, so the viewport says nothing about how much room the\n dashboard actually has \u2014 it could sit in a 400px column on a 1920px screen.\n Below ~560px of container the rail becomes a full-width list above the\n panel: all seven still visible, each still a 44px target. */\n@container (max-width: 560px) {\n /* align-items: flex-start is right in row direction and wrong in column \u2014\n it shrinks the rail to its content width, so width:100% alone cannot make\n it span. Stretch it explicitly when stacked. */\n .throttle-account { flex-direction: column; align-items: stretch; gap: var(--throttle-space-4); }\n .throttle-addresses { grid-template-columns: 1fr; }\n .throttle-fieldrow { grid-template-columns: 1fr; }\n .throttle-tabs__rail { width: 100%; }\n}\n\n.throttle-table { width: 100%; border-collapse: collapse; text-align: left; }\n.throttle-table__head { color: var(--throttle-color-muted-foreground); font-weight: 500; font-size: var(--throttle-font-size-sm); }\n.throttle-table__row { border-top: var(--throttle-border-width) solid var(--throttle-color-border); cursor: pointer; transition: background-color var(--throttle-transition); }\n.throttle-table__row:hover { background: var(--throttle-color-surface); }\n.throttle-table__row:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: -2px; }\n.throttle-table__cell { padding: var(--throttle-space-3) var(--throttle-space-2); height: 56px; box-sizing: border-box; }\n.throttle-table__scroll { overflow-x: auto; }\n\n.throttle-empty { text-align: center; padding: var(--throttle-space-6) var(--throttle-space-4); }\n.throttle-empty__title { font-weight: 600; margin: 0 0 var(--throttle-space-1); }\n.throttle-empty__description { color: var(--throttle-color-muted-foreground); margin: 0; }\n\n.throttle-avatar {\n display: inline-flex; align-items: center; justify-content: center;\n width: 32px; height: 32px; border-radius: var(--throttle-radius-full);\n background: var(--throttle-color-primary); color: var(--throttle-color-primary-foreground);\n font-size: var(--throttle-font-size-xs); font-weight: 600; text-transform: uppercase;\n}\n\n.throttle-badge {\n display: inline-block; font-size: var(--throttle-font-size-xs); font-weight: 500;\n padding: 2px var(--throttle-space-2); border-radius: var(--throttle-radius-full);\n background: var(--throttle-color-muted); color: var(--throttle-color-muted-foreground);\n}\n.throttle-badge--muted { background: none; border: var(--throttle-border-width) solid var(--throttle-color-border); color: var(--throttle-color-muted-foreground); font-weight: 400; padding: 1px calc(var(--throttle-space-2) - 1px); }\n.throttle-badge--success { background: color-mix(in srgb, var(--throttle-color-success) 15%, transparent); color: var(--throttle-color-success); }\n.throttle-badge--warning { background: color-mix(in srgb, var(--throttle-color-warning) 15%, transparent); color: var(--throttle-color-warning); }\n.throttle-badge--danger { background: color-mix(in srgb, var(--throttle-color-danger) 15%, transparent); color: var(--throttle-color-danger); }\n\n.throttle-stack { display: flex; flex-direction: column; gap: var(--throttle-space-3); }\n.throttle-row { display: flex; align-items: center; justify-content: space-between; gap: var(--throttle-space-2); flex-wrap: wrap; }\n.throttle-muted { color: var(--throttle-color-muted-foreground); }\n.throttle-banner {\n display: flex; align-items: center; justify-content: space-between; gap: var(--throttle-space-2);\n flex-wrap: wrap;\n background: color-mix(in srgb, var(--throttle-color-warning) 12%, transparent);\n color: var(--throttle-color-warning);\n border-radius: var(--throttle-radius-sm);\n padding: var(--throttle-space-3);\n margin-bottom: var(--throttle-space-4);\n}\n.throttle-panel { display: flex; flex-direction: column; gap: var(--throttle-space-4); }\n/* 100dvh, not 100vh: on mobile browsers 100vh includes the space behind the\n dynamic address/toolbar, so the page would be taller than the visible\n viewport and the card would sit off-centre until the toolbar collapsed. */\n.throttle-page {\n min-height: 100dvh;\n width: 100%;\n background: var(--throttle-color-surface);\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: var(--throttle-space-5);\n padding: var(--throttle-space-5);\n}\n.throttle-page__logo { display: flex; justify-content: center; }\n.throttle-page__footer { color: var(--throttle-color-muted-foreground); text-align: center; font-size: var(--throttle-font-size-sm); }\n.throttle-listitem {\n display: flex; align-items: flex-start; justify-content: space-between; gap: var(--throttle-space-2);\n flex-wrap: wrap;\n border: var(--throttle-border-width) solid var(--throttle-color-border);\n border-radius: var(--throttle-radius-sm);\n padding: var(--throttle-space-3);\n}\n/* 'rows' variant: hairline rules between items instead of each item carrying\n its own border+radius, so a panel does not read as a card inside a card. */\n.throttle-rows { display: flex; flex-direction: column; }\n.throttle-rowitem {\n display: flex; align-items: flex-start; justify-content: space-between; gap: var(--throttle-space-2);\n flex-wrap: wrap;\n border-top: var(--throttle-border-width) solid var(--throttle-color-border);\n padding: var(--throttle-space-3) 0;\n}\n.throttle-rowitem:first-child { border-top: none; padding-top: 0; }\n.throttle-actions {\n display: flex; gap: var(--throttle-space-2); flex-wrap: wrap; align-items: center;\n /* Primary buttons are full-width so a form's submit fills its card. In a row\n of sibling actions that same rule made every button claim 100% and then\n shrink to share the line, squeezing Resume to 59px so its label wrapped to\n two lines inside a 48px box. A custom property INHERITS to the buttons, so\n the row opts them back to content width without a descendant selector \u2014\n those outrank the merchant overrides in appearance.elements. */\n --throttle-button-width: auto;\n}\n.throttle-table__money { display: block; text-align: right; font-variant-numeric: tabular-nums; }\n.throttle-lineitem { display: flex; align-items: flex-start; gap: var(--throttle-space-3); padding: var(--throttle-space-2) 0; }\n/* The UA's 1em paragraph margins pushed a two-line item to 96px, so five\n items filled a screen with mostly whitespace. These carry the spacing\n instead. Separate classes, not a \".throttle-lineitem p\" descendant\n selector -- those outrank the merchant's appearance.elements overrides. */\n.throttle-lineitem__desc { margin: var(--throttle-space-1) 0 0; color: var(--throttle-color-muted-foreground); }\n.throttle-lineitem__meta { margin: var(--throttle-space-1) 0 0; color: var(--throttle-color-muted-foreground); font-size: var(--throttle-font-size-sm); }\n.throttle-lineitem__image { width: 48px; height: 48px; object-fit: cover; border-radius: var(--throttle-radius-sm); flex: none; }\n.throttle-totals { display: flex; flex-direction: column; gap: var(--throttle-space-1); }\n\n/* Order and invoice detail: the record on the left, what it costs and what\n you can do about it on the right. The rail sticks so the total and the\n actions stay reachable on an order with thirty lines, which is exactly when\n a buyer most wants them. Collapses below, where a sticky rail would eat a\n phone screen. */\n.throttle-detail { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: var(--throttle-space-6); align-items: start; }\n.throttle-detail__main { display: flex; flex-direction: column; gap: var(--throttle-space-5); min-width: 0; }\n.throttle-detail__rail {\n display: flex; flex-direction: column; gap: var(--throttle-space-4);\n position: sticky; top: var(--throttle-space-4);\n padding: var(--throttle-space-4);\n border: var(--throttle-border-width) solid var(--throttle-color-border);\n border-radius: var(--throttle-radius-md);\n background: var(--throttle-color-surface);\n}\n/* One column, and the rail stops sticking \u2014 on a phone a sticky summary covers\n the very line items it is summarising. Placed AFTER the base rules above: a\n container query adds no specificity, so the later rule wins. */\n@container (max-width: 560px) {\n .throttle-detail { grid-template-columns: 1fr; }\n .throttle-detail__rail { position: static; }\n}\n/* The one number the buyer came for. */\n.throttle-detail__headline { font-size: var(--throttle-font-size-xl); font-weight: 600; line-height: 1.2; }\n.throttle-detail__section { display: flex; flex-direction: column; gap: var(--throttle-space-2); }\n.throttle-detail__label { font-size: var(--throttle-font-size-sm); font-weight: 500; color: var(--throttle-color-muted-foreground); letter-spacing: .04em; text-transform: uppercase; }\n/* A rail action column: full width, stacked, so the primary reads as primary. */\n.throttle-detail__actions { display: flex; flex-direction: column; gap: var(--throttle-space-2); --throttle-button-width: 100%; }\n.throttle-detail__link { display: inline-flex; align-items: center; gap: var(--throttle-space-1); }\n\n@media (prefers-reduced-motion: reduce) {\n .throttle-button, .throttle-field__input, .throttle-dropdown__item, .throttle-dropdown__trigger, .throttle-tabs__tab, .throttle-table__row, .throttle-modal__close {\n transition: none;\n }\n}\n";
539
542
 
540
543
  /**
541
- * The only place minor units become major units. Every amount on the wire is
542
- * an integer in the currency's smallest unit, and the exponent varies: USD and
543
- * EUR are 2, JPY and KRW are 0, and a few are 3. `Intl` knows all of them, so
544
- * ask it rather than hardcoding 100.
544
+ * Minor units of `currency` as a display string, e.g. (5846, 'EUR') → "€58.46".
545
+ *
546
+ * The exponent is the currency's ISO 4217 one (JPY has none, KWD has three)
547
+ * and the digits are en-US on every surface, so `locale` does not change them;
548
+ * it is kept so existing calls compile. No currency is ever assumed: an empty
549
+ * code prints digits only.
550
+ *
551
+ * @deprecated Use `formatMoney` from `@usethrottle/auth` (the root entry) or
552
+ * from `@usethrottle/money`.
545
553
  */
546
554
  declare function formatMoney(minorUnits: number, currency: string, locale: string): string;
547
555
  declare function formatDate(value: string | Date, locale: string): string;
@@ -7,10 +7,13 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
7
7
  import { ReactNode } from 'react';
8
8
  import { d as AccountTab } from '../../AccountDashboard-V63ghvjY.js';
9
9
  export { A as ACCOUNT_TABS, a as AccountDashboard, b as AccountDashboardProps, c as AccountPanelVariant, e as AddressesPanel, f as OrdersPanel } from '../../AccountDashboard-V63ghvjY.js';
10
- export { P as Page, R as Resource, T as ThrottleAccount, a as ThrottleAuthError, c as createAccount, u as useAddresses, b as useCustomer, d as useInvoice, e as useInvoices, f as useOrder, g as useOrders, h as useSavedCards, i as useSubscriptions } from '../../hooks-DkpLrEiC.js';
10
+ export { P as Page, R as Resource, T as ThrottleAccount, a as ThrottleAuthError, c as createAccount, u as useAddresses, b as useCustomer, d as useInvoice, e as useInvoices, f as useOrder, g as useOrders, h as useSavedCards, i as useSubscriptions } from '../../hooks-q2sYQa7f.js';
11
11
  export { A as AccountModal, a as AccountModalProps, b as AddCardDialog, I as InvoiceDetail, c as InvoicesPanel, O as OrderDetail, P as PaymentMethodsPanel, d as ProfilePanel, S as SecurityPanel, e as SubscriptionsPanel, V as VerifyEmailBanner } from '../../AccountModal-pIMgledL.js';
12
- export { A as Address, a as AddressInput, b as AuthSnapshot, c as AuthStatus, d as AuthStorage, C as Customer, D as DeviceSession, I as Invoice, O as OpenCart, e as Order, P as PaymentMethod, g as ProfilePatch, S as Session, h as Subscription, i as SubscriptionShippingAddress, T as ThrottleAuth, j as ThrottleAuthConfig, k as createThrottleAuth } from '../../client-7LVKfuXO.js';
12
+ export { A as Address, a as AddressInput, b as AuthSnapshot, c as AuthStatus, d as AuthStorage, C as Customer, D as DeviceSession, I as Invoice, O as OpenCart, e as Order, P as PaymentMethod, g as ProfilePatch, S as Session, h as Subscription, i as SubscriptionShippingAddress, T as ThrottleAuth, j as ThrottleAuthConfig, k as createThrottleAuth } from '../../client-BripyQad.js';
13
13
  export { ThrottleAuthProvider, ThrottleAuthProviderProps, UseAuthResult, localStorageAdapter, memoryStorage, useAuth, useAuthContext } from '../index.js';
14
+ import * as money from '@usethrottle/money';
15
+ export { money };
16
+ export { CURRENCIES, CurrencyCode, MoneyValue, UnknownCurrencyError, currencySymbol, isKnownCurrency, minorUnitsOf, moneyValue, parseMoney, toDecimalString, toMinor } from '@usethrottle/money';
14
17
 
15
18
  declare const THROTTLE_STYLE_ID = "throttle-auth-styles";
16
19
  /**
@@ -27,10 +30,15 @@ declare const THROTTLE_STYLE_ID = "throttle-auth-styles";
27
30
  declare const THROTTLE_STYLES = "\n.throttle-root {\n --throttle-color-primary: #18181b;\n --throttle-color-primary-foreground: #ffffff;\n --throttle-color-background: #ffffff;\n --throttle-color-surface: #f8fafc;\n --throttle-color-foreground: #0e1116;\n --throttle-color-muted: #eceef2;\n --throttle-color-muted-foreground: #5b6472;\n --throttle-color-border: #e2e8f0;\n /* The boundary of an INTERACTIVE control, which WCAG 1.4.11 requires to\n reach 3:1 against its adjacent colour \u2014 an input identified only by a\n 1.23:1 hairline is not identifiable at all. Decorative separators (card\n edges, table rules, dividers) keep --throttle-color-border: they do not\n identify a control, so the requirement does not apply and darkening\n them would only add noise. */\n /* The account dashboard paints nothing by default so it can drop into a\n merchant's page without fighting their background. The accountSurface and\n accountPadding appearance variables opt back into a card.\n No backticks in this comment: the sheet is a TS template literal. */\n --throttle-card-width: 400px;\n --throttle-color-account-surface: transparent;\n --throttle-account-padding: 0;\n --throttle-color-border-control: #8b93a1;\n --throttle-color-danger: #c2321f;\n --throttle-color-danger-surface: #fef2f2;\n --throttle-color-danger-border: #fecaca;\n --throttle-color-success: #127a4a;\n --throttle-color-success-surface: #ecfdf5;\n --throttle-color-success-border: #a7f3d0;\n --throttle-color-warning: #92400e;\n --throttle-color-warning-surface: #fffbeb;\n --throttle-color-warning-border: #fde68a;\n --throttle-font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif;\n --throttle-font-size: 16px;\n --throttle-font-size-xs: 12px;\n --throttle-font-size-sm: 14px;\n --throttle-font-size-lg: 20px;\n --throttle-font-size-xl: 24px;\n --throttle-line-height: 1.5;\n --throttle-line-height-tight: 1.25;\n --throttle-radius: 12px;\n --throttle-radius-sm: 8px;\n --throttle-radius-full: 999px;\n --throttle-border-width: 1px;\n --throttle-spacing: 8px;\n --throttle-space-1: 4px;\n --throttle-space-2: var(--throttle-spacing);\n --throttle-space-3: 12px;\n --throttle-space-4: 16px;\n --throttle-space-5: 24px;\n --throttle-space-6: 32px;\n --throttle-control-height: 48px;\n --throttle-control-padding-x: 16px;\n --throttle-shadow-card: 0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);\n --throttle-shadow-popover: 0 10px 24px rgba(15,23,42,.12), 0 2px 6px rgba(15,23,42,.06);\n --throttle-transition: 150ms cubic-bezier(.2,0,.2,1);\n --throttle-z-modal: 2147483000;\n --throttle-z-popover: 2147482000;\n font-family: var(--throttle-font-family);\n font-size: var(--throttle-font-size);\n line-height: var(--throttle-line-height);\n color: var(--throttle-color-foreground);\n box-sizing: border-box;\n}\n.throttle-root *, .throttle-root *::before, .throttle-root *::after { box-sizing: inherit; }\n\n.throttle-root[data-throttle-theme=\"dark\"] {\n --throttle-color-primary: #e6edf3;\n --throttle-color-primary-foreground: #0d1117;\n --throttle-color-background: #0d1117;\n --throttle-color-surface: #1c2129;\n --throttle-color-foreground: #e6edf3;\n --throttle-color-muted: #21262d;\n --throttle-color-muted-foreground: #9aa4b2;\n --throttle-color-border: #30363d;\n --throttle-color-border-control: #5c6570;\n --throttle-color-danger: #ff6b58;\n --throttle-color-danger-surface: #2a1513;\n --throttle-color-danger-border: #5c2b25;\n --throttle-color-success: #45c08a;\n --throttle-color-success-surface: #0f2419;\n --throttle-color-success-border: #1f4d36;\n --throttle-color-warning: #e0a53a;\n --throttle-color-warning-surface: #2a2113;\n --throttle-color-warning-border: #5c4a25;\n --throttle-shadow-card: 0 1px 3px rgba(0,0,0,.6), 0 1px 2px rgba(0,0,0,.4);\n --throttle-shadow-popover: 0 10px 24px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.35);\n}\n@media (prefers-color-scheme: dark) {\n .throttle-root[data-throttle-theme=\"auto\"] {\n --throttle-color-primary: #e6edf3;\n --throttle-color-primary-foreground: #0d1117;\n --throttle-color-background: #0d1117;\n --throttle-color-surface: #1c2129;\n --throttle-color-foreground: #e6edf3;\n --throttle-color-muted: #21262d;\n --throttle-color-muted-foreground: #9aa4b2;\n --throttle-color-border: #30363d;\n --throttle-color-border-control: #5c6570;\n --throttle-color-danger: #ff6b58;\n --throttle-color-danger-surface: #2a1513;\n --throttle-color-danger-border: #5c2b25;\n --throttle-color-success: #45c08a;\n --throttle-color-success-surface: #0f2419;\n --throttle-color-success-border: #1f4d36;\n --throttle-color-warning: #e0a53a;\n --throttle-color-warning-surface: #2a2113;\n --throttle-color-warning-border: #5c4a25;\n --throttle-shadow-card: 0 1px 3px rgba(0,0,0,.6), 0 1px 2px rgba(0,0,0,.4);\n --throttle-shadow-popover: 0 10px 24px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.35);\n }\n}\n\n.throttle-card {\n background: var(--throttle-color-background);\n border: var(--throttle-border-width) solid var(--throttle-color-border);\n border-radius: var(--throttle-radius);\n box-shadow: var(--throttle-shadow-card);\n padding: var(--throttle-space-5);\n width: 100%;\n max-width: var(--throttle-card-width);\n margin-inline: auto;\n}\n/* Inside a Modal the dialog already provides the surface \u2014 background, radius\n and elevation. A card that draws its own on top is the \"box inside a box\":\n two shadowed rounded rectangles nested, with the card's max-width stranding\n it in the middle of a much wider dialog. */\n.throttle-card--bare { border: none; box-shadow: none; background: none; max-width: none; }\n.throttle-card__header { margin-bottom: var(--throttle-space-4); }\n.throttle-card__header--branded { text-align: center; }\n.throttle-card__logo { display: flex; justify-content: center; margin-bottom: var(--throttle-space-3); }\n.throttle-card__title { font-size: var(--throttle-font-size-xl); line-height: var(--throttle-line-height-tight); font-weight: 600; letter-spacing: -0.02em; margin: 0; }\n.throttle-card__title--branded { font-size: var(--throttle-font-size-xl); }\n.throttle-card__description { color: var(--throttle-color-muted-foreground); margin: var(--throttle-space-1) 0 0; }\n.throttle-card__body { display: flex; flex-direction: column; gap: var(--throttle-space-3); }\n.throttle-card__footer { margin-top: var(--throttle-space-4); text-align: center; }\n.throttle-card__footer--ruled { border-top: var(--throttle-border-width) solid var(--throttle-color-border); padding-top: var(--throttle-space-4); }\n\n.throttle-field { display: flex; flex-direction: column; gap: var(--throttle-space-1); }\n.throttle-field__labelrow { display: flex; align-items: baseline; justify-content: space-between; gap: var(--throttle-space-2); }\n.throttle-field__label { font-weight: 500; }\n.throttle-field__input {\n font: inherit;\n font-size: var(--throttle-font-size);\n color: var(--throttle-color-foreground);\n background: var(--throttle-color-background);\n border: var(--throttle-border-width) solid var(--throttle-color-border-control);\n border-radius: var(--throttle-radius-sm);\n /* padding-block stays 0 so min-height alone owns the height, exactly as\n .throttle-button does. With 12px vertical padding the box computed to\n 50px against the button's 48px \u2014 a 2px mismatch, measured in a browser\n across 19 controls. An input element centres its own text vertically. */\n padding-block: 0;\n padding-inline: var(--throttle-control-padding-x);\n min-height: var(--throttle-control-height);\n width: 100%;\n transition: border-color var(--throttle-transition), box-shadow var(--throttle-transition);\n}\n.throttle-field__input:focus-visible {\n outline: none;\n border-color: var(--throttle-color-primary);\n box-shadow: 0 0 0 2px var(--throttle-color-background), 0 0 0 4px var(--throttle-color-primary);\n}\n.throttle-field__input:disabled { background: var(--throttle-color-muted); color: var(--throttle-color-muted-foreground); cursor: not-allowed; }\n.throttle-field__input::placeholder { color: var(--throttle-color-muted-foreground); opacity: 1; }\n.throttle-field__input--grouped { border: none; border-radius: 0; padding-inline: 0; }\n.throttle-field__hint { color: var(--throttle-color-muted-foreground); font-size: var(--throttle-font-size-xs); }\n/* Always mounted, so it reserves its line whether or not there is an error:\n an error appearing on submit must not push the submit button out from\n under the buyer's pointer. */\n.throttle-field__error { color: var(--throttle-color-danger); font-size: var(--throttle-font-size-xs); line-height: 1rem; }\n/* Reserved a full line under EVERY input even with nothing to say, which\n with the stack gap put 28px of dead space beneath each field, on every\n form and all seven account panels. The element stays mounted when empty\n because role=alert only announces changes to a live region that was\n already there; it just stops occupying a line. */\n.throttle-field__error:empty { display: none; }\n\n.throttle-field-group {\n display: flex;\n flex-direction: column;\n border: var(--throttle-border-width) solid var(--throttle-color-border);\n border-radius: var(--throttle-radius-sm);\n overflow: hidden;\n}\n.throttle-field-group__item { padding: var(--throttle-space-3) var(--throttle-control-padding-x); }\n.throttle-field-group__divider { height: var(--throttle-border-width); background: var(--throttle-color-border); }\n.throttle-field-group__forgot { margin-left: auto; }\n\n.throttle-button {\n font: inherit;\n font-weight: 500;\n border-radius: var(--throttle-radius-sm);\n border: var(--throttle-border-width) solid transparent;\n padding-inline: var(--throttle-control-padding-x);\n padding-block: 0;\n min-height: var(--throttle-control-height);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n /* A label that wraps turns a control into a two-line block of text. */\n white-space: nowrap;\n transition: opacity var(--throttle-transition), background-color var(--throttle-transition), border-color var(--throttle-transition), filter var(--throttle-transition), box-shadow var(--throttle-transition);\n}\n.throttle-button:disabled { opacity: .55; cursor: not-allowed; }\n.throttle-button:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--throttle-color-background), 0 0 0 4px var(--throttle-color-primary); }\n.throttle-button--primary { background: var(--throttle-color-primary); color: var(--throttle-color-primary-foreground); width: var(--throttle-button-width, 100%); }\n.throttle-button--primary:hover:not(:disabled) { filter: brightness(0.92); }\n.throttle-button--secondary { background: var(--throttle-color-surface); color: var(--throttle-color-foreground); border-color: var(--throttle-color-border-control); }\n.throttle-button--secondary:hover:not(:disabled) { background: var(--throttle-color-muted); }\n.throttle-button--danger { background: transparent; color: var(--throttle-color-danger); border-color: var(--throttle-color-border); }\n.throttle-button--danger:hover:not(:disabled) { background: color-mix(in srgb, var(--throttle-color-danger) 10%, transparent); }\n/* Link-style actions are the rows panel default, and they carry Delete,\n Remove, Cancel and Sign out. Zero padding with min-height 0 made those\n roughly 20px tall and ~8px apart \u2014 a mis-tap on a phone lands on something\n irreversible. The target is expanded with vertical padding and pulled back\n with an equal negative margin, so the hit box clears 44px while the text\n sits exactly where it did. Collapsing this back to zero padding shrinks the\n target again. */\n.throttle-button--link { background: none; border: none; color: var(--throttle-color-primary); padding-inline: 0; padding-block: var(--throttle-space-3); margin-block: calc(var(--throttle-space-3) * -1); min-height: 0; text-decoration: underline; width: auto; }\n.throttle-button--link:hover:not(:disabled) { opacity: .8; }\n.throttle-button--linkDanger { background: none; border: none; color: var(--throttle-color-danger); padding-inline: 0; padding-block: var(--throttle-space-3); margin-block: calc(var(--throttle-space-3) * -1); min-height: 0; text-decoration: underline; width: auto; }\n.throttle-button--linkDanger:hover:not(:disabled) { opacity: .8; }\n.throttle-button--xs { font-size: var(--throttle-font-size-xs); }\n\n.throttle-alert { border-radius: var(--throttle-radius-sm); padding: var(--throttle-space-3); font-size: var(--throttle-font-size-sm); }\n.throttle-alert--error { background: var(--throttle-color-danger-surface); border: var(--throttle-border-width) solid var(--throttle-color-danger-border); color: var(--throttle-color-danger); }\n.throttle-alert--success { background: var(--throttle-color-success-surface); border: var(--throttle-border-width) solid var(--throttle-color-success-border); color: var(--throttle-color-success); }\n.throttle-alert--info { background: var(--throttle-color-surface); color: var(--throttle-color-muted-foreground); }\n\n.throttle-spinner {\n display: inline-block; width: 1em; height: 1em;\n border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;\n animation: throttle-spin 700ms linear infinite;\n}\n@keyframes throttle-spin { to { transform: rotate(360deg); } }\n.throttle-button--loading { position: relative; }\n.throttle-button__label { display: inline-flex; align-items: center; justify-content: center; gap: var(--throttle-space-2); }\n.throttle-button__label--hidden { visibility: hidden; }\n.throttle-spinner--centred { position: absolute; top: 50%; left: 50%; margin: -0.5em 0 0 -0.5em; }\n\n@media (prefers-reduced-motion: reduce) { .throttle-spinner { animation-duration: 2.4s; } }\n\n.throttle-skeleton {\n background: var(--throttle-color-muted);\n border-radius: var(--throttle-radius-sm);\n animation: throttle-pulse 1.4s ease-in-out infinite; height: 2.5em; }\n@keyframes throttle-pulse { 50% { opacity: .5; } }\n@media (prefers-reduced-motion: reduce) { .throttle-skeleton { animation: none; } }\n\n.throttle-modal__overlay {\n position: fixed; inset: 0; z-index: var(--throttle-z-modal);\n background: rgba(14,17,22,.45);\n display: flex; align-items: center; justify-content: center;\n padding: var(--throttle-space-4);\n overflow-y: auto;\n}\n.throttle-modal__container {\n background: var(--throttle-color-background);\n border-radius: var(--throttle-radius);\n box-shadow: var(--throttle-shadow-popover);\n max-width: 720px; width: 100%; max-height: 90vh; overflow-y: auto;\n position: relative;\n}\n/* After the base rule on purpose: both are single-class, so equal specificity\n means source order decides. Declared before it, this silently lost. */\n.throttle-modal__container--compact { max-width: 440px; }\n.throttle-modal__close {\n position: absolute; top: var(--throttle-space-3); right: var(--throttle-space-3);\n background: none; border: none; cursor: pointer; font-size: var(--throttle-font-size-lg);\n color: var(--throttle-color-muted-foreground);\n transition: color var(--throttle-transition);\n}\n.throttle-modal__close:hover { color: var(--throttle-color-foreground); }\n.throttle-modal__header { padding: var(--throttle-space-4) var(--throttle-space-4) 0; }\n.throttle-modal__title { font-size: var(--throttle-font-size-lg); line-height: var(--throttle-line-height-tight); font-weight: 600; margin: 0; }\n.throttle-modal__body { padding: var(--throttle-space-4); }\n\n.throttle-dropdown__trigger { background: none; border: none; cursor: pointer; padding: 0; border-radius: var(--throttle-radius-full); transition: background-color var(--throttle-transition); }\n.throttle-dropdown__trigger:hover { background: var(--throttle-color-surface); }\n.throttle-dropdown__trigger:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: 2px; }\n.throttle-dropdown__menu {\n position: absolute; right: 0; top: calc(100% + var(--throttle-space-2));\n z-index: var(--throttle-z-popover);\n min-width: 260px;\n background: var(--throttle-color-background);\n border: var(--throttle-border-width) solid var(--throttle-color-border);\n border-radius: var(--throttle-radius);\n box-shadow: var(--throttle-shadow-popover);\n padding: var(--throttle-space-1);\n}\n.throttle-dropdown__item {\n display: flex; align-items: center; gap: var(--throttle-space-2);\n width: 100%; text-align: left; font: inherit; color: inherit;\n background: none; border: none; cursor: pointer;\n padding: var(--throttle-space-3);\n border-radius: var(--throttle-radius-sm);\n text-decoration: none;\n transition: background-color var(--throttle-transition);\n}\n.throttle-dropdown__item:hover { background: var(--throttle-color-surface); }\n.throttle-dropdown__item:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: -2px; }\n.throttle-dropdown__separator { height: 1px; background: var(--throttle-color-border); margin: var(--throttle-space-1) 0; border: 0; }\n\n.throttle-tabs__list {\n display: flex; gap: var(--throttle-space-1);\n border-bottom: var(--throttle-border-width) solid var(--throttle-color-border);\n overflow-x: auto; scrollbar-width: thin;\n}\n.throttle-tabs__tab {\n font: inherit; background: none; border: none; cursor: pointer; white-space: nowrap;\n padding: var(--throttle-space-3);\n color: var(--throttle-color-muted-foreground);\n border-bottom: 2px solid transparent;\n transition: color var(--throttle-transition), border-color var(--throttle-transition);\n}\n.throttle-tabs__tab:hover { color: var(--throttle-color-foreground); }\n.throttle-tabs__tab--active { color: var(--throttle-color-foreground); border-bottom-color: var(--throttle-color-primary); }\n.throttle-tabs__panel { padding-top: var(--throttle-space-4); }\n\n/* Paints its own ground. A UserButton in a navbar should stay transparent, but\n the dashboard is a large surface of themed text: in dark theme its foreground\n is near-white, so on a light host page it was rendering white-on-white. */\n.throttle-cardframe { width: 100%; min-height: 420px; border: 0; display: block; }\n.throttle-centre { display: flex; align-items: center; justify-content: center; min-height: 160px; }\n.throttle-fieldrow { display: grid; grid-template-columns: 1fr 1fr; gap: var(--throttle-space-4); align-items: start; }\n.throttle-section__title { font-size: var(--throttle-font-size-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--throttle-color-muted-foreground); margin: 0 0 var(--throttle-space-2); font-weight: 600; }\n.throttle-addresses { display: grid; grid-template-columns: 1fr 1fr; gap: var(--throttle-space-5); }\n.throttle-addressblock__line { margin: 0 0 2px; }\n.throttle-timeline { display: flex; flex-direction: column; gap: var(--throttle-space-2); }\n.throttle-timeline__row { display: flex; align-items: center; gap: var(--throttle-space-2); }\n.throttle-timeline__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--throttle-color-border-control); flex: none; }\n.throttle-timeline__label { flex: 1; }\n.throttle-account-root { container-type: inline-size; background: var(--throttle-color-account-surface); color: var(--throttle-color-foreground); padding: var(--throttle-account-padding); }\n.throttle-account { display: flex; gap: var(--throttle-space-5); align-items: flex-start; }\n.throttle-account__content { flex: 1; min-width: 0; }\n.throttle-tabs__rail { flex: none; width: 220px; display: flex; flex-direction: column; gap: 2px; }\n.throttle-tabs__railitem {\n font: inherit;\n font-size: var(--throttle-font-size-sm);\n display: flex;\n align-items: center;\n gap: var(--throttle-space-3);\n width: 100%;\n text-align: left;\n background: none;\n border: none;\n border-radius: var(--throttle-radius-sm);\n padding: 0 var(--throttle-space-3);\n min-height: var(--throttle-control-height);\n color: var(--throttle-color-muted-foreground);\n cursor: pointer;\n transition: background var(--throttle-transition), color var(--throttle-transition);\n}\n.throttle-tabs__railitem:hover { background: var(--throttle-color-surface); color: var(--throttle-color-foreground); }\n.throttle-tabs__railitem:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: -2px; }\n.throttle-tabs__tab:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: -2px; }\n.throttle-tabs__railitem--active { background: var(--throttle-color-surface); color: var(--throttle-color-foreground); font-weight: 500; }\n.throttle-tabs__railicon { flex: none; opacity: .75; }\n\n/* A CONTAINER query, not a viewport one: these components render inside a\n merchant's page, so the viewport says nothing about how much room the\n dashboard actually has \u2014 it could sit in a 400px column on a 1920px screen.\n Below ~560px of container the rail becomes a full-width list above the\n panel: all seven still visible, each still a 44px target. */\n@container (max-width: 560px) {\n /* align-items: flex-start is right in row direction and wrong in column \u2014\n it shrinks the rail to its content width, so width:100% alone cannot make\n it span. Stretch it explicitly when stacked. */\n .throttle-account { flex-direction: column; align-items: stretch; gap: var(--throttle-space-4); }\n .throttle-addresses { grid-template-columns: 1fr; }\n .throttle-fieldrow { grid-template-columns: 1fr; }\n .throttle-tabs__rail { width: 100%; }\n}\n\n.throttle-table { width: 100%; border-collapse: collapse; text-align: left; }\n.throttle-table__head { color: var(--throttle-color-muted-foreground); font-weight: 500; font-size: var(--throttle-font-size-sm); }\n.throttle-table__row { border-top: var(--throttle-border-width) solid var(--throttle-color-border); cursor: pointer; transition: background-color var(--throttle-transition); }\n.throttle-table__row:hover { background: var(--throttle-color-surface); }\n.throttle-table__row:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: -2px; }\n.throttle-table__cell { padding: var(--throttle-space-3) var(--throttle-space-2); height: 56px; box-sizing: border-box; }\n.throttle-table__scroll { overflow-x: auto; }\n\n.throttle-empty { text-align: center; padding: var(--throttle-space-6) var(--throttle-space-4); }\n.throttle-empty__title { font-weight: 600; margin: 0 0 var(--throttle-space-1); }\n.throttle-empty__description { color: var(--throttle-color-muted-foreground); margin: 0; }\n\n.throttle-avatar {\n display: inline-flex; align-items: center; justify-content: center;\n width: 32px; height: 32px; border-radius: var(--throttle-radius-full);\n background: var(--throttle-color-primary); color: var(--throttle-color-primary-foreground);\n font-size: var(--throttle-font-size-xs); font-weight: 600; text-transform: uppercase;\n}\n\n.throttle-badge {\n display: inline-block; font-size: var(--throttle-font-size-xs); font-weight: 500;\n padding: 2px var(--throttle-space-2); border-radius: var(--throttle-radius-full);\n background: var(--throttle-color-muted); color: var(--throttle-color-muted-foreground);\n}\n.throttle-badge--muted { background: none; border: var(--throttle-border-width) solid var(--throttle-color-border); color: var(--throttle-color-muted-foreground); font-weight: 400; padding: 1px calc(var(--throttle-space-2) - 1px); }\n.throttle-badge--success { background: color-mix(in srgb, var(--throttle-color-success) 15%, transparent); color: var(--throttle-color-success); }\n.throttle-badge--warning { background: color-mix(in srgb, var(--throttle-color-warning) 15%, transparent); color: var(--throttle-color-warning); }\n.throttle-badge--danger { background: color-mix(in srgb, var(--throttle-color-danger) 15%, transparent); color: var(--throttle-color-danger); }\n\n.throttle-stack { display: flex; flex-direction: column; gap: var(--throttle-space-3); }\n.throttle-row { display: flex; align-items: center; justify-content: space-between; gap: var(--throttle-space-2); flex-wrap: wrap; }\n.throttle-muted { color: var(--throttle-color-muted-foreground); }\n.throttle-banner {\n display: flex; align-items: center; justify-content: space-between; gap: var(--throttle-space-2);\n flex-wrap: wrap;\n background: color-mix(in srgb, var(--throttle-color-warning) 12%, transparent);\n color: var(--throttle-color-warning);\n border-radius: var(--throttle-radius-sm);\n padding: var(--throttle-space-3);\n margin-bottom: var(--throttle-space-4);\n}\n.throttle-panel { display: flex; flex-direction: column; gap: var(--throttle-space-4); }\n/* 100dvh, not 100vh: on mobile browsers 100vh includes the space behind the\n dynamic address/toolbar, so the page would be taller than the visible\n viewport and the card would sit off-centre until the toolbar collapsed. */\n.throttle-page {\n min-height: 100dvh;\n width: 100%;\n background: var(--throttle-color-surface);\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: var(--throttle-space-5);\n padding: var(--throttle-space-5);\n}\n.throttle-page__logo { display: flex; justify-content: center; }\n.throttle-page__footer { color: var(--throttle-color-muted-foreground); text-align: center; font-size: var(--throttle-font-size-sm); }\n.throttle-listitem {\n display: flex; align-items: flex-start; justify-content: space-between; gap: var(--throttle-space-2);\n flex-wrap: wrap;\n border: var(--throttle-border-width) solid var(--throttle-color-border);\n border-radius: var(--throttle-radius-sm);\n padding: var(--throttle-space-3);\n}\n/* 'rows' variant: hairline rules between items instead of each item carrying\n its own border+radius, so a panel does not read as a card inside a card. */\n.throttle-rows { display: flex; flex-direction: column; }\n.throttle-rowitem {\n display: flex; align-items: flex-start; justify-content: space-between; gap: var(--throttle-space-2);\n flex-wrap: wrap;\n border-top: var(--throttle-border-width) solid var(--throttle-color-border);\n padding: var(--throttle-space-3) 0;\n}\n.throttle-rowitem:first-child { border-top: none; padding-top: 0; }\n.throttle-actions {\n display: flex; gap: var(--throttle-space-2); flex-wrap: wrap; align-items: center;\n /* Primary buttons are full-width so a form's submit fills its card. In a row\n of sibling actions that same rule made every button claim 100% and then\n shrink to share the line, squeezing Resume to 59px so its label wrapped to\n two lines inside a 48px box. A custom property INHERITS to the buttons, so\n the row opts them back to content width without a descendant selector \u2014\n those outrank the merchant overrides in appearance.elements. */\n --throttle-button-width: auto;\n}\n.throttle-table__money { display: block; text-align: right; font-variant-numeric: tabular-nums; }\n.throttle-lineitem { display: flex; align-items: flex-start; gap: var(--throttle-space-3); padding: var(--throttle-space-2) 0; }\n/* The UA's 1em paragraph margins pushed a two-line item to 96px, so five\n items filled a screen with mostly whitespace. These carry the spacing\n instead. Separate classes, not a \".throttle-lineitem p\" descendant\n selector -- those outrank the merchant's appearance.elements overrides. */\n.throttle-lineitem__desc { margin: var(--throttle-space-1) 0 0; color: var(--throttle-color-muted-foreground); }\n.throttle-lineitem__meta { margin: var(--throttle-space-1) 0 0; color: var(--throttle-color-muted-foreground); font-size: var(--throttle-font-size-sm); }\n.throttle-lineitem__image { width: 48px; height: 48px; object-fit: cover; border-radius: var(--throttle-radius-sm); flex: none; }\n.throttle-totals { display: flex; flex-direction: column; gap: var(--throttle-space-1); }\n\n/* Order and invoice detail: the record on the left, what it costs and what\n you can do about it on the right. The rail sticks so the total and the\n actions stay reachable on an order with thirty lines, which is exactly when\n a buyer most wants them. Collapses below, where a sticky rail would eat a\n phone screen. */\n.throttle-detail { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: var(--throttle-space-6); align-items: start; }\n.throttle-detail__main { display: flex; flex-direction: column; gap: var(--throttle-space-5); min-width: 0; }\n.throttle-detail__rail {\n display: flex; flex-direction: column; gap: var(--throttle-space-4);\n position: sticky; top: var(--throttle-space-4);\n padding: var(--throttle-space-4);\n border: var(--throttle-border-width) solid var(--throttle-color-border);\n border-radius: var(--throttle-radius-md);\n background: var(--throttle-color-surface);\n}\n/* One column, and the rail stops sticking \u2014 on a phone a sticky summary covers\n the very line items it is summarising. Placed AFTER the base rules above: a\n container query adds no specificity, so the later rule wins. */\n@container (max-width: 560px) {\n .throttle-detail { grid-template-columns: 1fr; }\n .throttle-detail__rail { position: static; }\n}\n/* The one number the buyer came for. */\n.throttle-detail__headline { font-size: var(--throttle-font-size-xl); font-weight: 600; line-height: 1.2; }\n.throttle-detail__section { display: flex; flex-direction: column; gap: var(--throttle-space-2); }\n.throttle-detail__label { font-size: var(--throttle-font-size-sm); font-weight: 500; color: var(--throttle-color-muted-foreground); letter-spacing: .04em; text-transform: uppercase; }\n/* A rail action column: full width, stacked, so the primary reads as primary. */\n.throttle-detail__actions { display: flex; flex-direction: column; gap: var(--throttle-space-2); --throttle-button-width: 100%; }\n.throttle-detail__link { display: inline-flex; align-items: center; gap: var(--throttle-space-1); }\n\n@media (prefers-reduced-motion: reduce) {\n .throttle-button, .throttle-field__input, .throttle-dropdown__item, .throttle-dropdown__trigger, .throttle-tabs__tab, .throttle-table__row, .throttle-modal__close {\n transition: none;\n }\n}\n";
28
31
 
29
32
  /**
30
- * The only place minor units become major units. Every amount on the wire is
31
- * an integer in the currency's smallest unit, and the exponent varies: USD and
32
- * EUR are 2, JPY and KRW are 0, and a few are 3. `Intl` knows all of them, so
33
- * ask it rather than hardcoding 100.
33
+ * Minor units of `currency` as a display string, e.g. (5846, 'EUR') → "€58.46".
34
+ *
35
+ * The exponent is the currency's ISO 4217 one (JPY has none, KWD has three)
36
+ * and the digits are en-US on every surface, so `locale` does not change them;
37
+ * it is kept so existing calls compile. No currency is ever assumed: an empty
38
+ * code prints digits only.
39
+ *
40
+ * @deprecated Use `formatMoney` from `@usethrottle/auth` (the root entry) or
41
+ * from `@usethrottle/money`.
34
42
  */
35
43
  declare function formatMoney(minorUnits: number, currency: string, locale: string): string;
36
44
  declare function formatDate(value: string | Date, locale: string): string;
@@ -1,5 +1,16 @@
1
1
  "use client";
2
- import "../../chunk-ETYOOYYV.js";
2
+ import {
3
+ CURRENCIES,
4
+ UnknownCurrencyError,
5
+ currencySymbol,
6
+ isKnownCurrency,
7
+ minorUnitsOf,
8
+ money,
9
+ moneyValue,
10
+ parseMoney,
11
+ toDecimalString,
12
+ toMinor
13
+ } from "../../chunk-PTREZIKS.js";
3
14
  import {
4
15
  Protect,
5
16
  SignedIn,
@@ -11,14 +22,14 @@ import {
11
22
  SignOutButton,
12
23
  SignUpButton,
13
24
  SignUpPage
14
- } from "../../chunk-VDK23T6L.js";
25
+ } from "../../chunk-X4IZ7RC6.js";
15
26
  import {
16
27
  THROTTLE_STYLES,
17
28
  THROTTLE_STYLE_ID,
18
29
  ThrottleProvider,
19
30
  ThrottleUIContext,
20
31
  useThrottle
21
- } from "../../chunk-RCNUWITB.js";
32
+ } from "../../chunk-YRJFGH6J.js";
22
33
  import "../../chunk-3B4DNX5T.js";
23
34
  import {
24
35
  ACCOUNT_TABS,
@@ -37,7 +48,7 @@ import {
37
48
  VerifyEmailBanner,
38
49
  formatDate,
39
50
  formatMoney
40
- } from "../../chunk-6WN3J5MM.js";
51
+ } from "../../chunk-37RG635A.js";
41
52
  import {
42
53
  useAddresses,
43
54
  useCustomer,
@@ -190,6 +201,7 @@ export {
190
201
  AddressesPanel,
191
202
  AuthFlow,
192
203
  AuthModal,
204
+ CURRENCIES,
193
205
  ForgotPassword,
194
206
  InvoiceDetail,
195
207
  InvoicesPanel,
@@ -216,16 +228,25 @@ export {
216
228
  ThrottleAuthError,
217
229
  ThrottleAuthProvider,
218
230
  ThrottleProvider,
231
+ UnknownCurrencyError,
219
232
  UserButton,
220
233
  VerifyEmail,
221
234
  VerifyEmailBanner,
222
235
  createAccount,
223
236
  createThrottleAuth,
237
+ currencySymbol,
224
238
  enUS,
225
239
  formatDate,
226
240
  formatMoney,
241
+ isKnownCurrency,
227
242
  localStorageAdapter,
228
243
  memoryStorage,
244
+ minorUnitsOf,
245
+ money,
246
+ moneyValue,
247
+ parseMoney,
248
+ toDecimalString,
249
+ toMinor,
229
250
  useAddresses,
230
251
  useAuth,
231
252
  useAuthContext,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/react/components/UserButton.tsx"],"sourcesContent":["import { useContext, useId, useRef, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { useAuth } from '../context';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from './appearance';\nimport { useCopy, type ThrottleLocalization } from './localization';\nimport { Avatar, Badge, Dropdown, DropdownItem, DropdownSeparator, Modal } from './primitives';\nimport { AccountDashboard, type AccountTab } from './account/AccountDashboard';\nimport { ThrottleUIContext } from './provider';\n\nexport interface UserButtonProps {\n /** \"modal\" opens the dashboard in an overlay; \"navigate\" links to accountUrl. */\n mode?: 'modal' | 'navigate';\n accountUrl?: string;\n /** Forwarded to the dashboard in modal mode. */\n tabs?: AccountTab[];\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n afterSignOut?(): void;\n children?: ReactNode;\n}\n\nfunction UserButtonRoot(props: UserButtonProps) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t } = useCopy(props.localization);\n const { auth, status, customer, emailVerified } = useAuth();\n // Delegate to the provider's single overlay when there is one. Two account\n // modals mounting at once is not cosmetic: each Modal captures the body's\n // overflow on open, so the second captures 'hidden' and restores 'hidden' on\n // close — leaving the merchant's page permanently unscrollable.\n const ui = useContext(ThrottleUIContext);\n const [localOpen, setLocalOpen] = useState(false);\n const accountOpen = ui ? false : localOpen;\n const titleId = useId();\n // \"Manage account\" both opens this modal AND is inside the Dropdown menu,\n // whose own onClick closes the dropdown on any click within it — both\n // state updates land in the same React commit, so the menuitem is removed\n // from the DOM in the same commit that mounts the Modal, and the browser\n // resets document.activeElement to <body> the instant a focused element is\n // removed (before Modal's own effect could ever capture it). Look up the\n // Dropdown's own trigger button instead, which stays mounted throughout —\n // see Modal's `restoreFocusTo` doc.\n const rootRef = useRef<HTMLSpanElement>(null);\n const openerRef = useRef<Element | null>(null);\n const openAccount = () => {\n const opener = rootRef.current?.querySelector('button[aria-haspopup=\"menu\"]') ?? null;\n openerRef.current = opener;\n if (ui) ui.openAccount({ tabs: props.tabs, restoreFocusTo: opener });\n else setLocalOpen(true);\n };\n\n // Nothing to show without a buyer — and nothing while loading either, so a\n // navbar never flickers between states during session restore.\n if (status !== 'authenticated' || !customer) return null;\n\n const name = [customer.firstName, customer.lastName].filter(Boolean).join(' ');\n\n return (\n <AppearanceProvider value={scoped}>\n <span {...a.rootProps}>\n <span ref={rootRef} {...a.el('userButton.root')}>\n <Dropdown\n label={t.userButton.openMenu}\n triggerKey=\"userButton.trigger\"\n menuKey=\"userButton.menu\"\n trigger={<Avatar name={name} email={customer.email} />}\n >\n <div {...a.el('userButton.identity', 'throttle-dropdown__item')}>\n <span>\n <span {...a.el('userButton.email')}>{customer.email}</span>\n <br />\n <Badge tone={emailVerified ? 'success' : 'warning'} elementKey=\"userButton.badge\">\n {emailVerified ? t.userButton.verified : t.userButton.unverified}\n </Badge>\n </span>\n </div>\n <DropdownSeparator />\n\n {props.mode === 'navigate' ? (\n <DropdownItem itemKey=\"userButton.manageButton\" href={props.accountUrl ?? '#'}>\n {t.userButton.manage}\n </DropdownItem>\n ) : (\n <DropdownItem itemKey=\"userButton.manageButton\" onClick={openAccount}>\n {t.userButton.manage}\n </DropdownItem>\n )}\n\n {props.children}\n <DropdownSeparator />\n\n <DropdownItem\n itemKey=\"userButton.signOutButton\"\n onClick={() => void auth.signOut().then(() => props.afterSignOut?.())}\n >\n {t.userButton.signOut}\n </DropdownItem>\n <DropdownItem\n itemKey=\"userButton.signOutAllButton\"\n // May raise step_up_required; the core opens the provider's dialog\n // and retries, so no handling is needed here.\n onClick={() => void auth.signOutEverywhere().then(() => props.afterSignOut?.())}\n >\n {t.userButton.signOutAll}\n </DropdownItem>\n </Dropdown>\n\n {props.mode !== 'navigate' && !ui ? (\n <Modal\n open={accountOpen}\n onClose={() => setLocalOpen(false)}\n labelledBy={titleId}\n restoreFocusTo={openerRef.current}\n >\n <h2 id={titleId} style={{ padding: '16px 16px 0', margin: 0 }}>{t.account.title}</h2>\n <div style={{ padding: 16 }}>\n <AccountDashboard\n tabs={props.tabs}\n appearance={props.appearance}\n localization={props.localization}\n />\n </div>\n </Modal>\n ) : null}\n </span>\n </span>\n </AppearanceProvider>\n );\n}\n\n/** `<UserButton.Link href label icon?/>` — a merchant link inside the menu. */\nfunction UserButtonLink(props: { href: string; label: string; icon?: ReactNode }) {\n return (\n <DropdownItem itemKey=\"userButton.item\" href={props.href}>\n {props.icon}{props.label}\n </DropdownItem>\n );\n}\n\n/** `<UserButton.Action onClick label icon?/>` — a merchant action inside the menu. */\nfunction UserButtonAction(props: { onClick(): void; label: string; icon?: ReactNode }) {\n return (\n <DropdownItem itemKey=\"userButton.item\" onClick={props.onClick}>\n {props.icon}{props.label}\n </DropdownItem>\n );\n}\n\nexport const UserButton = Object.assign(UserButtonRoot, {\n Link: UserButtonLink,\n Action: UserButtonAction,\n});\n"],"mappings":"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","names":[]}
1
+ {"version":3,"sources":["../../../src/react/components/UserButton.tsx"],"sourcesContent":["import { useContext, useId, useRef, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { useAuth } from '../context';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from './appearance';\nimport { useCopy, type ThrottleLocalization } from './localization';\nimport { Avatar, Badge, Dropdown, DropdownItem, DropdownSeparator, Modal } from './primitives';\nimport { AccountDashboard, type AccountTab } from './account/AccountDashboard';\nimport { ThrottleUIContext } from './provider';\n\nexport interface UserButtonProps {\n /** \"modal\" opens the dashboard in an overlay; \"navigate\" links to accountUrl. */\n mode?: 'modal' | 'navigate';\n accountUrl?: string;\n /** Forwarded to the dashboard in modal mode. */\n tabs?: AccountTab[];\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n afterSignOut?(): void;\n children?: ReactNode;\n}\n\nfunction UserButtonRoot(props: UserButtonProps) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t } = useCopy(props.localization);\n const { auth, status, customer, emailVerified } = useAuth();\n // Delegate to the provider's single overlay when there is one. Two account\n // modals mounting at once is not cosmetic: each Modal captures the body's\n // overflow on open, so the second captures 'hidden' and restores 'hidden' on\n // close — leaving the merchant's page permanently unscrollable.\n const ui = useContext(ThrottleUIContext);\n const [localOpen, setLocalOpen] = useState(false);\n const accountOpen = ui ? false : localOpen;\n const titleId = useId();\n // \"Manage account\" both opens this modal AND is inside the Dropdown menu,\n // whose own onClick closes the dropdown on any click within it — both\n // state updates land in the same React commit, so the menuitem is removed\n // from the DOM in the same commit that mounts the Modal, and the browser\n // resets document.activeElement to <body> the instant a focused element is\n // removed (before Modal's own effect could ever capture it). Look up the\n // Dropdown's own trigger button instead, which stays mounted throughout —\n // see Modal's `restoreFocusTo` doc.\n const rootRef = useRef<HTMLSpanElement>(null);\n const openerRef = useRef<Element | null>(null);\n const openAccount = () => {\n const opener = rootRef.current?.querySelector('button[aria-haspopup=\"menu\"]') ?? null;\n openerRef.current = opener;\n if (ui) ui.openAccount({ tabs: props.tabs, restoreFocusTo: opener });\n else setLocalOpen(true);\n };\n\n // Nothing to show without a buyer — and nothing while loading either, so a\n // navbar never flickers between states during session restore.\n if (status !== 'authenticated' || !customer) return null;\n\n const name = [customer.firstName, customer.lastName].filter(Boolean).join(' ');\n\n return (\n <AppearanceProvider value={scoped}>\n <span {...a.rootProps}>\n <span ref={rootRef} {...a.el('userButton.root')}>\n <Dropdown\n label={t.userButton.openMenu}\n triggerKey=\"userButton.trigger\"\n menuKey=\"userButton.menu\"\n trigger={<Avatar name={name} email={customer.email} />}\n >\n <div {...a.el('userButton.identity', 'throttle-dropdown__item')}>\n <span>\n <span {...a.el('userButton.email')}>{customer.email}</span>\n <br />\n <Badge tone={emailVerified ? 'success' : 'warning'} elementKey=\"userButton.badge\">\n {emailVerified ? t.userButton.verified : t.userButton.unverified}\n </Badge>\n </span>\n </div>\n <DropdownSeparator />\n\n {props.mode === 'navigate' ? (\n <DropdownItem itemKey=\"userButton.manageButton\" href={props.accountUrl ?? '#'}>\n {t.userButton.manage}\n </DropdownItem>\n ) : (\n <DropdownItem itemKey=\"userButton.manageButton\" onClick={openAccount}>\n {t.userButton.manage}\n </DropdownItem>\n )}\n\n {props.children}\n <DropdownSeparator />\n\n <DropdownItem\n itemKey=\"userButton.signOutButton\"\n onClick={() => void auth.signOut().then(() => props.afterSignOut?.())}\n >\n {t.userButton.signOut}\n </DropdownItem>\n <DropdownItem\n itemKey=\"userButton.signOutAllButton\"\n // May raise step_up_required; the core opens the provider's dialog\n // and retries, so no handling is needed here.\n onClick={() => void auth.signOutEverywhere().then(() => props.afterSignOut?.())}\n >\n {t.userButton.signOutAll}\n </DropdownItem>\n </Dropdown>\n\n {props.mode !== 'navigate' && !ui ? (\n <Modal\n open={accountOpen}\n onClose={() => setLocalOpen(false)}\n labelledBy={titleId}\n restoreFocusTo={openerRef.current}\n >\n <h2 id={titleId} style={{ padding: '16px 16px 0', margin: 0 }}>{t.account.title}</h2>\n <div style={{ padding: 16 }}>\n <AccountDashboard\n tabs={props.tabs}\n appearance={props.appearance}\n localization={props.localization}\n />\n </div>\n </Modal>\n ) : null}\n </span>\n </span>\n </AppearanceProvider>\n );\n}\n\n/** `<UserButton.Link href label icon?/>` — a merchant link inside the menu. */\nfunction UserButtonLink(props: { href: string; label: string; icon?: ReactNode }) {\n return (\n <DropdownItem itemKey=\"userButton.item\" href={props.href}>\n {props.icon}{props.label}\n </DropdownItem>\n );\n}\n\n/** `<UserButton.Action onClick label icon?/>` — a merchant action inside the menu. */\nfunction UserButtonAction(props: { onClick(): void; label: string; icon?: ReactNode }) {\n return (\n <DropdownItem itemKey=\"userButton.item\" onClick={props.onClick}>\n {props.icon}{props.label}\n </DropdownItem>\n );\n}\n\nexport const UserButton = Object.assign(UserButtonRoot, {\n Link: UserButtonLink,\n Action: UserButtonAction,\n});\n"],"mappings":"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","names":[]}
@@ -1,9 +1,10 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
3
  import { ReactNode } from 'react';
4
- import { j as ThrottleAuthConfig, T as ThrottleAuth } from '../../client-7LVKfuXO.js';
4
+ import { j as ThrottleAuthConfig, T as ThrottleAuth } from '../../client-BripyQad.js';
5
5
  import { a as ThrottleAppearance, c as ThrottleLocalization } from '../../localization-SnIAZXJn.js';
6
6
  import { d as AccountTab } from '../../AccountDashboard-V63ghvjY.js';
7
+ import '@usethrottle/money';
7
8
 
8
9
  /** One warning per problem per page, and only in development. */
9
10
  declare function warnOnce(key: string, message: string): void;
@@ -4,7 +4,7 @@ import {
4
4
  ThrottleUIContext,
5
5
  useThrottle,
6
6
  warnOnce
7
- } from "../../chunk-RCNUWITB.js";
7
+ } from "../../chunk-YRJFGH6J.js";
8
8
  import "../../chunk-X6D35EAX.js";
9
9
  import "../../chunk-CUNMJ2PH.js";
10
10
  import "../../chunk-K7RCWADI.js";
@@ -1,8 +1,10 @@
1
1
  "use client";
2
2
  "use strict";
3
+ var __create = Object.create;
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
6
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
9
  var __export = (target, all) => {
8
10
  for (var name in all)
@@ -16,17 +18,36 @@ var __copyProps = (to, from, except, desc) => {
16
18
  }
17
19
  return to;
18
20
  };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
19
29
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
30
 
21
31
  // src/react/index.tsx
22
32
  var react_exports = {};
23
33
  __export(react_exports, {
34
+ CURRENCIES: () => import_money.CURRENCIES,
24
35
  ThrottleAuthError: () => ThrottleAuthError,
25
36
  ThrottleAuthProvider: () => ThrottleAuthProvider,
37
+ UnknownCurrencyError: () => import_money.UnknownCurrencyError,
26
38
  createAccount: () => createAccount,
27
39
  createThrottleAuth: () => createThrottleAuth,
40
+ currencySymbol: () => import_money.currencySymbol,
41
+ formatMoney: () => import_money.formatMoney,
42
+ isKnownCurrency: () => import_money.isKnownCurrency,
28
43
  localStorageAdapter: () => localStorageAdapter,
29
44
  memoryStorage: () => memoryStorage,
45
+ minorUnitsOf: () => import_money.minorUnitsOf,
46
+ money: () => money,
47
+ moneyValue: () => import_money.moneyValue,
48
+ parseMoney: () => import_money.parseMoney,
49
+ toDecimalString: () => import_money.toDecimalString,
50
+ toMinor: () => import_money.toMinor,
30
51
  useAddresses: () => useAddresses,
31
52
  useAuth: () => useAuth,
32
53
  useAuthContext: () => useAuthContext,
@@ -613,14 +634,29 @@ function useInvoice(id) {
613
634
  const { account } = useAuth();
614
635
  return useResource(null, async () => id ? account.getInvoice(id) : null, [account, id]);
615
636
  }
637
+
638
+ // src/index.ts
639
+ var money = __toESM(require("@usethrottle/money"), 1);
640
+ var import_money = require("@usethrottle/money");
616
641
  // Annotate the CommonJS export names for ESM import in node:
617
642
  0 && (module.exports = {
643
+ CURRENCIES,
618
644
  ThrottleAuthError,
619
645
  ThrottleAuthProvider,
646
+ UnknownCurrencyError,
620
647
  createAccount,
621
648
  createThrottleAuth,
649
+ currencySymbol,
650
+ formatMoney,
651
+ isKnownCurrency,
622
652
  localStorageAdapter,
623
653
  memoryStorage,
654
+ minorUnitsOf,
655
+ money,
656
+ moneyValue,
657
+ parseMoney,
658
+ toDecimalString,
659
+ toMinor,
624
660
  useAddresses,
625
661
  useAuth,
626
662
  useAuthContext,