@nubitio/react-admin 0.1.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/LICENSE +21 -0
- package/README.md +65 -0
- package/dist/index.cjs +672 -0
- package/dist/index.d.cts +6 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.mjs +6 -0
- package/dist/style.css +6321 -0
- package/package.json +67 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Johan Guerreros
|
|
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
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# @nubitio/react-admin
|
|
2
|
+
|
|
3
|
+
Batteries-included admin stack for API Platform / Hydra backends. Umbrella package that re-exports [`@nubitio/core`](https://www.npmjs.com/package/@nubitio/core), [`@nubitio/ui`](https://www.npmjs.com/package/@nubitio/ui), [`@nubitio/admin`](https://www.npmjs.com/package/@nubitio/admin), [`@nubitio/crud`](https://www.npmjs.com/package/@nubitio/crud), and [`@nubitio/hydra`](https://www.npmjs.com/package/@nubitio/hydra) from a single install.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @nubitio/react-admin
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Peer dependencies
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
"@tanstack/react-query": "^5",
|
|
15
|
+
"i18next": "^23",
|
|
16
|
+
"react": "^19",
|
|
17
|
+
"react-dom": "^19",
|
|
18
|
+
"react-i18next": "^14",
|
|
19
|
+
"react-router-dom": "^6"
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Quick start
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import {
|
|
26
|
+
CoreProvider,
|
|
27
|
+
AdminShell,
|
|
28
|
+
SchemaProvider,
|
|
29
|
+
SmartCrudPage,
|
|
30
|
+
defineResource,
|
|
31
|
+
} from '@nubitio/react-admin';
|
|
32
|
+
import '@nubitio/react-admin/style.css';
|
|
33
|
+
|
|
34
|
+
const products = defineResource('/api/products', { title: 'Products' });
|
|
35
|
+
|
|
36
|
+
export function App() {
|
|
37
|
+
return (
|
|
38
|
+
<CoreProvider apiBaseUrl="https://api.example.com" locale="es" timezone="America/Lima">
|
|
39
|
+
<SchemaProvider>
|
|
40
|
+
<AdminShell title="My Admin" menuItems={menu}>
|
|
41
|
+
<SmartCrudPage resource={products} />
|
|
42
|
+
</AdminShell>
|
|
43
|
+
</SchemaProvider>
|
|
44
|
+
</CoreProvider>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
`SmartCrudPage` discovers the resource schema from your API Platform docs and renders a full CRUD page — datagrid with filters/sorting/pagination, create/edit forms (dialog, drawer, or page), validation, and RBAC — with zero hand-written field definitions. Use `CrudPage` with explicit field definitions when you want full manual control.
|
|
50
|
+
|
|
51
|
+
## The stack
|
|
52
|
+
|
|
53
|
+
| Package | What it provides |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| `@nubitio/core` | HTTP client, event bus, i18n, Mercure SSE, date utilities |
|
|
56
|
+
| `@nubitio/ui` | Visual primitives and theme system |
|
|
57
|
+
| `@nubitio/admin` | Responsive admin shell (sidebar, header) |
|
|
58
|
+
| `@nubitio/crud` | Declarative CRUD engine: field DSL, forms, datagrids, RBAC |
|
|
59
|
+
| `@nubitio/hydra` | Schema discovery and data sources from Hydra/OpenAPI docs |
|
|
60
|
+
|
|
61
|
+
Each package is also published separately if you only need part of the stack.
|
|
62
|
+
|
|
63
|
+
## License
|
|
64
|
+
|
|
65
|
+
MIT
|