UNPKG

@baseplate-dev/project-builder-web

Version:

Web interface for constructing project builder JSON

3 lines (2 loc) 1.41 kB
import{i as n}from"./_virtual___federation_fn_import-C4el_tlG.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{u as h}from"./use-enum-form-TZs3gWw7.js";import{E as p}from"./enum-info-form-icdWs1EM.js";const{useBlockBeforeContinue:x}=await n("@baseplate-dev/project-builder-lib/web"),{Button:i,Dialog:f,DialogClose:j,DialogContent:g,DialogDescription:C,DialogFooter:b,DialogHeader:D,DialogTitle:E,DialogTrigger:S,SwitchFieldController:w,useControlledState:v}=await n("@baseplate-dev/ui-components");function O({children:t,open:a,onOpenChange:r}){const[l,s]=v(a,r,!1),{onSubmit:c,form:{control:o},isSavingDefinition:u}=h({isCreate:!0,onSubmitSuccess:()=>{s(!1)}}),m=x();return e.jsxs(f,{open:l,onOpenChange:d=>{d?m({onContinue:()=>{s(!0)}}):s(!1)},children:[e.jsx(S,{asChild:!0,children:t}),e.jsxs(g,{children:[e.jsxs(D,{children:[e.jsx(E,{children:"New Enum"}),e.jsx(C,{children:"Enums are a list of values that can be used in your data models."})]}),e.jsxs("form",{onSubmit:c,className:"space-y-4",children:[e.jsx(p,{control:o}),e.jsx(w,{label:"Expose in GraphQL schema",control:o,name:"isExposed",description:"Whether to expose this enum in the GraphQL schema"}),e.jsxs(b,{children:[e.jsx(j,{asChild:!0,children:e.jsx(i,{variant:"secondary",children:"Cancel"})}),e.jsx(i,{type:"submit",disabled:u,children:"Create Enum"})]})]})]})]})}export{O as N}; //# sourceMappingURL=new-enum-dialog-BBIjPlSZ.js.map