@base316/react 0.2.0 → 0.5.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 (48) hide show
  1. package/CHANGELOG.md +115 -0
  2. package/README.md +14 -0
  3. package/dist/index.cjs +4440 -2021
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.d.ts +16 -0
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +5380 -2959
  8. package/dist/index.js.map +1 -1
  9. package/dist/manifest.json +396 -14
  10. package/dist/src/AcceptInvitation.d.ts +15 -1
  11. package/dist/src/AcceptInvitation.d.ts.map +1 -1
  12. package/dist/src/BillingDetailsForm.d.ts +33 -0
  13. package/dist/src/BillingDetailsForm.d.ts.map +1 -0
  14. package/dist/src/BillingPortal.d.ts +45 -0
  15. package/dist/src/BillingPortal.d.ts.map +1 -0
  16. package/dist/src/CreditBalances.d.ts +19 -0
  17. package/dist/src/CreditBalances.d.ts.map +1 -0
  18. package/dist/src/Invoices.d.ts +10 -6
  19. package/dist/src/Invoices.d.ts.map +1 -1
  20. package/dist/src/PaymentMethod.d.ts +25 -0
  21. package/dist/src/PaymentMethod.d.ts.map +1 -0
  22. package/dist/src/PlanChangeReview.d.ts +29 -0
  23. package/dist/src/PlanChangeReview.d.ts.map +1 -0
  24. package/dist/src/PricingTable.d.ts +13 -1
  25. package/dist/src/PricingTable.d.ts.map +1 -1
  26. package/dist/src/SeatManager.d.ts +24 -0
  27. package/dist/src/SeatManager.d.ts.map +1 -0
  28. package/dist/src/SecondFactorStep.d.ts +83 -0
  29. package/dist/src/SecondFactorStep.d.ts.map +1 -0
  30. package/dist/src/SignIn.d.ts +16 -3
  31. package/dist/src/SignIn.d.ts.map +1 -1
  32. package/dist/src/SignUp.d.ts +51 -3
  33. package/dist/src/SignUp.d.ts.map +1 -1
  34. package/dist/src/SubscriptionManager.d.ts +7 -1
  35. package/dist/src/SubscriptionManager.d.ts.map +1 -1
  36. package/dist/src/TeamMembers.d.ts.map +1 -1
  37. package/dist/src/TwoFactorManager.d.ts +14 -5
  38. package/dist/src/TwoFactorManager.d.ts.map +1 -1
  39. package/dist/src/UpcomingInvoice.d.ts +21 -0
  40. package/dist/src/UpcomingInvoice.d.ts.map +1 -0
  41. package/dist/src/appearance.d.ts +2 -2
  42. package/dist/src/appearance.d.ts.map +1 -1
  43. package/dist/src/manifest.d.ts.map +1 -1
  44. package/dist/src/provider.d.ts +13 -1
  45. package/dist/src/provider.d.ts.map +1 -1
  46. package/dist/src/usePlans.d.ts +17 -0
  47. package/dist/src/usePlans.d.ts.map +1 -1
  48. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,120 @@
1
1
  # @base316/react
2
2
 
