forlogic-core 2.2.5 → 2.2.7

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 (69) hide show
  1. package/.note/memory/features/import/attachment-idempotency-registry.md +8 -8
  2. package/.note/memory/features/import/attachment-strategy.md +30 -30
  3. package/.note/memory/patterns/admin-i18n-policy.md +20 -20
  4. package/.note/memory/patterns/alias-url-resolution.md +69 -69
  5. package/.note/memory/patterns/doc-sync-rule.md +35 -35
  6. package/.note/memory/patterns/documentation-standard.md +17 -17
  7. package/.note/memory/patterns/dynamic-supabase-config.md +4 -4
  8. package/.note/memory/patterns/environment-detection-logic.md +35 -35
  9. package/.note/memory/patterns/i18n-architecture.md +3 -3
  10. package/README.md +120 -120
  11. package/dist/README.md +1079 -0
  12. package/dist/bin/bootstrap.js +40 -0
  13. package/dist/bin/pull-docs.js +186 -0
  14. package/dist/components/ui/color-picker.d.ts +2 -0
  15. package/dist/components/ui/combo-tree.d.ts +3 -1
  16. package/dist/components/ui/combobox.d.ts +2 -1
  17. package/dist/components/ui/select.d.ts +9 -2
  18. package/dist/docs/KNOWLEDGE.md +109 -0
  19. package/dist/index.css +1 -1
  20. package/dist/index.css.map +1 -1
  21. package/dist/index.esm.js +1 -1
  22. package/dist/index.js +1 -1
  23. package/docs/PUBLISH.md +168 -168
  24. package/docs/STORAGE_BUCKETS.md +456 -456
  25. package/docs/SUPABASE_SECRETS.md +122 -122
  26. package/docs/WORKSPACE_KNOWLEDGE.md +154 -154
  27. package/docs/design-system/buttons-actions.md +130 -130
  28. package/docs/design-system/charts-dashboards.md +301 -340
  29. package/docs/design-system/crud.md +114 -174
  30. package/docs/design-system/data-display.md +106 -106
  31. package/docs/design-system/dialogs.md +212 -212
  32. package/docs/design-system/domain.md +329 -319
  33. package/docs/design-system/examples.md +275 -275
  34. package/docs/design-system/foundation.md +1 -1
  35. package/docs/design-system/inputs.md +137 -132
  36. package/docs/design-system/layout.md +154 -202
  37. package/docs/design-system/navigation.md +331 -272
  38. package/docs/design-system/notifications-feedback.md +34 -34
  39. package/docs/design-system/patterns/README.md +53 -53
  40. package/docs/design-system/patterns/action-button.md +22 -22
  41. package/docs/design-system/patterns/alertdialog-deletion.md +46 -46
  42. package/docs/design-system/patterns/baseform-custom-fields.md +59 -59
  43. package/docs/design-system/patterns/baseform-usage.md +42 -42
  44. package/docs/design-system/patterns/body-content-scroll.md +56 -56
  45. package/docs/design-system/patterns/combo-tree.md +23 -23
  46. package/docs/design-system/patterns/components-registry.md +17 -17
  47. package/docs/design-system/patterns/core-providers.md +41 -41
  48. package/docs/design-system/patterns/crud-bulk-actions.md +12 -12
  49. package/docs/design-system/patterns/crud-config-props.md +16 -16
  50. package/docs/design-system/patterns/crud-defaults.md +17 -17
  51. package/docs/design-system/patterns/crud-toolbar.md +28 -28
  52. package/docs/design-system/patterns/delete-confirmation.md +40 -40
  53. package/docs/design-system/patterns/dialog-body-scroll.md +26 -26
  54. package/docs/design-system/patterns/dialog-structure.md +32 -32
  55. package/docs/design-system/patterns/dialog-variants.md +41 -41
  56. package/docs/design-system/patterns/feature-flags.md +81 -81
  57. package/docs/design-system/patterns/header-metadata.md +57 -57
  58. package/docs/design-system/patterns/i18n-setup.md +117 -117
  59. package/docs/design-system/patterns/pagination.md +27 -27
  60. package/docs/design-system/patterns/single-scroll.md +39 -39
  61. package/docs/design-system/patterns/vite-tailwind-setup.md +49 -49
  62. package/docs/design-system/platform.md +18 -18
  63. package/docs/design-system/selectors.md +287 -258
  64. package/docs/design-system/tables-grids.md +38 -95
  65. package/package.json +152 -152
  66. package/dist/assets/docs-BEwTKYu3.css +0 -1
  67. package/dist/assets/docs-Bgpz6ETN.js +0 -10752
  68. package/dist/assets/index-SqMwTzMJ.js +0 -97
  69. package/dist/index.html +0 -34
