forlogic-core 2.2.6 → 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.
- package/.note/memory/features/import/attachment-idempotency-registry.md +8 -8
- package/.note/memory/features/import/attachment-strategy.md +30 -30
- package/.note/memory/patterns/admin-i18n-policy.md +20 -20
- package/.note/memory/patterns/alias-url-resolution.md +69 -69
- package/.note/memory/patterns/doc-sync-rule.md +35 -35
- package/.note/memory/patterns/documentation-standard.md +17 -17
- package/.note/memory/patterns/dynamic-supabase-config.md +4 -4
- package/.note/memory/patterns/environment-detection-logic.md +35 -35
- package/.note/memory/patterns/i18n-architecture.md +3 -3
- package/README.md +120 -120
- package/dist/README.md +1079 -0
- package/dist/bin/bootstrap.js +40 -0
- package/dist/bin/pull-docs.js +186 -0
- package/dist/components/ui/color-picker.d.ts +2 -0
- package/dist/components/ui/combo-tree.d.ts +3 -1
- package/dist/components/ui/combobox.d.ts +2 -1
- package/dist/components/ui/select.d.ts +9 -2
- package/dist/docs/KNOWLEDGE.md +109 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/docs/PUBLISH.md +168 -168
- package/docs/STORAGE_BUCKETS.md +456 -456
- package/docs/SUPABASE_SECRETS.md +122 -122
- package/docs/WORKSPACE_KNOWLEDGE.md +154 -154
- package/docs/design-system/buttons-actions.md +130 -130
- package/docs/design-system/charts-dashboards.md +301 -340
- package/docs/design-system/crud.md +114 -174
- package/docs/design-system/data-display.md +106 -106
- package/docs/design-system/dialogs.md +212 -212
- package/docs/design-system/domain.md +329 -319
- package/docs/design-system/examples.md +275 -275
- package/docs/design-system/foundation.md +1 -1
- package/docs/design-system/inputs.md +137 -132
- package/docs/design-system/layout.md +154 -202
- package/docs/design-system/navigation.md +331 -272
- package/docs/design-system/notifications-feedback.md +34 -34
- package/docs/design-system/patterns/README.md +53 -53
- package/docs/design-system/patterns/action-button.md +22 -22
- package/docs/design-system/patterns/alertdialog-deletion.md +46 -46
- package/docs/design-system/patterns/baseform-custom-fields.md +59 -59
- package/docs/design-system/patterns/baseform-usage.md +42 -42
- package/docs/design-system/patterns/body-content-scroll.md +56 -56
- package/docs/design-system/patterns/combo-tree.md +23 -23
- package/docs/design-system/patterns/components-registry.md +17 -17
- package/docs/design-system/patterns/core-providers.md +41 -41
- package/docs/design-system/patterns/crud-bulk-actions.md +12 -12
- package/docs/design-system/patterns/crud-config-props.md +16 -16
- package/docs/design-system/patterns/crud-defaults.md +17 -17
- package/docs/design-system/patterns/crud-toolbar.md +28 -28
- package/docs/design-system/patterns/delete-confirmation.md +40 -40
- package/docs/design-system/patterns/dialog-body-scroll.md +26 -26
- package/docs/design-system/patterns/dialog-structure.md +32 -32
- package/docs/design-system/patterns/dialog-variants.md +41 -41
- package/docs/design-system/patterns/feature-flags.md +81 -81
- package/docs/design-system/patterns/header-metadata.md +57 -57
- package/docs/design-system/patterns/i18n-setup.md +117 -117
- package/docs/design-system/patterns/pagination.md +27 -27
- package/docs/design-system/patterns/single-scroll.md +39 -39
- package/docs/design-system/patterns/vite-tailwind-setup.md +49 -49
- package/docs/design-system/platform.md +18 -18
- package/docs/design-system/selectors.md +287 -258
- package/docs/design-system/tables-grids.md +38 -95
- package/package.json +152 -152
- package/dist/assets/docs-BEwTKYu3.css +0 -1
- package/dist/assets/docs-Bgpz6ETN.js +0 -10752
- package/dist/assets/index-SqMwTzMJ.js +0 -97
- package/dist/index.html +0 -34
|
@@ -41,7 +41,7 @@ const NotesPage = createCrudPage({
|
|
|
41
41
|
- Nível Médio: CrudTable/CrudGrid — componentes compostos para layouts customizados
|
|
42
42
|
- Nível Baixo: Primitives (DataTable, DataPagination, DataFilterBar) — controle total
|
|
43
43
|
|
|
44
|
-
> Fonte: `src
|
|
44
|
+
> Fonte: `src\design-system\docs\components\crud\CrudOverviewDoc.tsx`
|
|
45
45
|
|
|
46
46
|
---
|
|
47
47
|
|
|
@@ -49,7 +49,7 @@ const NotesPage = createCrudPage({
|
|
|
49
49
|
|
|
50
50
|
Factory de alto nível que gera uma página CRUD completa com ~15 linhas de configuração declarativa.
|
|
51
51
|
|
|
52
|
-
> Fonte: `src
|
|
52
|
+
> Fonte: `src\design-system\docs\components\crud\CreateCrudPageDoc.tsx`
|
|
53
53
|
|
|
54
54
|
---
|
|
55
55
|
|
|
@@ -57,153 +57,93 @@ Factory de alto nível que gera uma página CRUD completa com ~15 linhas de conf
|
|
|
57
57
|
|
|
58
58
|
Barra de ações unificada usada por todos os componentes CRUD (CrudTable, CrudGrid, createCrudPage) para garantir UX consistente.
|
|
59
59
|
|
|
60
|
-
> Fonte: `src
|
|
60
|
+
> Fonte: `src\design-system\docs\components\crud\CrudActionBarDoc.tsx`
|
|
61
61
|
|
|
62
62
|
---
|
|
63
63
|
|
|
64
|
-
###
|
|
64
|
+
### CrudTable
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
Componente de tabela CRUD completo com ordenação, seleção, resize de colunas, ações em massa e paginação integrada com useCrud.
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
```tsx
|
|
70
|
-
import {
|
|
71
|
-
Table,
|
|
72
|
-
TableBody,
|
|
73
|
-
TableCaption,
|
|
74
|
-
TableCell,
|
|
75
|
-
TableHead,
|
|
76
|
-
TableHeader,
|
|
77
|
-
TableRow,
|
|
78
|
-
TableResizeHandle,
|
|
79
|
-
TruncatedCell,
|
|
80
|
-
} from "forlogic-core"
|
|
81
|
-
|
|
82
|
-
<Table>
|
|
83
|
-
<TableCaption>Lista de usuários</TableCaption>
|
|
84
|
-
<TableHeader>
|
|
85
|
-
<TableRow>
|
|
86
|
-
<TableHead>Nome</TableHead>
|
|
87
|
-
<TableHead>Email</TableHead>
|
|
88
|
-
<TableHead>Status</TableHead>
|
|
89
|
-
</TableRow>
|
|
90
|
-
</TableHeader>
|
|
91
|
-
<TableBody>
|
|
92
|
-
<TableRow>
|
|
93
|
-
<TableCell>João Silva</TableCell>
|
|
94
|
-
<TableCell>joao@example.com</TableCell>
|
|
95
|
-
<TableCell>Ativo</TableCell>
|
|
96
|
-
</TableRow>
|
|
97
|
-
</TableBody>
|
|
98
|
-
</Table>
|
|
99
|
-
```
|
|
68
|
+
> Fonte: `src\design-system\docs\components\crud\CrudTableDoc.tsx`
|
|
100
69
|
|
|
101
|
-
|
|
102
|
-
| Prop | Tipo | Padrão | Descrição |
|
|
103
|
-
|------|------|--------|-----------|
|
|
104
|
-
| `className` | `string` | - | Classes CSS adicionais para a tabela. |
|
|
105
|
-
| `TableResizeHandle.onMouseDown` | `(e: MouseEvent) => void` | - | Handler para iniciar o redimensionamento. |
|
|
106
|
-
| `TableResizeHandle.isDragging` | `boolean` | false | Se o handle está sendo arrastado (altera visual). |
|
|
107
|
-
| `TruncatedCell.children` | `ReactNode` | - | Conteúdo a ser truncado. |
|
|
108
|
-
| `TruncatedCell.className` | `string` | - | Classes CSS adicionais. |
|
|
70
|
+
---
|
|
109
71
|
|
|
110
|
-
|
|
111
|
-
- Usa elementos HTML semânticos de tabela
|
|
112
|
-
- Suporta navegação por teclado
|
|
113
|
-
- TableCaption fornece contexto para leitores de tela
|
|
114
|
-
- TableHeader define cabeçalhos de coluna apropriados
|
|
115
|
-
- TruncatedCell mostra tooltip acessível com conteúdo completo
|
|
116
|
-
- TableResizeHandle suporta interação via teclado
|
|
117
|
-
- Funciona com leitores de tela
|
|
72
|
+
### CrudGrid
|
|
118
73
|
|
|
119
|
-
|
|
120
|
-
- TableResizeHandle deve ser posicionado dentro de um TableHead com position: relative.
|
|
121
|
-
- TruncatedCell detecta automaticamente se o texto está truncado e exibe tooltip apenas quando necessário.
|
|
122
|
-
- Use larguras fixas (w-[Xpx]) nos TableHead para melhor controle do layout.
|
|
123
|
-
- TruncatedCell usa CSS text-overflow: ellipsis internamente.
|
|
74
|
+
Componente para exibir dados em formato de grade (cards) com todas as funcionalidades CRUD. Alternativa visual ao CrudTable para listagens com layout mais visual.
|
|
124
75
|
|
|
125
|
-
> Fonte: `src
|
|
76
|
+
> Fonte: `src\design-system\docs\components\crud\CrudGridDoc.tsx`
|
|
126
77
|
|
|
127
78
|
---
|
|
128
79
|
|
|
129
|
-
###
|
|
80
|
+
### CRUD Primitives
|
|
130
81
|
|
|
131
|
-
|
|
82
|
+
Componentes de baixo nível para interfaces CRUD totalmente customizadas com controle total sobre layout e comportamento. Aliases disponíveis: DataTable, DataFilterBar, DataPagination.
|
|
132
83
|
|
|
133
|
-
> Fonte: `src
|
|
84
|
+
> Fonte: `src\design-system\docs\components\crud\CrudPrimitivesDoc.tsx`
|
|
134
85
|
|
|
135
86
|
---
|
|
136
87
|
|
|
137
|
-
###
|
|
88
|
+
### Pagination
|
|
138
89
|
|
|
139
|
-
|
|
90
|
+
Barra de paginação completa com seletor de itens por página e controles de navegação.
|
|
140
91
|
|
|
141
92
|
**Uso:**
|
|
142
93
|
```tsx
|
|
143
|
-
import {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
<Table>
|
|
156
|
-
<TableCaption>Lista de usuários</TableCaption>
|
|
157
|
-
<TableHeader>
|
|
158
|
-
<TableRow>
|
|
159
|
-
<TableHead>Nome</TableHead>
|
|
160
|
-
<TableHead>Email</TableHead>
|
|
161
|
-
<TableHead>Status</TableHead>
|
|
162
|
-
</TableRow>
|
|
163
|
-
</TableHeader>
|
|
164
|
-
<TableBody>
|
|
165
|
-
<TableRow>
|
|
166
|
-
<TableCell>João Silva</TableCell>
|
|
167
|
-
<TableCell>joao@example.com</TableCell>
|
|
168
|
-
<TableCell>Ativo</TableCell>
|
|
169
|
-
</TableRow>
|
|
170
|
-
</TableBody>
|
|
171
|
-
</Table>
|
|
94
|
+
import { Pagination } from "forlogic-core/crud"
|
|
95
|
+
|
|
96
|
+
<Pagination
|
|
97
|
+
currentPage={1}
|
|
98
|
+
totalPages={10}
|
|
99
|
+
totalItems={100}
|
|
100
|
+
itemsPerPage={10}
|
|
101
|
+
onPageChange={(page) => setPage(page)}
|
|
102
|
+
onItemsPerPageChange={(limit) => setLimit(limit)}
|
|
103
|
+
variant="full"
|
|
104
|
+
/>
|
|
172
105
|
```
|
|
173
106
|
|
|
174
107
|
**Props:**
|
|
175
108
|
| Prop | Tipo | Padrão | Descrição |
|
|
176
109
|
|------|------|--------|-----------|
|
|
177
|
-
| `
|
|
178
|
-
| `
|
|
179
|
-
| `
|
|
180
|
-
| `
|
|
181
|
-
| `
|
|
110
|
+
| `currentPage` | `number` | - | Página atual (1-indexed) |
|
|
111
|
+
| `totalPages` | `number` | - | Número total de páginas |
|
|
112
|
+
| `totalItems` | `number` | - | Número total de itens |
|
|
113
|
+
| `itemsPerPage` | `number` | - | Quantidade de itens por página |
|
|
114
|
+
| `onPageChange` | `(page: number) => void` | - | Callback ao mudar de página |
|
|
115
|
+
| `onItemsPerPageChange` | `(limit: number) => void` | - | Callback ao mudar itens por página |
|
|
182
116
|
|
|
183
|
-
**
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
117
|
+
**Exemplos:**
|
|
118
|
+
```tsx
|
|
119
|
+
<Pagination
|
|
120
|
+
currentPage={1}
|
|
121
|
+
totalPages={2}
|
|
122
|
+
totalItems={15}
|
|
123
|
+
itemsPerPage={10}
|
|
124
|
+
onPageChange={setPage}
|
|
125
|
+
onItemsPerPageChange={setItemsPerPage}
|
|
126
|
+
variant=
|
|
127
|
+
```
|
|
128
|
+
```tsx
|
|
129
|
+
<Pagination
|
|
130
|
+
currentPage={3}
|
|
131
|
+
totalPages={25}
|
|
132
|
+
totalItems={250}
|
|
133
|
+
itemsPerPage={10}
|
|
134
|
+
onPageChange={setPage}
|
|
135
|
+
onItemsPerPageChange={setItemsPerPage}
|
|
136
|
+
variant=
|
|
137
|
+
```
|
|
203
138
|
|
|
204
|
-
|
|
139
|
+
**Acessibilidade:**
|
|
140
|
+
- Navegável por teclado
|
|
141
|
+
- Labels ARIA apropriados
|
|
142
|
+
- Indicação visual da página atual
|
|
143
|
+
- Botões desabilitados quando não aplicável
|
|
144
|
+
- Amigável para leitores de tela
|
|
205
145
|
|
|
206
|
-
> Fonte: `src
|
|
146
|
+
> Fonte: `src\design-system\docs\components\PaginationDoc.tsx`
|
|
207
147
|
|
|
208
148
|
---
|
|
209
149
|
|
|
@@ -213,55 +153,55 @@ Construindo formulários com React Hook Form e Zod.
|
|
|
213
153
|
|
|
214
154
|
**Uso:**
|
|
215
155
|
```tsx
|
|
216
|
-
import { zodResolver } from "@hookform/resolvers/zod"
|
|
217
|
-
import { useForm } from "react-hook-form"
|
|
218
|
-
import * as z from "zod"
|
|
219
|
-
import {
|
|
220
|
-
Form,
|
|
221
|
-
FormControl,
|
|
222
|
-
FormDescription,
|
|
223
|
-
FormField,
|
|
224
|
-
FormItem,
|
|
225
|
-
FormLabel,
|
|
226
|
-
FormMessage,
|
|
227
|
-
} from "forlogic-core"
|
|
228
|
-
|
|
229
|
-
const formSchema = z.object({
|
|
230
|
-
username: z.string().min(2).max(50),
|
|
231
|
-
})
|
|
232
|
-
|
|
233
|
-
function MyForm() {
|
|
234
|
-
const form = useForm<z.infer<typeof formSchema>>({
|
|
235
|
-
resolver: zodResolver(formSchema),
|
|
236
|
-
})
|
|
237
|
-
|
|
238
|
-
function onSubmit(values: z.infer<typeof formSchema>) {
|
|
239
|
-
console.log(values)
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
return (
|
|
243
|
-
<Form {...form}>
|
|
244
|
-
<form onSubmit={form.handleSubmit(onSubmit)}>
|
|
245
|
-
<FormField
|
|
246
|
-
control={form.control}
|
|
247
|
-
name="username"
|
|
248
|
-
render={({ field }) => (
|
|
249
|
-
<FormItem>
|
|
250
|
-
<FormLabel>Username</FormLabel>
|
|
251
|
-
<FormControl>
|
|
252
|
-
<Input placeholder="shadcn" {...field} />
|
|
253
|
-
</FormControl>
|
|
254
|
-
<FormDescription>
|
|
255
|
-
This is your public display name.
|
|
256
|
-
</FormDescription>
|
|
257
|
-
<FormMessage />
|
|
258
|
-
</FormItem>
|
|
259
|
-
)}
|
|
260
|
-
/>
|
|
261
|
-
<Button type="submit">Submit</Button>
|
|
262
|
-
</form>
|
|
263
|
-
</Form>
|
|
264
|
-
)
|
|
156
|
+
import { zodResolver } from "@hookform/resolvers/zod"
|
|
157
|
+
import { useForm } from "react-hook-form"
|
|
158
|
+
import * as z from "zod"
|
|
159
|
+
import {
|
|
160
|
+
Form,
|
|
161
|
+
FormControl,
|
|
162
|
+
FormDescription,
|
|
163
|
+
FormField,
|
|
164
|
+
FormItem,
|
|
165
|
+
FormLabel,
|
|
166
|
+
FormMessage,
|
|
167
|
+
} from "forlogic-core"
|
|
168
|
+
|
|
169
|
+
const formSchema = z.object({
|
|
170
|
+
username: z.string().min(2).max(50),
|
|
171
|
+
})
|
|
172
|
+
|
|
173
|
+
function MyForm() {
|
|
174
|
+
const form = useForm<z.infer<typeof formSchema>>({
|
|
175
|
+
resolver: zodResolver(formSchema),
|
|
176
|
+
})
|
|
177
|
+
|
|
178
|
+
function onSubmit(values: z.infer<typeof formSchema>) {
|
|
179
|
+
console.log(values)
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
return (
|
|
183
|
+
<Form {...form}>
|
|
184
|
+
<form onSubmit={form.handleSubmit(onSubmit)}>
|
|
185
|
+
<FormField
|
|
186
|
+
control={form.control}
|
|
187
|
+
name="username"
|
|
188
|
+
render={({ field }) => (
|
|
189
|
+
<FormItem>
|
|
190
|
+
<FormLabel>Username</FormLabel>
|
|
191
|
+
<FormControl>
|
|
192
|
+
<Input placeholder="shadcn" {...field} />
|
|
193
|
+
</FormControl>
|
|
194
|
+
<FormDescription>
|
|
195
|
+
This is your public display name.
|
|
196
|
+
</FormDescription>
|
|
197
|
+
<FormMessage />
|
|
198
|
+
</FormItem>
|
|
199
|
+
)}
|
|
200
|
+
/>
|
|
201
|
+
<Button type="submit">Submit</Button>
|
|
202
|
+
</form>
|
|
203
|
+
</Form>
|
|
204
|
+
)
|
|
265
205
|
}
|
|
266
206
|
```
|
|
267
207
|
|
|
@@ -280,13 +220,13 @@ function MyForm() {
|
|
|
280
220
|
|
|
281
221
|
**Exemplos:**
|
|
282
222
|
```tsx
|
|
283
|
-
<FormField
|
|
284
|
-
control={form.control}
|
|
223
|
+
<FormField
|
|
224
|
+
control={form.control}
|
|
285
225
|
name=
|
|
286
226
|
```
|
|
287
227
|
```tsx
|
|
288
|
-
const formSchema = z.object({
|
|
289
|
-
username: z.string().min(3, {
|
|
228
|
+
const formSchema = z.object({
|
|
229
|
+
username: z.string().min(3, {
|
|
290
230
|
message:
|
|
291
231
|
```
|
|
292
232
|
|
|
@@ -298,6 +238,6 @@ const formSchema = z.object({
|
|
|
298
238
|
- Usa React Hook Form para gerenciamento de estado de formulário
|
|
299
239
|
- Integra com Zod para validação de schema
|
|
300
240
|
|
|
301
|
-
> Fonte: `src
|
|
241
|
+
> Fonte: `src\design-system\docs\components\FormDoc.tsx`
|
|
302
242
|
|
|
303
243
|
---
|