3
+ ## 0.5.0 — 2026-10-14
4
+
5
+ Needs `@base316/sdk` 0.6.0 (`invitationToken` on `auth.signUp`).
6
+
7
+ ### Added
8
+
9
+ - `<SignUp />` accepts an invitation as part of signing up: it reads
10
+ `?invitation=` from the page (or the new `invitationToken` prop; `null`
11
+ ignores the URL), says "You are joining Acme as Member", fills in the address
12
+ the invitation went to and sends the token, so the account joins that team
13
+ instead of getting a personal workspace. `onJoined(organizationId)` is
14
+ called when it did. Wording: `labels.joining`.
15
+ - `<AcceptInvitation />`'s "Create an account" link carries `?invitation=` to
16
+ `signUpUrl`, so the sign-up page above picks it up.
17
+
18
+ ### Fixed
19
+
20
+ - `<SignUp />` shows the server's sentence for a `409` refusal (a team with no
21
+ free seat) instead of the generic failure.
22
+
23
+ ## 0.4.0 — 2026-10-13
24
+
25
+ Requires `@base316/sdk` 0.5.0.
26
+
27
+ ### Fixed — signing in when a second factor is required
28
+
29
+ - Under an environment that requires a second factor, `<SignIn />` showed
30
+ "From your authenticator app" to somebody with no factor, `<SignUp />`
31
+ stopped silently after creating the account, and the magic-link landing set
32
+ an undefined token, which looked like being signed out. All three now go
33
+ into the new second-factor step.
34
+ - `<SignUp />` shows the server's reason for a refusal ("Password needs a
35
+ symbol.", "That email is already registered.") rather than "The email may
36
+ already be registered" for everything, and the environment's own password
37
+ rules under the box (read with `auth.passwordPolicy()`) instead of a fixed
38
+ "At least 8 characters". An account created under a policy that requires a
39
+ confirmed address says to check the inbox instead of reporting a failure.
40
+
41
+ ### Added
42
+
43
+ - **`<SecondFactorStep />`** — the second half of a sign-in that returned
44
+ `mfaRequired`. With a factor: a code box naming where the code went, resend,
45
+ recovery codes accepted. With none, under a required policy: choose
46
+ **Authenticator app** (QR code, setup key, link, six-digit confirm), **Email
47
+ me a code** or **Text me a code** — only what the server lists in
48
+ `enrollMethods` — then the recovery codes once, with copy and download, and an
49
+ "I have saved these codes" confirmation before the session is handed over.
50
+ Focus moves to each step's heading; errors are announced. `<SignIn />` and
51
+ `<SignUp />` use it; use it directly after a first step of your own.
52
+ - Wording props for translation: `labels` on `<SecondFactorStep />` and
53
+ `<SignUp />`, `secondFactorLabels` on `<SignIn />` and `<SignUp />`
54
+ (`SecondFactorLabels`, `SignUpLabels`). English when omitted.
55
+
56
+ - **`<BillingPortal />`** — a whole billing page for the signed-in user: plan
57
+ and status, next invoice, a scheduled change with its undo, a plan picker
58
+ whose choice opens a review step, seats on a per-seat plan, the card on file,
59
+ invoices with PDF and Pay, and cancel and resume. `billingDetails` is a slot
60
+ for your own address or tax-ID form. Composed from the components below, so a
61
+ different layout uses them directly.
62
+ - **`<PlanChangeReview />`** — the step between picking a plan and changing to
63
+ it: features gained and lost, the prorated credit and charge now or the date
64
+ it waits for, the other timing when it is open, then confirm. A change now
65
+ with no card on file asks for one.
66
+ - **`<PaymentMethod />`** — the card on file and a button that replaces it on a
67
+ Stripe-hosted page, and any other saved cards with **Make default** and
68
+ **Remove**. No card field is rendered anywhere.
69
+ - **`<CreditBalances />`** — each credit balance, **Buy now** (the hosted pay
70
+ page) and auto-recharge with a threshold, pack and monthly maximum.
71
+ `<BillingPortal />` includes it when credit packs are on sale.
72
+ - `SubscriptionManager` offers **Resume** on a cancelled subscription, confirms
73
+ a cancel in the page, and takes `onChange`. `Invoices` adds **PDF** (the
74
+ server's rendering, downloaded) and **Pay** on an open invoice.
75
+ - **`<SeatManager />`** — the signed-in user changes how many seats their
76
+ subscription is for, with the price previewed before anything is charged:
77
+ adding seats is charged now for the rest of the period, removing them takes
78
+ effect at the period end with no refund. The user only picks the number;
79
+ each confirmed change carries its own idempotency key. Shows the plan's seat
80
+ limit when it has one, and that the plan is provided by their organization
81
+ for a managed tenant. `unitLabel` renames "seats"; `onChange` reports what a
82
+ change did.
83
+ - **`<UpcomingInvoice />`** — the signed-in user's next bill: when it is
84
+ issued, its lines, discount, tax, wallet balance and the amount due. Reads
85
+ `billing.upcomingInvoice` from `@base316/sdk`; nothing is stored or charged
86
+ by showing it. `showLines={false}` gives a one-line card. Says "No upcoming
87
+ invoice" when nothing will bill the user, and that the plan is provided by
88
+ their organization for a managed tenant.
89
+ - **Scheduled plan changes** — `<SubscriptionManager />` says when a scheduled
90
+ downgrade or ramp step takes effect ("Moves to Basic on 1 Nov") with a
91
+ "Keep Pro" button that withdraws it. `usePlans().selectPlan` returns
92
+ `{ status: "scheduled", effectiveAt }` for a downgrade, which now waits for
93
+ the renewal by default, and keeps the current plan marked current;
94
+ `<PricingTable />` says when the new plan starts.
95
+
96
+ ## 0.3.0 — 2026-10-03
97
+
98
+ Requires `@base316/sdk` 0.3.0.
99
+
100
+ ### Added
101
+
102
+ - **White-label for a tenant**: `Base316Provider` takes `tenant` —
103
+ `{ organizationId }` or `{ organizationExternalId }` — and every component
104
+ under it shows that tenant's branding (its own, then its parent's, then the
105
+ environment's). Changing it restyles without a reload; an inline object does
106
+ not refetch.
107
+ - `TeamMembers` says when a team is reached through the organization that
108
+ manages it rather than by membership.
109
+ - `SubscriptionManager` and `PricingTable` know when an account's plan is
110
+ provided by the organization that manages it: the plan is shown with the
111
+ provider named, and nothing can be bought, changed or cancelled.
112
+ `usePlans()` returns `managedBy`.
113
+ - `PricingTable` says what a reverse trial turns into: a plan version whose
114
+ `trialEndAction` is `DOWNGRADE` reads "14-day free trial, then Free unless
115
+ you add a card", naming the downgrade plan when it is among the published
116
+ plans. `CONVERT` trials read as before.
117
+
3
118
  ## 0.2.0
4
119
 
5
120
  The first release since `0.1.0` on 13 September. The package shipped **8
package/README.md CHANGED
@@ -79,6 +79,20 @@ inherits your application's styles automatically — silently absorbing whatever
79
79
  `body { font }` and `button { }` rules happen to exist produces components that
80
80
  look broken in ways neither side can predict.
81
81
 
82
+ ## White-label for a tenant
83
+
84
+ When one business runs your product for others — a firm and its clients — show
85
+ the firm's brand on the screens its clients see:
86
+
87
+ ```tsx
88
+ <Base316Provider publishableKey={key} tenant={{ organizationExternalId: firm.id }}>
89
+ ```
90
+
91
+ The tenant's own branding, then its parent's, then your environment's, field
92
+ by field. Change `tenant` when the person switches team and every component
93
+ restyles. `TeamMembers` says so when a team is reached through the firm rather
94
+ than by membership.
95
+
82
96
  ## Reading the session
83
97
 
84
98
  ```tsx