forlogic-core 2.0.3 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.note/memory/features/crud-defaults-batteries-included.md +1 -1
- package/README.md +187 -917
- package/dist/components/ui/dialog-wizard.d.ts +82 -0
- package/dist/components/ui/input-group.d.ts +1 -1
- package/dist/components/ui/input.d.ts +5 -23
- package/dist/components/ui/resizable.d.ts +1 -1
- package/dist/components/ui/sidebar.d.ts +1 -1
- package/dist/components/ui/step-selector.d.ts +11 -9
- package/dist/components/ui/textarea.d.ts +1 -0
- package/dist/crud/components/CrudTable.d.ts +3 -1
- package/dist/crud/createCrudPage.d.ts +2 -0
- package/dist/crud/hooks/useColumnManager.d.ts +3 -1
- package/dist/exports/ui.d.ts +1 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/types/sidebar.d.ts +2 -1
- package/dist/types.d.ts +3 -0
- package/docs/AUDIT_PROMPT.md +74 -0
- package/docs/PROJECT_KNOWLEDGE_TEMPLATE.md +117 -0
- package/docs/PROMPT_TEMPLATE.md +77 -0
- package/docs/STARTER_TEMPLATE.md +114 -0
- package/docs/design-system/README.md +45 -0
- package/docs/design-system/buttons-actions.md +433 -0
- package/docs/design-system/charts-dashboards.md +547 -0
- package/docs/design-system/crud.md +243 -0
- package/docs/design-system/data-display.md +360 -0
- package/docs/design-system/dialogs.md +588 -0
- package/docs/design-system/domain.md +661 -0
- package/docs/design-system/examples.md +275 -0
- package/docs/design-system/foundation.md +82 -0
- package/docs/design-system/infra-utils.md +36 -0
- package/docs/design-system/inputs.md +556 -0
- package/docs/design-system/layout.md +351 -0
- package/docs/design-system/navigation.md +604 -0
- package/docs/design-system/notifications-feedback.md +139 -0
- package/docs/design-system/platform.md +95 -0
- package/docs/design-system/selectors.md +424 -0
- package/docs/design-system/tables-grids.md +114 -0
- package/package.json +2 -2
- package/dist/assets/AccordionDoc-CGNlubG3.js +0 -31
- package/dist/assets/ActionButtonDoc-CYtkXR0k.js +0 -47
- package/dist/assets/ActionPlanDoc-BSuPRftQ.js +0 -65
- package/dist/assets/AlertDoc-Cpvxneqg.js +0 -37
- package/dist/assets/AliasUrlDoc-DIpUWf4Y.js +0 -189
- package/dist/assets/AppHeaderDoc-DNQErj_t.js +0 -74
- package/dist/assets/AppSidebarDoc-DkeQarDu.js +0 -221
- package/dist/assets/ApprovalFlowDoc-8YgXbhKJ.js +0 -31
- package/dist/assets/AuditLogDoc-BBvNcHIo.js +0 -67
- package/dist/assets/AuditTrailDoc-DgFHO-uo.js +0 -17
- package/dist/assets/AuthDoc-WIA_Aetl.js +0 -200
- package/dist/assets/AvatarDoc-B6go1C1T.js +0 -11
- package/dist/assets/BadgeDoc-BONhfqB_.js +0 -36
- package/dist/assets/BaseFormDoc-CuyUArcj.js +0 -169
- package/dist/assets/BodyContentDoc-CterHC1E.js +0 -83
- package/dist/assets/BreadcrumbDoc-Dwn9nLeO.js +0 -75
- package/dist/assets/ButtonDoc-BOjRseZT.js +0 -41
- package/dist/assets/ButtonGroupDoc-8IS6PPh4.js +0 -7
- package/dist/assets/CalendarDoc-CMwIEqgT.js +0 -81
- package/dist/assets/CardDoc-BZz1CVg2.js +0 -49
- package/dist/assets/ChartDoc-B5vZVtqD.js +0 -76
- package/dist/assets/CheckboxDoc-lAbYO9I5.js +0 -55
- package/dist/assets/ColorPickerDoc-Dpsprp4N.js +0 -10
- package/dist/assets/ColorsFoundationDoc-CCHeSL3p.js +0 -13
- package/dist/assets/ComboTreeDoc-D4dTkIt-.js +0 -46
- package/dist/assets/ComboboxDoc-CqqZPvZq.js +0 -134
- package/dist/assets/ComponentDocTemplate-CQbBhfvZ.js +0 -1
- package/dist/assets/ContextMenuDoc-D3jC-MVA.js +0 -182
- package/dist/assets/ContextsDoc-XFH0-JdS.js +0 -211
- package/dist/assets/CreateCrudPageDoc-CpuiWI-g.js +0 -106
- package/dist/assets/CrudActionBarDoc-wuBGXD9Y.js +0 -112
- package/dist/assets/CrudGridDoc-BYWqSXBH.js +0 -85
- package/dist/assets/CrudOverviewDoc-B_bk2a2t.js +0 -14
- package/dist/assets/CrudPrimitivesDoc-CxaTB94A.js +0 -164
- package/dist/assets/CrudTableDoc-Dga1VgCu.js +0 -113
- package/dist/assets/CustomFormFieldsDoc-C1hwwSl3.js +0 -33
- package/dist/assets/DashboardFormDoc-BUDCmrMl.js +0 -49
- package/dist/assets/DashboardGeneralViewDoc-Cyg1SIiG.js +0 -71
- package/dist/assets/DashboardGridDoc-BavePiRF.js +0 -49
- package/dist/assets/DashboardListDoc-CLyMA6UK.js +0 -37
- package/dist/assets/DashboardOverviewDoc-DRVvNIF1.js +0 -35
- package/dist/assets/DashboardPanelRendererDoc--mfwb8Nc.js +0 -60
- package/dist/assets/DashboardPanelsBasicDoc-BQ2V_52D.js +0 -62
- package/dist/assets/DashboardPanelsCartesianDoc-sy-hcVQY.js +0 -75
- package/dist/assets/DashboardPanelsSpecialDoc-DsIUCRRP.js +0 -83
- package/dist/assets/DashboardViewDoc-CtlCNlEF.js +0 -45
- package/dist/assets/DataListDoc-DUy88lCQ.js +0 -13
- package/dist/assets/DesignSystemHome-DHl9YtbH.js +0 -1
- package/dist/assets/DialogDoc-CMQqnTV-.js +0 -981
- package/dist/assets/DropdownMenuDoc-S7X9csGt.js +0 -175
- package/dist/assets/ElectronicSignatureDialogDoc-BfithaL_.js +0 -57
- package/dist/assets/EmptyStateDoc-CHGCiGIk.js +0 -35
- package/dist/assets/EnvironmentsDoc-DZHJZ2nm.js +0 -96
- package/dist/assets/ErrorBoundaryDoc-DoaAg68p.js +0 -111
- package/dist/assets/ExampleActionPlanPage-C0fIMZCD.js +0 -1
- package/dist/assets/ExampleAppDoc-DzIU81Fn.js +0 -1
- package/dist/assets/ExampleCard-DuLrb3t-.js +0 -1
- package/dist/assets/ExampleCrudReportsPage-M0pz6tdM.js +0 -1
- package/dist/assets/ExampleDashboardPage-CRG5r3Vw.js +0 -1
- package/dist/assets/ExampleIdeasPage-I84ZMLY4.js +0 -1
- package/dist/assets/ExampleImportWizardPage-h4YqrrSe.js +0 -1
- package/dist/assets/ExampleSettingsPage-CwdWqoaP.js +0 -1
- package/dist/assets/FileUploadDoc-9-UujFNX.js +0 -34
- package/dist/assets/FilterBar-DDTqqUfZ.js +0 -1
- package/dist/assets/FormDoc-CVES6n3d.js +0 -81
- package/dist/assets/FoundationOverview-DT0u11Gz.js +0 -1
- package/dist/assets/GridDoc-CbHFSILF.js +0 -28
- package/dist/assets/HooksDoc-Ctxdk6Wq.js +0 -665
- package/dist/assets/HoverCardDoc-8Wkaafdj.js +0 -31
- package/dist/assets/I18nDoc-D3Q2m7ik.js +0 -167
- package/dist/assets/IconPickerDoc-DZ26Gdpg.js +0 -10
- package/dist/assets/IconsFoundationDoc-xOxtC7CW.js +0 -33
- package/dist/assets/InputDoc-BhztAiuJ.js +0 -211
- package/dist/assets/LabelDoc-A4hmTRRV.js +0 -42
- package/dist/assets/LeadershipDoc-CqOSfWsP.js +0 -452
- package/dist/assets/MediaDoc-C78gvC8p.js +0 -459
- package/dist/assets/MenubarDoc-DCnmd2tO.js +0 -165
- package/dist/assets/ModuleAccessDoc-CmD5nHDp.js +0 -153
- package/dist/assets/ModulesDialogDoc-DVit1CA-.js +0 -46
- package/dist/assets/MultiselectPermissionsDoc-tlJMs04L.js +0 -34
- package/dist/assets/NavigationMenuDoc-q1fbc89j.js +0 -116
- package/dist/assets/OnboardingDialogDoc-3A3eBYrq.js +0 -55
- package/dist/assets/PaginationDoc-B8-bMz5J.js +0 -27
- package/dist/assets/PaginationDoc-BkGdxHL3.js +0 -98
- package/dist/assets/PlacesDoc-CKPO6ATs.js +0 -226
- package/dist/assets/PopoverDoc-CJPU4Ags.js +0 -64
- package/dist/assets/ProgressDoc-CpjbTL4o.js +0 -29
- package/dist/assets/QualiexUserFieldDoc-DDwumlRw.js +0 -149
- package/dist/assets/RadioGroupDoc-D6tSZz8G.js +0 -57
- package/dist/assets/RadiusDoc-B4xSnajw.js +0 -7
- package/dist/assets/ReportRequestListDoc-C0LIaU8P.js +0 -15
- package/dist/assets/RequiredFieldsCounterDoc-COesoSdx.js +0 -58
- package/dist/assets/ResizableDoc-CW0-XQuB.js +0 -104
- package/dist/assets/RichTextEditorDoc-C8c_XA9P.js +0 -24
- package/dist/assets/ScrollAreaDoc-BxtoAPaZ.js +0 -28
- package/dist/assets/SecurityDoc-wOVqpg2F.js +0 -204
- package/dist/assets/SelectDoc-C75gtY9D.js +0 -80
- package/dist/assets/SeparatorDoc-BjQBPB1P.js +0 -4
- package/dist/assets/ServicesDoc-CXTctwBl.js +0 -308
- package/dist/assets/ShadowsDoc-C6Lw8_x2.js +0 -9
- package/dist/assets/SignDoc-Bh5ZUg5x.js +0 -66
- package/dist/assets/SkeletonDoc-rTLGK5VE.js +0 -54
- package/dist/assets/SliderDoc-JMAMDub7.js +0 -41
- package/dist/assets/SpacingDoc-RljOrpwA.js +0 -12
- package/dist/assets/SplitButtonDoc-CvShUW3w.js +0 -53
- package/dist/assets/StepSelectorDoc-C-nAap9H.js +0 -41
- package/dist/assets/SwitchDoc-DLnqmkPr.js +0 -56
- package/dist/assets/TableDoc-B8EpWLVg.js +0 -128
- package/dist/assets/TabsDoc-DIBtl_uC.js +0 -42
- package/dist/assets/TeamSelectorDoc-B7OnCbL7.js +0 -10
- package/dist/assets/TermsOfUseDoc-Bb-pw08s.js +0 -16
- package/dist/assets/TextareaDoc-DGnqMqEC.js +0 -46
- package/dist/assets/ToastDoc-DjYyc7ae.js +0 -157
- package/dist/assets/ToggleDoc-C9ZOVjkY.js +0 -51
- package/dist/assets/TooltipDoc-BEx4l9-i.js +0 -58
- package/dist/assets/TruncatedCellDoc-BbV1bRSY.js +0 -12
- package/dist/assets/TypographyFoundationDoc-CUDYjRo9.js +0 -7
- package/dist/assets/UpdatesNotificationDoc-7nyjzLMJ.js +0 -29
- package/dist/assets/UsersGroupsSelectorDoc-C0KlTAL5.js +0 -18
- package/dist/assets/UtilitiesDoc-DGxaHVV1.js +0 -145
- package/dist/assets/ViewerDialogsDoc-CnTPTEz0.js +0 -1
- package/dist/assets/blocks-B6LrJeAM.js +0 -1
- package/dist/assets/building-DeVappnD.js +0 -1
- package/dist/assets/calendar-days-BQ0na5kM.js +0 -1
- package/dist/assets/check-check-C_-PJCJa.js +0 -1
- package/dist/assets/circle-plus-CpIcep-O.js +0 -1
- package/dist/assets/circle-x-jPpBPew0.js +0 -1
- package/dist/assets/clipboard-list-CXNPdciZ.js +0 -1
- package/dist/assets/cloud-upload-BEjzumjl.js +0 -1
- package/dist/assets/crown-CqNsQIsm.js +0 -1
- package/dist/assets/date-picker-BW3eGOe_.js +0 -1
- package/dist/assets/disabled-menu-item-C2YaMvSt.js +0 -1
- package/dist/assets/drawer-D5rflIcD.js +0 -3
- package/dist/assets/file-braces-DFb5X9so.js +0 -1
- package/dist/assets/file-pen-line-CyUGKkEN.js +0 -1
- package/dist/assets/git-branch-BcXv9mpp.js +0 -1
- package/dist/assets/globe-CpMIWAcv.js +0 -1
- package/dist/assets/hash-cQWdKjya.js +0 -1
- package/dist/assets/hourglass-BahQ3eDv.js +0 -1
- package/dist/assets/hover-card-R66N85sZ.js +0 -1
- package/dist/assets/iframe-dialog-V0mW5aBb.js +0 -1
- package/dist/assets/index-DkiftrvI.js +0 -352
- package/dist/assets/index-nmBjO9Th.css +0 -1
- package/dist/assets/life-buoy-ByXiPddz.js +0 -1
- package/dist/assets/loading-state-Cb5_t5uE.js +0 -1
- package/dist/assets/lucide-react-Cp3Yw3Zm.js +0 -1
- package/dist/assets/package-B3-pVvPM.js +0 -1
- package/dist/assets/pen-Bi_lmmKT.js +0 -1
- package/dist/assets/pin-DVsSl8QA.js +0 -1
- package/dist/assets/printer-BnJ8B6m-.js +0 -1
- package/dist/assets/radio-group-BHAaNGsm.js +0 -1
- package/dist/assets/server-CtzFTfKR.js +0 -1
- package/dist/assets/share-2-Dv8Do445.js +0 -1
- package/dist/assets/shield-check-CFXjOV_w.js +0 -1
- package/dist/assets/shield-x-DJTRfVux.js +0 -1
- package/dist/assets/slider-v9tXBSnB.js +0 -1
- package/dist/assets/smartphone-BSNR60L7.js +0 -1
- package/dist/assets/step-selector-ATTh_9Wa.js +0 -1
- package/dist/assets/text-align-start-qE-MbYYw.js +0 -1
- package/dist/assets/thumbs-up-D_XIW_uX.js +0 -1
- package/dist/assets/trash-DTWQwpwA.js +0 -1
- package/dist/assets/trending-up-jip5-leJ.js +0 -1
- package/dist/assets/useMockCrud-CN4vjyOZ.js +0 -1
- package/dist/assets/user-check-BlH3EDWK.js +0 -1
- package/dist/assets/user-plus-BqwXwD-c.js +0 -1
- package/dist/index.html +0 -33
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import{j as e,a as v,b as j,c as g,d as b,a5 as k,a6 as T,a7 as f,aa as N,r as C,J as t,K as n,M as A,W as V,x as w,aR as O,N as E,O as I,Q as B,R as P,V as S,m as L,eO as M,f7 as $,P as q,E as z,G as U,H as R,I as _,Y as D}from"./index-DkiftrvI.js";import{L as H}from"./lucide-react-Cp3Yw3Zm.js";import{C as Z}from"./ComponentDocTemplate-CQbBhfvZ.js";import"./pin-DVsSl8QA.js";import"./building-DeVappnD.js";import"./hash-cQWdKjya.js";import"./blocks-B6LrJeAM.js";import"./calendar-days-BQ0na5kM.js";import"./check-check-C_-PJCJa.js";import"./circle-plus-CpIcep-O.js";import"./circle-x-jPpBPew0.js";import"./clipboard-list-CXNPdciZ.js";import"./cloud-upload-BEjzumjl.js";import"./life-buoy-ByXiPddz.js";import"./share-2-Dv8Do445.js";import"./crown-CqNsQIsm.js";import"./file-braces-DFb5X9so.js";import"./file-pen-line-CyUGKkEN.js";import"./git-branch-BcXv9mpp.js";import"./globe-CpMIWAcv.js";import"./shield-x-DJTRfVux.js";import"./hourglass-BahQ3eDv.js";import"./package-B3-pVvPM.js";import"./smartphone-BSNR60L7.js";import"./pen-Bi_lmmKT.js";import"./printer-BnJ8B6m-.js";import"./server-CtzFTfKR.js";import"./shield-check-CFXjOV_w.js";import"./text-align-start-qE-MbYYw.js";import"./thumbs-up-D_XIW_uX.js";import"./trash-DTWQwpwA.js";import"./trending-up-jip5-leJ.js";import"./user-check-BlH3EDWK.js";import"./user-plus-BqwXwD-c.js";import"./ExampleCard-DuLrb3t-.js";function W(){const[l,m]=C.useState({name:"",email:"",bio:"",active:!0}),[s,p]=C.useState({}),d=(c,y)=>{m(F=>({...F,[c]:y})),s[c]&&p(F=>({...F,[c]:""}))},h=()=>{const c={};return l.name.trim()||(c.name="Nome é obrigatório"),l.email.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(l.email)||(c.email="E-mail inválido"):c.email="E-mail é obrigatório",p(c),Object.keys(c).length===0},a=()=>{h()?(D.success("Formulário enviado com sucesso!"),console.log("Dados:",l)):D.error("Corrija os erros antes de enviar")};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"basic-name",children:"Nome *"}),e.jsx(n,{id:"basic-name",value:l.name,onChange:c=>d("name",c.target.value),placeholder:"Digite o nome",className:s.name?"border-destructive":""}),s.name&&e.jsx("p",{className:"text-sm text-destructive",children:s.name})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"basic-email",children:"E-mail *"}),e.jsx(n,{id:"basic-email",type:"email",value:l.email,onChange:c=>d("email",c.target.value),placeholder:"email@exemplo.com",className:s.email?"border-destructive":""}),s.email&&e.jsx("p",{className:"text-sm text-destructive",children:s.email})]}),e.jsxs("div",{className:"space-y-2 md:col-span-2",children:[e.jsx(t,{htmlFor:"basic-bio",children:"Biografia"}),e.jsx(A,{id:"basic-bio",value:l.bio,onChange:c=>d("bio",c.target.value),placeholder:"Conte sobre você..."})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(V,{id:"basic-active",checked:l.active,onCheckedChange:c=>d("active",c)}),e.jsx(t,{htmlFor:"basic-active",children:"Ativo"})]})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(w,{variant:"outline",onClick:()=>m({name:"",email:"",bio:"",active:!0}),children:"Limpar"}),e.jsx(w,{onClick:a,children:"Salvar"})]})]})}function G(){const[l,m]=C.useState({name:"",email:"",age:"",description:"",status:"",category:"",active:!0,newsletter:!1,birthDate:"",color:"#3b82f6",icon:"Star"}),s=(a,c)=>{m(y=>({...y,[a]:c}))},p=[{value:"active",label:"Ativo"},{value:"inactive",label:"Inativo"},{value:"pending",label:"Pendente"}],d=[{value:"tech",label:"Tecnologia"},{value:"finance",label:"Finanças"},{value:"health",label:"Saúde"},{value:"education",label:"Educação"}],h=H[l.icon]||O;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-semibold mb-3 text-muted-foreground uppercase tracking-wide",children:"Campos de Texto"}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"all-name",children:"Nome (text)"}),e.jsx(n,{id:"all-name",value:l.name,onChange:a=>s("name",a.target.value),placeholder:"Digite o nome"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"all-email",children:"E-mail (email)"}),e.jsx(n,{id:"all-email",type:"email",value:l.email,onChange:a=>s("email",a.target.value),placeholder:"email@exemplo.com"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"all-age",children:"Idade (number)"}),e.jsx(n,{id:"all-age",type:"number",value:l.age,onChange:a=>s("age",a.target.value),placeholder:"25",min:0,max:150})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"all-date",children:"Data de Nascimento (date)"}),e.jsx(n,{id:"all-date",type:"date",value:l.birthDate,onChange:a=>s("birthDate",a.target.value)})]}),e.jsxs("div",{className:"space-y-2 md:col-span-2",children:[e.jsx(t,{htmlFor:"all-desc",children:"Descrição (textarea)"}),e.jsx(A,{id:"all-desc",value:l.description,onChange:a=>s("description",a.target.value),placeholder:"Descrição detalhada...",rows:3})]})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-semibold mb-3 text-muted-foreground uppercase tracking-wide",children:"Campos de Seleção"}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{children:"Status (select)"}),e.jsxs(E,{value:l.status,onValueChange:a=>s("status",a),children:[e.jsx(I,{children:e.jsx(B,{placeholder:"Selecione o status"})}),e.jsx(P,{children:p.map(a=>e.jsx(S,{value:a.value,children:a.label},a.value))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{children:"Categoria (select)"}),e.jsxs(E,{value:l.category,onValueChange:a=>s("category",a),children:[e.jsx(I,{children:e.jsx(B,{placeholder:"Selecione a categoria"})}),e.jsx(P,{children:d.map(a=>e.jsx(S,{value:a.value,children:a.label},a.value))})]})]})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-semibold mb-3 text-muted-foreground uppercase tracking-wide",children:"Campos Booleanos"}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"flex items-center justify-between p-3 border rounded-lg",children:[e.jsx(t,{htmlFor:"all-active",children:"Ativo (switch)"}),e.jsx(V,{id:"all-active",checked:l.active,onCheckedChange:a=>s("active",a)})]}),e.jsxs("div",{className:"flex items-center gap-2 p-3 border rounded-lg",children:[e.jsx(L,{id:"all-newsletter",checked:l.newsletter,onCheckedChange:a=>s("newsletter",!!a)}),e.jsx(t,{htmlFor:"all-newsletter",className:"cursor-pointer",children:"Receber newsletter (checkbox)"})]})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-semibold mb-3 text-muted-foreground uppercase tracking-wide",children:"Campos Visuais"}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{children:"Cor (color-picker)"}),e.jsx(M,{value:l.color,onChange:a=>s("color",a)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{children:"Ícone (icon-picker)"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx($,{value:l.icon,onChange:a=>s("icon",a)}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(h,{className:"h-5 w-5",style:{color:l.color}}),e.jsx("span",{children:l.icon})]})]})]})]})]}),e.jsxs("div",{className:"p-4 bg-muted/50 rounded-lg",children:[e.jsx("h4",{className:"text-sm font-semibold mb-2",children:"Dados do Formulário:"}),e.jsx("pre",{className:"text-xs overflow-x-auto",children:JSON.stringify(l,null,2)})]})]})}function J(){const[l,m]=C.useState({username:"",password:"",confirmPassword:"",email:"",phone:"",cpf:"",age:"",website:"",terms:!1}),[s,p]=C.useState({}),[d,h]=C.useState({}),a=(i,r)=>{m(o=>({...o,[i]:r})),h(o=>({...o,[i]:!0})),c(i,r)},c=(i,r)=>{let o="";switch(i){case"username":r?r.length<3?o="Mínimo 3 caracteres":r.length>20?o="Máximo 20 caracteres":/^[a-zA-Z0-9_]+$/.test(r)||(o="Apenas letras, números e _"):o="Usuário é obrigatório";break;case"password":r?r.length<8?o="Mínimo 8 caracteres":/[A-Z]/.test(r)?/[a-z]/.test(r)?/[0-9]/.test(r)||(o="Deve conter número"):o="Deve conter letra minúscula":o="Deve conter letra maiúscula":o="Senha é obrigatória";break;case"confirmPassword":r?r!==l.password&&(o="Senhas não conferem"):o="Confirmação é obrigatória";break;case"email":r?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r)||(o="E-mail inválido"):o="E-mail é obrigatório";break;case"phone":r&&!/^\(\d{2}\)\s?\d{4,5}-?\d{4}$/.test(r)&&(o="Formato: (11) 99999-9999");break;case"cpf":r&&r.replace(/\D/g,"").length!==11&&(o="CPF deve ter 11 dígitos");break;case"age":if(r){const u=parseInt(r);isNaN(u)||u<18?o="Idade mínima: 18 anos":u>120&&(o="Idade inválida")}break;case"website":r&&!/^https?:\/\/.+\..+$/.test(r)&&(o="URL inválida (ex: https://site.com)");break;case"terms":r||(o="Você deve aceitar os termos");break}return p(u=>({...u,[i]:o})),!o},y=()=>{let i=!0;return Object.keys(l).forEach(r=>{const o=l[r];c(r,o)||(i=!1),h(u=>({...u,[r]:!0}))}),i},F=()=>{y()?D.success("Cadastro realizado com sucesso!"):D.error("Corrija os erros antes de enviar")},x=i=>d[i]?s[i]?"border-destructive":"border-green-500":"";return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"val-username",children:"Usuário *"}),e.jsx(n,{id:"val-username",value:l.username,onChange:i=>a("username",i.target.value),placeholder:"seu_usuario",className:x("username")}),d.username&&s.username&&e.jsx("p",{className:"text-sm text-destructive",children:s.username}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"3-20 caracteres, letras, números e _"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"val-email",children:"E-mail *"}),e.jsx(n,{id:"val-email",type:"email",value:l.email,onChange:i=>a("email",i.target.value),placeholder:"email@exemplo.com",className:x("email")}),d.email&&s.email&&e.jsx("p",{className:"text-sm text-destructive",children:s.email})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"val-password",children:"Senha *"}),e.jsx(n,{id:"val-password",type:"password",value:l.password,onChange:i=>a("password",i.target.value),placeholder:"••••••••",className:x("password")}),d.password&&s.password&&e.jsx("p",{className:"text-sm text-destructive",children:s.password}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Mín. 8 chars, maiúscula, minúscula e número"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"val-confirm",children:"Confirmar Senha *"}),e.jsx(n,{id:"val-confirm",type:"password",value:l.confirmPassword,onChange:i=>a("confirmPassword",i.target.value),placeholder:"••••••••",className:x("confirmPassword")}),d.confirmPassword&&s.confirmPassword&&e.jsx("p",{className:"text-sm text-destructive",children:s.confirmPassword})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"val-phone",children:"Telefone"}),e.jsx(n,{id:"val-phone",value:l.phone,onChange:i=>a("phone",i.target.value),placeholder:"(11) 99999-9999",className:x("phone")}),d.phone&&s.phone&&e.jsx("p",{className:"text-sm text-destructive",children:s.phone})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"val-cpf",children:"CPF"}),e.jsx(n,{id:"val-cpf",value:l.cpf,onChange:i=>a("cpf",i.target.value),placeholder:"000.000.000-00",className:x("cpf")}),d.cpf&&s.cpf&&e.jsx("p",{className:"text-sm text-destructive",children:s.cpf})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"val-age",children:"Idade"}),e.jsx(n,{id:"val-age",type:"number",value:l.age,onChange:i=>a("age",i.target.value),placeholder:"25",min:18,className:x("age")}),d.age&&s.age&&e.jsx("p",{className:"text-sm text-destructive",children:s.age})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"val-website",children:"Website"}),e.jsx(n,{id:"val-website",value:l.website,onChange:i=>a("website",i.target.value),placeholder:"https://meusite.com",className:x("website")}),d.website&&s.website&&e.jsx("p",{className:"text-sm text-destructive",children:s.website})]})]}),e.jsxs("div",{className:"flex items-center gap-2 p-3 border rounded-lg",children:[e.jsx(L,{id:"val-terms",checked:l.terms,onCheckedChange:i=>a("terms",!!i)}),e.jsx(t,{htmlFor:"val-terms",className:"cursor-pointer",children:"Aceito os termos de uso e política de privacidade *"})]}),d.terms&&s.terms&&e.jsx("p",{className:"text-sm text-destructive",children:s.terms}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(w,{variant:"outline",onClick:()=>{m({username:"",password:"",confirmPassword:"",email:"",phone:"",cpf:"",age:"",website:"",terms:!1}),p({}),h({})},children:"Limpar"}),e.jsx(w,{onClick:F,children:"Cadastrar"})]})]})}function Q(){const[l,m]=C.useState(!1),[s,p]=C.useState({title:"",priority:"medium",assignee:"",dueDate:"",description:""}),d=(a,c)=>{p(y=>({...y,[a]:c}))},h=()=>{D.success("Tarefa criada com sucesso!"),m(!1),p({title:"",priority:"medium",assignee:"",dueDate:"",description:""})};return e.jsxs(e.Fragment,{children:[e.jsxs(w,{onClick:()=>m(!0),children:[e.jsx(q,{className:"h-4 w-4 mr-2"}),"Nova Tarefa"]}),e.jsx(z,{open:l,onOpenChange:m,children:e.jsxs(U,{size:"md",children:[e.jsx(R,{showSeparator:!0,children:e.jsx(_,{children:"Nova Tarefa"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"modal-title",children:"Título *"}),e.jsx(n,{id:"modal-title",value:s.title,onChange:a=>d("title",a.target.value),placeholder:"Digite o título da tarefa"})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{children:"Prioridade"}),e.jsxs(E,{value:s.priority,onValueChange:a=>d("priority",a),children:[e.jsx(I,{children:e.jsx(B,{})}),e.jsxs(P,{children:[e.jsx(S,{value:"low",children:"🟢 Baixa"}),e.jsx(S,{value:"medium",children:"🟡 Média"}),e.jsx(S,{value:"high",children:"🔴 Alta"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"modal-due",children:"Data Limite"}),e.jsx(n,{id:"modal-due",type:"date",value:s.dueDate,onChange:a=>d("dueDate",a.target.value)})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"modal-assignee",children:"Responsável"}),e.jsx(n,{id:"modal-assignee",value:s.assignee,onChange:a=>d("assignee",a.target.value),placeholder:"Nome do responsável"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"modal-desc",children:"Descrição"}),e.jsx(A,{id:"modal-desc",value:s.description,onChange:a=>d("description",a.target.value),placeholder:"Descreva a tarefa...",rows:3})]})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(w,{variant:"outline",onClick:()=>m(!1),children:"Cancelar"}),e.jsx(w,{onClick:h,disabled:!s.title.trim(),children:"Criar Tarefa"})]})]})})]})}function Be(){return e.jsxs(Z,{title:"BaseForm",description:"Formulário dinâmico baseado em configuração de seções e campos, suportando múltiplos tipos de campo, validação e layouts flexíveis.",tocItems:[{id:"formulario-basico",label:"Formulário Básico"},{id:"todos-tipos",label:"Todos os Tipos de Campo"},{id:"validacao-completa",label:"Validação Completa"},{id:"formulario-modal",label:"Formulário em Modal"},{id:"uso-baseform",label:"Uso com BaseForm"},{id:"tipos-campo",label:"Tipos de Campo"},{id:"props-baseform",label:"Props do BaseForm"},{id:"acessibilidade",label:"Acessibilidade"}],children:[e.jsxs(v,{id:"formulario-basico",className:"scroll-mt-4",children:[e.jsx(j,{children:e.jsx(g,{children:"Formulário Básico"})}),e.jsx(b,{children:e.jsxs(k,{defaultValue:"preview",children:[e.jsxs(T,{children:[e.jsx(f,{value:"preview",children:"Preview"}),e.jsx(f,{value:"code",children:"Código"})]}),e.jsx(N,{value:"preview",className:"pt-4",children:e.jsx(W,{})}),e.jsx(N,{value:"code",className:"pt-4",children:e.jsx("pre",{className:"bg-muted p-4 rounded-lg text-sm overflow-x-auto",children:`const [formData, setFormData] = useState({
|
|
2
|
-
name: '', email: '', bio: '', active: true
|
|
3
|
-
});
|
|
4
|
-
const [errors, setErrors] = useState({});
|
|
5
|
-
|
|
6
|
-
const validate = () => {
|
|
7
|
-
const newErrors = {};
|
|
8
|
-
if (!formData.name.trim()) newErrors.name = 'Nome é obrigatório';
|
|
9
|
-
if (!formData.email.trim()) newErrors.email = 'E-mail é obrigatório';
|
|
10
|
-
else if (!/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(formData.email)) {
|
|
11
|
-
newErrors.email = 'E-mail inválido';
|
|
12
|
-
}
|
|
13
|
-
setErrors(newErrors);
|
|
14
|
-
return Object.keys(newErrors).length === 0;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
<Input
|
|
18
|
-
value={formData.name}
|
|
19
|
-
onChange={e => setFormData(prev => ({ ...prev, name: e.target.value }))}
|
|
20
|
-
className={errors.name ? 'border-destructive' : ''}
|
|
21
|
-
/>
|
|
22
|
-
{errors.name && <p className="text-sm text-destructive">{errors.name}</p>}`})})]})})]}),e.jsxs(v,{id:"todos-tipos",className:"scroll-mt-4",children:[e.jsx(j,{children:e.jsx(g,{children:"Todos os Tipos de Campo"})}),e.jsx(b,{children:e.jsxs(k,{defaultValue:"preview",children:[e.jsxs(T,{children:[e.jsx(f,{value:"preview",children:"Preview"}),e.jsx(f,{value:"code",children:"Código"})]}),e.jsx(N,{value:"preview",className:"pt-4",children:e.jsx(G,{})}),e.jsx(N,{value:"code",className:"pt-4",children:e.jsx("pre",{className:"bg-muted p-4 rounded-lg text-sm overflow-x-auto",children:`// Tipos suportados pelo BaseForm:
|
|
23
|
-
|
|
24
|
-
const sections = [{
|
|
25
|
-
id: 'main',
|
|
26
|
-
title: 'Cadastro',
|
|
27
|
-
fields: [
|
|
28
|
-
// Texto
|
|
29
|
-
{ name: 'name', label: 'Nome', type: 'text', required: true },
|
|
30
|
-
{ name: 'email', label: 'E-mail', type: 'email', required: true },
|
|
31
|
-
|
|
32
|
-
// Número
|
|
33
|
-
{ name: 'age', label: 'Idade', type: 'number', min: 0, max: 150 },
|
|
34
|
-
|
|
35
|
-
// Textarea
|
|
36
|
-
{ name: 'description', label: 'Descrição', type: 'textarea', rows: 3 },
|
|
37
|
-
|
|
38
|
-
// Select
|
|
39
|
-
{
|
|
40
|
-
name: 'status',
|
|
41
|
-
label: 'Status',
|
|
42
|
-
type: 'select',
|
|
43
|
-
options: [
|
|
44
|
-
{ value: 'active', label: 'Ativo' },
|
|
45
|
-
{ value: 'inactive', label: 'Inativo' }
|
|
46
|
-
]
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
// Data
|
|
50
|
-
{ name: 'birthDate', label: 'Nascimento', type: 'date' },
|
|
51
|
-
|
|
52
|
-
// Booleanos
|
|
53
|
-
{ name: 'active', label: 'Ativo', type: 'switch' },
|
|
54
|
-
{ name: 'newsletter', label: 'Newsletter', type: 'checkbox' },
|
|
55
|
-
|
|
56
|
-
// Visuais
|
|
57
|
-
{ name: 'color', label: 'Cor', type: 'color-picker' },
|
|
58
|
-
{ name: 'icon', label: 'Ícone', type: 'icon-picker' }
|
|
59
|
-
]
|
|
60
|
-
}];`})})]})})]}),e.jsxs(v,{id:"validacao-completa",className:"scroll-mt-4",children:[e.jsx(j,{children:e.jsx(g,{children:"Validação Completa"})}),e.jsx(b,{children:e.jsxs(k,{defaultValue:"preview",children:[e.jsxs(T,{children:[e.jsx(f,{value:"preview",children:"Preview"}),e.jsx(f,{value:"code",children:"Código"})]}),e.jsx(N,{value:"preview",className:"pt-4",children:e.jsx(J,{})}),e.jsx(N,{value:"code",className:"pt-4",children:e.jsx("pre",{className:"bg-muted p-4 rounded-lg text-sm overflow-x-auto",children:`// Validação em tempo real com feedback visual
|
|
61
|
-
|
|
62
|
-
const validateField = (field, value) => {
|
|
63
|
-
let error = '';
|
|
64
|
-
|
|
65
|
-
switch (field) {
|
|
66
|
-
case 'username':
|
|
67
|
-
if (!value) error = 'Usuário é obrigatório';
|
|
68
|
-
else if (value.length < 3) error = 'Mínimo 3 caracteres';
|
|
69
|
-
else if (!/^[a-zA-Z0-9_]+$/.test(value)) error = 'Apenas letras, números e _';
|
|
70
|
-
break;
|
|
71
|
-
|
|
72
|
-
case 'password':
|
|
73
|
-
if (!value) error = 'Senha é obrigatória';
|
|
74
|
-
else if (value.length < 8) error = 'Mínimo 8 caracteres';
|
|
75
|
-
else if (!/[A-Z]/.test(value)) error = 'Deve conter letra maiúscula';
|
|
76
|
-
else if (!/[0-9]/.test(value)) error = 'Deve conter número';
|
|
77
|
-
break;
|
|
78
|
-
|
|
79
|
-
case 'email':
|
|
80
|
-
if (!/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(value)) error = 'E-mail inválido';
|
|
81
|
-
break;
|
|
82
|
-
|
|
83
|
-
case 'phone':
|
|
84
|
-
if (!/^\\(\\d{2}\\)\\s?\\d{4,5}-?\\d{4}$/.test(value)) {
|
|
85
|
-
error = 'Formato: (11) 99999-9999';
|
|
86
|
-
}
|
|
87
|
-
break;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
setErrors(prev => ({ ...prev, [field]: error }));
|
|
91
|
-
return !error;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
// Classe condicional baseada em estado
|
|
95
|
-
const getFieldClass = (field) => {
|
|
96
|
-
if (!touched[field]) return '';
|
|
97
|
-
return errors[field] ? 'border-destructive' : 'border-green-500';
|
|
98
|
-
};`})})]})})]}),e.jsxs(v,{id:"formulario-modal",className:"scroll-mt-4",children:[e.jsx(j,{children:e.jsx(g,{children:"Formulário em Modal"})}),e.jsx(b,{children:e.jsxs(k,{defaultValue:"preview",children:[e.jsxs(T,{children:[e.jsx(f,{value:"preview",children:"Preview"}),e.jsx(f,{value:"code",children:"Código"})]}),e.jsx(N,{value:"preview",className:"pt-4",children:e.jsx(Q,{})}),e.jsx(N,{value:"code",className:"pt-4",children:e.jsx("pre",{className:"bg-muted p-4 rounded-lg text-sm overflow-x-auto",children:`<Dialog open={open} onOpenChange={setOpen}>
|
|
99
|
-
<DialogContent size="md">
|
|
100
|
-
<DialogHeader showSeparator>
|
|
101
|
-
<DialogTitle>Nova Tarefa</DialogTitle>
|
|
102
|
-
</DialogHeader>
|
|
103
|
-
|
|
104
|
-
<div className="space-y-4 py-4">
|
|
105
|
-
<div className="space-y-2">
|
|
106
|
-
<Label>Título *</Label>
|
|
107
|
-
<Input
|
|
108
|
-
value={formData.title}
|
|
109
|
-
onChange={e => updateField('title', e.target.value)}
|
|
110
|
-
/>
|
|
111
|
-
</div>
|
|
112
|
-
|
|
113
|
-
<div className="grid gap-4 md:grid-cols-2">
|
|
114
|
-
<div className="space-y-2">
|
|
115
|
-
<Label>Prioridade</Label>
|
|
116
|
-
<Select value={formData.priority} onValueChange={v => updateField('priority', v)}>
|
|
117
|
-
<SelectTrigger><SelectValue /></SelectTrigger>
|
|
118
|
-
<SelectContent>
|
|
119
|
-
<SelectItem value="low">🟢 Baixa</SelectItem>
|
|
120
|
-
<SelectItem value="medium">🟡 Média</SelectItem>
|
|
121
|
-
<SelectItem value="high">🔴 Alta</SelectItem>
|
|
122
|
-
</SelectContent>
|
|
123
|
-
</Select>
|
|
124
|
-
</div>
|
|
125
|
-
|
|
126
|
-
<div className="space-y-2">
|
|
127
|
-
<Label>Data Limite</Label>
|
|
128
|
-
<Input type="date" value={formData.dueDate} onChange={...} />
|
|
129
|
-
</div>
|
|
130
|
-
</div>
|
|
131
|
-
</div>
|
|
132
|
-
|
|
133
|
-
<div className="flex justify-end gap-2">
|
|
134
|
-
<Button variant="outline" onClick={() => setOpen(false)}>Cancelar</Button>
|
|
135
|
-
<Button onClick={handleSubmit}>Criar Tarefa</Button>
|
|
136
|
-
</div>
|
|
137
|
-
</DialogContent>
|
|
138
|
-
</Dialog>`})})]})})]}),e.jsxs(v,{id:"uso-baseform",className:"scroll-mt-4",children:[e.jsx(j,{children:e.jsx(g,{children:"Uso com BaseForm (Biblioteca)"})}),e.jsx(b,{children:e.jsx("pre",{className:"bg-muted p-4 rounded-lg text-sm overflow-x-auto",children:`import BaseForm from 'forlogic-core/crud/components/BaseForm';
|
|
139
|
-
|
|
140
|
-
const sections = [
|
|
141
|
-
{
|
|
142
|
-
id: 'basic',
|
|
143
|
-
title: 'Informações Básicas',
|
|
144
|
-
fields: [
|
|
145
|
-
{ name: 'name', label: 'Nome', type: 'text', required: true },
|
|
146
|
-
{ name: 'email', label: 'E-mail', type: 'email', required: true },
|
|
147
|
-
{ name: 'bio', label: 'Biografia', type: 'textarea' },
|
|
148
|
-
{ name: 'active', label: 'Ativo', type: 'switch' },
|
|
149
|
-
],
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
id: 'advanced',
|
|
153
|
-
title: 'Configurações',
|
|
154
|
-
condition: (data) => !!data.name, // Só habilita quando nome preenchido
|
|
155
|
-
fields: [
|
|
156
|
-
{ name: 'role', label: 'Perfil', type: 'select', options: [...] },
|
|
157
|
-
{ name: 'notifications', label: 'Notificações', type: 'switch' },
|
|
158
|
-
],
|
|
159
|
-
},
|
|
160
|
-
];
|
|
161
|
-
|
|
162
|
-
<BaseForm
|
|
163
|
-
title="Novo Usuário"
|
|
164
|
-
sections={sections}
|
|
165
|
-
initialData={data}
|
|
166
|
-
open={isOpen}
|
|
167
|
-
onSubmit={handleSubmit}
|
|
168
|
-
onCancel={() => setIsOpen(false)}
|
|
169
|
-
/>`})})]}),e.jsxs(v,{id:"tipos-campo",className:"scroll-mt-4",children:[e.jsx(j,{children:e.jsx(g,{children:"Tipos de Campo Suportados"})}),e.jsx(b,{children:e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:[{type:"text",desc:"Input de texto padrão"},{type:"email",desc:"Input de e-mail com validação"},{type:"number",desc:"Input numérico com min/max/step"},{type:"textarea",desc:"Área de texto multilinha"},{type:"select",desc:"Seleção com opções"},{type:"multiselect",desc:"Seleção múltipla"},{type:"switch",desc:"Toggle on/off"},{type:"checkbox",desc:"Checkbox simples"},{type:"date",desc:"Seletor de data"},{type:"color-picker",desc:"Seletor de cor avançado"},{type:"icon-picker",desc:"Seletor de ícones Lucide"},{type:"user-select",desc:"Seletor de usuário Qualiex"},{type:"group",desc:"Agrupamento de campos"},{type:"custom",desc:"Componente customizado"}].map(l=>e.jsxs("div",{className:"p-3 border rounded-lg",children:[e.jsx("code",{className:"text-sm font-mono text-primary",children:l.type}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:l.desc})]},l.type))})})]}),e.jsxs(v,{id:"props-baseform",className:"scroll-mt-4",children:[e.jsx(j,{children:e.jsx(g,{children:"Props do BaseForm"})}),e.jsx(b,{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 p-2",children:"Prop"}),e.jsx("th",{className:"text-left p-2",children:"Tipo"}),e.jsx("th",{className:"text-left p-2",children:"Descrição"})]})}),e.jsx("tbody",{children:[["title","string","Título do dialog/formulário"],["sections","FormSection[]","Array de seções com campos"],["initialData","T","Dados iniciais do formulário"],["open","boolean","Controla visibilidade do dialog"],["onSubmit","(data: T) => void","Callback ao submeter"],["onCancel","() => void","Callback ao cancelar"],["submitButtonText","string","Texto do botão de submit"],["isLoading","boolean","Estado de carregamento"]].map(([l,m,s])=>e.jsxs("tr",{className:"border-b",children:[e.jsx("td",{className:"p-2 font-mono text-xs",children:l}),e.jsx("td",{className:"p-2 font-mono text-xs text-muted-foreground",children:m}),e.jsx("td",{className:"p-2",children:s})]},l))})]})})})]}),e.jsxs(v,{id:"acessibilidade",className:"scroll-mt-4",children:[e.jsx(j,{children:e.jsx(g,{children:"Acessibilidade"})}),e.jsx(b,{children:e.jsxs("ul",{className:"list-disc list-inside space-y-2 text-sm text-muted-foreground",children:[e.jsx("li",{children:"Todos os campos possuem labels associados via htmlFor/id"}),e.jsx("li",{children:"Mensagens de erro vinculadas aos campos via aria-describedby"}),e.jsx("li",{children:'Campos obrigatórios marcados com aria-required="true"'}),e.jsx("li",{children:"Navegação por teclado entre campos (Tab/Shift+Tab)"}),e.jsx("li",{children:"Foco visual destacado em todos os elementos interativos"}),e.jsx("li",{children:"Switch e Checkbox acessíveis via teclado (Space para toggle)"}),e.jsx("li",{children:"Feedback de validação anunciado por leitores de tela"}),e.jsx("li",{children:"Contraste adequado para mensagens de erro (WCAG AA)"})]})})]})]})}export{Be as BaseFormDoc};
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import{j as e,gl as o,gm as a,a as t,ab as n,B as r,x as i,F as s}from"./index-DkiftrvI.js";import{C as l}from"./ComponentDocTemplate-CQbBhfvZ.js";import"./ExampleCard-DuLrb3t-.js";function u(){return e.jsx(l,{title:"BodyContent",description:"Container principal de página com breadcrumb, background neutro e suporte a múltiplos containers de conteúdo.",component:e.jsx("div",{className:"w-full max-w-4xl",children:e.jsx(o,{breadcrumbs:[{label:"Módulo",href:"#"},{label:"Seção",href:"#"},{label:"Página Atual"}],className:"rounded-lg overflow-hidden",children:e.jsx(a,{title:"Título do Container",subtitle:"Subtítulo com informações adicionais",children:e.jsx("p",{className:"text-muted-foreground",children:"Este é o conteúdo principal do container. Aqui você pode adicionar qualquer tipo de conteúdo como formulários, tabelas, cards, etc."})})})}),usage:`import { BodyContent, ContentContainer } from 'forlogic-core';
|
|
2
|
-
|
|
3
|
-
<BodyContent
|
|
4
|
-
breadcrumbs={[
|
|
5
|
-
{ label: 'Módulo', href: '/modulo' },
|
|
6
|
-
{ label: 'Seção', href: '/modulo/secao' },
|
|
7
|
-
{ label: 'Página Atual' }, // Sem href = página atual
|
|
8
|
-
]}
|
|
9
|
-
>
|
|
10
|
-
<ContentContainer
|
|
11
|
-
title="Título do Container"
|
|
12
|
-
subtitle="Subtítulo com informações adicionais"
|
|
13
|
-
>
|
|
14
|
-
<p>Conteúdo principal aqui...</p>
|
|
15
|
-
</ContentContainer>
|
|
16
|
-
</BodyContent>`,props:[{name:"breadcrumbs",type:"BreadcrumbItemConfig[]",description:"Array de itens do breadcrumb. Último item é tratado como página atual."},{name:"children",type:"ReactNode",description:"Conteúdo principal (geralmente ContentContainers)"},{name:"className",type:"string",description:"Classes CSS adicionais para o container externo"},{name:"title",type:"string",description:"[ContentContainer] Título do container (opcional)"},{name:"subtitle",type:"string",description:"[ContentContainer] Subtítulo do container (opcional)"},{name:"hasHeader",type:"boolean",default:"true",description:"[ContentContainer] Se deve renderizar header separado do conteúdo"},{name:"label",type:"string",description:"[BreadcrumbItemConfig] Texto exibido no breadcrumb"},{name:"href",type:"string",description:"[BreadcrumbItemConfig] Link de navegação. Se omitido, renderiza como página atual."},{name:"asChild",type:"boolean",description:"[BreadcrumbItemConfig] Se true, usa children como elemento de link (para React Router)"}],examples:[{title:"Uso Básico",description:"Container simples com breadcrumb e título",code:`<BodyContent
|
|
17
|
-
breadcrumbs={[
|
|
18
|
-
{ label: 'Home', href: '/' },
|
|
19
|
-
{ label: 'Usuários' },
|
|
20
|
-
]}
|
|
21
|
-
>
|
|
22
|
-
<ContentContainer title="Lista de Usuários">
|
|
23
|
-
<p>Conteúdo da página...</p>
|
|
24
|
-
</ContentContainer>
|
|
25
|
-
</BodyContent>`,preview:e.jsx("div",{className:"w-full max-w-3xl",children:e.jsx(o,{breadcrumbs:[{label:"Home",href:"#"},{label:"Usuários"}],className:"rounded-lg overflow-hidden",children:e.jsx(a,{title:"Lista de Usuários",children:e.jsx("p",{className:"text-muted-foreground",children:"Conteúdo da página..."})})})})},{title:"Sem Breadcrumb",description:"Quando não há necessidade de navegação hierárquica",code:`<BodyContent>
|
|
26
|
-
<ContentContainer
|
|
27
|
-
title="Dashboard"
|
|
28
|
-
subtitle="Visão geral do sistema"
|
|
29
|
-
>
|
|
30
|
-
<div className="grid grid-cols-3 gap-4">
|
|
31
|
-
<Card>...</Card>
|
|
32
|
-
<Card>...</Card>
|
|
33
|
-
<Card>...</Card>
|
|
34
|
-
</div>
|
|
35
|
-
</ContentContainer>
|
|
36
|
-
</BodyContent>`,preview:e.jsx("div",{className:"w-full max-w-3xl",children:e.jsx(o,{className:"rounded-lg overflow-hidden",children:e.jsx(a,{title:"Dashboard",subtitle:"Visão geral do sistema",children:e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs(t,{className:"p-4 text-center",children:[e.jsx("p",{className:"text-2xl font-bold",children:"128"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Usuários"})]}),e.jsxs(t,{className:"p-4 text-center",children:[e.jsx("p",{className:"text-2xl font-bold",children:"45"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Projetos"})]}),e.jsxs(t,{className:"p-4 text-center",children:[e.jsx("p",{className:"text-2xl font-bold",children:"12"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Tarefas"})]})]})})})})},{title:"Múltiplos Containers",description:"Vários containers de conteúdo na mesma página",code:`<BodyContent
|
|
37
|
-
breadcrumbs={[
|
|
38
|
-
{ label: 'Configurações', href: '/config' },
|
|
39
|
-
{ label: 'Perfil' },
|
|
40
|
-
]}
|
|
41
|
-
>
|
|
42
|
-
<ContentContainer title="Informações Pessoais">
|
|
43
|
-
<p>Dados do usuário...</p>
|
|
44
|
-
</ContentContainer>
|
|
45
|
-
|
|
46
|
-
<ContentContainer title="Preferências">
|
|
47
|
-
<p>Configurações de preferência...</p>
|
|
48
|
-
</ContentContainer>
|
|
49
|
-
|
|
50
|
-
<ContentContainer title="Segurança">
|
|
51
|
-
<p>Opções de segurança...</p>
|
|
52
|
-
</ContentContainer>
|
|
53
|
-
</BodyContent>`,preview:e.jsx("div",{className:"w-full max-w-3xl",children:e.jsxs(o,{breadcrumbs:[{label:"Configurações",href:"#"},{label:"Perfil"}],className:"rounded-lg overflow-hidden",children:[e.jsx(a,{title:"Informações Pessoais",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center",children:e.jsx(n,{className:"w-8 h-8 text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"João Silva"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"joao@empresa.com"})]})]})}),e.jsx(a,{title:"Preferências",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{children:"Notificações por email"}),e.jsx(r,{children:"Ativo"})]})}),e.jsx(a,{title:"Segurança",children:e.jsx(i,{variant:"outline",size:"sm",children:"Alterar senha"})})]})})},{title:"Container sem Header",description:"Quando o conteúdo não precisa de título/subtítulo separado",code:`<BodyContent breadcrumbs={[{ label: 'Relatórios' }]}>
|
|
54
|
-
<ContentContainer hasHeader={false}>
|
|
55
|
-
<div className="flex items-center gap-2 mb-4">
|
|
56
|
-
<FileText className="w-5 h-5" />
|
|
57
|
-
<h2 className="text-lg font-semibold">Relatório Mensal</h2>
|
|
58
|
-
</div>
|
|
59
|
-
<p>Conteúdo do relatório...</p>
|
|
60
|
-
</ContentContainer>
|
|
61
|
-
</BodyContent>`,preview:e.jsx("div",{className:"w-full max-w-3xl",children:e.jsx(o,{breadcrumbs:[{label:"Relatórios"}],className:"rounded-lg overflow-hidden",children:e.jsxs(a,{hasHeader:!1,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(s,{className:"w-5 h-5 text-primary"}),e.jsx("h2",{className:"text-lg font-semibold",children:"Relatório Mensal"})]}),e.jsx("p",{className:"text-muted-foreground",children:"Conteúdo do relatório com header customizado dentro do container."})]})})})},{title:"Com React Router Link",description:"Usando asChild para integrar com Link do React Router",code:`import { Link } from 'react-router-dom';
|
|
62
|
-
|
|
63
|
-
<BodyContent
|
|
64
|
-
breadcrumbs={[
|
|
65
|
-
{
|
|
66
|
-
label: 'Home',
|
|
67
|
-
href: '/',
|
|
68
|
-
asChild: true,
|
|
69
|
-
children: <Link to="/">Home</Link>
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
label: 'Módulo',
|
|
73
|
-
href: '/modulo',
|
|
74
|
-
asChild: true,
|
|
75
|
-
children: <Link to="/modulo">Módulo</Link>
|
|
76
|
-
},
|
|
77
|
-
{ label: 'Página Atual' },
|
|
78
|
-
]}
|
|
79
|
-
>
|
|
80
|
-
<ContentContainer title="Conteúdo">
|
|
81
|
-
<p>Navegação com React Router...</p>
|
|
82
|
-
</ContentContainer>
|
|
83
|
-
</BodyContent>`,preview:e.jsx("div",{className:"w-full max-w-3xl",children:e.jsx(o,{breadcrumbs:[{label:"Home",href:"#"},{label:"Módulo",href:"#"},{label:"Página Atual"}],className:"rounded-lg overflow-hidden",children:e.jsx(a,{title:"Navegação com React Router",children:e.jsx("p",{className:"text-muted-foreground",children:"Os links do breadcrumb podem usar o componente Link do React Router para navegação SPA sem recarregamento de página."})})})})}],accessibility:['O breadcrumb usa a tag nav com aria-label="breadcrumb" para identificação por leitores de tela','A página atual no breadcrumb é marcada com aria-current="page"',"Os containers usam estrutura semântica com headings (h2) para títulos",'Separadores do breadcrumb são marcados com aria-hidden="true"'],notes:["O background externo usa a cor Escala Neutra 100 (#F5F5F5) para separar visualmente do conteúdo","Os ContentContainers têm background branco (#FFFFFF) com sombra sutil e border-radius","Use múltiplos ContentContainers para agrupar conteúdos relacionados na mesma página","O último item do breadcrumb é automaticamente tratado como página atual (sem link)","Para integração com React Router, use asChild=true e passe o Link como children","O espaçamento entre containers segue o padrão do Design System (space-y-6)"]})}export{u as BodyContentDoc};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import{j as e,ae as m,af as c,ag as r,ah as d,ff as i,ai as a,aj as s,fg as t}from"./index-DkiftrvI.js";import{C as o}from"./ComponentDocTemplate-CQbBhfvZ.js";import"./ExampleCard-DuLrb3t-.js";function b(){return e.jsx(o,{title:"Breadcrumb",description:"Exibe o caminho até o recurso atual usando uma hierarquia de links.",component:e.jsx(m,{children:e.jsxs(c,{children:[e.jsx(r,{children:e.jsx(d,{asChild:!0,children:e.jsx(i,{to:"/",children:"Home"})})}),e.jsx(a,{}),e.jsx(r,{children:e.jsx(d,{asChild:!0,children:e.jsx(i,{to:"/ds",children:"Componentes"})})}),e.jsx(a,{}),e.jsx(r,{children:e.jsx(s,{children:"Breadcrumb"})})]})}),usage:`import { Link } from "react-router-dom"
|
|
2
|
-
import {
|
|
3
|
-
Breadcrumb,
|
|
4
|
-
BreadcrumbItem,
|
|
5
|
-
BreadcrumbLink,
|
|
6
|
-
BreadcrumbList,
|
|
7
|
-
BreadcrumbPage,
|
|
8
|
-
BreadcrumbSeparator,
|
|
9
|
-
} from "forlogic-core"
|
|
10
|
-
|
|
11
|
-
// ✅ CORRETO: Usar asChild + Link para navegação SPA
|
|
12
|
-
<Breadcrumb>
|
|
13
|
-
<BreadcrumbList>
|
|
14
|
-
<BreadcrumbItem>
|
|
15
|
-
<BreadcrumbLink asChild>
|
|
16
|
-
<Link to="/">Home</Link>
|
|
17
|
-
</BreadcrumbLink>
|
|
18
|
-
</BreadcrumbItem>
|
|
19
|
-
<BreadcrumbSeparator />
|
|
20
|
-
<BreadcrumbItem>
|
|
21
|
-
<BreadcrumbLink asChild>
|
|
22
|
-
<Link to="/componentes">Componentes</Link>
|
|
23
|
-
</BreadcrumbLink>
|
|
24
|
-
</BreadcrumbItem>
|
|
25
|
-
<BreadcrumbSeparator />
|
|
26
|
-
<BreadcrumbItem>
|
|
27
|
-
<BreadcrumbPage>Breadcrumb</BreadcrumbPage>
|
|
28
|
-
</BreadcrumbItem>
|
|
29
|
-
</BreadcrumbList>
|
|
30
|
-
</Breadcrumb>
|
|
31
|
-
|
|
32
|
-
// ❌ ERRADO: Usar href diretamente (causa reload da página)
|
|
33
|
-
<BreadcrumbLink href="/componentes">Componentes</BreadcrumbLink>`,examples:[{title:"Navegação SPA com React Router",description:"Use asChild + Link para navegação sem reload da página.",preview:e.jsx(m,{children:e.jsxs(c,{children:[e.jsx(r,{children:e.jsx(d,{asChild:!0,children:e.jsx(i,{to:"/",children:"Home"})})}),e.jsx(a,{}),e.jsx(r,{children:e.jsx(d,{asChild:!0,children:e.jsx(i,{to:"/ds",children:"Design System"})})}),e.jsx(a,{}),e.jsx(r,{children:e.jsx(s,{children:"Breadcrumb"})})]})}),code:`import { Link } from "react-router-dom"
|
|
34
|
-
|
|
35
|
-
<Breadcrumb>
|
|
36
|
-
<BreadcrumbList>
|
|
37
|
-
<BreadcrumbItem>
|
|
38
|
-
<BreadcrumbLink asChild>
|
|
39
|
-
<Link to="/">Home</Link>
|
|
40
|
-
</BreadcrumbLink>
|
|
41
|
-
</BreadcrumbItem>
|
|
42
|
-
<BreadcrumbSeparator />
|
|
43
|
-
<BreadcrumbItem>
|
|
44
|
-
<BreadcrumbLink asChild>
|
|
45
|
-
<Link to="/ds">Design System</Link>
|
|
46
|
-
</BreadcrumbLink>
|
|
47
|
-
</BreadcrumbItem>
|
|
48
|
-
<BreadcrumbSeparator />
|
|
49
|
-
<BreadcrumbItem>
|
|
50
|
-
<BreadcrumbPage>Breadcrumb</BreadcrumbPage>
|
|
51
|
-
</BreadcrumbItem>
|
|
52
|
-
</BreadcrumbList>
|
|
53
|
-
</Breadcrumb>`},{title:"Colapsado com Ellipsis",description:"Use BreadcrumbEllipsis para mostrar um estado colapsado quando o breadcrumb for muito longo.",preview:e.jsx(m,{children:e.jsxs(c,{children:[e.jsx(r,{children:e.jsx(d,{asChild:!0,children:e.jsx(i,{to:"/",children:"Home"})})}),e.jsx(a,{}),e.jsx(r,{children:e.jsx(t,{})}),e.jsx(a,{}),e.jsx(r,{children:e.jsx(d,{asChild:!0,children:e.jsx(i,{to:"/ds",children:"Componentes"})})}),e.jsx(a,{}),e.jsx(r,{children:e.jsx(s,{children:"Breadcrumb"})})]})}),code:`<Breadcrumb>
|
|
54
|
-
<BreadcrumbList>
|
|
55
|
-
<BreadcrumbItem>
|
|
56
|
-
<BreadcrumbLink asChild>
|
|
57
|
-
<Link to="/">Home</Link>
|
|
58
|
-
</BreadcrumbLink>
|
|
59
|
-
</BreadcrumbItem>
|
|
60
|
-
<BreadcrumbSeparator />
|
|
61
|
-
<BreadcrumbItem>
|
|
62
|
-
<BreadcrumbEllipsis />
|
|
63
|
-
</BreadcrumbItem>
|
|
64
|
-
<BreadcrumbSeparator />
|
|
65
|
-
<BreadcrumbItem>
|
|
66
|
-
<BreadcrumbLink asChild>
|
|
67
|
-
<Link to="/componentes">Componentes</Link>
|
|
68
|
-
</BreadcrumbLink>
|
|
69
|
-
</BreadcrumbItem>
|
|
70
|
-
<BreadcrumbSeparator />
|
|
71
|
-
<BreadcrumbItem>
|
|
72
|
-
<BreadcrumbPage>Breadcrumb</BreadcrumbPage>
|
|
73
|
-
</BreadcrumbItem>
|
|
74
|
-
</BreadcrumbList>
|
|
75
|
-
</Breadcrumb>`}],props:[{name:"Breadcrumb",type:"nav",default:"-",description:'Elemento raiz do breadcrumb. Renderiza um elemento nav com aria-label="breadcrumb".'},{name:"BreadcrumbList",type:"ol",default:"-",description:"Lista ordenada que contém os itens do breadcrumb."},{name:"BreadcrumbItem",type:"li",default:"-",description:"Item individual do breadcrumb."},{name:"BreadcrumbLink",type:"a",default:"-",description:"Link clicável do breadcrumb. Use asChild + Link para navegação SPA."},{name:"asChild",type:"boolean",default:"false",description:"Permite compor com Link do React Router para navegação SPA."},{name:"BreadcrumbPage",type:"span",default:"-",description:'Representa a página atual (não clicável). Possui aria-current="page".'},{name:"BreadcrumbSeparator",type:"li",default:"ChevronRight",description:"Separador visual entre itens do breadcrumb."},{name:"BreadcrumbEllipsis",type:"span",default:"-",description:"Indica itens ocultos (reticências). Usado para breadcrumbs colapsados."}],accessibility:['Usa elemento nav com aria-label="breadcrumb" para identificação por leitores de tela.',"Estrutura HTML semântica com lista ordenada (ol > li).",'Página atual marcada com aria-current="page" e aria-disabled="true".','Separadores marcados com role="presentation" e aria-hidden="true".','BreadcrumbEllipsis inclui texto sr-only "Mais" para leitores de tela.',"Links navegáveis por teclado com foco visível.","Segue padrão WAI-ARIA Breadcrumb."],notes:["⚠️ OBRIGATÓRIO: Use asChild + Link do React Router para navegação SPA sem reload.","Use BreadcrumbPage para o item final (página atual) em vez de BreadcrumbLink.","Considere colapsar itens intermediários em telas menores usando BreadcrumbEllipsis.","Evite usar href diretamente - causa reload completo da página."]})}export{b as BreadcrumbDoc};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import{j as a,x as t,P as e,S as n,aY as i,aJ as r,y as s,A as o}from"./index-DkiftrvI.js";import{C as l}from"./ComponentDocTemplate-CQbBhfvZ.js";import"./ExampleCard-DuLrb3t-.js";function m(){return a.jsx(l,{title:"Button",description:"Componente de botão com variantes semânticas, tamanhos e estados. Use para ações primárias, secundárias e destrutivas.",component:a.jsx(t,{children:"Button"}),usage:`import { Button } from "forlogic-core"
|
|
2
|
-
|
|
3
|
-
<Button>Click me</Button>
|
|
4
|
-
<Button variant="primary">Primary</Button>
|
|
5
|
-
<Button variant="destructive">Delete</Button>`,examples:[{title:"Variantes Semânticas",preview:a.jsxs("div",{className:"flex flex-wrap gap-3",children:[a.jsx(t,{variant:"primary",children:"Primary"}),a.jsx(t,{variant:"secondary",children:"Secondary"}),a.jsx(t,{variant:"tertiary",children:"Tertiary"}),a.jsx(t,{variant:"outline",children:"Outline"}),a.jsx(t,{variant:"ghost",children:"Ghost"}),a.jsx(t,{variant:"subtle",children:"Subtle"}),a.jsx(t,{variant:"danger",children:"Danger"}),a.jsx(t,{variant:"link",children:"Link"})]}),code:`<Button variant="primary">Primary</Button>
|
|
6
|
-
<Button variant="secondary">Secondary</Button>
|
|
7
|
-
<Button variant="tertiary">Tertiary</Button>
|
|
8
|
-
<Button variant="outline">Outline</Button>
|
|
9
|
-
<Button variant="ghost">Ghost</Button>
|
|
10
|
-
<Button variant="subtle">Subtle</Button>
|
|
11
|
-
<Button variant="danger">Danger</Button>
|
|
12
|
-
<Button variant="link">Link</Button>`},{title:"Variantes Legadas (Deprecated)",preview:a.jsxs("div",{className:"flex flex-wrap gap-3",children:[a.jsx(t,{variant:"default",children:"default"}),a.jsx(t,{variant:"action",children:"action"}),a.jsx(t,{variant:"action-primary",children:"action-primary"}),a.jsx(t,{variant:"action-secondary",children:"action-secondary"}),a.jsx(t,{variant:"icon-only",children:"icon-only"}),a.jsx(t,{variant:"external-link",children:"external-link"}),a.jsx(t,{variant:"loading",children:"loading"})]}),code:`// ⚠️ DEPRECATED: Variantes mantidas para compatibilidade
|
|
13
|
-
// Use as variantes semânticas (primary, secondary, etc.)
|
|
14
|
-
<Button variant="default">default</Button> // → use primary
|
|
15
|
-
<Button variant="action">action</Button> // → use primary/10
|
|
16
|
-
<Button variant="action-primary">action-primary</Button> // → use primary
|
|
17
|
-
<Button variant="action-secondary">action-secondary</Button> // → use secondary
|
|
18
|
-
<Button variant="icon-only">icon-only</Button> // → use variant="icon"
|
|
19
|
-
<Button variant="external-link">external-link</Button> // → use subtle
|
|
20
|
-
<Button variant="loading">loading</Button> // → use primary + disabled`},{title:"Tamanhos",preview:a.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[a.jsx(t,{variant:"primary",size:"sm",children:"Small"}),a.jsx(t,{variant:"primary",size:"md",children:"Medium"}),a.jsx(t,{variant:"primary",size:"lg",children:"Large"}),a.jsx(t,{variant:"primary",size:"xl",children:"Extra Large"})]}),code:`<Button size="sm">Small</Button>
|
|
21
|
-
<Button size="md">Medium</Button>
|
|
22
|
-
<Button size="lg">Large</Button>
|
|
23
|
-
<Button size="xl">Extra Large</Button>`},{title:"Botões de Ícone",preview:a.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[a.jsx(t,{variant:"outline",size:"icon-xs",children:a.jsx(e,{className:"h-3 w-3"})}),a.jsx(t,{variant:"outline",size:"icon-sm",children:a.jsx(e,{className:"h-4 w-4"})}),a.jsx(t,{variant:"outline",size:"icon",children:a.jsx(n,{className:"h-4 w-4"})})]}),code:`<Button size="icon-xs"><Plus /></Button>
|
|
24
|
-
<Button size="icon-sm"><Plus /></Button>
|
|
25
|
-
<Button size="icon"><Settings /></Button>`},{title:"Estados",preview:a.jsxs("div",{className:"flex flex-wrap gap-3",children:[a.jsx(t,{children:"Normal"}),a.jsx(t,{disabled:!0,children:"Disabled"}),a.jsxs(t,{disabled:!0,children:[a.jsx(i,{className:"mr-2 h-4 w-4 animate-spin"}),"Loading"]})]}),code:`<Button>Normal</Button>
|
|
26
|
-
<Button disabled>Disabled</Button>
|
|
27
|
-
<Button disabled>
|
|
28
|
-
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
|
|
29
|
-
Loading
|
|
30
|
-
</Button>`},{title:"Com Ícones",preview:a.jsxs("div",{className:"flex flex-wrap gap-3",children:[a.jsxs(t,{variant:"primary",children:[a.jsx(r,{className:"mr-2 h-4 w-4"}),"Download"]}),a.jsxs(t,{variant:"secondary",children:[a.jsx(e,{className:"mr-2 h-4 w-4"}),"Adicionar"]}),a.jsxs(t,{variant:"danger",children:[a.jsx(s,{className:"mr-2 h-4 w-4"}),"Excluir"]}),a.jsxs(t,{variant:"outline",children:["Próximo",a.jsx(o,{className:"ml-2 h-4 w-4"})]})]}),code:`<Button variant="primary">
|
|
31
|
-
<Download className="mr-2 h-4 w-4" />
|
|
32
|
-
Download
|
|
33
|
-
</Button>
|
|
34
|
-
<Button variant="secondary">
|
|
35
|
-
<Plus className="mr-2 h-4 w-4" />
|
|
36
|
-
Adicionar
|
|
37
|
-
</Button>
|
|
38
|
-
<Button variant="danger">
|
|
39
|
-
<Trash2 className="mr-2 h-4 w-4" />
|
|
40
|
-
Excluir
|
|
41
|
-
</Button>`}],props:[{name:"variant",type:'"primary" | "secondary" | "tertiary" | "outline" | "ghost" | "subtle" | "danger" | "destructive" | "link" | "icon"',default:'"primary"',description:'Variante visual do botão. Use "danger" para ações destrutivas (alias de "destructive").'},{name:"size",type:'"sm" | "md" | "lg" | "xl" | "icon" | "icon-sm" | "icon-xs" | "default"',default:'"md"',description:"Tamanho do botão."},{name:"asChild",type:"boolean",default:"false",description:"Renderiza como elemento filho (ex: Link)."},{name:"disabled",type:"boolean",default:"false",description:"Estado desabilitado."}],accessibility:["Acessível via teclado (Tab, Enter, Space)","Indicador de foco visível (focus-visible)","Estado desabilitado comunicado a leitores de tela","Botões de ícone devem ter aria-label","Tamanho mínimo de toque de 44x44px no mobile"],notes:['✅ Use variant="primary" para a ação principal da página',"✅ Limite a um botão primário por seção",'✅ Use variant="danger" para ações destrutivas (consistente com Alert e Badge)',"✅ Inclua estado de loading para ações assíncronas","❌ Não use múltiplos botões primários no mesmo contexto","❌ Não crie estilos customizados fora do design system"]})}export{m as ButtonDoc};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{r as s,j as t,o as d,aZ as u,x as o}from"./index-DkiftrvI.js";import{C as l}from"./ComponentDocTemplate-CQbBhfvZ.js";import"./ExampleCard-DuLrb3t-.js";const c=u("flex items-center",{variants:{orientation:{horizontal:"flex-row [&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",vertical:"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"}},defaultVariants:{orientation:"horizontal"}}),e=s.forwardRef(({className:n,orientation:a,...r},i)=>t.jsx("div",{ref:i,className:d(c({orientation:a}),n),...r}));e.displayName="ButtonGroup";function B(){return t.jsx(l,{title:"Button Group",description:"Agrupa botões relacionados com espaçamento e bordas apropriados.",component:t.jsxs(e,{children:[t.jsx(o,{variant:"outline",children:"Esquerda"}),t.jsx(o,{variant:"outline",children:"Meio"}),t.jsx(o,{variant:"outline",children:"Direita"})]}),usage:`import { ButtonGroup, Button } from "forlogic-core"
|
|
2
|
-
|
|
3
|
-
<ButtonGroup>
|
|
4
|
-
<Button variant="outline">Esquerda</Button>
|
|
5
|
-
<Button variant="outline">Meio</Button>
|
|
6
|
-
<Button variant="outline">Direita</Button>
|
|
7
|
-
</ButtonGroup>`,props:[{name:"orientation",type:'"horizontal" | "vertical"',default:'"horizontal"',description:"Orientação do grupo de botões."},{name:"className",type:"string",default:"-",description:"Classes CSS adicionais para estilização."},{name:"children",type:"ReactNode",default:"-",description:"Botões a serem agrupados."}],accessibility:["Mantém acessibilidade individual dos botões","Gerenciamento adequado de foco","Navegação por teclas de seta entre botões"]})}export{B as ButtonGroupDoc};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import{eJ as C,eK as S,r as s,j as e,eL as D,J as n,x as r}from"./index-DkiftrvI.js";import{C as g}from"./ComponentDocTemplate-CQbBhfvZ.js";import{C as m,D as d}from"./date-picker-BW3eGOe_.js";import"./ExampleCard-DuLrb3t-.js";function p(l,o){const i=C(l);return isNaN(o)?S(l,NaN):(o&&i.setDate(i.getDate()+o),i)}function f(l,o){return p(l,-7)}function v(){const[l,o]=s.useState(new Date),[i,u]=s.useState();return e.jsx(g,{title:"Calendar & Date Picker",description:"Componentes para seleção de datas. O Calendar exibe um calendário interativo, enquanto o Date Picker combina um campo de input com o calendário em um popover.",component:e.jsxs("div",{className:"flex flex-wrap gap-8 items-start",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(n,{className:"text-xs text-muted-foreground",children:"Calendar"}),e.jsx(m,{mode:"single",selected:l,onSelect:o,className:"rounded-md border"})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(n,{className:"text-xs text-muted-foreground",children:"Date Picker"}),e.jsx(d,{date:i,onDateChange:u,placeholder:"Selecione uma data",className:"w-[280px]"})]})]}),usage:`import { Calendar, DatePicker } from "forlogic-core"
|
|
2
|
-
import { useState } from "react"
|
|
3
|
-
|
|
4
|
-
// Calendar
|
|
5
|
-
const [date, setDate] = useState<Date | undefined>(new Date())
|
|
6
|
-
|
|
7
|
-
<Calendar
|
|
8
|
-
mode="single"
|
|
9
|
-
selected={date}
|
|
10
|
-
onSelect={setDate}
|
|
11
|
-
className="rounded-md border"
|
|
12
|
-
/>
|
|
13
|
-
|
|
14
|
-
// Date Picker
|
|
15
|
-
<DatePicker
|
|
16
|
-
date={date}
|
|
17
|
-
onDateChange={setDate}
|
|
18
|
-
placeholder="Selecione uma data"
|
|
19
|
-
/>`,examples:[{title:"Calendar - Seleção Única",preview:(()=>{const[a,t]=s.useState();return e.jsxs("div",{className:"space-y-4",children:[e.jsx(m,{mode:"single",selected:a,onSelect:t,className:"rounded-md border"}),a&&e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Data selecionada: ",D(a,"dd/MM/yyyy")]})]})})(),code:`const [date, setDate] = useState<Date>();
|
|
20
|
-
|
|
21
|
-
<Calendar
|
|
22
|
-
mode="single"
|
|
23
|
-
selected={date}
|
|
24
|
-
onSelect={setDate}
|
|
25
|
-
className="rounded-md border"
|
|
26
|
-
/>`},{title:"Calendar - Seleção Múltipla",preview:(()=>{const[a,t]=s.useState([]);return e.jsxs("div",{className:"space-y-4",children:[e.jsx(m,{mode:"multiple",selected:a,onSelect:t,className:"rounded-md border"}),a&&a.length>0&&e.jsxs("p",{className:"text-sm text-muted-foreground",children:[a.length," data(s) selecionada(s)"]})]})})(),code:`const [dates, setDates] = useState<Date[]>([]);
|
|
27
|
-
|
|
28
|
-
<Calendar
|
|
29
|
-
mode="multiple"
|
|
30
|
-
selected={dates}
|
|
31
|
-
onSelect={setDates}
|
|
32
|
-
/>`},{title:"Date Picker - Básico",preview:(()=>{const[a,t]=s.useState();return e.jsx(d,{date:a,onDateChange:t,placeholder:"Selecione uma data",className:"w-[280px]"})})(),code:`const [date, setDate] = useState<Date>();
|
|
33
|
-
|
|
34
|
-
<DatePicker
|
|
35
|
-
date={date}
|
|
36
|
-
onDateChange={setDate}
|
|
37
|
-
placeholder="Selecione uma data"
|
|
38
|
-
/>`},{title:"Date Picker - Controlado",preview:(()=>{const[a,t]=s.useState();return e.jsx(d,{date:a,onDateChange:t,placeholder:"Selecione uma data",className:"w-[280px]"})})(),code:`const [date, setDate] = useState<Date>();
|
|
39
|
-
|
|
40
|
-
<DatePicker
|
|
41
|
-
date={date}
|
|
42
|
-
onDateChange={setDate}
|
|
43
|
-
placeholder="Selecione uma data"
|
|
44
|
-
/>`},{title:"Date Picker - Com Label",preview:(()=>{const[a,t]=s.useState();return e.jsxs("div",{className:"space-y-2 w-[280px]",children:[e.jsx(n,{children:"Data de Nascimento"}),e.jsx(d,{date:a,onDateChange:t,placeholder:"Selecione sua data de nascimento"})]})})(),code:`<div className="space-y-2">
|
|
45
|
-
<Label>Data de Nascimento</Label>
|
|
46
|
-
<DatePicker
|
|
47
|
-
date={date}
|
|
48
|
-
onDateChange={setDate}
|
|
49
|
-
placeholder="Selecione sua data de nascimento"
|
|
50
|
-
/>
|
|
51
|
-
</div>`},{title:"Date Picker - Desabilitado",preview:e.jsx(d,{placeholder:"Data desabilitada",disabled:!0,className:"w-[280px]"}),code:'<DatePicker placeholder="Data desabilitada" disabled />'},{title:"Date Picker - Com Datas Restritas",preview:(()=>{const[a,t]=s.useState();return e.jsxs("div",{className:"space-y-2 w-[280px]",children:[e.jsx(n,{children:"Apenas datas futuras"}),e.jsx(d,{date:a,onDateChange:t,placeholder:"Selecione uma data futura",disabledDates:c=>c<new Date})]})})(),code:`<DatePicker
|
|
52
|
-
date={date}
|
|
53
|
-
onDateChange={setDate}
|
|
54
|
-
disabledDates={(date) => date < new Date()}
|
|
55
|
-
/>`},{title:"Formulário de Agendamento",preview:(()=>{const[a,t]=s.useState(),[c,x]=s.useState();return e.jsxs("div",{className:"space-y-4 w-[280px]",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{children:"Data de Início"}),e.jsx(d,{date:a,onDateChange:t,placeholder:"Selecione a data de início"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{children:"Data de Término"}),e.jsx(d,{date:c,onDateChange:x,placeholder:"Selecione a data de término",disabledDates:h=>a?h<a:!1})]}),a&&c&&e.jsxs("div",{className:"p-3 bg-muted rounded-md text-sm",children:[e.jsx("p",{className:"font-medium",children:"Período:"}),e.jsxs("p",{className:"text-muted-foreground",children:[D(a,"dd/MM/yyyy")," até ",D(c,"dd/MM/yyyy")]})]})]})})(),code:`const [startDate, setStartDate] = useState<Date>();
|
|
56
|
-
const [endDate, setEndDate] = useState<Date>();
|
|
57
|
-
|
|
58
|
-
<div className="space-y-2">
|
|
59
|
-
<Label>Data de Início</Label>
|
|
60
|
-
<DatePicker
|
|
61
|
-
date={startDate}
|
|
62
|
-
onDateChange={setStartDate}
|
|
63
|
-
/>
|
|
64
|
-
</div>
|
|
65
|
-
|
|
66
|
-
<div className="space-y-2">
|
|
67
|
-
<Label>Data de Término</Label>
|
|
68
|
-
<DatePicker
|
|
69
|
-
date={endDate}
|
|
70
|
-
onDateChange={setEndDate}
|
|
71
|
-
disabledDates={(date) => date < startDate}
|
|
72
|
-
/>
|
|
73
|
-
</div>`},{title:"Date Picker com Atalhos",preview:(()=>{const[a,t]=s.useState();return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2 w-[280px]",children:[e.jsx(n,{children:"Selecione ou use um atalho"}),e.jsx(d,{date:a,onDateChange:t,placeholder:"Selecione uma data"})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(r,{variant:"outline",size:"sm",onClick:()=>t(new Date),children:"Hoje"}),e.jsx(r,{variant:"outline",size:"sm",onClick:()=>t(p(new Date,1)),children:"Amanhã"}),e.jsx(r,{variant:"outline",size:"sm",onClick:()=>t(p(new Date,7)),children:"+7 dias"}),e.jsx(r,{variant:"outline",size:"sm",onClick:()=>t(f(new Date)),children:"-7 dias"})]})]})})(),code:`const [date, setDate] = useState<Date>();
|
|
74
|
-
|
|
75
|
-
<DatePicker
|
|
76
|
-
date={date}
|
|
77
|
-
onDateChange={setDate}
|
|
78
|
-
/>
|
|
79
|
-
|
|
80
|
-
<Button onClick={() => setDate(new Date())}>Hoje</Button>
|
|
81
|
-
<Button onClick={() => setDate(addDays(new Date(), 1))}>Amanhã</Button>`}],props:[{name:"mode",type:'"single" | "multiple" | "range"',default:'"single"',description:"(Calendar) O modo de seleção."},{name:"selected",type:"Date | Date[] | DateRange",default:"-",description:"(Calendar) A(s) data(s) selecionada(s)."},{name:"onSelect",type:"(date) => void",default:"-",description:"(Calendar) Callback quando uma data é selecionada."},{name:"disabled",type:"(date: Date) => boolean",default:"-",description:"(Calendar) Função para desabilitar datas específicas."},{name:"showOutsideDays",type:"boolean",default:"true",description:"(Calendar) Exibe dias de meses adjacentes."},{name:"className",type:"string",default:"-",description:"(Calendar) Classes CSS adicionais."},{name:"date",type:"Date",default:"-",description:"(DatePicker) A data selecionada."},{name:"onDateChange",type:"(date: Date | undefined) => void",default:"-",description:"(DatePicker) Callback quando a data muda."},{name:"placeholder",type:"string",default:'"Pick a date"',description:"(DatePicker) Texto do placeholder."},{name:"disabled",type:"boolean",default:"false",description:"(DatePicker) Desabilita o componente."},{name:"disabledDates",type:"(date: Date) => boolean",default:"-",description:"(DatePicker) Função para desabilitar datas específicas."},{name:"className",type:"string",default:"-",description:"(DatePicker) Classes CSS adicionais."}],accessibility:["Navegação completa por teclado","Teclas de seta para navegar entre datas","Page Up/Down para navegação mensal","Labels e roles ARIA apropriados","Gerenciamento de foco adequado"]})}export{v as CalendarDoc};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import{j as e,a,b as s,c as t,e as d,d as r,bq as i,x as o,br as c,bs as n}from"./index-DkiftrvI.js";import{C as l}from"./ComponentDocTemplate-CQbBhfvZ.js";import"./ExampleCard-DuLrb3t-.js";function x(){return e.jsx(l,{title:"Card",description:"Exibe um card com cabeçalho, conteúdo e rodapé.",component:e.jsxs(a,{className:"w-[350px]",children:[e.jsxs(s,{children:[e.jsx(t,{children:"Card Title"}),e.jsx(d,{children:"Card Description"})]}),e.jsx(r,{children:e.jsx("p",{children:"Card Content"})})]}),usage:`import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from "forlogic-core"
|
|
2
|
-
|
|
3
|
-
<Card>
|
|
4
|
-
<CardHeader>
|
|
5
|
-
<CardTitle>Card Title</CardTitle>
|
|
6
|
-
<CardDescription>Card Description</CardDescription>
|
|
7
|
-
</CardHeader>
|
|
8
|
-
<CardContent>
|
|
9
|
-
<p>Card Content</p>
|
|
10
|
-
</CardContent>
|
|
11
|
-
<CardFooter>
|
|
12
|
-
<p>Card Footer</p>
|
|
13
|
-
</CardFooter>
|
|
14
|
-
</Card>`,examples:[{title:"Card Básico",preview:e.jsxs(a,{className:"w-[350px]",children:[e.jsxs(s,{children:[e.jsx(t,{children:"Criar projeto"}),e.jsx(d,{children:"Implante seu novo projeto em um clique."})]}),e.jsx(r,{children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure seu projeto e comece a desenvolver imediatamente."})}),e.jsxs(i,{className:"flex justify-between",children:[e.jsx(o,{variant:"outline",children:"Cancelar"}),e.jsx(o,{children:"Criar"})]})]}),code:`<Card className="w-[350px]">
|
|
15
|
-
<CardHeader>
|
|
16
|
-
<CardTitle>Criar projeto</CardTitle>
|
|
17
|
-
<CardDescription>Implante seu novo projeto em um clique.</CardDescription>
|
|
18
|
-
</CardHeader>
|
|
19
|
-
<CardContent>
|
|
20
|
-
<p>Configure seu projeto e comece a desenvolver imediatamente.</p>
|
|
21
|
-
</CardContent>
|
|
22
|
-
<CardFooter className="flex justify-between">
|
|
23
|
-
<Button variant="outline">Cancelar</Button>
|
|
24
|
-
<Button>Criar</Button>
|
|
25
|
-
</CardFooter>
|
|
26
|
-
</Card>`},{title:"Card com Notificações",preview:e.jsxs(a,{className:"w-[380px]",children:[e.jsxs(s,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(c,{className:"h-4 w-4"}),e.jsx(t,{children:"Notificações"})]}),e.jsx(d,{children:"Você tem 3 notificações não lidas."})]}),e.jsxs(r,{className:"grid gap-4",children:[e.jsx("div",{className:"flex items-center gap-4 rounded-md border p-4",children:e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"Sua chamada foi confirmada."}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Há 1 hora"})]})}),e.jsx("div",{className:"flex items-center gap-4 rounded-md border p-4",children:e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"Você tem uma nova mensagem!"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Há 2 horas"})]})})]}),e.jsx(i,{children:e.jsxs(o,{className:"w-full",children:[e.jsx(n,{className:"mr-2 h-4 w-4"})," Marcar todas como lidas"]})})]}),code:`<Card className="w-[380px]">
|
|
27
|
-
<CardHeader>
|
|
28
|
-
<CardTitle>Notificações</CardTitle>
|
|
29
|
-
<CardDescription>Você tem 3 notificações não lidas.</CardDescription>
|
|
30
|
-
</CardHeader>
|
|
31
|
-
<CardContent className="grid gap-4">
|
|
32
|
-
<div className="flex items-center gap-4 rounded-md border p-4">
|
|
33
|
-
<div className="flex-1 space-y-1">
|
|
34
|
-
<p className="text-sm font-medium">Sua chamada foi confirmada.</p>
|
|
35
|
-
<p className="text-sm text-muted-foreground">Há 1 hora</p>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
</CardContent>
|
|
39
|
-
<CardFooter>
|
|
40
|
-
<Button className="w-full">Marcar todas como lidas</Button>
|
|
41
|
-
</CardFooter>
|
|
42
|
-
</Card>`},{title:"Card Simples",preview:e.jsx(a,{className:"w-[350px]",children:e.jsx(r,{className:"pt-6",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h3",{className:"text-2xl font-bold",children:"$99"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"por mês"})]})})}),code:`<Card className="w-[350px]">
|
|
43
|
-
<CardContent className="pt-6">
|
|
44
|
-
<div className="text-center">
|
|
45
|
-
<h3 className="text-2xl font-bold">$99</h3>
|
|
46
|
-
<p className="text-sm text-muted-foreground">por mês</p>
|
|
47
|
-
</div>
|
|
48
|
-
</CardContent>
|
|
49
|
-
</Card>`}],props:[{name:"className",type:"string",default:"-",description:"Classes CSS adicionais para o card."}],accessibility:["Estrutura semântica com elementos apropriados","Hierarquia de cabeçalhos adequada","Contraste de cores acessível","Funciona com leitores de tela"]})}export{x as CardDoc};
|