forlogic-core 1.20.1 → 2.0.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/patterns/single-scroll-pattern.md +30 -12
- package/dist/action-plans/components/ActionPlanAttachmentsTab.d.ts +18 -0
- package/dist/action-plans/components/ActionPlanCommentsTab.d.ts +18 -0
- package/dist/action-plans/components/ActionPlanCostTab.d.ts +10 -0
- package/dist/action-plans/components/ActionPlanGeneralTab.d.ts +18 -0
- package/dist/action-plans/components/ActionPlanHistoryTab.d.ts +13 -0
- package/dist/action-plans/components/ActionPlanPage.d.ts +25 -0
- package/dist/action-plans/components/ActionPlanPredecessorsTab.d.ts +10 -0
- package/dist/action-plans/components/ActionPlanProgressDialog.d.ts +13 -0
- package/dist/action-plans/components/ActionPlanProgressTab.d.ts +5 -0
- package/dist/action-plans/components/ActionPlanStatusBadge.d.ts +11 -0
- package/dist/action-plans/constants.d.ts +42 -0
- package/dist/action-plans/hooks/useActionPlan.d.ts +14 -0
- package/dist/action-plans/hooks/useActionPlanProgress.d.ts +15 -0
- package/dist/action-plans/index.d.ts +15 -0
- package/dist/action-plans/types.d.ts +353 -0
- package/dist/action-plans/utils/formatTime.d.ts +15 -0
- package/dist/approval-flow/components/ApprovalSidenav.d.ts +16 -0
- package/dist/approval-flow/components/ApproveDialog.d.ts +13 -0
- package/dist/approval-flow/components/SelectApproverDialog.d.ts +11 -0
- package/dist/approval-flow/index.d.ts +4 -0
- package/dist/approval-flow/types.d.ts +76 -0
- package/dist/assets/index.d.ts +1 -0
- package/dist/audit-trail/components/AuditTrailDetails.d.ts +17 -0
- package/dist/audit-trail/components/AuditTrailFilter.d.ts +19 -0
- package/dist/audit-trail/components/AuditTrailPage.d.ts +30 -0
- package/dist/audit-trail/index.d.ts +9 -0
- package/dist/audit-trail/types.d.ts +151 -0
- package/dist/audit-trail/utils.d.ts +38 -0
- package/dist/components/dashboards/dashboard-form.d.ts +50 -0
- package/dist/components/dashboards/dashboard-general-view.d.ts +109 -0
- package/dist/components/dashboards/dashboard-grid.d.ts +41 -0
- package/dist/components/dashboards/dashboard-list.d.ts +31 -0
- package/dist/components/dashboards/dashboard-panel-renderer.d.ts +21 -0
- package/dist/components/dashboards/dashboard-view.d.ts +38 -0
- package/dist/components/dashboards/helpers.d.ts +47 -0
- package/dist/components/dashboards/index.d.ts +9 -0
- package/dist/components/dashboards/panels/burndown-panel.d.ts +26 -0
- package/dist/components/dashboards/panels/cartesian-panel.d.ts +46 -0
- package/dist/components/dashboards/panels/index.d.ts +14 -0
- package/dist/components/dashboards/panels/list-panel.d.ts +30 -0
- package/dist/components/dashboards/panels/matrix-risk-panel.d.ts +49 -0
- package/dist/components/dashboards/panels/numeric-panel.d.ts +22 -0
- package/dist/components/dashboards/panels/panel-error.d.ts +8 -0
- package/dist/components/dashboards/panels/panel-header.d.ts +17 -0
- package/dist/components/dashboards/panels/panel-loader.d.ts +7 -0
- package/dist/components/dashboards/panels/panel-no-data.d.ts +6 -0
- package/dist/components/dashboards/panels/panel-unavailable.d.ts +6 -0
- package/dist/components/dashboards/panels/pareto-panel.d.ts +20 -0
- package/dist/components/dashboards/panels/performance-panel.d.ts +24 -0
- package/dist/components/dashboards/panels/pie-panel.d.ts +19 -0
- package/dist/components/dashboards/panels/text-panel.d.ts +18 -0
- package/dist/components/dashboards/types.d.ts +525 -0
- package/dist/components/ui/electronic-signature-dialog.d.ts +21 -0
- package/dist/components/ui/export-dialog.d.ts +28 -0
- package/dist/components/ui/iframe-dialog.d.ts +14 -0
- package/dist/components/ui/multiselect-permissions.d.ts +59 -0
- package/dist/components/ui/online-editor-dialog.d.ts +18 -0
- package/dist/components/ui/report-request-list.d.ts +44 -0
- package/dist/components/ui/stimulsoft-viewer.d.ts +20 -0
- package/dist/components/ui/terms-of-use-dialog.d.ts +56 -0
- package/dist/components/ui/timepicker.d.ts +11 -0
- package/dist/components/ui/users-groups-selector.d.ts +44 -0
- package/dist/components/ui/viewer-dialog.d.ts +77 -0
- package/dist/custom-form-fields/components/CustomFormFields.d.ts +8 -0
- package/dist/custom-form-fields/fields/FormDateField.d.ts +6 -0
- package/dist/custom-form-fields/fields/FormMultiSelectionField.d.ts +6 -0
- package/dist/custom-form-fields/fields/FormNumericField.d.ts +6 -0
- package/dist/custom-form-fields/fields/FormQuestionsField.d.ts +6 -0
- package/dist/custom-form-fields/fields/FormSingleSelectionField.d.ts +6 -0
- package/dist/custom-form-fields/fields/FormTextField.d.ts +6 -0
- package/dist/custom-form-fields/fields/FormTimeField.d.ts +6 -0
- package/dist/custom-form-fields/fields/FormUrlField.d.ts +6 -0
- package/dist/custom-form-fields/fields/ReadOnlyTextField.d.ts +6 -0
- package/dist/custom-form-fields/index.d.ts +13 -0
- package/dist/custom-form-fields/types.d.ts +143 -0
- package/dist/exports/action-plans.d.ts +16 -0
- package/dist/exports/audit-trail.d.ts +1 -0
- package/dist/exports/custom-form-fields.d.ts +1 -0
- package/dist/exports/file-upload.d.ts +1 -0
- package/dist/exports/ui.d.ts +12 -0
- package/dist/file-upload/components/SingleFileUpload.d.ts +43 -0
- package/dist/file-upload/index.d.ts +6 -0
- package/dist/file-upload/types.d.ts +11 -0
- package/dist/file-upload/utils/formatBytes.d.ts +1 -0
- package/dist/file-upload/utils/getFileExtension.d.ts +1 -0
- package/dist/hooks/useSidebarResize.d.ts +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/team-selector/components/TeamSelector.d.ts +24 -0
- package/dist/team-selector/index.d.ts +2 -0
- package/dist/team-selector/types.d.ts +10 -0
- package/docs/ICON_MIGRATION_GUIDE.md +177 -0
- package/package.json +1 -1
- package/dist/assets/AccordionDoc-BVPUJk8G.js +0 -31
- package/dist/assets/ActionButtonDoc-DLJ_K9ib.js +0 -47
- package/dist/assets/AlertDoc-CY1ybZeG.js +0 -37
- package/dist/assets/AppHeaderDoc-Crkw4dA9.js +0 -67
- package/dist/assets/AppSidebarDoc-ET-4j6wV.js +0 -204
- package/dist/assets/AuthDoc-B4v4Nci5.js +0 -192
- package/dist/assets/AvatarDoc-BLdMoyJd.js +0 -11
- package/dist/assets/BadgeDoc-CSNM1b6b.js +0 -36
- package/dist/assets/BaseFormDoc-DXiYuN6-.js +0 -169
- package/dist/assets/BodyContentDoc-Bp6YmUWX.js +0 -83
- package/dist/assets/BreadcrumbDoc-D7tqqTvo.js +0 -75
- package/dist/assets/ButtonDoc-C4JwIvU3.js +0 -41
- package/dist/assets/ButtonGroupDoc-QFfjC7Pm.js +0 -7
- package/dist/assets/CalendarDoc-COlEKqmv.js +0 -81
- package/dist/assets/CardDoc-BVhMoC2w.js +0 -49
- package/dist/assets/ChartDoc-BJ14EjI2.js +0 -111
- package/dist/assets/CheckboxDoc-Bcqpln9_.js +0 -55
- package/dist/assets/ColorPickerDoc-CcfmSwyC.js +0 -10
- package/dist/assets/ColorsFoundationDoc-uO6IiJbS.js +0 -13
- package/dist/assets/ComboTreeDoc-R4qE6XwB.js +0 -46
- package/dist/assets/ComboboxDoc-JIo_-gSN.js +0 -134
- package/dist/assets/ComponentDocTemplate-CRbRY-v5.js +0 -1
- package/dist/assets/ContextMenuDoc-C4-_0NLp.js +0 -182
- package/dist/assets/ContextsDoc-Cj9Aaoyo.js +0 -184
- package/dist/assets/CreateCrudPageDoc-D_SnMRJ2.js +0 -106
- package/dist/assets/CrudActionBarDoc-BYqtIabp.js +0 -112
- package/dist/assets/CrudGridDoc-DspxQrq5.js +0 -85
- package/dist/assets/CrudOverviewDoc-DLcOL_HZ.js +0 -14
- package/dist/assets/CrudPrimitivesDoc-BRS86nWg.js +0 -164
- package/dist/assets/CrudTableDoc-Daw8u2G_.js +0 -113
- package/dist/assets/DataListDoc-BrgVNhhR.js +0 -13
- package/dist/assets/DesignSystemHome-BFBNqq1J.js +0 -1
- package/dist/assets/DialogDoc-DCpRy4rg.js +0 -981
- package/dist/assets/DropdownMenuDoc-DT6LBa8Z.js +0 -175
- package/dist/assets/EmptyStateDoc-wydc09gG.js +0 -35
- package/dist/assets/EnvironmentsDoc-amIriwDD.js +0 -96
- package/dist/assets/ErrorBoundaryDoc-BEixy_Gl.js +0 -111
- package/dist/assets/FormDoc-DxoRt6p7.js +0 -81
- package/dist/assets/FoundationOverview-CxSbumIt.js +0 -1
- package/dist/assets/GridDoc-BpQqCMUE.js +0 -28
- package/dist/assets/HooksDoc-JNODhbaF.js +0 -665
- package/dist/assets/HoverCardDoc-CdqiYrIb.js +0 -31
- package/dist/assets/I18nDoc-B6LMXnE3.js +0 -232
- package/dist/assets/IconPickerDoc-BRdy58IC.js +0 -10
- package/dist/assets/IconsFoundationDoc-CrymfxTI.js +0 -33
- package/dist/assets/InputDoc-BK-SdpJ7.js +0 -211
- package/dist/assets/LabelDoc-DHvgzhaJ.js +0 -42
- package/dist/assets/LeadershipDoc-DRiB0spL.js +0 -416
- package/dist/assets/MediaDoc-B_vqnf72.js +0 -459
- package/dist/assets/MenubarDoc-Zvgczxe2.js +0 -165
- package/dist/assets/ModuleAccessDoc-Nuxb4S27.js +0 -153
- package/dist/assets/ModulesDialogDoc-iJWLkOZo.js +0 -46
- package/dist/assets/NavigationMenuDoc-CeWun1VF.js +0 -116
- package/dist/assets/OnboardingDialogDoc-xBL-rXeZ.js +0 -55
- package/dist/assets/PaginationDoc-CfvwxCMe.js +0 -98
- package/dist/assets/PaginationDoc-DqtRgXnF.js +0 -27
- package/dist/assets/PlacesDoc-nckioEzg.js +0 -226
- package/dist/assets/PopoverDoc-C3o2CZCT.js +0 -64
- package/dist/assets/ProgressDoc-BmWBNMPA.js +0 -29
- package/dist/assets/QualiexUserFieldDoc-CE1e4mx6.js +0 -149
- package/dist/assets/RadioGroupDoc-DMZH6NmR.js +0 -57
- package/dist/assets/RadiusDoc-BOZD3gPV.js +0 -7
- package/dist/assets/RequiredFieldsCounterDoc-CG-lmSSy.js +0 -58
- package/dist/assets/ResizableDoc-CqGkv6Cd.js +0 -104
- package/dist/assets/RichTextEditorDoc-m50ll-Od.js +0 -24
- package/dist/assets/ScrollAreaDoc-BzJ-APXo.js +0 -28
- package/dist/assets/SecurityDoc-B34gVeiV.js +0 -204
- package/dist/assets/SelectDoc-DXRv7QHK.js +0 -80
- package/dist/assets/SeparatorDoc-DcNh8k0P.js +0 -4
- package/dist/assets/ServicesDoc-8aXBd6yg.js +0 -308
- package/dist/assets/ShadowsDoc-Brl4hIDI.js +0 -9
- package/dist/assets/SignDoc-BdwerR-2.js +0 -66
- package/dist/assets/SkeletonDoc-BWgqgbDY.js +0 -54
- package/dist/assets/SliderDoc-E-NjbYVk.js +0 -41
- package/dist/assets/SpacingDoc-BzburM-r.js +0 -12
- package/dist/assets/SplitButtonDoc-BYUysmJp.js +0 -53
- package/dist/assets/StepSelectorDoc-PB1k4v7F.js +0 -41
- package/dist/assets/SwitchDoc-BLOG6kfj.js +0 -56
- package/dist/assets/TableDoc-Dwcs-lop.js +0 -128
- package/dist/assets/TabsDoc-Ovkh8ArV.js +0 -42
- package/dist/assets/TextareaDoc-DsBYxmbr.js +0 -46
- package/dist/assets/ToastDoc-BbZaFE_A.js +0 -157
- package/dist/assets/ToggleDoc-C28vbvhp.js +0 -51
- package/dist/assets/TooltipDoc-DL5cnLak.js +0 -58
- package/dist/assets/TruncatedCellDoc-BuDA8QcY.js +0 -12
- package/dist/assets/TypographyFoundationDoc-CPdH4PHa.js +0 -7
- package/dist/assets/UtilitiesDoc-CrQhyEfz.js +0 -145
- package/dist/assets/blocks-DO93nPjs.js +0 -1
- package/dist/assets/calendar-days-cMfwBSZx.js +0 -1
- package/dist/assets/circle-plus-D3NftMzS.js +0 -1
- package/dist/assets/circle-x-BVAVJ_oz.js +0 -1
- package/dist/assets/crown-B2MTZDnM.js +0 -1
- package/dist/assets/date-picker-zhJU-_kM.js +0 -1
- package/dist/assets/disabled-menu-item-C16xsaVs.js +0 -1
- package/dist/assets/drawer-oTqCOtsC.js +0 -3
- package/dist/assets/file-pen-line-CXv-Eye-.js +0 -1
- package/dist/assets/git-branch-V6-h6P9K.js +0 -1
- package/dist/assets/globe-CaUBIJU8.js +0 -1
- package/dist/assets/hash-B4MTXppl.js +0 -1
- package/dist/assets/hover-card-DEuucfxP.js +0 -1
- package/dist/assets/index-CE0k7Rdh.js +0 -312
- package/dist/assets/index-Cx3adT_u.css +0 -1
- package/dist/assets/life-buoy-BRndExxh.js +0 -1
- package/dist/assets/lucide-react-t7dCa4lv.js +0 -1
- package/dist/assets/monitor-Dg3HKTSE.js +0 -1
- package/dist/assets/package-3G45ARQh.js +0 -1
- package/dist/assets/pen-BYSSwjK4.js +0 -1
- package/dist/assets/pin-CMYagNhs.js +0 -1
- package/dist/assets/radio-group-BVun_Tmt.js +0 -1
- package/dist/assets/server-p0Sb0mKI.js +0 -1
- package/dist/assets/share-2-D-ZhCCq2.js +0 -1
- package/dist/assets/shield-x-Q7hAXWsG.js +0 -1
- package/dist/assets/step-selector-DHxgT2FL.js +0 -1
- package/dist/assets/text-align-start-6aYQqbX4.js +0 -1
- package/dist/assets/trash-DveAOiLF.js +0 -1
- package/dist/assets/useMockCrud-GY0KxHXr.js +0 -1
- package/dist/assets/user-check-CoGNBfIk.js +0 -1
- package/dist/assets/user-plus-Bad2xWIT.js +0 -1
- package/dist/index.html +0 -35
- package/dist/leadership/components/LeaderRow.d.ts +0 -9
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import{j as e,f as a,ac as t,ad as n,ae as i}from"./index-CE0k7Rdh.js";import{C as d}from"./ComponentDocTemplate-CRbRY-v5.js";import{H as r,a as o,b as s}from"./hover-card-DEuucfxP.js";import{C as l}from"./calendar-days-cMfwBSZx.js";function u(){return e.jsx(d,{title:"Hover Card",description:"Para usuários com visão visualizarem conteúdo disponível por trás de um link. Exibe informações adicionais ao passar o mouse.",component:e.jsxs(r,{children:[e.jsx(o,{asChild:!0,children:e.jsx(a,{variant:"link",className:"p-0 h-auto",children:"@nextjs"})}),e.jsx(s,{className:"w-80",children:e.jsxs("div",{className:"flex justify-between space-x-4",children:[e.jsxs(t,{children:[e.jsx(n,{src:"https://github.com/vercel.png"}),e.jsx(i,{children:"VC"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("h4",{className:"text-sm font-semibold",children:"@nextjs"}),e.jsx("p",{className:"text-sm",children:"O framework React para a Web – utilizado por algumas das maiores empresas do mundo."}),e.jsxs("div",{className:"flex items-center pt-2",children:[e.jsx(l,{className:"mr-2 h-4 w-4 opacity-70"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Entrou em Dezembro de 2021"})]})]})]})})]}),usage:`import {
|
|
2
|
-
HoverCard,
|
|
3
|
-
HoverCardTrigger,
|
|
4
|
-
HoverCardContent,
|
|
5
|
-
Button
|
|
6
|
-
} from "forlogic-core"
|
|
7
|
-
|
|
8
|
-
<HoverCard>
|
|
9
|
-
<HoverCardTrigger asChild>
|
|
10
|
-
<Button variant="link">@nextjs</Button>
|
|
11
|
-
</HoverCardTrigger>
|
|
12
|
-
<HoverCardContent className="w-80">
|
|
13
|
-
<div className="flex space-x-4">
|
|
14
|
-
<Avatar>
|
|
15
|
-
<AvatarImage src="..." />
|
|
16
|
-
<AvatarFallback>VC</AvatarFallback>
|
|
17
|
-
</Avatar>
|
|
18
|
-
<div className="space-y-1">
|
|
19
|
-
<h4 className="text-sm font-semibold">@nextjs</h4>
|
|
20
|
-
<p className="text-sm">Descrição...</p>
|
|
21
|
-
</div>
|
|
22
|
-
</div>
|
|
23
|
-
</HoverCardContent>
|
|
24
|
-
</HoverCard>`,examples:[{title:"Uso Básico",preview:e.jsxs(r,{children:[e.jsx(o,{asChild:!0,children:e.jsx(a,{variant:"link",children:"Passe o mouse aqui"})}),e.jsx(s,{children:e.jsx("p",{className:"text-sm",children:"Conteúdo adicional exibido ao passar o mouse."})})]}),code:`<HoverCard>
|
|
25
|
-
<HoverCardTrigger asChild>
|
|
26
|
-
<Button variant="link">Passe o mouse</Button>
|
|
27
|
-
</HoverCardTrigger>
|
|
28
|
-
<HoverCardContent>
|
|
29
|
-
<p>Conteúdo adicional...</p>
|
|
30
|
-
</HoverCardContent>
|
|
31
|
-
</HoverCard>`}],props:[{name:"HoverCard.open",type:"boolean",default:"-",description:"Estado aberto controlado."},{name:"HoverCard.defaultOpen",type:"boolean",default:"false",description:"Estado aberto padrão."},{name:"HoverCard.onOpenChange",type:"(open: boolean) => void",default:"-",description:"Callback quando o estado muda."},{name:"HoverCard.openDelay",type:"number",default:"700",description:"Atraso para abrir (ms)."},{name:"HoverCard.closeDelay",type:"number",default:"300",description:"Atraso para fechar (ms)."},{name:"HoverCardTrigger.asChild",type:"boolean",default:"false",description:"Mescla props no elemento filho."},{name:"HoverCardContent.side",type:'"top" | "right" | "bottom" | "left"',default:'"bottom"',description:"Lado preferido."},{name:"HoverCardContent.sideOffset",type:"number",default:"4",description:"Distância do trigger (px)."},{name:"HoverCardContent.align",type:'"start" | "center" | "end"',default:'"center"',description:"Alinhamento."}],accessibility:["Projetado apenas para usuários com mouse (não focável por teclado)","Conteúdo não é anunciado para leitores de tela","Para conteúdo acessível, use Popover ou Dialog","Ideal para conteúdo suplementar não essencial","Respeita preferências de movimento reduzido do sistema"],notes:["⚠️ HoverCard é apenas para mouse - não é acessível via teclado","💡 Para conteúdo essencial, use Popover ou Dialog","💡 Ideal para previews de perfil, links, etc.","💡 Configure delays para evitar abertura acidental"]})}export{u as HoverCardDoc};
|
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
import{j as e,C as a,b9 as r,B as n,bb as i,aA as d,aC as c,v as s,bZ as m}from"./index-CE0k7Rdh.js";import{C as l}from"./ComponentDocTemplate-CRbRY-v5.js";import{F as o,M as u}from"./monitor-Dg3HKTSE.js";import{G as t}from"./globe-CaUBIJU8.js";function p(){return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[e.jsxs(a,{className:"p-4 border-2",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:e.jsx(o,{className:"h-5 w-5 text-primary"})}),e.jsx("h4",{className:"font-semibold",children:"translations.json"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Arquivo JSON estático local com todas as traduções (carregamento síncrono)"})]}),e.jsxs(a,{className:"p-4 border-2",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"p-2 rounded-lg bg-green-500/10",children:e.jsx(t,{className:"h-5 w-5 text-green-500"})}),e.jsx("h4",{className:"font-semibold",children:"LocaleContext"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Context React com locale fixo em pt-BR (futuramente via API externa)"})]}),e.jsxs(a,{className:"p-4 border-2",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"p-2 rounded-lg bg-orange-500/10",children:e.jsx(s,{className:"h-5 w-5 text-orange-500"})}),e.jsx("h4",{className:"font-semibold",children:"CoreProviders"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Wrapper que encapsula todos os providers incluindo i18n"})]})]})})}function x(){return e.jsxs(a,{className:"p-4 space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"p-2 rounded-lg bg-cyan-500/10",children:e.jsx(u,{className:"h-5 w-5 text-cyan-500"})}),e.jsx("h4",{className:"font-semibold",children:"Detecção Automática"})]}),e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-muted/50",children:[e.jsx(t,{className:"h-4 w-4 mt-0.5 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Idioma"}),e.jsxs("p",{className:"text-muted-foreground",children:[e.jsx("code",{children:"navigator.language"}),' → Detecta "pt-BR", "en-US", etc.']})]})]}),e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-muted/50",children:[e.jsx(s,{className:"h-4 w-4 mt-0.5 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Fuso Horário"}),e.jsx("p",{className:"text-muted-foreground",children:e.jsx("code",{children:"Intl.DateTimeFormat().resolvedOptions().timeZone"})})]})]}),e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-muted/50",children:[e.jsx(m,{className:"h-4 w-4 mt-0.5 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Formato de Data"}),e.jsx("p",{className:"text-muted-foreground",children:"Inferido do idioma detectado (pt-BR → dd/MM/yyyy)"})]})]})]})]})}function f(){return e.jsxs(a,{className:"p-4 space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"p-2 rounded-lg bg-violet-500/10",children:e.jsx(i,{className:"h-5 w-5 text-violet-500"})}),e.jsx("h4",{className:"font-semibold",children:"Conversão de Timezone"})]}),e.jsxs("div",{className:"text-sm space-y-2",children:[e.jsxs("div",{className:"p-2 rounded bg-muted/50 font-mono text-xs",children:["UTC: ","2024-03-15T17:30:00Z"]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs("div",{className:"flex justify-between py-2 border-b",children:[e.jsx("span",{className:"text-muted-foreground",children:"🇧🇷 Brasília (UTC-3)"}),e.jsx("span",{className:"font-medium",children:"15/03/2024 14:30"})]}),e.jsxs("div",{className:"flex justify-between py-2 border-b",children:[e.jsx("span",{className:"text-muted-foreground",children:"🇺🇸 New York (UTC-4)"}),e.jsx("span",{className:"font-medium",children:"03/15/2024 01:30 PM"})]}),e.jsxs("div",{className:"flex justify-between py-2 border-b",children:[e.jsx("span",{className:"text-muted-foreground",children:"🇬🇧 Londres (UTC+0)"}),e.jsx("span",{className:"font-medium",children:"15/03/2024 17:30"})]}),e.jsxs("div",{className:"flex justify-between py-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"🇯🇵 Tóquio (UTC+9)"}),e.jsx("span",{className:"font-medium",children:"16/03/2024 02:30"})]})]})]}),e.jsx(d,{children:e.jsxs(c,{className:"text-xs",children:["Usa ",e.jsx("code",{children:"date-fns-tz"})," para conversão precisa de timezones, incluindo horário de verão automático."]})})]})}function h(){return e.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[e.jsxs(a,{className:"p-4 flex items-center gap-3",children:[e.jsx("span",{className:"text-2xl",children:"🇧🇷"}),e.jsxs("div",{children:[e.jsxs("div",{className:"font-medium flex items-center gap-2",children:["Português (Brasil)",e.jsx(n,{variant:"secondary",children:"Padrão"})]}),e.jsx("code",{className:"text-xs text-muted-foreground",children:"pt-BR"})]})]}),e.jsxs(a,{className:"p-4 flex items-center gap-3",children:[e.jsx("span",{className:"text-2xl",children:"🇺🇸"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:"English (US)"}),e.jsx("code",{className:"text-xs text-muted-foreground",children:"en-US"})]})]}),e.jsxs(a,{className:"p-4 flex items-center gap-3",children:[e.jsx("span",{className:"text-2xl",children:"🇪🇸"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:"Español (España)"}),e.jsx("code",{className:"text-xs text-muted-foreground",children:"es-ES"})]})]})]})}function j(){return e.jsxs(a,{className:"p-4 bg-muted/50",children:[e.jsxs("h4",{className:"font-semibold mb-3 flex items-center gap-2",children:[e.jsx(o,{className:"h-4 w-4"}),"Arquivo: lib/i18n/translations.json"]}),e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsx("div",{className:"p-3 rounded bg-background font-mono text-xs",children:e.jsx("pre",{children:`{
|
|
2
|
-
"save": { "pt": "Salvar", "en": "Save", "es": "Guardar" },
|
|
3
|
-
"cancel": { "pt": "Cancelar", "en": "Cancel", "es": "Cancelar" },
|
|
4
|
-
"hello_user": { "pt": "Olá, {{name}}!", "en": "Hello, {{name}}!", "es": "¡Hola, {{name}}!" }
|
|
5
|
-
}`})}),e.jsxs("div",{className:"text-muted-foreground space-y-1",children:[e.jsxs("p",{children:["• Estrutura: ",e.jsxs("code",{children:["chave → ","{ pt, en, es }"]})]}),e.jsxs("p",{children:["• Carregamento ",e.jsx("strong",{children:"síncrono"})," via import estático"]}),e.jsx("p",{children:"• Sem dependência de banco de dados ou rede para inicializar"}),e.jsx("p",{children:"• Sem dependência de banco de dados ou rede para inicializar"})]})]})]})}function b(){return e.jsx(l,{title:"Internacionalização (i18n)",description:"Sistema de internacionalização usando react-i18next com traduções carregadas de um arquivo JSON estático local (lib/i18n/translations.json). Suporta pt-BR, en-US e es-ES com gerenciamento de preferências do usuário.",component:e.jsx(p,{}),usage:`// 1. Setup inicial com CoreProviders (recomendado)
|
|
6
|
-
import { CoreProviders } from 'forlogic-core';
|
|
7
|
-
|
|
8
|
-
function App() {
|
|
9
|
-
return (
|
|
10
|
-
<CoreProviders>
|
|
11
|
-
<BrowserRouter>
|
|
12
|
-
<Routes />
|
|
13
|
-
</BrowserRouter>
|
|
14
|
-
</CoreProviders>
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// 2. Usando traduções em componentes
|
|
19
|
-
import { useTranslation } from 'forlogic-core';
|
|
20
|
-
|
|
21
|
-
function MyComponent() {
|
|
22
|
-
const { t } = useTranslation();
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<Button>{t('save')}</Button>
|
|
26
|
-
);
|
|
27
|
-
}`,examples:[{title:"Idiomas Suportados",description:"O sistema suporta 3 idiomas com fallback automático para português",preview:e.jsx(h,{}),code:`// Idiomas configurados em lib/i18n/config.ts
|
|
28
|
-
i18n.init({
|
|
29
|
-
fallbackLng: 'pt-BR',
|
|
30
|
-
lng: 'pt-BR',
|
|
31
|
-
defaultNS: 'translations',
|
|
32
|
-
ns: ['translations'],
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
// Fallback automático para pt-BR quando tradução não existe
|
|
36
|
-
// en-US → fallback → pt-BR
|
|
37
|
-
// es-ES → fallback → pt-BR`},{title:"Estrutura do Arquivo JSON",description:"Traduções são armazenadas em lib/i18n/translations.json e carregadas de forma síncrona no build",preview:e.jsx(j,{}),code:`// Arquivo: lib/i18n/translations.json
|
|
38
|
-
// Estrutura: chave > idioma (pt, en, es)
|
|
39
|
-
{
|
|
40
|
-
"save": { "pt": "Salvar", "en": "Save", "es": "Guardar" },
|
|
41
|
-
"cancel": { "pt": "Cancelar", "en": "Cancel", "es": "Cancelar" },
|
|
42
|
-
"confirm": { "pt": "Confirmar", "en": "Confirm", "es": "Confirmar" }
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Em lib/i18n/config.ts, o JSON é transformado para o formato i18next:
|
|
46
|
-
import translationsData from './translations.json';
|
|
47
|
-
|
|
48
|
-
function buildResources(data) {
|
|
49
|
-
const ptBR = {}, enUS = {}, esES = {};
|
|
50
|
-
for (const [key, langs] of Object.entries(data)) {
|
|
51
|
-
ptBR[key] = langs.pt || key;
|
|
52
|
-
enUS[key] = langs.en || langs.pt || key;
|
|
53
|
-
esES[key] = langs.es || langs.pt || key;
|
|
54
|
-
}
|
|
55
|
-
return {
|
|
56
|
-
'pt-BR': { translations: ptBR },
|
|
57
|
-
'en-US': { translations: enUS },
|
|
58
|
-
'es-ES': { translations: esES },
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// Sincronização banco → JSON via script:
|
|
63
|
-
// bun run scripts/i18n/update-translations-source.ts`},{title:"useTranslation Hook",description:"Hook principal para acessar traduções nos componentes",preview:e.jsxs(a,{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(r,{className:"h-5 w-5 text-green-500"}),e.jsx("span",{className:"font-medium",children:"Hook disponível em toda a aplicação"})]}),e.jsxs("div",{className:"text-sm text-muted-foreground space-y-1",children:[e.jsxs("p",{children:["• ",e.jsx("code",{children:"t(key)"})," - Retorna a tradução para a chave"]}),e.jsxs("p",{children:["• ",e.jsxs("code",{children:["t(key, ","{{ var }}: value",")"]})," - Com interpolação"]}),e.jsxs("p",{children:["• ",e.jsx("code",{children:"i18n"})," - Instância do i18next para operações avançadas"]}),e.jsxs("p",{children:["• Traduções disponíveis ",e.jsx("strong",{children:"imediatamente"})," (sem loading)"]})]})]}),code:`import { useTranslation } from 'forlogic-core';
|
|
64
|
-
|
|
65
|
-
function MyComponent() {
|
|
66
|
-
const { t, i18n } = useTranslation();
|
|
67
|
-
|
|
68
|
-
// Tradução simples
|
|
69
|
-
const title = t('page_title');
|
|
70
|
-
|
|
71
|
-
// Com interpolação
|
|
72
|
-
const greeting = t('hello_user', { name: 'João' });
|
|
73
|
-
// "Olá, João!" (se a chave for "Olá, {{name}}!")
|
|
74
|
-
|
|
75
|
-
// Trocar idioma manualmente
|
|
76
|
-
const changeLanguage = (lang: string) => {
|
|
77
|
-
i18n.changeLanguage(lang);
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
// Não é necessário verificar "ready" - traduções são síncronas
|
|
81
|
-
return <h1>{title}</h1>;
|
|
82
|
-
}`},{title:"useLocale Hook",description:"Hook para acessar preferências de localização (atualmente fixas em pt-BR)",preview:e.jsxs(a,{className:"p-4 space-y-3",children:[e.jsx("h4",{className:"font-medium",children:"Valores fixos (futuramente via API):"}),e.jsxs("div",{className:"grid gap-2 text-sm",children:[e.jsxs("div",{className:"flex justify-between py-2 border-b",children:[e.jsx("span",{className:"text-muted-foreground",children:"locale"}),e.jsx("code",{children:"pt-BR"})]}),e.jsxs("div",{className:"flex justify-between py-2 border-b",children:[e.jsx("span",{className:"text-muted-foreground",children:"timezone"}),e.jsx("code",{children:"America/Sao_Paulo"})]}),e.jsxs("div",{className:"flex justify-between py-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"datetimeFormat"}),e.jsx("code",{children:"dd/MM/yyyy HH:mm"})]})]})]}),code:`import { useLocale } from 'forlogic-core';
|
|
83
|
-
|
|
84
|
-
function MyComponent() {
|
|
85
|
-
const { locale, timezone, datetimeFormat } = useLocale();
|
|
86
|
-
// locale: 'pt-BR' (fixo)
|
|
87
|
-
// timezone: 'America/Sao_Paulo' (fixo)
|
|
88
|
-
// datetimeFormat: 'dd/MM/yyyy HH:mm' (fixo)
|
|
89
|
-
// Futuramente será obtido de uma API externa
|
|
90
|
-
}`},{title:"useI18nFormatters Hook",description:"Hook RECOMENDADO para formatação de datas. Converte automaticamente para o timezone do usuário.",preview:e.jsx(a,{className:"p-4 space-y-3",children:e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"flex justify-between py-2 border-b",children:[e.jsx("span",{className:"text-muted-foreground",children:"formatDatetime()"}),e.jsx("span",{children:"26/12/2024 14:30"})]}),e.jsxs("div",{className:"flex justify-between py-2 border-b",children:[e.jsx("span",{className:"text-muted-foreground",children:"formatDate()"}),e.jsx("span",{children:"26 de dez. de 2024"})]}),e.jsxs("div",{className:"flex justify-between py-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"timezone"}),e.jsx("span",{children:"Converte automaticamente"})]})]})}),code:`import { useI18nFormatters } from 'forlogic-core';
|
|
91
|
-
|
|
92
|
-
function ActivityLog() {
|
|
93
|
-
const { formatDatetime, formatDate, locale, timezone, datetimeFormat } = useI18nFormatters();
|
|
94
|
-
|
|
95
|
-
// Data armazenada em UTC no banco
|
|
96
|
-
const createdAt = "2024-03-15T17:30:00Z"; // 17:30 UTC
|
|
97
|
-
|
|
98
|
-
return (
|
|
99
|
-
<div>
|
|
100
|
-
{/* formatDatetime: converte para timezone do usuário automaticamente */}
|
|
101
|
-
<p>Criado em: {formatDatetime(createdAt)}</p>
|
|
102
|
-
|
|
103
|
-
{/* formatDate: também considera timezone para determinar a data correta */}
|
|
104
|
-
<p>Data: {formatDate(createdAt)}</p>
|
|
105
|
-
|
|
106
|
-
{/* Saída varia conforme timezone configurado:
|
|
107
|
-
|
|
108
|
-
Usuário em Brasília (UTC-3):
|
|
109
|
-
→ "15/03/2024 14:30"
|
|
110
|
-
|
|
111
|
-
Usuário em Tokyo (UTC+9):
|
|
112
|
-
→ "16/03/2024 02:30" (já é dia seguinte!)
|
|
113
|
-
|
|
114
|
-
Usuário em New York (UTC-4):
|
|
115
|
-
→ "03/15/2024 01:30 PM"
|
|
116
|
-
*/}
|
|
117
|
-
</div>
|
|
118
|
-
);
|
|
119
|
-
}`},{title:"Conversão de Timezone",description:"As funções de formatação usam date-fns-tz para converter datas UTC para o timezone do usuário, com ajuste automático de horário de verão (DST)",preview:e.jsx(f,{}),code:`import { formatDatetime, formatDate } from 'forlogic-core';
|
|
120
|
-
|
|
121
|
-
// Data armazenada em UTC no banco de dados
|
|
122
|
-
const utcDate = "2024-03-15T17:30:00Z"; // 17:30 UTC
|
|
123
|
-
|
|
124
|
-
// Formatação com conversão de timezone
|
|
125
|
-
// Cada usuário verá a data/hora no seu fuso horário local
|
|
126
|
-
|
|
127
|
-
// Usuário em Brasília (UTC-3)
|
|
128
|
-
formatDatetime(utcDate, "dd/MM/yyyy HH:mm", "America/Sao_Paulo");
|
|
129
|
-
// → "15/03/2024 14:30"
|
|
130
|
-
|
|
131
|
-
// Usuário em Tokyo (UTC+9)
|
|
132
|
-
formatDatetime(utcDate, "dd/MM/yyyy HH:mm", "Asia/Tokyo");
|
|
133
|
-
// → "16/03/2024 02:30" (já é dia seguinte!)
|
|
134
|
-
|
|
135
|
-
// Usuário em New York (UTC-4, com horário de verão)
|
|
136
|
-
formatDatetime(utcDate, "MM/dd/yyyy hh:mm a", "America/New_York", "en-US");
|
|
137
|
-
// → "03/15/2024 01:30 PM"
|
|
138
|
-
|
|
139
|
-
// A função formatDate também considera timezone
|
|
140
|
-
// Isso é importante quando a data pode mudar dependendo do fuso
|
|
141
|
-
formatDate(utcDate, "pt-BR", "America/Sao_Paulo");
|
|
142
|
-
// → "15 de mar. de 2024"
|
|
143
|
-
|
|
144
|
-
formatDate(utcDate, "en-US", "Asia/Tokyo");
|
|
145
|
-
// → "Mar 16, 2024" (dia seguinte em Tokyo!)
|
|
146
|
-
|
|
147
|
-
// ============================================
|
|
148
|
-
// HORÁRIO DE VERÃO (DST) - AJUSTE AUTOMÁTICO
|
|
149
|
-
// ============================================
|
|
150
|
-
//
|
|
151
|
-
// A biblioteca date-fns-tz detecta automaticamente quando
|
|
152
|
-
// um timezone está em horário de verão e aplica o offset correto.
|
|
153
|
-
//
|
|
154
|
-
// Exemplo: New York
|
|
155
|
-
// - Inverno (EST): UTC-5
|
|
156
|
-
// - Verão (EDT): UTC-4
|
|
157
|
-
//
|
|
158
|
-
// Você NÃO precisa fazer nada! O sistema usa o identificador
|
|
159
|
-
// IANA (ex: "America/New_York") e aplica automaticamente
|
|
160
|
-
// o offset correto baseado na data sendo formatada.
|
|
161
|
-
//
|
|
162
|
-
// Os labels dos timezones mostram apenas o offset padrão
|
|
163
|
-
// (ex: "New York (UTC-5)") para simplificar, mas o sistema
|
|
164
|
-
// sempre calcula o offset real incluindo DST.
|
|
165
|
-
|
|
166
|
-
// IMPORTANTE: Sempre armazene datas em UTC no banco
|
|
167
|
-
// e deixe a conversão para o frontend com timezone do usuário`},{title:"Detecção Automática do Navegador/SO",description:"O sistema detecta automaticamente as preferências do navegador/SO como valores iniciais antes da autenticação",preview:e.jsx(x,{}),code:`import {
|
|
168
|
-
detectBrowserLocale,
|
|
169
|
-
detectBrowserTimezone,
|
|
170
|
-
inferDatetimeFormat,
|
|
171
|
-
detectBrowserPreferences
|
|
172
|
-
} from 'forlogic-core';
|
|
173
|
-
|
|
174
|
-
// Detectar idioma do navegador
|
|
175
|
-
const locale = detectBrowserLocale();
|
|
176
|
-
// → "pt-BR" (se navigator.language = "pt-BR")
|
|
177
|
-
// → "en-US" (se navigator.language = "en" ou "en-GB")
|
|
178
|
-
|
|
179
|
-
// Detectar timezone do sistema
|
|
180
|
-
const timezone = detectBrowserTimezone();
|
|
181
|
-
// → "America/Sao_Paulo" (se configurado no SO)
|
|
182
|
-
|
|
183
|
-
// Inferir formato de data baseado no idioma
|
|
184
|
-
const format = inferDatetimeFormat('en-US');
|
|
185
|
-
// → "MM/dd/yyyy hh:mm a"
|
|
186
|
-
|
|
187
|
-
// Detectar todas as preferências de uma vez
|
|
188
|
-
const prefs = detectBrowserPreferences();
|
|
189
|
-
// → { locale: "pt-BR", timezone: "America/Sao_Paulo", datetimeFormat: "dd/MM/yyyy HH:mm" }
|
|
190
|
-
|
|
191
|
-
// NOTA: Atualmente o locale é fixo em pt-BR.
|
|
192
|
-
// Futuramente será obtido de uma API externa.`},{title:"Constantes Centralizadas",description:"Todas as opções de localização estão centralizadas em lib/i18n/constants.ts",preview:e.jsxs(a,{className:"p-4 space-y-3",children:[e.jsx("h4",{className:"font-medium",children:"Constantes exportadas:"}),e.jsxs("div",{className:"text-sm space-y-2",children:[e.jsxs("p",{children:["• ",e.jsx("code",{children:"SUPPORTED_LOCALES"})," - pt-BR, en-US, es-ES"]}),e.jsxs("p",{children:["• ",e.jsx("code",{children:"DATETIME_FORMATS"})," - 6 formatos de data/hora"]}),e.jsxs("p",{children:["• ",e.jsx("code",{children:"TIMEZONES"})," - 12 fusos horários"]}),e.jsxs("p",{children:["• ",e.jsx("code",{children:"DEFAULT_*"})," - Valores padrão (fallback)"]}),e.jsxs("p",{children:["• ",e.jsx("code",{children:"detectBrowserPreferences()"})," - Detecta do navegador"]})]})]}),code:`import {
|
|
193
|
-
SUPPORTED_LOCALES,
|
|
194
|
-
DATETIME_FORMATS,
|
|
195
|
-
TIMEZONES,
|
|
196
|
-
DEFAULT_LOCALE,
|
|
197
|
-
DEFAULT_DATETIME_FORMAT,
|
|
198
|
-
DEFAULT_TIMEZONE,
|
|
199
|
-
// Funções de validação
|
|
200
|
-
findLocale,
|
|
201
|
-
findDatetimeFormat,
|
|
202
|
-
findTimezone,
|
|
203
|
-
isValidLocale,
|
|
204
|
-
isValidDatetimeFormat,
|
|
205
|
-
isValidTimezone,
|
|
206
|
-
// Funções de detecção automática
|
|
207
|
-
detectBrowserLocale,
|
|
208
|
-
detectBrowserTimezone,
|
|
209
|
-
inferDatetimeFormat,
|
|
210
|
-
detectBrowserPreferences
|
|
211
|
-
} from 'forlogic-core';
|
|
212
|
-
|
|
213
|
-
// Usar em selects de configuração
|
|
214
|
-
{DATETIME_FORMATS.map(fmt => (
|
|
215
|
-
<SelectItem key={fmt.value} value={fmt.value}>
|
|
216
|
-
<div className="flex flex-col">
|
|
217
|
-
<span>{fmt.label}</span>
|
|
218
|
-
<span className="text-xs text-muted-foreground">
|
|
219
|
-
{fmt.description} • {fmt.example}
|
|
220
|
-
</span>
|
|
221
|
-
</div>
|
|
222
|
-
</SelectItem>
|
|
223
|
-
))}
|
|
224
|
-
|
|
225
|
-
// Validar valor antes de salvar
|
|
226
|
-
if (isValidDatetimeFormat(userInput)) {
|
|
227
|
-
await setDatetimeFormat(userInput);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
// Encontrar detalhes de um formato
|
|
231
|
-
const format = findDatetimeFormat('dd/MM/yyyy HH:mm');
|
|
232
|
-
console.log(format?.description); // "Padrão Brasileiro"`}],props:[{name:"useTranslation",type:"hook",default:"-",description:"Hook principal para acessar traduções. Retorna { t, ready, i18n }."},{name:"useLocale",type:"hook",default:"-",description:"Hook para acessar locale fixo em pt-BR (futuramente via API externa)."},{name:"useI18nFormatters",type:"hook",default:"-",description:"Hook RECOMENDADO para formatação de datas respeitando preferências do usuário."},{name:"detectBrowserPreferences",type:"function",default:"-",description:"Detecta locale, timezone e formato de data do navegador/SO."},{name:"SUPPORTED_LOCALES",type:"const",default:"-",description:"Array com locales suportados: pt-BR, en-US, es-ES."},{name:"DATETIME_FORMATS",type:"const",default:"-",description:"Array com 6 formatos de data/hora disponíveis para o usuário."},{name:"TIMEZONES",type:"const",default:"-",description:"Array com 12 fusos horários suportados."},{name:"DEFAULT_LOCALE",type:"const",default:"pt-BR",description:"Locale padrão de fallback quando navegador não suportado."},{name:"DEFAULT_DATETIME_FORMAT",type:"const",default:"dd/MM/yyyy HH:mm",description:"Formato de data/hora de fallback."},{name:"DEFAULT_TIMEZONE",type:"const",default:"America/Sao_Paulo",description:"Fuso horário de fallback."},{name:"CoreProviders",type:"component",default:"-",description:"Wrapper que inclui todos os providers necessários incluindo i18n."},{name:"i18n",type:"instance",default:"-",description:"Instância configurada do i18next para uso direto."}],accessibility:["Traduções são carregadas de forma síncrona (sem loading/flash)","Fallback automático para português quando tradução não existe em outro idioma","Locale fixo em pt-BR — futuramente será obtido de uma API externa","useLocale() continua disponível para consumidores como useI18nFormatters"],notes:["**Arquivo estático**: Traduções são carregadas de `lib/i18n/translations.json` — carregamento síncrono, sem dependência de rede",'**Estrutura do JSON**: `{ "chave": { "pt": "...", "en": "...", "es": "..." } }`',"**CoreProviders** é a forma recomendada de configurar i18n — já inclui todos os providers necessários","Locale fixo em **pt-BR** — futuramente via API externa","**Horário de Verão (DST)**: O sistema ajusta automaticamente para DST usando identificadores IANA"]})}export{b as I18nDoc};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{r,j as o,cT as c,i}from"./index-CE0k7Rdh.js";import{C as n}from"./ComponentDocTemplate-CRbRY-v5.js";import{L as s}from"./lucide-react-t7dCa4lv.js";import"./hash-B4MTXppl.js";import"./blocks-DO93nPjs.js";import"./calendar-days-cMfwBSZx.js";import"./circle-plus-D3NftMzS.js";import"./circle-x-BVAVJ_oz.js";import"./life-buoy-BRndExxh.js";import"./share-2-D-ZhCCq2.js";import"./crown-B2MTZDnM.js";import"./monitor-Dg3HKTSE.js";import"./file-pen-line-CXv-Eye-.js";import"./git-branch-V6-h6P9K.js";import"./globe-CaUBIJU8.js";import"./shield-x-Q7hAXWsG.js";import"./package-3G45ARQh.js";import"./pen-BYSSwjK4.js";import"./pin-CMYagNhs.js";import"./server-p0Sb0mKI.js";import"./text-align-start-6aYQqbX4.js";import"./trash-DveAOiLF.js";import"./user-check-CoGNBfIk.js";import"./user-plus-Bad2xWIT.js";function w(){const[e,t]=r.useState("Star"),a=s[e]||i;return o.jsx(n,{title:"Icon Picker",description:"Seletor de ícones da biblioteca Lucide React com busca integrada.",component:o.jsxs("div",{className:"w-[300px]",children:[o.jsx(c,{value:e,onChange:t,label:"Escolha um ícone"}),o.jsxs("div",{className:"mt-4 p-4 rounded-md border bg-card flex items-center gap-3",children:[o.jsx(a,{className:"h-6 w-6 text-primary"}),o.jsxs("p",{className:"font-medium",children:["Ícone selecionado: ",e]})]})]}),usage:`import { IconPicker } from "forlogic-core"
|
|
2
|
-
import { useState } from 'react'
|
|
3
|
-
|
|
4
|
-
const [icon, setIcon] = useState('Star')
|
|
5
|
-
|
|
6
|
-
<IconPicker
|
|
7
|
-
value={icon}
|
|
8
|
-
onChange={setIcon}
|
|
9
|
-
label="Escolha um ícone"
|
|
10
|
-
/>`,props:[{name:"value",type:"string",default:"Star",description:"Nome do ícone selecionado (Lucide React)."},{name:"onChange",type:"(iconName: string) => void",default:"-",description:"Callback quando o ícone é alterado."},{name:"label",type:"string",default:"-",description:"Label opcional para o campo."}],accessibility:["Busca por nome do ícone","Grid acessível por teclado","Títulos descritivos em cada ícone","Indicador visual de seleção","Scroll area com navegação adequada"]})}export{w as IconPickerDoc};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import{r as m,j as e,B as y,C as c,a as d,b as n,c as i,I as k,d as o,f as N,g as S,h as L,i as T,H as u,k as P,E as v,u as E}from"./index-CE0k7Rdh.js";import{L as H,S as D}from"./lucide-react-t7dCa4lv.js";import{G as M}from"./life-buoy-BRndExxh.js";import"./hash-B4MTXppl.js";import"./blocks-DO93nPjs.js";import"./calendar-days-cMfwBSZx.js";import"./circle-plus-D3NftMzS.js";import"./circle-x-BVAVJ_oz.js";import"./share-2-D-ZhCCq2.js";import"./crown-B2MTZDnM.js";import"./monitor-Dg3HKTSE.js";import"./file-pen-line-CXv-Eye-.js";import"./git-branch-V6-h6P9K.js";import"./globe-CaUBIJU8.js";import"./shield-x-Q7hAXWsG.js";import"./package-3G45ARQh.js";import"./pen-BYSSwjK4.js";import"./pin-CMYagNhs.js";import"./server-p0Sb0mKI.js";import"./text-align-start-6aYQqbX4.js";import"./trash-DveAOiLF.js";import"./user-check-CoGNBfIk.js";import"./user-plus-Bad2xWIT.js";const z=["createLucideIcon","default","icons","Icon","LucideIcon","IconNode","LucideProps","createElement"];function le(){const[x,w]=m.useState(""),[C,g]=m.useState(null),[r,j]=m.useState(1),f=120,h=m.useMemo(()=>Object.entries(H).filter(([s,t])=>!(z.includes(s)||!t||typeof t!="function"&&typeof t!="object"||s.startsWith("Lucide")||typeof t=="object"&&!("$$typeof"in t))).map(([s,t])=>({name:s,Icon:t})),[]),p=m.useMemo(()=>{if(!x.trim())return h;const s=x.toLowerCase();return h.filter(({name:t})=>t.toLowerCase().includes(s))},[h,x]);m.useMemo(()=>{j(1)},[x]);const a=Math.ceil(p.length/f),b=m.useMemo(()=>{const s=(r-1)*f;return p.slice(s,s+f)},[p,r]),I=s=>{const t=`import { ${s} } from 'lucide-react';`;navigator.clipboard.writeText(t),g(s),E.success(`Import de ${s} copiado!`),setTimeout(()=>g(null),2e3)};return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-4xl font-bold mb-4",children:"Ícones"}),e.jsx("p",{className:"text-lg text-muted-foreground mb-2",children:"Biblioteca completa de ícones usando Lucide React - uma biblioteca de ícones open-source com mais de 1400 ícones em SVG."}),e.jsxs("div",{className:"flex items-center gap-2 mt-4",children:[e.jsxs(y,{variant:"secondary",children:[h.length," ícones disponíveis"]}),e.jsx(y,{variant:"outline",children:"lucide-react"})]})]}),e.jsxs(c,{children:[e.jsxs(d,{children:[e.jsx(n,{children:"Galeria de Ícones"}),e.jsxs(i,{children:["Clique em um ícone para copiar o import. Mostrando ",b.length," de ",p.length," ícones",p.length!==h.length&&` (${h.length} total)`,"."]}),e.jsx("div",{className:"mt-4 flex items-center gap-4",children:e.jsx(k,{type:"text",placeholder:"Buscar ícones...",value:x,onChange:s=>w(s.target.value),className:"max-w-sm"})})]}),e.jsxs(o,{className:"space-y-4",children:[e.jsx("div",{className:"grid grid-cols-6 sm:grid-cols-8 md:grid-cols-10 lg:grid-cols-12 gap-2",children:b.map(({name:s,Icon:t})=>e.jsxs("button",{onClick:()=>I(s),className:`flex flex-col items-center justify-center p-3 rounded-md border hover:bg-accent hover:border-primary transition-all group ${C===s?"bg-primary/10 border-primary":""}`,title:s,children:[e.jsx(t,{className:"h-5 w-5 group-hover:text-primary transition-colors"}),e.jsx("span",{className:"text-[9px] mt-1.5 text-muted-foreground truncate w-full text-center",children:s.length>8?`${s.slice(0,8)}...`:s})]},s))}),p.length===0&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[e.jsx(D,{className:"h-12 w-12 mb-4"}),e.jsxs("p",{children:['Nenhum ícone encontrado para "',x,'"']})]}),a>1&&e.jsxs("div",{className:"flex items-center justify-center gap-2 pt-4 border-t",children:[e.jsx(N,{variant:"outline",size:"sm",onClick:()=>j(s=>Math.max(1,s-1)),disabled:r===1,children:e.jsx(S,{className:"h-4 w-4"})}),e.jsx("div",{className:"flex items-center gap-1",children:Array.from({length:Math.min(5,a)},(s,t)=>{let l;return a<=5||r<=3?l=t+1:r>=a-2?l=a-4+t:l=r-2+t,e.jsx(N,{variant:r===l?"default":"outline",size:"sm",onClick:()=>j(l),className:"w-8",children:l},l)})}),e.jsx(N,{variant:"outline",size:"sm",onClick:()=>j(s=>Math.min(a,s+1)),disabled:r===a,children:e.jsx(L,{className:"h-4 w-4"})}),e.jsxs("span",{className:"text-sm text-muted-foreground ml-2",children:["Página ",r," de ",a]})]})]})]}),e.jsxs(c,{children:[e.jsxs(d,{children:[e.jsx(n,{children:"Instalação"}),e.jsx(i,{children:"Como instalar e usar a biblioteca de ícones"})]}),e.jsxs(o,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2",children:"1. Instalação"}),e.jsx("pre",{className:"bg-muted p-3 rounded-md text-sm overflow-x-auto",children:"npm install lucide-react"})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2",children:"2. Importação Individual (Recomendado)"}),e.jsx("pre",{className:"bg-muted p-3 rounded-md text-sm overflow-x-auto",children:`import { Home, Settings, User, Search } from 'lucide-react';
|
|
2
|
-
|
|
3
|
-
function MyComponent() {
|
|
4
|
-
return (
|
|
5
|
-
<div>
|
|
6
|
-
<Home className="h-6 w-6" />
|
|
7
|
-
<Settings className="h-6 w-6 text-muted-foreground" />
|
|
8
|
-
<User className="h-6 w-6 text-primary" />
|
|
9
|
-
</div>
|
|
10
|
-
);
|
|
11
|
-
}`})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2",children:"3. Ícone Dinâmico"}),e.jsx("pre",{className:"bg-muted p-3 rounded-md text-sm overflow-x-auto",children:`import { icons } from 'lucide-react';
|
|
12
|
-
|
|
13
|
-
function DynamicIcon({ name, ...props }: { name: keyof typeof icons }) {
|
|
14
|
-
const LucideIcon = icons[name];
|
|
15
|
-
return <LucideIcon {...props} />;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// Uso
|
|
19
|
-
<DynamicIcon name="Home" className="h-5 w-5" />`})]})]})]}),e.jsxs(c,{children:[e.jsxs(d,{children:[e.jsx(n,{children:"Propriedades"}),e.jsx(i,{children:"Props disponíveis para todos os ícones"})]}),e.jsx(o,{children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b",children:[e.jsx("th",{className:"text-left py-2 pr-4 font-semibold",children:"Prop"}),e.jsx("th",{className:"text-left py-2 pr-4 font-semibold",children:"Tipo"}),e.jsx("th",{className:"text-left py-2 pr-4 font-semibold",children:"Default"}),e.jsx("th",{className:"text-left py-2 font-semibold",children:"Descrição"})]})}),e.jsxs("tbody",{children:[e.jsxs("tr",{className:"border-b",children:[e.jsx("td",{className:"py-2 pr-4 font-mono text-xs",children:"size"}),e.jsx("td",{className:"py-2 pr-4 text-muted-foreground",children:"number"}),e.jsx("td",{className:"py-2 pr-4 text-muted-foreground",children:"24"}),e.jsx("td",{className:"py-2 text-muted-foreground",children:"Tamanho do ícone em pixels"})]}),e.jsxs("tr",{className:"border-b",children:[e.jsx("td",{className:"py-2 pr-4 font-mono text-xs",children:"color"}),e.jsx("td",{className:"py-2 pr-4 text-muted-foreground",children:"string"}),e.jsx("td",{className:"py-2 pr-4 text-muted-foreground",children:"currentColor"}),e.jsx("td",{className:"py-2 text-muted-foreground",children:"Cor do ícone"})]}),e.jsxs("tr",{className:"border-b",children:[e.jsx("td",{className:"py-2 pr-4 font-mono text-xs",children:"strokeWidth"}),e.jsx("td",{className:"py-2 pr-4 text-muted-foreground",children:"number"}),e.jsx("td",{className:"py-2 pr-4 text-muted-foreground",children:"2"}),e.jsx("td",{className:"py-2 text-muted-foreground",children:"Espessura do traço"})]}),e.jsxs("tr",{className:"border-b",children:[e.jsx("td",{className:"py-2 pr-4 font-mono text-xs",children:"absoluteStrokeWidth"}),e.jsx("td",{className:"py-2 pr-4 text-muted-foreground",children:"boolean"}),e.jsx("td",{className:"py-2 pr-4 text-muted-foreground",children:"false"}),e.jsx("td",{className:"py-2 text-muted-foreground",children:"Se verdadeiro, a espessura não escala com o tamanho"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4 font-mono text-xs",children:"className"}),e.jsx("td",{className:"py-2 pr-4 text-muted-foreground",children:"string"}),e.jsx("td",{className:"py-2 pr-4 text-muted-foreground",children:"-"}),e.jsx("td",{className:"py-2 text-muted-foreground",children:"Classes CSS (preferido para estilização)"})]})]})]})})})]}),e.jsxs(c,{children:[e.jsxs(d,{children:[e.jsx(n,{children:"Tamanhos"}),e.jsx(i,{children:"Exemplos de diferentes tamanhos de ícones"})]}),e.jsxs(o,{children:[e.jsx("div",{className:"flex items-end gap-6 flex-wrap",children:[16,20,24,32,40,48].map(s=>e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(T,{size:s,className:"text-primary"}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[s,"px"]})]},s))}),e.jsx("pre",{className:"bg-muted p-3 rounded-md text-sm mt-4 overflow-x-auto",children:`<Star size={16} />
|
|
20
|
-
<Star className="h-5 w-5" /> {/* 20px - Tailwind */}
|
|
21
|
-
<Star className="h-6 w-6" /> {/* 24px - Default */}
|
|
22
|
-
<Star size={32} />
|
|
23
|
-
<Star className="h-10 w-10" /> {/* 40px */}
|
|
24
|
-
<Star size={48} />`})]})]}),e.jsxs(c,{children:[e.jsxs(d,{children:[e.jsx(n,{children:"Cores"}),e.jsx(i,{children:"Use classes Tailwind para definir cores semânticas"})]}),e.jsxs(o,{children:[e.jsxs("div",{className:"flex items-center gap-6 flex-wrap",children:[e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(u,{className:"h-8 w-8"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"default"})]}),e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(u,{className:"h-8 w-8 text-primary"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"primary"})]}),e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(u,{className:"h-8 w-8 text-muted-foreground"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"muted"})]}),e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(u,{className:"h-8 w-8 text-destructive"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"destructive"})]}),e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(u,{className:"h-8 w-8 text-success"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"success"})]}),e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(u,{className:"h-8 w-8 text-warning"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"warning"})]})]}),e.jsx("pre",{className:"bg-muted p-3 rounded-md text-sm mt-4 overflow-x-auto",children:`<Heart className="h-8 w-8" /> {/* currentColor */}
|
|
25
|
-
<Heart className="h-8 w-8 text-primary" /> {/* cor primária */}
|
|
26
|
-
<Heart className="h-8 w-8 text-muted-foreground" /> {/* cor muted */}
|
|
27
|
-
<Heart className="h-8 w-8 text-destructive" /> {/* cor de erro */}
|
|
28
|
-
<Heart className="h-8 w-8 text-success" /> {/* cor de sucesso */}
|
|
29
|
-
<Heart className="h-8 w-8 text-warning" /> {/* cor de aviso */}`})]})]}),e.jsxs(c,{children:[e.jsxs(d,{children:[e.jsx(n,{children:"Espessura do Traço"}),e.jsx(i,{children:"Personalize a espessura do traço dos ícones"})]}),e.jsxs(o,{children:[e.jsx("div",{className:"flex items-center gap-6 flex-wrap",children:[1,1.5,2,2.5,3].map(s=>e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(P,{size:32,strokeWidth:s,className:"text-primary"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:s})]},s))}),e.jsx("pre",{className:"bg-muted p-3 rounded-md text-sm mt-4 overflow-x-auto",children:`<Circle strokeWidth={1} /> {/* fino */}
|
|
30
|
-
<Circle strokeWidth={1.5} /> {/* leve */}
|
|
31
|
-
<Circle strokeWidth={2} /> {/* padrão */}
|
|
32
|
-
<Circle strokeWidth={2.5} /> {/* médio */}
|
|
33
|
-
<Circle strokeWidth={3} /> {/* grosso */}`})]})]}),e.jsxs(c,{children:[e.jsxs(d,{children:[e.jsx(n,{children:"Boas Práticas"}),e.jsx(i,{children:"Diretrizes para uso consistente de ícones"})]}),e.jsxs(o,{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2 text-green-600 dark:text-green-400",children:"✅ Faça"}),e.jsxs("ul",{className:"list-disc list-inside space-y-1 text-sm text-muted-foreground",children:[e.jsx("li",{children:"Use importações individuais para melhor tree-shaking"}),e.jsxs("li",{children:["Prefira ",e.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:"className"})," para estilização via Tailwind"]}),e.jsx("li",{children:"Use tamanhos consistentes em contextos similares (h-4 w-4 para botões, h-5 w-5 para menus)"}),e.jsx("li",{children:"Use cores semânticas do design system (text-primary, text-muted-foreground)"}),e.jsxs("li",{children:["Adicione ",e.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:'aria-hidden="true"'})," para ícones decorativos"]})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2 text-red-600 dark:text-red-400",children:"❌ Não Faça"}),e.jsxs("ul",{className:"list-disc list-inside space-y-1 text-sm text-muted-foreground",children:[e.jsxs("li",{children:["Não importe todos os ícones com ",e.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:"import * as Icons"})]}),e.jsxs("li",{children:["Não use cores hardcoded como ",e.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:'color="#ff0000"'})]}),e.jsx("li",{children:"Não misture tamanhos inconsistentes na mesma interface"}),e.jsx("li",{children:"Não use ícones sem texto ou label para ações importantes"})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Padrões de Tamanho Recomendados"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b",children:[e.jsx("th",{className:"text-left py-2 pr-4 font-semibold",children:"Contexto"}),e.jsx("th",{className:"text-left py-2 pr-4 font-semibold",children:"Classe Tailwind"}),e.jsx("th",{className:"text-left py-2 font-semibold",children:"Tamanho"})]})}),e.jsxs("tbody",{children:[e.jsxs("tr",{className:"border-b",children:[e.jsx("td",{className:"py-2 pr-4",children:"Botões pequenos"}),e.jsx("td",{className:"py-2 pr-4 font-mono text-xs",children:"h-3.5 w-3.5"}),e.jsx("td",{className:"py-2 text-muted-foreground",children:"14px"})]}),e.jsxs("tr",{className:"border-b",children:[e.jsx("td",{className:"py-2 pr-4",children:"Botões e inputs"}),e.jsx("td",{className:"py-2 pr-4 font-mono text-xs",children:"h-4 w-4"}),e.jsx("td",{className:"py-2 text-muted-foreground",children:"16px"})]}),e.jsxs("tr",{className:"border-b",children:[e.jsx("td",{className:"py-2 pr-4",children:"Menus e listas"}),e.jsx("td",{className:"py-2 pr-4 font-mono text-xs",children:"h-5 w-5"}),e.jsx("td",{className:"py-2 text-muted-foreground",children:"20px"})]}),e.jsxs("tr",{className:"border-b",children:[e.jsx("td",{className:"py-2 pr-4",children:"Headers e destaque"}),e.jsx("td",{className:"py-2 pr-4 font-mono text-xs",children:"h-6 w-6"}),e.jsx("td",{className:"py-2 text-muted-foreground",children:"24px"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:"Empty states"}),e.jsx("td",{className:"py-2 pr-4 font-mono text-xs",children:"h-12 w-12"}),e.jsx("td",{className:"py-2 text-muted-foreground",children:"48px"})]})]})]})})]})]})]}),e.jsxs(c,{children:[e.jsxs(d,{children:[e.jsx(n,{children:"Links Úteis"}),e.jsx(i,{children:"Recursos adicionais da biblioteca Lucide"})]}),e.jsx(o,{children:e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsxs("a",{href:"https://lucide.dev/icons",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm text-primary hover:underline",children:[e.jsx(v,{className:"h-4 w-4"}),"Catálogo Oficial"]}),e.jsxs("a",{href:"https://lucide.dev/guide/packages/lucide-react",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm text-primary hover:underline",children:[e.jsx(v,{className:"h-4 w-4"}),"Documentação React"]}),e.jsxs("a",{href:"https://github.com/lucide-icons/lucide",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm text-primary hover:underline",children:[e.jsx(M,{className:"h-4 w-4"}),"GitHub"]})]})})]})]})}export{le as IconsFoundationDoc};
|