You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/ui-framework.md
+75-11Lines changed: 75 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,74 @@
1
1
# Standard UI Components Reference
2
2
3
-
This document defines the standard component library for `@objectos/ui`. These components are the reference implementations for the **View & Layout Specification**.
3
+
This document defines the standard component library for `@objectos/ui`. These components are the reference implementations for the **View & Layout Specifications**.
4
4
5
-
## 1. View Controller
5
+
---
6
+
7
+
## 1. Page Architecture
8
+
9
+
The top-level system for composing screens from Widgets and Layouts. Driven by `*.page.yml`.
10
+
11
+
### `ObjectPage`
12
+
The master controller for any URL-addressable page in the application.
13
+
14
+
-**Props**:
15
+
-`pageId`: string (e.g., "dashboard-sales") - *The ID of the page definition to load.*
16
+
-`context`: Record<string, any> - *Optional global variable to pass to widgets (e.g., `{ recordId: "123" }`)*.
17
+
-**Behavior**:
18
+
1. Loads `*.page.yml` from the Metadata Kernel.
19
+
2. Resolves permissions (can the user see this page?).
A simple stack layout, mostly used for Wiki-style pages or Mobile app views.
37
+
38
+
---
39
+
40
+
## 2. Page Components (Widgets)
41
+
42
+
These are the "Blocks" that live inside a Layout. In `*.page.yml`, these are the items in the `components` array.
43
+
44
+
### `WidgetMetric`
45
+
**Type:**`metric`
46
+
Displays a single KPI with trend indicator.
47
+
-**Props**: `label`, `value` (expression or query), `trend`, `format`.
48
+
-**UI**: A compact card (`Card`, `CardHeader`, `CardContent`).
49
+
50
+
### `WidgetChart`
51
+
**Type:**`chart`
52
+
Renders a visualization.
53
+
-**Props**: `chart_id`.
54
+
-**Behavior**: Use the `chart_id` to fetch the Chart definition (`*.chart.yml`), then renders the appropriate **Visualization Primitive** (see Section 7).
55
+
56
+
### `WidgetView`
57
+
**Type:**`view`
58
+
Embeds a full `ObjectView` inside a dashboard tile.
59
+
-**Props**: `view_id` OR (`object`, `view`).
60
+
-**Behavior**: Renders the `<ObjectView />` component (see Section 3) within a constrained container. Key difference: The toolbar might be simplified (e.g., no global search) to fit into a widget.
61
+
62
+
### `WidgetHtml`
63
+
**Type:**`html` / `markdown`
64
+
Renders static or dynamic content.
65
+
-**Props**: `content` (HTML/Markdown string).
66
+
67
+
---
68
+
69
+
## 3. View Architecture
6
70
7
-
The entry point for rendering any object view.
71
+
The system for rendering Object Data Collections. Can appear standalone (as a full page) or inside a Widget.
8
72
9
73
### `ObjectView`
10
74
The "Switchboard" component. It connects to the Metadata Registry, fetches the requested view definition (YAML), and renders the appropriate concrete View Component.
@@ -20,9 +84,9 @@ The "Switchboard" component. It connects to the Metadata Registry, fetches the r
20
84
21
85
---
22
86
23
-
## 2. Standard View Components
87
+
## 4. View Component Library
24
88
25
-
These "Smart Components" implement the specific logic for each View Type defined in the spec.
89
+
These "Smart Components" implement the specific logic for each View Type defined in `*.view.yml`.
26
90
27
91
### `ObjectGridView`
28
92
**Implements:**`type: list`, `type: grid`
@@ -103,9 +167,9 @@ A full-featured editor for creating or updating records.
103
167
104
168
---
105
169
106
-
## 3. Structural Components
170
+
## 5. Layout & Shell
107
171
108
-
Building blocks for the View layouts.
172
+
Building blocks for the outer application shell and view wrappers.
109
173
110
174
### `ViewToolbar`
111
175
The header bar rendered above any view.
@@ -124,7 +188,7 @@ A complex filter construction UI.
124
188
125
189
---
126
190
127
-
## 📝 4. Field Components
191
+
## 6. Field System
128
192
129
193
The `Field` component is the factory that decides which specific widget to render inside Forms, Cells, and Cards.
130
194
@@ -146,9 +210,9 @@ The `Field` component is the factory that decides which specific widget to rende
146
210
147
211
---
148
212
149
-
## 📊 5. Visualization Components
213
+
## 7. Visualization Primitives
150
214
151
-
Standard charting for Dashboards (`*.page.yml`).
215
+
Low-level charting components used by `WidgetChart`.
152
216
153
217
### `ChartAreaInteractive`
154
218
Interactive area chart for trends.
@@ -161,7 +225,7 @@ Donut/Pie chart for part-to-whole analysis.
161
225
162
226
---
163
227
164
-
## 🎨 6. Design System Primitives
228
+
## 8. UI Atoms
165
229
166
230
We strictly use **Tailwind CSS** and **Radix UI** (shadcn/ui) primitives.
0 commit comments