Skip to content

Commit ade388b

Browse files
Copilothotlong
andcommitted
Fix table component errors: replace with layout-based table UI to avoid SchemaRendererContext issues
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent fef1e1a commit ade388b

5 files changed

Lines changed: 249 additions & 58 deletions

File tree

content/docs/blocks/block-schema.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ BlockSchema enables:
8686
spacing: 3,
8787
className: "items-center text-center p-4",
8888
children: [
89-
{ type: "div", className: "w-12 h-12 rounded-lg bg-purple-500/10 flex items-center justify-center", children: [{ type: "icon", name: "BarChart3", className: "h-6 w-6 text-purple-600" }] },
89+
{ type: "div", className: "w-12 h-12 rounded-lg bg-purple-500/10 flex items-center justify-center", children: [{ type: "icon", name: "chart-column", className: "h-6 w-6 text-purple-600" }] },
9090
{ type: "text", content: "Advanced Analytics", className: "text-lg font-semibold" },
9191
{ type: "text", content: "Real-time dashboards and custom report builder included.", className: "text-sm text-muted-foreground" },
9292
{ type: "button", label: "View Demo", variant: "outline", size: "sm" }

content/docs/core/report-schema.mdx

Lines changed: 63 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -117,19 +117,69 @@ ReportSchema provides:
117117
]
118118
},
119119
{
120-
type: "table",
121-
columns: [
122-
{ header: "Region", accessorKey: "region" },
123-
{ header: "Revenue", accessorKey: "revenue" },
124-
{ header: "Orders", accessorKey: "orders" },
125-
{ header: "Growth", accessorKey: "growth" }
126-
],
127-
data: [
128-
{ region: "North America", revenue: "$125,400", orders: "824", growth: "+15.2%" },
129-
{ region: "Europe", revenue: "$89,200", orders: "562", growth: "+10.8%" },
130-
{ region: "Asia Pacific", revenue: "$42,300", orders: "298", growth: "+22.1%" },
131-
{ region: "Latin America", revenue: "$18,600", orders: "108", growth: "+5.4%" },
132-
{ region: "Middle East", revenue: "$9,000", orders: "50", growth: "+18.7%" }
120+
type: "stack",
121+
spacing: 0,
122+
children: [
123+
{
124+
type: "flex",
125+
className: "items-center gap-4 px-4 py-2 bg-muted text-xs font-medium text-muted-foreground border-b",
126+
children: [
127+
{ type: "text", content: "Region", className: "w-36" },
128+
{ type: "text", content: "Revenue", className: "w-24" },
129+
{ type: "text", content: "Orders", className: "w-20" },
130+
{ type: "text", content: "Growth", className: "w-20" }
131+
]
132+
},
133+
{
134+
type: "flex",
135+
className: "items-center gap-4 px-4 py-3 border-b text-sm",
136+
children: [
137+
{ type: "text", content: "North America", className: "w-36 font-medium" },
138+
{ type: "text", content: "$125,400", className: "w-24" },
139+
{ type: "text", content: "824", className: "w-20" },
140+
{ type: "text", content: "+15.2%", className: "w-20 text-green-600" }
141+
]
142+
},
143+
{
144+
type: "flex",
145+
className: "items-center gap-4 px-4 py-3 border-b text-sm",
146+
children: [
147+
{ type: "text", content: "Europe", className: "w-36 font-medium" },
148+
{ type: "text", content: "$89,200", className: "w-24" },
149+
{ type: "text", content: "562", className: "w-20" },
150+
{ type: "text", content: "+10.8%", className: "w-20 text-green-600" }
151+
]
152+
},
153+
{
154+
type: "flex",
155+
className: "items-center gap-4 px-4 py-3 border-b text-sm",
156+
children: [
157+
{ type: "text", content: "Asia Pacific", className: "w-36 font-medium" },
158+
{ type: "text", content: "$42,300", className: "w-24" },
159+
{ type: "text", content: "298", className: "w-20" },
160+
{ type: "text", content: "+22.1%", className: "w-20 text-green-600" }
161+
]
162+
},
163+
{
164+
type: "flex",
165+
className: "items-center gap-4 px-4 py-3 border-b text-sm",
166+
children: [
167+
{ type: "text", content: "Latin America", className: "w-36 font-medium" },
168+
{ type: "text", content: "$18,600", className: "w-24" },
169+
{ type: "text", content: "108", className: "w-20" },
170+
{ type: "text", content: "+5.4%", className: "w-20 text-green-600" }
171+
]
172+
},
173+
{
174+
type: "flex",
175+
className: "items-center gap-4 px-4 py-3 text-sm",
176+
children: [
177+
{ type: "text", content: "Middle East", className: "w-36 font-medium" },
178+
{ type: "text", content: "$9,000", className: "w-24" },
179+
{ type: "text", content: "50", className: "w-20" },
180+
{ type: "text", content: "+18.7%", className: "w-20 text-green-600" }
181+
]
182+
}
133183
]
134184
}
135185
]

