forlogic-core 2.0.7 → 2.1.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 (55) hide show
  1. package/.note/memory/patterns/admin-i18n-policy.md +20 -0
  2. package/.note/memory/patterns/i18n-architecture.md +3 -0
  3. package/README.md +34 -269
  4. package/dist/action-plans/constants.d.ts +23 -3
  5. package/dist/audit-trail/utils.d.ts +5 -5
  6. package/dist/auth/components/EditProfileDialog.d.ts +12 -0
  7. package/dist/auth/contexts/AuthContext.d.ts +1 -1
  8. package/dist/auth/services/AuthService.d.ts +1 -1
  9. package/dist/components/dashboards/panels/panel-header.d.ts +1 -1
  10. package/dist/components/layout/SidebarActionTrigger.d.ts +3 -3
  11. package/dist/components/modules/ModuleAccessGuard.d.ts +1 -1
  12. package/dist/components/modules/icons/ModulesCardIcons.d.ts +2 -2
  13. package/dist/components/ui/color-picker.d.ts +2 -2
  14. package/dist/components/ui/combo-tree.d.ts +3 -1
  15. package/dist/components/ui/data-list.d.ts +2 -2
  16. package/dist/components/ui/dialog-wizard.d.ts +1 -1
  17. package/dist/components/ui/dialog.d.ts +1 -1
  18. package/dist/components/ui/disabled-menu-item.d.ts +1 -1
  19. package/dist/components/ui/empty-state.d.ts +9 -9
  20. package/dist/components/ui/onboarding-dialog.d.ts +1 -1
  21. package/dist/components/ui/popover.d.ts +1 -1
  22. package/dist/components/ui/split-button.d.ts +2 -2
  23. package/dist/components/ui/terms-of-use-dialog.d.ts +3 -3
  24. package/dist/config/index.d.ts +1 -1
  25. package/dist/contexts/PageMetadataContext.d.ts +2 -2
  26. package/dist/crud/components/CrudTable.d.ts +3 -1
  27. package/dist/crud/components/FilterBar.d.ts +2 -2
  28. package/dist/crud/primitives/Table.d.ts +2 -2
  29. package/dist/crud/primitives/types.d.ts +1 -1
  30. package/dist/i18n/index.d.ts +1 -10
  31. package/dist/i18n/utils.d.ts +14 -0
  32. package/dist/index.css +1 -1
  33. package/dist/index.css.map +1 -1
  34. package/dist/index.esm.js +1 -1
  35. package/dist/index.js +1 -1
  36. package/dist/leadership/components/LeadershipPage.d.ts +1 -1
  37. package/dist/media/components/ImageRenderer.d.ts +1 -1
  38. package/dist/media/components/VideoEditor.d.ts +0 -20
  39. package/dist/media/components/VideoRenderer.d.ts +0 -6
  40. package/dist/qualiex/components/QualiexUserField.d.ts +1 -1
  41. package/dist/tailwind/index.esm.js +4 -0
  42. package/dist/tailwind/index.js +4 -0
  43. package/dist/types.d.ts +1 -0
  44. package/docs/WORKSPACE_KNOWLEDGE.md +119 -0
  45. package/docs/design-system/README.md +1 -1
  46. package/docs/design-system/patterns/feature-flags.md +1 -0
  47. package/docs/design-system/patterns/i18n-setup.md +76 -1
  48. package/package.json +1 -1
  49. package/docs/AUDIT_PROMPT.md +0 -74
  50. package/docs/ICON_MIGRATION_GUIDE.md +0 -177
  51. package/docs/KNOWLEDGE.md +0 -109
  52. package/docs/PROJECT_KNOWLEDGE_TEMPLATE.md +0 -120
  53. package/docs/PROMPT_TEMPLATE.md +0 -77
  54. package/docs/PUBLISH.md +0 -168
  55. package/docs/STARTER_TEMPLATE.md +0 -114
@@ -13,7 +13,7 @@ export interface LeadershipPageProps {
13
13
  columns?: TreeTableColumn<LeaderNode>[];
14
14
  /** Header da coluna de nome (default: "Líder") */
15
15
  nameHeader?: string;
16
- /** Texto da zona de drop raiz (default: "Tornar Líder Raiz") */
16
+ /** Texto da zona de drop raiz (default: t('leadership_make_root')) */
17
17
  rootDropLabel?: string;
18
18
  }
19
19
  export declare function LeadershipPage({ unassociatedUsers, onAssociateUser, onMoveNode: customMoveNode, onMoveNodes: customMoveNodes, columns: customColumns, nameHeader, rootDropLabel, }?: LeadershipPageProps): import("react/jsx-runtime").JSX.Element;
