@base316/react 0.1.0 → 0.3.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 (72) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +29 -15
  3. package/dist/index.cjs +4361 -166
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.d.ts +48 -0
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +4344 -164
  8. package/dist/index.js.map +1 -1
  9. package/dist/manifest.json +1176 -0
  10. package/dist/src/AcceptInvitation.d.ts +27 -0
  11. package/dist/src/AcceptInvitation.d.ts.map +1 -0
  12. package/dist/src/ActiveSessions.d.ts +21 -0
  13. package/dist/src/ActiveSessions.d.ts.map +1 -0
  14. package/dist/src/ApiKeyManager.d.ts +22 -0
  15. package/dist/src/ApiKeyManager.d.ts.map +1 -0
  16. package/dist/src/Chart.d.ts +42 -0
  17. package/dist/src/Chart.d.ts.map +1 -0
  18. package/dist/src/DataTable.d.ts +56 -0
  19. package/dist/src/DataTable.d.ts.map +1 -0
  20. package/dist/src/DeviceApproval.d.ts +30 -0
  21. package/dist/src/DeviceApproval.d.ts.map +1 -0
  22. package/dist/src/ForgotPassword.d.ts +24 -0
  23. package/dist/src/ForgotPassword.d.ts.map +1 -0
  24. package/dist/src/Invoices.d.ts.map +1 -1
  25. package/dist/src/Kanban.d.ts +40 -0
  26. package/dist/src/Kanban.d.ts.map +1 -0
  27. package/dist/src/PasskeyManager.d.ts.map +1 -1
  28. package/dist/src/PayInvoice.d.ts +41 -0
  29. package/dist/src/PayInvoice.d.ts.map +1 -0
  30. package/dist/src/PricingTable.d.ts +43 -11
  31. package/dist/src/PricingTable.d.ts.map +1 -1
  32. package/dist/src/PrivacyControls.d.ts +28 -0
  33. package/dist/src/PrivacyControls.d.ts.map +1 -0
  34. package/dist/src/RecordDetail.d.ts +31 -0
  35. package/dist/src/RecordDetail.d.ts.map +1 -0
  36. package/dist/src/RecordForm.d.ts +32 -0
  37. package/dist/src/RecordForm.d.ts.map +1 -0
  38. package/dist/src/RelationPicker.d.ts +23 -0
  39. package/dist/src/RelationPicker.d.ts.map +1 -0
  40. package/dist/src/ResetPassword.d.ts +24 -0
  41. package/dist/src/ResetPassword.d.ts.map +1 -0
  42. package/dist/src/SignIn.d.ts +20 -2
  43. package/dist/src/SignIn.d.ts.map +1 -1
  44. package/dist/src/SignUp.d.ts.map +1 -1
  45. package/dist/src/SubscriptionManager.d.ts.map +1 -1
  46. package/dist/src/TeamMembers.d.ts +49 -0
  47. package/dist/src/TeamMembers.d.ts.map +1 -0
  48. package/dist/src/TwoFactorManager.d.ts +38 -0
  49. package/dist/src/TwoFactorManager.d.ts.map +1 -0
  50. package/dist/src/VerifyEmail.d.ts +24 -0
  51. package/dist/src/VerifyEmail.d.ts.map +1 -0
  52. package/dist/src/appearance.d.ts +2 -2
  53. package/dist/src/appearance.d.ts.map +1 -1
  54. package/dist/src/confirm.d.ts +32 -0
  55. package/dist/src/confirm.d.ts.map +1 -0
  56. package/dist/src/fields.d.ts +44 -0
  57. package/dist/src/fields.d.ts.map +1 -0
  58. package/dist/src/manifest.d.ts +84 -0
  59. package/dist/src/manifest.d.ts.map +1 -0
  60. package/dist/src/provider.d.ts +13 -1
  61. package/dist/src/provider.d.ts.map +1 -1
  62. package/dist/src/test/harness.d.ts +204 -0
  63. package/dist/src/test/harness.d.ts.map +1 -0
  64. package/dist/src/test/setup.d.ts +2 -0
  65. package/dist/src/test/setup.d.ts.map +1 -0
  66. package/dist/src/useCollection.d.ts +79 -0
  67. package/dist/src/useCollection.d.ts.map +1 -0
  68. package/dist/src/usePaymentLink.d.ts +41 -0
  69. package/dist/src/usePaymentLink.d.ts.map +1 -0
  70. package/dist/src/usePlans.d.ts +74 -0
  71. package/dist/src/usePlans.d.ts.map +1 -0
  72. package/package.json +36 -28
