@base316/react 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/README.md +15 -15
- package/dist/index.cjs +4150 -160
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +48 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4136 -165
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +1161 -0
- package/dist/src/AcceptInvitation.d.ts +27 -0
- package/dist/src/AcceptInvitation.d.ts.map +1 -0
- package/dist/src/ActiveSessions.d.ts +21 -0
- package/dist/src/ActiveSessions.d.ts.map +1 -0
- package/dist/src/ApiKeyManager.d.ts +22 -0
- package/dist/src/ApiKeyManager.d.ts.map +1 -0
- package/dist/src/Chart.d.ts +42 -0
- package/dist/src/Chart.d.ts.map +1 -0
- package/dist/src/DataTable.d.ts +56 -0
- package/dist/src/DataTable.d.ts.map +1 -0
- package/dist/src/DeviceApproval.d.ts +30 -0
- package/dist/src/DeviceApproval.d.ts.map +1 -0
- package/dist/src/ForgotPassword.d.ts +24 -0
- package/dist/src/ForgotPassword.d.ts.map +1 -0
- package/dist/src/Invoices.d.ts.map +1 -1
- package/dist/src/Kanban.d.ts +40 -0
- package/dist/src/Kanban.d.ts.map +1 -0
- package/dist/src/PasskeyManager.d.ts.map +1 -1
- package/dist/src/PayInvoice.d.ts +41 -0
- package/dist/src/PayInvoice.d.ts.map +1 -0
- package/dist/src/PricingTable.d.ts +43 -11
- package/dist/src/PricingTable.d.ts.map +1 -1
- package/dist/src/PrivacyControls.d.ts +28 -0
- package/dist/src/PrivacyControls.d.ts.map +1 -0
- package/dist/src/RecordDetail.d.ts +31 -0
- package/dist/src/RecordDetail.d.ts.map +1 -0
- package/dist/src/RecordForm.d.ts +32 -0
- package/dist/src/RecordForm.d.ts.map +1 -0
- package/dist/src/RelationPicker.d.ts +23 -0
- package/dist/src/RelationPicker.d.ts.map +1 -0
- package/dist/src/ResetPassword.d.ts +24 -0
- package/dist/src/ResetPassword.d.ts.map +1 -0
- package/dist/src/SignIn.d.ts +11 -1
- package/dist/src/SignIn.d.ts.map +1 -1
- package/dist/src/SignUp.d.ts.map +1 -1
- package/dist/src/SubscriptionManager.d.ts.map +1 -1
- package/dist/src/TeamMembers.d.ts +49 -0
- package/dist/src/TeamMembers.d.ts.map +1 -0
- package/dist/src/TwoFactorManager.d.ts +29 -0
- package/dist/src/TwoFactorManager.d.ts.map +1 -0
- package/dist/src/VerifyEmail.d.ts +24 -0
- package/dist/src/VerifyEmail.d.ts.map +1 -0
- package/dist/src/appearance.d.ts +2 -2
- package/dist/src/appearance.d.ts.map +1 -1
- package/dist/src/confirm.d.ts +32 -0
- package/dist/src/confirm.d.ts.map +1 -0
- package/dist/src/fields.d.ts +44 -0
- package/dist/src/fields.d.ts.map +1 -0
- package/dist/src/manifest.d.ts +84 -0
- package/dist/src/manifest.d.ts.map +1 -0
- package/dist/src/test/harness.d.ts +204 -0
- package/dist/src/test/harness.d.ts.map +1 -0
- package/dist/src/test/setup.d.ts +2 -0
- package/dist/src/test/setup.d.ts.map +1 -0
- package/dist/src/useCollection.d.ts +79 -0
- package/dist/src/useCollection.d.ts.map +1 -0
- package/dist/src/usePaymentLink.d.ts +41 -0
- package/dist/src/usePaymentLink.d.ts.map +1 -0
- package/dist/src/usePlans.d.ts +66 -0
- package/dist/src/usePlans.d.ts.map +1 -0
- package/package.json +36 -28
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# @base316/react
|
|
2
|
+
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
The first release since `0.1.0` on 13 September. The package shipped **8
|
|
6
|
+
components** then and ships **28** now, all additive.
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
|
|
10
|
+
Identity and account surfaces:
|
|
11
|
+
|
|
12
|
+
- `AcceptInvitation`, `ActiveSessions`, `ApiKeyManager`, `DeviceApproval`,
|
|
13
|
+
`ForgotPassword`, `ResetPassword`, `PrivacyControls`.
|
|
14
|
+
|
|
15
|
+
Data surfaces, for the customer's own collections:
|
|
16
|
+
|
|
17
|
+
- `DataTable`, `RecordDetail`, `RecordForm`, `RelationPicker`, `Kanban`,
|
|
18
|
+
`Chart`.
|
|
19
|
+
|
|
20
|
+
Billing surfaces:
|
|
21
|
+
|
|
22
|
+
- `PayInvoice`, and additions to `Invoices`, `PricingTable` and
|
|
23
|
+
`SubscriptionManager`.
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
|
|
27
|
+
- Test type declarations are no longer published. `tsconfig.build.json`
|
|
28
|
+
excluded `**/*.test.ts` while every test here is `.test.tsx`, so 24
|
|
29
|
+
`.test.d.ts` files shipped inside `0.1.0`. The tarball drops from 104 files
|
|
30
|
+
to 80.
|
|
31
|
+
|
|
32
|
+
### Note
|
|
33
|
+
|
|
34
|
+
This package depends on `@base316/sdk` by exact version — `0.2.0` — so that
|
|
35
|
+
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
|
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:
|
|
@@ -85,10 +85,10 @@ look broken in ways neither side can predict.
|
|
|
85
85
|
import { useSession } from "@base316/react";
|
|
86
86
|
|
|
87
87
|
function Greeting() {
|
|
88
|
-
|
|
88
|
+
const { session, loading } = useSession();
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
if (loading) return null;
|
|
91
|
+
return session ? <p>Hello {session.user.email}</p> : <a href="/login">Sign in</a>;
|
|
92
92
|
}
|
|
93
93
|
```
|
|
94
94
|
|