forlogic-core 2.1.4 → 2.2.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 (248) 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 -68
  11. package/dist/action-plans/components/ActionPlanAttachmentsTab.d.ts +3 -0
  12. package/dist/action-plans/components/ActionPlanCommentsTab.d.ts +3 -0
  13. package/dist/action-plans/components/ActionPlanCostTab.d.ts +5 -0
  14. package/dist/action-plans/components/ActionPlanGeneralTab.d.ts +3 -0
  15. package/dist/action-plans/components/ActionPlanHistoryTab.d.ts +3 -0
  16. package/dist/action-plans/components/ActionPlanPredecessorsTab.d.ts +5 -0
  17. package/dist/action-plans/components/ActionPlanProgressDialog.d.ts +3 -0
  18. package/dist/action-plans/components/ActionPlanProgressTab.d.ts +5 -0
  19. package/dist/action-plans/components/ActionPlanStatusBadge.d.ts +9 -2
  20. package/dist/action-plans/constants.d.ts +24 -0
  21. package/dist/action-plans/hooks/useActionPlan.d.ts +5 -0
  22. package/dist/action-plans/hooks/useActionPlanProgress.d.ts +5 -0
  23. package/dist/action-plans/types.d.ts +60 -0
  24. package/dist/action-plans/utils/formatTime.d.ts +9 -0
  25. package/dist/audit-trail/components/AuditTrailDetails.d.ts +10 -0
  26. package/dist/audit-trail/components/AuditTrailFilter.d.ts +10 -0
  27. package/dist/audit-trail/components/AuditTrailPage.d.ts +10 -0
  28. package/dist/audit-trail/types.d.ts +58 -0
  29. package/dist/audit-trail/utils.d.ts +18 -2
  30. package/dist/auth/components/EditProfileDialog.d.ts +1 -0
  31. package/dist/auth/components/ProtectedRoute.d.ts +5 -0
  32. package/dist/auth/contexts/AuthContext.d.ts +5 -0
  33. package/dist/auth/pages/CallbackPage.d.ts +5 -0
  34. package/dist/auth/services/AuthService.d.ts +5 -0
  35. package/dist/auth/services/TokenManager.d.ts +5 -0
  36. package/dist/auth/services/TokenService.d.ts +10 -0
  37. package/dist/auth/utils/ErrorInterceptor.d.ts +5 -0
  38. package/dist/components/dashboards/dashboard-form.d.ts +15 -0
  39. package/dist/components/dashboards/dashboard-general-view.d.ts +15 -0
  40. package/dist/components/dashboards/dashboard-grid.d.ts +25 -0
  41. package/dist/components/dashboards/dashboard-list.d.ts +10 -0
  42. package/dist/components/dashboards/dashboard-panel-renderer.d.ts +10 -0
  43. package/dist/components/dashboards/dashboard-view.d.ts +10 -0
  44. package/dist/components/dashboards/helpers.d.ts +44 -5
  45. package/dist/components/dashboards/panels/burndown-panel.d.ts +15 -0
  46. package/dist/components/dashboards/panels/cartesian-panel.d.ts +20 -0
  47. package/dist/components/dashboards/panels/list-panel.d.ts +15 -0
  48. package/dist/components/dashboards/panels/matrix-risk-panel.d.ts +25 -0
  49. package/dist/components/dashboards/panels/numeric-panel.d.ts +10 -0
  50. package/dist/components/dashboards/panels/panel-error.d.ts +10 -0
  51. package/dist/components/dashboards/panels/panel-header.d.ts +10 -0
  52. package/dist/components/dashboards/panels/panel-loader.d.ts +10 -0
  53. package/dist/components/dashboards/panels/panel-no-data.d.ts +10 -0
  54. package/dist/components/dashboards/panels/panel-unavailable.d.ts +10 -0
  55. package/dist/components/dashboards/panels/pareto-panel.d.ts +10 -0
  56. package/dist/components/dashboards/panels/performance-panel.d.ts +15 -0
  57. package/dist/components/dashboards/panels/pie-panel.d.ts +10 -0
  58. package/dist/components/dashboards/panels/text-panel.d.ts +10 -0
  59. package/dist/components/dashboards/types.d.ts +230 -0
  60. package/dist/components/modules/AccessDeniedDialog.d.ts +3 -1
  61. package/dist/components/modules/ModuleAccessGuard.d.ts +3 -1
  62. package/dist/components/modules/ModulesContent.d.ts +3 -1
  63. package/dist/components/modules/ModulesDialog.d.ts +1 -1
  64. package/dist/components/modules/ModulesFooterCards.d.ts +3 -1
  65. package/dist/components/modules/types.d.ts +2 -0
  66. package/dist/components/ui/accordion.d.ts +35 -0
  67. package/dist/components/ui/action-button.d.ts +5 -0
  68. package/dist/components/ui/alert-dialog.d.ts +82 -0
  69. package/dist/components/ui/alert.d.ts +32 -0
  70. package/dist/components/ui/avatar.d.ts +30 -0
  71. package/dist/components/ui/badge.d.ts +32 -0
  72. package/dist/components/ui/breadcrumb.d.ts +54 -0
  73. package/dist/components/ui/button-group.d.ts +15 -0
  74. package/dist/components/ui/button.d.ts +55 -0
  75. package/dist/components/ui/calendar.d.ts +16 -0
  76. package/dist/components/ui/card.d.ts +49 -0
  77. package/dist/components/ui/chart.d.ts +35 -0
  78. package/dist/components/ui/checkbox.d.ts +11 -0
  79. package/dist/components/ui/collapsible.d.ts +15 -0
  80. package/dist/components/ui/color-picker.d.ts +5 -0
  81. package/dist/components/ui/combo-tree.d.ts +23 -0
  82. package/dist/components/ui/combobox.d.ts +28 -0
  83. package/dist/components/ui/command.d.ts +66 -0
  84. package/dist/components/ui/context-menu.d.ts +95 -0
  85. package/dist/components/ui/date-picker.d.ts +10 -0
  86. package/dist/components/ui/dialog-wizard.d.ts +22 -4
  87. package/dist/components/ui/dialog.d.ts +181 -0
  88. package/dist/components/ui/drawer.d.ts +72 -0
  89. package/dist/components/ui/dropdown-menu.d.ts +153 -0
  90. package/dist/components/ui/electronic-signature-dialog.d.ts +10 -0
  91. package/dist/components/ui/export-dialog.d.ts +20 -0
  92. package/dist/components/ui/form.d.ts +96 -0
  93. package/dist/components/ui/hover-card.d.ts +15 -0
  94. package/dist/components/ui/icon-picker.d.ts +5 -0
  95. package/dist/components/ui/iframe-dialog.d.ts +10 -0
  96. package/dist/components/ui/input-group.d.ts +16 -0
  97. package/dist/components/ui/input.d.ts +5 -0
  98. package/dist/components/ui/menubar.d.ts +80 -0
  99. package/dist/components/ui/multiselect-permissions.d.ts +25 -0
  100. package/dist/components/ui/navigation-menu.d.ts +45 -0
  101. package/dist/components/ui/onboarding-dialog.d.ts +15 -0
  102. package/dist/components/ui/online-editor-dialog.d.ts +10 -0
  103. package/dist/components/ui/pagination.d.ts +53 -0
  104. package/dist/components/ui/popover.d.ts +8 -0
  105. package/dist/components/ui/radio-group.d.ts +3 -0
  106. package/dist/components/ui/report-request-list.d.ts +20 -0
  107. package/dist/components/ui/resizable.d.ts +15 -0
  108. package/dist/components/ui/rich-text-editor.d.ts +13 -0
  109. package/dist/components/ui/scroll-area.d.ts +3 -0
  110. package/dist/components/ui/select.d.ts +71 -0
  111. package/dist/components/ui/separator.d.ts +13 -0
  112. package/dist/components/ui/sheet.d.ts +76 -0
  113. package/dist/components/ui/sidebar.d.ts +203 -0
  114. package/dist/components/ui/skeleton-variants.d.ts +25 -0
  115. package/dist/components/ui/skeleton.d.ts +12 -0
  116. package/dist/components/ui/slider.d.ts +5 -0
  117. package/dist/components/ui/sonner.d.ts +5 -0
  118. package/dist/components/ui/spinner.d.ts +5 -0
  119. package/dist/components/ui/split-button.d.ts +6 -0
  120. package/dist/components/ui/stack.d.ts +5 -0
  121. package/dist/components/ui/status-badge.d.ts +52 -0
  122. package/dist/components/ui/step-selector.d.ts +5 -0
  123. package/dist/components/ui/stimulsoft-viewer.d.ts +8 -0
  124. package/dist/components/ui/switch.d.ts +21 -0
  125. package/dist/components/ui/tab-page-layout.d.ts +33 -0
  126. package/dist/components/ui/table-resize-handle.d.ts +10 -3
  127. package/dist/components/ui/table.d.ts +102 -0
  128. package/dist/components/ui/tabs.d.ts +59 -0
  129. package/dist/components/ui/terms-of-use-dialog.d.ts +50 -4
  130. package/dist/components/ui/textarea.d.ts +27 -0
  131. package/dist/components/ui/timepicker.d.ts +23 -0
  132. package/dist/components/ui/toggle-group.d.ts +25 -0
  133. package/dist/components/ui/toggle.d.ts +21 -0
  134. package/dist/components/ui/tooltip.d.ts +48 -0
  135. package/dist/components/ui/truncated-cell.d.ts +13 -0
  136. package/dist/components/ui/typography.d.ts +119 -0
  137. package/dist/components/ui/updates-notification.d.ts +33 -0
  138. package/dist/components/ui/users-groups-selector.d.ts +43 -0
  139. package/dist/components/ui/viewer-dialog.d.ts +107 -0
  140. package/dist/crud/components/ActionMenuItems.d.ts +5 -0
  141. package/dist/crud/components/BaseForm.d.ts +46 -0
  142. package/dist/crud/components/ColumnSettingsPopover.d.ts +10 -0
  143. package/dist/crud/components/CrudActionBar.d.ts +20 -0
  144. package/dist/crud/components/CrudGrid.d.ts +10 -0
  145. package/dist/crud/components/CrudPagination.d.ts +5 -0
  146. package/dist/crud/components/CrudTable.d.ts +5 -0
  147. package/dist/crud/components/TableRowActions.d.ts +5 -0
  148. package/dist/crud/createCrudPage.d.ts +41 -8
  149. package/dist/crud/generateCrudConfig.d.ts +13 -8
  150. package/dist/crud/hooks/useBaseForm.d.ts +39 -0
  151. package/dist/crud/hooks/useColumnManager.d.ts +25 -0
  152. package/dist/crud/hooks/useCrud.d.ts +35 -0
  153. package/dist/crud/primitives/ActionMenu.d.ts +41 -0
  154. package/dist/crud/primitives/FilterBar.d.ts +45 -0
  155. package/dist/crud/primitives/Pagination.d.ts +5 -0
  156. package/dist/crud/primitives/Table.d.ts +6 -1
  157. package/dist/crud/primitives/TreeTable.d.ts +5 -0
  158. package/dist/crud/primitives/types.d.ts +63 -0
  159. package/dist/crud/utils/routingHelpers.d.ts +11 -0
  160. package/dist/custom-form-fields/components/CustomFormFields.d.ts +3 -0
  161. package/dist/custom-form-fields/fields/FormDateField.d.ts +3 -0
  162. package/dist/custom-form-fields/fields/FormMultiSelectionField.d.ts +3 -0
  163. package/dist/custom-form-fields/fields/FormNumericField.d.ts +3 -0
  164. package/dist/custom-form-fields/fields/FormQuestionsField.d.ts +3 -0
  165. package/dist/custom-form-fields/fields/FormSingleSelectionField.d.ts +3 -0
  166. package/dist/custom-form-fields/fields/FormTextField.d.ts +3 -0
  167. package/dist/custom-form-fields/fields/FormTimeField.d.ts +3 -0
  168. package/dist/custom-form-fields/fields/FormUrlField.d.ts +3 -0
  169. package/dist/custom-form-fields/fields/ReadOnlyTextField.d.ts +3 -0
  170. package/dist/custom-form-fields/types.d.ts +84 -21
  171. package/dist/exports/crud.d.ts +5 -0
  172. package/dist/exports/integrations.d.ts +1 -0
  173. package/dist/exports/ui.d.ts +1 -0
  174. package/dist/file-upload/components/SingleFileUpload.d.ts +59 -0
  175. package/dist/file-upload/types.d.ts +15 -0
  176. package/dist/file-upload/utils/formatBytes.d.ts +5 -0
  177. package/dist/file-upload/utils/getFileExtension.d.ts +5 -0
  178. package/dist/hooks/useColumnResize.d.ts +24 -0
  179. package/dist/hooks/useRowResize.d.ts +18 -0
  180. package/dist/hooks/useSidebarResize.d.ts +18 -0
  181. package/dist/hooks/useUpdatesNotification.d.ts +16 -0
  182. package/dist/index.css +1 -1
  183. package/dist/index.css.map +1 -1
  184. package/dist/index.esm.js +1 -1
  185. package/dist/index.js +1 -1
  186. package/dist/integrations/clarity/clarityTracking.d.ts +31 -0
  187. package/dist/integrations/clarity/index.d.ts +3 -0
  188. package/dist/integrations/clarity/types.d.ts +46 -0
  189. package/dist/integrations/clarity/useClarity.d.ts +34 -0
  190. package/dist/integrations/index.d.ts +5 -0
  191. package/dist/providers/CoreProviders.d.ts +16 -1
  192. package/dist/qualiex/components/QualiexUserField.d.ts +8 -0
  193. package/dist/qualiex/hooks/useQualiexUsers.d.ts +16 -26
  194. package/dist/qualiex/services/qualiexApi.d.ts +38 -2
  195. package/dist/qualiex/utils/QualiexErrorInterceptor.d.ts +5 -0
  196. package/dist/supabase/SupabaseSingleton.d.ts +34 -0
  197. package/dist/types.d.ts +51 -2
  198. package/dist/utils/color.d.ts +26 -0
  199. package/dist/utils/index.d.ts +1 -0
  200. package/dist/vite/index.esm.js +4 -1
  201. package/dist/vite/index.js +4 -1
  202. package/docs/PUBLISH.md +168 -0
  203. package/docs/STORAGE_BUCKETS.md +384 -0
  204. package/docs/WORKSPACE_KNOWLEDGE.md +120 -119
  205. package/docs/design-system/README.md +1 -1
  206. package/docs/design-system/buttons-actions.md +130 -130
  207. package/docs/design-system/charts-dashboards.md +340 -301
  208. package/docs/design-system/crud.md +174 -114
  209. package/docs/design-system/data-display.md +108 -103
  210. package/docs/design-system/dialogs.md +212 -212
  211. package/docs/design-system/domain.md +317 -317
  212. package/docs/design-system/examples.md +275 -275
  213. package/docs/design-system/foundation.md +1 -1
  214. package/docs/design-system/inputs.md +131 -131
  215. package/docs/design-system/layout.md +202 -154
  216. package/docs/design-system/navigation.md +271 -325
  217. package/docs/design-system/notifications-feedback.md +34 -34
  218. package/docs/design-system/patterns/README.md +53 -53
  219. package/docs/design-system/patterns/action-button.md +22 -22
  220. package/docs/design-system/patterns/alertdialog-deletion.md +46 -46
  221. package/docs/design-system/patterns/baseform-custom-fields.md +59 -59
  222. package/docs/design-system/patterns/baseform-usage.md +42 -42
  223. package/docs/design-system/patterns/body-content-scroll.md +56 -56
  224. package/docs/design-system/patterns/combo-tree.md +23 -23
  225. package/docs/design-system/patterns/components-registry.md +17 -17
  226. package/docs/design-system/patterns/core-providers.md +41 -39
  227. package/docs/design-system/patterns/crud-bulk-actions.md +12 -12
  228. package/docs/design-system/patterns/crud-config-props.md +16 -16
  229. package/docs/design-system/patterns/crud-defaults.md +17 -17
  230. package/docs/design-system/patterns/crud-toolbar.md +28 -28
  231. package/docs/design-system/patterns/delete-confirmation.md +40 -40
  232. package/docs/design-system/patterns/dialog-body-scroll.md +26 -26
  233. package/docs/design-system/patterns/dialog-structure.md +32 -32
  234. package/docs/design-system/patterns/dialog-variants.md +41 -41
  235. package/docs/design-system/patterns/feature-flags.md +24 -20
  236. package/docs/design-system/patterns/header-metadata.md +57 -57
  237. package/docs/design-system/patterns/i18n-setup.md +117 -117
  238. package/docs/design-system/patterns/pagination.md +27 -27
  239. package/docs/design-system/patterns/single-scroll.md +39 -39
  240. package/docs/design-system/patterns/vite-tailwind-setup.md +48 -48
  241. package/docs/design-system/platform.md +18 -18
  242. package/docs/design-system/selectors.md +240 -236
  243. package/docs/design-system/tables-grids.md +95 -38
  244. package/package.json +150 -144
  245. package/dist/README.md +0 -1079
  246. package/dist/bin/bootstrap.js +0 -40
  247. package/dist/bin/pull-docs.js +0 -186
  248. package/dist/docs/KNOWLEDGE.md +0 -109