@@ -12,7 +12,7 @@
12
12
  * content={{
13
13
  * imageUrl: 'https://example.com/image.jpg',
14
14
  * caption: 'Minha imagem',
15
- * alt: 'Descrição da imagem',
15
+ * alt: t('image_description'),
16
16
  * alignment: 'center',
17
17
  * allowDownload: true
18
18
  * }}
@@ -1,22 +1,2 @@
1
- /**
2
- * Video Editor Component
3
- *
4
- * Editor genérico de vídeo para forlogic-core.
5
- * Suporta URL, upload e código embed.
6
- *
7
- * @example
8
- * ```tsx
9
- * import { VideoEditor } from 'forlogic-core';
10
- *
11
- * <VideoEditor
12
- * value={videoData}
13
- * onChange={setVideoData}
14
- * onSubmit={handleSave}
15
- * onCancel={handleCancel}
16
- * uploadFunction={myUploadFunction}
17
- * uploadOptions={{ bucket: 'videos', folder: 'content' }}
18
- * />
19
- * ```
20
- */
21
1
  import type { MediaEditorProps, VideoBlockContent } from '../types';
22
2
  export declare function VideoEditor({ value, onChange, onSubmit, onCancel, uploadFunction, deleteFunction, uploadOptions }: MediaEditorProps<VideoBlockContent>): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,2 @@
1
- /**
2
- * Video Renderer Component
3
- *
4
- * Renderizador genérico de vídeo para forlogic-core.
5
- * Suporta YouTube, Vimeo e arquivos diretos.
6
- */
7
1
  import type { MediaRendererProps, VideoBlockContent } from '../types';
8
2
  export declare function VideoRenderer({ content, className, style }: MediaRendererProps<VideoBlockContent>): import("react/jsx-runtime").JSX.Element;
@@ -52,7 +52,7 @@ export type QualiexUserDisplayFormat = 'name' | 'name-email' | 'name-role' | 'cu
52
52
  * // Display customizado
53
53
  * <QualiexUserField
54
54
  * displayFormat="custom"
55
- * customDisplayFn={(user) => `${user.userName} - ${user.placeName || 'Sem local'}`}
55
+ * customDisplayFn={(user) => `${user.userName} - ${user.placeName || t('no_place_selected')}`}
56
56
  * value={userId}
57
57
  * onChange={setUserId}
58
58
  * />
@@ -9,6 +9,10 @@ const forlogicTailwindPreset = {
9
9
  }
10
10
  },
