@@ -4,59 +4,29 @@ This directory contains comprehensive examples demonstrating the **UI Protocol**
44
55## 📚 What's Inside
66
7- This package contains three types of examples:
8-
9- 1 . ** Metadata Examples** (` src/*.examples.ts ` ) - JSON/TypeScript configurations defining UI structure
10- 2 . ** Custom Components** (` custom-components/ ` ) - React implementations of custom UI components
11- 3 . ** React Renderer** (` react-renderer/ ` ) - How to render UI metadata using React
12-
13- ### Metadata Examples (` src/ ` )
14-
15- These demonstrate all major UI components of the ObjectStack Protocol:
16-
17- ### 1. ** Views** (` view.examples.ts ` )
18- Different ways to display and interact with data:
19- - ** Grid View** : Traditional table/spreadsheet layout
20- - ** Kanban View** : Card-based workflow boards
21- - ** Calendar View** : Time-based event visualization
22- - ** Gantt View** : Project timeline visualization
23- - ** Custom Data Sources** : Using API providers and static data
24-
25- ### 2. ** Pages** (` page.examples.ts ` )
26- Component composition patterns inspired by Salesforce Lightning Pages:
27- - ** Record Pages** : Contextual layouts for viewing/editing records
28- - ** Home Pages** : Dashboard-style landing pages
29- - ** App Pages** : Custom application screens
30- - ** Component Regions** : Flexible layout templates
31-
32- ### 3. ** Dashboards** (` dashboard.examples.ts ` )
33- Analytics and metrics visualization:
34- - ** Widget Types** : Metrics, charts (bar, line, pie, donut, funnel), tables
35- - ** Filters** : Dynamic data filtering
36- - ** Layout Grid** : Responsive dashboard layouts
37- - ** Real-time Metrics** : KPIs and business intelligence
38-
39- ### 4. ** Actions** (` action.examples.ts ` )
40- User interactions and workflows:
41- - ** Button Actions** : Custom buttons with various triggers
42- - ** Modal Actions** : Forms and dialogs
43- - ** Flow Actions** : Visual workflow execution
44- - ** Script Actions** : Custom JavaScript execution
45- - ** Batch Actions** : Mass operations on records
46-
47- ### 5. ** Apps** (` app.examples.ts ` )
48- Complete application structure:
49- - ** Navigation Trees** : Hierarchical menus with groups
50- - ** App Branding** : Custom colors, logos, themes
51- - ** Multi-app Architecture** : Switching between business contexts
52- - ** Permission-based Access** : Role-based app visibility
53-
54- ### 6. ** Themes** (` theme.examples.ts ` )
55- Visual styling and customization:
56- - ** Color Palettes** : Primary, secondary, accent colors
57- - ** Typography** : Font families and sizing
58- - ** Component Styles** : Button variants, borders, shadows
59- - ** Dark Mode** : Theme switching
7+ This package contains three sub-packages demonstrating different aspects of the UI Protocol:
8+
9+ ### 1. ** Metadata Examples** (` metadata-examples/ ` )
10+ TypeScript/JSON configurations defining UI structure - the "what" of the UI:
11+ - ** view.examples.ts** - Grid, Kanban, Calendar, Gantt views
12+ - ** page.examples.ts** - Record, Home, App pages
13+ - ** dashboard.examples.ts** - Analytics dashboards with widgets
14+ - ** action.examples.ts** - User interactions and workflows
15+ - ** app.examples.ts** - Complete application structures
16+ - ** theme.examples.ts** - Visual styling and theming
17+
18+ ### 2. ** Custom Components** (` custom-components/ ` )
19+ React implementations showing how to build custom UI components:
20+ - CustomButton - Flexible button with variants and theming
21+ - CustomDataGrid - Advanced grid with sorting, filtering, pagination
22+ - Component registration system
23+
24+ ### 3. ** React Renderer** (` react-renderer/ ` )
25+ Shows how to render UI metadata using React - the "how" of the UI:
26+ - PageRenderer - Renders Page metadata
27+ - ComponentRenderer - Renders individual components
28+ - Template expression resolver for data binding
29+ - Complete integration examples
6030
6131## 🎯 Key Concepts
6232
@@ -265,51 +235,56 @@ navigation: [
265235]
266236```
267237
268- ## 📝 File Structure
238+ ## 📝 Directory Structure
269239
270240```
271241examples/ui/
272- ├── package.json # Package configuration
273- ├── tsconfig.json # TypeScript configuration
274242├── README.md # This file
275- ├── src/ # Metadata examples (JSON/TypeScript)
276- │ ├── view.examples.ts # List, Form, Kanban, Calendar views
277- │ ├── page.examples.ts # Record, Home, App pages
278- │ ├── dashboard.examples.ts # Widgets and analytics
279- │ ├── action.examples.ts # Buttons and interactions
280- │ ├── app.examples.ts # Application structure
281- │ └── theme.examples.ts # Visual styling
243+ ├── metadata-examples/ # UI metadata configurations
244+ │ ├── README.md
245+ │ ├── package.json
246+ │ ├── tsconfig.json
247+ │ └── src/
248+ │ ├── view.examples.ts # List, Form, Kanban, Calendar views
249+ │ ├── page.examples.ts # Record, Home, App pages
250+ │ ├── dashboard.examples.ts # Widgets and analytics
251+ │ ├── action.examples.ts # Buttons and interactions
252+ │ ├── app.examples.ts # Application structure
253+ │ └── theme.examples.ts # Visual styling
282254├── custom-components/ # React component implementations
283255│ ├── README.md
284- │ ├── src/
285- │ │ ├── components/
286- │ │ │ ├── CustomButton.tsx
287- │ │ │ └── CustomDataGrid.tsx
288- │ │ └── registry.ts # Component registration
289- │ └── package.json
256+ │ ├── package.json
257+ │ ├── tsconfig.json
258+ │ └── src/
259+ │ ├── components/
260+ │ │ ├── CustomButton.tsx
261+ │ │ └── CustomDataGrid.tsx
262+ │ └── registry.ts # Component registration
290263└── react-renderer/ # React renderer for metadata
291264 ├── README.md
292- ├── src/
293- │ ├── renderers/
294- │ │ ├── PageRenderer.tsx
295- │ │ └── ComponentRenderer.tsx
296- │ ├── utils/
297- │ │ └── templateResolver.ts
298- │ └── examples/
299- │ └── SimpleApp.tsx
300- └── package.json
265+ ├── package.json
266+ ├── tsconfig.json
267+ └── src/
268+ ├── renderers/
269+ │ ├── PageRenderer.tsx
270+ │ └── ComponentRenderer.tsx
271+ ├── utils/
272+ │ └── templateResolver.ts
273+ └── examples/
274+ └── SimpleApp.tsx
301275```
302276
303277## 🚀 Quick Start
304278
305279### 1. View Metadata Examples
306280
307- The TypeScript examples in ` src/ ` show the metadata structure :
281+ Explore the TypeScript metadata configurations :
308282
309283``` bash
310- # These are TypeScript files that demonstrate the protocol
311- cat src/view.examples.ts
312- cat src/app.examples.ts
284+ cd metadata-examples
285+ npm install
286+ npm run build
287+ # View the examples in src/
313288```
314289
315290### 2. Custom Components
0 commit comments