forlogic-core 2.1.3 → 2.1.5

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 +68 -68
  11. package/dist/action-plans/components/ActionPlanStatusBadge.d.ts +6 -2
  12. package/dist/components/ui/__tests__/status-badge.test.d.ts +1 -0
  13. package/dist/components/ui/status-badge.d.ts +49 -0
  14. package/dist/crud/primitives/Table.d.ts +1 -1
  15. package/dist/crud/primitives/types.d.ts +6 -0
  16. package/dist/exports/crud.d.ts +5 -0
  17. package/dist/exports/ui.d.ts +1 -0
  18. package/dist/index.css +1 -1
  19. package/dist/index.css.map +1 -1
  20. package/dist/index.esm.js +1 -1
  21. package/dist/index.js +1 -1
  22. package/dist/utils/color.d.ts +26 -0
  23. package/dist/utils/index.d.ts +1 -0
  24. package/docs/PUBLISH.md +168 -0
  25. package/docs/WORKSPACE_KNOWLEDGE.md +119 -119
  26. package/docs/design-system/README.md +1 -1
  27. package/docs/design-system/buttons-actions.md +130 -130
  28. package/docs/design-system/charts-dashboards.md +340 -301
  29. package/docs/design-system/crud.md +174 -114
  30. package/docs/design-system/data-display.md +108 -103
  31. package/docs/design-system/dialogs.md +212 -212
  32. package/docs/design-system/domain.md +317 -317
  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 +131 -131
  36. package/docs/design-system/layout.md +202 -154
  37. package/docs/design-system/navigation.md +271 -325
  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 +39 -39
  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 +24 -20
  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 +48 -48
  62. package/docs/design-system/platform.md +18 -18
  63. package/docs/design-system/selectors.md +236 -236
  64. package/docs/design-system/tables-grids.md +95 -38
  65. package/package.json +144 -144
  66. package/dist/README.md +0 -1079
  67. package/dist/bin/bootstrap.js +0 -40
  68. package/dist/bin/pull-docs.js +0 -186
  69. package/dist/docs/KNOWLEDGE.md +0 -109
@@ -11,24 +11,24 @@ Sistema de gráficos baseado em Recharts com suporte a temas e tooltips customiz
11
11
 
12
12
  **Uso:**
13
13
  ```tsx
14
- import { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent } from "forlogic-core"
15
- import { Bar, BarChart, XAxis, YAxis, CartesianGrid } from "recharts"
16
-
17
- const chartConfig = {
18
- desktop: { label: "Desktop", color: "hsl(var(--primary))" },
19
- mobile: { label: "Mobile", color: "hsl(var(--secondary))" },
20
- }
21
-
22
- <ChartContainer config={chartConfig} className="h-[300px]">
23
- <BarChart data={data}>
24
- <CartesianGrid strokeDasharray="3 3" vertical={false} />
25
- <XAxis dataKey="month" tickLine={false} axisLine={false} />
26
- <YAxis tickLine={false} axisLine={false} />
27
- <ChartTooltip content={<ChartTooltipContent />} />
28
- <ChartLegend content={<ChartLegendContent />} />
29
- <Bar dataKey="desktop" fill="var(--color-desktop)" radius={4} />
30
- <Bar dataKey="mobile" fill="var(--color-mobile)" radius={4} />
31
- </BarChart>
14
+ import { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent } from "forlogic-core"
15
+ import { Bar, BarChart, XAxis, YAxis, CartesianGrid } from "recharts"
16
+
17
+ const chartConfig = {
18
+ desktop: { label: "Desktop", color: "hsl(var(--primary))" },
19
+ mobile: { label: "Mobile", color: "hsl(var(--secondary))" },
20
+ }
21
+
22
+ <ChartContainer config={chartConfig} className="h-[300px]">
23
+ <BarChart data={data}>
24
+ <CartesianGrid strokeDasharray="3 3" vertical={false} />
25
+ <XAxis dataKey="month" tickLine={false} axisLine={false} />
26
+ <YAxis tickLine={false} axisLine={false} />
27
+ <ChartTooltip content={<ChartTooltipContent />} />
28
+ <ChartLegend content={<ChartLegendContent />} />
29
+ <Bar dataKey="desktop" fill="var(--color-desktop)" radius={4} />
30
+ <Bar dataKey="mobile" fill="var(--color-mobile)" radius={4} />
31
+ </BarChart>
32
32
  </ChartContainer>
33
33
  ```
34
34
 
