4-Layer Component Architecture (65 total components):
Layer 1: Primitives (30) - Pure UI building blocks
- Button, Input, Select, Table, Card, Badge, Modal, Checkbox, Radio,
Textarea, Pagination, Alert, Spinner, Tooltip, Dropdown, Tabs,
Breadcrumb, NavBar, Sidebar, Icon, Link
- 180 Storybook stories, unit tests 70%+ coverage
Layer 2: Typed Fields (12) - Domain-aware inputs with validation
- TextField, DateField, DateRangeField, TimeField, CurrencyField,
PercentageField, QuantityField, StatusField, SelectField,
MultiSelectField, CheckboxField, SearchField
- 108 Storybook stories, auto-formatting + validation
Layer 3: Domain Fields (12) - Business-specific components with lookups
- OrderLineField, InventoryField, VoucherLineField, ProductField,
CustomerField, SupplierField, GLAccountField, WarehouseField,
StockTransferField, PriceField, DiscountField, DateRangeFilterField
- 108 Storybook stories, inline API lookups + business rules
Layer 4: Business Composites (11) - Full CRUD workflows
- Order, OrderLine, Inventory, StockTransfer, Product, Customer,
Supplier, GLAccount, Voucher, User, Warehouse
- 55 Storybook stories + 116 E2E test scenarios (10-15 per entity)
Folder Structure: src/components/{primitives,fields/typed,fields/domain,composites}
Storybook: 451 total stories (180+108+108+55)
Testing: 50/30/20 pyramid (350 unit + 150 integration + 116 E2E)
Accessibility: WCAG 2.1 AA, axe-core 95+ validation per component
Design System: Tabler UI + Bootstrap 5 + custom overrides
Phase 1-4 Implementation Plan:
- Phase 1: Vite scaffold + Storybook 7.0 + ESLint
- Phase 2: Build 30 Primitives (180 stories)
- Phase 3: Build 24 Fields (216 stories) + Pinia stores + API client
- Phase 4: Build 11 Composites (55 stories) + 116 E2E tests + responsive
D4 Phase 0 deliverable status: COMPLETE
- D1: OpenAPI spec ✅
- D2: ADR-001 Monolithic SPA ✅
- D3: Database Schema v1 ✅
- D4: Component Taxonomy ✅
- D5: CLAUDE.md Integration ⏳
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
31 KiB
Component Taxonomy: 4-Layer Architecture for OMS·WMS·ERP SPA
Status: DRAFT (Phase 0, requires Figma finalization)
Date: 2026-07-26
Related: ADR-001 (Spec 65), OpenAPI (Spec 63)
Overview
Component Hierarchy: 4 layers, 65 total components across OMS/WMS/ERP domains
┌─────────────────────────────────────────────────────────────────┐
│ Layer 4: Business Composite (11 CRUD Workflows) │
│ └─ OrderForm, InventoryTransferWizard, VoucherEditor, etc. │
├─────────────────────────────────────────────────────────────────┤
│ Layer 3: Domain Fields (12 Domain-Specific Inputs) │
│ └─ OrderLineField, InventoryField, VoucherLineField, etc. │
├─────────────────────────────────────────────────────────────────┤
│ Layer 2: Typed Fields (12 Type-Safe Inputs) │
│ └─ TextField, DateField, CurrencyField, StatusField, etc. │
├─────────────────────────────────────────────────────────────────┤
│ Layer 1: Primitives (30 UI Building Blocks) │
│ └─ Button, Input, Select, Table, Card, Badge, etc. │
└─────────────────────────────────────────────────────────────────┘
Design System: Tabler UI (Bootstrap 5) + Storybook 7.0+
Layer 1: Primitive Components (30)
Purpose
Reusable UI elements with zero business logic, full accessibility (WCAG 2.1 AA), typed props, consistent behavior.
Folder Structure
src/components/primitives/
├─ Button/
│ ├─ ButtonBase.vue
│ ├─ ButtonBase.stories.ts
│ └─ ButtonBase.spec.ts
├─ Input/
│ ├─ InputBase.vue
│ ├─ InputBase.stories.ts
│ └─ InputBase.spec.ts
├─ Select/
│ ├─ SelectBase.vue
│ ├─ SelectBase.stories.ts
│ └─ SelectBase.spec.ts
├─ Table/
│ ├─ TableBase.vue
│ ├─ TableBase.stories.ts
│ └─ TableBase.spec.ts
├─ Card/
│ ├─ CardBase.vue
│ └─ CardBase.stories.ts
├─ Badge/
├─ Modal/
├─ Checkbox/
├─ Radio/
├─ Textarea/
├─ Pagination/
├─ Alert/
├─ Spinner/
├─ Tooltip/
├─ Dropdown/
├─ Tabs/
├─ Breadcrumb/
├─ NavBar/
├─ Sidebar/
├─ Icon/
└─ Link/
Component Specifications
| Component | Props | Events | A11y | Story | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ButtonBase | variant (primary/secondary/danger), size (sm/md/lg), disabled, loading | click | aria-label, focus-visible | 12 stories | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| InputBase | type (text/email/number), placeholder, value, disabled, error, required | input, change, blur | label + aria-describedby (error) | 8 stories | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SelectBase | options: Array<{value, label}>, value, disabled, multiple | change | aria-label, aria-expanded | 10 stories | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| TableBase | columns: Array<{key, header, sortable}>, data: any[], onSort | row-click, sort | semantic , scope
Total Layer 1: 30 components × 6 stories (avg) = 180 Storybook stories Layer 2: Typed Field Components (12)PurposeDomain-aware input fields with automatic validation, formatting, labels, and error messages. Props are strongly typed via TypeScript. Folder StructureComponent Specifications
TypeScript Interface Example (TextField): Total Layer 2: 12 components × 9 stories (avg) = 108 Storybook stories Layer 3: Domain Field Components (12)PurposeBusiness-domain-specific input components that compose Layer 2 fields, enforce business rules, and provide inline lookups (e.g., product autocomplete, customer search). Folder StructureComponent Specifications
Example: OrderLineField Props Total Layer 3: 12 components × 9 stories (avg) = 108 Storybook stories Layer 4: Business Composite Components (11)PurposeFull workflow components for CRUD operations (List, Create, Read, Edit, Delete). Each maps to one entity in the OpenAPI spec. Orchestrates state, validation, approval workflows, and audit trails. Folder StructureCRUD Template Pattern (ALL 11 follow same structure)Standard Workflow: Component Specifications (11 entities)1. Order (OMS)2. OrderLine (Nested in Order)3. Inventory (WMS)4. StockTransfer (WMS)5. Product (ERP Master)6. Customer (OMS Master)7. Supplier (ERP Master)8. GLAccount (ERP)9. Voucher (ERP GL Entry)10. User (Admin)11. Warehouse (WMS Master)Total Layer 4: 11 components × 5 stories (avg for CRUD workflows) + 50 E2E tests = 55 Storybook stories + 116 E2E scenarios Folder Structure (Complete)Storybook OrganizationStorybook File StructureStorybook NavigationStorybook Configuration (main.ts)Testing StrategyTest Distribution (Testing Pyramid — Principle 26)Unit Tests (Layer 1-3 components)
File: Integration Tests (Layer 4 composites)
File: E2E Tests (Full User Journeys)
File: Example E2E Test: Figma Design System (Specification)Color Palette (Tabler Base)
Typography
Component Sizes
Spacing (8px grid)
Interactive States
Accessibility Requirements (WCAG 2.1 AA)Per-Component Checklist
Automated Validation
Migration Path (Phase 1-4)Phase 1: Setup (Week 1-2)
Phase 2: Primitives (Week 3-4)
Phase 3: Typed + Domain Fields (Week 5-6)
Phase 4: Business Composites (Week 7-8)
Sign-Off
Document Version: 1.0 |