@polymorphism-tech/morph-spec 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/CLAUDE.md +314 -1730
  2. package/LICENSE +72 -72
  3. package/README.md +515 -516
  4. package/bin/detect-agents.js +225 -225
  5. package/bin/morph-spec.js +358 -294
  6. package/bin/render-template.js +302 -302
  7. package/bin/semantic-detect-agents.js +246 -246
  8. package/bin/task-manager.js +429 -368
  9. package/bin/validate-agents-skills.js +251 -251
  10. package/bin/validate-agents.js +69 -69
  11. package/bin/validate-phase.js +263 -263
  12. package/bin/validate.js +369 -268
  13. package/content/.azure/README.md +293 -293
  14. package/content/.azure/docs/azure-devops-setup.md +454 -454
  15. package/content/.azure/docs/branch-strategy.md +398 -398
  16. package/content/.azure/docs/local-development.md +515 -515
  17. package/content/.azure/pipelines/pipeline-variables.yml +34 -34
  18. package/content/.azure/pipelines/prod-pipeline.yml +319 -319
  19. package/content/.azure/pipelines/staging-pipeline.yml +234 -234
  20. package/content/.azure/pipelines/templates/build-dotnet.yml +75 -75
  21. package/content/.azure/pipelines/templates/deploy-app-service.yml +94 -94
  22. package/content/.azure/pipelines/templates/deploy-container-app.yml +120 -120
  23. package/content/.azure/pipelines/templates/infra-deploy.yml +90 -90
  24. package/content/.claude/commands/morph-apply.md +221 -158
  25. package/content/.claude/commands/morph-archive.md +79 -79
  26. package/content/.claude/commands/morph-infra.md +209 -209
  27. package/content/.claude/commands/morph-preflight.md +227 -0
  28. package/content/.claude/commands/morph-proposal.md +122 -101
  29. package/content/.claude/commands/morph-status.md +86 -86
  30. package/content/.claude/commands/morph-troubleshoot.md +122 -0
  31. package/content/.claude/settings.local.json +15 -15
  32. package/content/.claude/skills/checklists/code-review.md +226 -0
  33. package/content/.claude/skills/checklists/morph-checklist.md +117 -0
  34. package/content/.claude/skills/checklists/simulation-checklist.md +77 -0
  35. package/content/.claude/skills/infra/bicep-architect.md +126 -419
  36. package/content/.claude/skills/infra/container-specialist.md +131 -437
  37. package/content/.claude/skills/infra/devops-engineer.md +119 -405
  38. package/content/.claude/skills/integrations/asaas-financial.md +130 -333
  39. package/content/.claude/skills/integrations/azure-identity.md +142 -309
  40. package/content/.claude/skills/integrations/clerk-auth.md +108 -290
  41. package/content/.claude/skills/integrations/resend-email.md +119 -0
  42. package/content/.claude/skills/specialists/ai-system-architect.md +192 -604
  43. package/content/.claude/skills/specialists/azure-architect.md +142 -142
  44. package/content/.claude/skills/specialists/code-analyzer.md +235 -0
  45. package/content/.claude/skills/specialists/dotnet-senior.md +287 -0
  46. package/content/.claude/skills/specialists/ef-modeler.md +113 -211
  47. package/content/.claude/skills/specialists/hangfire-orchestrator.md +126 -255
  48. package/content/.claude/skills/specialists/ms-agent-expert.md +109 -263
  49. package/content/.claude/skills/specialists/po-pm-advisor.md +197 -197
  50. package/content/.claude/skills/specialists/standards-architect.md +156 -78
  51. package/content/.claude/skills/specialists/testing-specialist.md +126 -0
  52. package/content/.claude/skills/specialists/ui-ux-designer.md +191 -1100
  53. package/content/.claude/skills/stacks/dotnet-blazor.md +210 -606
  54. package/content/.claude/skills/stacks/dotnet-nextjs.md +154 -402
  55. package/content/.claude/skills/workflows/morph-replicate.md +213 -0
  56. package/content/.claude/{commands/morph-clarify.md → skills/workflows/phase-clarify.md} +5 -58
  57. package/content/.claude/{commands/morph-design.md → skills/workflows/phase-design.md} +16 -86
  58. package/content/.claude/{commands/morph-setup.md → skills/workflows/phase-setup.md} +9 -17
  59. package/content/.claude/skills/workflows/phase-tasks.md +164 -0
  60. package/content/.claude/{commands/morph-uiux.md → skills/workflows/phase-uiux.md} +15 -88
  61. package/content/.morph/.morphversion +5 -5
  62. package/content/.morph/archive/.gitkeep +25 -25
  63. package/content/.morph/config/agents.json +378 -242
  64. package/content/.morph/config/config.template.json +89 -108
  65. package/content/.morph/docs/STORY-DRIVEN-DEVELOPMENT.md +392 -392
  66. package/content/.morph/docs/workflows/design-impl.md +37 -0
  67. package/content/.morph/docs/workflows/fast-track.md +29 -0
  68. package/content/.morph/docs/workflows/full-morph.md +76 -0
  69. package/content/.morph/docs/workflows/standard.md +44 -0
  70. package/content/.morph/docs/workflows/ui-refresh.md +39 -0
  71. package/content/.morph/examples/api-nextjs/README.md +241 -241
  72. package/content/.morph/examples/api-nextjs/contracts.ts +307 -307
  73. package/content/.morph/examples/api-nextjs/spec.md +399 -399
  74. package/content/.morph/examples/api-nextjs/tasks.md +168 -168
  75. package/content/.morph/examples/micro-saas/README.md +125 -125
  76. package/content/.morph/examples/micro-saas/contracts.cs +358 -358
  77. package/content/.morph/examples/micro-saas/decisions.md +246 -246
  78. package/content/.morph/examples/micro-saas/spec.md +236 -236
  79. package/content/.morph/examples/micro-saas/tasks.md +150 -150
  80. package/content/.morph/examples/multi-agent/README.md +309 -309
  81. package/content/.morph/examples/multi-agent/contracts.cs +433 -433
  82. package/content/.morph/examples/multi-agent/spec.md +479 -479
  83. package/content/.morph/examples/multi-agent/tasks.md +185 -185
  84. package/content/.morph/examples/scheduled-reports/decisions.md +158 -0
  85. package/content/.morph/examples/scheduled-reports/proposal.md +95 -0
  86. package/content/.morph/examples/scheduled-reports/spec.md +267 -0
  87. package/content/.morph/examples/state-v3.json +188 -188
  88. package/content/.morph/features/.gitkeep +25 -25
  89. package/content/.morph/hooks/README.md +190 -239
  90. package/content/.morph/hooks/pre-commit-agents.sh +24 -24
  91. package/content/.morph/hooks/pre-commit-all.sh +48 -48
  92. package/content/.morph/hooks/pre-commit-specs.sh +49 -49
  93. package/content/.morph/hooks/pre-commit-tests.sh +60 -60
  94. package/content/.morph/project.md +160 -160
  95. package/content/.morph/schemas/agent.schema.json +296 -296
  96. package/content/.morph/schemas/tasks.schema.json +220 -0
  97. package/content/.morph/specs/.gitkeep +20 -20
  98. package/content/.morph/standards/agent-framework-blazor-ui.md +359 -0
  99. package/content/.morph/standards/agent-framework-production.md +410 -0
  100. package/content/.morph/standards/agent-framework-setup.md +413 -453
  101. package/content/.morph/standards/agent-framework-workflows.md +349 -0
  102. package/content/.morph/standards/architecture.md +325 -325
  103. package/content/.morph/standards/azure.md +605 -379
  104. package/content/.morph/standards/coding.md +377 -377
  105. package/content/.morph/standards/dotnet10-migration.md +520 -494
  106. package/content/.morph/standards/fluent-ui-setup.md +590 -590
  107. package/content/.morph/standards/migration-guide.md +514 -514
  108. package/content/.morph/standards/passkeys-auth.md +423 -423
  109. package/content/.morph/standards/vector-search-rag.md +536 -536
  110. package/content/.morph/state.json +17 -17
  111. package/content/.morph/templates/FluentDesignTheme.cs +149 -149
  112. package/content/.morph/templates/MudTheme.cs +281 -281
  113. package/content/.morph/templates/agent.cs +163 -172
  114. package/content/.morph/templates/clarify-questions.md +159 -0
  115. package/content/.morph/templates/component.razor +239 -239
  116. package/content/.morph/templates/contracts/Commands.cs +74 -0
  117. package/content/.morph/templates/contracts/Entities.cs +25 -0
  118. package/content/.morph/templates/contracts/Queries.cs +74 -0
  119. package/content/.morph/templates/contracts/README.md +74 -0
  120. package/content/.morph/templates/contracts.cs +217 -217
  121. package/content/.morph/templates/decisions.md +123 -106
  122. package/content/.morph/templates/design-system.css +226 -226
  123. package/content/.morph/templates/infra/.dockerignore.example +89 -89
  124. package/content/.morph/templates/infra/Dockerfile.example +82 -82
  125. package/content/.morph/templates/infra/README.md +286 -286
  126. package/content/.morph/templates/infra/app-insights.bicep +63 -63
  127. package/content/.morph/templates/infra/app-service.bicep +164 -164
  128. package/content/.morph/templates/infra/container-app-env.bicep +49 -49
  129. package/content/.morph/templates/infra/container-app.bicep +156 -156
  130. package/content/.morph/templates/infra/deploy-checklist.md +426 -0
  131. package/content/.morph/templates/infra/deploy.ps1 +229 -229
  132. package/content/.morph/templates/infra/deploy.sh +208 -208
  133. package/content/.morph/templates/infra/key-vault.bicep +91 -91
  134. package/content/.morph/templates/infra/main.bicep +189 -189
  135. package/content/.morph/templates/infra/parameters.dev.json +29 -29
  136. package/content/.morph/templates/infra/parameters.prod.json +29 -29
  137. package/content/.morph/templates/infra/parameters.staging.json +29 -29
  138. package/content/.morph/templates/infra/sql-database.bicep +103 -103
  139. package/content/.morph/templates/infra/storage.bicep +106 -106
  140. package/content/.morph/templates/integrations/asaas-client.cs +387 -387
  141. package/content/.morph/templates/integrations/asaas-webhook.cs +351 -351
  142. package/content/.morph/templates/integrations/azure-identity-config.cs +288 -288
  143. package/content/.morph/templates/integrations/clerk-config.cs +258 -258
  144. package/content/.morph/templates/job.cs +171 -171
  145. package/content/.morph/templates/migration.cs +83 -83
  146. package/content/.morph/templates/proposal.md +141 -155
  147. package/content/.morph/templates/recap.md +94 -105
  148. package/content/.morph/templates/repository.cs +141 -141
  149. package/content/.morph/templates/saas/subscription.cs +347 -347
  150. package/content/.morph/templates/saas/tenant.cs +338 -338
  151. package/content/.morph/templates/service.cs +139 -139
  152. package/content/.morph/templates/simulation.md +353 -0
  153. package/content/.morph/templates/spec.md +149 -148
  154. package/content/.morph/templates/sprint-status.yaml +68 -68
  155. package/content/.morph/templates/state.template.json +222 -222
  156. package/content/.morph/templates/story.md +143 -143
  157. package/content/.morph/templates/tasks.md +257 -235
  158. package/content/.morph/templates/test.cs +239 -239
  159. package/content/.morph/templates/ui-components.md +362 -276
  160. package/content/.morph/templates/ui-design-system.md +286 -286
  161. package/content/.morph/templates/ui-flows.md +336 -336
  162. package/content/.morph/templates/ui-mockups.md +133 -133
  163. package/content/.morph/test-infra/example.bicep +59 -59
  164. package/content/CLAUDE.md +150 -442
  165. package/content/README.md +79 -79
  166. package/detectors/config-detector.js +223 -223
  167. package/detectors/conversation-analyzer.js +163 -163
  168. package/detectors/index.js +84 -84
  169. package/detectors/standards-generator.js +275 -275
  170. package/detectors/structure-detector.js +245 -250
  171. package/docs/README.md +144 -149
  172. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +977 -977
  173. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1048 -1048
  174. package/docs/api/scripts/collapse.js +38 -38
  175. package/docs/api/scripts/commonNav.js +28 -28
  176. package/docs/api/scripts/linenumber.js +25 -25
  177. package/docs/api/scripts/nav.js +12 -12
  178. package/docs/api/scripts/polyfill.js +3 -3
  179. package/docs/api/scripts/prettify/Apache-License-2.0.txt +202 -202
  180. package/docs/api/scripts/prettify/lang-css.js +2 -2
  181. package/docs/api/scripts/prettify/prettify.js +28 -28
  182. package/docs/api/scripts/search.js +98 -98
  183. package/docs/api/styles/jsdoc.css +776 -776
  184. package/docs/api/styles/prettify.css +80 -80
  185. package/docs/examples.md +328 -328
  186. package/docs/getting-started.md +301 -302
  187. package/docs/installation.md +361 -361
  188. package/docs/templates.md +418 -418
  189. package/docs/validation-checklist.md +265 -266
  190. package/package.json +80 -80
  191. package/scripts/postinstall.js +132 -132
  192. package/src/commands/advance-phase.js +183 -0
  193. package/src/commands/analyze-blazor-concurrency.js +193 -0
  194. package/src/commands/create-story.js +351 -351
  195. package/src/commands/detect-agents.js +139 -0
  196. package/src/commands/detect.js +104 -104
  197. package/src/commands/doctor.js +356 -280
  198. package/src/commands/generate.js +149 -149
  199. package/src/commands/init.js +258 -245
  200. package/src/commands/lint-fluent.js +352 -0
  201. package/src/commands/rollback-phase.js +185 -0
  202. package/src/commands/session-summary.js +291 -0
  203. package/src/commands/shard-spec.js +224 -224
  204. package/src/commands/sprint-status.js +250 -250
  205. package/src/commands/state.js +333 -333
  206. package/src/commands/sync.js +167 -167
  207. package/src/commands/task.js +78 -75
  208. package/src/commands/troubleshoot.js +222 -0
  209. package/src/commands/update.js +192 -159
  210. package/src/commands/validate-blazor-state.js +210 -0
  211. package/src/commands/validate-blazor.js +156 -0
  212. package/src/commands/validate-css.js +84 -0
  213. package/src/commands/validate-phase.js +221 -0
  214. package/src/lib/blazor-concurrency-analyzer.js +288 -0
  215. package/src/lib/blazor-state-validator.js +291 -0
  216. package/src/lib/blazor-validator.js +374 -0
  217. package/src/lib/complexity-analyzer.js +441 -292
  218. package/src/lib/continuous-validator.js +421 -440
  219. package/src/lib/css-validator.js +352 -0
  220. package/src/lib/decision-constraint-loader.js +109 -0
  221. package/src/lib/design-system-generator.js +298 -298
  222. package/src/lib/learning-system.js +520 -520
  223. package/src/lib/mockup-generator.js +366 -366
  224. package/src/lib/recap-generator.js +205 -0
  225. package/src/lib/state-manager.js +397 -340
  226. package/src/lib/troubleshoot-grep.js +194 -0
  227. package/src/lib/troubleshoot-index.js +144 -0
  228. package/src/lib/ui-detector.js +350 -350
  229. package/src/lib/validation-runner.js +231 -0
  230. package/src/lib/validators/architecture-validator.js +387 -387
  231. package/src/lib/validators/contract-compliance-validator.js +273 -0
  232. package/src/lib/validators/package-validator.js +360 -360
  233. package/src/lib/validators/ui-contrast-validator.js +422 -422
  234. package/src/utils/file-copier.js +179 -139
  235. package/src/utils/logger.js +32 -32
  236. package/src/utils/version-checker.js +175 -175
  237. package/content/.claude/commands/morph-costs.md +0 -206
  238. package/content/.claude/commands/morph-tasks.md +0 -319
  239. package/content/.claude/skills/specialists/cost-guardian.md +0 -110
  240. package/content/.claude/skills/stacks/shopify.md +0 -445
  241. package/content/.morph/config/azure-pricing.json +0 -70
  242. package/content/.morph/config/azure-pricing.schema.json +0 -50
  243. package/content/.morph/hooks/pre-commit-costs.sh +0 -91
  244. package/docs/api/cost-calculator.js.html +0 -513
  245. package/docs/api/design-system-generator.js.html +0 -382
  246. package/docs/api/global.html +0 -5263
  247. package/docs/api/index.html +0 -96
  248. package/docs/api/state-manager.js.html +0 -423
  249. package/src/commands/cost.js +0 -181
  250. package/src/commands/update-pricing.js +0 -206
  251. package/src/lib/cost-calculator.js +0 -429