11
11
  extend: {
12
+ fontFamily: {
13
+ sans: ["Inter", "Roboto", "-apple-system", "BlinkMacSystemFont", '"Segoe UI"', '"Helvetica Neue"', "Arial", "sans-serif"],
14
+ mono: ['"Roboto Mono"', "Menlo", "Monaco", '"Courier New"', "monospace"]
15
+ },
12
16
  colors: {
13
17
  border: "hsl(var(--border))",
14
18
  input: "hsl(var(--input))",
@@ -11,6 +11,10 @@ const forlogicTailwindPreset = {
11
11
  }
12
12
  },
13
13
  extend: {
14
+ fontFamily: {
15
+ sans: ["Inter", "Roboto", "-apple-system", "BlinkMacSystemFont", '"Segoe UI"', '"Helvetica Neue"', "Arial", "sans-serif"],
16
+ mono: ['"Roboto Mono"', "Menlo", "Monaco", '"Courier New"', "monospace"]
17
+ },
14
18
  colors: {
15
19
  border: "hsl(var(--border))",
16
20
  input: "hsl(var(--input))",
package/dist/types.d.ts CHANGED
@@ -405,6 +405,7 @@ export interface UserInfo {
405
405
  name: string;
406
406
  identifier: string;
407
407
  alias?: string;
408
+ isSysAdmin: boolean;
408
409
  }
409
410
  export interface Company {
410
411
  id: string;
@@ -0,0 +1,119 @@
1
+ # forlogic-core — Workspace Knowledge
2
+
3
+ > **Documento para colar no Lovable Workspace Knowledge** de projetos consumidores.
4
+ > Funciona como mapa de referências cruzadas entre os projetos.
5
+
6
+ ---
7
+
8
+ ## Projetos do Ecossistema
9
+
10
+ | Projeto | Alias | Responsabilidade |
11
+ |---------|-------|-----------------|
12
+ | **forlogic-docs** | `@forlogic-docs` | Fonte canônica de regras, padrões, templates e documentação |
13
+ | **qualiex-admin** | `@Admin` | Código-fonte da lib `forlogic-core`, Design System e docs gerados |
14
+
15
+ ---
16
+
17
+ ## Onde buscar cada informação
18
+
19
+ ### Regras e Padrões → `@forlogic-docs`
20
+
21
+ | O que | Caminho |
22
+ |-------|---------|
23
+ | Constituição (regras canônicas) | `docs/engenharia/padroes/constitution.md` |
24
+ | Guia de migração de ícones | `docs/engenharia/padroes/icon-migration.md` |
25
+ | Guia de publicação da lib | `docs/engenharia/devops/publish.md` |
26
+ | Prompt: auditoria | `docs/templates/prompts/audit.md` |
27
+ | Prompt: criação de tela | `docs/templates/prompts/new-screen.md` |
28
+ | Prompt: starter template | `docs/templates/prompts/starter.md` |
29
+ | ADRs (decisões de arquitetura) | `docs/adrs/` |
30
+ | Specs de API | `docs/apis/` |
31
+
32
+ ### Código-fonte e Design System → `@Admin`
33
+
34
+ | O que | Caminho |
35
+ |-------|---------|
36
+ | Código dos componentes UI | `lib/components/ui/` |
37
+ | Sistema CRUD | `lib/crud/` |
38
+ | Barrel exports (lista completa) | `lib/exports/ui.ts`, `lib/exports/index.ts` |
39
+ | Documentação MD do Design System | `docs/design-system/` |
40
+ | Golden snippets (exemplos) | `docs/design-system/examples.md` |
41
+ | Docs interativos (código-fonte) | `src/design-system/docs/` |
42
+ | Hooks compartilhados | `lib/hooks/` |
43
+ | Providers (CoreProviders) | `lib/providers/` |
44
+ | Serviços (Base, Email, Error) | `lib/services/` |
45
+ | Config Vite/Tailwind | `lib/vite/`, `lib/tailwind/` |
46
+ | Spec do módulo Queries | `spec/queries.md` |
47
+
48
+ ---
49
+
50
+ ## Schema do Projeto
51
+
52
+ > ⚠️ **O schema é definido no `README.md` de cada projeto consumidor.** Consulte-o antes de qualquer query.
53
+
54
+ ```ts
55
+ // ✅ CORRETO — substituir pelo schema do projeto
56
+ supabase.schema('SCHEMA_DO_PROJETO').from('tabela').select('*');
57
+
58
+ // ❌ ERRADO
59
+ supabase.from('tabela').select('*');
60
+ ```
61
+
62
+ ---
63
+
64
+ ## Regras Invioláveis (resumo)
65
+
66
+ > Fonte canônica: `@forlogic-docs docs/engenharia/padroes/constitution.md`
67
+
68
+ | Regra | Detalhe |
69
+ |-------|---------|
70
+ | Schema obrigatório | `.schema('...')` em toda query Supabase |
71
+ | Sem DELETE físico | Soft delete com `deleted_at` |
72
+ | Lib-first | Usar `forlogic-core` antes de criar componente |
73
+ | Import do Supabase | `getSupabaseClient()` de `forlogic-core` |
74
+ | Import de i18n | `useTranslation` de `forlogic-core`, nunca de `react-i18next` |
75
+ | Sem hardcoded admin | Nunca localStorage/sessionStorage para roles |
76
+
77
+ ---
78
+
79
+ ## Design System — Categorias
80
+
81
+ > Para ver props e exemplos: `@Admin docs/design-system/<arquivo>.md`
82
+
83
+ | Categoria | Arquivo |
84
+ |-----------|---------|
85
+ | Fundação | `foundation.md` |
86
+ | Botões & Ações | `buttons-actions.md` |
87
+ | Inputs | `inputs.md` |
88
+ | Seletores | `selectors.md` |
89
+ | Data Display | `data-display.md` |
90
+ | Data Grid | `tables-grids.md` |
91
+ | Navegação | `navigation.md` |
92
+ | Dialogs | `dialogs.md` |
93
+ | Layout | `layout.md` |
94
+ | CRUD | `crud.md` |
95
+
96
+ ### Aliases
97
+
98
+ | Original | Alias(es) |
99
+ |----------|-----------|
100
+ | Combobox | SelectSearch, MultiSelect, EntitySelect |
101
+ | ComboTree | TreeSelect |
102
+ | ActionButton | ActionMenu, RowActions |
103
+ | CrudPrimitiveTable | DataTable |
104
+
105
+ ---
106
+
107
+ ## Instrução para IA — Leitura Obrigatória
108
+
109
+ **QUANDO** criar ou modificar qualquer arquivo `.tsx`:
110
+
111
+ - **SE** contém tabela/CRUD → **LER** `@Admin docs/design-system/crud.md` ANTES
112
+ - **SE** contém formulário → **LER** `@Admin docs/design-system/inputs.md` ANTES
113
+ - **SE** contém modal → **LER** `@Admin docs/design-system/dialogs.md` ANTES
114
+ - **SE** contém botões/ações → **LER** `@Admin docs/design-system/buttons-actions.md` ANTES
115
+ - **SE** é layout → **LER** `@Admin docs/design-system/layout.md` ANTES
116
+
117
+ **SEMPRE** consultar `@Admin docs/design-system/examples.md` como referência.
118
+
119
+ **VALIDAÇÃO**: Todo import de componente visual DEVE vir de `forlogic-core`.
@@ -3,7 +3,7 @@
3
3
 
4
4
  # Design System — forlogic-core
5
5
 
6
- > Gerado automaticamente em 2026-04-06
6
+ > Gerado automaticamente em 2026-04-09
7
7
  > Total: 92 componentes documentados em 15 categorias
8
8
 
9
9
  ## Categorias
@@ -7,6 +7,7 @@
7
7
  | `VITE_SHOW_USER_PREFERENCES` | Exibe "Preferências" no menu do usuário (idioma, timezone, formato de data) | Não exibe |
8
8
  | `VITE_I18N_DEBUG_MODE` | Modo debug de i18n (mostra chaves ao invés de traduções) | `"false"` |
9
9
  | `VITE_IS_QUALIEX` | Usa logos Qualiex ao invés de Forlogic | `"false"` |
10
+ | `VITE_SHOW_EDIT_PROFILE` | Exibe "Editar Perfil" no menu do usuário (foto e idioma) | Não exibe |
10
11
 
11
12
  ## Uso
12
13
 
@@ -8,7 +8,9 @@
8
8
 
9
9
  ## Setup em projetos consumidores
10
10
 
11
- 1. Criar JSONs flat em `src/i18n/pt-BR.json`: `{ "key": "value" }` (sem nesting)
11
+ ### Projeto simples (poucas chaves)
12
+
13
+ 1. Criar JSON flat em `src/i18n/pt-BR.json`: `{ "key": "value" }` (sem nesting)
12
14
  2. Passar para CoreProviders:
13
15
 
14
16
  ```tsx
@@ -17,6 +19,67 @@
17
19
 
18
20
  3. Usar `useTranslation` de `forlogic-core` (nunca de `react-i18next`)
19
21
 
22
+ ### Projeto modular (múltiplas features)
23
+
24
+ Para módulos com muitas chaves, dividir traduções por feature:
25
+
26
+ ```text
27
+ src/i18n/
28
+ ├── pt-BR/
29
+ │ ├── common.json ← chaves gerais do módulo
30
+ │ ├── matrices.json ← feature: matrizes
31
+ │ ├── requirements.json ← feature: requisitos
32
+ │ └── reports.json ← feature: relatórios
33
+ ├── en-US/
34
+ │ ├── common.json
35
+ │ ├── matrices.json
36
+ │ ├── requirements.json
37
+ │ └── reports.json
38
+ └── index.ts ← merge automático
39
+ ```
40
+
41
+ #### Arquivo `src/i18n/index.ts`
42
+
43
+ ```ts
44
+ import { mergeTranslationFiles } from 'forlogic-core/i18n';
45
+
46
+ import ptCommon from './pt-BR/common.json';
47
+ import ptMatrices from './pt-BR/matrices.json';
48
+ import ptRequirements from './pt-BR/requirements.json';
49
+ import ptReports from './pt-BR/reports.json';
50
+
51
+ import enCommon from './en-US/common.json';
52
+ import enMatrices from './en-US/matrices.json';
53
+ import enRequirements from './en-US/requirements.json';
54
+ import enReports from './en-US/reports.json';
55
+
56
+ export const appTranslations = {
57
+ 'pt-BR': mergeTranslationFiles(ptCommon, ptMatrices, ptRequirements, ptReports),
58
+ 'en-US': mergeTranslationFiles(enCommon, enMatrices, enRequirements, enReports),
59
+ };
60
+ ```
61
+
62
+ #### Uso no App
63
+
64
+ ```tsx
65
+ import { CoreProviders } from 'forlogic-core';
66
+ import { appTranslations } from './i18n';
67
+
68
+ function App() {
69
+ return (
70
+ <CoreProviders appTranslations={appTranslations}>
71
+ <BrowserRouter><Routes /></BrowserRouter>
72
+ </CoreProviders>
73
+ );
74
+ }
75
+ ```
76
+
77
+ ## Regras dos JSONs
78
+
79
+ - Formato **flat** (sem nesting): `{ "key": "value" }`
80
+ - Chaves duplicadas entre arquivos: o último spread vence (common → features)
81
+ - Chaves do `app` sobrescrevem chaves do `core` com mesmo nome
82
+
20
83
  ## Resolução de chaves
21
84
 
22
85
  ```
@@ -25,6 +88,17 @@ t('objective') → app: "Objetivo"
25
88
  t('save') com override no app → app: "Gravar" (sobrescreve core)
26
89
  ```
27
90
 
91
+ ## Helper `mergeTranslationFiles`
92
+
93
+ Utilitário exportado pela lib para facilitar o merge:
94
+
95
+ ```ts
96
+ import { mergeTranslationFiles } from 'forlogic-core/i18n';
97
+
98
+ const ptBR = mergeTranslationFiles(common, matrices, requirements);
99
+ // Equivalente a: { ...common, ...matrices, ...requirements }
100
+ ```
101
+
28
102
  ## Debug
29
103
 
30
104
  ```ts
@@ -40,3 +114,4 @@ console.log('Resources:', i18n.store.data);
40
114
  | Import de `react-i18next` direto | Usar import de `forlogic-core` |
41
115
  | `appTranslations` não passado | Adicionar prop no CoreProviders |
42
116
  | JSON com formato errado | Deve ser flat, sem nesting |
117
+ | Chave duplicada entre features | Último arquivo no merge vence |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forlogic-core",
3
- "version": "2.0.7",
3
+ "version": "2.1.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -1,74 +0,0 @@
1
- # Prompt de Auditoria — Design System
2
-
3
- > **Como usar**: Cole este prompt em uma conversa do Lovable no projeto consumidor para auditar e corrigir violações do Design System.
4
-
5
- ---
6
-
7
- ## Prompt para copiar
8
-
9
- ```
10
- Audite TODOS os arquivos .tsx do projeto em busca de violações do Design System do forlogic-core.
11
-
12
- Antes de começar, leia obrigatoriamente via cross-project:
13
- @Admin docs/design-system/crud.md
14
- @Admin docs/design-system/inputs.md
15
- @Admin docs/design-system/selectors.md
16
- @Admin docs/design-system/layout.md
17
- @Admin docs/design-system/dialogs.md
18
- @Admin docs/design-system/buttons-actions.md
19
-
20
- Verifique CADA arquivo .tsx contra estas regras:
21
-
22
- ### Imports inválidos
23
- - [ ] Import de componente UI que NÃO vem de `forlogic-core` (Button, Dialog, Input, Select, Table, etc.)
24
- - [ ] Import de `react-i18next` em vez de `useTranslation` de `forlogic-core`
25
- - [ ] Import de `@/integrations/supabase/client` em vez de `getSupabaseClient()` de `forlogic-core`
26
-
27
- ### Componentes proibidos
28
- - [ ] `<Select>` ou `<StatusSelect>` → deve ser `<Combobox>`
29
- - [ ] `<MoreHorizontal>` genérico como menu de ações → deve ser `<ActionButton>`
30
- - [ ] `<DeleteConfirmationDialog>` → deve ser `<Dialog>`
31
- - [ ] `<Searchbar>` → deve ser `<Input>` com ícone de busca
32
- - [ ] `BulkActionBar` separado → deve ser dropdown no `CrudActionBar`
33
- - [ ] Paginação manual → deve ser `CrudPrimitivePagination`
34
-
35
- ### Supabase
36
- - [ ] Query sem `.schema('SCHEMA_PADRAO')` (qualquer `supabase.from(` direto)
37
- - [ ] DELETE físico (deve ser soft delete com `deleted_at`)
38
- - [ ] `supabase` importado diretamente do client em vez de `getSupabaseClient()`
39
-
40
- ### Layout
41
- - [ ] Página sem `usePageMetadata` (título/subtítulo)
42
- - [ ] Layout sem `AppLayout` + `AppSidebar`
43
- - [ ] Componente criado localmente quando existe equivalente na lib
44
-
45
- ### Formulários
46
- - [ ] Formulário sem `BaseForm` ou `react-hook-form` + `zod`
47
- - [ ] Select nativo HTML em vez de `Combobox`
48
-
49
- Para cada violação encontrada, gere um relatório no formato:
50
-
51
- | Arquivo | Linha | Violação | Correção |
52
- |---------|-------|----------|----------|
53
- | src/pages/X.tsx | 15 | Import de Button local | Usar `import { Button } from 'forlogic-core'` |
54
-
55
- Depois do relatório, pergunte se devo corrigir automaticamente.
56
- ```
57
-
58
- ---
59
-
60
- ## Variações
61
-
62
- ### Auditoria rápida (apenas imports)
63
-
64
- ```
65
- Busque em TODOS os arquivos .tsx do projeto por imports que NÃO vêm de 'forlogic-core'.
66
- Liste: arquivo, linha, import atual, e o import correto de forlogic-core.
67
- ```
68
-
69
- ### Auditoria de Supabase
70
-
71
- ```
72
- Busque em TODOS os arquivos .ts/.tsx por chamadas a `supabase.from(` sem `.schema('SCHEMA_PADRAO')`.
73
- Liste: arquivo, linha, query atual, e a correção com .schema().
74
- ```
@@ -1,177 +0,0 @@
1
- # Guia de Migração de Ícones: Angular Material → Lucide React
2
-
3
- > Referência para substituir ícones do Material Symbols/Icons pelos equivalentes do [Lucide React](https://lucide.dev/icons/).
4
-
5
- ---
6
-
7
- ## 1. Material Icons → Lucide React
8
-
9
- | Material Icon | Lucide React | Import |
10
- |:---|:---|:---|
11
- | `add` | `Plus` | `import { Plus } from 'lucide-react'` |
12
- | `alarm` | `AlarmClock` | `import { AlarmClock } from 'lucide-react'` |
13
- | `arrow_back` | `ArrowLeft` | `import { ArrowLeft } from 'lucide-react'` |
14
- | `arrow_downward` | `ArrowDown` | `import { ArrowDown } from 'lucide-react'` |
15
- | `arrow_drop_down` | `ChevronDown` | `import { ChevronDown } from 'lucide-react'` |
16
- | `arrow_drop_up` | `ChevronUp` | `import { ChevronUp } from 'lucide-react'` |
17
- | `arrow_outward` | `ExternalLink` | `import { ExternalLink } from 'lucide-react'` |
18
- | `arrow_right_alt` | `ArrowRight` | `import { ArrowRight } from 'lucide-react'` |
19
- | `arrow_upward` | `ArrowUp` | `import { ArrowUp } from 'lucide-react'` |
20
- | `article` | `FileText` | `import { FileText } from 'lucide-react'` |
21
- | `attach_file` | `Paperclip` | `import { Paperclip } from 'lucide-react'` |
22
- | `auto_stories` | `BookOpen` | `import { BookOpen } from 'lucide-react'` |
23
- | `cancel` | `XCircle` | `import { XCircle } from 'lucide-react'` |
24
- | `chat` | `MessageCircle` | `import { MessageCircle } from 'lucide-react'` |
25
- | `check` | `Check` | `import { Check } from 'lucide-react'` |
26
- | `check_circle` | `CheckCircle` | `import { CheckCircle } from 'lucide-react'` |
27
- | `circle` | `Circle` | `import { Circle } from 'lucide-react'` |
28
- | `clear` | `X` | `import { X } from 'lucide-react'` |
29
- | `close` | `X` | `import { X } from 'lucide-react'` |
30
- | `cloud_upload` | `CloudUpload` | `import { CloudUpload } from 'lucide-react'` |
31
- | `comment` | `MessageSquare` | `import { MessageSquare } from 'lucide-react'` |
32
- | `delete` | `Trash2` | `import { Trash2 } from 'lucide-react'` |
33
- | `done` | `Check` | `import { Check } from 'lucide-react'` |
34
- | `drag_indicator` | `GripVertical` | `import { GripVertical } from 'lucide-react'` |
35
- | `edit` | `Pencil` | `import { Pencil } from 'lucide-react'` |
36
- | `error` | `CircleAlert` | `import { CircleAlert } from 'lucide-react'` |
37
- | `exit_to_app` | `LogOut` | `import { LogOut } from 'lucide-react'` |
38
- | `expand_more` | `ChevronDown` | `import { ChevronDown } from 'lucide-react'` |
39
- | `favorite` | `Heart` | `import { Heart } from 'lucide-react'` |
40
- | `favorite_border` | `Heart` (sem fill) | `import { Heart } from 'lucide-react'` |
41
- | `group` | `Users` | `import { Users } from 'lucide-react'` |
42
- | `help` | `HelpCircle` | `import { HelpCircle } from 'lucide-react'` |
43
- | `hourglass_bottom` | `Hourglass` | `import { Hourglass } from 'lucide-react'` |
44
- | `info` | `Info` | `import { Info } from 'lucide-react'` |
45
- | `keyboard_arrow_down` | `ChevronDown` | `import { ChevronDown } from 'lucide-react'` |
46
- | `keyboard_tab` | `ArrowRightToLine` | `import { ArrowRightToLine } from 'lucide-react'` |
47
- | `label` | `Tag` | `import { Tag } from 'lucide-react'` |
48
- | `link` | `Link` | `import { Link } from 'lucide-react'` |
49
- | `menu` | `Menu` | `import { Menu } from 'lucide-react'` |
50
- | `more_vert` | `MoreVertical` | `import { MoreVertical } from 'lucide-react'` |
51
- | `person` | `User` | `import { User } from 'lucide-react'` |
52
- | `person_outline` | `User` | `import { User } from 'lucide-react'` |
53
- | `place` | `MapPin` | `import { MapPin } from 'lucide-react'` |
54
- | `refresh` | `RefreshCw` | `import { RefreshCw } from 'lucide-react'` |
55
- | `repeat` | `Repeat` | `import { Repeat } from 'lucide-react'` |
56
- | `schedule` | `Clock` | `import { Clock } from 'lucide-react'` |
57
- | `search` | `Search` | `import { Search } from 'lucide-react'` |
58
- | `star` | `Star` | `import { Star } from 'lucide-react'` |
59
- | `star_border` | `Star` (sem fill) | `import { Star } from 'lucide-react'` |
60
- | `supervisor_account` | `UserCheck` | `import { UserCheck } from 'lucide-react'` |
61
- | `swap_horiz` | `ArrowLeftRight` | `import { ArrowLeftRight } from 'lucide-react'` |
62
- | `verified` | `BadgeCheck` | `import { BadgeCheck } from 'lucide-react'` |
63
- | `visibility` | `Eye` | `import { Eye } from 'lucide-react'` |
64
- | `warning` | `TriangleAlert` | `import { TriangleAlert } from 'lucide-react'` |
65
-
66
- ---
67
-
68
- ## 2. Ícones de gráficos (Material → Lucide/Recharts)
69
-
70
- | Material Icon | Lucide React | Nota |
71
- |:---|:---|:---|
72
- | `area_chart_black_24dp` | `AreaChart` | `import { AreaChart } from 'lucide-react'` |
73
- | `bar_chart_black_24dp` | `BarChart3` | `import { BarChart3 } from 'lucide-react'` |
74
- | `legend_toggle` | `ListFilter` | Alternativa mais próxima |
75
- | `multiline_chart_black_24dp` | `LineChart` | `import { LineChart } from 'lucide-react'` |
76
- | `pie_chart_black_24dp` | `PieChart` | `import { PieChart } from 'lucide-react'` |
77
- | `pin_black_24dp` | `Pin` | `import { Pin } from 'lucide-react'` |
78
- | `poll` | `BarChart` | `import { BarChart } from 'lucide-react'` |
79
- | `show_chart_black_24dp` | `TrendingUp` | `import { TrendingUp } from 'lucide-react'` |
80
- | `stacked_bar_chart_black_24dp` | `BarChart3` | Mesmo ícone, sem variante "stacked" |
81
- | `stacked_line_chart` | `LineChart` | Mesmo ícone |
82
- | `trending_up` | `TrendingUp` | `import { TrendingUp } from 'lucide-react'` |
83
- | `view_list_black_24dp` | `List` | `import { List } from 'lucide-react'` |
84
- | `view_module` | `LayoutGrid` | `import { LayoutGrid } from 'lucide-react'` |
85
-
86
- ---
87
-
88
- ## 3. SVGs customizados do flc-icon (sem equivalente Lucide)
89
-
90
- Estes ícones são SVGs específicos do projeto e **não têm equivalente no Lucide**. Devem ser mantidos como assets SVG importados diretamente:
91
-
92
- ### Ícones de extensão de arquivo
93
- | SVG | Uso | Ação |
94
- |:----|:----|:-----|
95
- | `asp.svg`, `csv.svg`, `doc.svg`, `docx.svg`, `gif.svg`, `htm.svg`, `html.svg`, `jpg.svg`, `jpeg.svg`, `mp3.svg`, `mp4.svg`, `ods.svg`, `odt.svg`, `pdf.svg`, `png.svg`, `ppt.svg`, `pptx.svg`, `rar.svg`, `txt.svg`, `xls.svg`, `xlsx.svg`, `zip.svg` | Ícones de tipo de arquivo | Manter como SVG — representam extensões com cores e tipografia específicas |
96
- | `gdocs.svg`, `gsheets.svg` | Google Docs/Sheets | Manter como SVG |
97
-
98
- ### Ícones customizados do domínio
99
- | SVG | Lucide alternativo | Ação |
100
- |:----|:----|:-----|
101
- | `calendar.svg` | `Calendar` | Substituir por Lucide |
102
- | `clock-exclamation.svg` | `ClockAlert` ¹ | Verificar se existe no Lucide |
103
- | `distance.svg`, `distance-control.svg`, `distance-flow.svg` | — | Manter como SVG (domínio específico) |
104
- | `document.svg`, `document-configuration.svg`, `document-configuration-active.svg` | `FileText` / `FileCog` | Avaliar substituição |
105
- | `double-check.svg` | `CheckCheck` | Substituir por Lucide |
106
- | `double-square.svg` | `CopyPlus` | Avaliar substituição |
107
- | `drag-pan.svg` | `Move` | Substituir por Lucide |
108
- | `empty-state.svg`, `empty-state-control.svg`, `empty-state-flow.svg` | — | Manter (ilustrações) |
109
- | `eye.svg` | `Eye` | Substituir por Lucide |
110
- | `family-star.svg` | — | Manter como SVG |
111
- | `file-key.svg` | `FileKey` | Substituir por Lucide |
112
- | `file-lock.svg`, `file-locker.svg` | `FileLock` | Substituir por Lucide |
113
- | `file-plus.svg` | `FilePlus` | Substituir por Lucide |
114
- | `file-remove.svg` | `FileX` | Substituir por Lucide |
115
- | `flag-check.svg` | `FlagTriangleRight` | Avaliar substituição |
116
- | `folder.svg` | `Folder` | Substituir por Lucide |
117
- | `folder-key.svg` | `FolderKey` | Substituir por Lucide |
118
- | `groups.svg`, `groups-filled.svg` | `Users` | Substituir por Lucide |
119
- | `history.svg` | `History` | Substituir por Lucide |
120
- | `hourglass.svg`, `hourglass_empty.svg` | `Hourglass` | Substituir por Lucide |
121
- | `ia.svg` | `Sparkles` | Substituir por Lucide |
122
- | `info.svg` | `Info` | Substituir por Lucide |
123
- | `key.svg` | `Key` | Substituir por Lucide |
124
- | `notification.svg` | `Bell` | Substituir por Lucide |
125
- | `print.svg` | `Printer` | Substituir por Lucide |
126
- | `recycle-bin.svg` | `Trash2` | Substituir por Lucide |
127
- | `refresh.svg` | `RefreshCw` | Substituir por Lucide |
128
- | `star.svg` | `Star` | Substituir por Lucide |
129
- | `stop.svg` | `CircleStop` | Substituir por Lucide |
130
- | `trash.svg`, `trash-bin.svg` | `Trash2` | Substituir por Lucide |
131
- | `triangle-alert.svg` | `TriangleAlert` | Substituir por Lucide |
132
- | `upload.svg` | `Upload` | Substituir por Lucide |
133
- | `user-group.svg` | `Users` | Substituir por Lucide |
134
- | `user-key.svg` | `UserCog` | Avaliar substituição |
135
- | `user-team.svg`, `user-team-control.svg`, `user-team-flow.svg` | `Users` | Manter se visual único |
136
-
137
- ---
138
-
139
- ## 4. Como migrar na prática
140
-
141
- ### Antes (Angular)
142
- ```html
143
- <mat-icon>edit</mat-icon>
144
- <mat-icon>delete</mat-icon>
145
- <flc-icon iconSize="24px">pdf</flc-icon>
146
- ```
147
-
148
- ### Depois (React)
149
- ```tsx
150
- import { Pencil, Trash2 } from 'lucide-react';
151
- import pdfIcon from '@/assets/icons/pdf.svg';
152
-
153
- <Pencil size={24} />
154
- <Trash2 size={24} />
155
- <img src={pdfIcon} alt="PDF" width={24} height={24} />
156
- ```
157
-
158
- ### Dica: Tamanhos padrão
159
-
160
- | Contexto | Tamanho |
161
- |:---------|:--------|
162
- | Inline (texto, botões) | `size={16}` |
163
- | Padrão (toolbar, menu) | `size={20}` |
164
- | Destaque (cards, empty states) | `size={24}` |
165
- | Ilustração | `size={48}` ou maior |
166
-
167
- ---
168
-
169
- ## 5. Resumo
170
-
171
- | Categoria | Total | Substituir por Lucide | Manter como SVG |
172
- |:----------|:------|:---------------------|:----------------|
173
- | Material Icons | ~50 | **50** (100%) | 0 |
174
- | SVGs de extensão | ~24 | 0 | **24** (100%) |
175
- | SVGs customizados | ~40 | **~25** (62%) | **~15** (38%) |
176
-
177
- > ¹ `ClockAlert` não existe no Lucide atualmente. Usar `Clock` + badge ou manter SVG customizado.