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.
- 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 -68
- package/dist/action-plans/components/ActionPlanAttachmentsTab.d.ts +3 -0
- package/dist/action-plans/components/ActionPlanCommentsTab.d.ts +3 -0
- package/dist/action-plans/components/ActionPlanCostTab.d.ts +5 -0
- package/dist/action-plans/components/ActionPlanGeneralTab.d.ts +3 -0
- package/dist/action-plans/components/ActionPlanHistoryTab.d.ts +3 -0
- package/dist/action-plans/components/ActionPlanPredecessorsTab.d.ts +5 -0
- package/dist/action-plans/components/ActionPlanProgressDialog.d.ts +3 -0
- package/dist/action-plans/components/ActionPlanProgressTab.d.ts +5 -0
- package/dist/action-plans/components/ActionPlanStatusBadge.d.ts +9 -2
- package/dist/action-plans/constants.d.ts +24 -0
- package/dist/action-plans/hooks/useActionPlan.d.ts +5 -0
- package/dist/action-plans/hooks/useActionPlanProgress.d.ts +5 -0
- package/dist/action-plans/types.d.ts +60 -0
- package/dist/action-plans/utils/formatTime.d.ts +9 -0
- package/dist/audit-trail/components/AuditTrailDetails.d.ts +10 -0
- package/dist/audit-trail/components/AuditTrailFilter.d.ts +10 -0
- package/dist/audit-trail/components/AuditTrailPage.d.ts +10 -0
- package/dist/audit-trail/types.d.ts +58 -0
- package/dist/audit-trail/utils.d.ts +18 -2
- package/dist/auth/components/EditProfileDialog.d.ts +1 -0
- package/dist/auth/components/ProtectedRoute.d.ts +5 -0
- package/dist/auth/contexts/AuthContext.d.ts +5 -0
- package/dist/auth/pages/CallbackPage.d.ts +5 -0
- package/dist/auth/services/AuthService.d.ts +5 -0
- package/dist/auth/services/TokenManager.d.ts +5 -0
- package/dist/auth/services/TokenService.d.ts +10 -0
- package/dist/auth/utils/ErrorInterceptor.d.ts +5 -0
- package/dist/components/dashboards/dashboard-form.d.ts +15 -0
- package/dist/components/dashboards/dashboard-general-view.d.ts +15 -0
- package/dist/components/dashboards/dashboard-grid.d.ts +25 -0
- package/dist/components/dashboards/dashboard-list.d.ts +10 -0
- package/dist/components/dashboards/dashboard-panel-renderer.d.ts +10 -0
- package/dist/components/dashboards/dashboard-view.d.ts +10 -0
- package/dist/components/dashboards/helpers.d.ts +44 -5
- package/dist/components/dashboards/panels/burndown-panel.d.ts +15 -0
- package/dist/components/dashboards/panels/cartesian-panel.d.ts +20 -0
- package/dist/components/dashboards/panels/list-panel.d.ts +15 -0
- package/dist/components/dashboards/panels/matrix-risk-panel.d.ts +25 -0
- package/dist/components/dashboards/panels/numeric-panel.d.ts +10 -0
- package/dist/components/dashboards/panels/panel-error.d.ts +10 -0
- package/dist/components/dashboards/panels/panel-header.d.ts +10 -0
- package/dist/components/dashboards/panels/panel-loader.d.ts +10 -0
- package/dist/components/dashboards/panels/panel-no-data.d.ts +10 -0
- package/dist/components/dashboards/panels/panel-unavailable.d.ts +10 -0
- package/dist/components/dashboards/panels/pareto-panel.d.ts +10 -0
- package/dist/components/dashboards/panels/performance-panel.d.ts +15 -0
- package/dist/components/dashboards/panels/pie-panel.d.ts +10 -0
- package/dist/components/dashboards/panels/text-panel.d.ts +10 -0
- package/dist/components/dashboards/types.d.ts +230 -0
- package/dist/components/modules/AccessDeniedDialog.d.ts +3 -1
- package/dist/components/modules/ModuleAccessGuard.d.ts +3 -1
- package/dist/components/modules/ModulesContent.d.ts +3 -1
- package/dist/components/modules/ModulesDialog.d.ts +1 -1
- package/dist/components/modules/ModulesFooterCards.d.ts +3 -1
- package/dist/components/modules/types.d.ts +2 -0
- package/dist/components/ui/accordion.d.ts +35 -0
- package/dist/components/ui/action-button.d.ts +5 -0
- package/dist/components/ui/alert-dialog.d.ts +82 -0
- package/dist/components/ui/alert.d.ts +32 -0
- package/dist/components/ui/avatar.d.ts +30 -0
- package/dist/components/ui/badge.d.ts +32 -0
- package/dist/components/ui/breadcrumb.d.ts +54 -0
- package/dist/components/ui/button-group.d.ts +15 -0
- package/dist/components/ui/button.d.ts +55 -0
- package/dist/components/ui/calendar.d.ts +16 -0
- package/dist/components/ui/card.d.ts +49 -0
- package/dist/components/ui/chart.d.ts +35 -0
- package/dist/components/ui/checkbox.d.ts +11 -0
- package/dist/components/ui/collapsible.d.ts +15 -0
- package/dist/components/ui/color-picker.d.ts +5 -0
- package/dist/components/ui/combo-tree.d.ts +23 -0
- package/dist/components/ui/combobox.d.ts +28 -0
- package/dist/components/ui/command.d.ts +66 -0
- package/dist/components/ui/context-menu.d.ts +95 -0
- package/dist/components/ui/date-picker.d.ts +10 -0
- package/dist/components/ui/dialog-wizard.d.ts +22 -4
- package/dist/components/ui/dialog.d.ts +181 -0
- package/dist/components/ui/drawer.d.ts +72 -0
- package/dist/components/ui/dropdown-menu.d.ts +153 -0
- package/dist/components/ui/electronic-signature-dialog.d.ts +10 -0
- package/dist/components/ui/export-dialog.d.ts +20 -0
- package/dist/components/ui/form.d.ts +96 -0
- package/dist/components/ui/hover-card.d.ts +15 -0
- package/dist/components/ui/icon-picker.d.ts +5 -0
- package/dist/components/ui/iframe-dialog.d.ts +10 -0
- package/dist/components/ui/input-group.d.ts +16 -0
- package/dist/components/ui/input.d.ts +5 -0
- package/dist/components/ui/menubar.d.ts +80 -0
- package/dist/components/ui/multiselect-permissions.d.ts +25 -0
- package/dist/components/ui/navigation-menu.d.ts +45 -0
- package/dist/components/ui/onboarding-dialog.d.ts +15 -0
- package/dist/components/ui/online-editor-dialog.d.ts +10 -0
- package/dist/components/ui/pagination.d.ts +53 -0
- package/dist/components/ui/popover.d.ts +8 -0
- package/dist/components/ui/radio-group.d.ts +3 -0
- package/dist/components/ui/report-request-list.d.ts +20 -0
- package/dist/components/ui/resizable.d.ts +15 -0
- package/dist/components/ui/rich-text-editor.d.ts +13 -0
- package/dist/components/ui/scroll-area.d.ts +3 -0
- package/dist/components/ui/select.d.ts +71 -0
- package/dist/components/ui/separator.d.ts +13 -0
- package/dist/components/ui/sheet.d.ts +76 -0
- package/dist/components/ui/sidebar.d.ts +203 -0
- package/dist/components/ui/skeleton-variants.d.ts +25 -0
- package/dist/components/ui/skeleton.d.ts +12 -0
- package/dist/components/ui/slider.d.ts +5 -0
- package/dist/components/ui/sonner.d.ts +5 -0
- package/dist/components/ui/spinner.d.ts +5 -0
- package/dist/components/ui/split-button.d.ts +6 -0
- package/dist/components/ui/stack.d.ts +5 -0
- package/dist/components/ui/status-badge.d.ts +52 -0
- package/dist/components/ui/step-selector.d.ts +5 -0
- package/dist/components/ui/stimulsoft-viewer.d.ts +8 -0
- package/dist/components/ui/switch.d.ts +21 -0
- package/dist/components/ui/tab-page-layout.d.ts +33 -0
- package/dist/components/ui/table-resize-handle.d.ts +10 -3
- package/dist/components/ui/table.d.ts +102 -0
- package/dist/components/ui/tabs.d.ts +59 -0
- package/dist/components/ui/terms-of-use-dialog.d.ts +50 -4
- package/dist/components/ui/textarea.d.ts +27 -0
- package/dist/components/ui/timepicker.d.ts +23 -0
- package/dist/components/ui/toggle-group.d.ts +25 -0
- package/dist/components/ui/toggle.d.ts +21 -0
- package/dist/components/ui/tooltip.d.ts +48 -0
- package/dist/components/ui/truncated-cell.d.ts +13 -0
- package/dist/components/ui/typography.d.ts +119 -0
- package/dist/components/ui/updates-notification.d.ts +33 -0
- package/dist/components/ui/users-groups-selector.d.ts +43 -0
- package/dist/components/ui/viewer-dialog.d.ts +107 -0
- package/dist/crud/components/ActionMenuItems.d.ts +5 -0
- package/dist/crud/components/BaseForm.d.ts +46 -0
- package/dist/crud/components/ColumnSettingsPopover.d.ts +10 -0
- package/dist/crud/components/CrudActionBar.d.ts +20 -0
- package/dist/crud/components/CrudGrid.d.ts +10 -0
- package/dist/crud/components/CrudPagination.d.ts +5 -0
- package/dist/crud/components/CrudTable.d.ts +5 -0
- package/dist/crud/components/TableRowActions.d.ts +5 -0
- package/dist/crud/createCrudPage.d.ts +41 -8
- package/dist/crud/generateCrudConfig.d.ts +13 -8
- package/dist/crud/hooks/useBaseForm.d.ts +39 -0
- package/dist/crud/hooks/useColumnManager.d.ts +25 -0
- package/dist/crud/hooks/useCrud.d.ts +35 -0
- package/dist/crud/primitives/ActionMenu.d.ts +41 -0
- package/dist/crud/primitives/FilterBar.d.ts +45 -0
- package/dist/crud/primitives/Pagination.d.ts +5 -0
- package/dist/crud/primitives/Table.d.ts +6 -1
- package/dist/crud/primitives/TreeTable.d.ts +5 -0
- package/dist/crud/primitives/types.d.ts +63 -0
- package/dist/crud/utils/routingHelpers.d.ts +11 -0
- package/dist/custom-form-fields/components/CustomFormFields.d.ts +3 -0
- package/dist/custom-form-fields/fields/FormDateField.d.ts +3 -0
- package/dist/custom-form-fields/fields/FormMultiSelectionField.d.ts +3 -0
- package/dist/custom-form-fields/fields/FormNumericField.d.ts +3 -0
- package/dist/custom-form-fields/fields/FormQuestionsField.d.ts +3 -0
- package/dist/custom-form-fields/fields/FormSingleSelectionField.d.ts +3 -0
- package/dist/custom-form-fields/fields/FormTextField.d.ts +3 -0
- package/dist/custom-form-fields/fields/FormTimeField.d.ts +3 -0
- package/dist/custom-form-fields/fields/FormUrlField.d.ts +3 -0
- package/dist/custom-form-fields/fields/ReadOnlyTextField.d.ts +3 -0
- package/dist/custom-form-fields/types.d.ts +84 -21
- package/dist/exports/crud.d.ts +5 -0
- package/dist/exports/integrations.d.ts +1 -0
- package/dist/exports/ui.d.ts +1 -0
- package/dist/file-upload/components/SingleFileUpload.d.ts +59 -0
- package/dist/file-upload/types.d.ts +15 -0
- package/dist/file-upload/utils/formatBytes.d.ts +5 -0
- package/dist/file-upload/utils/getFileExtension.d.ts +5 -0
- package/dist/hooks/useColumnResize.d.ts +24 -0
- package/dist/hooks/useRowResize.d.ts +18 -0
- package/dist/hooks/useSidebarResize.d.ts +18 -0
- package/dist/hooks/useUpdatesNotification.d.ts +16 -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/dist/integrations/clarity/clarityTracking.d.ts +31 -0
- package/dist/integrations/clarity/index.d.ts +3 -0
- package/dist/integrations/clarity/types.d.ts +46 -0
- package/dist/integrations/clarity/useClarity.d.ts +34 -0
- package/dist/integrations/index.d.ts +5 -0
- package/dist/providers/CoreProviders.d.ts +16 -1
- package/dist/qualiex/components/QualiexUserField.d.ts +8 -0
- package/dist/qualiex/hooks/useQualiexUsers.d.ts +16 -26
- package/dist/qualiex/services/qualiexApi.d.ts +38 -2
- package/dist/qualiex/utils/QualiexErrorInterceptor.d.ts +5 -0
- package/dist/supabase/SupabaseSingleton.d.ts +34 -0
- package/dist/types.d.ts +51 -2
- package/dist/utils/color.d.ts +26 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/vite/index.esm.js +4 -1
- package/dist/vite/index.js +4 -1
- package/docs/PUBLISH.md +168 -0
- package/docs/STORAGE_BUCKETS.md +384 -0
- package/docs/WORKSPACE_KNOWLEDGE.md +120 -119
- package/docs/design-system/README.md +1 -1
- package/docs/design-system/buttons-actions.md +130 -130
- package/docs/design-system/charts-dashboards.md +340 -301
- package/docs/design-system/crud.md +174 -114
- package/docs/design-system/data-display.md +108 -103
- package/docs/design-system/dialogs.md +212 -212
- package/docs/design-system/domain.md +317 -317
- package/docs/design-system/examples.md +275 -275
- package/docs/design-system/foundation.md +1 -1
- package/docs/design-system/inputs.md +131 -131
- package/docs/design-system/layout.md +202 -154
- package/docs/design-system/navigation.md +271 -325
- 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 -39
- 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 +24 -20
- 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 +48 -48
- package/docs/design-system/platform.md +18 -18
- package/docs/design-system/selectors.md +240 -236
- package/docs/design-system/tables-grids.md +95 -38
- package/package.json +150 -144
- package/dist/README.md +0 -1079
- package/dist/bin/bootstrap.js +0 -40
- package/dist/bin/pull-docs.js +0 -186
- package/dist/docs/KNOWLEDGE.md +0 -109
|
@@ -11,39 +11,39 @@ Header principal da aplicação com título dinâmico, busca global integrada ao
|
|
|
11
11
|
|
|
12
12
|
**Uso:**
|
|
13
13
|
```tsx
|
|
14
|
-
import { AppLayout, usePageMetadata } from 'forlogic-core';
|
|
15
|
-
|
|
16
|
-
// O AppHeader é renderizado automaticamente pelo AppLayout
|
|
17
|
-
<AppLayout sidebarConfig={sidebarConfig}>
|
|
18
|
-
<Routes>...</Routes>
|
|
19
|
-
</AppLayout>
|
|
20
|
-
|
|
21
|
-
// Para configurar título, subtítulo e breadcrumbs
|
|
22
|
-
function UsersPage() {
|
|
23
|
-
usePageMetadata({
|
|
24
|
-
title: 'Usuários',
|
|
25
|
-
subtitle: 'Gerenciamento de usuários do sistema'
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// Com breadcrumbs
|
|
30
|
-
function EditUserPage() {
|
|
31
|
-
usePageMetadata({
|
|
32
|
-
title: 'Editar Usuário',
|
|
33
|
-
subtitle: 'Atualize os dados cadastrais',
|
|
34
|
-
breadcrumbs: [
|
|
35
|
-
{ label: 'Usuários', href: '/users' },
|
|
36
|
-
{ label: 'João Silva' }
|
|
37
|
-
]
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Subtitle com ReactNode
|
|
42
|
-
function DetailPage() {
|
|
43
|
-
usePageMetadata({
|
|
44
|
-
title: 'Detalhes',
|
|
45
|
-
subtitle: <span>Veja a <Link to="/docs">documentação</Link></span>
|
|
46
|
-
});
|
|
14
|
+
import { AppLayout, usePageMetadata } from 'forlogic-core';
|
|
15
|
+
|
|
16
|
+
// O AppHeader é renderizado automaticamente pelo AppLayout
|
|
17
|
+
<AppLayout sidebarConfig={sidebarConfig}>
|
|
18
|
+
<Routes>...</Routes>
|
|
19
|
+
</AppLayout>
|
|
20
|
+
|
|
21
|
+
// Para configurar título, subtítulo e breadcrumbs
|
|
22
|
+
function UsersPage() {
|
|
23
|
+
usePageMetadata({
|
|
24
|
+
title: 'Usuários',
|
|
25
|
+
subtitle: 'Gerenciamento de usuários do sistema'
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Com breadcrumbs
|
|
30
|
+
function EditUserPage() {
|
|
31
|
+
usePageMetadata({
|
|
32
|
+
title: 'Editar Usuário',
|
|
33
|
+
subtitle: 'Atualize os dados cadastrais',
|
|
34
|
+
breadcrumbs: [
|
|
35
|
+
{ label: 'Usuários', href: '/users' },
|
|
36
|
+
{ label: 'João Silva' }
|
|
37
|
+
]
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Subtitle com ReactNode
|
|
42
|
+
function DetailPage() {
|
|
43
|
+
usePageMetadata({
|
|
44
|
+
title: 'Detalhes',
|
|
45
|
+
subtitle: <span>Veja a <Link to="/docs">documentação</Link></span>
|
|
46
|
+
});
|
|
47
47
|
}
|
|
48
48
|
```
|
|
49
49
|
|
|
@@ -56,21 +56,21 @@ function DetailPage() {
|
|
|
56
56
|
|
|
57
57
|
**Exemplos:**
|
|
58
58
|
```tsx
|
|
59
|
-
// Áreas do AppHeader
|
|
60
|
-
// 1. Título: Título da página + Subtítulo + Badge do módulo
|
|
61
|
-
// 2. Busca: Input de busca global (visível quando habilitado)
|
|
62
|
-
// 3. Ações: Botões customizáveis via PageMetadataContext
|
|
63
|
-
// 4. Perfil: UserInfo com dropdown de usuário
|
|
64
|
-
|
|
59
|
+
// Áreas do AppHeader
|
|
60
|
+
// 1. Título: Título da página + Subtítulo + Badge do módulo
|
|
61
|
+
// 2. Busca: Input de busca global (visível quando habilitado)
|
|
62
|
+
// 3. Ações: Botões customizáveis via PageMetadataContext
|
|
63
|
+
// 4. Perfil: UserInfo com dropdown de usuário
|
|
64
|
+
|
|
65
65
|
// Altura fixa: 56px (h-14 no Tailwind)
|
|
66
66
|
```
|
|
67
67
|
```tsx
|
|
68
|
-
// UserInfo com variantes
|
|
68
|
+
// UserInfo com variantes
|
|
69
69
|
<UserInfo variant=
|
|
70
70
|
```
|
|
71
71
|
```tsx
|
|
72
|
-
// Configurar campos pesquisáveis no service
|
|
73
|
-
const userService = createSimpleService({
|
|
72
|
+
// Configurar campos pesquisáveis no service
|
|
73
|
+
const userService = createSimpleService({
|
|
74
74
|
tableName:
|
|
75
75
|
```
|
|
76
76
|
|
|
@@ -94,7 +94,7 @@ const userService = createSimpleService({
|
|
|
94
94
|
- ❌ Não use mais de 3 botões de ação
|
|
95
95
|
- ❌ Não esconda o UserInfo em páginas autenticadas
|
|
96
96
|
|
|
97
|
-
> Fonte: `src
|
|
97
|
+
> Fonte: `src/design-system/docs/components/layout/AppHeaderDoc.tsx`
|
|
98
98
|
|
|
99
99
|
---
|
|
100
100
|
|
|
@@ -104,63 +104,63 @@ Sidebar de navegação principal da aplicação com suporte a pin/unpin, permiss
|
|
|
104
104
|
|
|
105
105
|
**Uso:**
|
|
106
106
|
```tsx
|
|
107
|
-
import { AppLayout } from 'forlogic-core';
|
|
108
|
-
import type { SidebarConfig } from 'forlogic-core';
|
|
109
|
-
import { Home, Users, Settings, Shield, Plus, FileText, Folder } from 'lucide-react';
|
|
110
|
-
|
|
111
|
-
const sidebarConfig: SidebarConfig = {
|
|
112
|
-
appName: 'Minha Aplicação',
|
|
113
|
-
|
|
114
|
-
// Ações do módulo (opcional)
|
|
115
|
-
moduleActions: {
|
|
116
|
-
triggerLabel: 'Criar',
|
|
117
|
-
triggerIcon: Plus,
|
|
118
|
-
actions: [
|
|
119
|
-
{ id: 'new-doc', label: 'Novo Documento', icon: FileText, onClick: () => {} },
|
|
120
|
-
{ id: 'new-folder', label: 'Nova Pasta', icon: Folder, onClick: () => {} },
|
|
121
|
-
],
|
|
122
|
-
},
|
|
123
|
-
|
|
124
|
-
// Navegação (com suporte a hierarquia e separadores)
|
|
125
|
-
navigation: [
|
|
126
|
-
{ label: 'Início', path: '/', icon: Home },
|
|
127
|
-
{ label: 'Usuários', path: '/users', icon: Users },
|
|
128
|
-
{ label: '', path: '', type: 'separator' }, // Linha horizontal separadora
|
|
129
|
-
{
|
|
130
|
-
label: 'Configurações',
|
|
131
|
-
path: '/settings',
|
|
132
|
-
icon: Settings,
|
|
133
|
-
children: [
|
|
134
|
-
{ label: 'Perfil', path: '/settings/profile', icon: Users },
|
|
135
|
-
{ label: 'Segurança', path: '/settings/security', icon: Shield },
|
|
136
|
-
],
|
|
137
|
-
},
|
|
138
|
-
],
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
// Uso via AppLayout (recomendado)
|
|
142
|
-
<AppLayout sidebarConfig={sidebarConfig}>
|
|
143
|
-
<Routes>...</Routes>
|
|
144
|
-
</AppLayout>
|
|
145
|
-
|
|
146
|
-
// Uso direto (casos avançados)
|
|
147
|
-
<AppSidebar
|
|
148
|
-
config={sidebarConfig}
|
|
149
|
-
resizable={true}
|
|
150
|
-
minWidth={224}
|
|
151
|
-
maxWidth={384}
|
|
107
|
+
import { AppLayout } from 'forlogic-core';
|
|
108
|
+
import type { SidebarConfig } from 'forlogic-core';
|
|
109
|
+
import { Home, Users, Settings, Shield, Plus, FileText, Folder } from 'lucide-react';
|
|
110
|
+
|
|
111
|
+
const sidebarConfig: SidebarConfig = {
|
|
112
|
+
appName: 'Minha Aplicação',
|
|
113
|
+
|
|
114
|
+
// Ações do módulo (opcional)
|
|
115
|
+
moduleActions: {
|
|
116
|
+
triggerLabel: 'Criar',
|
|
117
|
+
triggerIcon: Plus,
|
|
118
|
+
actions: [
|
|
119
|
+
{ id: 'new-doc', label: 'Novo Documento', icon: FileText, onClick: () => {} },
|
|
120
|
+
{ id: 'new-folder', label: 'Nova Pasta', icon: Folder, onClick: () => {} },
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
// Navegação (com suporte a hierarquia e separadores)
|
|
125
|
+
navigation: [
|
|
126
|
+
{ label: 'Início', path: '/', icon: Home },
|
|
127
|
+
{ label: 'Usuários', path: '/users', icon: Users },
|
|
128
|
+
{ label: '', path: '', type: 'separator' }, // Linha horizontal separadora
|
|
129
|
+
{
|
|
130
|
+
label: 'Configurações',
|
|
131
|
+
path: '/settings',
|
|
132
|
+
icon: Settings,
|
|
133
|
+
children: [
|
|
134
|
+
{ label: 'Perfil', path: '/settings/profile', icon: Users },
|
|
135
|
+
{ label: 'Segurança', path: '/settings/security', icon: Shield },
|
|
136
|
+
],
|
|
137
|
+
},
|
|
138
|
+
],
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
// Uso via AppLayout (recomendado)
|
|
142
|
+
<AppLayout sidebarConfig={sidebarConfig}>
|
|
143
|
+
<Routes>...</Routes>
|
|
144
|
+
</AppLayout>
|
|
145
|
+
|
|
146
|
+
// Uso direto (casos avançados)
|
|
147
|
+
<AppSidebar
|
|
148
|
+
config={sidebarConfig}
|
|
149
|
+
resizable={true}
|
|
150
|
+
minWidth={224}
|
|
151
|
+
maxWidth={384}
|
|
152
152
|
/>
|
|
153
153
|
```
|
|
154
154
|
|
|
155
155
|
**Exemplos:**
|
|
156
156
|
```tsx
|
|
157
|
-
// Estrutura do AppSidebar
|
|
157
|
+
// Estrutura do AppSidebar
|
|
158
158
|
<Sidebar collapsible=
|
|
159
159
|
```
|
|
160
160
|
```tsx
|
|
161
|
-
// Matching de rota ativa (hierárquico)
|
|
162
|
-
const isActive = (path: string) =>
|
|
163
|
-
location.pathname === path ||
|
|
161
|
+
// Matching de rota ativa (hierárquico)
|
|
162
|
+
const isActive = (path: string) =>
|
|
163
|
+
location.pathname === path ||
|
|
164
164
|
location.pathname.startsWith(path +
|
|
165
165
|
```
|
|
166
166
|
|
|
@@ -187,7 +187,7 @@ const isActive = (path: string) =>
|
|
|
187
187
|
- ❌ Não misture ícones de bibliotecas diferentes
|
|
188
188
|
- ❌ Não use labels com mais de 20 caracteres
|
|
189
189
|
|
|
190
|
-
> Fonte: `src
|
|
190
|
+
> Fonte: `src/design-system/docs/components/layout/AppSidebarDoc.tsx`
|
|
191
191
|
|
|
192
192
|
---
|
|
193
193
|
|
|
@@ -197,28 +197,28 @@ Container principal de página com breadcrumb, background neutro e suporte a mú
|
|
|
197
197
|
|
|
198
198
|
**Uso:**
|
|
199
199
|
```tsx
|
|
200
|
-
import { BodyContent, ContentContainer } from 'forlogic-core';
|
|
201
|
-
|
|
202
|
-
<BodyContent
|
|
203
|
-
breadcrumbs={[
|
|
204
|
-
{ label: 'Módulo', href: '/modulo' },
|
|
205
|
-
{ label: 'Seção', href: '/modulo/secao' },
|
|
206
|
-
{ label: 'Página Atual' }, // Sem href = página atual
|
|
207
|
-
]}
|
|
208
|
-
>
|
|
209
|
-
<ContentContainer
|
|
210
|
-
title="Título do Container"
|
|
211
|
-
subtitle="Subtítulo com informações adicionais"
|
|
212
|
-
>
|
|
213
|
-
<p>Conteúdo principal aqui...</p>
|
|
214
|
-
</ContentContainer>
|
|
200
|
+
import { BodyContent, ContentContainer } from 'forlogic-core';
|
|
201
|
+
|
|
202
|
+
<BodyContent
|
|
203
|
+
breadcrumbs={[
|
|
204
|
+
{ label: 'Módulo', href: '/modulo' },
|
|
205
|
+
{ label: 'Seção', href: '/modulo/secao' },
|
|
206
|
+
{ label: 'Página Atual' }, // Sem href = página atual
|
|
207
|
+
]}
|
|
208
|
+
>
|
|
209
|
+
<ContentContainer
|
|
210
|
+
title="Título do Container"
|
|
211
|
+
subtitle="Subtítulo com informações adicionais"
|
|
212
|
+
>
|
|
213
|
+
<p>Conteúdo principal aqui...</p>
|
|
214
|
+
</ContentContainer>
|
|
215
215
|
</BodyContent>
|
|
216
216
|
```
|
|
217
217
|
|
|
218
218
|
**Exemplos:**
|
|
219
219
|
```tsx
|
|
220
|
-
<BodyContent
|
|
221
|
-
breadcrumbs={[
|
|
220
|
+
<BodyContent
|
|
221
|
+
breadcrumbs={[
|
|
222
222
|
{ label:
|
|
223
223
|
```
|
|
224
224
|
|
|
@@ -226,9 +226,9 @@ import { BodyContent, ContentContainer } from 'forlogic-core';
|
|
|
226
226
|
- O breadcrumb usa a tag nav com aria-label=
|
|
227
227
|
- para identificação por leitores de tela
|
|
228
228
|
- A página atual no breadcrumb é marcada com aria-current=
|
|
229
|
-
- ,
|
|
229
|
+
- ,
|
|
230
230
|
|
|
231
|
-
- ,
|
|
231
|
+
- ,
|
|
232
232
|
|
|
233
233
|
- true
|
|
234
234
|
|
|
@@ -240,15 +240,63 @@ import { BodyContent, ContentContainer } from 'forlogic-core';
|
|
|
240
240
|
- Para integração com React Router, use asChild=true e passe o Link como children
|
|
241
241
|
- O espaçamento entre containers segue o padrão do Design System (space-y-6)
|
|
242
242
|
|
|
243
|
-
> Fonte: `src
|
|
243
|
+
> Fonte: `src/design-system/docs/components/layout/BodyContentDoc.tsx`
|
|
244
244
|
|
|
245
245
|
---
|
|
246
246
|
|
|
247
|
-
###
|
|
247
|
+
### Grid & Stack
|
|
248
248
|
|
|
249
|
-
|
|
249
|
+
Sistema de layout com Grid responsivo e Stack flexível para organização de conteúdo.
|
|
250
250
|
|
|
251
|
-
|
|
251
|
+
**Uso:**
|
|
252
|
+
```tsx
|
|
253
|
+
import { Grid, Stack, Card } from "forlogic-core"
|
|
254
|
+
|
|
255
|
+
// Grid com 3 colunas fixas
|
|
256
|
+
<Grid cols="3" gap="md">
|
|
257
|
+
<div>Item 1</div>
|
|
258
|
+
<div>Item 2</div>
|
|
259
|
+
<div>Item 3</div>
|
|
260
|
+
</Grid>
|
|
261
|
+
|
|
262
|
+
// Stack vertical
|
|
263
|
+
<Stack direction="column" gap="md">
|
|
264
|
+
<div>Item 1</div>
|
|
265
|
+
<div>Item 2</div>
|
|
266
|
+
</Stack>
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
**Props:**
|
|
270
|
+
| Prop | Tipo | Padrão | Descrição |
|
|
271
|
+
|------|------|--------|-----------|
|
|
272
|
+
| `Stack.wrap` | `boolean` | false | Permite quebra de linha. |
|
|
273
|
+
|
|
274
|
+
**Exemplos:**
|
|
275
|
+
```tsx
|
|
276
|
+
<Stack direction=
|
|
277
|
+
```
|
|
278
|
+
```tsx
|
|
279
|
+
<Stack direction=
|
|
280
|
+
```
|
|
281
|
+
```tsx
|
|
282
|
+
<Stack direction=
|
|
283
|
+
```
|
|
284
|
+
```tsx
|
|
285
|
+
<Stack direction=
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
**Acessibilidade:**
|
|
289
|
+
- Layout responsivo automático
|
|
290
|
+
- Suporte a grid fixo e adaptativo
|
|
291
|
+
- Espaçamentos padronizados
|
|
292
|
+
- Props intuitivas e type-safe
|
|
293
|
+
|
|
294
|
+
**Notas:**
|
|
295
|
+
- **Grid** é ideal para layouts de cards, galerias e grids de conteúdo
|
|
296
|
+
- **Stack** é ideal para listas, formulários e layouts flexíveis
|
|
297
|
+
- Ambos suportam espaçamentos padronizados (xs, sm, md, lg, xl)
|
|
298
|
+
|
|
299
|
+
> Fonte: `src/design-system/docs/components/GridDoc.tsx`
|
|
252
300
|
|
|
253
301
|
---
|
|
254
302
|
|
|
@@ -258,24 +306,24 @@ Painéis redimensionáveis para criar layouts flexíveis e adaptáveis. Baseado
|
|
|
258
306
|
|
|
259
307
|
**Uso:**
|
|
260
308
|
```tsx
|
|
261
|
-
import {
|
|
262
|
-
ResizablePanelGroup,
|
|
263
|
-
ResizablePanel,
|
|
264
|
-
ResizableHandle
|
|
265
|
-
} from 'forlogic-core/modular';
|
|
266
|
-
|
|
267
|
-
function ResizableLayout() {
|
|
268
|
-
return (
|
|
269
|
-
<ResizablePanelGroup direction="horizontal" className="min-h-[200px]">
|
|
270
|
-
<ResizablePanel defaultSize={25}>
|
|
271
|
-
<div className="p-4">Painel Esquerdo</div>
|
|
272
|
-
</ResizablePanel>
|
|
273
|
-
<ResizableHandle withHandle />
|
|
274
|
-
<ResizablePanel defaultSize={75}>
|
|
275
|
-
<div className="p-4">Painel Direito</div>
|
|
276
|
-
</ResizablePanel>
|
|
277
|
-
</ResizablePanelGroup>
|
|
278
|
-
);
|
|
309
|
+
import {
|
|
310
|
+
ResizablePanelGroup,
|
|
311
|
+
ResizablePanel,
|
|
312
|
+
ResizableHandle
|
|
313
|
+
} from 'forlogic-core/modular';
|
|
314
|
+
|
|
315
|
+
function ResizableLayout() {
|
|
316
|
+
return (
|
|
317
|
+
<ResizablePanelGroup direction="horizontal" className="min-h-[200px]">
|
|
318
|
+
<ResizablePanel defaultSize={25}>
|
|
319
|
+
<div className="p-4">Painel Esquerdo</div>
|
|
320
|
+
</ResizablePanel>
|
|
321
|
+
<ResizableHandle withHandle />
|
|
322
|
+
<ResizablePanel defaultSize={75}>
|
|
323
|
+
<div className="p-4">Painel Direito</div>
|
|
324
|
+
</ResizablePanel>
|
|
325
|
+
</ResizablePanelGroup>
|
|
326
|
+
);
|
|
279
327
|
}
|
|
280
328
|
```
|
|
281
329
|
|
|
@@ -292,7 +340,7 @@ function ResizableLayout() {
|
|
|
292
340
|
- A soma de defaultSize dos painéis deve ser 100.
|
|
293
341
|
- Combine com hooks de resize (useColumnResize, useSidebarResize) para casos específicos.
|
|
294
342
|
|
|
295
|
-
> Fonte: `src
|
|
343
|
+
> Fonte: `src/design-system/docs/components/ResizableDoc.tsx`
|
|
296
344
|
|
|
297
345
|
---
|
|
298
346
|
|
|
@@ -302,24 +350,24 @@ function ResizableLayout() {
|
|
|
302
350
|
|
|
303
351
|
**Uso:**
|
|
304
352
|
```tsx
|
|
305
|
-
import { ScrollArea, ScrollBar } from "forlogic-core"
|
|
306
|
-
|
|
307
|
-
<ScrollArea className="h-72 w-48 rounded-md border">
|
|
308
|
-
<div className="p-4">
|
|
309
|
-
{items.map((item) => (
|
|
310
|
-
<div key={item.id}>{item.content}</div>
|
|
311
|
-
))}
|
|
312
|
-
</div>
|
|
313
|
-
</ScrollArea>
|
|
314
|
-
|
|
315
|
-
// Scroll horizontal:
|
|
316
|
-
<ScrollArea className="w-96 whitespace-nowrap rounded-md border">
|
|
317
|
-
<div className="flex w-max space-x-4 p-4">
|
|
318
|
-
{items.map((item) => (
|
|
319
|
-
<div key={item.id} className="w-[150px] shrink-0">{item.content}</div>
|
|
320
|
-
))}
|
|
321
|
-
</div>
|
|
322
|
-
<ScrollBar orientation="horizontal" />
|
|
353
|
+
import { ScrollArea, ScrollBar } from "forlogic-core"
|
|
354
|
+
|
|
355
|
+
<ScrollArea className="h-72 w-48 rounded-md border">
|
|
356
|
+
<div className="p-4">
|
|
357
|
+
{items.map((item) => (
|
|
358
|
+
<div key={item.id}>{item.content}</div>
|
|
359
|
+
))}
|
|
360
|
+
</div>
|
|
361
|
+
</ScrollArea>
|
|
362
|
+
|
|
363
|
+
// Scroll horizontal:
|
|
364
|
+
<ScrollArea className="w-96 whitespace-nowrap rounded-md border">
|
|
365
|
+
<div className="flex w-max space-x-4 p-4">
|
|
366
|
+
{items.map((item) => (
|
|
367
|
+
<div key={item.id} className="w-[150px] shrink-0">{item.content}</div>
|
|
368
|
+
))}
|
|
369
|
+
</div>
|
|
370
|
+
<ScrollBar orientation="horizontal" />
|
|
323
371
|
</ScrollArea>
|
|
324
372
|
```
|
|
325
373
|
|
|
@@ -346,6 +394,6 @@ import { ScrollArea, ScrollBar } from "forlogic-core"
|
|
|
346
394
|
- Usado internamente pela DesignSystemSidebar, AppSidebar, e outros componentes com overflow.
|
|
347
395
|
- Mantém bordas arredondadas do container pai (rounded-[inherit]).
|
|
348
396
|
|
|
349
|
-
> Fonte: `src
|
|
397
|
+
> Fonte: `src/design-system/docs/components/ScrollAreaDoc.tsx`
|
|
350
398
|
|
|
351
399
|
---
|