mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-05-07 03:59:35 +00:00
Organisms
Complex UI sections that combine atoms and molecules into complete features. Built on Material UI.
Layout Components
| Component | Description |
|---|---|
Table |
Data table with header/body/footer |
Command |
Command palette (cmdk-style) |
Sheet |
Side panel drawer |
Sidebar |
Navigation sidebar with groups |
NavigationMenu |
Top navigation with dropdowns |
Form |
Form with react-hook-form integration |
Feature Components
Core Builders
SchemaEditor- Full schema editing interfaceComponentCatalog- Component browsing and selectionPropertyInspector- Component property editorBuilder- Visual page builder with drag-and-dropCanvas- Rendering canvas for visual builder
Configuration Managers
CssClassBuilder- Visual CSS class selectionThemeEditor- Theme customization interfaceSMTPConfigEditor- SMTP configuration form
Code Editors
CodeEditor- Monaco-based code editorLuaEditor- Lua script editorJsonEditor- JSON editing with validationNerdModeIDE- Full-featured IDE panel
Data Management
DatabaseManager- Database managementUserManagement- User CRUD interfacePackageManager- Package managementAuditLogViewer- Audit log display
Security Components
SecurityWarningDialog- Security scan results dialog with severity classification
Usage
import {
Table, TableHeader, TableBody, TableRow, TableCell,
Sidebar, SidebarHeader, SidebarContent,
UserManagement
} from '@/components/organisms'
function AdminPanel() {
return (
<Box sx={{ display: 'flex', height: '100vh' }}>
<Sidebar width={280}>
<SidebarHeader>Admin</SidebarHeader>
<SidebarContent>
<SidebarGroup label="Users">
<SidebarMenuItem icon={<PeopleIcon />}>Users</SidebarMenuItem>
</SidebarGroup>
</SidebarContent>
</Sidebar>
<Box sx={{ flex: 1, p: 3 }}>
<Table>
<TableHeader>
<TableRow>
<TableHead>Name</TableHead>
<TableHead>Status</TableHead>
</TableRow>
</TableHeader>
<TableBody>
{users.map(user => (
<TableRow key={user.id}>
<TableCell>{user.name}</TableCell>
<TableCell>{user.status}</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</Box>
</Box>
)
}
Rules
- ✅ DO compose organisms from molecules and atoms
- ✅ DO include business logic when needed
- ✅ DO handle data fetching and state management
- ✅ DO use MUI
sxprop for styling - ❌ DON'T use Tailwind classes
- ❌ DON'T create organisms that are too granular (use molecules)
Testing
describe('UserManagement', () => {
it('allows creating new users', async () => {
render(<UserManagement />)
await userEvent.click(screen.getByRole('button', { name: /add user/i }))
await userEvent.type(screen.getByLabelText(/username/i), 'newuser')
await userEvent.click(screen.getByRole('button', { name: /save/i }))
expect(screen.getByText('newuser')).toBeInTheDocument()
})
})