forlogic-core 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -46
- package/dist/assets/AccordionDoc-CGNlubG3.js +31 -0
- package/dist/assets/ActionButtonDoc-CYtkXR0k.js +47 -0
- package/dist/assets/ActionPlanDoc-BSuPRftQ.js +65 -0
- package/dist/assets/AlertDoc-Cpvxneqg.js +37 -0
- package/dist/assets/AliasUrlDoc-DIpUWf4Y.js +189 -0
- package/dist/assets/AppHeaderDoc-DNQErj_t.js +74 -0
- package/dist/assets/AppSidebarDoc-DkeQarDu.js +221 -0
- package/dist/assets/ApprovalFlowDoc-8YgXbhKJ.js +31 -0
- package/dist/assets/AuditLogDoc-BBvNcHIo.js +67 -0
- package/dist/assets/AuditTrailDoc-DgFHO-uo.js +17 -0
- package/dist/assets/AuthDoc-WIA_Aetl.js +200 -0
- package/dist/assets/AvatarDoc-B6go1C1T.js +11 -0
- package/dist/assets/BadgeDoc-BONhfqB_.js +36 -0
- package/dist/assets/BaseFormDoc-CuyUArcj.js +169 -0
- package/dist/assets/BodyContentDoc-CterHC1E.js +83 -0
- package/dist/assets/BreadcrumbDoc-Dwn9nLeO.js +75 -0
- package/dist/assets/ButtonDoc-BOjRseZT.js +41 -0
- package/dist/assets/ButtonGroupDoc-8IS6PPh4.js +7 -0
- package/dist/assets/CalendarDoc-CMwIEqgT.js +81 -0
- package/dist/assets/CardDoc-BZz1CVg2.js +49 -0
- package/dist/assets/ChartDoc-B5vZVtqD.js +76 -0
- package/dist/assets/CheckboxDoc-lAbYO9I5.js +55 -0
- package/dist/assets/ColorPickerDoc-Dpsprp4N.js +10 -0
- package/dist/assets/ColorsFoundationDoc-CCHeSL3p.js +13 -0
- package/dist/assets/ComboTreeDoc-D4dTkIt-.js +46 -0
- package/dist/assets/ComboboxDoc-CqqZPvZq.js +134 -0
- package/dist/assets/ComponentDocTemplate-CQbBhfvZ.js +1 -0
- package/dist/assets/ContextMenuDoc-D3jC-MVA.js +182 -0
- package/dist/assets/ContextsDoc-XFH0-JdS.js +211 -0
- package/dist/assets/CreateCrudPageDoc-CpuiWI-g.js +106 -0
- package/dist/assets/CrudActionBarDoc-wuBGXD9Y.js +112 -0
- package/dist/assets/CrudGridDoc-BYWqSXBH.js +85 -0
- package/dist/assets/CrudOverviewDoc-B_bk2a2t.js +14 -0
- package/dist/assets/CrudPrimitivesDoc-CxaTB94A.js +164 -0
- package/dist/assets/CrudTableDoc-Dga1VgCu.js +113 -0
- package/dist/assets/CustomFormFieldsDoc-C1hwwSl3.js +33 -0
- package/dist/assets/DashboardFormDoc-BUDCmrMl.js +49 -0
- package/dist/assets/DashboardGeneralViewDoc-Cyg1SIiG.js +71 -0
- package/dist/assets/DashboardGridDoc-BavePiRF.js +49 -0
- package/dist/assets/DashboardListDoc-CLyMA6UK.js +37 -0
- package/dist/assets/DashboardOverviewDoc-DRVvNIF1.js +35 -0
- package/dist/assets/DashboardPanelRendererDoc--mfwb8Nc.js +60 -0
- package/dist/assets/DashboardPanelsBasicDoc-BQ2V_52D.js +62 -0
- package/dist/assets/DashboardPanelsCartesianDoc-sy-hcVQY.js +75 -0
- package/dist/assets/DashboardPanelsSpecialDoc-DsIUCRRP.js +83 -0
- package/dist/assets/DashboardViewDoc-CtlCNlEF.js +45 -0
- package/dist/assets/DataListDoc-DUy88lCQ.js +13 -0
- package/dist/assets/DesignSystemHome-DHl9YtbH.js +1 -0
- package/dist/assets/DialogDoc-CMQqnTV-.js +981 -0
- package/dist/assets/DropdownMenuDoc-S7X9csGt.js +175 -0
- package/dist/assets/ElectronicSignatureDialogDoc-BfithaL_.js +57 -0
- package/dist/assets/EmptyStateDoc-CHGCiGIk.js +35 -0
- package/dist/assets/EnvironmentsDoc-DZHJZ2nm.js +96 -0
- package/dist/assets/ErrorBoundaryDoc-DoaAg68p.js +111 -0
- package/dist/assets/ExampleActionPlanPage-C0fIMZCD.js +1 -0
- package/dist/assets/ExampleAppDoc-DzIU81Fn.js +1 -0
- package/dist/assets/ExampleCard-DuLrb3t-.js +1 -0
- package/dist/assets/ExampleCrudReportsPage-M0pz6tdM.js +1 -0
- package/dist/assets/ExampleDashboardPage-CRG5r3Vw.js +1 -0
- package/dist/assets/ExampleIdeasPage-I84ZMLY4.js +1 -0
- package/dist/assets/ExampleImportWizardPage-h4YqrrSe.js +1 -0
- package/dist/assets/ExampleSettingsPage-CwdWqoaP.js +1 -0
- package/dist/assets/FileUploadDoc-9-UujFNX.js +34 -0
- package/dist/assets/FilterBar-DDTqqUfZ.js +1 -0
- package/dist/assets/FormDoc-CVES6n3d.js +81 -0
- package/dist/assets/FoundationOverview-DT0u11Gz.js +1 -0
- package/dist/assets/GridDoc-CbHFSILF.js +28 -0
- package/dist/assets/HooksDoc-Ctxdk6Wq.js +665 -0
- package/dist/assets/HoverCardDoc-8Wkaafdj.js +31 -0
- package/dist/assets/I18nDoc-D3Q2m7ik.js +167 -0
- package/dist/assets/IconPickerDoc-DZ26Gdpg.js +10 -0
- package/dist/assets/IconsFoundationDoc-xOxtC7CW.js +33 -0
- package/dist/assets/InputDoc-BhztAiuJ.js +211 -0
- package/dist/assets/LabelDoc-A4hmTRRV.js +42 -0
- package/dist/assets/LeadershipDoc-CqOSfWsP.js +452 -0
- package/dist/assets/MediaDoc-C78gvC8p.js +459 -0
- package/dist/assets/MenubarDoc-DCnmd2tO.js +165 -0
- package/dist/assets/ModuleAccessDoc-CmD5nHDp.js +153 -0
- package/dist/assets/ModulesDialogDoc-DVit1CA-.js +46 -0
- package/dist/assets/MultiselectPermissionsDoc-tlJMs04L.js +34 -0
- package/dist/assets/NavigationMenuDoc-q1fbc89j.js +116 -0
- package/dist/assets/OnboardingDialogDoc-3A3eBYrq.js +55 -0
- package/dist/assets/PaginationDoc-B8-bMz5J.js +27 -0
- package/dist/assets/PaginationDoc-BkGdxHL3.js +98 -0
- package/dist/assets/PlacesDoc-CKPO6ATs.js +226 -0
- package/dist/assets/PopoverDoc-CJPU4Ags.js +64 -0
- package/dist/assets/ProgressDoc-CpjbTL4o.js +29 -0
- package/dist/assets/QualiexUserFieldDoc-DDwumlRw.js +149 -0
- package/dist/assets/RadioGroupDoc-D6tSZz8G.js +57 -0
- package/dist/assets/RadiusDoc-B4xSnajw.js +7 -0
- package/dist/assets/ReportRequestListDoc-C0LIaU8P.js +15 -0
- package/dist/assets/RequiredFieldsCounterDoc-COesoSdx.js +58 -0
- package/dist/assets/ResizableDoc-CW0-XQuB.js +104 -0
- package/dist/assets/RichTextEditorDoc-C8c_XA9P.js +24 -0
- package/dist/assets/ScrollAreaDoc-BxtoAPaZ.js +28 -0
- package/dist/assets/SecurityDoc-wOVqpg2F.js +204 -0
- package/dist/assets/SelectDoc-C75gtY9D.js +80 -0
- package/dist/assets/SeparatorDoc-BjQBPB1P.js +4 -0
- package/dist/assets/ServicesDoc-CXTctwBl.js +308 -0
- package/dist/assets/ShadowsDoc-C6Lw8_x2.js +9 -0
- package/dist/assets/SignDoc-Bh5ZUg5x.js +66 -0
- package/dist/assets/SkeletonDoc-rTLGK5VE.js +54 -0
- package/dist/assets/SliderDoc-JMAMDub7.js +41 -0
- package/dist/assets/SpacingDoc-RljOrpwA.js +12 -0
- package/dist/assets/SplitButtonDoc-CvShUW3w.js +53 -0
- package/dist/assets/StepSelectorDoc-C-nAap9H.js +41 -0
- package/dist/assets/SwitchDoc-DLnqmkPr.js +56 -0
- package/dist/assets/TableDoc-B8EpWLVg.js +128 -0
- package/dist/assets/TabsDoc-DIBtl_uC.js +42 -0
- package/dist/assets/TeamSelectorDoc-B7OnCbL7.js +10 -0
- package/dist/assets/TermsOfUseDoc-Bb-pw08s.js +16 -0
- package/dist/assets/TextareaDoc-DGnqMqEC.js +46 -0
- package/dist/assets/ToastDoc-DjYyc7ae.js +157 -0
- package/dist/assets/ToggleDoc-C9ZOVjkY.js +51 -0
- package/dist/assets/TooltipDoc-BEx4l9-i.js +58 -0
- package/dist/assets/TruncatedCellDoc-BbV1bRSY.js +12 -0
- package/dist/assets/TypographyFoundationDoc-CUDYjRo9.js +7 -0
- package/dist/assets/UpdatesNotificationDoc-7nyjzLMJ.js +29 -0
- package/dist/assets/UsersGroupsSelectorDoc-C0KlTAL5.js +18 -0
- package/dist/assets/UtilitiesDoc-DGxaHVV1.js +145 -0
- package/dist/assets/ViewerDialogsDoc-CnTPTEz0.js +1 -0
- package/dist/assets/blocks-B6LrJeAM.js +1 -0
- package/dist/assets/building-DeVappnD.js +1 -0
- package/dist/assets/calendar-days-BQ0na5kM.js +1 -0
- package/dist/assets/check-check-C_-PJCJa.js +1 -0
- package/dist/assets/circle-plus-CpIcep-O.js +1 -0
- package/dist/assets/circle-x-jPpBPew0.js +1 -0
- package/dist/assets/clipboard-list-CXNPdciZ.js +1 -0
- package/dist/assets/cloud-upload-BEjzumjl.js +1 -0
- package/dist/assets/crown-CqNsQIsm.js +1 -0
- package/dist/assets/date-picker-BW3eGOe_.js +1 -0
- package/dist/assets/disabled-menu-item-C2YaMvSt.js +1 -0
- package/dist/assets/drawer-D5rflIcD.js +3 -0
- package/dist/assets/file-braces-DFb5X9so.js +1 -0
- package/dist/assets/file-pen-line-CyUGKkEN.js +1 -0
- package/dist/assets/git-branch-BcXv9mpp.js +1 -0
- package/dist/assets/globe-CpMIWAcv.js +1 -0
- package/dist/assets/hash-cQWdKjya.js +1 -0
- package/dist/assets/hourglass-BahQ3eDv.js +1 -0
- package/dist/assets/hover-card-R66N85sZ.js +1 -0
- package/dist/assets/iframe-dialog-V0mW5aBb.js +1 -0
- package/dist/assets/index-DkiftrvI.js +352 -0
- package/dist/assets/index-nmBjO9Th.css +1 -0
- package/dist/assets/life-buoy-ByXiPddz.js +1 -0
- package/dist/assets/loading-state-Cb5_t5uE.js +1 -0
- package/dist/assets/lucide-react-Cp3Yw3Zm.js +1 -0
- package/dist/assets/package-B3-pVvPM.js +1 -0
- package/dist/assets/pen-Bi_lmmKT.js +1 -0
- package/dist/assets/pin-DVsSl8QA.js +1 -0
- package/dist/assets/printer-BnJ8B6m-.js +1 -0
- package/dist/assets/radio-group-BHAaNGsm.js +1 -0
- package/dist/assets/server-CtzFTfKR.js +1 -0
- package/dist/assets/share-2-Dv8Do445.js +1 -0
- package/dist/assets/shield-check-CFXjOV_w.js +1 -0
- package/dist/assets/shield-x-DJTRfVux.js +1 -0
- package/dist/assets/slider-v9tXBSnB.js +1 -0
- package/dist/assets/smartphone-BSNR60L7.js +1 -0
- package/dist/assets/step-selector-ATTh_9Wa.js +1 -0
- package/dist/assets/text-align-start-qE-MbYYw.js +1 -0
- package/dist/assets/thumbs-up-D_XIW_uX.js +1 -0
- package/dist/assets/trash-DTWQwpwA.js +1 -0
- package/dist/assets/trending-up-jip5-leJ.js +1 -0
- package/dist/assets/useMockCrud-CN4vjyOZ.js +1 -0
- package/dist/assets/user-check-BlH3EDWK.js +1 -0
- package/dist/assets/user-plus-BqwXwD-c.js +1 -0
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/resizable.d.ts +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.html +33 -0
- package/dist/index.js +1 -1
- package/dist/setup/favicon.d.ts +1 -0
- package/docs/PUBLISH.md +3 -3
- package/package.json +1 -5
- 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
|
@@ -0,0 +1,981 @@
|
|
|
1
|
+
import{j as e,E as x,fW as h,x as a,G as g,H as v,I as f,fX as M,X as j,J as d,K as u,a$ as Se,fY as E,fZ as z,f_ as q,f$ as R,g0 as V,g1 as we,g2 as ye,r as i,F as Te,as as W,A as U,T as Be,i as ke,k as te,l as D,dC as F,p as Fe,bl as Pe,q as C,bm as Le,bk as Oe,o as y,aH as He,bp as Ae,aI as Ie,B as P,bo as Ee,M as le,bs as ne,dn as oe,ab as ie,w as ze,dv as G,dh as qe,a4 as Re,aX as de,g3 as ce,g4 as me,g5 as pe,g6 as ue,g7 as xe,g8 as he,g9 as ge,dD as Ve}from"./index-DkiftrvI.js";import{C as We}from"./ComponentDocTemplate-CQbBhfvZ.js";import{D as Me,a as Ue,b as Ge,c as Xe,d as Qe,e as Je,f as $e,g as Ke}from"./drawer-D5rflIcD.js";import{C as Ye}from"./circle-plus-CpIcep-O.js";import{G as Ze}from"./git-branch-BcXv9mpp.js";import{S as X}from"./step-selector-ATTh_9Wa.js";import{D as re}from"./date-picker-BW3eGOe_.js";import"./ExampleCard-DuLrb3t-.js";function T({icon:l,title:o,description:s,selected:r,onClick:t}){return e.jsxs("div",{onClick:t,className:y("flex items-center gap-4 p-4 border rounded-lg cursor-pointer transition-all","hover:border-primary/50 hover:bg-muted/30",r&&"border-primary bg-primary/5"),children:[e.jsx("div",{className:"flex-shrink-0 w-12 h-12 rounded-lg bg-muted flex items-center justify-center text-primary",children:l}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h4",{className:"font-semibold text-foreground text-sm",children:o}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s})]})]})}function _e(){const[l,o]=i.useState(!1),[s,r]=i.useState(null),[t,m]=i.useState(1),p=3,N=["Seleção","Configuração","Confirmação"];return e.jsxs(x,{open:l,onOpenChange:o,children:[e.jsx(h,{asChild:!0,children:e.jsx(a,{variant:"outline",children:"Dialog com Seleção"})}),e.jsxs(g,{size:"md",children:[e.jsx(v,{showSeparator:!0,children:e.jsx(f,{children:"Título"})}),e.jsxs("div",{className:"flex-1 min-h-0 overflow-auto py-4 px-1 -mx-1",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("h4",{className:"font-semibold text-foreground",children:"Subtítulo"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Texto descritivo"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(T,{icon:e.jsx(Te,{className:"h-5 w-5"}),title:"Card 1",description:"Texto descritivo",selected:s===1,onClick:()=>r(1)}),e.jsx(T,{icon:e.jsx(Ye,{className:"h-5 w-5"}),title:"Card 2",description:"Texto descritivo",selected:s===2,onClick:()=>r(2)}),e.jsx(T,{icon:e.jsx(W,{className:"h-5 w-5"}),title:"Card 3",description:"Texto descritivo",selected:s===3,onClick:()=>r(3)})]})]}),e.jsxs(j,{className:"flex-row items-center justify-between sm:justify-between",children:[e.jsx(X,{currentStep:t,totalSteps:p,onStepChange:m,stepLabels:N}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(a,{variant:"outline",onClick:()=>o(!1),children:"Cancelar"}),e.jsxs(a,{disabled:!s,children:["Avançar",e.jsx(U,{className:"h-4 w-4 ml-2"})]})]})]})]})]})}function ea({icon:l,title:o,description:s,type:r,onView:t}){return e.jsxs("div",{className:"flex items-start gap-3 p-3 border rounded-lg bg-background",children:[e.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-success/10 flex items-center justify-center text-success",children:l}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h5",{className:"font-medium text-sm text-foreground",children:o}),e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1",children:s})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx(P,{className:"bg-success hover:bg-success/90 text-success-foreground",children:r}),e.jsx(a,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:t,children:e.jsx(de,{className:"h-4 w-4"})})]})]})}const aa=[{id:1,name:"Título",code:"9876543210",responsible:"Leonardo Paes Horácio",email:"leonardo@forlogic.net",date:"01/01/2026",linksCount:6,description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua",linkedItems:[{id:1,title:"Título",description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod",type:"Fluxos"},{id:2,title:"Título",description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod",type:"Fluxos"},{id:3,title:"Título",description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod",type:"Fluxos"},{id:4,title:"Título",description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod",type:"Fluxos"},{id:5,title:"Título",description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod",type:"Fluxos"},{id:6,title:"Título",description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod",type:"Fluxos"}]},{id:2,name:"Título",code:"9081726354",responsible:"Leonardo Paes Horácio",email:"leonardo@forlogic.net",date:"01/01/2026",linksCount:6,description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua",linkedItems:[{id:1,title:"Título",description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod",type:"Fluxos"},{id:2,title:"Título",description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod",type:"Fluxos"}]},{id:3,name:"Título",code:"2468135790",responsible:"Leonardo Paes Horácio",email:"leonardo@forlogic.net",date:"01/01/2026",linksCount:6,description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit",linkedItems:[{id:1,title:"Título",description:"Lorem ipsum dolor sit amet",type:"Fluxos"}]},{id:4,name:"Título",code:"1357924680",responsible:"Leonardo Paes Horácio",email:"leonardo@forlogic.net",date:"01/01/2026",linksCount:6,description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit",linkedItems:[]}];function sa(){const[l,o]=i.useState(!1),[s,r]=i.useState(1),[t,m]=i.useState(1),p=3,N=["Seleção de Dados","Revisão","Conclusão"];return e.jsxs(x,{open:l,onOpenChange:o,children:[e.jsx(h,{asChild:!0,children:e.jsx(a,{variant:"outline",children:"Dialog com Tabela"})}),e.jsxs(g,{size:"lg",children:[e.jsx(v,{showSeparator:!0,children:e.jsx(f,{children:"Título"})}),e.jsxs("div",{className:"flex-1 min-h-0 overflow-auto py-4 space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-foreground",children:"Subtítulo"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Texto descritivo"})]}),e.jsx("div",{className:"border rounded-lg overflow-hidden",children:e.jsxs(Be,{children:[e.jsx(ke,{children:e.jsxs(te,{className:"bg-muted/50",children:[e.jsx(D,{className:"w-[40px]"}),e.jsx(D,{children:e.jsxs("div",{className:"flex items-center gap-1",children:["Nome",e.jsx(F,{className:"h-4 w-4 text-muted-foreground"})]})}),e.jsx(D,{children:e.jsxs("div",{className:"flex items-center gap-1",children:["Código/ID",e.jsx(F,{className:"h-4 w-4 text-muted-foreground"})]})}),e.jsx(D,{children:e.jsxs("div",{className:"flex items-center gap-1",children:["Responsável",e.jsx(F,{className:"h-4 w-4 text-muted-foreground"})]})}),e.jsx(D,{children:e.jsxs("div",{className:"flex items-center gap-1",children:["Criado em",e.jsx(F,{className:"h-4 w-4 text-muted-foreground"})]})}),e.jsx(D,{children:e.jsxs("div",{className:"flex items-center gap-1",children:["Vínculos",e.jsx(F,{className:"h-4 w-4 text-muted-foreground"})]})}),e.jsx(D,{className:"w-[120px]"})]})}),e.jsx(Fe,{children:aa.map(n=>e.jsx(Pe,{open:s===n.id,onOpenChange:b=>r(b?n.id:null),asChild:!0,children:e.jsxs(e.Fragment,{children:[e.jsxs(te,{className:"border-b",children:[e.jsx(C,{children:e.jsx(Le,{asChild:!0,children:e.jsx(a,{variant:"ghost",size:"icon",className:"h-8 w-8",children:e.jsx(Oe,{className:y("h-4 w-4 transition-transform duration-200",s===n.id&&"rotate-180")})})})}),e.jsx(C,{className:"font-medium",children:n.name}),e.jsx(C,{children:n.code}),e.jsx(C,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(He,{className:"h-8 w-8",children:[e.jsx(Ae,{src:""}),e.jsx(Ie,{className:"text-xs bg-primary/10 text-primary",children:"LP"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:n.responsible}),e.jsx("p",{className:"text-xs text-muted-foreground",children:n.email})]})]})}),e.jsx(C,{children:n.date}),e.jsx(C,{children:e.jsxs(P,{variant:"outline",children:[n.linksCount," Vínculos"]})}),e.jsx(C,{children:e.jsx(a,{size:"sm",children:"Selecionar"})})]}),e.jsx(Ee,{asChild:!0,children:e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"p-4 bg-muted/30 border-b",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-foreground",children:"Título"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:n.description})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h4",{className:"font-semibold text-foreground",children:"Título"}),e.jsxs(P,{variant:"outline",children:[n.linkedItems.length," vínculos"]})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:n.linkedItems.map(b=>e.jsx(ea,{icon:e.jsx(Ze,{className:"h-4 w-4"}),title:b.title,description:b.description,type:b.type},b.id))})]})]})})})})]})},n.id))})]})})]}),e.jsxs(j,{className:"flex-row items-center justify-between sm:justify-between",children:[e.jsx(X,{currentStep:t,totalSteps:p,onStepChange:m,stepLabels:N}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(a,{variant:"outline",onClick:()=>o(!1),children:"Cancelar"}),e.jsxs(a,{children:["Avançar",e.jsx(U,{className:"h-4 w-4 ml-2"})]})]})]})]})]})}function ta(){const[l,o]=i.useState(!1);return e.jsxs(x,{open:l,onOpenChange:o,children:[e.jsx(h,{asChild:!0,children:e.jsx(a,{variant:"outline",children:"Dialog com Formulário"})}),e.jsxs(g,{size:"lg",children:[e.jsx(v,{showSeparator:!0,children:e.jsx(f,{children:"Novo Plano de Controle"})}),e.jsxs("div",{className:"flex-1 min-h-0 overflow-auto py-4 px-1 -mx-1 space-y-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"font-semibold text-foreground",children:"Identificação"}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(d,{htmlFor:"planNumber",children:["Número do Plano ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(u,{id:"planNumber",defaultValue:"9876543210"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"emissionDate",children:"Data de emissão"}),e.jsx(u,{id:"emissionDate",type:"date",defaultValue:"2025-09-17"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"revisionDate",children:"Data de revisão"}),e.jsx(u,{id:"revisionDate",type:"date",defaultValue:"2025-10-17"})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"font-semibold text-foreground",children:"Cliente e Organização"}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(d,{htmlFor:"clientName",children:["Nome do cliente ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(u,{id:"clientName",placeholder:"Insira o nome do cliente"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(d,{htmlFor:"orgName",children:["Nome da organização ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(u,{id:"orgName",placeholder:"Insira o nome da organização"})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"font-semibold text-foreground",children:"Produto/Peça"}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(d,{htmlFor:"partNumber",children:["Número da peça ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(u,{id:"partNumber",placeholder:"Insira o número da peça"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(d,{htmlFor:"engLevel",children:["Nível de engenharia ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(u,{id:"engLevel",placeholder:"Insira o nível"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(d,{htmlFor:"partDescription",children:["Descrição da peça ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(le,{id:"partDescription",placeholder:"Descreva detalhes sobre a peça...",rows:3})]})]})]}),e.jsxs(j,{children:[e.jsx(a,{variant:"outline",onClick:()=>o(!1),children:"Cancelar"}),e.jsxs(a,{children:[e.jsx(ne,{className:"h-4 w-4 mr-2"}),"Salvar"]})]})]})]})}function oa(){const[l,o]=i.useState(!1),[s,r]=i.useState(1),[t,m]=i.useState(null),[p,N]=i.useState(""),[n,b]=i.useState(""),[L,Q]=i.useState(""),[O,J]=i.useState(""),[S,$]=i.useState(void 0),[H,K]=i.useState(void 0),[B,Y]=i.useState(null),[k,Z]=i.useState(!0),A=4,ve=["Tipo do Projeto","Informações Básicas","Configurações","Confirmação"],_=["Projeto Interno","Projeto Cliente","Projeto Temporário"],ee=["Para uso da equipe interna","Para entrega a clientes externos","Com data de expiração definida"],ae=["Baixa","Média","Alta","Crítica"],fe=["bg-muted","bg-primary/20","bg-warning/20","bg-destructive/20"],I=c=>{switch(c){case 1:return t!==null;case 2:return p.trim().length>0&&L.trim().length>0;case 3:return!!S&&B!==null;case 4:return!0;default:return!1}},je=c=>{for(let w=1;w<c;w++)if(!I(w))return!1;return!0},Ne=()=>{s<A&&I(s)&&r(s+1)},be=()=>{s>1&&r(s-1)},De=()=>{o(!1),se()},se=()=>{r(1),m(null),N(""),b(""),Q(""),J(""),$(void 0),K(void 0),Y(null),Z(!0)},Ce=c=>{o(c),c||se()};return e.jsxs(x,{open:l,onOpenChange:Ce,children:[e.jsx(h,{asChild:!0,children:e.jsx(a,{variant:"outline",children:"Dialog com Wizard"})}),e.jsxs(g,{size:"lg",children:[e.jsx(v,{showSeparator:!0,children:e.jsx(f,{children:"Novo Projeto"})}),e.jsxs("div",{className:"flex-1 min-h-0 overflow-auto py-4 px-1 -mx-1",children:[s===1&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-foreground",children:"Selecione o tipo de projeto"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Escolha uma opção para continuar"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[e.jsx(T,{icon:e.jsx(oe,{className:"h-5 w-5"}),title:"Projeto Interno",description:"Para uso da equipe interna",selected:t===1,onClick:()=>m(1)}),e.jsx(T,{icon:e.jsx(ie,{className:"h-5 w-5"}),title:"Projeto Cliente",description:"Para entrega a clientes externos",selected:t===2,onClick:()=>m(2)}),e.jsx(T,{icon:e.jsx(W,{className:"h-5 w-5"}),title:"Projeto Temporário",description:"Com data de expiração definida",selected:t===3,onClick:()=>m(3)})]}),t&&e.jsx("div",{className:"p-3 bg-primary/5 border border-primary/20 rounded-lg",children:e.jsxs("p",{className:"text-sm text-primary",children:[e.jsxs("strong",{children:[_[t-1],":"]})," ",ee[t-1]]})})]}),s===2&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-foreground",children:"Informações básicas"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Preencha os dados do projeto"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"col-span-2 space-y-2",children:[e.jsxs(d,{htmlFor:"projectName",children:["Nome do projeto ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(u,{id:"projectName",placeholder:"Ex: Sistema de Gestão de Qualidade",value:p,onChange:c=>N(c.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(d,{htmlFor:"responsible",children:["Responsável ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(u,{id:"responsible",placeholder:"Nome do responsável",value:L,onChange:c=>Q(c.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"department",children:"Departamento"}),e.jsx(u,{id:"department",placeholder:"Ex: Tecnologia",value:O,onChange:c=>J(c.target.value)})]}),e.jsxs("div",{className:"col-span-2 space-y-2",children:[e.jsx(d,{htmlFor:"projectDesc",children:"Descrição"}),e.jsx(le,{id:"projectDesc",placeholder:"Descreva o objetivo e escopo do projeto...",rows:3,value:n,onChange:c=>b(c.target.value)})]})]})]}),s===3&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-foreground",children:"Configurações do projeto"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Defina prazos e prioridade"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(d,{children:["Data de início ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(re,{date:S,onDateChange:$,placeholder:"Selecione a data de início",className:"w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{children:"Data prevista de conclusão"}),e.jsx(re,{date:H,onDateChange:K,placeholder:"Selecione a data de término",disabledDates:c=>S?c<S:!1,className:"w-full"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs(d,{children:["Prioridade ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx("div",{className:"grid grid-cols-4 gap-2",children:ae.map((c,w)=>e.jsx("button",{type:"button",onClick:()=>Y(w),className:y("p-3 rounded-lg border text-center transition-all text-sm font-medium",B===w?"border-primary bg-primary/10 text-primary":"border-border hover:border-primary/50 hover:bg-muted/50"),children:c},c))})]}),e.jsx(ze,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(d,{className:"text-base",children:"Notificar equipe"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Enviar e-mail para os membros quando o projeto for criado"})]}),e.jsx("button",{type:"button",onClick:()=>Z(!k),className:y("relative inline-flex h-6 w-11 items-center rounded-full transition-colors",k?"bg-primary":"bg-muted"),children:e.jsx("span",{className:y("inline-block h-4 w-4 transform rounded-full bg-white transition-transform",k?"translate-x-6":"translate-x-1")})})]})]}),s===4&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-foreground",children:"Confirmar criação"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Revise as informações antes de concluir"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3 p-3 border rounded-lg bg-muted/30",children:[e.jsxs("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center text-primary",children:[t===1&&e.jsx(oe,{className:"h-5 w-5"}),t===2&&e.jsx(ie,{className:"h-5 w-5"}),t===3&&e.jsx(W,{className:"h-5 w-5"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:t?_[t-1]:"-"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t?ee[t-1]:""})]})]}),e.jsxs("div",{className:"border rounded-lg divide-y",children:[e.jsxs("div",{className:"p-3 flex justify-between items-center",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Nome do projeto"}),e.jsx("span",{className:"text-sm font-medium",children:p})]}),e.jsxs("div",{className:"p-3 flex justify-between items-center",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Responsável"}),e.jsx("span",{className:"text-sm font-medium",children:L})]}),O&&e.jsxs("div",{className:"p-3 flex justify-between items-center",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Departamento"}),e.jsx("span",{className:"text-sm font-medium",children:O})]}),e.jsxs("div",{className:"p-3 flex justify-between items-center",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Período"}),e.jsxs("span",{className:"text-sm font-medium",children:[S?S.toLocaleDateString("pt-BR"):"-",H&&" até "+H.toLocaleDateString("pt-BR")]})]}),e.jsxs("div",{className:"p-3 flex justify-between items-center",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Prioridade"}),e.jsx(P,{className:y(fe[B||0],"text-foreground"),children:B!==null?ae[B]:"-"})]}),e.jsxs("div",{className:"p-3 flex justify-between items-center",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Notificar equipe"}),e.jsx(P,{variant:k?"default":"outline",children:k?"Sim":"Não"})]})]}),n&&e.jsxs("div",{className:"p-3 border rounded-lg",children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:"Descrição"}),e.jsx("p",{className:"text-sm",children:n})]}),e.jsxs("div",{className:"flex items-start gap-2 p-3 bg-primary/5 border border-primary/20 rounded-lg",children:[e.jsx(G,{className:"h-4 w-4 text-primary mt-0.5 shrink-0"}),e.jsx("p",{className:"text-sm text-primary",children:"Ao concluir, o projeto será criado e você poderá adicionar tarefas, membros e documentos."})]})]})]})]}),e.jsxs(j,{className:"flex-row items-center justify-between sm:justify-between",children:[e.jsx(X,{currentStep:s,totalSteps:A,onStepChange:r,stepLabels:ve,canGoToStep:je}),e.jsxs("div",{className:"flex gap-2",children:[s>1&&e.jsxs(a,{variant:"outline",onClick:be,children:[e.jsx(qe,{className:"h-4 w-4 mr-2"}),"Voltar"]}),s<A?e.jsxs(a,{onClick:Ne,disabled:!I(s),children:["Avançar",e.jsx(U,{className:"h-4 w-4 ml-2"})]}):e.jsxs(a,{onClick:De,children:[e.jsx(ne,{className:"h-4 w-4 mr-2"}),"Criar Projeto"]})]})]})]})]})}function ia(){return e.jsxs(x,{children:[e.jsx(h,{asChild:!0,children:e.jsx(a,{variant:"outline",children:"Dialog Simples"})}),e.jsxs(g,{size:"md",children:[e.jsx(v,{showSeparator:!0,children:e.jsx(f,{children:"Título"})}),e.jsxs("div",{className:"flex-1 min-h-0 overflow-auto py-4 px-1 -mx-1",children:[e.jsx("h4",{className:"font-semibold text-foreground",children:"Subtítulo"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Texto descritivo com informações adicionais sobre o conteúdo do dialog."})]})]})]})}function ra(){const[l,o]=i.useState(!1),[s,r]=i.useState(""),t="EXCLUIR",m=p=>{o(p),p||r("")};return e.jsxs(ce,{open:l,onOpenChange:m,children:[e.jsx(me,{asChild:!0,children:e.jsx(a,{variant:"destructive",children:"Excluir Permanentemente"})}),e.jsxs(pe,{children:[e.jsx(ue,{className:"border-b pb-4",children:e.jsx(xe,{children:"Exclusão com Confirmação"})}),e.jsxs("div",{className:"py-4 space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-destructive/10 shrink-0",children:e.jsx(G,{className:"h-5 w-5 text-destructive"})}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-foreground",children:"Excluir permanentemente?"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Esta ação não pode ser desfeita. Isso excluirá permanentemente o registro e removerá todos os dados associados de nossos servidores."})]})]}),e.jsxs("div",{children:[e.jsxs(d,{htmlFor:"confirm-text",className:"text-sm",children:["Digite ",e.jsx("span",{className:"font-semibold text-destructive",children:t})," para confirmar:"]}),e.jsx(u,{id:"confirm-text",className:"mt-2",placeholder:t,value:s,onChange:p=>r(p.target.value)})]})]}),e.jsxs(he,{children:[e.jsx(ge,{children:"Cancelar"}),e.jsx(a,{variant:"destructive",disabled:s!==t,onClick:()=>o(!1),children:"Excluir Permanentemente"})]})]})]})}function la(){const[l,o]=i.useState(!1),[s,r]=i.useState(""),[t,m]=i.useState(!1),p=n=>{o(n),n||(r(""),m(!1))},N=s.length>=6;return e.jsxs(ce,{open:l,onOpenChange:p,children:[e.jsx(me,{asChild:!0,children:e.jsx(a,{variant:"destructive",children:"Excluir com Senha"})}),e.jsxs(pe,{children:[e.jsx(ue,{className:"border-b pb-4",children:e.jsx(xe,{children:"Confirmação de Segurança"})}),e.jsxs("div",{className:"py-4 space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-destructive/10 shrink-0",children:e.jsx(G,{className:"h-5 w-5 text-destructive"})}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-foreground",children:"Confirmar exclusão"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Para confirmar esta ação, digite sua senha de acesso."})]})]}),e.jsxs("div",{children:[e.jsx(d,{htmlFor:"password-confirm",className:"text-sm",children:"Digite sua senha para confirmar:"}),e.jsxs("div",{className:"relative mt-2",children:[e.jsx(u,{id:"password-confirm",type:t?"text":"password",placeholder:"••••••••",value:s,onChange:n=>r(n.target.value)}),e.jsx(a,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 hover:bg-transparent",onClick:()=>m(!t),children:t?e.jsx(Ve,{className:"h-4 w-4"}):e.jsx(de,{className:"h-4 w-4"})})]})]})]}),e.jsxs(he,{children:[e.jsx(ge,{children:"Cancelar"}),e.jsx(a,{variant:"destructive",disabled:!N,onClick:()=>o(!1),children:"Confirmar Exclusão"})]})]})]})}function na(){return e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ra,{}),e.jsx(la,{})]})}function da(){const[l,o]=i.useState(!1),[s,r]=i.useState(!1),[t,m]=i.useState(!1),[p,N]=i.useState(!1);return e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(x,{open:l,onOpenChange:o,children:[e.jsx(h,{asChild:!0,children:e.jsx(a,{variant:"outline",size:"sm",children:"Pequeno (sm)"})}),e.jsxs(g,{size:"sm",children:[e.jsx(v,{showSeparator:!0,children:e.jsx(f,{children:"Dialog Pequeno"})}),e.jsx("div",{className:"py-4",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Ideal para confirmações rápidas e alertas simples."})}),e.jsx(j,{children:e.jsx(a,{variant:"outline",onClick:()=>o(!1),children:"Fechar"})})]})]}),e.jsxs(x,{open:s,onOpenChange:r,children:[e.jsx(h,{asChild:!0,children:e.jsx(a,{variant:"outline",size:"sm",children:"Médio (md)"})}),e.jsxs(g,{size:"md",children:[e.jsx(v,{showSeparator:!0,children:e.jsx(f,{children:"Dialog Médio"})}),e.jsx("div",{className:"py-4",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Tamanho padrão para formulários e conteúdo moderado."})}),e.jsxs(j,{children:[e.jsx(a,{variant:"outline",onClick:()=>r(!1),children:"Cancelar"}),e.jsx(a,{onClick:()=>r(!1),children:"Confirmar"})]})]})]}),e.jsxs(x,{open:t,onOpenChange:m,children:[e.jsx(h,{asChild:!0,children:e.jsx(a,{variant:"outline",size:"sm",children:"Grande (lg)"})}),e.jsxs(g,{size:"lg",children:[e.jsx(v,{showSeparator:!0,children:e.jsx(f,{children:"Dialog Grande"})}),e.jsxs("div",{className:"flex-1 min-h-0 overflow-auto py-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Ideal para tabelas, formulários complexos e conteúdo extenso."}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"p-4 border rounded-lg",children:[e.jsx("h4",{className:"font-medium mb-2",children:"Seção 1"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Conteúdo da primeira seção."})]}),e.jsxs("div",{className:"p-4 border rounded-lg",children:[e.jsx("h4",{className:"font-medium mb-2",children:"Seção 2"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Conteúdo da segunda seção."})]})]})]}),e.jsx(j,{children:e.jsx(a,{variant:"outline",onClick:()=>m(!1),children:"Fechar"})})]})]}),e.jsxs(x,{open:p,onOpenChange:N,children:[e.jsx(h,{asChild:!0,children:e.jsx(a,{variant:"outline",size:"sm",children:"Customizado"})}),e.jsxs(g,{size:"md",customMaxWidth:"600px",customMaxHeight:"400px",children:[e.jsx(v,{showSeparator:!0,children:e.jsx(f,{children:"Dimensões Customizadas"})}),e.jsx("div",{className:"py-4",children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Usa ",e.jsx("code",{className:"bg-muted px-1 rounded",children:'size="md"'})," como base, com ",e.jsx("code",{className:"bg-muted px-1 rounded",children:'customMaxWidth="600px"'}),"."]})}),e.jsx(j,{children:e.jsx(a,{variant:"outline",onClick:()=>N(!1),children:"Fechar"})})]})]})]})}function ca(){const[l,o]=i.useState(!1);return e.jsxs(x,{open:l,onOpenChange:o,children:[e.jsx(h,{asChild:!0,children:e.jsx(a,{variant:"outline",children:"Informative"})}),e.jsxs(g,{variant:"informative",size:"md",children:[e.jsx(v,{showSeparator:!0,children:e.jsx(f,{children:"Informações do Sistema"})}),e.jsx(M,{children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Este dialog pode ser fechado clicando fora, pressionando ESC ou no botão X. Ideal para exibir informações, instruções ou avisos."})})]})]})}function ma(){const[l,o]=i.useState(!1),[s,r]=i.useState(""),t=s.length>0;return e.jsxs(x,{open:l,onOpenChange:o,children:[e.jsx(h,{asChild:!0,children:e.jsx(a,{variant:"outline",children:"Form (com isDirty)"})}),e.jsxs(g,{variant:"form",isDirty:t,size:"md",children:[e.jsx(v,{showSeparator:!0,children:e.jsx(f,{children:"Novo Registro"})}),e.jsx(M,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Nome *"}),e.jsx("input",{className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",placeholder:"Digite algo para ativar isDirty...",value:s,onChange:m=>r(m.target.value)})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t?"⚠️ isDirty=true — ESC e X pedirão confirmação. Clique fora está bloqueado.":"isDirty=false — ESC e X fecham normalmente. Clique fora está bloqueado."})]})}),e.jsxs(j,{children:[e.jsx(a,{variant:"outline",onClick:()=>o(!1),children:"Cancelar"}),e.jsx(a,{onClick:()=>{r(""),o(!1)},children:"Salvar"})]})]})]})}function pa(){const[l,o]=i.useState(!1);return e.jsxs(x,{open:l,onOpenChange:o,children:[e.jsx(h,{asChild:!0,children:e.jsx(a,{variant:"destructive",children:"Destructive"})}),e.jsxs(g,{variant:"destructive",size:"sm",children:[e.jsx(v,{showSeparator:!0,children:e.jsx(f,{className:"sr-only",children:"Confirmação"})}),e.jsxs("div",{className:"flex flex-col items-center text-center space-y-3 py-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-destructive/10 flex items-center justify-center",children:e.jsx(Re,{className:"h-6 w-6 text-destructive"})}),e.jsx("h3",{className:"text-lg font-semibold",children:"Tem certeza?"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Esta ação não pode ser desfeita. Não há botão X, ESC ou clique fora."})]}),e.jsxs(j,{className:"justify-center gap-2",children:[e.jsx(a,{variant:"outline",onClick:()=>o(!1),children:"Cancelar"}),e.jsx(a,{variant:"destructive",onClick:()=>o(!1),children:"Sim, excluir"})]})]})]})}function ua(){return e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(ca,{}),e.jsx(ma,{}),e.jsx(pa,{})]})}function Da(){return e.jsx(We,{title:"Dialog",description:"Uma janela sobreposta à janela principal ou a outra janela de diálogo, tornando o conteúdo abaixo inerte. Inclui variações para seleção, tabelas e formulários.",component:e.jsx(ia,{}),usage:`import {
|
|
2
|
+
Dialog,
|
|
3
|
+
DialogContent,
|
|
4
|
+
DialogHeader,
|
|
5
|
+
DialogTitle,
|
|
6
|
+
DialogTrigger,
|
|
7
|
+
} from "forlogic-core"
|
|
8
|
+
|
|
9
|
+
// Tamanhos disponíveis: sm, md (padrão), lg
|
|
10
|
+
<Dialog>
|
|
11
|
+
<DialogTrigger asChild>
|
|
12
|
+
<Button variant="outline">Dialog Simples</Button>
|
|
13
|
+
</DialogTrigger>
|
|
14
|
+
<DialogContent size="md">
|
|
15
|
+
<DialogHeader showSeparator>
|
|
16
|
+
<DialogTitle>Título</DialogTitle>
|
|
17
|
+
</DialogHeader>
|
|
18
|
+
<div className="flex-1 min-h-0 overflow-auto py-4 px-1 -mx-1">
|
|
19
|
+
<p className="text-sm text-muted-foreground">Conteúdo</p>
|
|
20
|
+
</div>
|
|
21
|
+
</DialogContent>
|
|
22
|
+
</Dialog>
|
|
23
|
+
|
|
24
|
+
// Com dimensões customizadas
|
|
25
|
+
<DialogContent
|
|
26
|
+
size="md"
|
|
27
|
+
customMaxWidth="600px"
|
|
28
|
+
customMaxHeight="400px"
|
|
29
|
+
>
|
|
30
|
+
...
|
|
31
|
+
</DialogContent>`,examples:[{title:"Variantes Semânticas",description:"O DialogContent possui 3 variantes que controlam o comportamento de fechamento: informative (fecha livremente), form (bloqueia clique externo, confirma se isDirty) e destructive (exige ação explícita).",preview:e.jsx(ua,{}),code:`// Informative (padrão) — fecha livremente
|
|
32
|
+
<DialogContent variant="informative" size="md">
|
|
33
|
+
<DialogHeader showSeparator>
|
|
34
|
+
<DialogTitle>Informações</DialogTitle>
|
|
35
|
+
</DialogHeader>
|
|
36
|
+
<DialogBody>
|
|
37
|
+
<p>Conteúdo informativo...</p>
|
|
38
|
+
</DialogBody>
|
|
39
|
+
</DialogContent>
|
|
40
|
+
|
|
41
|
+
// Form — bloqueia clique externo, confirma se isDirty
|
|
42
|
+
<DialogContent variant="form" isDirty={form.formState.isDirty} size="lg">
|
|
43
|
+
<DialogHeader showSeparator>
|
|
44
|
+
<DialogTitle>Novo Registro</DialogTitle>
|
|
45
|
+
</DialogHeader>
|
|
46
|
+
<DialogBody>
|
|
47
|
+
<form>...</form>
|
|
48
|
+
</DialogBody>
|
|
49
|
+
<DialogFooter>
|
|
50
|
+
<Button variant="outline" onClick={() => onOpenChange(false)}>Cancelar</Button>
|
|
51
|
+
<Button type="submit">Salvar</Button>
|
|
52
|
+
</DialogFooter>
|
|
53
|
+
</DialogContent>
|
|
54
|
+
|
|
55
|
+
// Destructive — sem botão X, sem ESC, sem clique fora
|
|
56
|
+
<DialogContent variant="destructive" size="sm">
|
|
57
|
+
<DialogHeader showSeparator>
|
|
58
|
+
<DialogTitle className="sr-only">Confirmação</DialogTitle>
|
|
59
|
+
</DialogHeader>
|
|
60
|
+
<DialogBody>
|
|
61
|
+
<p>Esta ação não pode ser desfeita.</p>
|
|
62
|
+
</DialogBody>
|
|
63
|
+
<DialogFooter>
|
|
64
|
+
<Button variant="outline" onClick={() => onOpenChange(false)}>Cancelar</Button>
|
|
65
|
+
<Button variant="destructive" onClick={handleDelete}>Excluir</Button>
|
|
66
|
+
</DialogFooter>
|
|
67
|
+
</DialogContent>`},{title:"Tamanhos Responsivos",description:"O dialog possui 3 tamanhos pré-definidos que se adaptam a diferentes resoluções de tela.",preview:e.jsx(da,{}),code:`// Tamanhos disponíveis: sm, md, lg
|
|
68
|
+
// sm: width 30vw, min 320px, max 480px, maxHeight 320px
|
|
69
|
+
// md: width 50vw, min 480px, max 720px, maxHeight 70vh (padrão)
|
|
70
|
+
// lg: width 85vw, min 720px, max 1440px, height 85vh, maxHeight 900px
|
|
71
|
+
|
|
72
|
+
<DialogContent size="sm">Pequeno</DialogContent>
|
|
73
|
+
<DialogContent size="md">Médio (padrão)</DialogContent>
|
|
74
|
+
<DialogContent size="lg">Grande</DialogContent>
|
|
75
|
+
|
|
76
|
+
// Customização de dimensões individuais
|
|
77
|
+
<DialogContent
|
|
78
|
+
size="md"
|
|
79
|
+
customMaxWidth="600px"
|
|
80
|
+
customMaxHeight="400px"
|
|
81
|
+
customMinWidth="400px"
|
|
82
|
+
>
|
|
83
|
+
Dimensões customizadas
|
|
84
|
+
</DialogContent>`},{title:"Dialog com Seleção de Cards",description:"Permite ao usuário escolher uma opção entre múltiplos cards antes de prosseguir. Usa StepSelector para navegação.",preview:e.jsx(_e,{}),code:`// Componente SelectionCard para opções
|
|
85
|
+
function SelectionCard({ icon, title, description, selected, onClick }) {
|
|
86
|
+
return (
|
|
87
|
+
<div
|
|
88
|
+
onClick={onClick}
|
|
89
|
+
className={cn(
|
|
90
|
+
"flex items-center gap-4 p-4 border rounded-lg cursor-pointer transition-all",
|
|
91
|
+
"hover:border-primary/50 hover:bg-muted/30",
|
|
92
|
+
selected && "border-primary bg-primary/5"
|
|
93
|
+
)}
|
|
94
|
+
>
|
|
95
|
+
<div className="flex-shrink-0 w-12 h-12 rounded-lg bg-muted flex items-center justify-center text-primary">
|
|
96
|
+
{icon}
|
|
97
|
+
</div>
|
|
98
|
+
<div className="flex-1 min-w-0">
|
|
99
|
+
<h4 className="font-semibold text-foreground text-sm">{title}</h4>
|
|
100
|
+
<p className="text-sm text-muted-foreground">{description}</p>
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Dialog com Seleção
|
|
107
|
+
function DialogWithSelection() {
|
|
108
|
+
const [open, setOpen] = useState(false);
|
|
109
|
+
const [selected, setSelected] = useState<number | null>(null);
|
|
110
|
+
const [step, setStep] = useState(1);
|
|
111
|
+
const totalSteps = 3;
|
|
112
|
+
const stepLabels = ['Seleção', 'Configuração', 'Confirmação'];
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<Dialog open={open} onOpenChange={setOpen}>
|
|
116
|
+
<DialogTrigger asChild>
|
|
117
|
+
<Button variant="outline">Dialog com Seleção</Button>
|
|
118
|
+
</DialogTrigger>
|
|
119
|
+
<DialogContent size="md">
|
|
120
|
+
<DialogHeader showSeparator>
|
|
121
|
+
<DialogTitle>Título</DialogTitle>
|
|
122
|
+
</DialogHeader>
|
|
123
|
+
<div className="flex-1 min-h-0 overflow-auto py-4 px-1 -mx-1">
|
|
124
|
+
<div className="mb-4">
|
|
125
|
+
<h4 className="font-semibold text-foreground">Subtítulo</h4>
|
|
126
|
+
<p className="text-sm text-muted-foreground">Texto descritivo</p>
|
|
127
|
+
</div>
|
|
128
|
+
<div className="space-y-3">
|
|
129
|
+
<SelectionCard
|
|
130
|
+
icon={<FileText className="h-5 w-5" />}
|
|
131
|
+
title="Card 1"
|
|
132
|
+
description="Texto descritivo"
|
|
133
|
+
selected={selected === 1}
|
|
134
|
+
onClick={() => setSelected(1)}
|
|
135
|
+
/>
|
|
136
|
+
<SelectionCard
|
|
137
|
+
icon={<PlusCircle className="h-5 w-5" />}
|
|
138
|
+
title="Card 2"
|
|
139
|
+
description="Texto descritivo"
|
|
140
|
+
selected={selected === 2}
|
|
141
|
+
onClick={() => setSelected(2)}
|
|
142
|
+
/>
|
|
143
|
+
<SelectionCard
|
|
144
|
+
icon={<Clock className="h-5 w-5" />}
|
|
145
|
+
title="Card 3"
|
|
146
|
+
description="Texto descritivo"
|
|
147
|
+
selected={selected === 3}
|
|
148
|
+
onClick={() => setSelected(3)}
|
|
149
|
+
/>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
<DialogFooter className="flex-row items-center justify-between sm:justify-between">
|
|
153
|
+
<StepSelector
|
|
154
|
+
currentStep={step}
|
|
155
|
+
totalSteps={totalSteps}
|
|
156
|
+
onStepChange={setStep}
|
|
157
|
+
stepLabels={stepLabels}
|
|
158
|
+
/>
|
|
159
|
+
<div className="flex items-center gap-2">
|
|
160
|
+
<Button variant="outline" onClick={() => setOpen(false)}>
|
|
161
|
+
Cancelar
|
|
162
|
+
</Button>
|
|
163
|
+
<Button disabled={!selected}>
|
|
164
|
+
Avançar
|
|
165
|
+
<ArrowRight className="h-4 w-4 ml-2" />
|
|
166
|
+
</Button>
|
|
167
|
+
</div>
|
|
168
|
+
</DialogFooter>
|
|
169
|
+
</DialogContent>
|
|
170
|
+
</Dialog>
|
|
171
|
+
);
|
|
172
|
+
}`},{title:"Dialog com Tabela Expansível",description:"Tabela com linhas expansíveis que mostram conteúdo detalhado e itens vinculados. Usa StepSelector para navegação.",preview:e.jsx(sa,{}),code:`// Componente para card de item vinculado
|
|
173
|
+
function LinkedItemCard({ icon, title, description, type }) {
|
|
174
|
+
return (
|
|
175
|
+
<div className="flex items-start gap-3 p-3 border rounded-lg bg-background">
|
|
176
|
+
<div className="w-8 h-8 rounded-full bg-success/10 flex items-center justify-center text-success">
|
|
177
|
+
{icon}
|
|
178
|
+
</div>
|
|
179
|
+
<div className="flex-1 min-w-0">
|
|
180
|
+
<h5 className="font-medium text-sm">{title}</h5>
|
|
181
|
+
<p className="text-xs text-muted-foreground line-clamp-1">{description}</p>
|
|
182
|
+
</div>
|
|
183
|
+
<div className="flex items-center gap-2">
|
|
184
|
+
<Badge className="bg-success text-success-foreground">{type}</Badge>
|
|
185
|
+
<Button variant="ghost" size="icon" className="h-8 w-8">
|
|
186
|
+
<Eye className="h-4 w-4" />
|
|
187
|
+
</Button>
|
|
188
|
+
</div>
|
|
189
|
+
</div>
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// Dialog com Tabela Expansível
|
|
194
|
+
function DialogWithTable() {
|
|
195
|
+
const [open, setOpen] = useState(false);
|
|
196
|
+
const [expandedRow, setExpandedRow] = useState<number | null>(1);
|
|
197
|
+
const [step, setStep] = useState(1);
|
|
198
|
+
const totalSteps = 3;
|
|
199
|
+
const stepLabels = ['Seleção de Dados', 'Revisão', 'Conclusão'];
|
|
200
|
+
|
|
201
|
+
return (
|
|
202
|
+
<Dialog open={open} onOpenChange={setOpen}>
|
|
203
|
+
<DialogTrigger asChild>
|
|
204
|
+
<Button variant="outline">Dialog com Tabela</Button>
|
|
205
|
+
</DialogTrigger>
|
|
206
|
+
<DialogContent size="lg">
|
|
207
|
+
<DialogHeader showSeparator>
|
|
208
|
+
<DialogTitle>Título</DialogTitle>
|
|
209
|
+
</DialogHeader>
|
|
210
|
+
<div className="flex-1 min-h-0 overflow-auto py-4 space-y-4">
|
|
211
|
+
<div>
|
|
212
|
+
<h4 className="font-semibold text-foreground">Subtítulo</h4>
|
|
213
|
+
<p className="text-sm text-muted-foreground">Texto descritivo</p>
|
|
214
|
+
</div>
|
|
215
|
+
<div className="border rounded-lg overflow-hidden">
|
|
216
|
+
<Table>
|
|
217
|
+
<TableHeader>
|
|
218
|
+
<TableRow className="bg-muted/50">
|
|
219
|
+
<TableHead className="w-[40px]"></TableHead>
|
|
220
|
+
<TableHead>Nome</TableHead>
|
|
221
|
+
<TableHead>Código/ID</TableHead>
|
|
222
|
+
<TableHead>Responsável</TableHead>
|
|
223
|
+
<TableHead>Criado em</TableHead>
|
|
224
|
+
<TableHead>Vínculos</TableHead>
|
|
225
|
+
<TableHead className="w-[120px]"></TableHead>
|
|
226
|
+
</TableRow>
|
|
227
|
+
</TableHeader>
|
|
228
|
+
<TableBody>
|
|
229
|
+
{tableData.map(row => (
|
|
230
|
+
<Collapsible
|
|
231
|
+
key={row.id}
|
|
232
|
+
open={expandedRow === row.id}
|
|
233
|
+
onOpenChange={(isOpen) => setExpandedRow(isOpen ? row.id : null)}
|
|
234
|
+
asChild
|
|
235
|
+
>
|
|
236
|
+
<>
|
|
237
|
+
<TableRow className="border-b">
|
|
238
|
+
<TableCell>
|
|
239
|
+
<CollapsibleTrigger asChild>
|
|
240
|
+
<Button variant="ghost" size="icon" className="h-8 w-8">
|
|
241
|
+
<ChevronDown className={cn(
|
|
242
|
+
"h-4 w-4 transition-transform duration-200",
|
|
243
|
+
expandedRow === row.id && "rotate-180"
|
|
244
|
+
)} />
|
|
245
|
+
</Button>
|
|
246
|
+
</CollapsibleTrigger>
|
|
247
|
+
</TableCell>
|
|
248
|
+
<TableCell className="font-medium">{row.name}</TableCell>
|
|
249
|
+
<TableCell>{row.code}</TableCell>
|
|
250
|
+
<TableCell>
|
|
251
|
+
<div className="flex items-center gap-2">
|
|
252
|
+
<Avatar className="h-8 w-8">
|
|
253
|
+
<AvatarFallback className="text-xs bg-primary/10 text-primary">LP</AvatarFallback>
|
|
254
|
+
</Avatar>
|
|
255
|
+
<div>
|
|
256
|
+
<p className="text-sm font-medium">{row.responsible}</p>
|
|
257
|
+
<p className="text-xs text-muted-foreground">{row.email}</p>
|
|
258
|
+
</div>
|
|
259
|
+
</div>
|
|
260
|
+
</TableCell>
|
|
261
|
+
<TableCell>{row.date}</TableCell>
|
|
262
|
+
<TableCell>
|
|
263
|
+
<Badge variant="outline">{row.linksCount} Vínculos</Badge>
|
|
264
|
+
</TableCell>
|
|
265
|
+
<TableCell>
|
|
266
|
+
<Button size="sm">Selecionar</Button>
|
|
267
|
+
</TableCell>
|
|
268
|
+
</TableRow>
|
|
269
|
+
<CollapsibleContent asChild>
|
|
270
|
+
<tr>
|
|
271
|
+
<td colSpan={7} className="p-4 bg-muted/30 border-b">
|
|
272
|
+
<div className="space-y-4">
|
|
273
|
+
<div>
|
|
274
|
+
<h4 className="font-semibold text-foreground">Título</h4>
|
|
275
|
+
<p className="text-sm text-muted-foreground">{row.description}</p>
|
|
276
|
+
</div>
|
|
277
|
+
<div>
|
|
278
|
+
<div className="flex items-center justify-between mb-3">
|
|
279
|
+
<h4 className="font-semibold text-foreground">Título</h4>
|
|
280
|
+
<Badge variant="outline">{row.linkedItems.length} vínculos</Badge>
|
|
281
|
+
</div>
|
|
282
|
+
<div className="grid grid-cols-2 gap-3">
|
|
283
|
+
{row.linkedItems.map(item => (
|
|
284
|
+
<LinkedItemCard
|
|
285
|
+
key={item.id}
|
|
286
|
+
icon={<GitBranch className="h-4 w-4" />}
|
|
287
|
+
title={item.title}
|
|
288
|
+
description={item.description}
|
|
289
|
+
type={item.type}
|
|
290
|
+
/>
|
|
291
|
+
))}
|
|
292
|
+
</div>
|
|
293
|
+
</div>
|
|
294
|
+
</div>
|
|
295
|
+
</td>
|
|
296
|
+
</tr>
|
|
297
|
+
</CollapsibleContent>
|
|
298
|
+
</>
|
|
299
|
+
</Collapsible>
|
|
300
|
+
))}
|
|
301
|
+
</TableBody>
|
|
302
|
+
</Table>
|
|
303
|
+
</div>
|
|
304
|
+
</div>
|
|
305
|
+
<DialogFooter className="flex-row items-center justify-between sm:justify-between">
|
|
306
|
+
<StepSelector
|
|
307
|
+
currentStep={step}
|
|
308
|
+
totalSteps={totalSteps}
|
|
309
|
+
onStepChange={setStep}
|
|
310
|
+
stepLabels={stepLabels}
|
|
311
|
+
/>
|
|
312
|
+
<div className="flex items-center gap-2">
|
|
313
|
+
<Button variant="outline" onClick={() => setOpen(false)}>
|
|
314
|
+
Cancelar
|
|
315
|
+
</Button>
|
|
316
|
+
<Button>
|
|
317
|
+
Avançar
|
|
318
|
+
<ArrowRight className="h-4 w-4 ml-2" />
|
|
319
|
+
</Button>
|
|
320
|
+
</div>
|
|
321
|
+
</DialogFooter>
|
|
322
|
+
</DialogContent>
|
|
323
|
+
</Dialog>
|
|
324
|
+
);
|
|
325
|
+
}`},{title:"Dialog com Formulário",description:"Formulário completo com seções e campos obrigatórios organizados em grid responsivo.",preview:e.jsx(ta,{}),code:`function DialogWithForm() {
|
|
326
|
+
const [open, setOpen] = useState(false);
|
|
327
|
+
|
|
328
|
+
return (
|
|
329
|
+
<Dialog open={open} onOpenChange={setOpen}>
|
|
330
|
+
<DialogTrigger asChild>
|
|
331
|
+
<Button variant="outline">Dialog com Formulário</Button>
|
|
332
|
+
</DialogTrigger>
|
|
333
|
+
<DialogContent size="lg">
|
|
334
|
+
<DialogHeader showSeparator>
|
|
335
|
+
<DialogTitle>Novo Plano de Controle</DialogTitle>
|
|
336
|
+
</DialogHeader>
|
|
337
|
+
<div className="flex-1 min-h-0 overflow-auto py-4 px-1 -mx-1 space-y-6">
|
|
338
|
+
{/* Seção Identificação */}
|
|
339
|
+
<div className="space-y-4">
|
|
340
|
+
<h3 className="font-semibold text-foreground">Identificação</h3>
|
|
341
|
+
<div className="grid grid-cols-3 gap-4">
|
|
342
|
+
<div className="space-y-2">
|
|
343
|
+
<Label htmlFor="planNumber">
|
|
344
|
+
Número do Plano <span className="text-destructive">*</span>
|
|
345
|
+
</Label>
|
|
346
|
+
<Input id="planNumber" defaultValue="9876543210" />
|
|
347
|
+
</div>
|
|
348
|
+
<div className="space-y-2">
|
|
349
|
+
<Label htmlFor="emissionDate">Data de emissão</Label>
|
|
350
|
+
<Input id="emissionDate" type="date" defaultValue="2025-09-17" />
|
|
351
|
+
</div>
|
|
352
|
+
<div className="space-y-2">
|
|
353
|
+
<Label htmlFor="revisionDate">Data de revisão</Label>
|
|
354
|
+
<Input id="revisionDate" type="date" defaultValue="2025-10-17" />
|
|
355
|
+
</div>
|
|
356
|
+
</div>
|
|
357
|
+
</div>
|
|
358
|
+
|
|
359
|
+
{/* Seção Cliente e Organização */}
|
|
360
|
+
<div className="space-y-4">
|
|
361
|
+
<h3 className="font-semibold text-foreground">Cliente e Organização</h3>
|
|
362
|
+
<div className="grid grid-cols-2 gap-4">
|
|
363
|
+
<div className="space-y-2">
|
|
364
|
+
<Label htmlFor="clientName">
|
|
365
|
+
Nome do cliente <span className="text-destructive">*</span>
|
|
366
|
+
</Label>
|
|
367
|
+
<Input id="clientName" placeholder="Insira o nome do cliente" />
|
|
368
|
+
</div>
|
|
369
|
+
<div className="space-y-2">
|
|
370
|
+
<Label htmlFor="orgName">
|
|
371
|
+
Nome da organização <span className="text-destructive">*</span>
|
|
372
|
+
</Label>
|
|
373
|
+
<Input id="orgName" placeholder="Insira o nome da organização" />
|
|
374
|
+
</div>
|
|
375
|
+
</div>
|
|
376
|
+
</div>
|
|
377
|
+
|
|
378
|
+
{/* Seção Produto/Peça */}
|
|
379
|
+
<div className="space-y-4">
|
|
380
|
+
<h3 className="font-semibold text-foreground">Produto/Peça</h3>
|
|
381
|
+
<div className="grid grid-cols-2 gap-4">
|
|
382
|
+
<div className="space-y-2">
|
|
383
|
+
<Label htmlFor="partNumber">
|
|
384
|
+
Número da peça <span className="text-destructive">*</span>
|
|
385
|
+
</Label>
|
|
386
|
+
<Input id="partNumber" placeholder="Insira o número da peça" />
|
|
387
|
+
</div>
|
|
388
|
+
<div className="space-y-2">
|
|
389
|
+
<Label htmlFor="engLevel">
|
|
390
|
+
Nível de engenharia <span className="text-destructive">*</span>
|
|
391
|
+
</Label>
|
|
392
|
+
<Input id="engLevel" placeholder="Insira o nível" />
|
|
393
|
+
</div>
|
|
394
|
+
</div>
|
|
395
|
+
<div className="space-y-2">
|
|
396
|
+
<Label htmlFor="partDescription">
|
|
397
|
+
Descrição da peça <span className="text-destructive">*</span>
|
|
398
|
+
</Label>
|
|
399
|
+
<Textarea id="partDescription" placeholder="Descreva detalhes sobre a peça..." rows={3} />
|
|
400
|
+
</div>
|
|
401
|
+
</div>
|
|
402
|
+
</div>
|
|
403
|
+
<DialogFooter>
|
|
404
|
+
<Button variant="outline" onClick={() => setOpen(false)}>
|
|
405
|
+
Cancelar
|
|
406
|
+
</Button>
|
|
407
|
+
<Button>
|
|
408
|
+
<Check className="h-4 w-4 mr-2" />
|
|
409
|
+
Salvar
|
|
410
|
+
</Button>
|
|
411
|
+
</DialogFooter>
|
|
412
|
+
</DialogContent>
|
|
413
|
+
</Dialog>
|
|
414
|
+
);
|
|
415
|
+
}`},{title:"Dialog com Wizard Multi-etapas",description:"Wizard funcional com 4 etapas: seleção de tipo, informações básicas, configurações e confirmação. Inclui validação de campos obrigatórios, navegação controlada via StepSelector e reset ao fechar.",preview:e.jsx(oa,{}),code:`function DialogWithWizard() {
|
|
416
|
+
const [open, setOpen] = useState(false);
|
|
417
|
+
const [step, setStep] = useState(1);
|
|
418
|
+
|
|
419
|
+
// Step 1: Tipo
|
|
420
|
+
const [selectedType, setSelectedType] = useState<number | null>(null);
|
|
421
|
+
|
|
422
|
+
// Step 2: Informações básicas
|
|
423
|
+
const [projectName, setProjectName] = useState('');
|
|
424
|
+
const [projectDesc, setProjectDesc] = useState('');
|
|
425
|
+
const [responsible, setResponsible] = useState('');
|
|
426
|
+
const [department, setDepartment] = useState('');
|
|
427
|
+
|
|
428
|
+
// Step 3: Configurações
|
|
429
|
+
const [startDate, setStartDate] = useState<Date | undefined>(undefined);
|
|
430
|
+
const [endDate, setEndDate] = useState<Date | undefined>(undefined);
|
|
431
|
+
const [priority, setPriority] = useState<number | null>(null);
|
|
432
|
+
const [notifyTeam, setNotifyTeam] = useState(true);
|
|
433
|
+
|
|
434
|
+
const totalSteps = 4;
|
|
435
|
+
const stepLabels = ['Tipo do Projeto', 'Informações Básicas', 'Configurações', 'Confirmação'];
|
|
436
|
+
const typeLabels = ['Projeto Interno', 'Projeto Cliente', 'Projeto Temporário'];
|
|
437
|
+
const priorityLabels = ['Baixa', 'Média', 'Alta', 'Crítica'];
|
|
438
|
+
|
|
439
|
+
// Validação por step
|
|
440
|
+
const isStepValid = (stepToCheck: number) => {
|
|
441
|
+
switch (stepToCheck) {
|
|
442
|
+
case 1: return selectedType !== null;
|
|
443
|
+
case 2: return projectName.trim().length > 0 && responsible.trim().length > 0;
|
|
444
|
+
case 3: return !!startDate && priority !== null;
|
|
445
|
+
case 4: return true;
|
|
446
|
+
default: return false;
|
|
447
|
+
}
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
// Verifica se pode ir para um step (todos anteriores precisam estar válidos)
|
|
451
|
+
const canGoToStep = (targetStep: number) => {
|
|
452
|
+
for (let i = 1; i < targetStep; i++) {
|
|
453
|
+
if (!isStepValid(i)) return false;
|
|
454
|
+
}
|
|
455
|
+
return true;
|
|
456
|
+
};
|
|
457
|
+
|
|
458
|
+
const handleNext = () => {
|
|
459
|
+
if (step < totalSteps && isStepValid(step)) setStep(step + 1);
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
const handleBack = () => {
|
|
463
|
+
if (step > 1) setStep(step - 1);
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
const resetForm = () => {
|
|
467
|
+
setStep(1);
|
|
468
|
+
setSelectedType(null);
|
|
469
|
+
setProjectName('');
|
|
470
|
+
setProjectDesc('');
|
|
471
|
+
setResponsible('');
|
|
472
|
+
setDepartment('');
|
|
473
|
+
setStartDate(undefined);
|
|
474
|
+
setEndDate(undefined);
|
|
475
|
+
setPriority(null);
|
|
476
|
+
setNotifyTeam(true);
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
const handleOpenChange = (isOpen: boolean) => {
|
|
480
|
+
setOpen(isOpen);
|
|
481
|
+
if (!isOpen) resetForm();
|
|
482
|
+
};
|
|
483
|
+
|
|
484
|
+
return (
|
|
485
|
+
<Dialog open={open} onOpenChange={handleOpenChange}>
|
|
486
|
+
<DialogTrigger asChild>
|
|
487
|
+
<Button variant="outline">Dialog com Wizard</Button>
|
|
488
|
+
</DialogTrigger>
|
|
489
|
+
<DialogContent size="lg">
|
|
490
|
+
<DialogHeader showSeparator>
|
|
491
|
+
<DialogTitle>Novo Projeto</DialogTitle>
|
|
492
|
+
</DialogHeader>
|
|
493
|
+
|
|
494
|
+
<div className="flex-1 min-h-0 overflow-auto py-4 px-1 -mx-1">
|
|
495
|
+
{/* Step 1: Seleção de tipo */}
|
|
496
|
+
{step === 1 && (
|
|
497
|
+
<div className="space-y-4">
|
|
498
|
+
<div>
|
|
499
|
+
<h4 className="font-semibold text-foreground">Selecione o tipo de projeto</h4>
|
|
500
|
+
<p className="text-sm text-muted-foreground">Escolha uma opção para continuar</p>
|
|
501
|
+
</div>
|
|
502
|
+
<div className="grid grid-cols-1 md:grid-cols-3 gap-3">
|
|
503
|
+
<SelectionCard
|
|
504
|
+
icon={<Building2 className="h-5 w-5" />}
|
|
505
|
+
title="Projeto Interno"
|
|
506
|
+
description="Para uso da equipe interna"
|
|
507
|
+
selected={selectedType === 1}
|
|
508
|
+
onClick={() => setSelectedType(1)}
|
|
509
|
+
/>
|
|
510
|
+
<SelectionCard
|
|
511
|
+
icon={<Users className="h-5 w-5" />}
|
|
512
|
+
title="Projeto Cliente"
|
|
513
|
+
description="Para entrega a clientes externos"
|
|
514
|
+
selected={selectedType === 2}
|
|
515
|
+
onClick={() => setSelectedType(2)}
|
|
516
|
+
/>
|
|
517
|
+
<SelectionCard
|
|
518
|
+
icon={<Clock className="h-5 w-5" />}
|
|
519
|
+
title="Projeto Temporário"
|
|
520
|
+
description="Com data de expiração definida"
|
|
521
|
+
selected={selectedType === 3}
|
|
522
|
+
onClick={() => setSelectedType(3)}
|
|
523
|
+
/>
|
|
524
|
+
</div>
|
|
525
|
+
</div>
|
|
526
|
+
)}
|
|
527
|
+
|
|
528
|
+
{/* Step 2: Informações Básicas */}
|
|
529
|
+
{step === 2 && (
|
|
530
|
+
<div className="space-y-6">
|
|
531
|
+
<div>
|
|
532
|
+
<h4 className="font-semibold text-foreground">Informações básicas</h4>
|
|
533
|
+
<p className="text-sm text-muted-foreground">Preencha os dados do projeto</p>
|
|
534
|
+
</div>
|
|
535
|
+
<div className="grid grid-cols-2 gap-4">
|
|
536
|
+
<div className="col-span-2 space-y-2">
|
|
537
|
+
<Label htmlFor="projectName">
|
|
538
|
+
Nome do projeto <span className="text-destructive">*</span>
|
|
539
|
+
</Label>
|
|
540
|
+
<Input
|
|
541
|
+
id="projectName"
|
|
542
|
+
placeholder="Ex: Sistema de Gestão de Qualidade"
|
|
543
|
+
value={projectName}
|
|
544
|
+
onChange={(e) => setProjectName(e.target.value)}
|
|
545
|
+
/>
|
|
546
|
+
</div>
|
|
547
|
+
<div className="space-y-2">
|
|
548
|
+
<Label htmlFor="responsible">
|
|
549
|
+
Responsável <span className="text-destructive">*</span>
|
|
550
|
+
</Label>
|
|
551
|
+
<Input
|
|
552
|
+
id="responsible"
|
|
553
|
+
placeholder="Nome do responsável"
|
|
554
|
+
value={responsible}
|
|
555
|
+
onChange={(e) => setResponsible(e.target.value)}
|
|
556
|
+
/>
|
|
557
|
+
</div>
|
|
558
|
+
<div className="space-y-2">
|
|
559
|
+
<Label htmlFor="department">Departamento</Label>
|
|
560
|
+
<Input
|
|
561
|
+
id="department"
|
|
562
|
+
placeholder="Ex: Tecnologia"
|
|
563
|
+
value={department}
|
|
564
|
+
onChange={(e) => setDepartment(e.target.value)}
|
|
565
|
+
/>
|
|
566
|
+
</div>
|
|
567
|
+
</div>
|
|
568
|
+
</div>
|
|
569
|
+
)}
|
|
570
|
+
|
|
571
|
+
{/* Step 3: Configurações */}
|
|
572
|
+
{step === 3 && (
|
|
573
|
+
<div className="space-y-6">
|
|
574
|
+
<div>
|
|
575
|
+
<h4 className="font-semibold text-foreground">Configurações do projeto</h4>
|
|
576
|
+
<p className="text-sm text-muted-foreground">Defina prazos e prioridade</p>
|
|
577
|
+
</div>
|
|
578
|
+
<div className="grid grid-cols-2 gap-4">
|
|
579
|
+
<div className="space-y-2">
|
|
580
|
+
<Label>
|
|
581
|
+
Data de início <span className="text-destructive">*</span>
|
|
582
|
+
</Label>
|
|
583
|
+
<DatePicker
|
|
584
|
+
date={startDate}
|
|
585
|
+
onDateChange={setStartDate}
|
|
586
|
+
placeholder="Selecione a data de início"
|
|
587
|
+
className="w-full"
|
|
588
|
+
/>
|
|
589
|
+
</div>
|
|
590
|
+
<div className="space-y-2">
|
|
591
|
+
<Label>Data prevista de conclusão</Label>
|
|
592
|
+
<DatePicker
|
|
593
|
+
date={endDate}
|
|
594
|
+
onDateChange={setEndDate}
|
|
595
|
+
placeholder="Selecione a data de término"
|
|
596
|
+
disabledDates={(date) => (startDate ? date < startDate : false)}
|
|
597
|
+
className="w-full"
|
|
598
|
+
/>
|
|
599
|
+
</div>
|
|
600
|
+
</div>
|
|
601
|
+
<div className="space-y-3">
|
|
602
|
+
<Label>Prioridade <span className="text-destructive">*</span></Label>
|
|
603
|
+
<div className="grid grid-cols-4 gap-2">
|
|
604
|
+
{priorityLabels.map((label, idx) => (
|
|
605
|
+
<button
|
|
606
|
+
key={label}
|
|
607
|
+
type="button"
|
|
608
|
+
onClick={() => setPriority(idx)}
|
|
609
|
+
className={cn(
|
|
610
|
+
"p-3 rounded-lg border text-center transition-all text-sm font-medium",
|
|
611
|
+
priority === idx
|
|
612
|
+
? "border-primary bg-primary/10 text-primary"
|
|
613
|
+
: "border-border hover:border-primary/50 hover:bg-muted/50"
|
|
614
|
+
)}
|
|
615
|
+
>
|
|
616
|
+
{label}
|
|
617
|
+
</button>
|
|
618
|
+
))}
|
|
619
|
+
</div>
|
|
620
|
+
</div>
|
|
621
|
+
</div>
|
|
622
|
+
)}
|
|
623
|
+
|
|
624
|
+
{/* Step 4: Confirmação */}
|
|
625
|
+
{step === 4 && (
|
|
626
|
+
<div className="space-y-6">
|
|
627
|
+
<div>
|
|
628
|
+
<h4 className="font-semibold text-foreground">Confirmar criação</h4>
|
|
629
|
+
<p className="text-sm text-muted-foreground">Revise as informações antes de concluir</p>
|
|
630
|
+
</div>
|
|
631
|
+
<div className="border rounded-lg divide-y">
|
|
632
|
+
<div className="p-3 flex justify-between items-center">
|
|
633
|
+
<span className="text-sm text-muted-foreground">Tipo</span>
|
|
634
|
+
<span className="text-sm font-medium">{selectedType ? typeLabels[selectedType - 1] : '-'}</span>
|
|
635
|
+
</div>
|
|
636
|
+
<div className="p-3 flex justify-between items-center">
|
|
637
|
+
<span className="text-sm text-muted-foreground">Nome do projeto</span>
|
|
638
|
+
<span className="text-sm font-medium">{projectName}</span>
|
|
639
|
+
</div>
|
|
640
|
+
<div className="p-3 flex justify-between items-center">
|
|
641
|
+
<span className="text-sm text-muted-foreground">Responsável</span>
|
|
642
|
+
<span className="text-sm font-medium">{responsible}</span>
|
|
643
|
+
</div>
|
|
644
|
+
<div className="p-3 flex justify-between items-center">
|
|
645
|
+
<span className="text-sm text-muted-foreground">Período</span>
|
|
646
|
+
<span className="text-sm font-medium">
|
|
647
|
+
{startDate ? startDate.toLocaleDateString('pt-BR') : '-'}
|
|
648
|
+
{endDate && ' até ' + endDate.toLocaleDateString('pt-BR')}
|
|
649
|
+
</span>
|
|
650
|
+
</div>
|
|
651
|
+
<div className="p-3 flex justify-between items-center">
|
|
652
|
+
<span className="text-sm text-muted-foreground">Prioridade</span>
|
|
653
|
+
<Badge>{priority !== null ? priorityLabels[priority] : '-'}</Badge>
|
|
654
|
+
</div>
|
|
655
|
+
</div>
|
|
656
|
+
</div>
|
|
657
|
+
)}
|
|
658
|
+
</div>
|
|
659
|
+
|
|
660
|
+
<DialogFooter className="flex-row items-center justify-between sm:justify-between">
|
|
661
|
+
<StepSelector
|
|
662
|
+
currentStep={step}
|
|
663
|
+
totalSteps={totalSteps}
|
|
664
|
+
onStepChange={setStep}
|
|
665
|
+
stepLabels={stepLabels}
|
|
666
|
+
canGoToStep={canGoToStep}
|
|
667
|
+
/>
|
|
668
|
+
<div className="flex gap-2">
|
|
669
|
+
{step > 1 && (
|
|
670
|
+
<Button variant="outline" onClick={handleBack}>
|
|
671
|
+
<ArrowLeft className="h-4 w-4 mr-2" />
|
|
672
|
+
Voltar
|
|
673
|
+
</Button>
|
|
674
|
+
)}
|
|
675
|
+
{step < totalSteps ? (
|
|
676
|
+
<Button onClick={handleNext} disabled={!isStepValid(step)}>
|
|
677
|
+
Avançar
|
|
678
|
+
<ArrowRight className="h-4 w-4 ml-2" />
|
|
679
|
+
</Button>
|
|
680
|
+
) : (
|
|
681
|
+
<Button onClick={() => setOpen(false)}>
|
|
682
|
+
<Check className="h-4 w-4 mr-2" />
|
|
683
|
+
Criar Projeto
|
|
684
|
+
</Button>
|
|
685
|
+
)}
|
|
686
|
+
</div>
|
|
687
|
+
</DialogFooter>
|
|
688
|
+
</DialogContent>
|
|
689
|
+
</Dialog>
|
|
690
|
+
);
|
|
691
|
+
}`},{title:"DialogBody – Padrão Obrigatório",description:"O componente DialogBody DEVE ser usado para envolver o conteúdo entre DialogHeader e DialogFooter. Ele garante scroll adequado e evita problemas de overflow.",preview:e.jsxs(x,{children:[e.jsx(h,{asChild:!0,children:e.jsx(a,{variant:"outline",children:"Dialog com DialogBody"})}),e.jsxs(g,{children:[e.jsx(v,{showSeparator:!0,children:e.jsx(f,{children:"Exemplo com DialogBody"})}),e.jsx(M,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["O DialogBody aplica automaticamente as classes para scroll interno:",e.jsx("code",{className:"ml-2 px-1 py-0.5 bg-muted rounded text-xs",children:"flex-1 min-h-0 overflow-auto py-4 px-1 -mx-1"})]}),e.jsxs("div",{className:"p-4 border rounded-lg bg-muted/30",children:[e.jsx("h4",{className:"font-medium mb-2",children:"Benefícios:"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1",children:[e.jsx("li",{children:"✓ Scroll automático quando conteúdo excede altura"}),e.jsx("li",{children:"✓ Focus rings não são cortados (px-1 -mx-1)"}),e.jsx("li",{children:"✓ Padding consistente (py-4)"}),e.jsx("li",{children:"✓ Flex adequado para dialogs responsivos"})]})]})]})}),e.jsxs(j,{children:[e.jsx(a,{variant:"outline",children:"Cancelar"}),e.jsx(a,{children:"Confirmar"})]})]})]}),code:`// ✅ CORRETO: Usar DialogBody
|
|
692
|
+
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogBody, DialogFooter } from 'forlogic-core';
|
|
693
|
+
|
|
694
|
+
<Dialog>
|
|
695
|
+
<DialogTrigger asChild>
|
|
696
|
+
<Button variant="outline">Abrir</Button>
|
|
697
|
+
</DialogTrigger>
|
|
698
|
+
<DialogContent>
|
|
699
|
+
<DialogHeader showSeparator>
|
|
700
|
+
<DialogTitle>Título</DialogTitle>
|
|
701
|
+
</DialogHeader>
|
|
702
|
+
<DialogBody>
|
|
703
|
+
{/* Seu conteúdo aqui */}
|
|
704
|
+
<p>Conteúdo com scroll automático</p>
|
|
705
|
+
</DialogBody>
|
|
706
|
+
<DialogFooter>
|
|
707
|
+
<Button variant="outline">Cancelar</Button>
|
|
708
|
+
<Button>Confirmar</Button>
|
|
709
|
+
</DialogFooter>
|
|
710
|
+
</DialogContent>
|
|
711
|
+
</Dialog>
|
|
712
|
+
|
|
713
|
+
// ❌ ERRADO: Conteúdo direto sem DialogBody
|
|
714
|
+
<Dialog>
|
|
715
|
+
<DialogContent>
|
|
716
|
+
<DialogHeader>
|
|
717
|
+
<DialogTitle>Título</DialogTitle>
|
|
718
|
+
</DialogHeader>
|
|
719
|
+
{/* Conteúdo direto causa overflow */}
|
|
720
|
+
<p>Este conteúdo pode vazar do dialog!</p>
|
|
721
|
+
<DialogFooter>...</DialogFooter>
|
|
722
|
+
</DialogContent>
|
|
723
|
+
</Dialog>
|
|
724
|
+
|
|
725
|
+
// ❌ ERRADO: Usando div com classes manuais
|
|
726
|
+
<Dialog>
|
|
727
|
+
<DialogContent>
|
|
728
|
+
<DialogHeader>...</DialogHeader>
|
|
729
|
+
<div className="flex-1 min-h-0 overflow-auto py-4">
|
|
730
|
+
{/* Funciona, mas DialogBody é mais semântico */}
|
|
731
|
+
</div>
|
|
732
|
+
<DialogFooter>...</DialogFooter>
|
|
733
|
+
</DialogContent>
|
|
734
|
+
</Dialog>`},{title:"Dialog de Confirmação",preview:e.jsxs(x,{children:[e.jsx(h,{asChild:!0,children:e.jsx(a,{variant:"destructive",children:"Deletar Conta"})}),e.jsxs(g,{children:[e.jsx(v,{showSeparator:!0,children:e.jsx(f,{children:"Você tem certeza absoluta?"})}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto py-4 px-1 -mx-1",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Esta ação não pode ser desfeita. Isso irá deletar permanentemente sua conta e remover seus dados de nossos servidores."})}),e.jsxs(j,{children:[e.jsx(a,{variant:"outline",children:"Cancelar"}),e.jsx(a,{variant:"destructive",children:"Sim, deletar"})]})]})]}),code:`<Dialog>
|
|
735
|
+
<DialogTrigger asChild>
|
|
736
|
+
<Button variant="destructive">Deletar Conta</Button>
|
|
737
|
+
</DialogTrigger>
|
|
738
|
+
<DialogContent>
|
|
739
|
+
<DialogHeader showSeparator>
|
|
740
|
+
<DialogTitle>Você tem certeza absoluta?</DialogTitle>
|
|
741
|
+
</DialogHeader>
|
|
742
|
+
<div className="flex-1 min-h-0 overflow-auto py-4 px-1 -mx-1">
|
|
743
|
+
<p className="text-sm text-muted-foreground">
|
|
744
|
+
Esta ação não pode ser desfeita.
|
|
745
|
+
</p>
|
|
746
|
+
</div>
|
|
747
|
+
<DialogFooter>
|
|
748
|
+
<Button variant="outline">Cancelar</Button>
|
|
749
|
+
<Button variant="destructive">Sim, deletar</Button>
|
|
750
|
+
</DialogFooter>
|
|
751
|
+
</DialogContent>
|
|
752
|
+
</Dialog>`},{title:"Dialog com Ação Customizada",preview:e.jsxs(x,{children:[e.jsx(h,{asChild:!0,children:e.jsx(a,{variant:"outline",children:"Compartilhar"})}),e.jsxs(g,{className:"sm:max-w-md",children:[e.jsx(v,{showSeparator:!0,children:e.jsx(f,{children:"Compartilhar link"})}),e.jsxs("div",{className:"flex-1 min-h-0 overflow-auto py-4 px-1 -mx-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Qualquer pessoa com o link poderá visualizar este documento."}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxs("div",{className:"grid flex-1 gap-2",children:[e.jsx(d,{htmlFor:"link",className:"sr-only",children:"Link"}),e.jsx(u,{id:"link",defaultValue:"https://ui.shadcn.com/docs/installation",readOnly:!0})]}),e.jsxs(a,{type:"submit",size:"sm",className:"px-3",children:[e.jsx("span",{className:"sr-only",children:"Copiar"}),e.jsx(Se,{className:"h-4 w-4"})]})]})]}),e.jsx(j,{className:"sm:justify-start",children:e.jsx(a,{type:"button",variant:"secondary",children:"Fechar"})})]})]}),code:`<Dialog>
|
|
753
|
+
<DialogTrigger asChild>
|
|
754
|
+
<Button variant="outline">Compartilhar</Button>
|
|
755
|
+
</DialogTrigger>
|
|
756
|
+
<DialogContent className="sm:max-w-md">
|
|
757
|
+
<DialogHeader showSeparator>
|
|
758
|
+
<DialogTitle>Compartilhar link</DialogTitle>
|
|
759
|
+
</DialogHeader>
|
|
760
|
+
<div className="flex-1 min-h-0 overflow-auto py-4 px-1 -mx-1">
|
|
761
|
+
<p className="text-sm text-muted-foreground mb-4">
|
|
762
|
+
Qualquer pessoa com o link poderá visualizar.
|
|
763
|
+
</p>
|
|
764
|
+
<div className="flex items-center space-x-2">
|
|
765
|
+
<Input defaultValue="https://..." readOnly />
|
|
766
|
+
<Button size="sm">
|
|
767
|
+
<Copy className="h-4 w-4" />
|
|
768
|
+
</Button>
|
|
769
|
+
</div>
|
|
770
|
+
</div>
|
|
771
|
+
</DialogContent>
|
|
772
|
+
</Dialog>`},{title:"AlertDialog - Exclusão com Confirmação",description:'AlertDialog para ações destrutivas. Oferece duas variações: confirmação por palavra-chave ("EXCLUIR") ou por senha do usuário.',preview:e.jsx(na,{}),code:`// Variação 1: Confirmação por palavra-chave
|
|
773
|
+
function AlertDialogWithConfirmation() {
|
|
774
|
+
const [open, setOpen] = useState(false);
|
|
775
|
+
const [confirmText, setConfirmText] = useState('');
|
|
776
|
+
const confirmPhrase = 'EXCLUIR';
|
|
777
|
+
|
|
778
|
+
const handleOpenChange = (isOpen: boolean) => {
|
|
779
|
+
setOpen(isOpen);
|
|
780
|
+
if (!isOpen) setConfirmText('');
|
|
781
|
+
};
|
|
782
|
+
|
|
783
|
+
return (
|
|
784
|
+
<AlertDialog open={open} onOpenChange={handleOpenChange}>
|
|
785
|
+
<AlertDialogTrigger asChild>
|
|
786
|
+
<Button variant="destructive">Excluir Permanentemente</Button>
|
|
787
|
+
</AlertDialogTrigger>
|
|
788
|
+
<AlertDialogContent>
|
|
789
|
+
<AlertDialogHeader className="border-b pb-4">
|
|
790
|
+
<AlertDialogTitle>Exclusão com Confirmação</AlertDialogTitle>
|
|
791
|
+
</AlertDialogHeader>
|
|
792
|
+
<div className="py-4 space-y-4">
|
|
793
|
+
<div className="flex items-start gap-3">
|
|
794
|
+
<div className="flex h-10 w-10 items-center justify-center rounded-full bg-destructive/10 shrink-0">
|
|
795
|
+
<AlertCircle className="h-5 w-5 text-destructive" />
|
|
796
|
+
</div>
|
|
797
|
+
<div>
|
|
798
|
+
<h4 className="font-semibold text-foreground">Excluir permanentemente?</h4>
|
|
799
|
+
<p className="text-sm text-muted-foreground">
|
|
800
|
+
Esta ação não pode ser desfeita. Isso excluirá permanentemente o registro
|
|
801
|
+
e removerá todos os dados associados de nossos servidores.
|
|
802
|
+
</p>
|
|
803
|
+
</div>
|
|
804
|
+
</div>
|
|
805
|
+
<div>
|
|
806
|
+
<Label htmlFor="confirm-text" className="text-sm">
|
|
807
|
+
Digite <span className="font-semibold text-destructive">{confirmPhrase}</span> para confirmar:
|
|
808
|
+
</Label>
|
|
809
|
+
<Input
|
|
810
|
+
id="confirm-text"
|
|
811
|
+
className="mt-2"
|
|
812
|
+
placeholder={confirmPhrase}
|
|
813
|
+
value={confirmText}
|
|
814
|
+
onChange={(e) => setConfirmText(e.target.value)}
|
|
815
|
+
/>
|
|
816
|
+
</div>
|
|
817
|
+
</div>
|
|
818
|
+
<AlertDialogFooter>
|
|
819
|
+
<AlertDialogCancel>Cancelar</AlertDialogCancel>
|
|
820
|
+
<Button
|
|
821
|
+
variant="destructive"
|
|
822
|
+
disabled={confirmText !== confirmPhrase}
|
|
823
|
+
onClick={() => setOpen(false)}
|
|
824
|
+
>
|
|
825
|
+
Excluir Permanentemente
|
|
826
|
+
</Button>
|
|
827
|
+
</AlertDialogFooter>
|
|
828
|
+
</AlertDialogContent>
|
|
829
|
+
</AlertDialog>
|
|
830
|
+
);
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
// Variação 2: Confirmação por senha do usuário
|
|
834
|
+
function AlertDialogWithPasswordConfirmation() {
|
|
835
|
+
const [open, setOpen] = useState(false);
|
|
836
|
+
const [password, setPassword] = useState('');
|
|
837
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
838
|
+
|
|
839
|
+
const handleOpenChange = (isOpen: boolean) => {
|
|
840
|
+
setOpen(isOpen);
|
|
841
|
+
if (!isOpen) {
|
|
842
|
+
setPassword('');
|
|
843
|
+
setShowPassword(false);
|
|
844
|
+
}
|
|
845
|
+
};
|
|
846
|
+
|
|
847
|
+
const isPasswordValid = password.length >= 6;
|
|
848
|
+
|
|
849
|
+
return (
|
|
850
|
+
<AlertDialog open={open} onOpenChange={handleOpenChange}>
|
|
851
|
+
<AlertDialogTrigger asChild>
|
|
852
|
+
<Button variant="destructive">Excluir com Senha</Button>
|
|
853
|
+
</AlertDialogTrigger>
|
|
854
|
+
<AlertDialogContent>
|
|
855
|
+
<AlertDialogHeader className="border-b pb-4">
|
|
856
|
+
<AlertDialogTitle>Confirmação de Segurança</AlertDialogTitle>
|
|
857
|
+
</AlertDialogHeader>
|
|
858
|
+
<div className="py-4 space-y-4">
|
|
859
|
+
<div className="flex items-start gap-3">
|
|
860
|
+
<div className="flex h-10 w-10 items-center justify-center rounded-full bg-destructive/10 shrink-0">
|
|
861
|
+
<AlertCircle className="h-5 w-5 text-destructive" />
|
|
862
|
+
</div>
|
|
863
|
+
<div>
|
|
864
|
+
<h4 className="font-semibold text-foreground">Confirmar exclusão</h4>
|
|
865
|
+
<p className="text-sm text-muted-foreground">
|
|
866
|
+
Para confirmar esta ação, digite sua senha de acesso.
|
|
867
|
+
</p>
|
|
868
|
+
</div>
|
|
869
|
+
</div>
|
|
870
|
+
<div>
|
|
871
|
+
<Label htmlFor="password-confirm" className="text-sm">
|
|
872
|
+
Digite sua senha para confirmar:
|
|
873
|
+
</Label>
|
|
874
|
+
<div className="relative mt-2">
|
|
875
|
+
<Input
|
|
876
|
+
id="password-confirm"
|
|
877
|
+
type={showPassword ? 'text' : 'password'}
|
|
878
|
+
placeholder="••••••••"
|
|
879
|
+
value={password}
|
|
880
|
+
onChange={(e) => setPassword(e.target.value)}
|
|
881
|
+
/>
|
|
882
|
+
<Button
|
|
883
|
+
variant="ghost"
|
|
884
|
+
size="icon"
|
|
885
|
+
className="absolute right-0 top-0 h-full px-3 hover:bg-transparent"
|
|
886
|
+
onClick={() => setShowPassword(!showPassword)}
|
|
887
|
+
>
|
|
888
|
+
{showPassword ? <EyeOff className="h-4 w-4" /> : <Eye className="h-4 w-4" />}
|
|
889
|
+
</Button>
|
|
890
|
+
</div>
|
|
891
|
+
</div>
|
|
892
|
+
</div>
|
|
893
|
+
<AlertDialogFooter>
|
|
894
|
+
<AlertDialogCancel>Cancelar</AlertDialogCancel>
|
|
895
|
+
<Button
|
|
896
|
+
variant="destructive"
|
|
897
|
+
disabled={!isPasswordValid}
|
|
898
|
+
onClick={() => setOpen(false)}
|
|
899
|
+
>
|
|
900
|
+
Confirmar Exclusão
|
|
901
|
+
</Button>
|
|
902
|
+
</AlertDialogFooter>
|
|
903
|
+
</AlertDialogContent>
|
|
904
|
+
</AlertDialog>
|
|
905
|
+
);
|
|
906
|
+
}`},{title:"Sheet - Painel Lateral Direito",description:"Sheet abre um painel lateral para edição ou detalhes.",preview:e.jsxs(E,{children:[e.jsx(z,{asChild:!0,children:e.jsx(a,{variant:"outline",children:"Abrir Sheet"})}),e.jsxs(q,{children:[e.jsx(R,{showSeparator:!0,children:e.jsx(V,{children:"Editar perfil"})}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto py-4 px-1 -mx-1",children:e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx(d,{htmlFor:"name",className:"text-right",children:"Nome"}),e.jsx(u,{id:"name",defaultValue:"Pedro Duarte",className:"col-span-3"})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx(d,{htmlFor:"username",className:"text-right",children:"Username"}),e.jsx(u,{id:"username",defaultValue:"@peduarte",className:"col-span-3"})]})]})}),e.jsx(we,{children:e.jsx(ye,{asChild:!0,children:e.jsx(a,{type:"submit",children:"Salvar alterações"})})})]})]}),code:`import {
|
|
907
|
+
Sheet,
|
|
908
|
+
SheetClose,
|
|
909
|
+
SheetContent,
|
|
910
|
+
SheetHeader,
|
|
911
|
+
SheetTitle,
|
|
912
|
+
SheetFooter,
|
|
913
|
+
SheetTrigger,
|
|
914
|
+
} from 'forlogic-core';
|
|
915
|
+
|
|
916
|
+
<Sheet>
|
|
917
|
+
<SheetTrigger asChild>
|
|
918
|
+
<Button variant="outline">Abrir</Button>
|
|
919
|
+
</SheetTrigger>
|
|
920
|
+
<SheetContent>
|
|
921
|
+
<SheetHeader showSeparator>
|
|
922
|
+
<SheetTitle>Editar perfil</SheetTitle>
|
|
923
|
+
</SheetHeader>
|
|
924
|
+
<div className="flex-1 min-h-0 overflow-auto py-4 px-1 -mx-1">
|
|
925
|
+
<div className="grid gap-4">
|
|
926
|
+
<div className="grid grid-cols-4 items-center gap-4">
|
|
927
|
+
<Label htmlFor="name" className="text-right">Nome</Label>
|
|
928
|
+
<Input id="name" className="col-span-3" />
|
|
929
|
+
</div>
|
|
930
|
+
</div>
|
|
931
|
+
</div>
|
|
932
|
+
<SheetFooter>
|
|
933
|
+
<SheetClose asChild>
|
|
934
|
+
<Button type="submit">Salvar</Button>
|
|
935
|
+
</SheetClose>
|
|
936
|
+
</SheetFooter>
|
|
937
|
+
</SheetContent>
|
|
938
|
+
</Sheet>`},{title:"Sheet – Lado Esquerdo",description:"Sheet abre do lado esquerdo da tela, ideal para menus de navegação.",preview:e.jsxs(E,{children:[e.jsx(z,{asChild:!0,children:e.jsx(a,{variant:"outline",children:"Esquerda"})}),e.jsxs(q,{side:"left",children:[e.jsx(R,{showSeparator:!0,children:e.jsx(V,{children:"Menu Lateral"})}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto py-4 px-1 -mx-1",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:'Conteúdo do painel esquerdo. Use side="left" para posicionar.'})})]})]}),code:`<Sheet>
|
|
939
|
+
<SheetTrigger asChild>
|
|
940
|
+
<Button variant="outline">Esquerda</Button>
|
|
941
|
+
</SheetTrigger>
|
|
942
|
+
<SheetContent side="left">
|
|
943
|
+
<SheetHeader showSeparator>
|
|
944
|
+
<SheetTitle>Menu Lateral</SheetTitle>
|
|
945
|
+
</SheetHeader>
|
|
946
|
+
<div className="py-4">Conteúdo do painel esquerdo</div>
|
|
947
|
+
</SheetContent>
|
|
948
|
+
</Sheet>`},{title:"Sheet – Topo",description:"Sheet abre do topo da tela, ideal para notificações ou buscas.",preview:e.jsxs(E,{children:[e.jsx(z,{asChild:!0,children:e.jsx(a,{variant:"outline",children:"Topo"})}),e.jsxs(q,{side:"top",children:[e.jsx(R,{showSeparator:!0,children:e.jsx(V,{children:"Notificações"})}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto py-4 px-1 -mx-1",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:'Conteúdo do painel superior. Use side="top" para posicionar.'})})]})]}),code:`<Sheet>
|
|
949
|
+
<SheetTrigger asChild>
|
|
950
|
+
<Button variant="outline">Topo</Button>
|
|
951
|
+
</SheetTrigger>
|
|
952
|
+
<SheetContent side="top">
|
|
953
|
+
<SheetHeader showSeparator>
|
|
954
|
+
<SheetTitle>Notificações</SheetTitle>
|
|
955
|
+
</SheetHeader>
|
|
956
|
+
<div className="py-4">Conteúdo do painel superior</div>
|
|
957
|
+
</SheetContent>
|
|
958
|
+
</Sheet>`},{title:"Sheet – Inferior",description:"Painel que desliza da parte inferior da tela. Baseado na biblioteca vaul, suporta gestos de swipe. Ideal para mobile e ações secundárias.",preview:e.jsxs(Me,{children:[e.jsx(Ue,{asChild:!0,children:e.jsx(a,{variant:"outline",children:"Inferior (Drawer)"})}),e.jsxs(Ge,{children:[e.jsxs(Xe,{children:[e.jsx(Qe,{children:"Editar Perfil"}),e.jsx(Je,{children:"Faça alterações no seu perfil aqui. Clique em salvar quando terminar."})]}),e.jsx("div",{className:"p-4",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Conteúdo do drawer. Suporta gestos de swipe para fechar."})}),e.jsxs($e,{children:[e.jsx(a,{children:"Salvar"}),e.jsx(Ke,{asChild:!0,children:e.jsx(a,{variant:"outline",children:"Cancelar"})})]})]})]}),code:`// Sheet Inferior usa Drawer (biblioteca vaul) para gestos de swipe
|
|
959
|
+
import {
|
|
960
|
+
Drawer, DrawerTrigger, DrawerContent, DrawerHeader,
|
|
961
|
+
DrawerTitle, DrawerDescription, DrawerFooter, DrawerClose
|
|
962
|
+
} from "forlogic-core";
|
|
963
|
+
|
|
964
|
+
<Drawer>
|
|
965
|
+
<DrawerTrigger asChild>
|
|
966
|
+
<Button variant="outline">Abrir</Button>
|
|
967
|
+
</DrawerTrigger>
|
|
968
|
+
<DrawerContent>
|
|
969
|
+
<DrawerHeader>
|
|
970
|
+
<DrawerTitle>Título</DrawerTitle>
|
|
971
|
+
<DrawerDescription>Descrição opcional</DrawerDescription>
|
|
972
|
+
</DrawerHeader>
|
|
973
|
+
<div className="p-4">Conteúdo</div>
|
|
974
|
+
<DrawerFooter>
|
|
975
|
+
<Button>Salvar</Button>
|
|
976
|
+
<DrawerClose asChild>
|
|
977
|
+
<Button variant="outline">Cancelar</Button>
|
|
978
|
+
</DrawerClose>
|
|
979
|
+
</DrawerFooter>
|
|
980
|
+
</DrawerContent>
|
|
981
|
+
</Drawer>`}],props:[{name:"variant",type:'"informative" | "form" | "destructive"',default:'"informative"',description:"Variante semântica que controla o comportamento de fechamento. informative: fecha livremente. form: bloqueia clique externo, confirma se isDirty. destructive: exige ação explícita nos botões."},{name:"isDirty",type:"boolean",default:"false",description:'Quando variant="form", exibe window.confirm antes de fechar via ESC ou botão X se houver alterações não salvas.'},{name:"size",type:'"sm" | "md" | "lg"',default:'"md"',description:"Tamanho responsivo do dialog. sm: confirmações rápidas, md: formulários padrão, lg: tabelas e conteúdo extenso."},{name:"customWidth",type:"string",default:"-",description:'Sobrescreve a largura do tamanho selecionado (ex: "600px", "50vw").'},{name:"customMinWidth",type:"string",default:"-",description:"Sobrescreve a largura mínima do tamanho selecionado."},{name:"customMaxWidth",type:"string",default:"-",description:"Sobrescreve a largura máxima do tamanho selecionado."},{name:"customHeight",type:"string",default:"-",description:"Sobrescreve a altura do tamanho selecionado."},{name:"customMinHeight",type:"string",default:"-",description:"Sobrescreve a altura mínima do tamanho selecionado."},{name:"customMaxHeight",type:"string",default:"-",description:"Sobrescreve a altura máxima do tamanho selecionado."},{name:"open",type:"boolean",default:"-",description:"O estado controlado de abertura do dialog."},{name:"onOpenChange",type:"(open: boolean) => void",default:"-",description:"Callback quando o estado de abertura muda."},{name:"modal",type:"boolean",default:"true",description:"Se o dialog deve bloquear interação com elementos fora."},{name:"showSeparator",type:"boolean",default:"false",description:"Exibe um separador abaixo do Header (Dialog/Sheet)."},{name:"DialogBody",type:"component",default:"-",description:"OBRIGATÓRIO para envolver conteúdo entre Header e Footer. Aplica flex-1 min-h-0 overflow-auto py-4 px-1 -mx-1 automaticamente."},{name:"className",type:"string",default:"-",description:"Classes CSS adicionais para Content."},{name:"Sheet.side",type:'"top" | "right" | "bottom" | "left"',default:'"right"',description:"Lado da tela onde o Sheet abre (exceto inferior que usa Drawer)."},{name:"Drawer (Sheet Inferior)",type:"component",default:"-",description:"Painel inferior baseado em vaul. Suporta gestos de swipe."},{name:"shouldScaleBackground",type:"boolean",default:"true",description:"Escala o background ao abrir (Sheet Inferior/Drawer)."}],notes:["⚠️ OBRIGATÓRIO: Use DialogBody para envolver conteúdo entre Header e Footer. Evita problemas de overflow!","🔒 Variantes semânticas: informative (fecha livremente), form (bloqueia clique externo, confirma isDirty), destructive (exige ação explícita).","Tamanhos responsivos: sm (30vw, 320-480px), md (50vw, 480-720px), lg (85vw, 720-1440px).","Use props custom* para sobrescrever dimensões específicas quando necessário.",'variant="form" com isDirty=true exibe window.confirm ao tentar fechar via ESC ou botão X.','variant="destructive" oculta o botão X e bloqueia ESC — fechamento apenas por botões no Footer.',"AlertDialog: requer ação explícita (não fecha com clique fora). Use para ações destrutivas com confirmação por texto/senha.","Sheet: painel que desliza da borda da tela (left, right, top). Ideal para formulários e detalhes.","Sheet Inferior (Drawer): usa biblioteca vaul, suporta gestos de swipe. Prefira para mobile.","Use DialogHeader/SheetHeader, DialogBody e DialogFooter/SheetFooter para estruturar.","showSeparator adiciona linha visual abaixo do Header."],accessibility:["Foco capturado automaticamente (focus trap)","Esc fecha dialog/sheet (comportamento depende da variant)","Clique fora fecha dialog/sheet (bloqueado em variant form/destructive)","Tab navega entre elementos focáveis",'aria-modal="true" aplicado automaticamente','role="dialog" ou "alertdialog" apropriado',"aria-labelledby vinculado ao Title","Compatível com leitores de tela (NVDA, VoiceOver, JAWS)"]})}export{Da as DialogDoc};
|