forlogic-core 2.1.3 → 2.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +68 -68
- package/dist/action-plans/components/ActionPlanStatusBadge.d.ts +6 -2
- package/dist/components/ui/__tests__/status-badge.test.d.ts +1 -0
- package/dist/components/ui/status-badge.d.ts +49 -0
- package/dist/crud/primitives/Table.d.ts +1 -1
- package/dist/crud/primitives/types.d.ts +6 -0
- package/dist/exports/crud.d.ts +5 -0
- package/dist/exports/ui.d.ts +1 -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/utils/color.d.ts +26 -0
- package/dist/utils/index.d.ts +1 -0
- package/docs/PUBLISH.md +168 -0
- package/docs/WORKSPACE_KNOWLEDGE.md +119 -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 +39 -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 +236 -236
- package/docs/design-system/tables-grids.md +95 -38
- package/package.json +144 -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,12 @@ 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
53
|
|
|
54
54
|
|
|
55
|
-
> Fonte: `src
|
|
55
|
+
> Fonte: `src/design-system/docs/components/ComboTreeDoc.tsx`
|
|
56
56
|
|
|
57
57
|
---
|
|
58
58
|
|
|
@@ -62,139 +62,139 @@ Componente versátil para seleção única ou múltipla com busca inteligente. C
|
|
|
62
62
|
|
|
63
63
|
**Uso:**
|
|
64
64
|
```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
|
-
)
|
|
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
|
+
)
|
|
198
198
|
}
|
|
199
199
|
```
|
|
200
200
|
|
|
@@ -209,10 +209,10 @@ function ResponsiveCombobox() {
|
|
|
209
209
|
**Notas:**
|
|
210
210
|
- 💡 Alias: Também disponível como
|
|
211
211
|
- — import { AutoComplete } from
|
|
212
|
-
- ,
|
|
212
|
+
- ,
|
|
213
213
|
|
|
214
214
|
|
|
215
|
-
> Fonte: `src
|
|
215
|
+
> Fonte: `src/design-system/docs/components/ComboboxDoc.tsx`
|
|
216
216
|
|
|
217
217
|
---
|
|
218
218
|
|
|
@@ -222,30 +222,30 @@ Componente de seleção hierárquica (tree view) com busca recursiva, expansão
|
|
|
222
222
|
|
|
223
223
|
**Uso:**
|
|
224
224
|
```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..."
|
|
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..."
|
|
249
249
|
/>
|
|
250
250
|
```
|
|
251
251
|
|
|
@@ -258,12 +258,12 @@ const options: ComboTreeOption[] = [
|
|
|
258
258
|
**Notas:**
|
|
259
259
|
- 💡 Alias: Também disponível como
|
|
260
260
|
- — import { TreeSelect } from
|
|
261
|
-
- ,
|
|
261
|
+
- ,
|
|
262
262
|
|
|
263
|
-
- ,
|
|
263
|
+
- ,
|
|
264
264
|
|
|
265
265
|
|
|
266
|
-
> Fonte: `src
|
|
266
|
+
> Fonte: `src/design-system/docs/components/ComboTreeDoc.tsx`
|
|
267
267
|
|
|
268
268
|
---
|
|
269
269
|
|
|
@@ -273,15 +273,15 @@ Seletor de cores com paleta predefinida e seletor customizado.
|
|
|
273
273
|
|
|
274
274
|
**Uso:**
|
|
275
275
|
```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"
|
|
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"
|
|
285
285
|
/>
|
|
286
286
|
```
|
|
287
287
|
|
|
@@ -298,7 +298,7 @@ const [color, setColor] = useState('#3b82f6')
|
|
|
298
298
|
- Labels descritivos para cores predefinidas
|
|
299
299
|
- Navegação por teclado completa
|
|
300
300
|
|
|
301
|
-
> Fonte: `src
|
|
301
|
+
> Fonte: `src/design-system/docs/components/ColorPickerDoc.tsx`
|
|
302
302
|
|
|
303
303
|
---
|
|
304
304
|
|
|
@@ -308,15 +308,15 @@ Seletor de ícones Material Symbols Outlined com opção 'sem ícone'.
|
|
|
308
308
|
|
|
309
309
|
**Uso:**
|
|
310
310
|
```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"
|
|
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"
|
|
320
320
|
/>
|
|
321
321
|
```
|
|
322
322
|
|
|
@@ -334,7 +334,7 @@ const [icon, setIcon] = useState<string | null>('star_rate')
|
|
|
334
334
|
- Scroll area com navegação adequada
|
|
335
335
|
- Opção para remover ícone selecionado
|
|
336
336
|
|
|
337
|
-
> Fonte: `src
|
|
337
|
+
> Fonte: `src/design-system/docs/components/IconPickerDoc.tsx`
|
|
338
338
|
|
|
339
339
|
---
|
|
340
340
|
|
|
@@ -344,24 +344,24 @@ Componentes para seleção de datas. O Calendar exibe um calendário interativo,
|
|
|
344
344
|
|
|
345
345
|
**Uso:**
|
|
346
346
|
```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"
|
|
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"
|
|
365
365
|
/>
|
|
366
366
|
```
|
|
367
367
|
|
|
@@ -372,7 +372,7 @@ const [date, setDate] = useState<Date | undefined>(new Date())
|
|
|
372
372
|
- Labels e roles ARIA apropriados
|
|
373
373
|
- Gerenciamento de foco adequado
|
|
374
374
|
|
|
375
|
-
> Fonte: `src
|
|
375
|
+
> Fonte: `src/design-system/docs/components/CalendarDoc.tsx`
|
|
376
376
|
|
|
377
377
|
---
|
|
378
378
|
|
|
@@ -382,12 +382,12 @@ Indica o progresso de preenchimento de campos obrigatórios em formulários com
|
|
|
382
382
|
|
|
383
383
|
**Uso:**
|
|
384
384
|
```tsx
|
|
385
|
-
import { RequiredFieldsCounter } from "@/design-system/components/RequiredFieldsCounter"
|
|
386
|
-
|
|
387
|
-
// Progresso parcial
|
|
388
|
-
<RequiredFieldsCounter filled={2} total={5} />
|
|
389
|
-
|
|
390
|
-
// Formulário completo
|
|
385
|
+
import { RequiredFieldsCounter } from "@/design-system/components/RequiredFieldsCounter"
|
|
386
|
+
|
|
387
|
+
// Progresso parcial
|
|
388
|
+
<RequiredFieldsCounter filled={2} total={5} />
|
|
389
|
+
|
|
390
|
+
// Formulário completo
|
|
391
391
|
<RequiredFieldsCounter filled={5} total={5} />
|
|
392
392
|
```
|
|
393
393
|
|
|
@@ -416,9 +416,9 @@ import { RequiredFieldsCounter } from "@/design-system/components/RequiredFields
|
|
|
416
416
|
- definida no tailwind.config.ts
|
|
417
417
|
- Importar de
|
|
418
418
|
- ou diretamente de
|
|
419
|
-
- ,
|
|
419
|
+
- ,
|
|
420
420
|
|
|
421
421
|
|
|
422
|
-
> Fonte: `src
|
|
422
|
+
> Fonte: `src/design-system/docs/components/RequiredFieldsCounterDoc.tsx`
|
|
423
423
|
|
|
424
424
|
---
|