package/CHANGELOG.md ADDED
@@ -0,0 +1,53 @@
1
+ # @base316/react
2
+
3
+ ## 0.3.0 — 2026-10-03
4
+
5
+ Requires `@base316/sdk` 0.3.0.
6
+
7
+ ### Added
8
+
9
+ - **White-label for a tenant**: `Base316Provider` takes `tenant` —
10
+ `{ organizationId }` or `{ organizationExternalId }` — and every component
11
+ under it shows that tenant's branding (its own, then its parent's, then the
12
+ environment's). Changing it restyles without a reload; an inline object does
13
+ not refetch.
14
+ - `TeamMembers` says when a team is reached through the organization that
15
+ manages it rather than by membership.
16
+ - `SubscriptionManager` and `PricingTable` know when an account's plan is
17
+ provided by the organization that manages it: the plan is shown with the
18
+ provider named, and nothing can be bought, changed or cancelled.
19
+ `usePlans()` returns `managedBy`.
20
+
21
+ ## 0.2.0
22
+
23
+ The first release since `0.1.0` on 13 September. The package shipped **8
24
+ components** then and ships **28** now, all additive.
25
+
26
+ ### Added
27
+
28
+ Identity and account surfaces:
29
+
30
+ - `AcceptInvitation`, `ActiveSessions`, `ApiKeyManager`, `DeviceApproval`,
31
+ `ForgotPassword`, `ResetPassword`, `PrivacyControls`.
32
+
33
+ Data surfaces, for the customer's own collections:
34
+
35
+ - `DataTable`, `RecordDetail`, `RecordForm`, `RelationPicker`, `Kanban`,
36
+ `Chart`.
37
+
38
+ Billing surfaces:
39
+
40
+ - `PayInvoice`, and additions to `Invoices`, `PricingTable` and
41
+ `SubscriptionManager`.
42
+
43
+ ### Fixed
44
+
45
+ - Test type declarations are no longer published. `tsconfig.build.json`
46
+ excluded `**/*.test.ts` while every test here is `.test.tsx`, so 24
47
+ `.test.d.ts` files shipped inside `0.1.0`. The tarball drops from 104 files
48
+ to 80.
49
+
50
+ ### Note
51
+
52
+ This package depends on `@base316/sdk` by exact version — `0.2.0` — so that
53
+ package has to be on npm first or an install of this one cannot resolve.
package/README.md CHANGED
@@ -14,11 +14,11 @@ npm install @base316/react @base316/sdk
14
14
  import { Base316Provider } from "@base316/react";
15
15
 
16
16
  export default function App({ children }) {
17
- return (
18
- <Base316Provider publishableKey={process.env.NEXT_PUBLIC_BASE316_KEY}>
19
- {children}
20
- </Base316Provider>
21
- );
17
+ return (
18
+ <Base316Provider publishableKey={process.env.NEXT_PUBLIC_BASE316_KEY}>
19
+ {children}
20
+ </Base316Provider>
21
+ );
22
22
  }
23
23
  ```
24
24
 
@@ -32,7 +32,7 @@ these components look like here. No colours to keep in step in two places.
32
32
  import { SignIn } from "@base316/react";
33
33
 
34
34
  export default function LoginPage() {
35
- return <SignIn onSignedIn={() => router.push("/app")} />;
35
+ return <SignIn onSignedIn={() => router.push("/app")} />;
36
36
  }
37
37
  ```
38
38
 
@@ -47,11 +47,11 @@ point your users at the link in the dashboard and they come back signed in.
47
47
 
48
48
  ```tsx
49
49
  import {
50
- UserProfile, // email, password, sessions, two-factor
51
- PricingTable, // your plans, with a checkout button
52
- SubscriptionManager, // what they are on, and how to change it
53
- Invoices, // what they have been billed
54
- Branding, // your logo and name, as configured
50
+ UserProfile, // email, password, sessions, two-factor
51
+ PricingTable, // your plans, with a checkout button
52
+ SubscriptionManager, // what they are on, and how to change it
53
+ Invoices, // what they have been billed
54
+ Branding, // your logo and name, as configured
55
55
  } from "@base316/react";
56
56
  ```
57
57
 
@@ -59,7 +59,7 @@ import {
59
59
 
60
60
  Three ways, from least to most invasive. Use the first that works.
61
61
 
62
- **1. The dashboard.** Whatever you set under *Sign-in pages* — brand colour,
62
+ **1. The dashboard.** Whatever you set under _Sign-in pages_ — brand colour,
63
63
  background, logo — arrives here automatically.
64
64
 
65
65
  **2. `appearance` tokens.** No CSS to write:
@@ -79,16 +79,30 @@ 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
85
99
  import { useSession } from "@base316/react";
86
100
 
87
101
  function Greeting() {
88
- const { session, loading } = useSession();
102
+ const { session, loading } = useSession();
89
103
 
90
- if (loading) return null;
91
- return session ? <p>Hello {session.user.email}</p> : <a href="/login">Sign in</a>;
104
+ if (loading) return null;
105
+ return session ? <p>Hello {session.user.email}</p> : <a href="/login">Sign in</a>;
92
106
  }
93
107
  ```
94
108