@terreno/admin-frontend 0.29.0 → 0.31.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 (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +62 -2
  3. package/package.json +4 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Flourish Health, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,5 +1,65 @@
1
1
  # @terreno/admin-frontend
2
2
 
3
- Admin panel frontend screens for `@terreno/api` backends. Provides reusable React Native components for building admin interfaces with CRUD operations.
3
+ Reusable React Native admin screens for `@terreno/api` backends — model list, tables, forms, and shell layout wired to admin CRUD routes.
4
4
 
5
- See the [full documentation](../.claude/rules/admin-frontend/00-admin-frontend.md) for usage, components, and integration details.
5
+ ## Install
6
+
7
+ ```bash
8
+ bun add @terreno/admin-frontend @terreno/ui @reduxjs/toolkit react react-redux
9
+ ```
10
+
11
+ Optional peer: `react-native-webview` (for consent/signature fields).
12
+
13
+ ## Quick start
14
+
15
+ ```typescript
16
+ // app/admin/_layout.tsx
17
+ import {AdminShellLayout} from "@terreno/admin-frontend";
18
+ import {Stack} from "expo-router";
19
+ import {api} from "@/store/openApiSdk";
20
+
21
+ export default function AdminLayout() {
22
+ return (
23
+ <AdminShellLayout
24
+ api={api}
25
+ apiBase="/admin"
26
+ configurationPath="/admin/configuration"
27
+ routeBase="/admin"
28
+ versionConfigPath="/version-config"
29
+ >
30
+ <Stack screenOptions={{headerShown: false, contentStyle: {flex: 1}}}>
31
+ <Stack.Screen name="index" />
32
+ <Stack.Screen name="[model]" />
33
+ </Stack>
34
+ </AdminShellLayout>
35
+ );
36
+ }
37
+
38
+ // app/admin/index.tsx
39
+ import {AdminModelList} from "@terreno/admin-frontend";
40
+ import {api} from "@/store/openApiSdk";
41
+
42
+ export default function AdminIndexScreen() {
43
+ return <AdminModelList baseUrl="/admin" api={api} />;
44
+ }
45
+ ```
46
+
47
+ Pair with `@terreno/admin-backend` on the API so `/admin/config` and CRUD routes exist.
48
+
49
+ ## What's included
50
+
51
+ - `AdminModelList`, `AdminModelTable`, `AdminModelForm` — core CRUD screens
52
+ - `AdminShellLayout` / `AdminShell` — sidebar + main column chrome for Expo Router apps
53
+ - `AdminFieldRenderer`, `AdminRefField` — table cell and reference link rendering
54
+ - `useAdminConfig`, `useAdminApi` — fetch config and generate RTK Query hooks per model
55
+ - `ConfigurationScreen`, consent editors, `DocumentStorageBrowser`, and admin script UI
56
+ - `SYSTEM_FIELDS` — fields skipped in auto-generated forms
57
+ - Types: `AdminModelConfig`, `AdminFieldConfig`, `AdminConfigResponse`, and more
58
+
59
+ ## Documentation
60
+
61
+ Full API reference: [docs/reference/admin-frontend.md](https://github.com/flourishhealth/terreno/blob/master/docs/reference/admin-frontend.md)
62
+
63
+ ## License and Contributing
64
+
65
+ Licensed under the [MIT License](https://github.com/flourishhealth/terreno/blob/master/LICENSE). See [CONTRIBUTING.md](https://github.com/flourishhealth/terreno/blob/master/CONTRIBUTING.md) for contribution guidelines.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "dependencies": {
3
- "@terreno/ui": "0.29.0",
3
+ "@terreno/ui": "0.31.0",
4
4
  "expo-router": "~6.0.19",
5
5
  "jspdf": "^4.2.0",
6
6
  "lodash": "^4.18.1",
@@ -19,11 +19,12 @@
19
19
  "typescript": "~5.9.2"
20
20
  },
21
21
  "files": [
22
+ "LICENSE",
22
23
  "dist/**/*",
23
24
  "src/**/*",
24
25
  ".ai/**/*"
25
26
  ],
26
- "license": "Apache-2.0",
27
+ "license": "MIT",
27
28
  "main": "dist/index.js",
28
29
  "name": "@terreno/admin-frontend",
29
30
  "peerDependencies": {
@@ -52,5 +53,5 @@
52
53
  "test:coverage": "bun run ../scripts/check-coverage.ts"
53
54
  },
54
55
  "types": "dist/index.d.ts",
55
- "version": "0.29.0"
56
+ "version": "0.31.0"
56
57
  }