content/docs/plugins/plugin-dashboard.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ npm install @object-ui/plugin-dashboard
132132
type: "metric-card",
133133
title: "Resolution Rate",
134134
value: "94%",
135-
icon: "check-circle",
135+
icon: "circle-check",
136136
trend: "up",
137137
trendValue: "+3%",
138138
description: "vs last week"

content/docs/plugins/plugin-grid.mdx

Lines changed: 130 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,82 @@ npm install @object-ui/plugin-grid
3030
type: "flex",
3131
className: "gap-2",
3232
children: [
33-
{ type: "button", label: "Filter", variant: "outline", size: "sm", icon: "Filter" },
34-
{ type: "button", label: "Export", variant: "outline", size: "sm", icon: "Download" }
33+
{ type: "button", label: "Filter", variant: "outline", size: "sm", icon: "filter" },
34+
{ type: "button", label: "Export", variant: "outline", size: "sm", icon: "download" }
3535
]
3636
}
3737
]
3838
},
3939
{
40-
type: "table",
41-
columns: [
42-
{ header: "Product", accessorKey: "product" },
43-
{ header: "SKU", accessorKey: "sku" },
44-
{ header: "Price", accessorKey: "price" },
45-
{ header: "Stock", accessorKey: "stock" },
46-
{ header: "Status", accessorKey: "status" }
47-
],
48-
data: [
49-
{ product: "Wireless Mouse", sku: "WM-001", price: "$29.99", stock: "150", status: "In Stock" },
50-
{ product: "Mechanical Keyboard", sku: "MK-002", price: "$89.99", stock: "42", status: "Low Stock" },
51-
{ product: "USB-C Hub", sku: "UH-003", price: "$45.00", stock: "200", status: "In Stock" },
52-
{ product: "Monitor Stand", sku: "MS-004", price: "$35.00", stock: "0", status: "Out of Stock" },
53-
{ product: "Webcam HD", sku: "WC-005", price: "$65.00", stock: "88", status: "In Stock" }
40+
type: "stack",
41+
spacing: 0,
42+
children: [
43+
{
44+
type: "flex",
45+
className: "items-center gap-4 px-4 py-2 bg-muted text-xs font-medium text-muted-foreground border-b",
46+
children: [
47+
{ type: "text", content: "Product", className: "w-40" },
48+
{ type: "text", content: "SKU", className: "w-24" },
49+
{ type: "text", content: "Price", className: "w-20" },
50+
{ type: "text", content: "Stock", className: "w-16" },
51+
{ type: "text", content: "Status", className: "w-24" }
52+
]
53+
},
54+
{
55+
type: "flex",
56+
className: "items-center gap-4 px-4 py-3 border-b text-sm",
57+
children: [
58+
{ type: "text", content: "Wireless Mouse", className: "w-40 font-medium" },
59+
{ type: "text", content: "WM-001", className: "w-24 text-muted-foreground" },
60+
{ type: "text", content: "$29.99", className: "w-20" },
61+
{ type: "text", content: "150", className: "w-16" },
62+
{ type: "badge", label: "In Stock", variant: "default" }
63+
]
64+
},
65+
{
66+
type: "flex",
67+
className: "items-center gap-4 px-4 py-3 border-b text-sm",
68+
children: [
69+
{ type: "text", content: "Mechanical Keyboard", className: "w-40 font-medium" },
70+
{ type: "text", content: "MK-002", className: "w-24 text-muted-foreground" },
71+
{ type: "text", content: "$89.99", className: "w-20" },
72+
{ type: "text", content: "42", className: "w-16" },
73+
{ type: "badge", label: "Low Stock", variant: "outline" }
74+
]
75+
},
76+
{
77+
type: "flex",
78+
className: "items-center gap-4 px-4 py-3 border-b text-sm",
79+
children: [
80+
{ type: "text", content: "USB-C Hub", className: "w-40 font-medium" },
81+
{ type: "text", content: "UH-003", className: "w-24 text-muted-foreground" },
82+
{ type: "text", content: "$45.00", className: "w-20" },
83+
{ type: "text", content: "200", className: "w-16" },
84+
{ type: "badge", label: "In Stock", variant: "default" }
85+
]
86+
},
87+
{
88+
type: "flex",
89+
className: "items-center gap-4 px-4 py-3 border-b text-sm",
90+
children: [
91+
{ type: "text", content: "Monitor Stand", className: "w-40 font-medium" },
92+
{ type: "text", content: "MS-004", className: "w-24 text-muted-foreground" },
93+
{ type: "text", content: "$35.00", className: "w-20" },
94+
{ type: "text", content: "0", className: "w-16" },
95+
{ type: "badge", label: "Out of Stock", variant: "destructive" }
96+
]
97+
},
98+
{
99+
type: "flex",
100+
className: "items-center gap-4 px-4 py-3 text-sm",
101+
children: [
102+
{ type: "text", content: "Webcam HD", className: "w-40 font-medium" },
103+
{ type: "text", content: "WC-005", className: "w-24 text-muted-foreground" },
104+
{ type: "text", content: "$65.00", className: "w-20" },
105+
{ type: "text", content: "88", className: "w-16" },
106+
{ type: "badge", label: "In Stock", variant: "default" }
107+
]
108+
}
54109
]
55110
}
56111
]
@@ -68,23 +123,68 @@ npm install @object-ui/plugin-grid
68123
className: "items-center justify-between mb-4",
69124
children: [
70125
{ type: "text", content: "Team Members", className: "text-lg font-semibold" },
71-
{ type: "button", label: "Invite Member", variant: "default", size: "sm", icon: "UserPlus" }
126+
{ type: "button", label: "Invite Member", variant: "default", size: "sm", icon: "user-plus" }
72127
]
73128
},
74129
{
75-
type: "table",
76-
columns: [
77-
{ header: "Name", accessorKey: "name" },
78-
{ header: "Role", accessorKey: "role" },
79-
{ header: "Department", accessorKey: "department" },
80-
{ header: "Status", accessorKey: "status" },
81-
{ header: "Last Active", accessorKey: "lastActive" }
82-
],
83-
data: [
84-
{ name: "Sarah Chen", role: "Lead Engineer", department: "Engineering", status: "Online", lastActive: "Just now" },
85-
{ name: "Marcus Rodriguez", role: "Designer", department: "Design", status: "Online", lastActive: "2m ago" },
86-
{ name: "Emily Watson", role: "PM", department: "Product", status: "Away", lastActive: "1h ago" },
87-
{ name: "James Kim", role: "DevOps", department: "Engineering", status: "Offline", lastActive: "3h ago" }
130+
type: "stack",
131+
spacing: 0,
132+
children: [
133+
{
134+
type: "flex",
135+
className: "items-center gap-4 px-4 py-2 bg-muted text-xs font-medium text-muted-foreground border-b",
136+
children: [
137+
{ type: "text", content: "Name", className: "w-40" },
138+
{ type: "text", content: "Role", className: "w-32" },
139+
{ type: "text", content: "Department", className: "w-28" },
140+
{ type: "text", content: "Status", className: "w-20" },
141+
{ type: "text", content: "Last Active", className: "w-24" }
142+
]
143+
},
144+
{
145+
type: "flex",
146+
className: "items-center gap-4 px-4 py-3 border-b text-sm",
147+
children: [
148+
{ type: "text", content: "Sarah Chen", className: "w-40 font-medium" },
149+
{ type: "text", content: "Lead Engineer", className: "w-32" },
150+
{ type: "text", content: "Engineering", className: "w-28 text-muted-foreground" },
151+
{ type: "badge", label: "Online", variant: "default", className: "w-20" },
152+
{ type: "text", content: "Just now", className: "w-24 text-xs text-muted-foreground" }
153+
]
154+
},
155+
{
156+
type: "flex",
157+
className: "items-center gap-4 px-4 py-3 border-b text-sm",
158+
children: [
159+
{ type: "text", content: "Marcus Rodriguez", className: "w-40 font-medium" },
160+
{ type: "text", content: "Designer", className: "w-32" },
161+
{ type: "text", content: "Design", className: "w-28 text-muted-foreground" },
162+
{ type: "badge", label: "Online", variant: "default", className: "w-20" },
163+
{ type: "text", content: "2m ago", className: "w-24 text-xs text-muted-foreground" }
164+
]
165+
},
166+
{
167+
type: "flex",
168+
className: "items-center gap-4 px-4 py-3 border-b text-sm",
169+
children: [
170+
{ type: "text", content: "Emily Watson", className: "w-40 font-medium" },
171+
{ type: "text", content: "PM", className: "w-32" },
172+
{ type: "text", content: "Product", className: "w-28 text-muted-foreground" },
173+
{ type: "badge", label: "Away", variant: "secondary", className: "w-20" },
174+
{ type: "text", content: "1h ago", className: "w-24 text-xs text-muted-foreground" }
175+
]
176+
},
177+
{
178+
type: "flex",
179+
className: "items-center gap-4 px-4 py-3 text-sm",
180+
children: [
181+
{ type: "text", content: "James Kim", className: "w-40 font-medium" },
182+
{ type: "text", content: "DevOps", className: "w-32" },
183+
{ type: "text", content: "Engineering", className: "w-28 text-muted-foreground" },
184+
{ type: "badge", label: "Offline", variant: "outline", className: "w-20" },
185+
{ type: "text", content: "3h ago", className: "w-24 text-xs text-muted-foreground" }
186+
]
187+
}
88188
]
89189
}
90190
]