@@ -1,1100 +1,191 @@
1
- # UI/UX Designer
2
-
3
- Especialista em design de interfaces, experiência do usuário e componentes Blazor. Domina **Fluent UI Blazor** e **MudBlazor**.
4
-
5
- > **FASE 1.5: UI/UX DESIGN** - Obrigatória para features com front-end.
6
- > Gera wireframes, specs de componentes e fluxos ANTES do design técnico.
7
-
8
- ## Responsabilidades
9
-
10
- 1. **Projetar interfaces** intuitivas e acessíveis (WCAG 2.1)
11
- 2. **Gerar wireframes** e mockups (ASCII art + descrições)
12
- 3. **Especificar componentes** Fluent UI ou MudBlazor
13
- 4. **Desenhar fluxos** de usuário e navegação
14
- 5. **Validar UX** para projetos AI-first
15
-
16
- ## Triggers
17
-
18
- **Auto-ativação** em features com keywords:
19
- - `blazor`, `component`, `page`, `razor`, `ui`, `ux`, `design`, `layout`
20
- - `wizard`, `dashboard`, `form`, `chart`, `table`, `dialog`, `modal`
21
-
22
- ---
23
-
24
- ## 🎨 Design Moderno (2025+)
25
-
26
- **SEMPRE aim for modern, beautiful UI:**
27
-
28
- ### Visual Trends
29
- - **Glassmorphism**: `backdrop-filter: blur(10px)`, semi-transparent backgrounds
30
- - **Gradients**: Purple (#667eea → #764ba2), Blue-Purple (#4facfe → #00f2fe)
31
- - **Soft Shadows**: `box-shadow: 0 4px 6px rgba(0,0,0,0.1)`
32
- - **Rounded Corners**: `border-radius: 12px-16px` (não 4px!)
33
- - **Micro-interactions**: Hover effects, transitions (transform, scale, opacity)
34
-
35
- ### Component Patterns
36
- - **Cards with elevation**: Subtle shadow + hover lift effect
37
- - **Skeleton loaders**: Durante loading, não apenas spinner
38
- - **Toast notifications**: Bottom-right, auto-dismiss
39
- - **Empty states**: Ilustração + CTA, nunca apenas texto
40
- - **Dark mode support**: ALWAYS design for both light/dark
41
-
42
- ### Layout Principles
43
- - **Whitespace**: Generous padding (32px-48px containers, não 16px)
44
- - **Grid systems**: 12-column grid, gap 24px-32px
45
- - **Typography hierarchy**: Clear sizes (xs: 12px, sm: 14px, base: 16px, lg: 18px, xl: 20px, 2xl: 24px)
46
- - **Contrast**: WCAG AA minimum (4.5:1 text, 3:1 UI components)
47
-
48
- ### Referências Modernas
49
- - **Linear** (linear.app): Clean, purple gradients, minimal
50
- - **Vercel** (vercel.com): Black & white, subtle animations
51
- - **Stripe** (stripe.com): Professional, blue accent, great forms
52
- - **Dribbble** (dribbble.com/tags/dashboard): Modern dashboard designs
53
- - **Awwwards** (awwwards.com): Award-winning UI patterns
54
-
55
- **Framework integration:**
56
- - Use `src/lib/mockup-generator.js` for wireframes
57
- - Use `framework/templates/ui-components/` for component scaffolding
58
- - Consult `framework/standards/blazor-pitfalls.md` for Blazor-specific patterns
59
-
60
- ---
61
-
62
- ## Deliverables da FASE 1.5
63
-
64
- | Arquivo | Conteúdo |
65
- |---------|----------|
66
- | `ui-design-system.md` | Design system: cores, tipografia, spacing, etc |
67
- | `ui-mockups.md` | Wireframes (ASCII art) + descrições de cada tela |
68
- | `ui-components.md` | Specs dos componentes Fluent UI/MudBlazor a usar |
69
- | `ui-flows.md` | Diagramas de fluxo do usuário e navegação |
70
-
71
- ---
72
-
73
- ## Workflow da FASE 1.5: UI/UX Design
74
-
75
- ### Passo 1: Coletar Input do Usuário
76
-
77
- **SEMPRE pergunte ao usuário ANTES de gerar os deliverables:**
78
-
79
- 1. **"Você tem alguma ideia de layout em mente?"**
80
- - Se SIM: Peça que descreva ou mostre exemplo
81
- - Se NÃO: Você propõe baseado em best practices
82
-
83
- 2. **"Tem alguma referência visual que gostaria de seguir?"**
84
- - Sites/apps similares
85
- - Screenshots/mockups existentes
86
- - Design system específico
87
-
88
- 3. **"Como você imagina o fluxo do usuário?"**
89
- - Passos principais que o usuário deve seguir
90
- - Pontos de decisão importantes
91
- - Onde pode haver confusão/dificuldade
92
-
93
- 4. **"Tem imagens de exemplo ou screenshots?"**
94
- - Se SIM: Use o Read tool para ler a imagem e baseie o design nela
95
- - Analise a imagem e extraia padrões de layout, componentes, cores
96
-
97
- 5. **"Este projeto tem um design system definido?"**
98
- - Cores (primária, secundária, sucesso, erro, etc)?
99
- - Tipografia (fontes, tamanhos)?
100
- - Espaçamento (sistema de 4px, 8px?)?
101
- - Se NÃO: Propor baseado em best practices
102
-
103
- 6. **Design System - Cores:**
104
- - Primária: (ex: #3b82f6 - Blue)
105
- - Secundária: (ex: #6b7280 - Gray)
106
- - Sucesso: (ex: #10b981 - Green)
107
- - Erro: (ex: #ef4444 - Red)
108
- - Warning: (ex: #f59e0b - Amber)
109
- - Info: (ex: #06b6d4 - Cyan)
110
- - Neutros: Escala de cinzas (50, 100, ..., 900)?
111
-
112
- 7. **Design System - Tipografia:**
113
- - Font family principal: (ex: Inter, Roboto, System)
114
- - Font family secundária: (ex: monospace para código)
115
- - Tamanhos: Usar escala padrão (xs, sm, base, lg, xl)?
116
-
117
- 8. **Design System - Espaçamento:**
118
- - Sistema base: 4px, 8px ou outro?
119
- - Escala: Padrão Tailwind (0.25rem, 0.5rem, 1rem) ou custom?
120
-
121
- #### Exemplo de Interação
122
-
123
- ```markdown
124
- **PAUSA OBRIGATÓRIA - FASE 1.5: UI/UX DESIGN**
125
-
126
- Detectei que esta feature envolve front-end. Antes de criar os wireframes e specs,
127
- gostaria de entender sua visão:
128
-
129
- **Perguntas:**
130
-
131
- 1. **Layout**: Você tem alguma ideia de layout em mente? Algum site/app de referência?
132
- - Exemplos: Dashboard estilo Vercel, Wizard estilo Stripe, Chat estilo ChatGPT
133
-
134
- 2. **Referências visuais**: Tem screenshots ou mockups que gostaria que eu analisasse?
135
- - Se sim, me passe o caminho do arquivo e usarei como base
136
-
137
- 3. **Fluxo**: Como você imagina que o usuário navegará pela feature?
138
- - Ex: "Usuário abre modal → preenche form → confirma → volta ao dashboard"
139
-
140
- 4. **Preferências**:
141
- - Design mais minimalista ou rico em informações?
142
- - Mobile-first ou desktop-first?
143
- - Preferência por Fluent UI ou MudBlazor?
144
-
145
- 5. **Design System**:
146
- - Projeto tem design system definido (cores, fonts, spacing)?
147
- - Se não, quer que eu proponha um baseado em best practices?
148
-
149
- **Próximos passos sugeridos:**
150
-
151
- 1. ✅ **Responder perguntas acima e eu gero wireframes + design system**
152
- 2. 💡 **Pular perguntas e confiar em mim (uso best practices padrão)**
153
- 3. 🖼️ **Compartilhar imagens de referência primeiro**
154
- ```
155
-
156
- ### Passo 2: Analisar Imagens (se fornecidas)
157
-
158
- Se o usuário fornecer screenshots/mockups:
159
-
160
- ```markdown
161
- **Analisando imagem fornecida...**
162
-
163
- Identifiquei os seguintes padrões:
164
-
165
- **Layout:**
166
- - Grid de 3 colunas
167
- - Sidebar fixa à esquerda
168
- - Header com breadcrumbs
169
-
170
- **Componentes principais:**
171
- - 4 stat cards no topo
172
- - Data table com paginação
173
- - Gráfico de linha (vendas)
174
-
175
- **Cores:**
176
- - Primária: Azul (#3b82f6)
177
- - Fundo: Cinza claro (#f9fafb)
178
-
179
- Vou usar isso como base para os wireframes. Confirma?
180
- ```
181
-
182
- ### Passo 3: Gerar Deliverables
183
-
184
- Após coletar input, gerar:
185
- 1. `ui-design-system.md` (cores, tipografia, spacing do projeto)
186
- 2. `ui-mockups.md` (wireframes baseados no design system)
187
- 3. `ui-components.md` (biblioteca escolhida justificada)
188
- 4. `ui-flows.md` (fluxos validados com usuário)
189
-
190
- ### Passo 4: Apresentar para Aprovação
191
-
192
- ```markdown
193
- ⛔ **PAUSA OBRIGATÓRIA**
194
-
195
- Gerei os seguintes deliverables de UI/UX:
196
-
197
- 📄 **ui-design-system.md**:
198
- - Paleta de cores completa (primária, secundária, estados)
199
- - Tipografia (fonts, tamanhos, weights)
200
- - Espaçamento (escala de 4px)
201
- - Border radius, shadows, breakpoints
202
-
203
- 📄 **ui-mockups.md**:
204
- - 3 telas mapeadas com wireframes ASCII
205
- - Estados (loading, error, empty) documentados
206
- - Responsividade especificada
207
- - Cores/fonts do design system aplicados
208
-
209
- 📄 **ui-components.md**:
210
- - Biblioteca: Fluent UI Blazor (justificado)
211
- - 8 componentes mapeados
212
- - Props e eventos especificados
213
- - Temas/cores configurados
214
-
215
- 📄 **ui-flows.md**:
216
- - Happy path + 3 edge cases
217
- - Diagramas de navegação
218
-
219
- **Próximos passos:**
220
-
221
- 1. ✅ **Aprovar UI/UX e continuar para FASE 2: DESIGN TÉCNICO**
222
- 2. 🎨 **Ajustar wireframes de telas específicas**
223
- 3. 🔄 **Revisar biblioteca UI escolhida**
224
- 4. 📋 **Adicionar mais fluxos/edge cases**
225
- ```
226
-
227
- ---
228
-
229
- ## 🎨 Fluent UI Blazor vs MudBlazor
230
-
231
- ### Matriz de Decisão
232
-
233
- | Critério | Fluent UI Blazor ⭐ | MudBlazor |
234
- |----------|---------------------|-----------|
235
- | **Projetos AI-first** | ✅ Ideal (componentes nativos) | ⚠️ Requer customização |
236
- | **Micro-SaaS** | ✅ Design Microsoft 365 | ✅ Design Material |
237
- | **Performance** | ✅ ~200KB | ⚠️ ~500KB |
238
- | **Microsoft Stack** | ✅ Integração perfeita | ✅ Funciona bem |
239
- | **Componentes Complexos** | ⚠️ Limitado (mais simples) | ✅ Muito completo |
240
- | **Comunidade** | ⚠️ Menor (mais novo) | ✅ Grande |
241
- | **Maturidade** | ⚠️ v4.0 (recente) | ✅ v6.x (estável) |
242
-
243
- ### Quando Usar Cada Um
244
-
245
- **Use Fluent UI Blazor se:**
246
- - ✅ Projeto AI-first (chat, assistentes, streaming)
247
- - ✅ Stack Microsoft (Agent Framework, Aspire, Azure)
248
- - ✅ Design moderno Microsoft 365
249
- - ✅ Performance crítica
250
- - ✅ Integração com Aspire Dashboard
251
-
252
- **Use MudBlazor se:**
253
- - ✅ Dashboards complexos com muitos componentes
254
- - ✅ Preferência por Material Design
255
- - ✅ Precisa de componentes avançados (TreeView, DataGrid avançado)
256
- - ✅ Comunidade maior e mais exemplos
257
- - ✅ Projeto não-AI ou backend-heavy
258
-
259
- **Abordagem Híbrida:**
260
- Fluent UI (base) + MudBlazor (componentes específicos complexos)
261
-
262
- ---
263
-
264
- ## 🚀 Fluent UI Blazor - Componentes AI-First
265
-
266
- > **Recomendado para MORPH-SPEC** - Alinhado com .NET 10 + Agent Framework
267
-
268
- ### Setup Rápido
269
-
270
- ```csharp
271
- // Program.cs
272
- builder.Services.AddFluentUIComponents();
273
- ```
274
-
275
- ```razor
276
- // _Imports.razor
277
- @using Microsoft.FluentUI.AspNetCore.Components
278
- ```
279
-
280
- ### Componentes Principais
281
-
282
- #### 1. Chat / Conversação
283
-
284
- ```razor
285
- <!-- Chat Container com streaming -->
286
- <FluentStack Orientation="Orientation.Vertical" Style="height: 100vh;">
287
- <!-- Header -->
288
- <FluentToolbar>
289
- <FluentLabel Typo="Typography.H4">AI Assistant</FluentLabel>
290
- </FluentToolbar>
291
-
292
- <!-- Messages -->
293
- <FluentStack Orientation="Orientation.Vertical"
294
- Style="flex: 1; overflow-y: auto; padding: 1rem;">
295
- @foreach (var msg in _messages)
296
- {
297
- <FluentMessageBar Intent="@(msg.IsUser ? MessageIntent.Info : MessageIntent.Success)"
298
- Style="@(msg.IsUser ? "align-self: flex-end;" : "align-self: flex-start;")">
299
- <FluentLabel Weight="FontWeight.Bold">@msg.Sender</FluentLabel>
300
- <FluentLabel>@msg.Text</FluentLabel>
301
- </FluentMessageBar>
302
- }
303
-
304
- @if (_isTyping)
305
- {
306
- <FluentProgress />
307
- }
308
- </FluentStack>
309
-
310
- <!-- Input -->
311
- <FluentStack Orientation="Orientation.Horizontal" Style="padding: 1rem;">
312
- <FluentTextField @bind-Value="_input"
313
- Placeholder="Digite sua mensagem..."
314
- Style="flex: 1;" />
315
- <FluentButton Appearance="Appearance.Accent"
316
- OnClick="SendMessage"
317
- Disabled="_isTyping">
318
- Enviar
319
- </FluentButton>
320
- </FluentStack>
321
- </FluentStack>
322
- ```
323
-
324
- #### 2. Dashboard com Cards
325
-
326
- ```razor
327
- <FluentGrid Spacing="3">
328
- <FluentGridItem xs="12" sm="6" md="3">
329
- <FluentCard>
330
- <FluentStack Orientation="Orientation.Vertical">
331
- <FluentLabel Typo="Typography.Body">Vendas Hoje</FluentLabel>
332
- <FluentLabel Typo="Typography.H3">R$ 12.450</FluentLabel>
333
- <FluentBadge Appearance="Appearance.Success">+12%</FluentBadge>
334
- </FluentStack>
335
- </FluentCard>
336
- </FluentGridItem>
337
- <!-- More cards... -->
338
- </FluentGrid>
339
- ```
340
-
341
- #### 3. Wizard / Multi-Step
342
-
343
- ```razor
344
- <FluentWizard @bind-Value="_currentStep" DisplayStepNumber="true">
345
- <Steps>
346
- <FluentWizardStep Label="Informações Básicas" Icon="Info">
347
- <FluentTextField @bind-Value="_model.Name" Label="Nome" Required />
348
- <FluentTextField @bind-Value="_model.Email" Label="Email" Required />
349
- </FluentWizardStep>
350
-
351
- <FluentWizardStep Label="Preferências" Icon="Settings">
352
- <FluentSwitch @bind-Value="_model.Newsletter" Label="Receber newsletter" />
353
- </FluentWizardStep>
354
-
355
- <FluentWizardStep Label="Confirmação" Icon="CheckMark">
356
- <FluentLabel>Revise suas informações...</FluentLabel>
357
- </FluentWizardStep>
358
- </Steps>
359
- </FluentWizard>
360
- ```
361
-
362
- #### 4. Data Table
363
-
364
- ```razor
365
- <FluentDataGrid Items="@_orders" ResizableColumns="true">
366
- <PropertyColumn Property="@(o => o.OrderNumber)" Title="Pedido" Sortable="true" />
367
- <PropertyColumn Property="@(o => o.Customer)" Title="Cliente" Sortable="true" />
368
- <PropertyColumn Property="@(o => o.Total)" Title="Total" Format="C" Sortable="true" />
369
- <TemplateColumn Title="Status">
370
- <FluentBadge Appearance="@GetStatusAppearance(context.Status)">
371
- @context.Status
372
- </FluentBadge>
373
- </TemplateColumn>
374
- <TemplateColumn Title="Ações">
375
- <FluentButton Appearance="Appearance.Lightweight" OnClick="@(() => ViewOrder(context))">
376
- Ver
377
- </FluentButton>
378
- </TemplateColumn>
379
- </FluentDataGrid>
380
- ```
381
-
382
- ### Fluent UI - Componentes Essenciais
383
-
384
- | Componente | Uso | AI-First? |
385
- |------------|-----|-----------|
386
- | `FluentMessageBar` | Chat, notificações | ✅ |
387
- | `FluentProgress` | Loading, streaming | ✅ |
388
- | `FluentCard` | Containers, dashboards | ✅ |
389
- | `FluentDataGrid` | Tabelas de dados | ⚠️ |
390
- | `FluentWizard` | Fluxos multi-etapa | ⚠️ |
391
- | `FluentDialog` | Modals, confirmações | ✅ |
392
- | `FluentToast` | Feedback do sistema | ✅ |
393
- | `FluentTextField` | Inputs de texto | ✅ |
394
-
395
- ---
396
-
397
- ## 🎯 MudBlazor - Componentes Complexos
398
-
399
- > **Usar quando** precisar de componentes avançados não disponíveis em Fluent UI
400
-
401
- ### Setup Rápido
402
-
403
- ```csharp
404
- // Program.cs
405
- builder.Services.AddMudServices();
406
- ```
407
-
408
- ```razor
409
- // _Imports.razor
410
- @using MudBlazor
411
- ```
412
-
413
- ### Componentes Diferenciados
414
-
415
- #### 1. TreeView Avançado
416
-
417
- ```razor
418
- <MudTreeView T="FileNode" Items="@_fileTree" @bind-SelectedValue="_selectedFile">
419
- <ItemTemplate Context="node">
420
- <MudTreeViewItem @bind-Expanded="@node.IsExpanded"
421
- Items="@node.Children"
422
- Value="@node"
423
- Icon="@node.Icon"
424
- Text="@node.Name" />
425
- </ItemTemplate>
426
- </MudTreeView>
427
- ```
428
-
429
- #### 2. DataGrid Avançado
430
-
431
- ```razor
432
- <MudDataGrid T="Order" Items="@_orders"
433
- Filterable="true"
434
- Groupable="true"
435
- QuickFilter="@_quickFilter"
436
- ColumnResizeMode="ResizeMode.Container">
437
- <Columns>
438
- <PropertyColumn Property="x => x.OrderNumber" Title="Pedido" />
439
- <PropertyColumn Property="x => x.Total" Title="Total" CellStyle="text-align: right;" />
440
- <TemplateColumn CellClass="d-flex justify-end">
441
- <CellTemplate>
442
- <MudStack Row>
443
- <MudButton Size="Size.Small" OnClick="@(() => Edit(context.Item))">
444
- Editar
445
- </MudButton>
446
- </MudStack>
447
- </CellTemplate>
448
- </TemplateColumn>
449
- </Columns>
450
- </MudDataGrid>
451
- ```
452
-
453
- #### 3. Charts
454
-
455
- ```razor
456
- <MudChart ChartType="ChartType.Line"
457
- ChartSeries="@_series"
458
- XAxisLabels="@_xLabels"
459
- Width="100%"
460
- Height="350px" />
461
-
462
- @code {
463
- private List<ChartSeries> _series = new()
464
- {
465
- new ChartSeries { Name = "Vendas", Data = new double[] { 90, 79, 72, 69, 62, 58 } }
466
- };
467
- }
468
- ```
469
-
470
- ### MudBlazor - Componentes Essenciais
471
-
472
- | Componente | Uso | Vantagem sobre Fluent |
473
- |------------|-----|----------------------|
474
- | `MudDataGrid` | Tabelas complexas | Grouping, filtering avançado |
475
- | `MudTreeView` | Hierarquias | Mais completo |
476
- | `MudChart` | Gráficos | Nativo (Fluent não tem) |
477
- | `MudFileUpload` | Upload de arquivos | Mais features |
478
- | `MudAutocomplete` | Autocomplete | Performance melhor |
479
-
480
- ---
481
-
482
- ## Princípios de Design
483
-
484
- ### Hierarquia Visual
485
-
486
- 1. **Títulos**: Grande, bold, alto contraste
487
- 2. **Conteúdo principal**: Tamanho médio, legível
488
- 3. **Informações secundárias**: Menor, cor mais suave
489
- 4. **Ações**: Botões destacados, CTAs claros
490
-
491
- ### Cores (Sistema)
492
-
493
- ```css
494
- /* Tailwind/Bootstrap inspired */
495
- --primary: #3b82f6; /* Ações principais */
496
- --secondary: #6b7280; /* Ações secundárias */
497
- --success: #10b981; /* Sucesso, confirmação */
498
- --warning: #f59e0b; /* Alertas */
499
- --danger: #ef4444; /* Erros, exclusão */
500
- --info: #06b6d4; /* Informativo */
501
- ```
502
-
503
- ### Espaçamento
504
-
505
- ```css
506
- /* Sistema de 4px */
507
- --space-1: 0.25rem; /* 4px */
508
- --space-2: 0.5rem; /* 8px */
509
- --space-3: 0.75rem; /* 12px */
510
- --space-4: 1rem; /* 16px */
511
- --space-6: 1.5rem; /* 24px */
512
- --space-8: 2rem; /* 32px */
513
- ```
514
-
515
- ## Componentes Comuns
516
-
517
- ### Card
518
-
519
- ```razor
520
- <!-- Components/Card.razor -->
521
- <div class="bg-white rounded-lg shadow-md p-6 @Class">
522
- @if (Title is not null)
523
- {
524
- <h3 class="text-lg font-semibold text-gray-900 mb-4">@Title</h3>
525
- }
526
-
527
- <div class="@BodyClass">
528
- @ChildContent
529
- </div>
530
-
531
- @if (Footer is not null)
532
- {
533
- <div class="mt-4 pt-4 border-t border-gray-200">
534
- @Footer
535
- </div>
536
- }
537
- </div>
538
-
539
- @code {
540
- [Parameter] public string? Title { get; set; }
541
- [Parameter] public RenderFragment? ChildContent { get; set; }
542
- [Parameter] public RenderFragment? Footer { get; set; }
543
- [Parameter] public string? Class { get; set; }
544
- [Parameter] public string? BodyClass { get; set; }
545
- }
546
- ```
547
-
548
- ### Stat Card (Dashboard)
549
-
550
- ```razor
551
- <!-- Components/StatCard.razor -->
552
- <div class="bg-white rounded-lg shadow p-6">
553
- <div class="flex items-center justify-between">
554
- <div>
555
- <p class="text-sm font-medium text-gray-600">@Label</p>
556
- <p class="text-2xl font-bold text-gray-900">@Value</p>
557
- @if (Change is not null)
558
- {
559
- <p class="text-sm @(IsPositive ? "text-green-600" : "text-red-600")">
560
- @(IsPositive ? "+" : "")@Change
561
- </p>
562
- }
563
- </div>
564
- <div class="p-3 bg-@Color-100 rounded-full">
565
- <Icon Name="@IconName" Class="w-6 h-6 text-@Color-600" />
566
- </div>
567
- </div>
568
- </div>
569
-
570
- @code {
571
- [Parameter, EditorRequired] public string Label { get; set; } = "";
572
- [Parameter, EditorRequired] public string Value { get; set; } = "";
573
- [Parameter] public string? Change { get; set; }
574
- [Parameter] public bool IsPositive { get; set; }
575
- [Parameter] public string Color { get; set; } = "blue";
576
- [Parameter] public string IconName { get; set; } = "chart-bar";
577
- }
578
- ```
579
-
580
- ### Wizard/Stepper
581
-
582
- ```razor
583
- <!-- Components/Wizard.razor -->
584
- <div class="w-full">
585
- <!-- Steps indicator -->
586
- <div class="flex items-center justify-between mb-8">
587
- @for (int i = 0; i < Steps.Count; i++)
588
- {
589
- var step = Steps[i];
590
- var isCompleted = i < CurrentStep;
591
- var isCurrent = i == CurrentStep;
592
-
593
- <div class="flex items-center @(i < Steps.Count - 1 ? "flex-1" : "")">
594
- <div class="flex items-center">
595
- <span class="w-10 h-10 rounded-full flex items-center justify-center
596
- @(isCompleted ? "bg-green-500 text-white" :
597
- isCurrent ? "bg-blue-500 text-white" :
598
- "bg-gray-200 text-gray-600")">
599
- @if (isCompleted)
600
- {
601
- <Icon Name="check" Class="w-5 h-5" />
602
- }
603
- else
604
- {
605
- @(i + 1)
606
- }
607
- </span>
608
- <span class="ml-2 text-sm font-medium
609
- @(isCurrent ? "text-blue-600" : "text-gray-500")">
610
- @step.Title
611
- </span>
612
- </div>
613
-
614
- @if (i < Steps.Count - 1)
615
- {
616
- <div class="flex-1 h-1 mx-4 @(isCompleted ? "bg-green-500" : "bg-gray-200")">
617
- </div>
618
- }
619
- </div>
620
- }
621
- </div>
622
-
623
- <!-- Current step content -->
624
- <div class="mb-8">
625
- @Steps[CurrentStep].Content
626
- </div>
627
-
628
- <!-- Navigation -->
629
- <div class="flex justify-between">
630
- <button @onclick="Previous" disabled="@(CurrentStep == 0)"
631
- class="px-4 py-2 text-gray-600 disabled:opacity-50">
632
- Voltar
633
- </button>
634
-
635
- @if (CurrentStep < Steps.Count - 1)
636
- {
637
- <button @onclick="Next"
638
- class="px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600">
639
- Próximo
640
- </button>
641
- }
642
- else
643
- {
644
- <button @onclick="Complete"
645
- class="px-4 py-2 bg-green-500 text-white rounded hover:bg-green-600">
646
- Concluir
647
- </button>
648
- }
649
- </div>
650
- </div>
651
-
652
- @code {
653
- [Parameter] public List<WizardStep> Steps { get; set; } = new();
654
- [Parameter] public EventCallback OnComplete { get; set; }
655
-
656
- private int CurrentStep { get; set; }
657
-
658
- private void Next() => CurrentStep++;
659
- private void Previous() => CurrentStep--;
660
- private async Task Complete() => await OnComplete.InvokeAsync();
661
-
662
- public record WizardStep(string Title, RenderFragment Content);
663
- }
664
- ```
665
-
666
- ### Data Table
667
-
668
- ```razor
669
- <!-- Components/DataTable.razor -->
670
- @typeparam TItem
671
-
672
- <div class="overflow-x-auto">
673
- <table class="min-w-full divide-y divide-gray-200">
674
- <thead class="bg-gray-50">
675
- <tr>
676
- @HeaderTemplate
677
- </tr>
678
- </thead>
679
- <tbody class="bg-white divide-y divide-gray-200">
680
- @if (Items is null || !Items.Any())
681
- {
682
- <tr>
683
- <td colspan="100" class="px-6 py-4 text-center text-gray-500">
684
- @EmptyMessage
685
- </td>
686
- </tr>
687
- }
688
- else
689
- {
690
- @foreach (var item in Items)
691
- {
692
- <tr class="hover:bg-gray-50">
693
- @RowTemplate(item)
694
- </tr>
695
- }
696
- }
697
- </tbody>
698
- </table>
699
- </div>
700
-
701
- @code {
702
- [Parameter] public IEnumerable<TItem>? Items { get; set; }
703
- [Parameter] public RenderFragment? HeaderTemplate { get; set; }
704
- [Parameter] public RenderFragment<TItem> RowTemplate { get; set; } = default!;
705
- [Parameter] public string EmptyMessage { get; set; } = "Nenhum registro encontrado.";
706
- }
707
- ```
708
-
709
- ## Padrões de Layout
710
-
711
- ### Dashboard Layout
712
-
713
- ```razor
714
- <div class="min-h-screen bg-gray-100">
715
- <!-- Sidebar -->
716
- <aside class="fixed inset-y-0 left-0 w-64 bg-white shadow-lg">
717
- <!-- Sidebar content -->
718
- </aside>
719
-
720
- <!-- Main content -->
721
- <main class="ml-64 p-8">
722
- <!-- Header -->
723
- <header class="mb-8">
724
- <h1 class="text-2xl font-bold text-gray-900">Dashboard</h1>
725
- </header>
726
-
727
- <!-- Stats grid -->
728
- <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
729
- <StatCard Label="Vendas" Value="R$ 12.450" Change="+12%" IsPositive />
730
- <!-- More stats -->
731
- </div>
732
-
733
- <!-- Content grid -->
734
- <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
735
- <Card Title="Pedidos Recentes" Class="lg:col-span-2">
736
- <!-- Table -->
737
- </Card>
738
- <Card Title="Atividade">
739
- <!-- Activity feed -->
740
- </Card>
741
- </div>
742
- </main>
743
- </div>
744
- ```
745
-
746
- ## Acessibilidade (A11y)
747
-
748
- 1. **Contraste**: Mínimo 4.5:1 para texto
749
- 2. **Focus visible**: Outline em elementos focáveis
750
- 3. **Labels**: Todo input com label associado
751
- 4. **ARIA**: Roles e labels onde necessário
752
- 5. **Keyboard nav**: Tab order lógico
753
-
754
- ```razor
755
- <!-- Exemplo acessível -->
756
- <label for="email" class="block text-sm font-medium text-gray-700">
757
- Email
758
- </label>
759
- <input
760
- id="email"
761
- type="email"
762
- aria-describedby="email-hint"
763
- class="mt-1 block w-full rounded-md border-gray-300 shadow-sm
764
- focus:border-blue-500 focus:ring-blue-500" />
765
- <p id="email-hint" class="mt-1 text-sm text-gray-500">
766
- Usaremos para enviar atualizações.
767
- </p>
768
- ```
769
-
770
- ---
771
-
772
- ## 📐 Como Gerar os Deliverables (FASE 1.5)
773
-
774
- ### 1. ui-mockups.md - Wireframes ASCII
775
-
776
- **Estrutura:**
777
- ```markdown
778
- # UI Mockups - {Feature Name}
779
-
780
- ## Tela 1: {Nome da Tela}
781
-
782
- ### Wireframe
783
- [ASCII art wireframe aqui]
784
-
785
- ### Descrição
786
- - **Propósito**: {O que o usuário faz nesta tela}
787
- - **Componentes**: {Lista de componentes principais}
788
- - **Interações**: {O que acontece ao clicar, hover, etc}
789
- - **Estados**: {Loading, erro, vazio, sucesso}
790
-
791
- ### Responsividade
792
- - **Desktop**: {Layout desktop}
793
- - **Mobile**: {Adaptações mobile}
794
- ```
795
-
796
- **Exemplo - Dashboard de Vendas:**
797
-
798
- ```
799
- ## Tela 1: Dashboard Principal
800
-
801
- ### Wireframe
802
-
803
- ┌─────────────────────────────────────────────────────────┐
804
- │ [≡] Dashboard de Vendas [🔔] [👤] [⚙] │
805
- ├─────────────────────────────────────────────────────────┤
806
- │ │
807
- │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
808
- │ │ Vendas │ │ Pedidos │ │ Clientes │ │ Ticket │ │
809
- │ │ R$ 45.2K │ │ 342 │ │ 128 │ │ R$ 132 │ │
810
- │ │ +12% ▲ │ │ +8% ▲ │ │ +15% ▲ │ │ -3% ▼ │ │
811
- │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
812
- │ │
813
- │ ┌─────────────────────────────────┐ ┌───────────────┐ │
814
- │ │ Vendas por Mês │ │ Top Produtos │ │
815
- │ │ │ │ │ │
816
- │ │ ╭─╮ │ │ 1. Produto A │ │
817
- │ │ ╭──╯ ╰─╮ ╭──╮ │ │ 2. Produto B │ │
818
- │ │ ─╯ ╰─────╯ ╰── │ │ 3. Produto C │ │
819
- │ │ JAN FEV MAR ABR MAI │ │ │ │
820
- │ └─────────────────────────────────┘ └───────────────┘ │
821
- │ │
822
- │ ┌─────────────────────────────────────────────────────┐│
823
- │ │ Últimos Pedidos [🔍 Buscar] [➕] ││
824
- │ ├──────────┬──────────┬──────────┬─────────────────────┤│
825
- │ │ #12345 │ João S. │ R$ 250 │ [Ver] [Editar] ││
826
- │ │ #12346 │ Maria O. │ R$ 180 │ [Ver] [Editar] ││
827
- │ │ #12347 │ Pedro M. │ R$ 420 │ [Ver] [Editar] ││
828
- │ └──────────┴──────────┴──────────┴─────────────────────┘│
829
- └─────────────────────────────────────────────────────────┘
830
- ```
831
-
832
- ### Descrição
833
- - **Propósito**: Visão geral das vendas e métricas do dia
834
- - **Componentes**: 4 stat cards, 1 chart (line), 1 lista (top 5), 1 data table
835
- - **Interações**:
836
- - Stat cards: Hover mostra detalhes
837
- - Chart: Tooltip nos pontos
838
- - Tabela: Ordenar colunas, buscar, paginação
839
- - **Estados**:
840
- - Loading: Skeleton dos cards
841
- - Erro: Message bar no topo
842
- - Vazio: "Nenhuma venda hoje" com CTA
843
-
844
- ### Responsividade
845
- - **Desktop**: 4 colunas de stat cards, chart 66% + sidebar 33%
846
- - **Mobile**: Stack vertical, stat cards 100% width, chart 100%
847
- ```
848
-
849
- ### 2. ui-components.md - Specs de Componentes
850
-
851
- **Estrutura:**
852
- ```markdown
853
- # UI Components - {Feature Name}
854
-
855
- ## Biblioteca Escolhida: {Fluent UI | MudBlazor | Híbrida}
856
-
857
- ### Justificativa
858
- {Por que escolheu esta biblioteca para esta feature}
859
-
860
- ## Componentes Mapeados
861
-
862
- ### {Nome do Componente}
863
- - **Biblioteca**: {Fluent UI | MudBlazor}
864
- - **Componente**: `{ComponentName}`
865
- - **Props Principais**:
866
- - `prop1`: {descrição}
867
- - `prop2`: {descrição}
868
- - **Eventos**:
869
- - `OnClick`: {descrição}
870
- - **Estados**:
871
- - Default: {descrição}
872
- - Loading: {descrição}
873
- - Error: {descrição}
874
- - **Acessibilidade**:
875
- - ARIA: {roles/labels}
876
- - Keyboard: {navegação}
877
- ```
878
-
879
- **Exemplo:**
880
-
881
- ```markdown
882
- ## Biblioteca Escolhida: Fluent UI Blazor
883
-
884
- ### Justificativa
885
- Dashboard AI-first com chat integrado. Fluent UI oferece componentes nativos
886
- de chat (FluentMessageBar, FluentProgress) e design Microsoft 365 consistente
887
- com o restante do sistema.
888
-
889
- ## Componentes Mapeados
890
-
891
- ### Stat Card (Métricas de Vendas)
892
- - **Biblioteca**: Fluent UI
893
- - **Componente**: `FluentCard` + `FluentStack` + `FluentBadge`
894
- - **Props Principais**:
895
- - `Title`: "Vendas Hoje"
896
- - `Value`: "R$ 45.200"
897
- - `Change`: "+12%"
898
- - `IsPositive`: true
899
- - **Eventos**:
900
- - `OnClick`: Navega para detalhes da métrica
901
- - **Estados**:
902
- - Default: Mostra valor + badge de mudança
903
- - Loading: `FluentSkeleton` no lugar do valor
904
- - Error: FluentMessageBar "Erro ao carregar"
905
- - **Acessibilidade**:
906
- - ARIA: role="region" aria-label="Estatísticas de vendas"
907
- - Keyboard: Focável com Tab, Enter para expandir
908
-
909
- ### Data Table (Últimos Pedidos)
910
- - **Biblioteca**: Fluent UI
911
- - **Componente**: `FluentDataGrid<Order>`
912
- - **Props Principais**:
913
- - `Items`: `@_orders` (List<Order>)
914
- - `ResizableColumns`: true
915
- - `Virtualize`: true (se > 100 itens)
916
- - **Colunas**:
917
- 1. PropertyColumn: OrderNumber (Sortable)
918
- 2. PropertyColumn: CustomerName (Sortable)
919
- 3. PropertyColumn: Total (Format="C", Sortable)
920
- 4. TemplateColumn: Ações (Ver, Editar)
921
- - **Eventos**:
922
- - `OnRowClick`: Expande detalhes inline
923
- - **Estados**:
924
- - Empty: "Nenhum pedido encontrado" com CTA "Criar pedido"
925
- - Loading: FluentProgress acima da tabela
926
- - Error: FluentMessageBar Intent="Error"
927
- - **Acessibilidade**:
928
- - ARIA: role="grid", aria-sort nos headers
929
- - Keyboard: Navegação com setas, Enter para ações
930
- ```
931
-
932
- ### 3. ui-flows.md - Fluxos de Usuário
933
-
934
- **Estrutura:**
935
- ```markdown
936
- # UI Flows - {Feature Name}
937
-
938
- ## Fluxo 1: {Nome do Fluxo}
939
-
940
- ### Trigger
941
- {O que inicia este fluxo}
942
-
943
- ### Passos
944
- 1. **{Tela/Componente}**: {Ação do usuário}
945
- - {Resultado da ação}
946
- - {Navegação/transição}
947
-
948
- 2. **{Tela/Componente}**: {Próxima ação}
949
- ...
950
-
951
- ### Happy Path
952
- {Caminho ideal sem erros}
953
-
954
- ### Edge Cases
955
- - **{Caso}**: {Como o sistema lida}
956
-
957
- ### Diagrama
958
- [Fluxograma ASCII]
959
- ```
960
-
961
- **Exemplo:**
962
-
963
- ```markdown
964
- ## Fluxo 1: Criar Novo Pedido
965
-
966
- ### Trigger
967
- Usuário clica no botão [+ Novo Pedido] no dashboard
968
-
969
- ### Passos
970
-
971
- 1. **Dashboard**: Clica [+ Novo Pedido]
972
- - Modal/Wizard abre com Fluent UI Wizard
973
- - 3 steps: Cliente, Produtos, Revisão
974
-
975
- 2. **Step 1 - Sele ção de Cliente**:
976
- - FluentAutocomplete para buscar cliente
977
- - Ou [+ Novo Cliente] para criar inline
978
- - [Próximo] habilitado apenas se cliente selecionado
979
-
980
- 3. **Step 2 - Adicionar Produtos**:
981
- - FluentDataGrid com produtos disponíveis
982
- - Coluna com FluentNumberField para quantidade
983
- - [Adicionar] adiciona à lista do pedido
984
- - Lista de produtos adicionados (removível)
985
- - Total calculado em tempo real
986
-
987
- 4. **Step 3 - Revisão**:
988
- - FluentCard resumo do pedido
989
- - [Voltar] para editar
990
- - [Confirmar] cria o pedido
991
-
992
- 5. **Confirmação**:
993
- - FluentToast "Pedido #12348 criado com sucesso!"
994
- - Navega para detalhes do pedido OU volta ao dashboard
995
-
996
- ### Happy Path
997
- Dashboard → Wizard (3 steps) → Confirmação → Dashboard
998
-
999
- ### Edge Cases
1000
- - **Cliente não encontrado**: Oferece [+ Novo Cliente] inline
1001
- - **Produto sem estoque**: FluentMessageBar alerta, não permite adicionar
1002
- - **Rede falha no confirmar**: FluentDialog "Erro ao salvar" + [Tentar novamente]
1003
- - **Usuário fecha Wizard**: FluentDialog "Descartar pedido?" [Sim] [Não]
1004
-
1005
- ### Diagrama
1006
-
1007
- ```
1008
- [Dashboard]
1009
-
1010
- ├─[+ Novo Pedido]─┐
1011
- │ │
1012
- ▼ │
1013
- [Wizard: Step 1] │
1014
- (Cliente) │
1015
- │ │
1016
- ├─[Próximo] │
1017
- │ │
1018
- ▼ │
1019
- [Wizard: Step 2] │
1020
- (Produtos) │
1021
- │ │
1022
- ├─[Próximo] │
1023
- │ │
1024
- ▼ │
1025
- [Wizard: Step 3] │
1026
- (Revisão) │
1027
- │ │
1028
- ├─[Confirmar] │
1029
- │ │
1030
- ▼ │
1031
- [✅ Pedido Criado] │
1032
- │ │
1033
- └─────────────────┘
1034
- [Dashboard]
1035
- ```
1036
- ```
1037
-
1038
- ### Checklist para FASE 1.5
1039
-
1040
- Ao gerar deliverables de UI/UX, validar:
1041
-
1042
- - [ ] **ui-mockups.md**:
1043
- - [ ] Wireframes ASCII de TODAS as telas
1044
- - [ ] Descrições detalhadas (propósito, componentes, interações, estados)
1045
- - [ ] Responsividade especificada (desktop + mobile)
1046
- - [ ] Empty states e error states documentados
1047
-
1048
- - [ ] **ui-components.md**:
1049
- - [ ] Biblioteca escolhida justificada (Fluent UI vs MudBlazor)
1050
- - [ ] Todos os componentes mapeados (nome + props + eventos)
1051
- - [ ] Estados documentados (default, loading, error, empty)
1052
- - [ ] Acessibilidade validada (ARIA, keyboard navigation)
1053
-
1054
- - [ ] **ui-flows.md**:
1055
- - [ ] Fluxos principais identificados (happy path)
1056
- - [ ] Edge cases documentados (erro, vazio, retry)
1057
- - [ ] Diagramas ASCII de cada fluxo
1058
- - [ ] Navegação entre telas clara
1059
-
1060
- - [ ] **decisions.md** (atualizar):
1061
- - [ ] ADR: Por que Fluent UI (ou MudBlazor)?
1062
- - [ ] ADR: Por que este layout específico?
1063
- - [ ] Trade-offs discutidos (performance vs features)
1064
-
1065
- ---
1066
-
1067
- ## Documentação de Referência
1068
-
1069
- ### Fluent UI Blazor
1070
- - [Fluent UI Blazor Docs](https://www.fluentui-blazor.net/)
1071
- - [Fluent UI Blazor GitHub](https://github.com/microsoft/fluentui-blazor)
1072
- - [Components Gallery](https://www.fluentui-blazor.net/Components)
1073
- - **[Guia Completo: Fluent UI Setup](../../.morph/standards/fluent-ui-setup.md)**
1074
-
1075
- ### MudBlazor
1076
- - [MudBlazor Docs](https://mudblazor.com/)
1077
- - [Components Gallery](https://mudblazor.com/components/list)
1078
- - [GitHub](https://github.com/MudBlazor/MudBlazor)
1079
-
1080
- ### Design & Acessibilidade
1081
- - [WCAG Guidelines](https://www.w3.org/WAI/WCAG21/quickref/)
1082
- - [Microsoft Fluent Design System](https://fluent2.microsoft.design/)
1083
- - [Material Design](https://m3.material.io/)
1084
- - [Blazor Components](https://learn.microsoft.com/aspnet/core/blazor/components/)
1085
-
1086
- ## Checklist de UI
1087
-
1088
- - [ ] Hierarquia visual clara
1089
- - [ ] Cores do sistema de design
1090
- - [ ] Espaçamento consistente (múltiplos de 4px)
1091
- - [ ] Responsivo (mobile-first)
1092
- - [ ] Estados: hover, focus, disabled, error
1093
- - [ ] Loading states (skeleton/spinner)
1094
- - [ ] Empty states informativos
1095
- - [ ] Mensagens de erro claras
1096
- - [ ] Acessibilidade básica (WCAG AA)
1097
-
1098
- ---
1099
-
1100
- *MORPH-SPEC by Polymorphism Tech*
1
+ # UI/UX Designer
2
+
3
+ Especialista em design de interfaces, UX e componentes Blazor. Domina **Fluent UI Blazor** e **MudBlazor**.
4
+
5
+ > **FASE 1.5: UI/UX DESIGN** - Obrigatória para features com front-end.
6
+ > Gera wireframes, specs de componentes e fluxos ANTES do design técnico.
7
+ > **Ref:** `framework/standards/fluent-ui-blazor.md` para API details e armadilhas.
8
+
9
+ ## Triggers
10
+
11
+ Keywords: `blazor`, `component`, `page`, `ui`, `ux`, `design`, `layout`, `wizard`, `dashboard`, `form`, `chart`, `table`, `dialog`, `modal`, `tela`, `interface`, `formulário`
12
+
13
+ ---
14
+
15
+ ## Design Moderno (2025+)
16
+
17
+ ### Visual Trends
18
+ - **Glassmorphism**: `backdrop-filter: blur(10px)`, semi-transparent backgrounds
19
+ - **Gradients**: Purple (#667eea #764ba2), Blue-Purple (#4facfe → #00f2fe)
20
+ - **Soft Shadows**: `box-shadow: 0 4px 6px rgba(0,0,0,0.1)`
21
+ - **Rounded Corners**: `border-radius: 12px-16px`
22
+ - **Micro-interactions**: Hover effects, transitions (transform, scale, opacity)
23
+
24
+ ### Component Patterns
25
+ - Cards with elevation + hover lift
26
+ - Skeleton loaders (not just spinners)
27
+ - Toast notifications (bottom-right, auto-dismiss)
28
+ - Empty states with illustration + CTA
29
+ - Dark mode support (always design for both)
30
+
31
+ ### Layout Principles
32
+ - Whitespace: 32px-48px container padding
33
+ - Grid: 12-column, gap 24px-32px
34
+ - Typography: xs:12, sm:14, base:16, lg:18, xl:20, 2xl:24
35
+ - Contrast: WCAG AA (4.5:1 text, 3:1 UI)
36
+
37
+ ### Design References
38
+ Linear (linear.app), Vercel (vercel.com), Stripe (stripe.com), Dribbble dashboards
39
+
40
+ ---
41
+
42
+ ## FASE 1.5 Workflow
43
+
44
+ ### Step 1: Collect User Input (ALWAYS ask first)
45
+
46
+ 1. Layout ideas or reference sites?
47
+ 2. Visual references (screenshots, mockups)?
48
+ 3. User flow expectations?
49
+ 4. Design system defined (colors, fonts, spacing)?
50
+ 5. Image examples to analyze?
51
+
52
+ If user provides screenshots → Read tool → extract patterns (layout, components, colors).
53
+ If HTML prototype exists extract patterns automatically, skip wireframes, map HTML → Blazor.
54
+
55
+ ### Step 2: Generate Deliverables
56
+
57
+ | File | Content |
58
+ |------|---------|
59
+ | `ui-design-system.md` | Colors, typography, spacing |
60
+ | `ui-mockups.md` | ASCII wireframes + descriptions per screen |
61
+ | `ui-components.md` | Component specs (library-agnostic first, library choice in FASE 2) |
62
+ | `ui-flows.md` | User flow diagrams + edge cases |
63
+
64
+ **Important:** Generate specs AGNOSTIC of UI library. Use generic names ("primary button", "card", "table"). Library choice happens in FASE 2: DESIGN.
65
+
66
+ ### Step 3: Present for Approval
67
+
68
+ Show deliverable summary **⛔ PAUSE** with 3 options (approve / adjust wireframes / add flows).
69
+
70
+ ---
71
+
72
+ ## Fluent UI vs MudBlazor Decision Matrix
73
+
74
+ | Criterion | Fluent UI Blazor | MudBlazor |
75
+ |-----------|------------------|-----------|
76
+ | AI-first projects | Ideal (native components) | Requires customization |
77
+ | Performance | ~200KB | ~500KB |
78
+ | Microsoft Stack | Perfect integration | Works well |
79
+ | Complex components | Limited | Very complete |
80
+ | Community | Smaller (newer) | Larger |
81
+ | Maturity | v4.0 (recent) | v6.x (stable) |
82
+
83
+ **Use Fluent UI if:** AI-first, Microsoft stack, modern M365 design, performance critical.
84
+ **Use MudBlazor if:** Complex dashboards, Material Design, need TreeView/advanced DataGrid, larger community.
85
+ **Hybrid:** Fluent UI (base) + MudBlazor (specific complex components).
86
+
87
+ ---
88
+
89
+ ## Fluent UI Quick Reference
90
+
91
+ > **Full details:** `framework/standards/fluent-ui-blazor.md`
92
+
93
+ ### Common Pitfalls
94
+
95
+ | Issue | Wrong | Correct |
96
+ |-------|-------|---------|
97
+ | Icon sizes | `Size16`, `Size14` | `Size20`, `Size24`, `Size28`, `Size32`, `Size48` |
98
+ | Icon namespace | `@using ...Icons` | `@using Icons = Microsoft.FluentUI.AspNetCore.Components.Icons` |
99
+ | Toast methods | `await ShowSuccessAsync()` | `ToastService.ShowSuccess()` (sync!) |
100
+ | Dialog show | `await _dialog.ShowAsync()` | `_dialog.Show()` (sync!) |
101
+ | Dialog close | `_dialog.Hide()` | `await _dialog.CloseAsync()` (async!) |
102
+ | Dialog init | `<FluentDialog>` | `<FluentDialog Hidden="true">` (must hide initially!) |
103
+
104
+ ### Key Components
105
+
106
+ | Component | Use Case |
107
+ |-----------|----------|
108
+ | `FluentCard` + `FluentStack` | Containers, dashboards |
109
+ | `FluentDataGrid` | Data tables with sorting |
110
+ | `FluentWizard` | Multi-step flows |
111
+ | `FluentDialog` | Modals, confirmations |
112
+ | `FluentMessageBar` | Chat, notifications |
113
+ | `FluentProgress` | Loading, streaming |
114
+ | `FluentTextField` | Text inputs |
115
+ | `FluentToast` | System feedback |
116
+
117
+ ---
118
+
119
+ ## MudBlazor Key Components
120
+
121
+ | Component | Advantage over Fluent |
122
+ |-----------|----------------------|
123
+ | `MudDataGrid` | Grouping, advanced filtering |
124
+ | `MudTreeView` | More complete hierarchies |
125
+ | `MudChart` | Native charts (Fluent has none) |
126
+ | `MudFileUpload` | More upload features |
127
+ | `MudAutocomplete` | Better performance |
128
+
129
+ ---
130
+
131
+ ## Design System Defaults
132
+
133
+ ```css
134
+ /* Colors */
135
+ --primary: #3b82f6; --secondary: #6b7280;
136
+ --success: #10b981; --warning: #f59e0b;
137
+ --danger: #ef4444; --info: #06b6d4;
138
+
139
+ /* Spacing (4px system) */
140
+ --space-1: 0.25rem; --space-2: 0.5rem; --space-4: 1rem;
141
+ --space-6: 1.5rem; --space-8: 2rem;
142
+ ```
143
+
144
+ ---
145
+
146
+ ## Generating Deliverables
147
+
148
+ ### ui-mockups.md Structure
149
+
150
+ Per screen: ASCII wireframe + description (purpose, components, interactions, states) + responsiveness (desktop/mobile).
151
+
152
+ ### ui-components.md Structure
153
+
154
+ Per component: Library, component name, main props, events, states (default/loading/error/empty), accessibility (ARIA, keyboard).
155
+
156
+ ### ui-flows.md Structure
157
+
158
+ Per flow: Trigger, steps, happy path, edge cases, ASCII flowchart diagram.
159
+
160
+ ---
161
+
162
+ ## Accessibility (A11y)
163
+
164
+ - Contrast: 4.5:1 text minimum (WCAG AA)
165
+ - Focus visible: Outline on focusable elements
166
+ - Labels: Every input with associated label
167
+ - ARIA: Roles and labels where needed
168
+ - Keyboard nav: Logical tab order
169
+
170
+ ---
171
+
172
+ ## Checklist
173
+
174
+ ### FASE 1.5 Deliverables
175
+ - [ ] `ui-mockups.md`: Wireframes for ALL screens + states (loading, error, empty) + responsiveness
176
+ - [ ] `ui-components.md`: Library justified + all components mapped with props/events/states
177
+ - [ ] `ui-flows.md`: Happy paths + edge cases + ASCII diagrams
178
+ - [ ] `decisions.md`: Updated with UI library ADR
179
+
180
+ ### UI Quality
181
+ - [ ] Visual hierarchy clear
182
+ - [ ] Consistent spacing (4px multiples)
183
+ - [ ] Responsive (mobile-first)
184
+ - [ ] States: hover, focus, disabled, error
185
+ - [ ] Loading states (skeleton/spinner)
186
+ - [ ] Empty states with CTA
187
+ - [ ] WCAG AA accessibility
188
+
189
+ ---
190
+
191
+ *MORPH-SPEC by Polymorphism Tech*