@polymorphism-tech/morph-spec 2.2.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 -1673
  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 -173
  6. package/bin/render-template.js +302 -302
  7. package/bin/semantic-detect-agents.js +246 -246
  8. package/bin/task-manager.js +429 -0
  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 -0
  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 -200
  47. package/content/.claude/skills/specialists/hangfire-orchestrator.md +126 -245
  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 -1060
  53. package/content/.claude/skills/stacks/dotnet-blazor.md +210 -588
  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 -0
  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 -0
  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 -0
  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 -0
  223. package/src/lib/mockup-generator.js +366 -0
  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 -0
  229. package/src/lib/validation-runner.js +231 -0
  230. package/src/lib/validators/architecture-validator.js +387 -0
  231. package/src/lib/validators/contract-compliance-validator.js +273 -0
  232. package/src/lib/validators/package-validator.js +360 -0
  233. package/src/lib/validators/ui-contrast-validator.js +422 -0
  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,1060 +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
- ## Deliverables da FASE 1.5
23
-
24
- | Arquivo | Conteúdo |
25
- |---------|----------|
26
- | `ui-design-system.md` | Design system: cores, tipografia, spacing, etc |
27
- | `ui-mockups.md` | Wireframes (ASCII art) + descrições de cada tela |
28
- | `ui-components.md` | Specs dos componentes Fluent UI/MudBlazor a usar |
29
- | `ui-flows.md` | Diagramas de fluxo do usuário e navegação |
30
-
31
- ---
32
-
33
- ## Workflow da FASE 1.5: UI/UX Design
34
-
35
- ### Passo 1: Coletar Input do Usuário
36
-
37
- **SEMPRE pergunte ao usuário ANTES de gerar os deliverables:**
38
-
39
- 1. **"Você tem alguma ideia de layout em mente?"**
40
- - Se SIM: Peça que descreva ou mostre exemplo
41
- - Se NÃO: Você propõe baseado em best practices
42
-
43
- 2. **"Tem alguma referência visual que gostaria de seguir?"**
44
- - Sites/apps similares
45
- - Screenshots/mockups existentes
46
- - Design system específico
47
-
48
- 3. **"Como você imagina o fluxo do usuário?"**
49
- - Passos principais que o usuário deve seguir
50
- - Pontos de decisão importantes
51
- - Onde pode haver confusão/dificuldade
52
-
53
- 4. **"Tem imagens de exemplo ou screenshots?"**
54
- - Se SIM: Use o Read tool para ler a imagem e baseie o design nela
55
- - Analise a imagem e extraia padrões de layout, componentes, cores
56
-
57
- 5. **"Este projeto tem um design system definido?"**
58
- - Cores (primária, secundária, sucesso, erro, etc)?
59
- - Tipografia (fontes, tamanhos)?
60
- - Espaçamento (sistema de 4px, 8px?)?
61
- - Se NÃO: Propor baseado em best practices
62
-
63
- 6. **Design System - Cores:**
64
- - Primária: (ex: #3b82f6 - Blue)
65
- - Secundária: (ex: #6b7280 - Gray)
66
- - Sucesso: (ex: #10b981 - Green)
67
- - Erro: (ex: #ef4444 - Red)
68
- - Warning: (ex: #f59e0b - Amber)
69
- - Info: (ex: #06b6d4 - Cyan)
70
- - Neutros: Escala de cinzas (50, 100, ..., 900)?
71
-
72
- 7. **Design System - Tipografia:**
73
- - Font family principal: (ex: Inter, Roboto, System)
74
- - Font family secundária: (ex: monospace para código)
75
- - Tamanhos: Usar escala padrão (xs, sm, base, lg, xl)?
76
-
77
- 8. **Design System - Espaçamento:**
78
- - Sistema base: 4px, 8px ou outro?
79
- - Escala: Padrão Tailwind (0.25rem, 0.5rem, 1rem) ou custom?
80
-
81
- #### Exemplo de Interação
82
-
83
- ```markdown
84
- **PAUSA OBRIGATÓRIA - FASE 1.5: UI/UX DESIGN**
85
-
86
- Detectei que esta feature envolve front-end. Antes de criar os wireframes e specs,
87
- gostaria de entender sua visão:
88
-
89
- **Perguntas:**
90
-
91
- 1. **Layout**: Você tem alguma ideia de layout em mente? Algum site/app de referência?
92
- - Exemplos: Dashboard estilo Vercel, Wizard estilo Stripe, Chat estilo ChatGPT
93
-
94
- 2. **Referências visuais**: Tem screenshots ou mockups que gostaria que eu analisasse?
95
- - Se sim, me passe o caminho do arquivo e usarei como base
96
-
97
- 3. **Fluxo**: Como você imagina que o usuário navegará pela feature?
98
- - Ex: "Usuário abre modal preenche form confirma volta ao dashboard"
99
-
100
- 4. **Preferências**:
101
- - Design mais minimalista ou rico em informações?
102
- - Mobile-first ou desktop-first?
103
- - Preferência por Fluent UI ou MudBlazor?
104
-
105
- 5. **Design System**:
106
- - Projeto tem design system definido (cores, fonts, spacing)?
107
- - Se não, quer que eu proponha um baseado em best practices?
108
-
109
- **Próximos passos sugeridos:**
110
-
111
- 1. **Responder perguntas acima e eu gero wireframes + design system**
112
- 2. 💡 **Pular perguntas e confiar em mim (uso best practices padrão)**
113
- 3. 🖼️ **Compartilhar imagens de referência primeiro**
114
- ```
115
-
116
- ### Passo 2: Analisar Imagens (se fornecidas)
117
-
118
- Se o usuário fornecer screenshots/mockups:
119
-
120
- ```markdown
121
- **Analisando imagem fornecida...**
122
-
123
- Identifiquei os seguintes padrões:
124
-
125
- **Layout:**
126
- - Grid de 3 colunas
127
- - Sidebar fixa à esquerda
128
- - Header com breadcrumbs
129
-
130
- **Componentes principais:**
131
- - 4 stat cards no topo
132
- - Data table com paginação
133
- - Gráfico de linha (vendas)
134
-
135
- **Cores:**
136
- - Primária: Azul (#3b82f6)
137
- - Fundo: Cinza claro (#f9fafb)
138
-
139
- Vou usar isso como base para os wireframes. Confirma?
140
- ```
141
-
142
- ### Passo 3: Gerar Deliverables
143
-
144
- Após coletar input, gerar:
145
- 1. `ui-design-system.md` (cores, tipografia, spacing do projeto)
146
- 2. `ui-mockups.md` (wireframes baseados no design system)
147
- 3. `ui-components.md` (biblioteca escolhida justificada)
148
- 4. `ui-flows.md` (fluxos validados com usuário)
149
-
150
- ### Passo 4: Apresentar para Aprovação
151
-
152
- ```markdown
153
- ⛔ **PAUSA OBRIGATÓRIA**
154
-
155
- Gerei os seguintes deliverables de UI/UX:
156
-
157
- 📄 **ui-design-system.md**:
158
- - Paleta de cores completa (primária, secundária, estados)
159
- - Tipografia (fonts, tamanhos, weights)
160
- - Espaçamento (escala de 4px)
161
- - Border radius, shadows, breakpoints
162
-
163
- 📄 **ui-mockups.md**:
164
- - 3 telas mapeadas com wireframes ASCII
165
- - Estados (loading, error, empty) documentados
166
- - Responsividade especificada
167
- - Cores/fonts do design system aplicados
168
-
169
- 📄 **ui-components.md**:
170
- - Biblioteca: Fluent UI Blazor (justificado)
171
- - 8 componentes mapeados
172
- - Props e eventos especificados
173
- - Temas/cores configurados
174
-
175
- 📄 **ui-flows.md**:
176
- - Happy path + 3 edge cases
177
- - Diagramas de navegação
178
-
179
- **Próximos passos:**
180
-
181
- 1. **Aprovar UI/UX e continuar para FASE 2: DESIGN TÉCNICO**
182
- 2. 🎨 **Ajustar wireframes de telas específicas**
183
- 3. 🔄 **Revisar biblioteca UI escolhida**
184
- 4. 📋 **Adicionar mais fluxos/edge cases**
185
- ```
186
-
187
- ---
188
-
189
- ## 🎨 Fluent UI Blazor vs MudBlazor
190
-
191
- ### Matriz de Decisão
192
-
193
- | Critério | Fluent UI Blazor ⭐ | MudBlazor |
194
- |----------|---------------------|-----------|
195
- | **Projetos AI-first** | ✅ Ideal (componentes nativos) | ⚠️ Requer customização |
196
- | **Micro-SaaS** | ✅ Design Microsoft 365 | ✅ Design Material |
197
- | **Performance** | ✅ ~200KB | ⚠️ ~500KB |
198
- | **Microsoft Stack** | ✅ Integração perfeita | ✅ Funciona bem |
199
- | **Componentes Complexos** | ⚠️ Limitado (mais simples) | ✅ Muito completo |
200
- | **Comunidade** | ⚠️ Menor (mais novo) | ✅ Grande |
201
- | **Maturidade** | ⚠️ v4.0 (recente) | ✅ v6.x (estável) |
202
-
203
- ### Quando Usar Cada Um
204
-
205
- **Use Fluent UI Blazor se:**
206
- - ✅ Projeto AI-first (chat, assistentes, streaming)
207
- - ✅ Stack Microsoft (Agent Framework, Aspire, Azure)
208
- - ✅ Design moderno Microsoft 365
209
- - ✅ Performance crítica
210
- - ✅ Integração com Aspire Dashboard
211
-
212
- **Use MudBlazor se:**
213
- - ✅ Dashboards complexos com muitos componentes
214
- - ✅ Preferência por Material Design
215
- - ✅ Precisa de componentes avançados (TreeView, DataGrid avançado)
216
- - ✅ Comunidade maior e mais exemplos
217
- - ✅ Projeto não-AI ou backend-heavy
218
-
219
- **Abordagem Híbrida:**
220
- Fluent UI (base) + MudBlazor (componentes específicos complexos)
221
-
222
- ---
223
-
224
- ## 🚀 Fluent UI Blazor - Componentes AI-First
225
-
226
- > **Recomendado para MORPH-SPEC** - Alinhado com .NET 10 + Agent Framework
227
-
228
- ### Setup Rápido
229
-
230
- ```csharp
231
- // Program.cs
232
- builder.Services.AddFluentUIComponents();
233
- ```
234
-
235
- ```razor
236
- // _Imports.razor
237
- @using Microsoft.FluentUI.AspNetCore.Components
238
- ```
239
-
240
- ### Componentes Principais
241
-
242
- #### 1. Chat / Conversação
243
-
244
- ```razor
245
- <!-- Chat Container com streaming -->
246
- <FluentStack Orientation="Orientation.Vertical" Style="height: 100vh;">
247
- <!-- Header -->
248
- <FluentToolbar>
249
- <FluentLabel Typo="Typography.H4">AI Assistant</FluentLabel>
250
- </FluentToolbar>
251
-
252
- <!-- Messages -->
253
- <FluentStack Orientation="Orientation.Vertical"
254
- Style="flex: 1; overflow-y: auto; padding: 1rem;">
255
- @foreach (var msg in _messages)
256
- {
257
- <FluentMessageBar Intent="@(msg.IsUser ? MessageIntent.Info : MessageIntent.Success)"
258
- Style="@(msg.IsUser ? "align-self: flex-end;" : "align-self: flex-start;")">
259
- <FluentLabel Weight="FontWeight.Bold">@msg.Sender</FluentLabel>
260
- <FluentLabel>@msg.Text</FluentLabel>
261
- </FluentMessageBar>
262
- }
263
-
264
- @if (_isTyping)
265
- {
266
- <FluentProgress />
267
- }
268
- </FluentStack>
269
-
270
- <!-- Input -->
271
- <FluentStack Orientation="Orientation.Horizontal" Style="padding: 1rem;">
272
- <FluentTextField @bind-Value="_input"
273
- Placeholder="Digite sua mensagem..."
274
- Style="flex: 1;" />
275
- <FluentButton Appearance="Appearance.Accent"
276
- OnClick="SendMessage"
277
- Disabled="_isTyping">
278
- Enviar
279
- </FluentButton>
280
- </FluentStack>
281
- </FluentStack>
282
- ```
283
-
284
- #### 2. Dashboard com Cards
285
-
286
- ```razor
287
- <FluentGrid Spacing="3">
288
- <FluentGridItem xs="12" sm="6" md="3">
289
- <FluentCard>
290
- <FluentStack Orientation="Orientation.Vertical">
291
- <FluentLabel Typo="Typography.Body">Vendas Hoje</FluentLabel>
292
- <FluentLabel Typo="Typography.H3">R$ 12.450</FluentLabel>
293
- <FluentBadge Appearance="Appearance.Success">+12%</FluentBadge>
294
- </FluentStack>
295
- </FluentCard>
296
- </FluentGridItem>
297
- <!-- More cards... -->
298
- </FluentGrid>
299
- ```
300
-
301
- #### 3. Wizard / Multi-Step
302
-
303
- ```razor
304
- <FluentWizard @bind-Value="_currentStep" DisplayStepNumber="true">
305
- <Steps>
306
- <FluentWizardStep Label="Informações Básicas" Icon="Info">
307
- <FluentTextField @bind-Value="_model.Name" Label="Nome" Required />
308
- <FluentTextField @bind-Value="_model.Email" Label="Email" Required />
309
- </FluentWizardStep>
310
-
311
- <FluentWizardStep Label="Preferências" Icon="Settings">
312
- <FluentSwitch @bind-Value="_model.Newsletter" Label="Receber newsletter" />
313
- </FluentWizardStep>
314
-
315
- <FluentWizardStep Label="Confirmação" Icon="CheckMark">
316
- <FluentLabel>Revise suas informações...</FluentLabel>
317
- </FluentWizardStep>
318
- </Steps>
319
- </FluentWizard>
320
- ```
321
-
322
- #### 4. Data Table
323
-
324
- ```razor
325
- <FluentDataGrid Items="@_orders" ResizableColumns="true">
326
- <PropertyColumn Property="@(o => o.OrderNumber)" Title="Pedido" Sortable="true" />
327
- <PropertyColumn Property="@(o => o.Customer)" Title="Cliente" Sortable="true" />
328
- <PropertyColumn Property="@(o => o.Total)" Title="Total" Format="C" Sortable="true" />
329
- <TemplateColumn Title="Status">
330
- <FluentBadge Appearance="@GetStatusAppearance(context.Status)">
331
- @context.Status
332
- </FluentBadge>
333
- </TemplateColumn>
334
- <TemplateColumn Title="Ações">
335
- <FluentButton Appearance="Appearance.Lightweight" OnClick="@(() => ViewOrder(context))">
336
- Ver
337
- </FluentButton>
338
- </TemplateColumn>
339
- </FluentDataGrid>
340
- ```
341
-
342
- ### Fluent UI - Componentes Essenciais
343
-
344
- | Componente | Uso | AI-First? |
345
- |------------|-----|-----------|
346
- | `FluentMessageBar` | Chat, notificações | ✅ |
347
- | `FluentProgress` | Loading, streaming | ✅ |
348
- | `FluentCard` | Containers, dashboards | ✅ |
349
- | `FluentDataGrid` | Tabelas de dados | ⚠️ |
350
- | `FluentWizard` | Fluxos multi-etapa | ⚠️ |
351
- | `FluentDialog` | Modals, confirmações | ✅ |
352
- | `FluentToast` | Feedback do sistema | ✅ |
353
- | `FluentTextField` | Inputs de texto | ✅ |
354
-
355
- ---
356
-
357
- ## 🎯 MudBlazor - Componentes Complexos
358
-
359
- > **Usar quando** precisar de componentes avançados não disponíveis em Fluent UI
360
-
361
- ### Setup Rápido
362
-
363
- ```csharp
364
- // Program.cs
365
- builder.Services.AddMudServices();
366
- ```
367
-
368
- ```razor
369
- // _Imports.razor
370
- @using MudBlazor
371
- ```
372
-
373
- ### Componentes Diferenciados
374
-
375
- #### 1. TreeView Avançado
376
-
377
- ```razor
378
- <MudTreeView T="FileNode" Items="@_fileTree" @bind-SelectedValue="_selectedFile">
379
- <ItemTemplate Context="node">
380
- <MudTreeViewItem @bind-Expanded="@node.IsExpanded"
381
- Items="@node.Children"
382
- Value="@node"
383
- Icon="@node.Icon"
384
- Text="@node.Name" />
385
- </ItemTemplate>
386
- </MudTreeView>
387
- ```
388
-
389
- #### 2. DataGrid Avançado
390
-
391
- ```razor
392
- <MudDataGrid T="Order" Items="@_orders"
393
- Filterable="true"
394
- Groupable="true"
395
- QuickFilter="@_quickFilter"
396
- ColumnResizeMode="ResizeMode.Container">
397
- <Columns>
398
- <PropertyColumn Property="x => x.OrderNumber" Title="Pedido" />
399
- <PropertyColumn Property="x => x.Total" Title="Total" CellStyle="text-align: right;" />
400
- <TemplateColumn CellClass="d-flex justify-end">
401
- <CellTemplate>
402
- <MudStack Row>
403
- <MudButton Size="Size.Small" OnClick="@(() => Edit(context.Item))">
404
- Editar
405
- </MudButton>
406
- </MudStack>
407
- </CellTemplate>
408
- </TemplateColumn>
409
- </Columns>
410
- </MudDataGrid>
411
- ```
412
-
413
- #### 3. Charts
414
-
415
- ```razor
416
- <MudChart ChartType="ChartType.Line"
417
- ChartSeries="@_series"
418
- XAxisLabels="@_xLabels"
419
- Width="100%"
420
- Height="350px" />
421
-
422
- @code {
423
- private List<ChartSeries> _series = new()
424
- {
425
- new ChartSeries { Name = "Vendas", Data = new double[] { 90, 79, 72, 69, 62, 58 } }
426
- };
427
- }
428
- ```
429
-
430
- ### MudBlazor - Componentes Essenciais
431
-
432
- | Componente | Uso | Vantagem sobre Fluent |
433
- |------------|-----|----------------------|
434
- | `MudDataGrid` | Tabelas complexas | Grouping, filtering avançado |
435
- | `MudTreeView` | Hierarquias | Mais completo |
436
- | `MudChart` | Gráficos | Nativo (Fluent não tem) |
437
- | `MudFileUpload` | Upload de arquivos | Mais features |
438
- | `MudAutocomplete` | Autocomplete | Performance melhor |
439
-
440
- ---
441
-
442
- ## Princípios de Design
443
-
444
- ### Hierarquia Visual
445
-
446
- 1. **Títulos**: Grande, bold, alto contraste
447
- 2. **Conteúdo principal**: Tamanho médio, legível
448
- 3. **Informações secundárias**: Menor, cor mais suave
449
- 4. **Ações**: Botões destacados, CTAs claros
450
-
451
- ### Cores (Sistema)
452
-
453
- ```css
454
- /* Tailwind/Bootstrap inspired */
455
- --primary: #3b82f6; /* Ações principais */
456
- --secondary: #6b7280; /* Ações secundárias */
457
- --success: #10b981; /* Sucesso, confirmação */
458
- --warning: #f59e0b; /* Alertas */
459
- --danger: #ef4444; /* Erros, exclusão */
460
- --info: #06b6d4; /* Informativo */
461
- ```
462
-
463
- ### Espaçamento
464
-
465
- ```css
466
- /* Sistema de 4px */
467
- --space-1: 0.25rem; /* 4px */
468
- --space-2: 0.5rem; /* 8px */
469
- --space-3: 0.75rem; /* 12px */
470
- --space-4: 1rem; /* 16px */
471
- --space-6: 1.5rem; /* 24px */
472
- --space-8: 2rem; /* 32px */
473
- ```
474
-
475
- ## Componentes Comuns
476
-
477
- ### Card
478
-
479
- ```razor
480
- <!-- Components/Card.razor -->
481
- <div class="bg-white rounded-lg shadow-md p-6 @Class">
482
- @if (Title is not null)
483
- {
484
- <h3 class="text-lg font-semibold text-gray-900 mb-4">@Title</h3>
485
- }
486
-
487
- <div class="@BodyClass">
488
- @ChildContent
489
- </div>
490
-
491
- @if (Footer is not null)
492
- {
493
- <div class="mt-4 pt-4 border-t border-gray-200">
494
- @Footer
495
- </div>
496
- }
497
- </div>
498
-
499
- @code {
500
- [Parameter] public string? Title { get; set; }
501
- [Parameter] public RenderFragment? ChildContent { get; set; }
502
- [Parameter] public RenderFragment? Footer { get; set; }
503
- [Parameter] public string? Class { get; set; }
504
- [Parameter] public string? BodyClass { get; set; }
505
- }
506
- ```
507
-
508
- ### Stat Card (Dashboard)
509
-
510
- ```razor
511
- <!-- Components/StatCard.razor -->
512
- <div class="bg-white rounded-lg shadow p-6">
513
- <div class="flex items-center justify-between">
514
- <div>
515
- <p class="text-sm font-medium text-gray-600">@Label</p>
516
- <p class="text-2xl font-bold text-gray-900">@Value</p>
517
- @if (Change is not null)
518
- {
519
- <p class="text-sm @(IsPositive ? "text-green-600" : "text-red-600")">
520
- @(IsPositive ? "+" : "")@Change
521
- </p>
522
- }
523
- </div>
524
- <div class="p-3 bg-@Color-100 rounded-full">
525
- <Icon Name="@IconName" Class="w-6 h-6 text-@Color-600" />
526
- </div>
527
- </div>
528
- </div>
529
-
530
- @code {
531
- [Parameter, EditorRequired] public string Label { get; set; } = "";
532
- [Parameter, EditorRequired] public string Value { get; set; } = "";
533
- [Parameter] public string? Change { get; set; }
534
- [Parameter] public bool IsPositive { get; set; }
535
- [Parameter] public string Color { get; set; } = "blue";
536
- [Parameter] public string IconName { get; set; } = "chart-bar";
537
- }
538
- ```
539
-
540
- ### Wizard/Stepper
541
-
542
- ```razor
543
- <!-- Components/Wizard.razor -->
544
- <div class="w-full">
545
- <!-- Steps indicator -->
546
- <div class="flex items-center justify-between mb-8">
547
- @for (int i = 0; i < Steps.Count; i++)
548
- {
549
- var step = Steps[i];
550
- var isCompleted = i < CurrentStep;
551
- var isCurrent = i == CurrentStep;
552
-
553
- <div class="flex items-center @(i < Steps.Count - 1 ? "flex-1" : "")">
554
- <div class="flex items-center">
555
- <span class="w-10 h-10 rounded-full flex items-center justify-center
556
- @(isCompleted ? "bg-green-500 text-white" :
557
- isCurrent ? "bg-blue-500 text-white" :
558
- "bg-gray-200 text-gray-600")">
559
- @if (isCompleted)
560
- {
561
- <Icon Name="check" Class="w-5 h-5" />
562
- }
563
- else
564
- {
565
- @(i + 1)
566
- }
567
- </span>
568
- <span class="ml-2 text-sm font-medium
569
- @(isCurrent ? "text-blue-600" : "text-gray-500")">
570
- @step.Title
571
- </span>
572
- </div>
573
-
574
- @if (i < Steps.Count - 1)
575
- {
576
- <div class="flex-1 h-1 mx-4 @(isCompleted ? "bg-green-500" : "bg-gray-200")">
577
- </div>
578
- }
579
- </div>
580
- }
581
- </div>
582
-
583
- <!-- Current step content -->
584
- <div class="mb-8">
585
- @Steps[CurrentStep].Content
586
- </div>
587
-
588
- <!-- Navigation -->
589
- <div class="flex justify-between">
590
- <button @onclick="Previous" disabled="@(CurrentStep == 0)"
591
- class="px-4 py-2 text-gray-600 disabled:opacity-50">
592
- Voltar
593
- </button>
594
-
595
- @if (CurrentStep < Steps.Count - 1)
596
- {
597
- <button @onclick="Next"
598
- class="px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600">
599
- Próximo
600
- </button>
601
- }
602
- else
603
- {
604
- <button @onclick="Complete"
605
- class="px-4 py-2 bg-green-500 text-white rounded hover:bg-green-600">
606
- Concluir
607
- </button>
608
- }
609
- </div>
610
- </div>
611
-
612
- @code {
613
- [Parameter] public List<WizardStep> Steps { get; set; } = new();
614
- [Parameter] public EventCallback OnComplete { get; set; }
615
-
616
- private int CurrentStep { get; set; }
617
-
618
- private void Next() => CurrentStep++;
619
- private void Previous() => CurrentStep--;
620
- private async Task Complete() => await OnComplete.InvokeAsync();
621
-
622
- public record WizardStep(string Title, RenderFragment Content);
623
- }
624
- ```
625
-
626
- ### Data Table
627
-
628
- ```razor
629
- <!-- Components/DataTable.razor -->
630
- @typeparam TItem
631
-
632
- <div class="overflow-x-auto">
633
- <table class="min-w-full divide-y divide-gray-200">
634
- <thead class="bg-gray-50">
635
- <tr>
636
- @HeaderTemplate
637
- </tr>
638
- </thead>
639
- <tbody class="bg-white divide-y divide-gray-200">
640
- @if (Items is null || !Items.Any())
641
- {
642
- <tr>
643
- <td colspan="100" class="px-6 py-4 text-center text-gray-500">
644
- @EmptyMessage
645
- </td>
646
- </tr>
647
- }
648
- else
649
- {
650
- @foreach (var item in Items)
651
- {
652
- <tr class="hover:bg-gray-50">
653
- @RowTemplate(item)
654
- </tr>
655
- }
656
- }
657
- </tbody>
658
- </table>
659
- </div>
660
-
661
- @code {
662
- [Parameter] public IEnumerable<TItem>? Items { get; set; }
663
- [Parameter] public RenderFragment? HeaderTemplate { get; set; }
664
- [Parameter] public RenderFragment<TItem> RowTemplate { get; set; } = default!;
665
- [Parameter] public string EmptyMessage { get; set; } = "Nenhum registro encontrado.";
666
- }
667
- ```
668
-
669
- ## Padrões de Layout
670
-
671
- ### Dashboard Layout
672
-
673
- ```razor
674
- <div class="min-h-screen bg-gray-100">
675
- <!-- Sidebar -->
676
- <aside class="fixed inset-y-0 left-0 w-64 bg-white shadow-lg">
677
- <!-- Sidebar content -->
678
- </aside>
679
-
680
- <!-- Main content -->
681
- <main class="ml-64 p-8">
682
- <!-- Header -->
683
- <header class="mb-8">
684
- <h1 class="text-2xl font-bold text-gray-900">Dashboard</h1>
685
- </header>
686
-
687
- <!-- Stats grid -->
688
- <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
689
- <StatCard Label="Vendas" Value="R$ 12.450" Change="+12%" IsPositive />
690
- <!-- More stats -->
691
- </div>
692
-
693
- <!-- Content grid -->
694
- <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
695
- <Card Title="Pedidos Recentes" Class="lg:col-span-2">
696
- <!-- Table -->
697
- </Card>
698
- <Card Title="Atividade">
699
- <!-- Activity feed -->
700
- </Card>
701
- </div>
702
- </main>
703
- </div>
704
- ```
705
-
706
- ## Acessibilidade (A11y)
707
-
708
- 1. **Contraste**: Mínimo 4.5:1 para texto
709
- 2. **Focus visible**: Outline em elementos focáveis
710
- 3. **Labels**: Todo input com label associado
711
- 4. **ARIA**: Roles e labels onde necessário
712
- 5. **Keyboard nav**: Tab order lógico
713
-
714
- ```razor
715
- <!-- Exemplo acessível -->
716
- <label for="email" class="block text-sm font-medium text-gray-700">
717
- Email
718
- </label>
719
- <input
720
- id="email"
721
- type="email"
722
- aria-describedby="email-hint"
723
- class="mt-1 block w-full rounded-md border-gray-300 shadow-sm
724
- focus:border-blue-500 focus:ring-blue-500" />
725
- <p id="email-hint" class="mt-1 text-sm text-gray-500">
726
- Usaremos para enviar atualizações.
727
- </p>
728
- ```
729
-
730
- ---
731
-
732
- ## 📐 Como Gerar os Deliverables (FASE 1.5)
733
-
734
- ### 1. ui-mockups.md - Wireframes ASCII
735
-
736
- **Estrutura:**
737
- ```markdown
738
- # UI Mockups - {Feature Name}
739
-
740
- ## Tela 1: {Nome da Tela}
741
-
742
- ### Wireframe
743
- [ASCII art wireframe aqui]
744
-
745
- ### Descrição
746
- - **Propósito**: {O que o usuário faz nesta tela}
747
- - **Componentes**: {Lista de componentes principais}
748
- - **Interações**: {O que acontece ao clicar, hover, etc}
749
- - **Estados**: {Loading, erro, vazio, sucesso}
750
-
751
- ### Responsividade
752
- - **Desktop**: {Layout desktop}
753
- - **Mobile**: {Adaptações mobile}
754
- ```
755
-
756
- **Exemplo - Dashboard de Vendas:**
757
-
758
- ```
759
- ## Tela 1: Dashboard Principal
760
-
761
- ### Wireframe
762
-
763
- ┌─────────────────────────────────────────────────────────┐
764
- │ [≡] Dashboard de Vendas [🔔] [👤] [⚙] │
765
- ├─────────────────────────────────────────────────────────┤
766
- │ │
767
- │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
768
- │ │ Vendas │ │ Pedidos │ │ Clientes │ │ Ticket │ │
769
- │ │ R$ 45.2K │ │ 342 │ │ 128 │ │ R$ 132 │ │
770
- │ │ +12% ▲ │ │ +8% ▲ │ │ +15% ▲ │ │ -3% ▼ │ │
771
- │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
772
- │ │
773
- │ ┌─────────────────────────────────┐ ┌───────────────┐ │
774
- │ │ Vendas por Mês │ │ Top Produtos │ │
775
- │ │ │ │ │ │
776
- │ │ ╭─╮ │ │ 1. Produto A │ │
777
- │ │ ╭──╯ ╰─╮ ╭──╮ │ │ 2. Produto B │ │
778
- │ │ ─╯ ╰─────╯ ╰── │ │ 3. Produto C │ │
779
- │ │ JAN FEV MAR ABR MAI │ │ │ │
780
- │ └─────────────────────────────────┘ └───────────────┘ │
781
- │ │
782
- │ ┌─────────────────────────────────────────────────────┐│
783
- │ │ Últimos Pedidos [🔍 Buscar] [➕] ││
784
- │ ├──────────┬──────────┬──────────┬─────────────────────┤│
785
- │ │ #12345 │ João S. │ R$ 250 │ [Ver] [Editar] ││
786
- │ │ #12346 │ Maria O. │ R$ 180 │ [Ver] [Editar] ││
787
- │ │ #12347 │ Pedro M. │ R$ 420 │ [Ver] [Editar] ││
788
- │ └──────────┴──────────┴──────────┴─────────────────────┘│
789
- └─────────────────────────────────────────────────────────┘
790
- ```
791
-
792
- ### Descrição
793
- - **Propósito**: Visão geral das vendas e métricas do dia
794
- - **Componentes**: 4 stat cards, 1 chart (line), 1 lista (top 5), 1 data table
795
- - **Interações**:
796
- - Stat cards: Hover mostra detalhes
797
- - Chart: Tooltip nos pontos
798
- - Tabela: Ordenar colunas, buscar, paginação
799
- - **Estados**:
800
- - Loading: Skeleton dos cards
801
- - Erro: Message bar no topo
802
- - Vazio: "Nenhuma venda hoje" com CTA
803
-
804
- ### Responsividade
805
- - **Desktop**: 4 colunas de stat cards, chart 66% + sidebar 33%
806
- - **Mobile**: Stack vertical, stat cards 100% width, chart 100%
807
- ```
808
-
809
- ### 2. ui-components.md - Specs de Componentes
810
-
811
- **Estrutura:**
812
- ```markdown
813
- # UI Components - {Feature Name}
814
-
815
- ## Biblioteca Escolhida: {Fluent UI | MudBlazor | Híbrida}
816
-
817
- ### Justificativa
818
- {Por que escolheu esta biblioteca para esta feature}
819
-
820
- ## Componentes Mapeados
821
-
822
- ### {Nome do Componente}
823
- - **Biblioteca**: {Fluent UI | MudBlazor}
824
- - **Componente**: `{ComponentName}`
825
- - **Props Principais**:
826
- - `prop1`: {descrição}
827
- - `prop2`: {descrição}
828
- - **Eventos**:
829
- - `OnClick`: {descrição}
830
- - **Estados**:
831
- - Default: {descrição}
832
- - Loading: {descrição}
833
- - Error: {descrição}
834
- - **Acessibilidade**:
835
- - ARIA: {roles/labels}
836
- - Keyboard: {navegação}
837
- ```
838
-
839
- **Exemplo:**
840
-
841
- ```markdown
842
- ## Biblioteca Escolhida: Fluent UI Blazor
843
-
844
- ### Justificativa
845
- Dashboard AI-first com chat integrado. Fluent UI oferece componentes nativos
846
- de chat (FluentMessageBar, FluentProgress) e design Microsoft 365 consistente
847
- com o restante do sistema.
848
-
849
- ## Componentes Mapeados
850
-
851
- ### Stat Card (Métricas de Vendas)
852
- - **Biblioteca**: Fluent UI
853
- - **Componente**: `FluentCard` + `FluentStack` + `FluentBadge`
854
- - **Props Principais**:
855
- - `Title`: "Vendas Hoje"
856
- - `Value`: "R$ 45.200"
857
- - `Change`: "+12%"
858
- - `IsPositive`: true
859
- - **Eventos**:
860
- - `OnClick`: Navega para detalhes da métrica
861
- - **Estados**:
862
- - Default: Mostra valor + badge de mudança
863
- - Loading: `FluentSkeleton` no lugar do valor
864
- - Error: FluentMessageBar "Erro ao carregar"
865
- - **Acessibilidade**:
866
- - ARIA: role="region" aria-label="Estatísticas de vendas"
867
- - Keyboard: Focável com Tab, Enter para expandir
868
-
869
- ### Data Table (Últimos Pedidos)
870
- - **Biblioteca**: Fluent UI
871
- - **Componente**: `FluentDataGrid<Order>`
872
- - **Props Principais**:
873
- - `Items`: `@_orders` (List<Order>)
874
- - `ResizableColumns`: true
875
- - `Virtualize`: true (se > 100 itens)
876
- - **Colunas**:
877
- 1. PropertyColumn: OrderNumber (Sortable)
878
- 2. PropertyColumn: CustomerName (Sortable)
879
- 3. PropertyColumn: Total (Format="C", Sortable)
880
- 4. TemplateColumn: Ações (Ver, Editar)
881
- - **Eventos**:
882
- - `OnRowClick`: Expande detalhes inline
883
- - **Estados**:
884
- - Empty: "Nenhum pedido encontrado" com CTA "Criar pedido"
885
- - Loading: FluentProgress acima da tabela
886
- - Error: FluentMessageBar Intent="Error"
887
- - **Acessibilidade**:
888
- - ARIA: role="grid", aria-sort nos headers
889
- - Keyboard: Navegação com setas, Enter para ações
890
- ```
891
-
892
- ### 3. ui-flows.md - Fluxos de Usuário
893
-
894
- **Estrutura:**
895
- ```markdown
896
- # UI Flows - {Feature Name}
897
-
898
- ## Fluxo 1: {Nome do Fluxo}
899
-
900
- ### Trigger
901
- {O que inicia este fluxo}
902
-
903
- ### Passos
904
- 1. **{Tela/Componente}**: {Ação do usuário}
905
- - {Resultado da ação}
906
- - {Navegação/transição}
907
-
908
- 2. **{Tela/Componente}**: {Próxima ação}
909
- ...
910
-
911
- ### Happy Path
912
- {Caminho ideal sem erros}
913
-
914
- ### Edge Cases
915
- - **{Caso}**: {Como o sistema lida}
916
-
917
- ### Diagrama
918
- [Fluxograma ASCII]
919
- ```
920
-
921
- **Exemplo:**
922
-
923
- ```markdown
924
- ## Fluxo 1: Criar Novo Pedido
925
-
926
- ### Trigger
927
- Usuário clica no botão [+ Novo Pedido] no dashboard
928
-
929
- ### Passos
930
-
931
- 1. **Dashboard**: Clica [+ Novo Pedido]
932
- - Modal/Wizard abre com Fluent UI Wizard
933
- - 3 steps: Cliente, Produtos, Revisão
934
-
935
- 2. **Step 1 - Sele ção de Cliente**:
936
- - FluentAutocomplete para buscar cliente
937
- - Ou [+ Novo Cliente] para criar inline
938
- - [Próximo] habilitado apenas se cliente selecionado
939
-
940
- 3. **Step 2 - Adicionar Produtos**:
941
- - FluentDataGrid com produtos disponíveis
942
- - Coluna com FluentNumberField para quantidade
943
- - [Adicionar] adiciona à lista do pedido
944
- - Lista de produtos adicionados (removível)
945
- - Total calculado em tempo real
946
-
947
- 4. **Step 3 - Revisão**:
948
- - FluentCard resumo do pedido
949
- - [Voltar] para editar
950
- - [Confirmar] cria o pedido
951
-
952
- 5. **Confirmação**:
953
- - FluentToast "Pedido #12348 criado com sucesso!"
954
- - Navega para detalhes do pedido OU volta ao dashboard
955
-
956
- ### Happy Path
957
- Dashboard → Wizard (3 steps) → Confirmação → Dashboard
958
-
959
- ### Edge Cases
960
- - **Cliente não encontrado**: Oferece [+ Novo Cliente] inline
961
- - **Produto sem estoque**: FluentMessageBar alerta, não permite adicionar
962
- - **Rede falha no confirmar**: FluentDialog "Erro ao salvar" + [Tentar novamente]
963
- - **Usuário fecha Wizard**: FluentDialog "Descartar pedido?" [Sim] [Não]
964
-
965
- ### Diagrama
966
-
967
- ```
968
- [Dashboard]
969
-
970
- ├─[+ Novo Pedido]─┐
971
- │ │
972
- ▼ │
973
- [Wizard: Step 1] │
974
- (Cliente) │
975
- │ │
976
- ├─[Próximo] │
977
- │ │
978
- ▼ │
979
- [Wizard: Step 2] │
980
- (Produtos) │
981
- │ │
982
- ├─[Próximo] │
983
- │ │
984
- ▼ │
985
- [Wizard: Step 3] │
986
- (Revisão) │
987
- │ │
988
- ├─[Confirmar] │
989
- │ │
990
- ▼ │
991
- [✅ Pedido Criado] │
992
- │ │
993
- └─────────────────┘
994
- [Dashboard]
995
- ```
996
- ```
997
-
998
- ### Checklist para FASE 1.5
999
-
1000
- Ao gerar deliverables de UI/UX, validar:
1001
-
1002
- - [ ] **ui-mockups.md**:
1003
- - [ ] Wireframes ASCII de TODAS as telas
1004
- - [ ] Descrições detalhadas (propósito, componentes, interações, estados)
1005
- - [ ] Responsividade especificada (desktop + mobile)
1006
- - [ ] Empty states e error states documentados
1007
-
1008
- - [ ] **ui-components.md**:
1009
- - [ ] Biblioteca escolhida justificada (Fluent UI vs MudBlazor)
1010
- - [ ] Todos os componentes mapeados (nome + props + eventos)
1011
- - [ ] Estados documentados (default, loading, error, empty)
1012
- - [ ] Acessibilidade validada (ARIA, keyboard navigation)
1013
-
1014
- - [ ] **ui-flows.md**:
1015
- - [ ] Fluxos principais identificados (happy path)
1016
- - [ ] Edge cases documentados (erro, vazio, retry)
1017
- - [ ] Diagramas ASCII de cada fluxo
1018
- - [ ] Navegação entre telas clara
1019
-
1020
- - [ ] **decisions.md** (atualizar):
1021
- - [ ] ADR: Por que Fluent UI (ou MudBlazor)?
1022
- - [ ] ADR: Por que este layout específico?
1023
- - [ ] Trade-offs discutidos (performance vs features)
1024
-
1025
- ---
1026
-
1027
- ## Documentação de Referência
1028
-
1029
- ### Fluent UI Blazor
1030
- - [Fluent UI Blazor Docs](https://www.fluentui-blazor.net/)
1031
- - [Fluent UI Blazor GitHub](https://github.com/microsoft/fluentui-blazor)
1032
- - [Components Gallery](https://www.fluentui-blazor.net/Components)
1033
- - **[Guia Completo: Fluent UI Setup](../../.morph/standards/fluent-ui-setup.md)**
1034
-
1035
- ### MudBlazor
1036
- - [MudBlazor Docs](https://mudblazor.com/)
1037
- - [Components Gallery](https://mudblazor.com/components/list)
1038
- - [GitHub](https://github.com/MudBlazor/MudBlazor)
1039
-
1040
- ### Design & Acessibilidade
1041
- - [WCAG Guidelines](https://www.w3.org/WAI/WCAG21/quickref/)
1042
- - [Microsoft Fluent Design System](https://fluent2.microsoft.design/)
1043
- - [Material Design](https://m3.material.io/)
1044
- - [Blazor Components](https://learn.microsoft.com/aspnet/core/blazor/components/)
1045
-
1046
- ## Checklist de UI
1047
-
1048
- - [ ] Hierarquia visual clara
1049
- - [ ] Cores do sistema de design
1050
- - [ ] Espaçamento consistente (múltiplos de 4px)
1051
- - [ ] Responsivo (mobile-first)
1052
- - [ ] Estados: hover, focus, disabled, error
1053
- - [ ] Loading states (skeleton/spinner)
1054
- - [ ] Empty states informativos
1055
- - [ ] Mensagens de erro claras
1056
- - [ ] Acessibilidade básica (WCAG AA)
1057
-
1058
- ---
1059
-
1060
- *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*