content/docs/plugins/plugin-view.mdx

Lines changed: 54 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,63 @@ npm install @object-ui/plugin-view
2828
className: "items-center justify-between mb-4",
2929
children: [
3030
{ type: "text", content: "Users", className: "text-lg font-semibold" },
31-
{ type: "button", label: "Add User", variant: "default", size: "sm", icon: "Plus" }
31+
{ type: "button", label: "Add User", variant: "default", size: "sm", icon: "plus" }
3232
]
3333
},
3434
{
35-
type: "table",
36-
columns: [
37-
{ header: "Name", accessorKey: "name" },
38-
{ header: "Email", accessorKey: "email" },
39-
{ header: "Role", accessorKey: "role" },
40-
{ header: "Status", accessorKey: "status" }
41-
],
42-
data: [
43-
{ name: "Alice Johnson", email: "alice@example.com", role: "Admin", status: "Active" },
44-
{ name: "Bob Smith", email: "bob@example.com", role: "Editor", status: "Active" },
45-
{ name: "Carol White", email: "carol@example.com", role: "Viewer", status: "Inactive" },
46-
{ name: "David Lee", email: "david@example.com", role: "Editor", status: "Active" }
35+
type: "stack",
36+
spacing: 0,
37+
children: [
38+
{
39+
type: "flex",
40+
className: "items-center gap-4 px-4 py-2 bg-muted text-xs font-medium text-muted-foreground border-b",
41+
children: [
42+
{ type: "text", content: "Name", className: "w-36" },
43+
{ type: "text", content: "Email", className: "w-48" },
44+
{ type: "text", content: "Role", className: "w-24" },
45+
{ type: "text", content: "Status", className: "w-20" }
46+
]
47+
},
48+
{
49+
type: "flex",
50+
className: "items-center gap-4 px-4 py-3 border-b text-sm",
51+
children: [
52+
{ type: "text", content: "Alice Johnson", className: "w-36 font-medium" },
53+
{ type: "text", content: "alice@example.com", className: "w-48 text-muted-foreground" },
54+
{ type: "text", content: "Admin", className: "w-24" },
55+
{ type: "badge", label: "Active", variant: "default" }
56+
]
57+
},
58+
{
59+
type: "flex",
60+
className: "items-center gap-4 px-4 py-3 border-b text-sm",
61+
children: [
62+
{ type: "text", content: "Bob Smith", className: "w-36 font-medium" },
63+
{ type: "text", content: "bob@example.com", className: "w-48 text-muted-foreground" },
64+
{ type: "text", content: "Editor", className: "w-24" },
65+
{ type: "badge", label: "Active", variant: "default" }
66+
]
67+
},
68+
{
69+
type: "flex",
70+
className: "items-center gap-4 px-4 py-3 border-b text-sm",
71+
children: [
72+
{ type: "text", content: "Carol White", className: "w-36 font-medium" },
73+
{ type: "text", content: "carol@example.com", className: "w-48 text-muted-foreground" },
74+
{ type: "text", content: "Viewer", className: "w-24" },
75+
{ type: "badge", label: "Inactive", variant: "secondary" }
76+
]
77+
},
78+
{
79+
type: "flex",
80+
className: "items-center gap-4 px-4 py-3 text-sm",
81+
children: [
82+
{ type: "text", content: "David Lee", className: "w-36 font-medium" },
83+
{ type: "text", content: "david@example.com", className: "w-48 text-muted-foreground" },
84+
{ type: "text", content: "Editor", className: "w-24" },
85+
{ type: "badge", label: "Active", variant: "default" }
86+
]
87+
}
4788
]
4889
}
4990
]

0 commit comments

Comments
 (0)