@@ -44,7 +44,7 @@ const chartConfig = {
44
44
 
45
45
  **Exemplos:**
46
46
  ```tsx
47
- <BarChart data={data}>
47
+ <BarChart data={data}>
48
48
  <Bar dataKey=
49
49
  ```
50
50
 
@@ -69,7 +69,7 @@ const chartConfig = {
69
69
  - e
70
70
  - para visual mais moderno
71
71
 
72
- > Fonte: `src\design-system\docs\components\ChartDoc.tsx`
72
+ > Fonte: `src/design-system/docs/components/ChartDoc.tsx`
73
73
 
74
74
  ---
75
75
 
@@ -79,30 +79,30 @@ Módulo completo de dashboards portado do qex-dashboards Angular. Inclui 14 tipo
79
79
 
80
80
  **Uso:**
81
81
  ```tsx
82
- import {
83
- // Orquestrador principal
84
- DashboardGeneralView,
85
-
86
- // Componentes de página
87
- DashboardView,
88
- DashboardList,
89
- DashboardForm,
90
- DashboardGrid,
91
- DashboardPanelRenderer,
92
-
93
- // Painéis individuais
94
- NumericPanel, TextPanel, ListPanel,
95
- CartesianPanel, PiePanel, ParetoPanel,
96
- BurndownPanel, PerformancePanel, MatrixRiskPanel,
97
-
98
- // Shared de painel
99
- PanelHeader, PanelError, PanelLoader, PanelNoData, PanelUnavailable,
100
-
101
- // Types & Helpers
102
- DashboardPanelType, PanelState, AggregationType,
103
- type PanelConfig, type Dashboard, type DashboardPanel,
104
- getDefaultPanelSize, getMinPanelSize,
105
- currencyFormatter, processUrl, getLinkFromRow,
82
+ import {
83
+ // Orquestrador principal
84
+ DashboardGeneralView,
85
+
86
+ // Componentes de página
87
+ DashboardView,
88
+ DashboardList,
89
+ DashboardForm,
90
+ DashboardGrid,
91
+ DashboardPanelRenderer,
92
+
93
+ // Painéis individuais
94
+ NumericPanel, TextPanel, ListPanel,
95
+ CartesianPanel, PiePanel, ParetoPanel,
96
+ BurndownPanel, PerformancePanel, MatrixRiskPanel,
97
+
98
+ // Shared de painel
99
+ PanelHeader, PanelError, PanelLoader, PanelNoData, PanelUnavailable,
100
+
101
+ // Types & Helpers
102
+ DashboardPanelType, PanelState, AggregationType,
103
+ type PanelConfig, type Dashboard, type DashboardPanel,
104
+ getDefaultPanelSize, getMinPanelSize,
105
+ currencyFormatter, processUrl, getLinkFromRow,
106
106
  } from 'forlogic-core';
107
107
  ```
108
108
 
@@ -120,15 +120,15 @@ import {
120
120
 
121
121
  **Exemplos:**
122
122
  ```tsx
123
- // O renderer mapeia typeId → componente automaticamente
124
- <DashboardPanelRenderer
125
- config={{ ...panelConfig, typeId: DashboardPanelType.Column }}
126
- state={PanelState.Loaded}
127
- cartesianData={chartData}
123
+ // O renderer mapeia typeId → componente automaticamente
124
+ <DashboardPanelRenderer
125
+ config={{ ...panelConfig, typeId: DashboardPanelType.Column }}
126
+ state={PanelState.Loaded}
127
+ cartesianData={chartData}
128
128
  cartesianSeries={[{ dataKey:
129
129
  ```
130
130
 
131
- > Fonte: `src\design-system\docs\components\dashboards\DashboardOverviewDoc.tsx`
131
+ > Fonte: `src/design-system/docs/components/dashboards/DashboardOverviewDoc.tsx`
132
132
 
133
133
  ---
134
134
 
@@ -138,49 +138,49 @@ Componente orquestrador que gerencia todo o ciclo de vida do módulo de Dashboar
138
138
 
139
139
  **Uso:**
140
140
  ```tsx
141
- import { DashboardGeneralView } from 'forlogic-core';
142
-
143
- // Uso básico (uncontrolled — gerencia estado internamente)
144
- <DashboardGeneralView
145
- dashboards={dashboards}
146
- limit={{ maxDashboards: 50, countDashboards: 12 }}
147
- canAdd canEdit canRemove
148
- activePanels={panels}
149
- activePages={pages}
150
- getPanelData={(panelId) => ({
151
- state: PanelState.Loaded,
152
- data: panelData[panelId],
153
- })}
154
- onOpen={(d) => loadPanels(d.id)}
155
- onSave={(values) => createDashboard(values)}
156
- onUpdate={(id, values) => updateDashboard(id, values)}
157
- onRemove={(d) => removeDashboard(d.id)}
158
- onToggleFavorite={(d) => toggleFav(d.id)}
159
- />
160
-
161
- // Uso controlado (com react-router)
162
- const [viewState, setViewState] = useState({ mode: 'list' });
163
-
164
- <DashboardGeneralView
165
- dashboards={dashboards}
166
- viewState={viewState}
167
- onViewStateChange={(state) => {
168
- setViewState(state);
169
- if (state.mode === 'view') navigate(\`/dashboards/\${state.dashboardId}\`);
170
- if (state.mode === 'list') navigate('/dashboards');
171
- }}
172
- // ... demais props
141
+ import { DashboardGeneralView } from 'forlogic-core';
142
+
143
+ // Uso básico (uncontrolled — gerencia estado internamente)
144
+ <DashboardGeneralView
145
+ dashboards={dashboards}
146
+ limit={{ maxDashboards: 50, countDashboards: 12 }}
147
+ canAdd canEdit canRemove
148
+ activePanels={panels}
149
+ activePages={pages}
150
+ getPanelData={(panelId) => ({
151
+ state: PanelState.Loaded,
152
+ data: panelData[panelId],
153
+ })}
154
+ onOpen={(d) => loadPanels(d.id)}
155
+ onSave={(values) => createDashboard(values)}
156
+ onUpdate={(id, values) => updateDashboard(id, values)}
157
+ onRemove={(d) => removeDashboard(d.id)}
158
+ onToggleFavorite={(d) => toggleFav(d.id)}
159
+ />
160
+
161
+ // Uso controlado (com react-router)
162
+ const [viewState, setViewState] = useState({ mode: 'list' });
163
+
164
+ <DashboardGeneralView
165
+ dashboards={dashboards}
166
+ viewState={viewState}
167
+ onViewStateChange={(state) => {
168
+ setViewState(state);
169
+ if (state.mode === 'view') navigate(\`/dashboards/\${state.dashboardId}\`);
170
+ if (state.mode === 'list') navigate('/dashboards');
171
+ }}
172
+ // ... demais props
173
173
  />
174
174
  ```
175
175
 
176
176
  **Exemplos:**
177
177
  ```tsx
178
- // DashboardViewState
179
- type DashboardViewState =
178
+ // DashboardViewState
179
+ type DashboardViewState =
180
180
  | { mode:
181
181
  ```
182
182
 
183
- > Fonte: `src\design-system\docs\components\dashboards\DashboardGeneralViewDoc.tsx`
183
+ > Fonte: `src/design-system/docs/components/dashboards/DashboardGeneralViewDoc.tsx`
184
184
 
185
185
  ---
186
186
 
@@ -190,105 +190,144 @@ Lista/tabela de dashboards com busca integrada, filtros rápidos (Todos / Meus /
190
190
 
191
191
  **Uso:**
192
192
  ```tsx
193
- import { DashboardList, QuickFilterDashboard } from 'forlogic-core';
194
-
195
- <DashboardList
196
- dashboards={dashboards}
197
- limit={{ maxDashboards: 50, countDashboards: 12 }}
198
- language={DashboardLanguage.PtBr}
199
- canAdd canEdit canRemove
200
- onOpen={(d) => navigate(\`/dashboards/\${d.id}\`)}
201
- onEdit={(d) => navigate(\`/dashboards/\${d.id}/edit\`)}
202
- onShare={(d) => openShareDialog(d)}
203
- onDuplicate={(d) => duplicateDashboard(d.id)}
204
- onRemove={(d) => removeDashboard(d.id)}
205
- onAdd={() => navigate('/dashboards/new')}
206
- onToggleFavorite={(d) => toggleFavorite(d.id)}
207
- onSearch={(q) => setSearch(q)}
208
- onQuickFilterChange={(f) => setFilter(f)}
193
+ import { DashboardList, QuickFilterDashboard } from 'forlogic-core';
194
+
195
+ <DashboardList
196
+ dashboards={dashboards}
197
+ limit={{ maxDashboards: 50, countDashboards: 12 }}
198
+ language={DashboardLanguage.PtBr}
199
+ canAdd canEdit canRemove
200
+ onOpen={(d) => navigate(\`/dashboards/\${d.id}\`)}
201
+ onEdit={(d) => navigate(\`/dashboards/\${d.id}/edit\`)}
202
+ onShare={(d) => openShareDialog(d)}
203
+ onDuplicate={(d) => duplicateDashboard(d.id)}
204
+ onRemove={(d) => removeDashboard(d.id)}
205
+ onAdd={() => navigate('/dashboards/new')}
206
+ onToggleFavorite={(d) => toggleFavorite(d.id)}
207
+ onSearch={(q) => setSearch(q)}
208
+ onQuickFilterChange={(f) => setFilter(f)}
209
209
  />
210
210
  ```
211
211
 
212
212
  **Exemplos:**
213
213
  ```tsx
214
- <DashboardList
215
- dashboards={dashboards}
216
- limit={{ maxDashboards: 50, countDashboards: 12 }}
217
- canAdd canEdit canRemove
218
- onOpen={(d) => openDashboard(d)}
219
- onToggleFavorite={(d) => toggleFav(d.id)}
220
- onSearch={(q) => fetchFiltered(q)}
221
- onQuickFilterChange={(filter) => {
222
- // QuickFilterDashboard.All | OnlyMine | Favorites
223
- refetch(filter);
224
- }}
214
+ <DashboardList
215
+ dashboards={dashboards}
216
+ limit={{ maxDashboards: 50, countDashboards: 12 }}
217
+ canAdd canEdit canRemove
218
+ onOpen={(d) => openDashboard(d)}
219
+ onToggleFavorite={(d) => toggleFav(d.id)}
220
+ onSearch={(q) => fetchFiltered(q)}
221
+ onQuickFilterChange={(filter) => {
222
+ // QuickFilterDashboard.All | OnlyMine | Favorites
223
+ refetch(filter);
224
+ }}
225
225
  />
226
226
  ```
227
227
  ```tsx
228
- // As ações são controladas por callbacks
229
- <DashboardList
230
- canEdit={true}
231
- canRemove={true}
228
+ // As ações são controladas por callbacks
229
+ <DashboardList
230
+ canEdit={true}
231
+ canRemove={true}
232
232
  onOpen={(d) => navigate(\
233
233
  ```
234
234
 
235
- > Fonte: `src\design-system\docs\components\dashboards\DashboardListDoc.tsx`
235
+ > Fonte: `src/design-system/docs/components/dashboards/DashboardListDoc.tsx`
236
236
 
237
237
  ---
238
238
 
239
- ### DashboardForm
239
+ ### Form
240
240
 
241
- Formulário de criação/edição de dashboards com títulos multilíngue (PT-BR, EN-US, ES-ES), intervalo de atualização, tipo de visualização (Normal/Carousel), switch de situação e aba de compartilhamento com três modos.
241
+ Construindo formulários com React Hook Form e Zod.
242
242
 
243
243
  **Uso:**
244
244
  ```tsx
245
- import { DashboardForm, type DashboardFormValues } from 'forlogic-core';
246
-
247
- // Criação
248
- <DashboardForm
249
- onSave={(values: DashboardFormValues) => {
250
- // values: { titlePtBr, titleEnUs, titleEsEs, isActive,
251
- // idUpdateTime, idViewType, idPageTime,
252
- // idShare, groups?, places?, collaborators? }
253
- createDashboard(values);
254
- }}
255
- onCancel={() => navigate('/dashboards')}
256
- />
257
-
258
- // Edição
259
- <DashboardForm
260
- dashboard={existingDashboard}
261
- users={usersList}
262
- groups={groupsList}
263
- places={placesList}
264
- collaborators={collaboratorsList}
265
- isSaving={mutation.isPending}
266
- onSave={(values) => updateDashboard(dashboard.id, values)}
267
- onCancel={() => goBack()}
268
- />
245
+ import { zodResolver } from "@hookform/resolvers/zod"
246
+ import { useForm } from "react-hook-form"
247
+ import * as z from "zod"
248
+ import {
249
+ Form,
250
+ FormControl,
251
+ FormDescription,
252
+ FormField,
253
+ FormItem,
254
+ FormLabel,
255
+ FormMessage,
256
+ } from "forlogic-core"
257
+
258
+ const formSchema = z.object({
259
+ username: z.string().min(2).max(50),
260
+ })
261
+
262
+ function MyForm() {
263
+ const form = useForm<z.infer<typeof formSchema>>({
264
+ resolver: zodResolver(formSchema),
265
+ })
266
+
267
+ function onSubmit(values: z.infer<typeof formSchema>) {
268
+ console.log(values)
269
+ }
270
+
271
+ return (
272
+ <Form {...form}>
273
+ <form onSubmit={form.handleSubmit(onSubmit)}>
274
+ <FormField
275
+ control={form.control}
276
+ name="username"
277
+ render={({ field }) => (
278
+ <FormItem>
279
+ <FormLabel>Username</FormLabel>
280
+ <FormControl>
281
+ <Input placeholder="shadcn" {...field} />
282
+ </FormControl>
283
+ <FormDescription>
284
+ This is your public display name.
285
+ </FormDescription>
286
+ <FormMessage />
287
+ </FormItem>
288
+ )}
289
+ />
290
+ <Button type="submit">Submit</Button>
291
+ </form>
292
+ </Form>
293
+ )
294
+ }
269
295
  ```
270
296
 
271
297
  **Props:**
272
298
  | Prop | Tipo | Padrão | Descrição |
273
299
  |------|------|--------|-----------|
274
- | `dashboard` | `Dashboard | null` | - | Dashboard existente para edição. null para criação. |
275
- | `initialTab` | `DashboardFormTab` | - | Aba inicial (General ou Share). Default: General. |
276
- | `isSaving` | `boolean` | - | Desabilita o botão salvar e mostra spinner. |
277
- | `isQualitfy` | `boolean` | - | Dashboard padrão Qualitfy bloqueia campos de configuração. |
278
- | `users` | `Array<{ id, name }>` | - | Lista para seletor de responsável. |
279
- | `groups / places / collaborators` | `Array<{ id, name }>` | - | Listas para aba de compartilhamento. |
280
- | `onSave` | `(values: DashboardFormValues) => void` | - | Chamado ao clicar Salvar com valores válidos. |
281
- | `onCancel` | `() => void` | - | Chamado ao clicar Cancelar. |
300
+ | `Form` | `FormProvider props` | - | Wrapper que provê o contexto do formulário via React Hook Form |
301
+ | `FormField.control` | `Control` | - | Objeto control do useForm para gerenciar o campo |
302
+ | `FormField.name` | `string` | - | Nome do campo no schema do formulário |
303
+ | `FormField.render` | `(field) => ReactNode` | - | Função de renderização do campo com acesso ao field object |
304
+ | `FormItem` | `HTMLDivElement` | - | Container que agrupa label, controle, descrição e mensagem de erro |
305
+ | `FormLabel` | `LabelProps` | - | Label associado ao campo do formulário |
306
+ | `FormControl` | `SlotProps` | - | Wrapper que conecta o controle ao contexto do campo |
307
+ | `FormDescription` | `HTMLParagraphElement` | - | Texto de ajuda exibido abaixo do controle |
308
+ | `FormMessage` | `HTMLParagraphElement` | - | Exibe mensagens de erro de validação automaticamente |
282
309
 
283
310
  **Exemplos:**
284
311
  ```tsx
285
- <DashboardForm
286
- dashboard={null} // null = criação
287
- users={[
288
- { id:
312
+ <FormField
313
+ control={form.control}
314
+ name=
315
+ ```
316
+ ```tsx
317
+ const formSchema = z.object({
318
+ username: z.string().min(3, {
319
+ message:
289
320
  ```
290
321
 
291
- > Fonte: `src\design-system\docs\components\dashboards\DashboardFormDoc.tsx`
322
+ **Acessibilidade:**
323
+ - Labels são automaticamente associados aos controles via aria-describedby
324
+ - Mensagens de erro são anunciadas por leitores de tela
325
+ - Suporta navegação por teclado nativa dos controles
326
+ - Estados de erro são indicados visualmente e semanticamente
327
+ - Usa React Hook Form para gerenciamento de estado de formulário
328
+ - Integra com Zod para validação de schema
329
+
330
+ > Fonte: `src/design-system/docs/components/FormDoc.tsx`
292
331
 
293
332
  ---
294
333
 
@@ -304,32 +343,32 @@ Grid de 8 colunas com posicionamento por col/row e dimensão por sizeX/sizeY. Su
304
343
 
305
344
  **Uso:**
306
345
  ```tsx
307
- import { DashboardGrid, getDefaultPanelSize, getMinPanelSize } from 'forlogic-core';
308
-
309
- <DashboardGrid
310
- panels={[
311
- { id: 'p1', col: 0, row: 0, sizeX: 4, sizeY: 2 },
312
- { id: 'p2', col: 4, row: 0, sizeX: 4, sizeY: 2 },
313
- { id: 'p3', col: 0, row: 2, sizeX: 8, sizeY: 2 },
314
- ]}
315
- columns={8} // padrão: 8
316
- cellHeight={160} // padrão: 160px
317
- cellGap={10} // padrão: 10px
318
- allowDragging={canEdit}
319
- showGridLines={canEdit}
320
- renderPanel={(panelId) => <MyPanelComponent id={panelId} />}
321
- onLayoutChange={(updatedPanels) => saveLayout(updatedPanels)}
346
+ import { DashboardGrid, getDefaultPanelSize, getMinPanelSize } from 'forlogic-core';
347
+
348
+ <DashboardGrid
349
+ panels={[
350
+ { id: 'p1', col: 0, row: 0, sizeX: 4, sizeY: 2 },
351
+ { id: 'p2', col: 4, row: 0, sizeX: 4, sizeY: 2 },
352
+ { id: 'p3', col: 0, row: 2, sizeX: 8, sizeY: 2 },
353
+ ]}
354
+ columns={8} // padrão: 8
355
+ cellHeight={160} // padrão: 160px
356
+ cellGap={10} // padrão: 10px
357
+ allowDragging={canEdit}
358
+ showGridLines={canEdit}
359
+ renderPanel={(panelId) => <MyPanelComponent id={panelId} />}
360
+ onLayoutChange={(updatedPanels) => saveLayout(updatedPanels)}
322
361
  />
323
362
  ```
324
363
 
325
364
  **Exemplos:**
326
365
  ```tsx
327
- <DashboardGrid
328
- panels={[
366
+ <DashboardGrid
367
+ panels={[
329
368
  { id:
330
369
  ```
331
370
 
332
- > Fonte: `src\design-system\docs\components\dashboards\DashboardGridDoc.tsx`
371
+ > Fonte: `src/design-system/docs/components/dashboards/DashboardGridDoc.tsx`
333
372
 
334
373
  ---
335
374
 
@@ -339,37 +378,37 @@ Componente de roteamento que mapeia DashboardPanelType para o componente React c
339
378
 
340
379
  **Uso:**
341
380
  ```tsx
342
- import { DashboardPanelRenderer, PanelState, DashboardPanelType } from 'forlogic-core';
343
-
344
- // O renderer resolve automaticamente qual componente usar
345
- <DashboardPanelRenderer
346
- config={{
347
- id: 'p1',
348
- title: 'Ocorrências por Mês',
349
- typeId: DashboardPanelType.Column,
350
- // ... demais campos de PanelConfig
351
- }}
352
- state={PanelState.Loaded}
353
- cartesianData={[
354
- { key: 'Jan', value: 42 },
355
- { key: 'Fev', value: 58 },
356
- ]}
357
- cartesianSeries={[{ dataKey: 'value', name: 'Total' }]}
358
- />
359
-
360
- // Para NumericPanel, use numericValue:
361
- <DashboardPanelRenderer
362
- config={{ ...config, typeId: DashboardPanelType.Numeric }}
363
- state={PanelState.Loaded}
364
- numericValue={1247}
365
- />
366
-
367
- // Para MatrixRisk, use matrixRule + matrixRisks:
368
- <DashboardPanelRenderer
369
- config={{ ...config, typeId: DashboardPanelType.RiskMatrix }}
370
- state={PanelState.Loaded}
371
- matrixRule={rule}
372
- matrixRisks={risks}
381
+ import { DashboardPanelRenderer, PanelState, DashboardPanelType } from 'forlogic-core';
382
+
383
+ // O renderer resolve automaticamente qual componente usar
384
+ <DashboardPanelRenderer
385
+ config={{
386
+ id: 'p1',
387
+ title: 'Ocorrências por Mês',
388
+ typeId: DashboardPanelType.Column,
389
+ // ... demais campos de PanelConfig
390
+ }}
391
+ state={PanelState.Loaded}
392
+ cartesianData={[
393
+ { key: 'Jan', value: 42 },
394
+ { key: 'Fev', value: 58 },
395
+ ]}
396
+ cartesianSeries={[{ dataKey: 'value', name: 'Total' }]}
397
+ />
398
+
399
+ // Para NumericPanel, use numericValue:
400
+ <DashboardPanelRenderer
401
+ config={{ ...config, typeId: DashboardPanelType.Numeric }}
402
+ state={PanelState.Loaded}
403
+ numericValue={1247}
404
+ />
405
+
406
+ // Para MatrixRisk, use matrixRule + matrixRisks:
407
+ <DashboardPanelRenderer
408
+ config={{ ...config, typeId: DashboardPanelType.RiskMatrix }}
409
+ state={PanelState.Loaded}
410
+ matrixRule={rule}
411
+ matrixRisks={risks}
373
412
  />
374
413
  ```
375
414
 
@@ -379,7 +418,7 @@ import { DashboardPanelRenderer, PanelState, DashboardPanelType } from 'forlogic
379
418
  | `config` | `PanelConfig` | - | Configuração do painel — inclui typeId que determina qual componente renderizar. |
380
419
  | `state` | `PanelState` | - | Estado atual do painel (Loading, Loaded, Error, NoData, Unavailable). |
381
420
 
382
- > Fonte: `src\design-system\docs\components\dashboards\DashboardPanelRendererDoc.tsx`
421
+ > Fonte: `src/design-system/docs/components/dashboards/DashboardPanelRendererDoc.tsx`
383
422
 
384
423
  ---
385
424
 
@@ -389,31 +428,31 @@ Os três painéis não-gráficos do módulo de dashboards: NumericPanel (valor n
389
428
 
390
429
  **Uso:**
391
430
  ```tsx
392
- import { NumericPanel, TextPanel, ListPanel, PanelState } from 'forlogic-core';
393
-
394
- // Painel Numérico
395
- <NumericPanel
396
- config={panelConfig}
397
- state={PanelState.Loaded}
398
- value={1247}
399
- label="Contagem" // override do label automático
400
- onClick={() => openPopover()}
401
- />
402
-
403
- // Painel de Texto
404
- <TextPanel
405
- config={{ ...panelConfig, textTypeString: '<h3>Título</h3><p>Conteúdo</p>' }}
406
- state={PanelState.Loaded}
407
- />
408
-
409
- // Painel de Lista
410
- <ListPanel
411
- config={panelConfig}
412
- state={PanelState.Loaded}
413
- data={rows}
414
- columns={columnDefinitions}
415
- enableRowLinks={true}
416
- onRowClick={(row) => openDetail(row)}
431
+ import { NumericPanel, TextPanel, ListPanel, PanelState } from 'forlogic-core';
432
+
433
+ // Painel Numérico
434
+ <NumericPanel
435
+ config={panelConfig}
436
+ state={PanelState.Loaded}
437
+ value={1247}
438
+ label="Contagem" // override do label automático
439
+ onClick={() => openPopover()}
440
+ />
441
+
442
+ // Painel de Texto
443
+ <TextPanel
444
+ config={{ ...panelConfig, textTypeString: '<h3>Título</h3><p>Conteúdo</p>' }}
445
+ state={PanelState.Loaded}
446
+ />
447
+
448
+ // Painel de Lista
449
+ <ListPanel
450
+ config={panelConfig}
451
+ state={PanelState.Loaded}
452
+ data={rows}
453
+ columns={columnDefinitions}
454
+ enableRowLinks={true}
455
+ onRowClick={(row) => openDetail(row)}
417
456
  />
418
457
  ```
419
458
 
@@ -427,29 +466,29 @@ import { NumericPanel, TextPanel, ListPanel, PanelState } from 'forlogic-core';
427
466
 
428
467
  **Exemplos:**
429
468
  ```tsx
430
- // Contagem simples
431
- <NumericPanel config={config} state={PanelState.Loaded} value={1247} />
432
-
469
+ // Contagem simples
470
+ <NumericPanel config={config} state={PanelState.Loaded} value={1247} />
471
+
433
472
  // Com formatação de moeda (detectado pelo campo
434
473
  ```
435
474
  ```tsx
436
- <TextPanel
437
- config={{
438
- ...config,
475
+ <TextPanel
476
+ config={{
477
+ ...config,
439
478
  textTypeString:
440
479
  ```
441
480
  ```tsx
442
- <ListPanel
443
- config={config}
444
- state={PanelState.Loaded}
445
- data={[
481
+ <ListPanel
482
+ config={config}
483
+ state={PanelState.Loaded}
484
+ data={[
446
485
  { code:
447
486
  ```
448
487
  ```tsx
449
488
  OC-002
450
489
  ```
451
490
 
452
- > Fonte: `src\design-system\docs\components\dashboards\DashboardPanelsBasicDoc.tsx`
491
+ > Fonte: `src/design-system/docs/components/dashboards/DashboardPanelsBasicDoc.tsx`
453
492
 
454
493
  ---
455
494
 
@@ -459,43 +498,43 @@ CartesianPanel é um componente unificado que renderiza 6 variantes de gráfico
459
498
 
460
499
  **Uso:**
461
500
  ```tsx
462
- import { CartesianPanel, PanelState, type CartesianSeries } from 'forlogic-core';
463
-
464
- // Uso básico — série única
465
- <CartesianPanel
466
- config={panelConfig}
467
- variant="column" // 'bar' | 'column' | 'stacked-column' | 'area' | 'line' | 'evolution-line'
468
- state={PanelState.Loaded}
469
- data={[
470
- { key: 'Jan', value: 42 },
471
- { key: 'Fev', value: 58 },
472
- ]}
473
- />
474
-
475
- // Múltiplas séries
476
- <CartesianPanel
477
- config={panelConfig}
478
- variant="column"
479
- state={PanelState.Loaded}
480
- data={data}
481
- series={[
482
- { dataKey: 'opened', name: 'Abertas', color: '#4e79a7' },
483
- { dataKey: 'closed', name: 'Fechadas', color: '#59a14f' },
484
- ]}
485
- categoryKey="month" // chave do eixo X (default: 'key')
486
- yAxisFormat="R$ {value}" // formato do eixo Y
487
- onPointClick={(data, index) => openDetail(data)}
501
+ import { CartesianPanel, PanelState, type CartesianSeries } from 'forlogic-core';
502
+
503
+ // Uso básico — série única
504
+ <CartesianPanel
505
+ config={panelConfig}
506
+ variant="column" // 'bar' | 'column' | 'stacked-column' | 'area' | 'line' | 'evolution-line'
507
+ state={PanelState.Loaded}
508
+ data={[
509
+ { key: 'Jan', value: 42 },
510
+ { key: 'Fev', value: 58 },
511
+ ]}
512
+ />
513
+
514
+ // Múltiplas séries
515
+ <CartesianPanel
516
+ config={panelConfig}
517
+ variant="column"
518
+ state={PanelState.Loaded}
519
+ data={data}
520
+ series={[
521
+ { dataKey: 'opened', name: 'Abertas', color: '#4e79a7' },
522
+ { dataKey: 'closed', name: 'Fechadas', color: '#59a14f' },
523
+ ]}
524
+ categoryKey="month" // chave do eixo X (default: 'key')
525
+ yAxisFormat="R$ {value}" // formato do eixo Y
526
+ onPointClick={(data, index) => openDetail(data)}
488
527
  />
489
528
  ```
490
529
 
491
530
  **Exemplos:**
492
531
  ```tsx
493
- <CartesianPanel
494
- config={config}
532
+ <CartesianPanel
533
+ config={config}
495
534
  variant=
496
535
  ```
497
536
 
498
- > Fonte: `src\design-system\docs\components\dashboards\DashboardPanelsCartesianDoc.tsx`
537
+ > Fonte: `src/design-system/docs/components/dashboards/DashboardPanelsCartesianDoc.tsx`
499
538
 
500
539
  ---
501
540
 
@@ -505,43 +544,43 @@ Cinco painéis especializados: PiePanel (pizza com percentuais), ParetoPanel (ba
505
544
 
506
545
  **Uso:**
507
546
  ```tsx
508
- import {
509
- PiePanel, ParetoPanel, BurndownPanel,
510
- PerformancePanel, MatrixRiskPanel,
511
- PanelState, MatrixViewType,
512
- } from 'forlogic-core';
513
-
514
- // Pie
515
- <PiePanel config={config} state={PanelState.Loaded} data={pieData} />
516
-
517
- // Pareto
518
- <ParetoPanel config={config} state={PanelState.Loaded} data={paretoData} />
519
-
520
- // Burndown
521
- <BurndownPanel config={config} state={PanelState.Loaded} data={burndownData} />
522
-
523
- // Performance
524
- <PerformancePanel config={config} state={PanelState.Loaded} data={performanceData} />
525
-
526
- // Matrix Risk
527
- <MatrixRiskPanel
528
- config={config}
529
- state={PanelState.Loaded}
530
- rule={matrixRule}
531
- risks={risks}
532
- matrixViewType={MatrixViewType.Quantity}
547
+ import {
548
+ PiePanel, ParetoPanel, BurndownPanel,
549
+ PerformancePanel, MatrixRiskPanel,
550
+ PanelState, MatrixViewType,
551
+ } from 'forlogic-core';
552
+
553
+ // Pie
554
+ <PiePanel config={config} state={PanelState.Loaded} data={pieData} />
555
+
556
+ // Pareto
557
+ <ParetoPanel config={config} state={PanelState.Loaded} data={paretoData} />
558
+
559
+ // Burndown
560
+ <BurndownPanel config={config} state={PanelState.Loaded} data={burndownData} />
561
+
562
+ // Performance
563
+ <PerformancePanel config={config} state={PanelState.Loaded} data={performanceData} />
564
+
565
+ // Matrix Risk
566
+ <MatrixRiskPanel
567
+ config={config}
568
+ state={PanelState.Loaded}
569
+ rule={matrixRule}
570
+ risks={risks}
571
+ matrixViewType={MatrixViewType.Quantity}
533
572
  />
534
573
  ```
535
574
 
536
575
  **Exemplos:**
537
576
  ```tsx
538
- <PiePanel
539
- config={config}
540
- state={PanelState.Loaded}
541
- data={[
577
+ <PiePanel
578
+ config={config}
579
+ state={PanelState.Loaded}
580
+ data={[
542
581
  { key:
543
582
  ```
544
583
 
545
- > Fonte: `src\design-system\docs\components\dashboards\DashboardPanelsSpecialDoc.tsx`
584
+ > Fonte: `src/design-system/docs/components/dashboards/DashboardPanelsSpecialDoc.tsx`
546
585
 
547
586
  ---