mtxuilib 0.0.505 → 0.0.506
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";var
|
|
1
|
+
"use client";var v=Object.defineProperty;var d=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var f=(o,t,e)=>t in o?v(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,u=(o,t)=>{for(var e in t||(t={}))w.call(t,e)&&f(o,e,t[e]);if(d)for(var e of d(t))N.call(t,e)&&f(o,e,t[e]);return o};var g=(o,t,e)=>new Promise((p,i)=>{var m=r=>{try{a(e.next(r))}catch(l){i(l)}},c=r=>{try{a(e.throw(r))}catch(l){i(l)}},a=r=>r.done?p(r.value):Promise.resolve(r.value).then(m,c);a((e=e.apply(o,t)).next())});import{jsx as s,jsxs as n}from"react/jsx-runtime";import{AuthLoginInput as S}from"gomtm/validations/auth";import{useRouter as b,useSearchParams as M}from"next/navigation";import{MtLink as x}from"../../common/mtlink";import{ZForm as L,useZodForm as F}from"../../form/ZodForm";import{Input as h}from"../../ui/input";import{MtButton as y}from"../../ui/ui-mt/Button";function O(){const o=F({schema:S,defaultValues:{}}),t=M(),e=b();return n("div",{className:"mx-auto max-w-md",children:[s("div",{className:"prose",children:"Sign in"}),n("div",{className:"prose text-sm",children:["New to company?"," ",s(x,{href:"#replace-with-a-link",children:"Sign up!"})]}),s(y,{variant:"ghost",className:"bg-opacity/0.8 w-full bg-neutral-50",children:"Continue with Google"}),n(L,{form:o,className:"space-y-2",handleSubmit:i=>g(this,null,function*(){const m=yield fetch("/api.v1/login",{method:"POST",body:JSON.stringify(i)}),{success:c}=yield m.json();if(c){const a=t.get("next");e.push(a!=null?a:"/"),e.refresh()}else alert("Login failed")}),children:[s(h,u({},o.register("username"))),s(h,u({type:"password"},o.register("password"))),s("div",{className:"flex items-center justify-between"}),s(y,{type:"submit",className:"w-full",children:"Sign in"})]}),s("footer",{className:"py-3",children:n("div",{className:"prose text-center",children:["\xA9 Mtm ltd. ",new Date().getFullYear()]})})]})}export{O as LoginScreen2};
|