I'll start by exploring the project structure to understand what we're working with.
Now let me check the entry point and TS config.
Now I'll set up the foundation: styles with dark-mode variant, HTML title, and entry point.
Now the core utilities — formatters, validators, and helpers.
Now general utilities and the cache/history service.
Now the API service and custom hooks.
Now the shared UI primitives and inline SVG icon set.
Now the Toast system, Modal, ThemeToggle and Loading skeletons.
Now the search bar and history components.
Now the data mapper that safely extracts information from any API payload shape.
Now the result cards — company summary and address.
Now the CNAE card, partners table, state registrations, and contacts.
Now the universal JSON explorer (recursive node + container).
Now the field counter, raw JSON modal, back-to-top and empty states.
Now the main App that orchestrates everything.
Converting the entry point to JSX so the project is pure JavaScript as requested.
Build succeeded. Let me verify that the custom Tailwind v4 utilities and dark variant compiled correctly.
A few refinements: fix duplicate phone detection, UF casing, and the result layout.
Let me verify no stale references remain in App and review the final file list.
A aplicação está completa e o build passa com sucesso. Aqui está o que foi construído:
🏗️ Arquitetura (100% JavaScript + Hooks, sem libs de UI/ícones/máscara)
Componentes (src/components/)
SearchBar — máscara 00.000.000/0000-00 digitada manualmente, aceita colagem (extrai só dígitos), Enter consulta, contador 14/14, chips de exemplo
CompanySummary · AddressCard · CnaeCard · PartnersTable · StateRegistrationTable · ContactsCard
JsonExplorer + JsonNode — visualizador universal recursivo com colapso/expansão por nível, indentação com guias, badges de tipo, busca com filtro de subárvore e "expandir/recolher tudo"
Modal, RawJsonModal (JSON colorido por tokenizador próprio + abas bruto/árvore), Toast (Context + useToast), Loading (skeleton shimmer + spinner), ThemeToggle, History, FieldCounter, BackToTop, EmptyState
ui/Primitives + ui/Icons (SVG inline, zero dependências)
Serviços e hooks
CnpjService — fetch com AbortController (timeout 15s) e tratamento de 404, 429, 500/502/503, rede, timeout, JSON inválido e resposta vazia com mensagens + dicas amigáveis
CacheService — cache TTL de 30 minutos, histórico dos últimos 10 CNPJs e tema, tudo em localStorage com fallback seguro
CnpjMapper — normaliza qualquer payload; contatos são coletados por varredura do JSON inteiro (telefones com DDD combinado, e-mails, websites)
useCnpjQuery, useHistory, useTheme
Utilitários: formatCNPJ, maskCNPJ, formatCPF, formatCEP, formatPhone, formatMoney, formatDate, formatBoolean, formatPercent, smartFormatValue (detecção automática por chave+valor), countFilledFields, flattenObject, copyToClipboard, downloadJson, validateCNPJ (dígitos verificadores) e getCnpjValidationError.
✨ UX
Dark mode por classe (variante custom do Tailwind v4), animações fade/scale/slide/shimmer, contador "X de Y campos preenchidos" com barra de progresso, scroll automático até o resultado, tooltips, botão voltar ao topo, tabelas com cartões no mobile, foco visível/aria-* em todos os controles e layout fluido do celular ao desktop.
Files built: src/index.css, index.html, src/main.tsx, src/utils/Formatters.js, src/utils/Validators.js, src/utils/Utils.js, src/services/CacheService.js, src/services/CnpjService.js, src/hooks/useTheme.js, src/hooks/useCnpjQuery.js, src/hooks/useHistory.js, src/components/ui/Icons.jsx, src/components/ui/Primitives.jsx, src/components/Toast.jsx, src/components/Modal.jsx, src/components/ThemeToggle.jsx, src/components/Loading.jsx, src/components/SearchBar.jsx, src/components/History.jsx, src/services/CnpjMapper.js, src/components/CompanySummary.jsx, src/components/AddressCard.jsx, src/components/CnaeCard.jsx, src/components/PartnersTable.jsx, src/components/StateRegistrationTable.jsx, src/components/ContactsCard.jsx, src/components/JsonNode.jsx, src/components/JsonExplorer.jsx, src/components/FieldCounter.jsx, src/components/RawJsonModal.jsx, src/components/BackToTop.jsx, src/components/EmptyState.jsx, src/App.jsx, src/main.jsx