najwer23morsels 1.2.5 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/lib/Form-CgTuTB2Q.js +1 -0
- package/lib/Form.js +1 -1
- package/lib/FormLogin/FormLogin.d.ts +20 -0
- package/lib/FormLogin/index.d.ts +2 -0
- package/lib/FormLogin.js +1 -0
- package/lib/Masonry.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{L as n}from"./LoaderDots-BoEg_zlZ.js";import{T as o}from"./TextBox-__k4jPYK.js";const r=({children:r,onSubmit:s,className:i,isError:a,isPending:m,isSuccess:l,errorMsg:c,successMsg:f,style:p,...u})=>e("form",{className:["n23mForm",i].filter(Boolean).join(" "),...u,style:{...p},onSubmit:e=>{e.preventDefault();const t=e.currentTarget;t&&Array.from(t.elements).forEach(e=>{(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement)&&e.dispatchEvent(new FocusEvent("focusout",{bubbles:!0}))});const n=Object.fromEntries(Array.from(t.elements).filter(e=>e instanceof HTMLInputElement&&""!==e.name||e instanceof HTMLTextAreaElement&&""!==e.name||e instanceof HTMLSelectElement&&""!==e.name).map(e=>[e.name,{error:e.className.includes("error"),value:e.value}]));s(n)},children:[r,a&&t(o,{tag:"p",color:"#ff3333",mobileSize:12,desktopSize:12,margin:"15px 0 10px 0",fontWeight:400,children:c}),m&&t(n,{color:"grey",mobileSize:12,desktopSize:12,fontWeight:400,margin:"15px 0 10px 0"}),l&&t(o,{tag:"p",color:"#4BB543",mobileSize:12,desktopSize:12,margin:"15px 0 10px 0",fontWeight:400,children:f})]});r.displayName="Form";export{r as F};
|
package/lib/Form.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{F as Form}from"./Form-CgTuTB2Q.js";import"react/jsx-runtime";import"./LoaderDots-BoEg_zlZ.js";import"./TextBox-__k4jPYK.js";import"./style-inject.es-CrVRO2OA.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type FormType } from '../Form';
|
|
2
|
+
interface FormLoginData {
|
|
3
|
+
code?: string;
|
|
4
|
+
message?: string;
|
|
5
|
+
}
|
|
6
|
+
interface FormLoginError {
|
|
7
|
+
message?: string;
|
|
8
|
+
}
|
|
9
|
+
interface FormLoginProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSubmit'> {
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
onSubmit: (formData: FormType) => void;
|
|
13
|
+
isPending?: boolean;
|
|
14
|
+
isError?: boolean;
|
|
15
|
+
data?: FormLoginData;
|
|
16
|
+
error?: FormLoginError;
|
|
17
|
+
onNavigate?: (path: string) => void;
|
|
18
|
+
}
|
|
19
|
+
export declare const FormLogin: React.FC<FormLoginProps>;
|
|
20
|
+
export {};
|
package/lib/FormLogin.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{B as r}from"./Button-B93Rn5W6.js";import{F as i}from"./Form-CgTuTB2Q.js";import{G as t}from"./Grid-DZqidZrf.js";import{I as n}from"./Input-EbrliieY.js";import{T as a}from"./TextBox-__k4jPYK.js";import{s,g as l}from"./style-inject.es-CrVRO2OA.js";import"react";import"./Loader-BPh2L4dp.js";import"./LoaderDots-BoEg_zlZ.js";import"./index-uD0K440h.js";var m={n23mFormLogin:"FormLogin-module_n23mFormLogin__1mOEk",loginWrapper:"FormLogin-module_loginWrapper__HOEgv"};s("@layer n23mFormLogin{.FormLogin-module_n23mFormLogin__1mOEk{.FormLogin-module_loginWrapper__HOEgv{corner-shape:squircle;background-color:#fff;border:1px solid grey;border-radius:12px}}}");const d=({children:s,className:d,style:p,onSubmit:g,isPending:c=!1,isError:h=!1,data:u,error:f,onNavigate:x,...y})=>{const b=e=>{x?x(e):window.location.href=e};return e("div",{className:[m.n23mFormLogin,"n23mFormLogin",d].filter(Boolean).join(" "),...y,style:{...l({"--formlogin":"test"}),...p},children:e(t,{layout:"flex",flexWrap:"wrap",justifyContent:"center",alignItems:"center",widthMax:"1400px",minHeight:"calc(100dvb - 100px)",children:o(t,{layout:"container",minHeight:0,widthMin:"min(450px, calc(100% - 40px))",padding:"20px",margin:"20px",className:m.loginWrapper,children:[e(a,{desktopSize:20,mobileSize:20,fontWeight:500,tag:"a",href:"/",color:"grey",onClick:e=>{e.preventDefault(),b("/")},children:"GYM"}),e(a,{tag:"h3",desktopSize:14,mobileSize:14,fontWeight:500,margin:"12px 0 18px",children:"Good to see you!"}),o(i,{onSubmit:g,isError:h,isPending:c,isSuccess:"OK"===u?.code,errorMsg:f?.message,successMsg:u?.message,children:[e(n,{validatorOptions:[{type:"empty"},{type:"email"}],label:"Email",name:"email",type:"text",placeholder:"Email"}),e(n,{label:"Password",type:"password",name:"pass",validatorOptions:[{type:"empty"}],placeholder:"Password"}),o(t,{layout:"flex",justifyContent:"space-between",alignItems:"flex-start",children:[e(r,{type:"submit",disabled:c,height:"40px",width:"80px",padding:0,backgroundColor:"orangered",backgroundColorDisabled:"grey",children:e(a,{tag:"span",desktopSize:16,mobileSize:16,fontWeight:400,color:"white",children:"LOG IN"})}),o("div",{children:[e("div",{children:e(a,{tag:"a",href:"/auth/forgot-password",desktopSize:12,mobileSize:12,fontWeight:400,color:"orangered",onClick:e=>{e.preventDefault(),b("/auth/forgot-password")},children:"forgot password"})}),e(t,{layout:"flex",justifyContent:"right",children:e(a,{tag:"a",href:"/auth/sign-up",desktopSize:12,mobileSize:12,fontWeight:400,color:"orangered",onClick:e=>{e.preventDefault(),b("/auth/sign-up")},children:"sign up"})})]})]})]})]})})})};d.displayName="FormLogin";export{d as FormLogin};
|
package/lib/Masonry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as n}from"react/jsx-runtime";import{useRef as a,useEffect as m,Children as r,useState as o,useMemo as s}from"react";import{u as e}from"./useWindowSize-CAQRbyxi.js";import{s as t,g as l}from"./style-inject.es-CrVRO2OA.js";import{a as i}from"./useResizeObserver-BbBZwKT3.js";var
|
|
1
|
+
import{jsx as n}from"react/jsx-runtime";import{useRef as a,useEffect as m,Children as r,useState as o,useMemo as s}from"react";import{u as e}from"./useWindowSize-CAQRbyxi.js";import{s as t,g as l}from"./style-inject.es-CrVRO2OA.js";import{a as i}from"./useResizeObserver-BbBZwKT3.js";var d={n23mMasonry:"Masonry-module_n23mMasonry__PqEPk",n23mMasonryColumn:"Masonry-module_n23mMasonryColumn__Vq3lz",n23mMasonryColumnChild:"Masonry-module_n23mMasonryColumnChild__m9YtO"};t("@layer n23mMasonry{.Masonry-module_n23mMasonry__PqEPk{column-gap:var(--masonry-cg);display:flex;&>*{height:fit-content}}.Masonry-module_n23mMasonryColumn__Vq3lz{width:calc(100%/var(--mc) - ((var(--mc) - 1)/var(--mc))*var(--masonry-cg))}.Masonry-module_n23mMasonryColumnChild__m9YtO{margin-bottom:var(--masonry-rg)}@media (max-width:767.98px){.Masonry-module_n23mMasonryColumn__Vq3lz{--mc:var(--masonry-cm)}}@media (min-width:768px) and (max-width:1199.98px){.Masonry-module_n23mMasonryColumn__Vq3lz{--mc:var(--masonry-ct)}}@media (min-width:1200px) and (max-width:1599.98px){.Masonry-module_n23mMasonryColumn__Vq3lz{--mc:var(--masonry-csd)}}@media (min-width:1600px){.Masonry-module_n23mMasonryColumn__Vq3lz{--mc:var(--masonry-cd)}}}");const y=({arrWithChildren:o,onHeightChange:s,id:e})=>{const t=a(null),{height:l=0}=i({ref:t});return m(()=>{s(l)},[l]),n("div",{ref:t,className:d.n23mMasonryColumn,children:r.map(o,(a,m)=>n("div",{className:d.n23mMasonryColumnChild,children:a},e+m))},e)};y.displayName="MasonryColumn";const c=({children:r,gap:t,col:i,onGridMasonryLoadEnd:c,delay:h=10,className:u,style:M,..._})=>{const[p,g]=o(0),{width:C}=e(),v=a(!0),f=n=>n<767.98?i.mobile:n>=768.98&&n<1199.98?i.tablet:n>=1199.98&&n<1599.98?i.smallDesktop:n>=1599.98?i.desktop:3,[x,w]=o(()=>f(C)),q=n=>Array.from({length:n}).map((n,a)=>({name:`col${a}`,arrWithElm:[],height:0})),[z,j]=o(()=>q(x));m(()=>{const n=setTimeout(()=>{const n=f(C);n!==x&&(g(0),w(n),j(q(n)))},100);return()=>clearTimeout(n)},[C]);const E=s(()=>z.map(({height:n})=>n).join(","),[z]);return m(()=>{const n=v.current?0:h,a=setTimeout(()=>{if(p<r.length){const n=(n=>[...n].sort((n,a)=>n.height-a.height)[0].name)(z);j(z.map(a=>a.name===n?{...a,arrWithElm:[...a.arrWithElm,r[p]]}:a)),g(n=>n+1),p===r.length-1&&c&&c(!0)}},n);return()=>clearTimeout(a)},[E]),m(()=>{v.current=!1},[]),n("div",{className:[d.n23mMasonry,"n23mMasonry",u].filter(Boolean).join(" "),..._,style:{...l({"--masonry-cm":i.mobile,"--masonry-ct":i.tablet,"--masonry-csd":i.smallDesktop,"--masonry-cd":i.desktop,"--masonry-cg":t.col,"--masonry-rg":t.row}),...M},children:z.map(({arrWithElm:a,name:m})=>n(y,{arrWithChildren:a,onHeightChange:n=>((n,a)=>{j(z.map(m=>m.name===a?{...m,height:n}:m))})(n,m),id:m},"masonry-parent"+m))})};c.displayName="Masonry";export{c as Masonry};
|