@@ -1,57 +1,57 @@
1
- # Padrão: Título, Subtítulo e Breadcrumbs via Header (usePageMetadata)
2
-
3
- ## Regra
4
-
5
- **O padrão da aplicação é exibir título, subtítulo e breadcrumbs no header** usando `usePageMetadata()`.
6
-
7
- - **NÃO** usar `BodyContent` ou `ContentContainer` com título/subtítulo internos por padrão.
8
- - Breadcrumbs, títulos e subtítulos internos ao conteúdo são **exceções** e devem ser usados **somente quando explicitamente solicitados**.
9
-
10
- ## Uso Padrão
11
-
12
- ```tsx
13
- import { usePageMetadata } from 'forlogic-core';
14
-
15
- export function MinhaPage() {
16
- usePageMetadata({ title: 'Título', subtitle: 'Subtítulo descritivo' });
17
-
18
- return (
19
- <div className="flex flex-col h-full p-4 gap-4">
20
- {/* conteúdo direto, sem BodyContent/ContentContainer */}
21
- </div>
22
- );
23
- }
24
- ```
25
-
26
- ## Com Breadcrumbs
27
-
28
- ```tsx
29
- usePageMetadata({
30
- title: 'Editar Usuário',
31
- subtitle: 'Atualize os dados cadastrais',
32
- breadcrumbs: [
33
- { label: 'Usuários', href: '/users' },
34
- { label: 'João Silva' }
35
- ]
36
- });
37
- ```
38
-
39
- ## Subtitle com ReactNode
40
-
41
- ```tsx
42
- usePageMetadata({
43
- title: 'Detalhes',
44
- subtitle: <span>Veja a <Link to="/docs">documentação</Link></span>
45
- });
46
- ```
47
-
48
- ## ❌ Evitar (exceto quando pedido)
49
-
50
- ```tsx
51
- // NÃO fazer por padrão:
52
- <BodyContent breadcrumbs={[{ label: 'Página' }]}>
53
- <ContentContainer title="Título" subtitle="Subtítulo">
54
- ...
55
- </ContentContainer>
56
- </BodyContent>
57
- ```
1
+ # Padrão: Título, Subtítulo e Breadcrumbs via Header (usePageMetadata)
2
+
3
+ ## Regra
4
+
5
+ **O padrão da aplicação é exibir título, subtítulo e breadcrumbs no header** usando `usePageMetadata()`.
6
+
7
+ - **NÃO** usar `BodyContent` ou `ContentContainer` com título/subtítulo internos por padrão.
8
+ - Breadcrumbs, títulos e subtítulos internos ao conteúdo são **exceções** e devem ser usados **somente quando explicitamente solicitados**.
9
+
10
+ ## Uso Padrão
11
+
12
+ ```tsx
13
+ import { usePageMetadata } from 'forlogic-core';
14
+
15
+ export function MinhaPage() {
16
+ usePageMetadata({ title: 'Título', subtitle: 'Subtítulo descritivo' });
17
+
18
+ return (
19
+ <div className="flex flex-col h-full p-4 gap-4">
20
+ {/* conteúdo direto, sem BodyContent/ContentContainer */}
21
+ </div>
22
+ );
23
+ }
24
+ ```
25
+
26
+ ## Com Breadcrumbs
27
+
28
+ ```tsx
29
+ usePageMetadata({
30
+ title: 'Editar Usuário',
31
+ subtitle: 'Atualize os dados cadastrais',
32
+ breadcrumbs: [
33
+ { label: 'Usuários', href: '/users' },
34
+ { label: 'João Silva' }
35
+ ]
36
+ });
37
+ ```
38
+
39
+ ## Subtitle com ReactNode
40
+
41
+ ```tsx
42
+ usePageMetadata({
43
+ title: 'Detalhes',
44
+ subtitle: <span>Veja a <Link to="/docs">documentação</Link></span>
45
+ });
46
+ ```
47
+
48
+ ## ❌ Evitar (exceto quando pedido)
49
+
50
+ ```tsx
51
+ // NÃO fazer por padrão:
52
+ <BodyContent breadcrumbs={[{ label: 'Página' }]}>
53
+ <ContentContainer title="Título" subtitle="Subtítulo">
54
+ ...
55
+ </ContentContainer>
56
+ </BodyContent>
57
+ ```
@@ -1,117 +1,117 @@
1
- # Padrão: Setup de Traduções (i18n)
2
-
3
- ## Arquitetura de namespaces
4
-
5
- - `core` — traduções base da lib (save, cancel, delete, etc.)
6
- - `app` — traduções do projeto consumidor (injetadas via `CoreProviders`)
7
- - Resolução: `app` → `core` → fallback `pt-BR`
8
-
9
- ## Setup em projetos consumidores
10
-
11
- ### Projeto simples (poucas chaves)
12
-
13
- 1. Criar JSON flat em `src/i18n/pt-BR.json`: `{ "key": "value" }` (sem nesting)
14
- 2. Passar para CoreProviders:
15
-
16
- ```tsx
17
- <CoreProviders appTranslations={{ 'pt-BR': ptBR, 'en-US': enUS }}>
18
- ```
19
-
20
- 3. Usar `useTranslation` de `forlogic-core` (nunca de `react-i18next`)
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
-
83
- ## Resolução de chaves
84
-
85
- ```
86
- t('save') → app: não encontra → core: "Salvar"
87
- t('objective') → app: "Objetivo"
88
- t('save') com override no app → app: "Gravar" (sobrescreve core)
89
- ```
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
-
102
- ## Debug
103
-
104
- ```ts
105
- import { i18n } from 'forlogic-core';
106
- console.log('Resources:', i18n.store.data);
107
- ```
108
-
109
- ## Troubleshooting
110
-
111
- | Causa | Solução |
112
- |-------|---------|
113
- | Chaves aparecem ao invés de traduções | Instalar peer deps `i18next` e `react-i18next` |
114
- | Import de `react-i18next` direto | Usar import de `forlogic-core` |
115
- | `appTranslations` não passado | Adicionar prop no CoreProviders |
116
- | JSON com formato errado | Deve ser flat, sem nesting |
117
- | Chave duplicada entre features | Último arquivo no merge vence |
1
+ # Padrão: Setup de Traduções (i18n)
2
+
3
+ ## Arquitetura de namespaces
4
+
5
+ - `core` — traduções base da lib (save, cancel, delete, etc.)
6
+ - `app` — traduções do projeto consumidor (injetadas via `CoreProviders`)
7
+ - Resolução: `app` → `core` → fallback `pt-BR`
8
+
9
+ ## Setup em projetos consumidores
10
+
11
+ ### Projeto simples (poucas chaves)
12
+
13
+ 1. Criar JSON flat em `src/i18n/pt-BR.json`: `{ "key": "value" }` (sem nesting)
14
+ 2. Passar para CoreProviders:
15
+
16
+ ```tsx
17
+ <CoreProviders appTranslations={{ 'pt-BR': ptBR, 'en-US': enUS }}>
18
+ ```
19
+
20
+ 3. Usar `useTranslation` de `forlogic-core` (nunca de `react-i18next`)
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
+
83
+ ## Resolução de chaves
84
+
85
+ ```
86
+ t('save') → app: não encontra → core: "Salvar"
87
+ t('objective') → app: "Objetivo"
88
+ t('save') com override no app → app: "Gravar" (sobrescreve core)
89
+ ```
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
+
102
+ ## Debug
103
+
104
+ ```ts
105
+ import { i18n } from 'forlogic-core';
106
+ console.log('Resources:', i18n.store.data);
107
+ ```
108
+
109
+ ## Troubleshooting
110
+
111
+ | Causa | Solução |
112
+ |-------|---------|
113
+ | Chaves aparecem ao invés de traduções | Instalar peer deps `i18next` e `react-i18next` |
114
+ | Import de `react-i18next` direto | Usar import de `forlogic-core` |
115
+ | `appTranslations` não passado | Adicionar prop no CoreProviders |
116
+ | JSON com formato errado | Deve ser flat, sem nesting |
117
+ | Chave duplicada entre features | Último arquivo no merge vence |
@@ -1,27 +1,27 @@
1
- # Padrão: Paginação
2
-
3
- **SEMPRE** usar `Pagination` ou `CrudPrimitivePagination` da lib. NUNCA implementar manualmente.
4
-
5
- ```tsx
6
- // ❌ PROIBIDO - paginação manual
7
- <div className="flex gap-2">
8
- <Button onClick={() => setPage(p => p - 1)}>Anterior</Button>
9
- <span>Página {page}</span>
10
- <Button onClick={() => setPage(p => p + 1)}>Próxima</Button>
11
- </div>
12
-
13
- // ✅ CORRETO - componente padronizado
14
- import { CrudPrimitivePagination } from 'forlogic-core';
15
-
16
- <CrudPrimitivePagination
17
- currentPage={page}
18
- totalPages={totalPages}
19
- pageSize={pageSize}
20
- totalItems={total}
21
- onPageChange={setPage}
22
- onPageSizeChange={setPageSize}
23
- variant="full"
24
- />
25
- ```
26
-
27
- **Obrigatório**: `variant="full"` inclui seletor de itens por página e "X-Y de Z itens".
1
+ # Padrão: Paginação
2
+
3
+ **SEMPRE** usar `Pagination` ou `CrudPrimitivePagination` da lib. NUNCA implementar manualmente.
4
+
5
+ ```tsx
6
+ // ❌ PROIBIDO - paginação manual
7
+ <div className="flex gap-2">
8
+ <Button onClick={() => setPage(p => p - 1)}>Anterior</Button>
9
+ <span>Página {page}</span>
10
+ <Button onClick={() => setPage(p => p + 1)}>Próxima</Button>
11
+ </div>
12
+
13
+ // ✅ CORRETO - componente padronizado
14
+ import { CrudPrimitivePagination } from 'forlogic-core';
15
+
16
+ <CrudPrimitivePagination
17
+ currentPage={page}
18
+ totalPages={totalPages}
19
+ pageSize={pageSize}
20
+ totalItems={total}
21
+ onPageChange={setPage}
22
+ onPageSizeChange={setPageSize}
23
+ variant="full"
24
+ />
25
+ ```
26
+
27
+ **Obrigatório**: `variant="full"` inclui seletor de itens por página e "X-Y de Z itens".
@@ -1,39 +1,39 @@
1
- # Padrão: Scroll Único no Viewport
2
-
3
- O padrão de Scroll Único evita barras de rolagem duplicadas na aplicação.
4
-
5
- ## Cadeia de layout do AppLayout
6
-
7
- ```text
8
- div.h-screen.overflow-hidden ← preso ao viewport, sem scroll
9
- ├─ header (sticky top-0) ← cabeçalho fixo
10
- └─ div.sidebar-container.flex-1.overflow-hidden
11
- ├─ AppSidebar ← sidebar com scroll próprio
12
- └─ main.flex-1.overflow-hidden
13
- └─ div.flex-1.min-h-0.overflow-y-auto ← SCROLL ATIVO aqui
14
- └─ BodyContent (h-full)
15
- └─ ContentContainer (overflow-visible) ← delega scroll para cima
16
- ```
17
-
18
- | Componente | Classes | Responsabilidade |
19
- |------------|---------|------------------|
20
- | `AppLayout` raiz | `h-screen overflow-hidden` | Prende layout ao viewport |
21
- | Container de conteúdo | `flex-1 min-h-0 overflow-y-auto` | Gerencia scroll da página |
22
- | `BodyContent` | `h-full` | Container flexível |
23
- | `ContentContainer` | `overflow-visible` | Delega scroll para o pai |
24
-
25
- **Regra**: Apenas UM nível da hierarquia deve ter scroll ativo — o `div.overflow-y-auto` dentro do `<main>`.
26
-
27
- ```tsx
28
- // ❌ ERRADO - min-h-screen permite crescer além do viewport
29
- <div className="min-h-screen overflow-auto">
30
-
31
- // ✅ CORRETO - h-screen trava no viewport
32
- <div className="h-screen overflow-hidden">
33
- ...
34
- <div className="flex-1 min-h-0 overflow-y-auto">
35
- <BodyContent>...</BodyContent>
36
- </div>
37
- ```
38
-
39
- **`min-h-0`** é essencial no container com `overflow-y-auto` — sem ele, flex items não encolhem abaixo do tamanho do conteúdo.
1
+ # Padrão: Scroll Único no Viewport
2
+
3
+ O padrão de Scroll Único evita barras de rolagem duplicadas na aplicação.
4
+
5
+ ## Cadeia de layout do AppLayout
6
+
7
+ ```text
8
+ div.h-screen.overflow-hidden ← preso ao viewport, sem scroll
9
+ ├─ header (sticky top-0) ← cabeçalho fixo
10
+ └─ div.sidebar-container.flex-1.overflow-hidden
11
+ ├─ AppSidebar ← sidebar com scroll próprio
12
+ └─ main.flex-1.overflow-hidden
13
+ └─ div.flex-1.min-h-0.overflow-y-auto ← SCROLL ATIVO aqui
14
+ └─ BodyContent (h-full)
15
+ └─ ContentContainer (overflow-visible) ← delega scroll para cima
16
+ ```
17
+
18
+ | Componente | Classes | Responsabilidade |
19
+ |------------|---------|------------------|
20
+ | `AppLayout` raiz | `h-screen overflow-hidden` | Prende layout ao viewport |
21
+ | Container de conteúdo | `flex-1 min-h-0 overflow-y-auto` | Gerencia scroll da página |
22
+ | `BodyContent` | `h-full` | Container flexível |
23
+ | `ContentContainer` | `overflow-visible` | Delega scroll para o pai |
24
+
25
+ **Regra**: Apenas UM nível da hierarquia deve ter scroll ativo — o `div.overflow-y-auto` dentro do `<main>`.
26
+
27
+ ```tsx
28
+ // ❌ ERRADO - min-h-screen permite crescer além do viewport
29
+ <div className="min-h-screen overflow-auto">
30
+
31
+ // ✅ CORRETO - h-screen trava no viewport
32
+ <div className="h-screen overflow-hidden">
33
+ ...
34
+ <div className="flex-1 min-h-0 overflow-y-auto">
35
+ <BodyContent>...</BodyContent>
36
+ </div>
37
+ ```
38
+
39
+ **`min-h-0`** é essencial no container com `overflow-y-auto` — sem ele, flex items não encolhem abaixo do tamanho do conteúdo.
@@ -1,48 +1,48 @@
1
- # Padrão: Setup Vite + Tailwind para Projetos Consumidores
2
-
3
- ## Vite — Security Headers
4
-
5
- ```ts
6
- import { createSecurityHeadersPlugin } from 'forlogic-core/vite';
7
-
8
- export default defineConfig(({ mode }) => ({
9
- plugins: [
10
- react(),
11
- createSecurityHeadersPlugin(mode === 'development', {
12
- supabaseUrls: ['https://SEU_PROJETO.supabase.co'],
13
- additionalConnectSrc: ['https://*.qualiex.com'],
14
- }),
15
- ],
16
- resolve: {
17
- alias: { '@': path.resolve(__dirname, './src') },
18
- },
19
- publicDir: false,
20
- esbuild: { sourcemap: true, target: 'es2020' },
21
- build: { chunkSizeWarningLimit: 4000 },
22
- }));
23
- ```
24
-
25
- Opções do plugin: `supabaseUrls`, `trustedOrigins`, `additionalScriptSrc`, `additionalStyleSrc`, `additionalConnectSrc`, `cspReportUri`, `enableTrustedTypes` (default true), `upgradeInsecureRequests` (default true).
26
-
27
- Alternativa: `createForlogicViteConfig()` factory que retorna config completa (ver README).
28
-
29
- ## Tailwind
30
-
31
- ```ts
32
- import { forlogicTailwindPreset, forlogicContentPaths } from 'forlogic-core/tailwind';
33
-
34
- export default {
35
- presets: [forlogicTailwindPreset],
36
- content: [...forlogicContentPaths],
37
- } satisfies Config;
38
- ```
39
-
40
- `forlogicContentPaths` inclui: `./src/**/*.{ts,tsx}`, `./lib/**/*.{ts,tsx}`, `./node_modules/forlogic-core/dist/**/*.{js,ts,jsx,tsx}`, etc.
41
-
42
- ## Checklist
43
-
44
- - [ ] `createSecurityHeadersPlugin` no vite.config.ts com URLs do Supabase
45
- - [ ] `resolve.alias` usa `path.resolve(__dirname, ...)`
46
- - [ ] `forlogicTailwindPreset` no tailwind.config.ts
47
- - [ ] `forlogicContentPaths` no content
48
- - [ ] Variáveis CSS definidas no index.css (--primary, --background, etc.)
1
+ # Padrão: Setup Vite + Tailwind para Projetos Consumidores
2
+
3
+ ## Vite — Security Headers
4
+
5
+ ```ts
6
+ import { createSecurityHeadersPlugin } from 'forlogic-core/vite';
7
+
8
+ export default defineConfig(({ mode }) => ({
9
+ plugins: [
10
+ react(),
11
+ createSecurityHeadersPlugin(mode === 'development', {
12
+ supabaseUrls: ['https://SEU_PROJETO.supabase.co'],
13
+ additionalConnectSrc: ['https://*.qualiex.com'],
14
+ }),
15
+ ],
16
+ resolve: {
17
+ alias: { '@': path.resolve(__dirname, './src') },
18
+ },
19
+ publicDir: false,
20
+ esbuild: { sourcemap: true, target: 'es2020' },
21
+ build: { chunkSizeWarningLimit: 4000 },
22
+ }));
23
+ ```
24
+
25
+ Opções do plugin: `supabaseUrls`, `trustedOrigins`, `additionalScriptSrc`, `additionalStyleSrc`, `additionalConnectSrc`, `cspReportUri`, `enableTrustedTypes` (default true), `upgradeInsecureRequests` (default true).
26
+
27
+ Alternativa: `createForlogicViteConfig()` factory que retorna config completa (ver README).
28
+
29
+ ## Tailwind
30
+
31
+ ```ts
32
+ import { forlogicTailwindPreset, forlogicContentPaths } from 'forlogic-core/tailwind';
33
+
34
+ export default {
35
+ presets: [forlogicTailwindPreset],
36
+ content: [...forlogicContentPaths],
37
+ } satisfies Config;
38
+ ```
39
+
40
+ `forlogicContentPaths` inclui: `./src/**/*.{ts,tsx}`, `./lib/**/*.{ts,tsx}`, `./node_modules/forlogic-core/dist/**/*.{js,ts,jsx,tsx}`, etc.
41
+
42
+ ## Checklist
43
+
44
+ - [ ] `createSecurityHeadersPlugin` no vite.config.ts com URLs do Supabase
45
+ - [ ] `resolve.alias` usa `path.resolve(__dirname, ...)`
46
+ - [ ] `forlogicTailwindPreset` no tailwind.config.ts
47
+ - [ ] `forlogicContentPaths` no content
48
+ - [ ] Variáveis CSS definidas no index.css (--primary, --background, etc.)
@@ -29,23 +29,23 @@ Componente único multi-provider de assinatura digital com fluxo em 3 fases: Upl
29
29
 