package/README.md CHANGED
@@ -1,120 +1,120 @@
1
- # forlogic-core
2
-
3
- Shared React component library, hooks, services, and configuration for Forlogic / Qualiex projects. Built on Vite + React 18 + Tailwind + shadcn primitives, opinionated for multi-tenant SaaS with Supabase.
4
-
5
- ## Install
6
-
7
- ```bash
8
- npm install forlogic-core
9
- ```
10
-
11
- ## Quick Start
12
-
13
- ```tsx
14
- import { CoreProviders, Button } from 'forlogic-core';
15
- import { setupQualiexCore } from 'forlogic-core/setup';
16
- import ptBR from './i18n/pt-BR.json';
17
-
18
- setupQualiexCore(); // injects fonts, favicon, etc.
19
-
20
- function App() {
21
- return (
22
- <CoreProviders moduleAlias="my-module" appTranslations={{ 'pt-BR': ptBR }}>
23
- <Button variant="primary">Hello</Button>
24
- </CoreProviders>
25
- );
26
- }
27
- ```
28
-
29
- `CoreProviders` wires up auth, React Query, i18n and tooltip providers in the right order.
30
-
31
- ## Modules
32
-
33
- | Module | What it provides | README |
34
- |---|---|---|
35
- | `forlogic-core` (UI) | shadcn-based components (`Button`, `Dialog`, `Combobox`, `Tabs`, ...) | `docs/design-system/` |
36
- | `forlogic-core` (CRUD) | `createCrudPage`, `CrudTable`, `BaseForm`, services hook | `docs/design-system/crud.md` |
37
- | `forlogic-core/auth` | OAuth + PKCE, multi-tenant alias routing, `useAuth` | [`lib/auth/README.md`](lib/auth/README.md) |
38
- | `forlogic-core/services` | `BaseService`, `createSimpleService`, Email, Error | [`lib/services/README.md`](lib/services/README.md) |
39
- | `forlogic-core/places` | Hierarchical Org Units (UO) selectors and tree view | [`lib/places/README.md`](lib/places/README.md) |
40
- | `forlogic-core/approval-flow` | Approval sidebar, dialogs and types | [`lib/approval-flow/README.md`](lib/approval-flow/README.md) |
41
- | `forlogic-core/media` | `VideoEditor`, `ImageEditor` with pluggable upload | [`lib/media/README.md`](lib/media/README.md) |
42
- | `forlogic-core/integrations` | Clarity, Supabase client | [`lib/integrations/README.md`](lib/integrations/README.md) |
43
-
44
- ## Modular imports
45
-
46
- Subpath exports keep bundles lean:
47
-
48
- ```ts
49
- import { Button } from 'forlogic-core/ui';
50
- import { createCrudPage } from 'forlogic-core/crud';
51
- import { createSecurityHeadersPlugin } from 'forlogic-core/vite';
52
- import { forlogicTailwindPreset } from 'forlogic-core/tailwind';
53
- ```
54
-
55
- The flat `forlogic-core` export re-exports everything for convenience.
56
-
57
- ---
58
-
59
- ## Schema do Projeto
60
-
61
- > ⚠️ **SCHEMA = `common`**
62
- >
63
- > Este é o **único local** onde o schema é definido. Toda query Supabase **DEVE** usar `.schema('common')`.
64
-
65
- ```ts
66
- // ✅ CORRETO
67
- supabase.schema('common').from('tabela').select('*');
68
-
69
- // ❌ ERRADO (vai falhar em produção)
70
- supabase.from('tabela').select('*');
71
- ```
72
-
73
- ---
74
-
75
- ## Documentação
76
-
77
- | Documento | Caminho | Conteúdo |
78
- |-----------|---------|----------|
79
- | **Constituição** | [`spec/constitution.md`](spec/constitution.md) | Regras, convenções e melhores práticas obrigatórias |
80
- | **Design System** | `docs/design-system/` | Documentação de componentes, props e exemplos |
81
- | **Design System (visual)** | Rota `/ds` no app | Documentação interativa |
82
-
83
- ---
84
-
85
- ## Cross-Project: Projeto Admin (DS + Lib)
86
-
87
- > Para consultar componentes, props, tipos, exemplos e implementação: use cross-project (`@Admin`).
88
-
89
- | O que procurar | Caminho no Admin |
90
- |----------------|------------------|
91
- | Código-fonte dos componentes UI | `lib/components/ui/` |
92
- | Sistema CRUD | `lib/crud/` |
93
- | Barrel exports (lista completa) | `lib/exports/ui.ts`, `lib/exports/index.ts` |
94
- | Documentação MD do Design System | `docs/design-system/` |
95
- | Docs interativos (código-fonte) | `src/design-system/docs/` |
96
- | Hooks compartilhados | `lib/hooks/` |
97
- | Providers (CoreProviders) | `lib/providers/` |
98
- | Serviços (Base, Email, Error) | `lib/services/` |
99
- | Config Vite/Tailwind | `lib/vite/`, `lib/tailwind/` |
100
- | Prompt template | `docs/PROMPT_TEMPLATE.md` |
101
- | Project Knowledge template | `docs/PROJECT_KNOWLEDGE_TEMPLATE.md` |
102
- | Starter template | `docs/STARTER_TEMPLATE.md` |
103
- | Prompt de auditoria | `docs/AUDIT_PROMPT.md` |
104
- | Golden snippets | `docs/design-system/examples.md` |
105
-
106
- ---
107
-
108
- ## Instrução para IA
109
-
110
- **QUANDO** criar ou modificar qualquer arquivo `.tsx` com JSX:
111
-
112
- - **SE** contém tabela, listagem ou CRUD → **LER** `@Admin docs/design-system/crud.md` e `@Admin docs/design-system/tables-grids.md` ANTES
113
- - **SE** contém formulário, input ou campo → **LER** `@Admin docs/design-system/inputs.md` e `@Admin docs/design-system/selectors.md` ANTES
114
- - **SE** contém modal ou confirmação → **LER** `@Admin docs/design-system/dialogs.md` ANTES
115
- - **SE** contém botões ou ações de linha → **LER** `@Admin docs/design-system/buttons-actions.md` ANTES
116
- - **SE** é estrutura de página/layout → **LER** `@Admin docs/design-system/layout.md` ANTES
117
-
118
- **SEMPRE** consultar `@Admin docs/design-system/examples.md` como referência de implementação.
119
-
120
- **VALIDAÇÃO pós-geração**: Todo import de componente visual DEVE vir de `forlogic-core`. Se criou componente local que existe na lib, refatore imediatamente.
1
+ # forlogic-core
2
+
3
+ Shared React component library, hooks, services, and configuration for Forlogic / Qualiex projects. Built on Vite + React 18 + Tailwind + shadcn primitives, opinionated for multi-tenant SaaS with Supabase.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install forlogic-core
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```tsx
14
+ import { CoreProviders, Button } from 'forlogic-core';
15
+ import { setupQualiexCore } from 'forlogic-core/setup';
16
+ import ptBR from './i18n/pt-BR.json';
17
+
18
+ setupQualiexCore(); // injects fonts, favicon, etc.
19
+
20
+ function App() {
21
+ return (
22
+ <CoreProviders moduleAlias="my-module" appTranslations={{ 'pt-BR': ptBR }}>
23
+ <Button variant="primary">Hello</Button>
24
+ </CoreProviders>
25
+ );
26
+ }
27
+ ```
28
+
29
+ `CoreProviders` wires up auth, React Query, i18n and tooltip providers in the right order.
30
+
31
+ ## Modules
32
+
33
+ | Module | What it provides | README |
34
+ |---|---|---|
35
+ | `forlogic-core` (UI) | shadcn-based components (`Button`, `Dialog`, `Combobox`, `Tabs`, ...) | `docs/design-system/` |
36
+ | `forlogic-core` (CRUD) | `createCrudPage`, `CrudTable`, `BaseForm`, services hook | `docs/design-system/crud.md` |
37
+ | `forlogic-core/auth` | OAuth + PKCE, multi-tenant alias routing, `useAuth` | [`lib/auth/README.md`](lib/auth/README.md) |
38
+ | `forlogic-core/services` | `BaseService`, `createSimpleService`, Email, Error | [`lib/services/README.md`](lib/services/README.md) |
39
+ | `forlogic-core/places` | Hierarchical Org Units (UO) selectors and tree view | [`lib/places/README.md`](lib/places/README.md) |
40
+ | `forlogic-core/approval-flow` | Approval sidebar, dialogs and types | [`lib/approval-flow/README.md`](lib/approval-flow/README.md) |
41
+ | `forlogic-core/media` | `VideoEditor`, `ImageEditor` with pluggable upload | [`lib/media/README.md`](lib/media/README.md) |
42
+ | `forlogic-core/integrations` | Clarity, Supabase client | [`lib/integrations/README.md`](lib/integrations/README.md) |
43
+
44
+ ## Modular imports
45
+
46
+ Subpath exports keep bundles lean:
47
+
48
+ ```ts
49
+ import { Button } from 'forlogic-core/ui';
50
+ import { createCrudPage } from 'forlogic-core/crud';
51
+ import { createSecurityHeadersPlugin } from 'forlogic-core/vite';
52
+ import { forlogicTailwindPreset } from 'forlogic-core/tailwind';
53
+ ```
54
+
55
+ The flat `forlogic-core` export re-exports everything for convenience.
56
+
57
+ ---
58
+
59
+ ## Schema do Projeto
60
+
61
+ > ⚠️ **SCHEMA = `common`**
62
+ >
63
+ > Este é o **único local** onde o schema é definido. Toda query Supabase **DEVE** usar `.schema('common')`.
64
+
65
+ ```ts
66
+ // ✅ CORRETO
67
+ supabase.schema('common').from('tabela').select('*');
68
+
69
+ // ❌ ERRADO (vai falhar em produção)
70
+ supabase.from('tabela').select('*');
71
+ ```
72
+
73
+ ---
74
+
75
+ ## Documentação
76
+
77
+ | Documento | Caminho | Conteúdo |
78
+ |-----------|---------|----------|
79
+ | **Constituição** | [`spec/constitution.md`](spec/constitution.md) | Regras, convenções e melhores práticas obrigatórias |
80
+ | **Design System** | `docs/design-system/` | Documentação de componentes, props e exemplos |
81
+ | **Design System (visual)** | Rota `/ds` no app | Documentação interativa |
82
+
83
+ ---
84
+
85
+ ## Cross-Project: Projeto Admin (DS + Lib)
86
+
87
+ > Para consultar componentes, props, tipos, exemplos e implementação: use cross-project (`@Admin`).
88
+
89
+ | O que procurar | Caminho no Admin |
90
+ |----------------|------------------|
91
+ | Código-fonte dos componentes UI | `lib/components/ui/` |
92
+ | Sistema CRUD | `lib/crud/` |
93
+ | Barrel exports (lista completa) | `lib/exports/ui.ts`, `lib/exports/index.ts` |
94
+ | Documentação MD do Design System | `docs/design-system/` |
95
+ | Docs interativos (código-fonte) | `src/design-system/docs/` |
96
+ | Hooks compartilhados | `lib/hooks/` |
97
+ | Providers (CoreProviders) | `lib/providers/` |
98
+ | Serviços (Base, Email, Error) | `lib/services/` |
99
+ | Config Vite/Tailwind | `lib/vite/`, `lib/tailwind/` |
100
+ | Prompt template | `docs/PROMPT_TEMPLATE.md` |
101
+ | Project Knowledge template | `docs/PROJECT_KNOWLEDGE_TEMPLATE.md` |
102
+ | Starter template | `docs/STARTER_TEMPLATE.md` |
103
+ | Prompt de auditoria | `docs/AUDIT_PROMPT.md` |
104
+ | Golden snippets | `docs/design-system/examples.md` |
105
+
106
+ ---
107
+
108
+ ## Instrução para IA
109
+
110
+ **QUANDO** criar ou modificar qualquer arquivo `.tsx` com JSX:
111
+
112
+ - **SE** contém tabela, listagem ou CRUD → **LER** `@Admin docs/design-system/crud.md` e `@Admin docs/design-system/tables-grids.md` ANTES
113
+ - **SE** contém formulário, input ou campo → **LER** `@Admin docs/design-system/inputs.md` e `@Admin docs/design-system/selectors.md` ANTES
114
+ - **SE** contém modal ou confirmação → **LER** `@Admin docs/design-system/dialogs.md` ANTES
115
+ - **SE** contém botões ou ações de linha → **LER** `@Admin docs/design-system/buttons-actions.md` ANTES
116
+ - **SE** é estrutura de página/layout → **LER** `@Admin docs/design-system/layout.md` ANTES
117
+
118
+ **SEMPRE** consultar `@Admin docs/design-system/examples.md` como referência de implementação.
119
+
120
+ **VALIDAÇÃO pós-geração**: Todo import de componente visual DEVE vir de `forlogic-core`. Se criou componente local que existe na lib, refatore imediatamente.