@base316/react 0.3.0 → 0.5.1

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