CODITECT UI Component Kit: Master Index
Version: 1.0
Design System: Atomic Design Methodology
Philosophy: Test-Driven, Modular, Composable
Overview
This kit provides Lego-like building blocks for constructing CODITECT admin interfaces. Each component is:
- ✅ Tested - With specs and validation rules
- ✅ Documented - With usage examples and variants
- ✅ Composable - Combines with other components
- ✅ Accessible - WCAG AA compliant
- ✅ Responsive - Mobile-first design
Atomic Design Hierarchy
Atoms (Basic building blocks)
├─ Molecules (Simple combinations)
│ ├─ Organisms (Complex UI sections)
│ │ └─ Templates (Page layouts)
│ │ └─ Pages (Real instances)
Component Inventory
Atoms (13 components)
Smallest UI elements - cannot be broken down further.
| Component | Purpose | Test Count | Variants | Status |
|---|---|---|---|---|
| Button | Primary actions | 8 | primary, secondary, danger, ghost, icon | ✅ Ready |
| Input | Text entry | 12 | text, email, password, search, error | ✅ Ready |
| Label | Form labels | 4 | default, required, optional, error | ✅ Ready |
| Badge | Status indicators | 6 | success, warning, error, info, count | ✅ Ready |
| Avatar | User representation | 5 | image, initials, icon, sizes | ✅ Ready |
| Icon | Visual symbols | 3 | sizes, colors, interactive | ✅ Ready |
| Dot | Status indicator | 4 | green, yellow, red, gray | ✅ Ready |
| ProgressBar | Visual progress | 5 | default, success, warning, error, indeterminate | ✅ Ready |
| Checkbox | Selection control | 7 | default, checked, disabled, indeterminate | ✅ Ready |
| Radio | Single selection | 5 | default, selected, disabled | ✅ Ready |
| Toggle | On/off switch | 6 | off, on, disabled | ✅ Ready |
| Spinner | Loading indicator | 4 | small, medium, large, colors | ✅ Ready |
| Divider | Visual separator | 3 | horizontal, vertical, text | ✅ Ready |
Molecules (11 components)
Combinations of atoms serving a specific function.
| Component | Atoms Used | Purpose | Test Count | Status |
|---|---|---|---|---|
| FormField | Label + Input + Error | Complete form control | 10 | ✅ Ready |
| SearchInput | Input + Icon + Clear | Search functionality | 8 | ✅ Ready |
| StatusIndicator | Dot + Label | Status display | 6 | ✅ Ready |
| ProgressIndicator | ProgressBar + Label + Percent | Progress display | 7 | ✅ Ready |
| AvatarGroup | Multiple Avatars | Team presence | 5 | ✅ Ready |
| ButtonGroup | Multiple Buttons | Action groups | 6 | ✅ Ready |
| TagList | Multiple Badges | Tag management | 7 | ✅ Ready |
| Breadcrumb | Links + Dividers | Navigation trail | 5 | ✅ Ready |
| Pagination | Buttons + Labels | Page navigation | 9 | ✅ Ready |
| EmptyState | Icon + Text + Button | No content state | 6 | ✅ Ready |
| Toast | Icon + Text + Close | Notification | 8 | ✅ Ready |
Organisms (9 components)
Complex UI sections combining multiple molecules.
| Component | Purpose | Molecules Used | Test Count | Status |
|---|---|---|---|---|
| Header | Top navigation | SearchInput, AvatarGroup, ButtonGroup | 12 | ✅ Ready |
| Card | Content container | StatusIndicator, ButtonGroup, AvatarGroup | 15 | ✅ Ready |
| Modal | Overlay dialog | Header, FormField, ButtonGroup | 18 | ✅ Ready |
| DataTable | Tabular data | Pagination, ButtonGroup, StatusIndicator | 20 | ✅ Ready |
| Form | Data collection | Multiple FormFields, ButtonGroup | 16 | ✅ Ready |
| KanbanColumn | Project status | Multiple Cards, ProgressIndicator | 14 | ✅ Ready |
| Sidebar | Side navigation | AvatarGroup, StatusIndicator, ButtonGroup | 10 | ✅ Ready |
| UserMenu | User dropdown | Avatar, ButtonGroup, Divider | 8 | ✅ Ready |
| FilterPanel | Data filtering | Multiple FormFields, ButtonGroup | 12 | ✅ Ready |
Templates (6 layouts)
Page structures without real content.
| Template | Organisms Used | Purpose | Variants | Status |
|---|---|---|---|---|
| DashboardGrid | Header + Cards | Entity overview | 2, 3, 4 column | ✅ Ready |
| DetailView | Header + Card + Sidebar | Entity detail | With/without sidebar | ✅ Ready |
| KanbanBoard | Header + KanbanColumns | Project management | 3, 4, 5 column | ✅ Ready |
| ListDetail | Header + DataTable | Browse entities | With/without filters | ✅ Ready |
| FormPage | Header + Form | Data entry | Single/multi-step | ✅ Ready |
| EmptyPage | Header + EmptyState | Onboarding | Various messages | ✅ Ready |
Quick Start Guide
1. Install Dependencies (Copy/Paste)
# If using npm
npm install react react-dom
# If using yarn
yarn add react react-dom
2. Copy Design Tokens
/* Copy to your root CSS file */
@import url('./design-tokens.css');
3. Import Components
// Import atoms
import { Button, Input, Badge } from './components/atoms';
// Import molecules
import { FormField, StatusIndicator } from './components/molecules';
// Import organisms
import { Card, Modal, Header } from './components/organisms';
// Import H.P.008-TEMPLATES
import { DashboardGrid, DetailView } from './components/H.P.008-TEMPLATES';
4. Compose Your UI
// Example: Simple dashboard
<DashboardGrid>
<Card
title="Active Projects"
status={<StatusIndicator status="success" label="Healthy" />}
footer={
<ButtonGroup>
<Button variant="primary">View All</Button>
<Button variant="ghost">Settings</Button>
</ButtonGroup>
}
>
<ProgressIndicator value={75} label="Overall Progress" />
</Card>
{/* More cards... */}
</DashboardGrid>
Testing Philosophy
Test-Driven Specifications
Every component includes:
- Unit Tests - Component renders correctly
- Visual Tests - Appearance matches design
- Interaction Tests - User actions work
- Accessibility Tests - WCAG compliance
- Integration Tests - Works with other components
Example Test Structure
describe('Button', () => {
describe('Rendering', () => {
test('renders with text')
test('renders with icon')
test('renders in disabled state')
});
describe('Interactions', () => {
test('calls onClick when clicked')
test('does not call onClick when disabled')
test('shows hover state')
});
describe('Accessibility', () => {
test('has correct ARIA attributes')
test('is keyboard navigable')
test('meets color contrast requirements')
});
describe('Variants', () => {
test('renders primary variant')
test('renders secondary variant')
test('renders danger variant')
});
});
Component Composition Examples
Example 1: Login Form
<Form onSubmit={handleLogin}>
<FormField
label="Email"
type="email"
placeholder="you@company.com"
required
/>
<FormField
label="Password"
type="password"
required
/>
<ButtonGroup>
<Button variant="primary" type="submit">Sign In</Button>
<Button variant="ghost" onClick={handleForgot}>Forgot Password?</Button>
</ButtonGroup>
</Form>
Example 2: Project Card
<Card
title="Website Redesign"
subtitle={<StatusIndicator status="success" label="Active" />}
metadata={
<>
<AvatarGroup users={teamMembers} max={3} />
<Badge variant="info">8 tasks</Badge>
</>
}
footer={
<>
<ProgressIndicator value={65} />
<ButtonGroup>
<Button variant="ghost" icon="eye">View</Button>
<Button variant="ghost" icon="settings">Settings</Button>
</ButtonGroup>
</>
}
>
<p>Redesign company website with new brand guidelines...</p>
</Card>
Example 3: Data Table with Actions
<DataTable
columns={[
{ key: 'name', header: 'Name', sortable: true },
{ key: 'status', header: 'Status', render: (val) => <StatusIndicator status={val} /> },
{ key: 'progress', header: 'Progress', render: (val) => <ProgressBar value={val} /> },
{ key: 'actions', header: '', render: (row) => (
<ButtonGroup>
<Button variant="ghost" icon="edit" onClick={() => handleEdit(row)} />
<Button variant="ghost" icon="delete" onClick={() => handleDelete(row)} />
</ButtonGroup>
)}
]}
data={projects}
pagination={{
page: 1,
pageSize: 10,
total: 47
}}
/>
File Structure
components/
├── atoms/
│ ├── Button/
│ │ ├── Button.jsx
│ │ ├── Button.test.js
│ │ ├── Button.stories.jsx
│ │ └── README.md
│ ├── Input/
│ ├── Badge/
│ └── ...
├── molecules/
│ ├── FormField/
│ ├── SearchInput/
│ └── ...
├── organisms/
│ ├── Header/
│ ├── Card/
│ └── ...
├── H.P.008-TEMPLATES/
│ ├── DashboardGrid/
│ ├── DetailView/
│ └── ...
└── index.js (exports all components)
design-tokens/
├── colors.css
├── typography.css
├── spacing.css
└── index.css (imports all)
tests/
├── unit/
├── integration/
├── visual/
└── accessibility/
docs/
├── getting-started.md
├── design-principles.md
├── component-guide.md
└── composition-patterns.md
Next Steps
- Explore Atoms - Start with basic building blocks
- Learn Molecules - Understand common combinations
- Study Organisms - See complex patterns
- Use Templates - Build pages quickly
- Customize - Adapt to your brand
Each component includes:
- Full implementation code
- Comprehensive tests
- Usage documentation
- Composition examples
- Accessibility notes
Start with the atoms - they're the foundation of everything else.