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,30 +11,30 @@ Componente de seleção hierárquica (tree view) com busca recursiva, expansão
|
|
|
11
11
|
|
|
12
12
|
**Uso:**
|
|
13
13
|
```tsx
|
|
14
|
-
import { ComboTree, type ComboTreeOption } from 'forlogic-core';
|
|
15
|
-
// 💡 Alias disponível: import { TreeSelect, type TreeSelectProps } from 'forlogic-core';
|
|
16
|
-
import { Folder, FolderOpen, FileText } from 'lucide-react';
|
|
17
|
-
|
|
18
|
-
const options: ComboTreeOption[] = [
|
|
19
|
-
{
|
|
20
|
-
value: 'quality',
|
|
21
|
-
label: 'Qualidade',
|
|
22
|
-
icon: Folder,
|
|
23
|
-
iconOpen: FolderOpen,
|
|
24
|
-
children: [
|
|
25
|
-
{ value: 'docs', label: 'Documentos', icon: FileText },
|
|
26
|
-
{ value: 'occurrences', label: 'Ocorrências', icon: FileText },
|
|
27
|
-
],
|
|
28
|
-
},
|
|
29
|
-
{ value: 'hr', label: 'RH' },
|
|
30
|
-
];
|
|
31
|
-
|
|
32
|
-
<ComboTree
|
|
33
|
-
options={options}
|
|
34
|
-
value={selected}
|
|
35
|
-
onChange={setSelected}
|
|
36
|
-
label="Departamento"
|
|
37
|
-
placeholder="Selecione..."
|
|
14
|
+
import { ComboTree, type ComboTreeOption } from 'forlogic-core';
|
|
15
|
+
// 💡 Alias disponível: import { TreeSelect, type TreeSelectProps } from 'forlogic-core';
|
|
16
|
+
import { Folder, FolderOpen, FileText } from 'lucide-react';
|
|
17
|
+
|
|
18
|
+
const options: ComboTreeOption[] = [
|
|
19
|
+
{
|
|
20
|
+
value: 'quality',
|
|
21
|
+
label: 'Qualidade',
|
|
22
|
+
icon: Folder,
|
|
23
|
+
iconOpen: FolderOpen,
|
|
24
|
+
children: [
|
|
25
|
+
{ value: 'docs', label: 'Documentos', icon: FileText },
|
|
26
|
+
{ value: 'occurrences', label: 'Ocorrências', icon: FileText },
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
{ value: 'hr', label: 'RH' },
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
<ComboTree
|
|
33
|
+
options={options}
|
|
34
|
+
value={selected}
|
|
35
|
+
onChange={setSelected}
|
|
36
|
+
label="Departamento"
|
|
37
|
+
placeholder="Selecione..."
|
|
38
38
|
/>
|
|
39
39
|
```
|
|
40
40
|
|
|
@@ -47,12 +47,14 @@ const options: ComboTreeOption[] = [
|
|
|
47
47
|
**Notas:**
|
|
48
48
|
- 💡 Alias: Também disponível como
|
|
49
49
|
- — import { TreeSelect } from
|
|
50
|
-
- ,
|
|
50
|
+
- ,
|
|
51
51
|
|
|
52
|
-
- ,
|
|
52
|
+
- ,
|
|
53
|
+
|
|
54
|
+
- ,
|
|
53
55
|
|
|
54
56
|
|
|
55
|
-
> Fonte: `src
|
|
57
|
+
> Fonte: `src/design-system/docs/components/ComboTreeDoc.tsx`
|
|
56
58
|
|
|
57
59
|
---
|
|
58
60
|
|
|
@@ -62,139 +64,139 @@ Componente versátil para seleção única ou múltipla com busca inteligente. C
|
|
|
62
64
|
|
|
63
65
|
**Uso:**
|
|
64
66
|
```tsx
|
|
65
|
-
import { Combobox } from "forlogic-core"
|
|
66
|
-
|
|
67
|
-
const options = [
|
|
68
|
-
{ value: 'next.js', label: 'Next.js' },
|
|
69
|
-
{ value: 'sveltekit', label: 'SvelteKit' },
|
|
70
|
-
]
|
|
71
|
-
|
|
72
|
-
// Seleção única
|
|
73
|
-
<Combobox
|
|
74
|
-
options={options}
|
|
75
|
-
value={selected}
|
|
76
|
-
onChange={setSelected}
|
|
77
|
-
placeholder="Select..."
|
|
78
|
-
/>
|
|
79
|
-
|
|
80
|
-
// Seleção múltipla
|
|
81
|
-
<Combobox
|
|
82
|
-
multiple
|
|
83
|
-
options={options}
|
|
84
|
-
value={selectedArray}
|
|
85
|
-
onChange={setSelectedArray}
|
|
86
|
-
placeholder="Select multiple..."
|
|
87
|
-
/>
|
|
88
|
-
|
|
89
|
-
// =====================
|
|
90
|
-
// POPOVER COM COMMAND
|
|
91
|
-
// =====================
|
|
92
|
-
import { Popover, PopoverTrigger, PopoverContent, Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, Button } from "forlogic-core"
|
|
93
|
-
|
|
94
|
-
<Popover open={open} onOpenChange={setOpen}>
|
|
95
|
-
<PopoverTrigger asChild>
|
|
96
|
-
<Button variant="outline">
|
|
97
|
-
{selectedStatus ? selectedStatus.label : "+ Definir status"}
|
|
98
|
-
</Button>
|
|
99
|
-
</PopoverTrigger>
|
|
100
|
-
<PopoverContent className="p-0 bg-popover" side="right" align="start">
|
|
101
|
-
<Command>
|
|
102
|
-
<CommandInput placeholder="Alterar status..." />
|
|
103
|
-
<CommandList>
|
|
104
|
-
<CommandEmpty>Nenhum resultado.</CommandEmpty>
|
|
105
|
-
<CommandGroup>
|
|
106
|
-
{statuses.map((status) => (
|
|
107
|
-
<CommandItem
|
|
108
|
-
key={status.value}
|
|
109
|
-
value={status.value}
|
|
110
|
-
onSelect={(value) => {
|
|
111
|
-
setSelectedStatus(statuses.find((s) => s.value === value))
|
|
112
|
-
setOpen(false)
|
|
113
|
-
}}
|
|
114
|
-
>
|
|
115
|
-
{status.label}
|
|
116
|
-
</CommandItem>
|
|
117
|
-
))}
|
|
118
|
-
</CommandGroup>
|
|
119
|
-
</CommandList>
|
|
120
|
-
</Command>
|
|
121
|
-
</PopoverContent>
|
|
122
|
-
</Popover>
|
|
123
|
-
|
|
124
|
-
// =====================
|
|
125
|
-
// DROPDOWN MENU COM COMMAND
|
|
126
|
-
// =====================
|
|
127
|
-
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent } from "forlogic-core"
|
|
128
|
-
|
|
129
|
-
<DropdownMenu open={open} onOpenChange={setOpen}>
|
|
130
|
-
<DropdownMenuTrigger asChild>
|
|
131
|
-
<Button variant="ghost" size="sm">
|
|
132
|
-
<MoreVertical className="h-4 w-4" />
|
|
133
|
-
</Button>
|
|
134
|
-
</DropdownMenuTrigger>
|
|
135
|
-
<DropdownMenuContent align="end" className="w-[200px] bg-popover">
|
|
136
|
-
<DropdownMenuLabel>Ações</DropdownMenuLabel>
|
|
137
|
-
<DropdownMenuSeparator />
|
|
138
|
-
<DropdownMenuSub>
|
|
139
|
-
<DropdownMenuSubTrigger>Aplicar label</DropdownMenuSubTrigger>
|
|
140
|
-
<DropdownMenuSubContent className="p-0 bg-popover">
|
|
141
|
-
<Command>
|
|
142
|
-
<CommandInput placeholder="Filtrar label..." />
|
|
143
|
-
<CommandList>
|
|
144
|
-
<CommandEmpty>Nenhum label encontrado.</CommandEmpty>
|
|
145
|
-
<CommandGroup>
|
|
146
|
-
{labels.map((label) => (
|
|
147
|
-
<CommandItem
|
|
148
|
-
key={label}
|
|
149
|
-
value={label}
|
|
150
|
-
onSelect={(value) => {
|
|
151
|
-
setLabel(value)
|
|
152
|
-
setOpen(false)
|
|
153
|
-
}}
|
|
154
|
-
>
|
|
155
|
-
{label}
|
|
156
|
-
</CommandItem>
|
|
157
|
-
))}
|
|
158
|
-
</CommandGroup>
|
|
159
|
-
</CommandList>
|
|
160
|
-
</Command>
|
|
161
|
-
</DropdownMenuSubContent>
|
|
162
|
-
</DropdownMenuSub>
|
|
163
|
-
</DropdownMenuContent>
|
|
164
|
-
</DropdownMenu>
|
|
165
|
-
|
|
166
|
-
// =====================
|
|
167
|
-
// RESPONSIVO (Popover/Drawer)
|
|
168
|
-
// =====================
|
|
169
|
-
import { useMediaQuery } from "@/design-system/hooks/useMediaQuery"
|
|
170
|
-
import { Drawer, DrawerTrigger, DrawerContent } from "forlogic-core"
|
|
171
|
-
|
|
172
|
-
function ResponsiveCombobox() {
|
|
173
|
-
const isDesktop = useMediaQuery("(min-width: 768px)")
|
|
174
|
-
|
|
175
|
-
if (isDesktop) {
|
|
176
|
-
return (
|
|
177
|
-
<Popover>
|
|
178
|
-
<PopoverTrigger asChild>
|
|
179
|
-
<Button>Definir status</Button>
|
|
180
|
-
</PopoverTrigger>
|
|
181
|
-
<PopoverContent className="p-0 bg-popover">
|
|
182
|
-
<StatusList />
|
|
183
|
-
</PopoverContent>
|
|
184
|
-
</Popover>
|
|
185
|
-
)
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
return (
|
|
189
|
-
<Drawer>
|
|
190
|
-
<DrawerTrigger asChild>
|
|
191
|
-
<Button>Definir status</Button>
|
|
192
|
-
</DrawerTrigger>
|
|
193
|
-
<DrawerContent>
|
|
194
|
-
<StatusList />
|
|
195
|
-
</DrawerContent>
|
|
196
|
-
</Drawer>
|
|
197
|
-
)
|
|
67
|
+
import { Combobox } from "forlogic-core"
|
|
68
|
+
|
|
69
|
+
const options = [
|
|
70
|
+
{ value: 'next.js', label: 'Next.js' },
|
|
71
|
+
{ value: 'sveltekit', label: 'SvelteKit' },
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
// Seleção única
|
|
75
|
+
<Combobox
|
|
76
|
+
options={options}
|
|
77
|
+
value={selected}
|
|
78
|
+
onChange={setSelected}
|
|
79
|
+
placeholder="Select..."
|
|
80
|
+
/>
|
|
81
|
+
|
|
82
|
+
// Seleção múltipla
|
|
83
|
+
<Combobox
|
|
84
|
+
multiple
|
|
85
|
+
options={options}
|
|
86
|
+
value={selectedArray}
|
|
87
|
+
onChange={setSelectedArray}
|
|
88
|
+
placeholder="Select multiple..."
|
|
89
|
+
/>
|
|
90
|
+
|
|
91
|
+
// =====================
|
|
92
|
+
// POPOVER COM COMMAND
|
|
93
|
+
// =====================
|
|
94
|
+
import { Popover, PopoverTrigger, PopoverContent, Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, Button } from "forlogic-core"
|
|
95
|
+
|
|
96
|
+
<Popover open={open} onOpenChange={setOpen}>
|
|
97
|
+
<PopoverTrigger asChild>
|
|
98
|
+
<Button variant="outline">
|
|
99
|
+
{selectedStatus ? selectedStatus.label : "+ Definir status"}
|
|
100
|
+
</Button>
|
|
101
|
+
</PopoverTrigger>
|
|
102
|
+
<PopoverContent className="p-0 bg-popover" side="right" align="start">
|
|
103
|
+
<Command>
|
|
104
|
+
<CommandInput placeholder="Alterar status..." />
|
|
105
|
+
<CommandList>
|
|
106
|
+
<CommandEmpty>Nenhum resultado.</CommandEmpty>
|
|
107
|
+
<CommandGroup>
|
|
108
|
+
{statuses.map((status) => (
|
|
109
|
+
<CommandItem
|
|
110
|
+
key={status.value}
|
|
111
|
+
value={status.value}
|
|
112
|
+
onSelect={(value) => {
|
|
113
|
+
setSelectedStatus(statuses.find((s) => s.value === value))
|
|
114
|
+
setOpen(false)
|
|
115
|
+
}}
|
|
116
|
+
>
|
|
117
|
+
{status.label}
|
|
118
|
+
</CommandItem>
|
|
119
|
+
))}
|
|
120
|
+
</CommandGroup>
|
|
121
|
+
</CommandList>
|
|
122
|
+
</Command>
|
|
123
|
+
</PopoverContent>
|
|
124
|
+
</Popover>
|
|
125
|
+
|
|
126
|
+
// =====================
|
|
127
|
+
// DROPDOWN MENU COM COMMAND
|
|
128
|
+
// =====================
|
|
129
|
+
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent } from "forlogic-core"
|
|
130
|
+
|
|
131
|
+
<DropdownMenu open={open} onOpenChange={setOpen}>
|
|
132
|
+
<DropdownMenuTrigger asChild>
|
|
133
|
+
<Button variant="ghost" size="sm">
|
|
134
|
+
<MoreVertical className="h-4 w-4" />
|
|
135
|
+
</Button>
|
|
136
|
+
</DropdownMenuTrigger>
|
|
137
|
+
<DropdownMenuContent align="end" className="w-[200px] bg-popover">
|
|
138
|
+
<DropdownMenuLabel>Ações</DropdownMenuLabel>
|
|
139
|
+
<DropdownMenuSeparator />
|
|
140
|
+
<DropdownMenuSub>
|
|
141
|
+
<DropdownMenuSubTrigger>Aplicar label</DropdownMenuSubTrigger>
|
|
142
|
+
<DropdownMenuSubContent className="p-0 bg-popover">
|
|
143
|
+
<Command>
|
|
144
|
+
<CommandInput placeholder="Filtrar label..." />
|
|
145
|
+
<CommandList>
|
|
146
|
+
<CommandEmpty>Nenhum label encontrado.</CommandEmpty>
|
|
147
|
+
<CommandGroup>
|
|
148
|
+
{labels.map((label) => (
|
|
149
|
+
<CommandItem
|
|
150
|
+
key={label}
|
|
151
|
+
value={label}
|
|
152
|
+
onSelect={(value) => {
|
|
153
|
+
setLabel(value)
|
|
154
|
+
setOpen(false)
|
|
155
|
+
}}
|
|
156
|
+
>
|
|
157
|
+
{label}
|
|
158
|
+
</CommandItem>
|
|
159
|
+
))}
|
|
160
|
+
</CommandGroup>
|
|
161
|
+
</CommandList>
|
|
162
|
+
</Command>
|
|
163
|
+
</DropdownMenuSubContent>
|
|
164
|
+
</DropdownMenuSub>
|
|
165
|
+
</DropdownMenuContent>
|
|
166
|
+
</DropdownMenu>
|
|
167
|
+
|
|
168
|
+
// =====================
|
|
169
|
+
// RESPONSIVO (Popover/Drawer)
|
|
170
|
+
// =====================
|
|
171
|
+
import { useMediaQuery } from "@/design-system/hooks/useMediaQuery"
|
|
172
|
+
import { Drawer, DrawerTrigger, DrawerContent } from "forlogic-core"
|
|
173
|
+
|
|
174
|
+
function ResponsiveCombobox() {
|
|
175
|
+
const isDesktop = useMediaQuery("(min-width: 768px)")
|
|
176
|
+
|
|
177
|
+
if (isDesktop) {
|
|
178
|
+
return (
|
|
179
|
+
<Popover>
|
|
180
|
+
<PopoverTrigger asChild>
|
|
181
|
+
<Button>Definir status</Button>
|
|
182
|
+
</PopoverTrigger>
|
|
183
|
+
<PopoverContent className="p-0 bg-popover">
|
|
184
|
+
<StatusList />
|
|
185
|
+
</PopoverContent>
|
|
186
|
+
</Popover>
|
|
187
|
+
)
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return (
|
|
191
|
+
<Drawer>
|
|
192
|
+
<DrawerTrigger asChild>
|
|
193
|
+
<Button>Definir status</Button>
|
|
194
|
+
</DrawerTrigger>
|
|
195
|
+
<DrawerContent>
|
|
196
|
+
<StatusList />
|
|
197
|
+
</DrawerContent>
|
|
198
|
+
</Drawer>
|
|
199
|
+
)
|
|
198
200
|
}
|
|
199
201
|
```
|
|
200
202
|
|
|
@@ -209,10 +211,10 @@ function ResponsiveCombobox() {
|
|
|
209
211
|
**Notas:**
|
|
210
212
|
- 💡 Alias: Também disponível como
|
|
211
213
|
- — import { AutoComplete } from
|
|
212
|
-
- ,
|
|
214
|
+
- ,
|
|
213
215
|
|
|
214
216
|
|
|
215
|
-
> Fonte: `src
|
|
217
|
+
> Fonte: `src/design-system/docs/components/ComboboxDoc.tsx`
|
|
216
218
|
|
|
217
219
|
---
|
|
218
220
|
|
|
@@ -222,30 +224,30 @@ Componente de seleção hierárquica (tree view) com busca recursiva, expansão
|
|
|
222
224
|
|
|
223
225
|
**Uso:**
|
|
224
226
|
```tsx
|
|
225
|
-
import { ComboTree, type ComboTreeOption } from 'forlogic-core';
|
|
226
|
-
// 💡 Alias disponível: import { TreeSelect, type TreeSelectProps } from 'forlogic-core';
|
|
227
|
-
import { Folder, FolderOpen, FileText } from 'lucide-react';
|
|
228
|
-
|
|
229
|
-
const options: ComboTreeOption[] = [
|
|
230
|
-
{
|
|
231
|
-
value: 'quality',
|
|
232
|
-
label: 'Qualidade',
|
|
233
|
-
icon: Folder,
|
|
234
|
-
iconOpen: FolderOpen,
|
|
235
|
-
children: [
|
|
236
|
-
{ value: 'docs', label: 'Documentos', icon: FileText },
|
|
237
|
-
{ value: 'occurrences', label: 'Ocorrências', icon: FileText },
|
|
238
|
-
],
|
|
239
|
-
},
|
|
240
|
-
{ value: 'hr', label: 'RH' },
|
|
241
|
-
];
|
|
242
|
-
|
|
243
|
-
<ComboTree
|
|
244
|
-
options={options}
|
|
245
|
-
value={selected}
|
|
246
|
-
onChange={setSelected}
|
|
247
|
-
label="Departamento"
|
|
248
|
-
placeholder="Selecione..."
|
|
227
|
+
import { ComboTree, type ComboTreeOption } from 'forlogic-core';
|
|
228
|
+
// 💡 Alias disponível: import { TreeSelect, type TreeSelectProps } from 'forlogic-core';
|
|
229
|
+
import { Folder, FolderOpen, FileText } from 'lucide-react';
|
|
230
|
+
|
|
231
|
+
const options: ComboTreeOption[] = [
|
|
232
|
+
{
|
|
233
|
+
value: 'quality',
|
|
234
|
+
label: 'Qualidade',
|
|
235
|
+
icon: Folder,
|
|
236
|
+
iconOpen: FolderOpen,
|
|
237
|
+
children: [
|
|
238
|
+
{ value: 'docs', label: 'Documentos', icon: FileText },
|
|
239
|
+
{ value: 'occurrences', label: 'Ocorrências', icon: FileText },
|
|
240
|
+
],
|
|
241
|
+
},
|
|
242
|
+
{ value: 'hr', label: 'RH' },
|
|
243
|
+
];
|
|
244
|
+
|
|
245
|
+
<ComboTree
|
|
246
|
+
options={options}
|
|
247
|
+
value={selected}
|
|
248
|
+
onChange={setSelected}
|
|
249
|
+
label="Departamento"
|
|
250
|
+
placeholder="Selecione..."
|
|
249
251
|
/>
|
|
250
252
|
```
|
|
251
253
|
|
|
@@ -258,12 +260,14 @@ const options: ComboTreeOption[] = [
|
|
|
258
260
|
**Notas:**
|
|
259
261
|
- 💡 Alias: Também disponível como
|
|
260
262
|
- — import { TreeSelect } from
|
|
261
|
-
- ,
|
|
263
|
+
- ,
|
|
262
264
|
|
|
263
|
-
- ,
|
|
265
|
+
- ,
|
|
266
|
+
|
|
267
|
+
- ,
|
|
264
268
|
|
|
265
269
|
|
|
266
|
-
> Fonte: `src
|
|
270
|
+
> Fonte: `src/design-system/docs/components/ComboTreeDoc.tsx`
|
|
267
271
|
|
|
268
272
|
---
|
|
269
273
|
|
|
@@ -273,15 +277,15 @@ Seletor de cores com paleta predefinida e seletor customizado.
|
|
|
273
277
|
|
|
274
278
|
**Uso:**
|
|
275
279
|
```tsx
|
|
276
|
-
import { ColorPicker } from "forlogic-core"
|
|
277
|
-
import { useState } from 'react'
|
|
278
|
-
|
|
279
|
-
const [color, setColor] = useState('#3b82f6')
|
|
280
|
-
|
|
281
|
-
<ColorPicker
|
|
282
|
-
value={color}
|
|
283
|
-
onChange={setColor}
|
|
284
|
-
label="Escolha uma cor"
|
|
280
|
+
import { ColorPicker } from "forlogic-core"
|
|
281
|
+
import { useState } from 'react'
|
|
282
|
+
|
|
283
|
+
const [color, setColor] = useState('#3b82f6')
|
|
284
|
+
|
|
285
|
+
<ColorPicker
|
|
286
|
+
value={color}
|
|
287
|
+
onChange={setColor}
|
|
288
|
+
label="Escolha uma cor"
|
|
285
289
|
/>
|
|
286
290
|
```
|
|
287
291
|
|
|
@@ -298,7 +302,7 @@ const [color, setColor] = useState('#3b82f6')
|
|
|
298
302
|
- Labels descritivos para cores predefinidas
|
|
299
303
|
- Navegação por teclado completa
|
|
300
304
|
|
|
301
|
-
> Fonte: `src
|
|
305
|
+
> Fonte: `src/design-system/docs/components/ColorPickerDoc.tsx`
|
|
302
306
|
|
|
303
307
|
---
|
|
304
308
|
|
|
@@ -308,15 +312,15 @@ Seletor de ícones Material Symbols Outlined com opção 'sem ícone'.
|
|
|
308
312
|
|
|
309
313
|
**Uso:**
|
|
310
314
|
```tsx
|
|
311
|
-
import { IconPicker } from "forlogic-core"
|
|
312
|
-
import { useState } from 'react'
|
|
313
|
-
|
|
314
|
-
const [icon, setIcon] = useState<string | null>('star_rate')
|
|
315
|
-
|
|
316
|
-
<IconPicker
|
|
317
|
-
value={icon}
|
|
318
|
-
onChange={setIcon}
|
|
319
|
-
label="Escolha um ícone"
|
|
315
|
+
import { IconPicker } from "forlogic-core"
|
|
316
|
+
import { useState } from 'react'
|
|
317
|
+
|
|
318
|
+
const [icon, setIcon] = useState<string | null>('star_rate')
|
|
319
|
+
|
|
320
|
+
<IconPicker
|
|
321
|
+
value={icon}
|
|
322
|
+
onChange={setIcon}
|
|
323
|
+
label="Escolha um ícone"
|
|
320
324
|
/>
|
|
321
325
|
```
|
|
322
326
|
|
|
@@ -334,7 +338,7 @@ const [icon, setIcon] = useState<string | null>('star_rate')
|
|
|
334
338
|
- Scroll area com navegação adequada
|
|
335
339
|
- Opção para remover ícone selecionado
|
|
336
340
|
|
|
337
|
-
> Fonte: `src
|
|
341
|
+
> Fonte: `src/design-system/docs/components/IconPickerDoc.tsx`
|
|
338
342
|
|
|
339
343
|
---
|
|
340
344
|
|
|
@@ -344,24 +348,24 @@ Componentes para seleção de datas. O Calendar exibe um calendário interativo,
|
|
|
344
348
|
|
|
345
349
|
**Uso:**
|
|
346
350
|
```tsx
|
|
347
|
-
import { Calendar, DatePicker } from "forlogic-core"
|
|
348
|
-
import { useState } from "react"
|
|
349
|
-
|
|
350
|
-
// Calendar
|
|
351
|
-
const [date, setDate] = useState<Date | undefined>(new Date())
|
|
352
|
-
|
|
353
|
-
<Calendar
|
|
354
|
-
mode="single"
|
|
355
|
-
selected={date}
|
|
356
|
-
onSelect={setDate}
|
|
357
|
-
className="rounded-md border"
|
|
358
|
-
/>
|
|
359
|
-
|
|
360
|
-
// Date Picker
|
|
361
|
-
<DatePicker
|
|
362
|
-
date={date}
|
|
363
|
-
onDateChange={setDate}
|
|
364
|
-
placeholder="Selecione uma data"
|
|
351
|
+
import { Calendar, DatePicker } from "forlogic-core"
|
|
352
|
+
import { useState } from "react"
|
|
353
|
+
|
|
354
|
+
// Calendar
|
|
355
|
+
const [date, setDate] = useState<Date | undefined>(new Date())
|
|
356
|
+
|
|
357
|
+
<Calendar
|
|
358
|
+
mode="single"
|
|
359
|
+
selected={date}
|
|
360
|
+
onSelect={setDate}
|
|
361
|
+
className="rounded-md border"
|
|
362
|
+
/>
|
|
363
|
+
|
|
364
|
+
// Date Picker
|
|
365
|
+
<DatePicker
|
|
366
|
+
date={date}
|
|
367
|
+
onDateChange={setDate}
|
|
368
|
+
placeholder="Selecione uma data"
|
|
365
369
|
/>
|
|
366
370
|
```
|
|
367
371
|
|
|
@@ -372,7 +376,7 @@ const [date, setDate] = useState<Date | undefined>(new Date())
|
|
|
372
376
|
- Labels e roles ARIA apropriados
|
|
373
377
|
- Gerenciamento de foco adequado
|
|
374
378
|
|
|
375
|
-
> Fonte: `src
|
|
379
|
+
> Fonte: `src/design-system/docs/components/CalendarDoc.tsx`
|
|
376
380
|
|
|
377
381
|
---
|
|
378
382
|
|
|
@@ -382,12 +386,12 @@ Indica o progresso de preenchimento de campos obrigatórios em formulários com
|
|
|
382
386
|
|
|
383
387
|
**Uso:**
|
|
384
388
|
```tsx
|
|
385
|
-
import { RequiredFieldsCounter } from "@/design-system/components/RequiredFieldsCounter"
|
|
386
|
-
|
|
387
|
-
// Progresso parcial
|
|
388
|
-
<RequiredFieldsCounter filled={2} total={5} />
|
|
389
|
-
|
|
390
|
-
// Formulário completo
|
|
389
|
+
import { RequiredFieldsCounter } from "@/design-system/components/RequiredFieldsCounter"
|
|
390
|
+
|
|
391
|
+
// Progresso parcial
|
|
392
|
+
<RequiredFieldsCounter filled={2} total={5} />
|
|
393
|
+
|
|
394
|
+
// Formulário completo
|
|
391
395
|
<RequiredFieldsCounter filled={5} total={5} />
|
|
392
396
|
```
|
|
393
397
|
|
|
@@ -416,9 +420,9 @@ import { RequiredFieldsCounter } from "@/design-system/components/RequiredFields
|
|
|
416
420
|
- definida no tailwind.config.ts
|
|
417
421
|
- Importar de
|
|
418
422
|
- ou diretamente de
|
|
419
|
-
- ,
|
|
423
|
+
- ,
|
|
420
424
|
|
|
421
425
|
|
|
422
|
-
> Fonte: `src
|
|
426
|
+
> Fonte: `src/design-system/docs/components/RequiredFieldsCounterDoc.tsx`
|
|
423
427
|
|
|
424
428
|
---
|