forlogic-core 2.0.3 → 2.0.4
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/README.md +187 -917
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/types/sidebar.d.ts +2 -1
- package/docs/AUDIT_PROMPT.md +74 -0
- package/docs/PROJECT_KNOWLEDGE_TEMPLATE.md +117 -0
- package/docs/PROMPT_TEMPLATE.md +77 -0
- package/docs/STARTER_TEMPLATE.md +114 -0
- package/docs/design-system/README.md +45 -0
- package/docs/design-system/buttons-actions.md +427 -0
- package/docs/design-system/charts-dashboards.md +547 -0
- package/docs/design-system/crud.md +243 -0
- package/docs/design-system/data-display.md +360 -0
- package/docs/design-system/dialogs.md +588 -0
- package/docs/design-system/domain.md +651 -0
- package/docs/design-system/examples.md +275 -0
- package/docs/design-system/foundation.md +82 -0
- package/docs/design-system/infra-utils.md +36 -0
- package/docs/design-system/inputs.md +536 -0
- package/docs/design-system/layout.md +351 -0
- package/docs/design-system/navigation.md +599 -0
- package/docs/design-system/notifications-feedback.md +137 -0
- package/docs/design-system/platform.md +95 -0
- package/docs/design-system/selectors.md +424 -0
- package/docs/design-system/tables-grids.md +114 -0
- package/package.json +2 -2
|
@@ -0,0 +1,599 @@
|
|
|
1
|
+
<!-- ⚠️ ARQUIVO GERADO AUTOMATICAMENTE — NÃO EDITAR MANUALMENTE -->
|
|
2
|
+
<!-- Fonte: src/design-system/docs/ | Regenerar: npx tsx scripts/generate-ds-docs.ts -->
|
|
3
|
+
|
|
4
|
+
# Navegação
|
|
5
|
+
|
|
6
|
+
Categoria: **Navegação** | 8 componentes
|
|
7
|
+
|
|
8
|
+
### Breadcrumb
|
|
9
|
+
|
|
10
|
+
Exibe o caminho até o recurso atual usando uma hierarquia de links.
|
|
11
|
+
|
|
12
|
+
**Uso:**
|
|
13
|
+
```tsx
|
|
14
|
+
import { Link } from "react-router-dom"
|
|
15
|
+
import {
|
|
16
|
+
Breadcrumb,
|
|
17
|
+
BreadcrumbItem,
|
|
18
|
+
BreadcrumbLink,
|
|
19
|
+
BreadcrumbList,
|
|
20
|
+
BreadcrumbPage,
|
|
21
|
+
BreadcrumbSeparator,
|
|
22
|
+
} from "forlogic-core"
|
|
23
|
+
|
|
24
|
+
// ✅ CORRETO: Usar asChild + Link para navegação SPA
|
|
25
|
+
<Breadcrumb>
|
|
26
|
+
<BreadcrumbList>
|
|
27
|
+
<BreadcrumbItem>
|
|
28
|
+
<BreadcrumbLink asChild>
|
|
29
|
+
<Link to="/">Home</Link>
|
|
30
|
+
</BreadcrumbLink>
|
|
31
|
+
</BreadcrumbItem>
|
|
32
|
+
<BreadcrumbSeparator />
|
|
33
|
+
<BreadcrumbItem>
|
|
34
|
+
<BreadcrumbLink asChild>
|
|
35
|
+
<Link to="/componentes">Componentes</Link>
|
|
36
|
+
</BreadcrumbLink>
|
|
37
|
+
</BreadcrumbItem>
|
|
38
|
+
<BreadcrumbSeparator />
|
|
39
|
+
<BreadcrumbItem>
|
|
40
|
+
<BreadcrumbPage>Breadcrumb</BreadcrumbPage>
|
|
41
|
+
</BreadcrumbItem>
|
|
42
|
+
</BreadcrumbList>
|
|
43
|
+
</Breadcrumb>
|
|
44
|
+
|
|
45
|
+
// ❌ ERRADO: Usar href diretamente (causa reload da página)
|
|
46
|
+
<BreadcrumbLink href="/componentes">Componentes</BreadcrumbLink>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Props:**
|
|
50
|
+
| Prop | Tipo | Padrão | Descrição |
|
|
51
|
+
|------|------|--------|-----------|
|
|
52
|
+
| `Breadcrumb` | `nav` | - | Elemento raiz do breadcrumb. Renderiza um elemento nav com aria-label= |
|
|
53
|
+
| `BreadcrumbList` | `ol` | - | Lista ordenada que contém os itens do breadcrumb. |
|
|
54
|
+
| `BreadcrumbItem` | `li` | - | Item individual do breadcrumb. |
|
|
55
|
+
| `BreadcrumbLink` | `a` | - | Link clicável do breadcrumb. Use asChild + Link para navegação SPA. |
|
|
56
|
+
| `asChild` | `boolean` | false | Permite compor com Link do React Router para navegação SPA. |
|
|
57
|
+
| `BreadcrumbPage` | `span` | - | Representa a página atual (não clicável). Possui aria-current= |
|
|
58
|
+
| `BreadcrumbSeparator` | `li` | ChevronRight | Separador visual entre itens do breadcrumb. |
|
|
59
|
+
| `BreadcrumbEllipsis` | `span` | - | Indica itens ocultos (reticências). Usado para breadcrumbs colapsados. |
|
|
60
|
+
|
|
61
|
+
**Exemplos:**
|
|
62
|
+
```tsx
|
|
63
|
+
import { Link } from
|
|
64
|
+
```
|
|
65
|
+
```tsx
|
|
66
|
+
<Breadcrumb>
|
|
67
|
+
<BreadcrumbList>
|
|
68
|
+
<BreadcrumbItem>
|
|
69
|
+
<BreadcrumbLink asChild>
|
|
70
|
+
<Link to=
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Acessibilidade:**
|
|
74
|
+
- Usa elemento nav com aria-label=
|
|
75
|
+
- para identificação por leitores de tela.
|
|
76
|
+
- Estrutura HTML semântica com lista ordenada (ol > li).
|
|
77
|
+
- Página atual marcada com aria-current=
|
|
78
|
+
- e aria-disabled=
|
|
79
|
+
- .
|
|
80
|
+
- Separadores marcados com role=
|
|
81
|
+
- e aria-hidden=
|
|
82
|
+
- .
|
|
83
|
+
- BreadcrumbEllipsis inclui texto sr-only
|
|
84
|
+
- para leitores de tela.
|
|
85
|
+
- Links navegáveis por teclado com foco visível.
|
|
86
|
+
- Segue padrão WAI-ARIA Breadcrumb.
|
|
87
|
+
|
|
88
|
+
**Notas:**
|
|
89
|
+
- ⚠️ OBRIGATÓRIO: Use asChild + Link do React Router para navegação SPA sem reload.
|
|
90
|
+
- Use BreadcrumbPage para o item final (página atual) em vez de BreadcrumbLink.
|
|
91
|
+
- Considere colapsar itens intermediários em telas menores usando BreadcrumbEllipsis.
|
|
92
|
+
- Evite usar href diretamente - causa reload completo da página.
|
|
93
|
+
|
|
94
|
+
> Fonte: `src\design-system\docs\components\BreadcrumbDoc.tsx`
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
### Context Menu
|
|
99
|
+
|
|
100
|
+
Exibe um menu ao usuário — como um conjunto de ações ou funções — acionado por um clique com o botão direito do mouse.
|
|
101
|
+
|
|
102
|
+
**Uso:**
|
|
103
|
+
```tsx
|
|
104
|
+
import {
|
|
105
|
+
ContextMenu,
|
|
106
|
+
ContextMenuContent,
|
|
107
|
+
ContextMenuItem,
|
|
108
|
+
ContextMenuTrigger,
|
|
109
|
+
ContextMenuCheckboxItem,
|
|
110
|
+
ContextMenuRadioGroup,
|
|
111
|
+
ContextMenuRadioItem,
|
|
112
|
+
ContextMenuLabel,
|
|
113
|
+
ContextMenuSeparator,
|
|
114
|
+
ContextMenuShortcut,
|
|
115
|
+
ContextMenuSub,
|
|
116
|
+
ContextMenuSubContent,
|
|
117
|
+
ContextMenuSubTrigger,
|
|
118
|
+
} from "forlogic-core"
|
|
119
|
+
|
|
120
|
+
<ContextMenu>
|
|
121
|
+
<ContextMenuTrigger className="flex h-[150px] w-[300px] items-center justify-center rounded-md border border-dashed">
|
|
122
|
+
Clique com o botão direito aqui
|
|
123
|
+
</ContextMenuTrigger>
|
|
124
|
+
<ContextMenuContent className="w-64">
|
|
125
|
+
<ContextMenuItem inset>
|
|
126
|
+
Voltar
|
|
127
|
+
<ContextMenuShortcut>⌘[</ContextMenuShortcut>
|
|
128
|
+
</ContextMenuItem>
|
|
129
|
+
<ContextMenuItem inset disabled>
|
|
130
|
+
Avançar
|
|
131
|
+
<ContextMenuShortcut>⌘]</ContextMenuShortcut>
|
|
132
|
+
</ContextMenuItem>
|
|
133
|
+
<ContextMenuItem inset>
|
|
134
|
+
Recarregar
|
|
135
|
+
<ContextMenuShortcut>⌘R</ContextMenuShortcut>
|
|
136
|
+
</ContextMenuItem>
|
|
137
|
+
<ContextMenuSub>
|
|
138
|
+
<ContextMenuSubTrigger inset>Mais Ferramentas</ContextMenuSubTrigger>
|
|
139
|
+
<ContextMenuSubContent className="w-48">
|
|
140
|
+
<ContextMenuItem>
|
|
141
|
+
Salvar Página Como...
|
|
142
|
+
<ContextMenuShortcut>⇧⌘S</ContextMenuShortcut>
|
|
143
|
+
</ContextMenuItem>
|
|
144
|
+
<ContextMenuItem>Criar Atalho...</ContextMenuItem>
|
|
145
|
+
<ContextMenuItem>Nomear Janela...</ContextMenuItem>
|
|
146
|
+
<ContextMenuSeparator />
|
|
147
|
+
<ContextMenuItem>Ferramentas do Desenvolvedor</ContextMenuItem>
|
|
148
|
+
</ContextMenuSubContent>
|
|
149
|
+
</ContextMenuSub>
|
|
150
|
+
<ContextMenuSeparator />
|
|
151
|
+
<ContextMenuCheckboxItem checked>
|
|
152
|
+
Mostrar Barra de Favoritos
|
|
153
|
+
<ContextMenuShortcut>⌘⇧B</ContextMenuShortcut>
|
|
154
|
+
</ContextMenuCheckboxItem>
|
|
155
|
+
<ContextMenuCheckboxItem>Mostrar URLs Completas</ContextMenuCheckboxItem>
|
|
156
|
+
<ContextMenuSeparator />
|
|
157
|
+
<ContextMenuRadioGroup value="pedro">
|
|
158
|
+
<ContextMenuLabel inset>Pessoas</ContextMenuLabel>
|
|
159
|
+
<ContextMenuRadioItem value="pedro">Pedro Duarte</ContextMenuRadioItem>
|
|
160
|
+
<ContextMenuRadioItem value="colm">Colm Tuite</ContextMenuRadioItem>
|
|
161
|
+
</ContextMenuRadioGroup>
|
|
162
|
+
</ContextMenuContent>
|
|
163
|
+
</ContextMenu>
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
**Props:**
|
|
167
|
+
| Prop | Tipo | Padrão | Descrição |
|
|
168
|
+
|------|------|--------|-----------|
|
|
169
|
+
| `ContextMenu` | `Component` | - | Componente raiz que envolve o trigger e o conteúdo do menu. |
|
|
170
|
+
| `ContextMenuTrigger` | `Component` | - | Área que detecta o clique com botão direito para abrir o menu. Aceita asChild. |
|
|
171
|
+
| `ContextMenuContent` | `Component` | - | Container para os itens do menu. Aceita alignOffset, sideOffset e className. |
|
|
172
|
+
| `ContextMenuItem` | `Component` | - | Item básico do menu. Aceita inset, disabled e onSelect. |
|
|
173
|
+
| `ContextMenuCheckboxItem` | `Component` | - | Item com checkbox. Aceita checked, onCheckedChange e disabled. |
|
|
174
|
+
| `ContextMenuRadioGroup` | `Component` | - | Agrupa radio items. Aceita value e onValueChange. |
|
|
175
|
+
| `ContextMenuRadioItem` | `Component` | - | Item de seleção única dentro de um RadioGroup. Requer value. |
|
|
176
|
+
| `ContextMenuLabel` | `Component` | - | Rótulo não interativo para agrupar itens. Aceita inset. |
|
|
177
|
+
| `ContextMenuSeparator` | `Component` | - | Linha divisória visual entre grupos de itens. |
|
|
178
|
+
| `ContextMenuShortcut` | `Component` | - | Exibe atalho de teclado alinhado à direita do item. |
|
|
179
|
+
| `ContextMenuSub` | `Component` | - | Container para submenu aninhado. |
|
|
180
|
+
| `ContextMenuSubTrigger` | `Component` | - | Item que abre um submenu ao hover ou foco. Aceita inset. |
|
|
181
|
+
| `ContextMenuSubContent` | `Component` | - | Conteúdo do submenu aninhado. |
|
|
182
|
+
| `ContextMenuGroup` | `Component` | - | Agrupa itens relacionados para organização semântica. |
|
|
183
|
+
|
|
184
|
+
**Acessibilidade:**
|
|
185
|
+
- Abre com clique do botão direito ou tecla de menu de contexto (Shift+F10 ou tecla Menu)
|
|
186
|
+
- Navegação completa por teclado usando setas direcionais
|
|
187
|
+
- Enter ou Espaço para selecionar item focado
|
|
188
|
+
- Escape fecha o menu e retorna foco ao elemento anterior
|
|
189
|
+
- Suporte completo a WAI-ARIA com roles menu, menuitem, menuitemcheckbox e menuitemradio
|
|
190
|
+
- Submenus acessíveis via seta direita (abrir) e seta esquerda (fechar)
|
|
191
|
+
- Type-ahead: digitar caracteres foca no item correspondente
|
|
192
|
+
- Foco visual claro nos itens durante navegação por teclado
|
|
193
|
+
|
|
194
|
+
> Fonte: `src\design-system\docs\components\ContextMenuDoc.tsx`
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
### Dropdown Menu
|
|
199
|
+
|
|
200
|
+
Exibe um menu ao usuário — como um conjunto de ações ou funções — acionado por um botão ou elemento interativo.
|
|
201
|
+
|
|
202
|
+
**Uso:**
|
|
203
|
+
```tsx
|
|
204
|
+
import {
|
|
205
|
+
DropdownMenu,
|
|
206
|
+
DropdownMenuContent,
|
|
207
|
+
DropdownMenuItem,
|
|
208
|
+
DropdownMenuLabel,
|
|
209
|
+
DropdownMenuSeparator,
|
|
210
|
+
DropdownMenuTrigger,
|
|
211
|
+
DropdownMenuShortcut,
|
|
212
|
+
DropdownMenuGroup,
|
|
213
|
+
DropdownMenuSub,
|
|
214
|
+
DropdownMenuSubContent,
|
|
215
|
+
DropdownMenuSubTrigger,
|
|
216
|
+
Button
|
|
217
|
+
} from "forlogic-core"
|
|
218
|
+
import { User, Settings, LogOut, ChevronDown } from "lucide-react"
|
|
219
|
+
|
|
220
|
+
<DropdownMenu>
|
|
221
|
+
<DropdownMenuTrigger asChild>
|
|
222
|
+
<Button variant="outline">
|
|
223
|
+
Abrir Menu
|
|
224
|
+
<ChevronDown className="ml-2 h-4 w-4" />
|
|
225
|
+
</Button>
|
|
226
|
+
</DropdownMenuTrigger>
|
|
227
|
+
<DropdownMenuContent className="w-56">
|
|
228
|
+
<DropdownMenuLabel>Minha Conta</DropdownMenuLabel>
|
|
229
|
+
<DropdownMenuSeparator />
|
|
230
|
+
<DropdownMenuGroup>
|
|
231
|
+
<DropdownMenuItem>
|
|
232
|
+
<User className="mr-2 h-4 w-4" />
|
|
233
|
+
<span>Perfil</span>
|
|
234
|
+
<DropdownMenuShortcut>⇧⌘P</DropdownMenuShortcut>
|
|
235
|
+
</DropdownMenuItem>
|
|
236
|
+
<DropdownMenuItem>
|
|
237
|
+
<Settings className="mr-2 h-4 w-4" />
|
|
238
|
+
<span>Configurações</span>
|
|
239
|
+
</DropdownMenuItem>
|
|
240
|
+
</DropdownMenuGroup>
|
|
241
|
+
<DropdownMenuSeparator />
|
|
242
|
+
<DropdownMenuItem>
|
|
243
|
+
<LogOut className="mr-2 h-4 w-4" />
|
|
244
|
+
<span>Sair</span>
|
|
245
|
+
</DropdownMenuItem>
|
|
246
|
+
</DropdownMenuContent>
|
|
247
|
+
</DropdownMenu>
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
**Props:**
|
|
251
|
+
| Prop | Tipo | Padrão | Descrição |
|
|
252
|
+
|------|------|--------|-----------|
|
|
253
|
+
| `DropdownMenu` | `Component` | - | Componente raiz que envolve o trigger e o conteúdo do menu. |
|
|
254
|
+
| `DropdownMenuTrigger` | `Component` | - | Elemento que dispara a abertura do menu. Use asChild para renderizar um elemento personalizado. |
|
|
255
|
+
| `DropdownMenuContent` | `Component` | - | Container para os itens do menu. Aceita align, sideOffset e className. |
|
|
256
|
+
| `DropdownMenuItem` | `Component` | - | Item básico do menu. Aceita inset, disabled e onSelect. |
|
|
257
|
+
| `DropdownMenuCheckboxItem` | `Component` | - | Item com checkbox. Aceita checked e onCheckedChange. |
|
|
258
|
+
| `DropdownMenuRadioGroup` | `Component` | - | Agrupa radio items. Aceita value e onValueChange. |
|
|
259
|
+
| `DropdownMenuRadioItem` | `Component` | - | Item de seleção única dentro de um RadioGroup. Requer value. |
|
|
260
|
+
| `DropdownMenuLabel` | `Component` | - | Rótulo não interativo para agrupar itens. Aceita inset. |
|
|
261
|
+
| `DropdownMenuSeparator` | `Component` | - | Linha divisória visual entre grupos de itens. |
|
|
262
|
+
| `DropdownMenuShortcut` | `Component` | - | Exibe atalho de teclado alinhado à direita do item. |
|
|
263
|
+
| `DropdownMenuGroup` | `Component` | - | Agrupa itens relacionados para organização semântica. |
|
|
264
|
+
| `DropdownMenuSub` | `Component` | - | Container para submenu aninhado. |
|
|
265
|
+
| `DropdownMenuSubTrigger` | `Component` | - | Item que abre um submenu ao hover ou foco. |
|
|
266
|
+
| `DropdownMenuSubContent` | `Component` | - | Conteúdo do submenu aninhado. |
|
|
267
|
+
| `DisabledMenuItem` | `Component` | - | Item desabilitado com tooltip explicativo. Aceita disabledReason para exibir motivo do bloqueio. |
|
|
268
|
+
|
|
269
|
+
**Acessibilidade:**
|
|
270
|
+
- Abre com clique, Enter ou Espaço no trigger
|
|
271
|
+
- Navegação completa por teclado usando setas direcionais
|
|
272
|
+
- Enter ou Espaço para selecionar item focado
|
|
273
|
+
- Escape fecha o menu e retorna foco ao trigger
|
|
274
|
+
- Tab navega para fora do menu (fechando-o)
|
|
275
|
+
- Suporte completo a WAI-ARIA com roles menu, menuitem, menuitemcheckbox e menuitemradio
|
|
276
|
+
- Submenus acessíveis via seta direita (abrir) e seta esquerda (fechar)
|
|
277
|
+
- Type-ahead: digitar caracteres foca no item correspondente
|
|
278
|
+
- Itens desabilitados exibem tooltip explicativo no hover
|
|
279
|
+
|
|
280
|
+
> Fonte: `src\design-system\docs\components\DropdownMenuDoc.tsx`
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
### Menubar
|
|
285
|
+
|
|
286
|
+
Barra de menu horizontal com submenus, checkboxes e radio items. Ideal para barras de navegação de aplicações desktop-like, seguindo padrões de aplicações nativas.
|
|
287
|
+
|
|
288
|
+
**Uso:**
|
|
289
|
+
```tsx
|
|
290
|
+
import {
|
|
291
|
+
Menubar,
|
|
292
|
+
MenubarContent,
|
|
293
|
+
MenubarItem,
|
|
294
|
+
MenubarMenu,
|
|
295
|
+
MenubarSeparator,
|
|
296
|
+
MenubarShortcut,
|
|
297
|
+
MenubarTrigger,
|
|
298
|
+
MenubarCheckboxItem,
|
|
299
|
+
MenubarRadioGroup,
|
|
300
|
+
MenubarRadioItem,
|
|
301
|
+
MenubarSub,
|
|
302
|
+
MenubarSubContent,
|
|
303
|
+
MenubarSubTrigger,
|
|
304
|
+
} from "forlogic-core"
|
|
305
|
+
|
|
306
|
+
// Exemplo básico
|
|
307
|
+
<Menubar>
|
|
308
|
+
<MenubarMenu>
|
|
309
|
+
<MenubarTrigger>Arquivo</MenubarTrigger>
|
|
310
|
+
<MenubarContent>
|
|
311
|
+
<MenubarItem>
|
|
312
|
+
Novo <MenubarShortcut>⌘N</MenubarShortcut>
|
|
313
|
+
</MenubarItem>
|
|
314
|
+
<MenubarItem>Abrir</MenubarItem>
|
|
315
|
+
<MenubarSeparator />
|
|
316
|
+
<MenubarItem>Sair</MenubarItem>
|
|
317
|
+
</MenubarContent>
|
|
318
|
+
</MenubarMenu>
|
|
319
|
+
</Menubar>
|
|
320
|
+
|
|
321
|
+
// Com checkbox items
|
|
322
|
+
const [showBar, setShowBar] = useState(true);
|
|
323
|
+
|
|
324
|
+
<MenubarCheckboxItem
|
|
325
|
+
checked={showBar}
|
|
326
|
+
onCheckedChange={setShowBar}
|
|
327
|
+
>
|
|
328
|
+
Mostrar Barra
|
|
329
|
+
</MenubarCheckboxItem>
|
|
330
|
+
|
|
331
|
+
// Com radio group
|
|
332
|
+
const [theme, setTheme] = useState("light");
|
|
333
|
+
|
|
334
|
+
<MenubarRadioGroup value={theme} onValueChange={setTheme}>
|
|
335
|
+
<MenubarRadioItem value="light">Claro</MenubarRadioItem>
|
|
336
|
+
<MenubarRadioItem value="dark">Escuro</MenubarRadioItem>
|
|
337
|
+
</MenubarRadioGroup>
|
|
338
|
+
|
|
339
|
+
// Com submenus
|
|
340
|
+
<MenubarSub>
|
|
341
|
+
<MenubarSubTrigger>Exportar</MenubarSubTrigger>
|
|
342
|
+
<MenubarSubContent>
|
|
343
|
+
<MenubarItem>PDF</MenubarItem>
|
|
344
|
+
<MenubarItem>Word</MenubarItem>
|
|
345
|
+
</MenubarSubContent>
|
|
346
|
+
</MenubarSub>
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
**Props:**
|
|
350
|
+
| Prop | Tipo | Padrão | Descrição |
|
|
351
|
+
|------|------|--------|-----------|
|
|
352
|
+
| `Menubar` | `ReactNode` | - | Container principal da barra de menu. |
|
|
353
|
+
| `MenubarMenu` | `ReactNode` | - | Agrupa um trigger e seu conteúdo. |
|
|
354
|
+
| `MenubarTrigger` | `ReactNode` | - | Botão que abre o menu dropdown. |
|
|
355
|
+
| `MenubarContent` | `ReactNode` | - | Container do conteúdo do menu dropdown. |
|
|
356
|
+
| `MenubarItem` | `ReactNode` | - | Item clicável do menu. Aceita prop |
|
|
357
|
+
| `MenubarShortcut` | `string` | - | Exibe atalho de teclado ao lado do item. |
|
|
358
|
+
| `MenubarSeparator` | `-` | - | Linha separadora entre grupos de itens. |
|
|
359
|
+
| `MenubarCheckboxItem` | `ReactNode` | - | Item com checkbox. Props: checked, onCheckedChange. |
|
|
360
|
+
| `MenubarRadioGroup` | `ReactNode` | - | Container para radio items. Props: value, onValueChange. |
|
|
361
|
+
| `MenubarRadioItem` | `ReactNode` | - | Item de radio dentro do RadioGroup. Prop: value. |
|
|
362
|
+
| `MenubarSub` | `ReactNode` | - | Container para submenu aninhado. |
|
|
363
|
+
| `MenubarSubTrigger` | `ReactNode` | - | Trigger que abre o submenu. |
|
|
364
|
+
| `MenubarSubContent` | `ReactNode` | - | Conteúdo do submenu. |
|
|
365
|
+
|
|
366
|
+
**Exemplos:**
|
|
367
|
+
```tsx
|
|
368
|
+
<Menubar>
|
|
369
|
+
<MenubarMenu>
|
|
370
|
+
<MenubarTrigger>Arquivo</MenubarTrigger>
|
|
371
|
+
<MenubarContent>
|
|
372
|
+
<MenubarItem>Novo</MenubarItem>
|
|
373
|
+
<MenubarItem>Abrir</MenubarItem>
|
|
374
|
+
<MenubarSeparator />
|
|
375
|
+
<MenubarItem>Salvar</MenubarItem>
|
|
376
|
+
</MenubarContent>
|
|
377
|
+
</MenubarMenu>
|
|
378
|
+
<MenubarMenu>
|
|
379
|
+
<MenubarTrigger>Editar</MenubarTrigger>
|
|
380
|
+
<MenubarContent>
|
|
381
|
+
<MenubarItem>Desfazer</MenubarItem>
|
|
382
|
+
<MenubarItem>Refazer</MenubarItem>
|
|
383
|
+
</MenubarContent>
|
|
384
|
+
</MenubarMenu>
|
|
385
|
+
</Menubar>
|
|
386
|
+
```
|
|
387
|
+
```tsx
|
|
388
|
+
<Menubar>
|
|
389
|
+
<MenubarMenu>
|
|
390
|
+
<MenubarTrigger>Editar</MenubarTrigger>
|
|
391
|
+
<MenubarContent>
|
|
392
|
+
<MenubarItem>
|
|
393
|
+
Desfazer <MenubarShortcut>⌘Z</MenubarShortcut>
|
|
394
|
+
</MenubarItem>
|
|
395
|
+
<MenubarItem>
|
|
396
|
+
Refazer <MenubarShortcut>⇧⌘Z</MenubarShortcut>
|
|
397
|
+
</MenubarItem>
|
|
398
|
+
<MenubarSeparator />
|
|
399
|
+
<MenubarItem>
|
|
400
|
+
Recortar <MenubarShortcut>⌘X</MenubarShortcut>
|
|
401
|
+
</MenubarItem>
|
|
402
|
+
<MenubarItem>
|
|
403
|
+
Copiar <MenubarShortcut>⌘C</MenubarShortcut>
|
|
404
|
+
</MenubarItem>
|
|
405
|
+
<MenubarItem>
|
|
406
|
+
Colar <MenubarShortcut>⌘V</MenubarShortcut>
|
|
407
|
+
</MenubarItem>
|
|
408
|
+
</MenubarContent>
|
|
409
|
+
</MenubarMenu>
|
|
410
|
+
</Menubar>
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
**Acessibilidade:**
|
|
414
|
+
- Navegação completa por teclado (setas, Enter, Escape, Tab)
|
|
415
|
+
- Segue padrão WAI-ARIA de menubar
|
|
416
|
+
- Submenus acessíveis via seta direita/esquerda
|
|
417
|
+
- Gerenciamento de foco automático
|
|
418
|
+
- Suporte a leitor de tela com roles apropriados
|
|
419
|
+
- Escape fecha o menu atual e retorna foco ao trigger
|
|
420
|
+
|
|
421
|
+
**Notas:**
|
|
422
|
+
- Use MenubarSeparator para agrupar visualmente itens relacionados
|
|
423
|
+
- MenubarShortcut é apenas visual - implemente os atalhos separadamente
|
|
424
|
+
- Submenus podem ser aninhados em múltiplos níveis
|
|
425
|
+
- Use
|
|
426
|
+
- em MenubarItem quando precisar alinhar com CheckboxItems/RadioItems
|
|
427
|
+
- Para menus contextuais (clique direito), use ContextMenu ao invés de Menubar
|
|
428
|
+
|
|
429
|
+
> Fonte: `src\design-system\docs\components\MenubarDoc.tsx`
|
|
430
|
+
|
|
431
|
+
---
|
|
432
|
+
|
|
433
|
+
### Navigation Menu
|
|
434
|
+
|
|
435
|
+
*Documentação não extraída automaticamente. Consulte o Design System interativo em `/ds`.*
|
|
436
|
+
|
|
437
|
+
---
|
|
438
|
+
|
|
439
|
+
### Pagination
|
|
440
|
+
|
|
441
|
+
Barra de paginação completa com seletor de itens por página e controles de navegação.
|
|
442
|
+
|
|
443
|
+
**Uso:**
|
|
444
|
+
```tsx
|
|
445
|
+
import { Pagination } from "forlogic-core/crud"
|
|
446
|
+
|
|
447
|
+
<Pagination
|
|
448
|
+
currentPage={1}
|
|
449
|
+
totalPages={10}
|
|
450
|
+
totalItems={100}
|
|
451
|
+
itemsPerPage={10}
|
|
452
|
+
onPageChange={(page) => setPage(page)}
|
|
453
|
+
onItemsPerPageChange={(limit) => setLimit(limit)}
|
|
454
|
+
variant="full"
|
|
455
|
+
/>
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
**Props:**
|
|
459
|
+
| Prop | Tipo | Padrão | Descrição |
|
|
460
|
+
|------|------|--------|-----------|
|
|
461
|
+
| `currentPage` | `number` | - | Página atual (1-indexed) |
|
|
462
|
+
| `totalPages` | `number` | - | Número total de páginas |
|
|
463
|
+
| `totalItems` | `number` | - | Número total de itens |
|
|
464
|
+
| `itemsPerPage` | `number` | - | Quantidade de itens por página |
|
|
465
|
+
| `onPageChange` | `(page: number) => void` | - | Callback ao mudar de página |
|
|
466
|
+
| `onItemsPerPageChange` | `(limit: number) => void` | - | Callback ao mudar itens por página |
|
|
467
|
+
|
|
468
|
+
**Exemplos:**
|
|
469
|
+
```tsx
|
|
470
|
+
<Pagination
|
|
471
|
+
currentPage={1}
|
|
472
|
+
totalPages={2}
|
|
473
|
+
totalItems={15}
|
|
474
|
+
itemsPerPage={10}
|
|
475
|
+
onPageChange={setPage}
|
|
476
|
+
onItemsPerPageChange={setItemsPerPage}
|
|
477
|
+
variant=
|
|
478
|
+
```
|
|
479
|
+
```tsx
|
|
480
|
+
<Pagination
|
|
481
|
+
currentPage={3}
|
|
482
|
+
totalPages={25}
|
|
483
|
+
totalItems={250}
|
|
484
|
+
itemsPerPage={10}
|
|
485
|
+
onPageChange={setPage}
|
|
486
|
+
onItemsPerPageChange={setItemsPerPage}
|
|
487
|
+
variant=
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
**Acessibilidade:**
|
|
491
|
+
- Navegável por teclado
|
|
492
|
+
- Labels ARIA apropriados
|
|
493
|
+
- Indicação visual da página atual
|
|
494
|
+
- Botões desabilitados quando não aplicável
|
|
495
|
+
- Amigável para leitores de tela
|
|
496
|
+
|
|
497
|
+
> Fonte: `src\design-system\docs\components\PaginationDoc.tsx`
|
|
498
|
+
|
|
499
|
+
---
|
|
500
|
+
|
|
501
|
+
### Select
|
|
502
|
+
|
|
503
|
+
Exibe uma lista de opções para o usuário escolher—acionada por um botão.
|
|
504
|
+
|
|
505
|
+
**Uso:**
|
|
506
|
+
```tsx
|
|
507
|
+
import {
|
|
508
|
+
Select,
|
|
509
|
+
SelectContent,
|
|
510
|
+
SelectItem,
|
|
511
|
+
SelectTrigger,
|
|
512
|
+
SelectValue,
|
|
513
|
+
} from "forlogic-core"
|
|
514
|
+
|
|
515
|
+
<Select>
|
|
516
|
+
<SelectTrigger className="w-[180px]">
|
|
517
|
+
<SelectValue placeholder="Theme" />
|
|
518
|
+
</SelectTrigger>
|
|
519
|
+
<SelectContent>
|
|
520
|
+
<SelectItem value="light">Light</SelectItem>
|
|
521
|
+
<SelectItem value="dark">Dark</SelectItem>
|
|
522
|
+
</SelectContent>
|
|
523
|
+
</Select>
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
**Props:**
|
|
527
|
+
| Prop | Tipo | Padrão | Descrição |
|
|
528
|
+
|------|------|--------|-----------|
|
|
529
|
+
| `defaultValue` | `string` | - | O valor selecionado padrão. |
|
|
530
|
+
| `value` | `string` | - | O valor selecionado controlado. |
|
|
531
|
+
| `onValueChange` | `(value: string) => void` | - | Manipulador de evento quando o valor muda. |
|
|
532
|
+
| `disabled` | `boolean` | false | Se o select está desabilitado. |
|
|
533
|
+
| `container (SelectContent)` | `HTMLElement` | - | Container HTML para portal (útil dentro de Dialog). |
|
|
534
|
+
| `collisionBoundary (SelectContent)` | `HTMLElement` | - | Elemento para detecção de colisão de posicionamento. |
|
|
535
|
+
|
|
536
|
+
**Acessibilidade:**
|
|
537
|
+
- Navegação completa por teclado
|
|
538
|
+
- Busca por digitação antecipada
|
|
539
|
+
- Segue o padrão de listbox WAI-ARIA
|
|
540
|
+
- Anúncios para leitores de tela
|
|
541
|
+
|
|
542
|
+
**Notas:**
|
|
543
|
+
- 💡 Use
|
|
544
|
+
- e
|
|
545
|
+
- quando o Select estiver dentro de um Dialog para evitar problemas de scroll
|
|
546
|
+
- 💡 Para seleção com busca, considere usar
|
|
547
|
+
- ao invés de
|
|
548
|
+
|
|
549
|
+
> Fonte: `src\design-system\docs\components\SelectDoc.tsx`
|
|
550
|
+
|
|
551
|
+
---
|
|
552
|
+
|
|
553
|
+
### Tabs & TabPageLayout
|
|
554
|
+
|
|
555
|
+
Componentes de navegação em abas. Tabs para conteúdo simples e TabPageLayout para páginas completas com header fixo e scroll.
|
|
556
|
+
|
|
557
|
+
**Uso:**
|
|
558
|
+
```tsx
|
|
559
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from "forlogic-core"
|
|
560
|
+
|
|
561
|
+
<Tabs defaultValue="account">
|
|
562
|
+
<TabsList>
|
|
563
|
+
<TabsTrigger value="account">Conta</TabsTrigger>
|
|
564
|
+
<TabsTrigger value="password">Senha</TabsTrigger>
|
|
565
|
+
</TabsList>
|
|
566
|
+
<TabsContent value="account">
|
|
567
|
+
Faça alterações na sua conta aqui.
|
|
568
|
+
</TabsContent>
|
|
569
|
+
<TabsContent value="password">
|
|
570
|
+
Altere sua senha aqui.
|
|
571
|
+
</TabsContent>
|
|
572
|
+
</Tabs>
|
|
573
|
+
```
|
|
574
|
+
|
|
575
|
+
**Props:**
|
|
576
|
+
| Prop | Tipo | Padrão | Descrição |
|
|
577
|
+
|------|------|--------|-----------|
|
|
578
|
+
| `defaultValue` | `string` | - | O valor da aba que deve estar ativa por padrão. |
|
|
579
|
+
| `value` | `string` | - | O valor controlado da aba ativa. |
|
|
580
|
+
| `onValueChange` | `(value: string) => void` | - | Manipulador de evento quando a aba ativa muda. |
|
|
581
|
+
| `TabPageHeader.title` | `string | ReactNode` | - | Título do header. |
|
|
582
|
+
| `TabPageHeader.description` | `string` | - | Descrição opcional. |
|
|
583
|
+
| `TabPageHeader.actions` | `ReactNode` | - | Ações (botões) do header. |
|
|
584
|
+
|
|
585
|
+
**Acessibilidade:**
|
|
586
|
+
- Navegação completa por teclado (teclas de seta para navegar entre abas)
|
|
587
|
+
- Segue o padrão WAI-ARIA de tabs
|
|
588
|
+
- Gerenciamento adequado de foco
|
|
589
|
+
- Anúncios para leitores de tela
|
|
590
|
+
|
|
591
|
+
**Notas:**
|
|
592
|
+
- **Tabs** é ideal para alternar entre visualizações simples
|
|
593
|
+
- **TabPageLayout** é ideal para páginas dentro de tabs com header fixo e scroll
|
|
594
|
+
- TabPageLayout inclui separador automático e scroll area
|
|
595
|
+
- Para barras de menu estilo desktop, veja o componente **Menubar**
|
|
596
|
+
|
|
597
|
+
> Fonte: `src\design-system\docs\components\TabsDoc.tsx`
|
|
598
|
+
|
|
599
|
+
---
|