30
30
  **Uso:**
31
31
  ```tsx
32
- // Uso básico — provedor resolvido automaticamente pela config da unidade
33
- <DocumentSigner
34
- showEventLog
35
- onDocumentSigned={(data) => {
36
- // data.provider → 'clicksign' ou 'd4sign'
37
- // data.envelope_id, data.document_id, data.signer_id, data.environment
38
- console.log('Assinado:', data);
39
- }}
40
- onError={(error) => {
41
- console.error('Erro:', error.message);
42
- }}
43
- />
44
-
45
- // Passando PDF programaticamente (sem upload manual)
46
- <DocumentSigner
47
- file={meuArquivoPdf}
48
- onDocumentSigned={(data) => console.log('Assinado:', data)}
32
+ // Uso básico — provedor resolvido automaticamente pela config da unidade
33
+ <DocumentSigner
34
+ showEventLog
35
+ onDocumentSigned={(data) => {
36
+ // data.provider → 'clicksign' ou 'd4sign'
37
+ // data.envelope_id, data.document_id, data.signer_id, data.environment
38
+ console.log('Assinado:', data);
39
+ }}
40
+ onError={(error) => {
41
+ console.error('Erro:', error.message);
42
+ }}
43
+ />
44
+
45
+ // Passando PDF programaticamente (sem upload manual)
46
+ <DocumentSigner
47
+ file={meuArquivoPdf}
48
+ onDocumentSigned={(data) => console.log('Assinado:', data)}
49
49
  />
50
50
  ```
51
51
 
@@ -78,7 +78,7 @@ import { DocumentSigner } from
78
78
  - permite busca manual ilimitada.
79
79
  - Configuração de produção: Admin → /a/cs (aba Assinatura digital).
80
80
 
81
- > Fonte: `src\design-system\docs\components\SignDoc.tsx`
81
+ > Fonte: `src/design-system/docs/components/SignDoc.tsx`
82
82
 
83
83
  ---
84
84