@lanaco/lnc-react-ui 4.0.72 → 4.0.74
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,10 +1,10 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),d=require("react"),b=require("./emotion-styled.browser.esm-BtEseadx.cjs"),y=require("./consts-CtNoHdBj.cjs"),z=require("./Button.cjs"),I=require("./index-BPVoEhTF.cjs"),L=require("./RangeSlider.cjs"),F=require("./DropdownItem.cjs"),X=require("./DropdownMenu.cjs"),Z=require("./IconButton.cjs"),V=require("./BannerSectionWithList.cjs"),H=require("./utils-BXPz9bck.cjs"),D=b.styled.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
width: 100%;
|
|
5
5
|
gap: 2.25rem;
|
|
6
6
|
|
|
7
|
-
@media (max-width: ${
|
|
7
|
+
@media (max-width: ${y.MOBILE_SIZE_PX+"px"}) {
|
|
8
8
|
gap: 2rem;
|
|
9
9
|
}
|
|
10
10
|
`,Y=b.styled.div`
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
font-weight: 500;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
@media (max-width: ${
|
|
28
|
+
@media (max-width: ${y.MOBILE_SIZE_PX+"px"}) {
|
|
29
29
|
}
|
|
30
30
|
`;b.styled.div`
|
|
31
31
|
display: flex;
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
@media (max-width: ${
|
|
60
|
+
@media (max-width: ${y.MOBILE_SIZE_PX+"px"}) {
|
|
61
61
|
gap: 2rem;
|
|
62
62
|
& .btns-footer {
|
|
63
63
|
width: 100%;
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
padding-top: 0 !important;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
@media (max-width: ${
|
|
136
|
+
@media (max-width: ${y.MOBILE_SIZE_PX+"px"}) {
|
|
137
137
|
gap: 0.25rem;
|
|
138
138
|
grid-template-columns: auto;
|
|
139
139
|
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
margin: 0 0.62rem;
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
@media (max-width: ${
|
|
189
|
+
@media (max-width: ${y.MOBILE_SIZE_PX+"px"}) {
|
|
190
190
|
padding: 0.75rem;
|
|
191
191
|
gap: 0.75rem;
|
|
192
192
|
|
|
@@ -206,7 +206,7 @@
|
|
|
206
206
|
gap: 1rem;
|
|
207
207
|
flex: 1;
|
|
208
208
|
|
|
209
|
-
@media (max-width: ${
|
|
209
|
+
@media (max-width: ${y.MOBILE_SIZE_PX+"px"}) {
|
|
210
210
|
grid-template-columns: repeat(2, 1fr);
|
|
211
211
|
gap: 0.75rem;
|
|
212
212
|
}
|
|
@@ -236,7 +236,7 @@
|
|
|
236
236
|
font-size: 3rem;
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
-
@media (max-width: ${
|
|
239
|
+
@media (max-width: ${y.MOBILE_SIZE_PX+"px"}) {
|
|
240
240
|
flex-direction: row;
|
|
241
241
|
gap: 0.25rem;
|
|
242
242
|
font-size: 0.875rem;
|
|
@@ -266,7 +266,7 @@
|
|
|
266
266
|
font-family: Arial, sans-serif;
|
|
267
267
|
font-weight: bold;
|
|
268
268
|
font-size: 1rem;
|
|
269
|
-
color: var(--gray-950, #
|
|
269
|
+
color: var(--gray-950, #14161a);
|
|
270
270
|
transition: background-color 0.3s;
|
|
271
271
|
min-height: 2.5rem;
|
|
272
272
|
max-height: 2.5rem;
|
|
@@ -289,7 +289,7 @@
|
|
|
289
289
|
position: absolute;
|
|
290
290
|
top: 0;
|
|
291
291
|
bottom: 0;
|
|
292
|
-
left: ${c=>c.checked?"
|
|
292
|
+
left: ${c=>c.checked?"4.6875rem":"0"};
|
|
293
293
|
background: var(--success-600, #059669);
|
|
294
294
|
border-radius: 30px;
|
|
295
295
|
transition: left 0.3s;
|
|
@@ -305,6 +305,15 @@
|
|
|
305
305
|
min-height: 2.5rem;
|
|
306
306
|
max-height: 2.5rem;
|
|
307
307
|
border: 1px solid var(--success-600, #059669);
|
|
308
|
+
|
|
309
|
+
& .cont {
|
|
310
|
+
min-width: 6.25rem;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
& .cont {
|
|
315
|
+
min-width: 4.6875rem;
|
|
316
|
+
justify-content: center;
|
|
308
317
|
}
|
|
309
318
|
|
|
310
319
|
.text {
|
|
@@ -329,4 +338,4 @@
|
|
|
329
338
|
align-items: center;
|
|
330
339
|
gap: 0.38rem;
|
|
331
340
|
}
|
|
332
|
-
`,E=o.forwardRef((c,v)=>{var g,m,x,p,h,f,N,y;const{onChange:d=()=>{},items:a=[{name:"Male",icon:"mng-lnc-male-02",value:"male"},{name:"Female",value:"female",icon:"mng-lnc-female-02"}],...l}=c,s=e.jsxs("div",{className:"cont",children:[e.jsx("i",{className:(g=a==null?void 0:a.at(0))==null?void 0:g.icon}),e.jsx("span",{children:(m=a==null?void 0:a.at(0))==null?void 0:m.name})]}),n=e.jsxs("div",{className:"cont",children:[e.jsx("span",{children:(x=a==null?void 0:a.at(1))==null?void 0:x.name}),e.jsx("i",{className:(p=a==null?void 0:a.at(1))==null?void 0:p.icon})]}),[t,r]=o.useState(!1),i=u=>{var C,T;r(u.target.checked),d&&d(u.target.checked===!0?(C=a==null?void 0:a.at(1))==null?void 0:C.value:(T=a==null?void 0:a.at(0))==null?void 0:T.value)};return e.jsxs(ee,{ref:v,checked:t,...l,children:[e.jsx("input",{type:"checkbox",checked:t,onChange:i}),e.jsx("span",{className:"knob",children:t?n:s}),e.jsxs("span",{className:"text",children:[e.jsxs("div",{className:"cont",children:[e.jsx("i",{className:(h=a==null?void 0:a.at(0))==null?void 0:h.icon}),t===!0&&e.jsx("span",{className:"hidden-txt",children:(f=a==null?void 0:a.at(0))==null?void 0:f.name})]}),e.jsxs("div",{className:"cont",children:[t!==!0&&e.jsx("span",{className:"hidden-txt",children:(N=a==null?void 0:a.at(1))==null?void 0:N.name}),e.jsx("i",{className:(y=a==null?void 0:a.at(1))==null?void 0:y.icon})]})]})]})});E.propTypes={value:I.PropTypes.any,handleClick:I.PropTypes.func,color:I.PropTypes.string};const te=o.forwardRef((c,v)=>{var y;const{yearsText:d,heightText:a,weightText:l,genderText:s="Gender",calculateText:n="Calculate",closeText:t="Close calculator",onClose:r=()=>{},genders:i=[{name:"Male",icon:"mng-lnc-male-02",value:"male"},{name:"Female",value:"female",icon:"mng-lnc-female-02"}],activityLevels:g=[{name:"Very low",code:"veryLow"},{name:"Moderate",code:"moderate"},{name:"Very active",code:"veryActive"}],activityLevelText:m,goalText:x,goals:p=[{name:"Lose weight",code:"loseWeight",icon:"mng-lnc-weight-scale"},{name:"Maintaining",code:"maintaining",icon:"mng-lnc-move"},{name:"Gain muscle",code:"gainMuscle",icon:"mng-lnc-muscule"}],onCalculate:h=()=>{}}=c,f=o.useRef({year:null,height:null,weight:null,gender:(y=i==null?void 0:i.at(0))==null?void 0:y.value,activityLevel:null,goal:null}),N=()=>{h==null||h(f==null?void 0:f.current)};return e.jsxs(K,{children:[e.jsxs(J,{className:"calorie-calculating",children:[e.jsx("div",{className:"grid-label",children:s}),e.jsx("div",{children:e.jsx(E,{items:i,onChange:u=>f.current.gender=u})}),e.jsx(ae,{text:d,onChange:u=>f.current.year=u}),e.jsx(ne,{text:a,onChange:u=>f.current.height=u}),e.jsx(re,{text:l,onChange:u=>f.current.weight=u}),e.jsx(ie,{text:m,activityLevels:g,onChange:u=>f.current.activityLevel=u}),e.jsx(le,{text:x,goals:p,onChange:u=>f.current.goal=u})]}),e.jsxs("div",{className:"btns-footer",children:[e.jsx(z,{type:"button",color:"neutral",size:"medium",onClick:()=>{N()},children:n}),e.jsx(z,{type:"button",btnType:"basic",color:"gray",size:"medium",onClick:()=>r==null?void 0:r(),children:t})]})]})}),ae=o.forwardRef((c,v)=>{const{text:d="Years",onChange:a=()=>{}}=c,[l,s]=o.useState(1);return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid-label",children:d}),e.jsxs("div",{className:"caluclating-group",children:[e.jsx(L,{className:"range-input-lnc",max:115,min:0,step:1,value:l,color:"success",defaultValue:0,onChange:n=>{var t,r;s((t=n==null?void 0:n.target)==null?void 0:t.value),a==null||a((r=n==null?void 0:n.target)==null?void 0:r.value)}}),e.jsx("input",{tabIndex:2,type:"text",className:"calculating-input",onChange:n=>{var t,r,i,g,m,x,p;!isNaN((t=n==null?void 0:n.target)==null?void 0:t.value)&&+((r=n==null?void 0:n.target)==null?void 0:r.value)>=0&&s(((g=(i=n==null?void 0:n.target)==null?void 0:i.value)==null?void 0:g.length)>1?(x=(m=n==null?void 0:n.target)==null?void 0:m.value)==null?void 0:x.replace(/^0+/,""):(p=n==null?void 0:n.target)==null?void 0:p.value)},value:l==null?void 0:l.toString()})]})]})}),ne=o.forwardRef((c,v)=>{const{text:d="Height",unitText:a="cm",onChange:l=()=>{}}=c,[s,n]=o.useState(1);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid-label",children:[d," ",e.jsx("span",{className:"unit",children:`(${a})`})]}),e.jsxs("div",{className:"caluclating-group",children:[e.jsx(L,{className:"range-input-lnc",max:273,min:0,step:1,value:s,defaultValue:0,color:"success",onChange:t=>{var r,i;n((r=t==null?void 0:t.target)==null?void 0:r.value),l==null||l((i=t==null?void 0:t.target)==null?void 0:i.value)}}),e.jsx("input",{type:"text",tabIndex:2,className:"calculating-input",onChange:t=>{var r,i,g,m,x,p,h;!isNaN((r=t==null?void 0:t.target)==null?void 0:r.value)&&+((i=t==null?void 0:t.target)==null?void 0:i.value)>=0&&n(((m=(g=t==null?void 0:t.target)==null?void 0:g.value)==null?void 0:m.length)>1?(p=(x=t==null?void 0:t.target)==null?void 0:x.value)==null?void 0:p.replace(/^0+/,""):(h=t==null?void 0:t.target)==null?void 0:h.value)},value:s==null?void 0:s.toString()})]})]})}),re=o.forwardRef((c,v)=>{const{text:d="Weight",unitText:a="cm",onChange:l=()=>{}}=c,[s,n]=o.useState(1);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid-label",children:[d," ",e.jsx("span",{className:"unit",children:`(${a})`})]}),e.jsxs("div",{className:"caluclating-group",children:[e.jsx(L,{className:"range-input-lnc",max:400,min:0,step:1,value:s,color:"success",defaultValue:0,onChange:t=>{var r,i;n((r=t==null?void 0:t.target)==null?void 0:r.value),l==null||l((i=t==null?void 0:t.target)==null?void 0:i.value)}}),e.jsx("input",{tabIndex:2,type:"text",className:"calculating-input",onChange:t=>{var r,i,g,m,x,p,h;!isNaN((r=t==null?void 0:t.target)==null?void 0:r.value)&&+((i=t==null?void 0:t.target)==null?void 0:i.value)>=0&&n(((m=(g=t==null?void 0:t.target)==null?void 0:g.value)==null?void 0:m.length)>1?(p=(x=t==null?void 0:t.target)==null?void 0:x.value)==null?void 0:p.replace(/^0+/,""):(h=t==null?void 0:t.target)==null?void 0:h.value)},value:s==null?void 0:s.toString()})]})]})}),ie=o.forwardRef((c,v)=>{const{text:d="Activity level",activityLevels:a,onChange:l=()=>{}}=c,[s,n]=o.useState(null);return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid-label",children:d}),e.jsx("div",{className:"caluclating-group",children:a==null?void 0:a.map((t,r)=>e.jsx(z,{type:"button",btnType:s===(t==null?void 0:t.code)?"filled":"tinted",color:"neutral",borderRadius:"curved",onClick:()=>{n(t==null?void 0:t.code),l(t==null?void 0:t.code)},children:t==null?void 0:t.name},r))})]})}),le=o.forwardRef((c,v)=>{const{text:d="Goal",goals:a,onChange:l=()=>{}}=c,[s,n]=o.useState(null);return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid-label",children:d}),e.jsx("div",{className:"caluclating-group group-activity",children:a==null?void 0:a.map((t,r)=>e.jsx(z,{type:"button",btnType:s===(t==null?void 0:t.code)?"filled":"tinted",color:"neutral",borderRadius:"curved",onClick:()=>{n(t==null?void 0:t.code),l(t==null?void 0:t.code)},children:e.jsxs("div",{className:"btn-cnt",children:[e.jsx("i",{className:t==null?void 0:t.icon}),e.jsx("span",{children:t==null?void 0:t.name})]})},r))})]})}),se=o.forwardRef((c,v)=>{const{caloriesText:d="Calories",carbsText:a="Carbs",proteinText:l="Protein",fatsText:s="Fats",calculateAgainText:n="Calculate again",calories:t,carbs:r,protein:i,fats:g,onGoBack:m=()=>{}}=c;return e.jsxs(Q,{children:[e.jsxs(U,{children:[e.jsxs(S,{color:"var(--warning-600)",children:[e.jsx("i",{className:"mng-lnc-fire"}),e.jsxs("div",{className:"subgroup",children:[e.jsxs("div",{children:[t," kcal"]}),e.jsx("div",{className:"subtext",children:d})]})]}),e.jsxs(S,{color:"var(--secondary-400)",children:[e.jsx("i",{className:"mng-lnc-leaf"}),e.jsxs("div",{className:"subgroup",children:[e.jsxs("div",{children:[r,"g"]}),e.jsx("div",{className:"subtext",children:a})]})]}),e.jsxs(S,{color:"var(--info-500)",children:[e.jsx("i",{className:"mng-lnc-meat"}),e.jsxs("div",{className:"subgroup",children:[e.jsxs("div",{children:[i,"g"]}),e.jsx("div",{className:"subtext",children:l})]})]}),e.jsxs(S,{color:"var(--warning-300)",children:[e.jsx("i",{className:"mng-lnc-meat"}),e.jsxs("div",{className:"subgroup",children:[e.jsxs("div",{children:[g,"g"]}),e.jsx("div",{className:"subtext",children:s})]})]})]}),e.jsxs("div",{className:"dropdown-group",children:[e.jsx("div",{className:"vertical-line"}),e.jsx(X,{color:"neutral",control:e.jsx(Z,{borderRadius:"curved",btnType:"basic",className:"dropdown-btn",color:"neutral",icon:"ellipsis",type:"button"}),offsetValue:-10,placement:"bottom-end",children:e.jsx(F,{icon:"star",onClick:m,children:n})})]})]})}),ce=o.forwardRef((c,v)=>{const{caloriesText:d,carbsText:a,proteinText:l,fatsText:s,calculateAgainText:n,yearsText:t,heightText:r,weightText:i,genderText:g,calculateText:m,closeText:x,genders:p,activityLevels:h,activityLevelText:f,goalText:N,goals:y,title:u="Daily calorie calculator",subtitle:C="Lorem ipsum dolor sit amet",list:T=["Ovdje može pisati zašto je bitno da znamo kolika nam je dnevna kalorijska potreba.","Ovdje može pisati zašto je bitno da znamo kolikanam je dnevna kalorijska potreba.","From certified dealers from all over Europe"],buttonText:_="Calculate calorie needs"}=c,[R,k]=o.useState(1),[j,B]=o.useState(0),M=({gender:q,year:O,height:P,weight:W,activityLevel:$,goal:A})=>{const G=H.calculateCalories({gender:q,age:O,heightCm:P,weightKg:W,activityLevel:$,goal:A});B(G),k(3)};return e.jsxs(D,{ref:v,children:[e.jsxs(Y,{children:[e.jsx("div",{className:"header-title",children:u}),e.jsx("div",{className:"header-subtitle",children:C})]}),R===1&&e.jsx(V,{buttonText:_,onButtonAction:()=>{k(2)},list:T}),R===2&&e.jsx(te,{yearsText:t,heightText:r,weightText:i,genderText:g,calculateText:m,closeText:x,onClose:()=>k(1),genders:p,activityLevels:h,activityLevelText:f,goalText:N,goals:y,onCalculate:M}),R===3&&e.jsx(se,{caloriesText:d,carbsText:a,proteinText:l,fatsText:s,calculateAgainText:n,onGoBack:()=>k(2),calories:j==null?void 0:j.calories,fats:j==null?void 0:j.fat,carbs:j==null?void 0:j.carbs,protein:j==null?void 0:j.protein})]})}),oe=o.forwardRef((c,v)=>e.jsx(ce,{ref:v,...c}));module.exports=oe;
|
|
341
|
+
`,E=d.forwardRef((c,v)=>{var u,g,h,f,x,o,N,w;const{onChange:m=()=>{},items:a=[{name:"Male",icon:"mng-lnc-male-02",value:"male"},{name:"Female",value:"female",icon:"mng-lnc-female-02"}],...i}=c,s=t.jsxs("div",{className:"cont",children:[t.jsx("i",{className:(u=a==null?void 0:a.at(0))==null?void 0:u.icon}),t.jsx("span",{children:(g=a==null?void 0:a.at(0))==null?void 0:g.name})]}),n=t.jsxs("div",{className:"cont",children:[t.jsx("span",{children:(h=a==null?void 0:a.at(1))==null?void 0:h.name}),t.jsx("i",{className:(f=a==null?void 0:a.at(1))==null?void 0:f.icon})]}),[e,r]=d.useState(!1),l=p=>{var T,k;r(p.target.checked),m&&m(p.target.checked===!0?(T=a==null?void 0:a.at(1))==null?void 0:T.value:(k=a==null?void 0:a.at(0))==null?void 0:k.value)};return t.jsxs(ee,{ref:v,checked:e,...i,children:[t.jsx("input",{type:"checkbox",checked:e,onChange:l}),t.jsx("span",{className:"knob",children:e?n:s}),t.jsxs("span",{className:"text",children:[t.jsxs("div",{className:"cont",children:[t.jsx("i",{className:(x=a==null?void 0:a.at(0))==null?void 0:x.icon}),e===!0&&t.jsx("span",{className:"hidden-txt",children:(o=a==null?void 0:a.at(0))==null?void 0:o.name})]}),t.jsxs("div",{className:"cont",children:[e!==!0&&t.jsx("span",{className:"hidden-txt",children:(N=a==null?void 0:a.at(1))==null?void 0:N.name}),t.jsx("i",{className:(w=a==null?void 0:a.at(1))==null?void 0:w.icon})]})]})]})});E.propTypes={value:I.PropTypes.any,handleClick:I.PropTypes.func,color:I.PropTypes.string};const te=d.forwardRef((c,v)=>{var w;const{yearsText:m,heightText:a,weightText:i,genderText:s="Gender",calculateText:n="Calculate",closeText:e="Close calculator",onClose:r=()=>{},genders:l=[{name:"Male",icon:"mng-lnc-male-02",value:"male"},{name:"Female",value:"female",icon:"mng-lnc-female-02"}],activityLevels:u=[{name:"Very low",code:"veryLow"},{name:"Moderate",code:"moderate"},{name:"Very active",code:"veryActive"}],activityLevelText:g,goalText:h,goals:f=[{name:"Lose weight",code:"loseWeight",icon:"mng-lnc-weight-scale"},{name:"Maintaining",code:"maintaining",icon:"mng-lnc-move"},{name:"Gain muscle",code:"gainMuscle",icon:"mng-lnc-muscule"}],onCalculate:x=()=>{}}=c,o=d.useRef({year:null,height:null,weight:null,gender:(w=l==null?void 0:l.at(0))==null?void 0:w.value,activityLevel:null,goal:null}),N=()=>{x==null||x(o==null?void 0:o.current)};return t.jsxs(K,{children:[t.jsxs(J,{className:"calorie-calculating",children:[t.jsx("div",{className:"grid-label",children:s}),t.jsx("div",{children:t.jsx(E,{items:l,onChange:p=>o.current.gender=p})}),t.jsx(ae,{text:m,onChange:p=>o.current.year=p}),t.jsx(ne,{text:a,onChange:p=>o.current.height=p}),t.jsx(re,{text:i,onChange:p=>o.current.weight=p}),t.jsx(ie,{text:g,activityLevels:u,onChange:p=>o.current.activityLevel=p}),t.jsx(le,{text:h,goals:f,onChange:p=>o.current.goal=p})]}),t.jsxs("div",{className:"btns-footer",children:[t.jsx(z,{type:"button",color:"neutral",size:"medium",onClick:()=>{N()},children:n}),t.jsx(z,{type:"button",btnType:"basic",color:"gray",size:"medium",onClick:()=>r==null?void 0:r(),children:e})]})]})}),ae=d.forwardRef((c,v)=>{const{text:m="Years",onChange:a=()=>{}}=c,[i,s]=d.useState(1);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"grid-label",children:m}),t.jsxs("div",{className:"caluclating-group",children:[t.jsx(L,{className:"range-input-lnc",max:115,min:0,step:1,value:i,color:"success",defaultValue:0,onChange:n=>{var e,r;s((e=n==null?void 0:n.target)==null?void 0:e.value),a==null||a((r=n==null?void 0:n.target)==null?void 0:r.value)}}),t.jsx("input",{tabIndex:2,type:"text",className:"calculating-input",onChange:n=>{var e,r,l,u,g,h,f,x;!isNaN((e=n==null?void 0:n.target)==null?void 0:e.value)&&+((r=n==null?void 0:n.target)==null?void 0:r.value)>=0&&(s(((u=(l=n==null?void 0:n.target)==null?void 0:l.value)==null?void 0:u.length)>1?(h=(g=n==null?void 0:n.target)==null?void 0:g.value)==null?void 0:h.replace(/^0+/,""):(f=n==null?void 0:n.target)==null?void 0:f.value),a==null||a((x=n==null?void 0:n.target)==null?void 0:x.value))},value:i==null?void 0:i.toString()})]})]})}),ne=d.forwardRef((c,v)=>{const{text:m="Height",unitText:a="cm",onChange:i=()=>{}}=c,[s,n]=d.useState(1);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid-label",children:[m," ",t.jsx("span",{className:"unit",children:`(${a})`})]}),t.jsxs("div",{className:"caluclating-group",children:[t.jsx(L,{className:"range-input-lnc",max:273,min:0,step:1,value:s,defaultValue:0,color:"success",onChange:e=>{var r,l;n((r=e==null?void 0:e.target)==null?void 0:r.value),i==null||i((l=e==null?void 0:e.target)==null?void 0:l.value)}}),t.jsx("input",{type:"text",tabIndex:2,className:"calculating-input",onChange:e=>{var r,l,u,g,h,f,x,o;!isNaN((r=e==null?void 0:e.target)==null?void 0:r.value)&&+((l=e==null?void 0:e.target)==null?void 0:l.value)>=0&&(n(((g=(u=e==null?void 0:e.target)==null?void 0:u.value)==null?void 0:g.length)>1?(f=(h=e==null?void 0:e.target)==null?void 0:h.value)==null?void 0:f.replace(/^0+/,""):(x=e==null?void 0:e.target)==null?void 0:x.value),i==null||i((o=e==null?void 0:e.target)==null?void 0:o.value))},value:s==null?void 0:s.toString()})]})]})}),re=d.forwardRef((c,v)=>{const{text:m="Weight",unitText:a="cm",onChange:i=()=>{}}=c,[s,n]=d.useState(1);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid-label",children:[m," ",t.jsx("span",{className:"unit",children:`(${a})`})]}),t.jsxs("div",{className:"caluclating-group",children:[t.jsx(L,{className:"range-input-lnc",max:400,min:0,step:1,value:s,color:"success",defaultValue:0,onChange:e=>{var r,l;n((r=e==null?void 0:e.target)==null?void 0:r.value),i==null||i((l=e==null?void 0:e.target)==null?void 0:l.value)}}),t.jsx("input",{tabIndex:2,type:"text",className:"calculating-input",onChange:e=>{var r,l,u,g,h,f,x,o;!isNaN((r=e==null?void 0:e.target)==null?void 0:r.value)&&+((l=e==null?void 0:e.target)==null?void 0:l.value)>=0&&(n(((g=(u=e==null?void 0:e.target)==null?void 0:u.value)==null?void 0:g.length)>1?(f=(h=e==null?void 0:e.target)==null?void 0:h.value)==null?void 0:f.replace(/^0+/,""):(x=e==null?void 0:e.target)==null?void 0:x.value),i==null||i((o=e==null?void 0:e.target)==null?void 0:o.value))},value:s==null?void 0:s.toString()})]})]})}),ie=d.forwardRef((c,v)=>{const{text:m="Activity level",activityLevels:a,onChange:i=()=>{}}=c,[s,n]=d.useState(null);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"grid-label",children:m}),t.jsx("div",{className:"caluclating-group",children:a==null?void 0:a.map((e,r)=>t.jsx(z,{type:"button",btnType:s===(e==null?void 0:e.code)?"filled":"tinted",color:"neutral",borderRadius:"curved",onClick:()=>{n(e==null?void 0:e.code),i(e==null?void 0:e.code)},children:e==null?void 0:e.name},r))})]})}),le=d.forwardRef((c,v)=>{const{text:m="Goal",goals:a,onChange:i=()=>{}}=c,[s,n]=d.useState(null);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"grid-label",children:m}),t.jsx("div",{className:"caluclating-group group-activity",children:a==null?void 0:a.map((e,r)=>t.jsx(z,{type:"button",btnType:s===(e==null?void 0:e.code)?"filled":"tinted",color:"neutral",borderRadius:"curved",onClick:()=>{n(e==null?void 0:e.code),i(e==null?void 0:e.code)},children:t.jsxs("div",{className:"btn-cnt",children:[t.jsx("i",{className:e==null?void 0:e.icon}),t.jsx("span",{children:e==null?void 0:e.name})]})},r))})]})}),se=d.forwardRef((c,v)=>{const{caloriesText:m="Calories",carbsText:a="Carbs",proteinText:i="Protein",fatsText:s="Fats",calculateAgainText:n="Calculate again",calories:e,carbs:r,protein:l,fats:u,onGoBack:g=()=>{}}=c;return t.jsxs(Q,{children:[t.jsxs(U,{children:[t.jsxs(S,{color:"var(--warning-600)",children:[t.jsx("i",{className:"mng-lnc-fire"}),t.jsxs("div",{className:"subgroup",children:[t.jsxs("div",{children:[e," kcal"]}),t.jsx("div",{className:"subtext",children:m})]})]}),t.jsxs(S,{color:"var(--secondary-400)",children:[t.jsx("i",{className:"mng-lnc-leaf"}),t.jsxs("div",{className:"subgroup",children:[t.jsxs("div",{children:[r,"g"]}),t.jsx("div",{className:"subtext",children:a})]})]}),t.jsxs(S,{color:"var(--info-500)",children:[t.jsx("i",{className:"mng-lnc-meat"}),t.jsxs("div",{className:"subgroup",children:[t.jsxs("div",{children:[l,"g"]}),t.jsx("div",{className:"subtext",children:i})]})]}),t.jsxs(S,{color:"var(--warning-300)",children:[t.jsx("i",{className:"mng-lnc-meat"}),t.jsxs("div",{className:"subgroup",children:[t.jsxs("div",{children:[u,"g"]}),t.jsx("div",{className:"subtext",children:s})]})]})]}),t.jsxs("div",{className:"dropdown-group",children:[t.jsx("div",{className:"vertical-line"}),t.jsx(X,{color:"neutral",control:t.jsx(Z,{borderRadius:"curved",btnType:"basic",className:"dropdown-btn",color:"neutral",icon:"ellipsis",type:"button"}),offsetValue:-10,placement:"bottom-end",children:t.jsx(F,{icon:"star",onClick:g,children:n})})]})]})}),ce=d.forwardRef((c,v)=>{const{caloriesText:m,carbsText:a,proteinText:i,fatsText:s,calculateAgainText:n,yearsText:e,heightText:r,weightText:l,genderText:u,calculateText:g,closeText:h,genders:f,activityLevels:x,activityLevelText:o,goalText:N,goals:w,title:p="Daily calorie calculator",subtitle:T="Lorem ipsum dolor sit amet",list:k=["Ovdje može pisati zašto je bitno da znamo kolika nam je dnevna kalorijska potreba.","Ovdje može pisati zašto je bitno da znamo kolikanam je dnevna kalorijska potreba.","From certified dealers from all over Europe"],buttonText:_="Calculate calorie needs"}=c,[R,C]=d.useState(1),[j,B]=d.useState(0),M=({gender:q,year:O,height:P,weight:W,activityLevel:$,goal:G})=>{const A=H.calculateCalories({gender:q,age:O,heightCm:P,weightKg:W,activityLevel:$,goal:G});B(A),C(3)};return t.jsxs(D,{ref:v,children:[t.jsxs(Y,{children:[t.jsx("div",{className:"header-title",children:p}),t.jsx("div",{className:"header-subtitle",children:T})]}),R===1&&t.jsx(V,{buttonText:_,onButtonAction:()=>{C(2)},list:k}),R===2&&t.jsx(te,{yearsText:e,heightText:r,weightText:l,genderText:u,calculateText:g,closeText:h,onClose:()=>C(1),genders:f,activityLevels:x,activityLevelText:o,goalText:N,goals:w,onCalculate:M}),R===3&&t.jsx(se,{caloriesText:m,carbsText:a,proteinText:i,fatsText:s,calculateAgainText:n,onGoBack:()=>C(2),calories:j==null?void 0:j.calories,fats:j==null?void 0:j.fat,carbs:j==null?void 0:j.carbs,protein:j==null?void 0:j.protein})]})}),oe=d.forwardRef((c,v)=>t.jsx(ce,{ref:v,...c}));module.exports=oe;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsxs as i, jsx as
|
|
1
|
+
import { jsxs as i, jsx as a, Fragment as z } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as w, useState as N, useRef as Y } from "react";
|
|
3
3
|
import { s as y } from "./emotion-styled.browser.esm-BNN1dTl3.js";
|
|
4
|
-
import { M as
|
|
4
|
+
import { M as C } from "./consts-C1uHV4xc.js";
|
|
5
5
|
import S from "./Button.js";
|
|
6
|
-
import { P as
|
|
7
|
-
import
|
|
6
|
+
import { P as G } from "./index-S5Cd7WrG.js";
|
|
7
|
+
import A from "./RangeSlider.js";
|
|
8
8
|
import _ from "./DropdownItem.js";
|
|
9
9
|
import K from "./DropdownMenu.js";
|
|
10
10
|
import X from "./IconButton.js";
|
|
@@ -16,7 +16,7 @@ const J = y.div`
|
|
|
16
16
|
width: 100%;
|
|
17
17
|
gap: 2.25rem;
|
|
18
18
|
|
|
19
|
-
@media (max-width: ${
|
|
19
|
+
@media (max-width: ${C + "px"}) {
|
|
20
20
|
gap: 2rem;
|
|
21
21
|
}
|
|
22
22
|
`, Q = y.div`
|
|
@@ -37,7 +37,7 @@ const J = y.div`
|
|
|
37
37
|
font-weight: 500;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
@media (max-width: ${
|
|
40
|
+
@media (max-width: ${C + "px"}) {
|
|
41
41
|
}
|
|
42
42
|
`;
|
|
43
43
|
y.div`
|
|
@@ -71,7 +71,7 @@ const U = y.div`
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
@media (max-width: ${
|
|
74
|
+
@media (max-width: ${C + "px"}) {
|
|
75
75
|
gap: 2rem;
|
|
76
76
|
& .btns-footer {
|
|
77
77
|
width: 100%;
|
|
@@ -147,7 +147,7 @@ const U = y.div`
|
|
|
147
147
|
padding-top: 0 !important;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
@media (max-width: ${
|
|
150
|
+
@media (max-width: ${C + "px"}) {
|
|
151
151
|
gap: 0.25rem;
|
|
152
152
|
grid-template-columns: auto;
|
|
153
153
|
|
|
@@ -200,7 +200,7 @@ const U = y.div`
|
|
|
200
200
|
margin: 0 0.62rem;
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
@media (max-width: ${
|
|
203
|
+
@media (max-width: ${C + "px"}) {
|
|
204
204
|
padding: 0.75rem;
|
|
205
205
|
gap: 0.75rem;
|
|
206
206
|
|
|
@@ -220,7 +220,7 @@ const U = y.div`
|
|
|
220
220
|
gap: 1rem;
|
|
221
221
|
flex: 1;
|
|
222
222
|
|
|
223
|
-
@media (max-width: ${
|
|
223
|
+
@media (max-width: ${C + "px"}) {
|
|
224
224
|
grid-template-columns: repeat(2, 1fr);
|
|
225
225
|
gap: 0.75rem;
|
|
226
226
|
}
|
|
@@ -250,7 +250,7 @@ const U = y.div`
|
|
|
250
250
|
font-size: 3rem;
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
-
@media (max-width: ${
|
|
253
|
+
@media (max-width: ${C + "px"}) {
|
|
254
254
|
flex-direction: row;
|
|
255
255
|
gap: 0.25rem;
|
|
256
256
|
font-size: 0.875rem;
|
|
@@ -280,7 +280,7 @@ const U = y.div`
|
|
|
280
280
|
font-family: Arial, sans-serif;
|
|
281
281
|
font-weight: bold;
|
|
282
282
|
font-size: 1rem;
|
|
283
|
-
color: var(--gray-950, #
|
|
283
|
+
color: var(--gray-950, #14161a);
|
|
284
284
|
transition: background-color 0.3s;
|
|
285
285
|
min-height: 2.5rem;
|
|
286
286
|
max-height: 2.5rem;
|
|
@@ -303,7 +303,7 @@ const U = y.div`
|
|
|
303
303
|
position: absolute;
|
|
304
304
|
top: 0;
|
|
305
305
|
bottom: 0;
|
|
306
|
-
left: ${(s) => s.checked ? "
|
|
306
|
+
left: ${(s) => s.checked ? "4.6875rem" : "0"};
|
|
307
307
|
background: var(--success-600, #059669);
|
|
308
308
|
border-radius: 30px;
|
|
309
309
|
transition: left 0.3s;
|
|
@@ -319,6 +319,15 @@ const U = y.div`
|
|
|
319
319
|
min-height: 2.5rem;
|
|
320
320
|
max-height: 2.5rem;
|
|
321
321
|
border: 1px solid var(--success-600, #059669);
|
|
322
|
+
|
|
323
|
+
& .cont {
|
|
324
|
+
min-width: 6.25rem;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
& .cont {
|
|
329
|
+
min-width: 4.6875rem;
|
|
330
|
+
justify-content: center;
|
|
322
331
|
}
|
|
323
332
|
|
|
324
333
|
.text {
|
|
@@ -343,53 +352,53 @@ const U = y.div`
|
|
|
343
352
|
align-items: center;
|
|
344
353
|
gap: 0.38rem;
|
|
345
354
|
}
|
|
346
|
-
`, I = w((s,
|
|
347
|
-
var
|
|
355
|
+
`, I = w((s, x) => {
|
|
356
|
+
var g, u, v, f, p, d, k, T;
|
|
348
357
|
const {
|
|
349
|
-
onChange:
|
|
358
|
+
onChange: m = () => {
|
|
350
359
|
},
|
|
351
|
-
items:
|
|
360
|
+
items: t = [
|
|
352
361
|
{ name: "Male", icon: "mng-lnc-male-02", value: "male" },
|
|
353
362
|
{ name: "Female", value: "female", icon: "mng-lnc-female-02" }
|
|
354
363
|
],
|
|
355
364
|
...l
|
|
356
365
|
} = s, c = /* @__PURE__ */ i("div", { className: "cont", children: [
|
|
357
|
-
/* @__PURE__ */
|
|
358
|
-
/* @__PURE__ */
|
|
366
|
+
/* @__PURE__ */ a("i", { className: (g = t == null ? void 0 : t.at(0)) == null ? void 0 : g.icon }),
|
|
367
|
+
/* @__PURE__ */ a("span", { children: (u = t == null ? void 0 : t.at(0)) == null ? void 0 : u.name })
|
|
359
368
|
] }), n = /* @__PURE__ */ i("div", { className: "cont", children: [
|
|
360
|
-
/* @__PURE__ */
|
|
361
|
-
/* @__PURE__ */
|
|
369
|
+
/* @__PURE__ */ a("span", { children: (v = t == null ? void 0 : t.at(1)) == null ? void 0 : v.name }),
|
|
370
|
+
/* @__PURE__ */ a("i", { className: (f = t == null ? void 0 : t.at(1)) == null ? void 0 : f.icon })
|
|
362
371
|
] }), [e, r] = N(!1);
|
|
363
|
-
return /* @__PURE__ */ i(ne, { ref:
|
|
364
|
-
/* @__PURE__ */
|
|
365
|
-
var
|
|
366
|
-
r(
|
|
367
|
-
|
|
372
|
+
return /* @__PURE__ */ i(ne, { ref: x, checked: e, ...l, children: [
|
|
373
|
+
/* @__PURE__ */ a("input", { type: "checkbox", checked: e, onChange: (h) => {
|
|
374
|
+
var j, L;
|
|
375
|
+
r(h.target.checked), m && m(
|
|
376
|
+
h.target.checked === !0 ? (j = t == null ? void 0 : t.at(1)) == null ? void 0 : j.value : (L = t == null ? void 0 : t.at(0)) == null ? void 0 : L.value
|
|
368
377
|
);
|
|
369
378
|
} }),
|
|
370
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ a("span", { className: "knob", children: e ? n : c }),
|
|
371
380
|
/* @__PURE__ */ i("span", { className: "text", children: [
|
|
372
381
|
/* @__PURE__ */ i("div", { className: "cont", children: [
|
|
373
|
-
/* @__PURE__ */
|
|
374
|
-
e === !0 && /* @__PURE__ */
|
|
382
|
+
/* @__PURE__ */ a("i", { className: (p = t == null ? void 0 : t.at(0)) == null ? void 0 : p.icon }),
|
|
383
|
+
e === !0 && /* @__PURE__ */ a("span", { className: "hidden-txt", children: (d = t == null ? void 0 : t.at(0)) == null ? void 0 : d.name })
|
|
375
384
|
] }),
|
|
376
385
|
/* @__PURE__ */ i("div", { className: "cont", children: [
|
|
377
|
-
e !== !0 && /* @__PURE__ */
|
|
378
|
-
/* @__PURE__ */
|
|
386
|
+
e !== !0 && /* @__PURE__ */ a("span", { className: "hidden-txt", children: (k = t == null ? void 0 : t.at(1)) == null ? void 0 : k.name }),
|
|
387
|
+
/* @__PURE__ */ a("i", { className: (T = t == null ? void 0 : t.at(1)) == null ? void 0 : T.icon })
|
|
379
388
|
] })
|
|
380
389
|
] })
|
|
381
390
|
] });
|
|
382
391
|
});
|
|
383
392
|
I.propTypes = {
|
|
384
|
-
value:
|
|
385
|
-
handleClick:
|
|
386
|
-
color:
|
|
393
|
+
value: G.any,
|
|
394
|
+
handleClick: G.func,
|
|
395
|
+
color: G.string
|
|
387
396
|
};
|
|
388
|
-
const ie = w((s,
|
|
389
|
-
var
|
|
397
|
+
const ie = w((s, x) => {
|
|
398
|
+
var T;
|
|
390
399
|
const {
|
|
391
|
-
yearsText:
|
|
392
|
-
heightText:
|
|
400
|
+
yearsText: m,
|
|
401
|
+
heightText: t,
|
|
393
402
|
weightText: l,
|
|
394
403
|
genderText: c = "Gender",
|
|
395
404
|
calculateText: n = "Calculate",
|
|
@@ -400,80 +409,80 @@ const ie = w((s, f) => {
|
|
|
400
409
|
{ name: "Male", icon: "mng-lnc-male-02", value: "male" },
|
|
401
410
|
{ name: "Female", value: "female", icon: "mng-lnc-female-02" }
|
|
402
411
|
],
|
|
403
|
-
activityLevels:
|
|
412
|
+
activityLevels: g = [
|
|
404
413
|
{ name: "Very low", code: "veryLow" },
|
|
405
414
|
{ name: "Moderate", code: "moderate" },
|
|
406
415
|
{ name: "Very active", code: "veryActive" }
|
|
407
416
|
],
|
|
408
|
-
activityLevelText:
|
|
409
|
-
goalText:
|
|
410
|
-
goals:
|
|
417
|
+
activityLevelText: u,
|
|
418
|
+
goalText: v,
|
|
419
|
+
goals: f = [
|
|
411
420
|
{ name: "Lose weight", code: "loseWeight", icon: "mng-lnc-weight-scale" },
|
|
412
421
|
{ name: "Maintaining", code: "maintaining", icon: "mng-lnc-move" },
|
|
413
422
|
{ name: "Gain muscle", code: "gainMuscle", icon: "mng-lnc-muscule" }
|
|
414
423
|
],
|
|
415
|
-
onCalculate:
|
|
424
|
+
onCalculate: p = () => {
|
|
416
425
|
}
|
|
417
|
-
} = s,
|
|
426
|
+
} = s, d = Y({
|
|
418
427
|
year: null,
|
|
419
428
|
height: null,
|
|
420
429
|
weight: null,
|
|
421
|
-
gender: (
|
|
430
|
+
gender: (T = o == null ? void 0 : o.at(0)) == null ? void 0 : T.value,
|
|
422
431
|
activityLevel: null,
|
|
423
432
|
goal: null
|
|
424
433
|
}), k = () => {
|
|
425
|
-
|
|
434
|
+
p == null || p(d == null ? void 0 : d.current);
|
|
426
435
|
};
|
|
427
436
|
return /* @__PURE__ */ i(U, { children: [
|
|
428
437
|
/* @__PURE__ */ i(ee, { className: "calorie-calculating", children: [
|
|
429
|
-
/* @__PURE__ */
|
|
430
|
-
/* @__PURE__ */
|
|
438
|
+
/* @__PURE__ */ a("div", { className: "grid-label", children: c }),
|
|
439
|
+
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
|
|
431
440
|
I,
|
|
432
441
|
{
|
|
433
442
|
items: o,
|
|
434
|
-
onChange: (
|
|
443
|
+
onChange: (h) => d.current.gender = h
|
|
435
444
|
}
|
|
436
445
|
) }),
|
|
437
|
-
/* @__PURE__ */
|
|
446
|
+
/* @__PURE__ */ a(
|
|
438
447
|
re,
|
|
439
448
|
{
|
|
440
|
-
text:
|
|
441
|
-
onChange: (
|
|
449
|
+
text: m,
|
|
450
|
+
onChange: (h) => d.current.year = h
|
|
442
451
|
}
|
|
443
452
|
),
|
|
444
|
-
/* @__PURE__ */
|
|
453
|
+
/* @__PURE__ */ a(
|
|
445
454
|
le,
|
|
446
455
|
{
|
|
447
|
-
text:
|
|
448
|
-
onChange: (
|
|
456
|
+
text: t,
|
|
457
|
+
onChange: (h) => d.current.height = h
|
|
449
458
|
}
|
|
450
459
|
),
|
|
451
|
-
/* @__PURE__ */
|
|
460
|
+
/* @__PURE__ */ a(
|
|
452
461
|
ce,
|
|
453
462
|
{
|
|
454
463
|
text: l,
|
|
455
|
-
onChange: (
|
|
464
|
+
onChange: (h) => d.current.weight = h
|
|
456
465
|
}
|
|
457
466
|
),
|
|
458
|
-
/* @__PURE__ */
|
|
467
|
+
/* @__PURE__ */ a(
|
|
459
468
|
oe,
|
|
460
469
|
{
|
|
461
|
-
text:
|
|
462
|
-
activityLevels:
|
|
463
|
-
onChange: (
|
|
470
|
+
text: u,
|
|
471
|
+
activityLevels: g,
|
|
472
|
+
onChange: (h) => d.current.activityLevel = h
|
|
464
473
|
}
|
|
465
474
|
),
|
|
466
|
-
/* @__PURE__ */
|
|
475
|
+
/* @__PURE__ */ a(
|
|
467
476
|
se,
|
|
468
477
|
{
|
|
469
|
-
text:
|
|
470
|
-
goals:
|
|
471
|
-
onChange: (
|
|
478
|
+
text: v,
|
|
479
|
+
goals: f,
|
|
480
|
+
onChange: (h) => d.current.goal = h
|
|
472
481
|
}
|
|
473
482
|
)
|
|
474
483
|
] }),
|
|
475
484
|
/* @__PURE__ */ i("div", { className: "btns-footer", children: [
|
|
476
|
-
/* @__PURE__ */
|
|
485
|
+
/* @__PURE__ */ a(
|
|
477
486
|
S,
|
|
478
487
|
{
|
|
479
488
|
type: "button",
|
|
@@ -485,7 +494,7 @@ const ie = w((s, f) => {
|
|
|
485
494
|
children: n
|
|
486
495
|
}
|
|
487
496
|
),
|
|
488
|
-
/* @__PURE__ */
|
|
497
|
+
/* @__PURE__ */ a(
|
|
489
498
|
S,
|
|
490
499
|
{
|
|
491
500
|
type: "button",
|
|
@@ -498,14 +507,14 @@ const ie = w((s, f) => {
|
|
|
498
507
|
)
|
|
499
508
|
] })
|
|
500
509
|
] });
|
|
501
|
-
}), re = w((s,
|
|
502
|
-
const { text:
|
|
510
|
+
}), re = w((s, x) => {
|
|
511
|
+
const { text: m = "Years", onChange: t = () => {
|
|
503
512
|
} } = s, [l, c] = N(1);
|
|
504
513
|
return /* @__PURE__ */ i(z, { children: [
|
|
505
|
-
/* @__PURE__ */
|
|
514
|
+
/* @__PURE__ */ a("div", { className: "grid-label", children: m }),
|
|
506
515
|
/* @__PURE__ */ i("div", { className: "caluclating-group", children: [
|
|
507
|
-
/* @__PURE__ */
|
|
508
|
-
|
|
516
|
+
/* @__PURE__ */ a(
|
|
517
|
+
A,
|
|
509
518
|
{
|
|
510
519
|
className: "range-input-lnc",
|
|
511
520
|
max: 115,
|
|
@@ -516,39 +525,39 @@ const ie = w((s, f) => {
|
|
|
516
525
|
defaultValue: 0,
|
|
517
526
|
onChange: (n) => {
|
|
518
527
|
var e, r;
|
|
519
|
-
c((e = n == null ? void 0 : n.target) == null ? void 0 : e.value),
|
|
528
|
+
c((e = n == null ? void 0 : n.target) == null ? void 0 : e.value), t == null || t((r = n == null ? void 0 : n.target) == null ? void 0 : r.value);
|
|
520
529
|
}
|
|
521
530
|
}
|
|
522
531
|
),
|
|
523
|
-
/* @__PURE__ */
|
|
532
|
+
/* @__PURE__ */ a(
|
|
524
533
|
"input",
|
|
525
534
|
{
|
|
526
535
|
tabIndex: 2,
|
|
527
536
|
type: "text",
|
|
528
537
|
className: "calculating-input",
|
|
529
538
|
onChange: (n) => {
|
|
530
|
-
var e, r, o,
|
|
531
|
-
!isNaN((e = n == null ? void 0 : n.target) == null ? void 0 : e.value) && +((r = n == null ? void 0 : n.target) == null ? void 0 : r.value) >= 0 && c(
|
|
532
|
-
((
|
|
533
|
-
);
|
|
539
|
+
var e, r, o, g, u, v, f, p;
|
|
540
|
+
!isNaN((e = n == null ? void 0 : n.target) == null ? void 0 : e.value) && +((r = n == null ? void 0 : n.target) == null ? void 0 : r.value) >= 0 && (c(
|
|
541
|
+
((g = (o = n == null ? void 0 : n.target) == null ? void 0 : o.value) == null ? void 0 : g.length) > 1 ? (v = (u = n == null ? void 0 : n.target) == null ? void 0 : u.value) == null ? void 0 : v.replace(/^0+/, "") : (f = n == null ? void 0 : n.target) == null ? void 0 : f.value
|
|
542
|
+
), t == null || t((p = n == null ? void 0 : n.target) == null ? void 0 : p.value));
|
|
534
543
|
},
|
|
535
544
|
value: l == null ? void 0 : l.toString()
|
|
536
545
|
}
|
|
537
546
|
)
|
|
538
547
|
] })
|
|
539
548
|
] });
|
|
540
|
-
}), le = w((s,
|
|
541
|
-
const { text:
|
|
549
|
+
}), le = w((s, x) => {
|
|
550
|
+
const { text: m = "Height", unitText: t = "cm", onChange: l = () => {
|
|
542
551
|
} } = s, [c, n] = N(1);
|
|
543
552
|
return /* @__PURE__ */ i(z, { children: [
|
|
544
553
|
/* @__PURE__ */ i("div", { className: "grid-label", children: [
|
|
545
|
-
|
|
554
|
+
m,
|
|
546
555
|
" ",
|
|
547
|
-
/* @__PURE__ */
|
|
556
|
+
/* @__PURE__ */ a("span", { className: "unit", children: `(${t})` })
|
|
548
557
|
] }),
|
|
549
558
|
/* @__PURE__ */ i("div", { className: "caluclating-group", children: [
|
|
550
|
-
/* @__PURE__ */
|
|
551
|
-
|
|
559
|
+
/* @__PURE__ */ a(
|
|
560
|
+
A,
|
|
552
561
|
{
|
|
553
562
|
className: "range-input-lnc",
|
|
554
563
|
max: 273,
|
|
@@ -563,35 +572,35 @@ const ie = w((s, f) => {
|
|
|
563
572
|
}
|
|
564
573
|
}
|
|
565
574
|
),
|
|
566
|
-
/* @__PURE__ */
|
|
575
|
+
/* @__PURE__ */ a(
|
|
567
576
|
"input",
|
|
568
577
|
{
|
|
569
578
|
type: "text",
|
|
570
579
|
tabIndex: 2,
|
|
571
580
|
className: "calculating-input",
|
|
572
581
|
onChange: (e) => {
|
|
573
|
-
var r, o,
|
|
574
|
-
!isNaN((r = e == null ? void 0 : e.target) == null ? void 0 : r.value) && +((o = e == null ? void 0 : e.target) == null ? void 0 : o.value) >= 0 && n(
|
|
575
|
-
((
|
|
576
|
-
);
|
|
582
|
+
var r, o, g, u, v, f, p, d;
|
|
583
|
+
!isNaN((r = e == null ? void 0 : e.target) == null ? void 0 : r.value) && +((o = e == null ? void 0 : e.target) == null ? void 0 : o.value) >= 0 && (n(
|
|
584
|
+
((u = (g = e == null ? void 0 : e.target) == null ? void 0 : g.value) == null ? void 0 : u.length) > 1 ? (f = (v = e == null ? void 0 : e.target) == null ? void 0 : v.value) == null ? void 0 : f.replace(/^0+/, "") : (p = e == null ? void 0 : e.target) == null ? void 0 : p.value
|
|
585
|
+
), l == null || l((d = e == null ? void 0 : e.target) == null ? void 0 : d.value));
|
|
577
586
|
},
|
|
578
587
|
value: c == null ? void 0 : c.toString()
|
|
579
588
|
}
|
|
580
589
|
)
|
|
581
590
|
] })
|
|
582
591
|
] });
|
|
583
|
-
}), ce = w((s,
|
|
584
|
-
const { text:
|
|
592
|
+
}), ce = w((s, x) => {
|
|
593
|
+
const { text: m = "Weight", unitText: t = "cm", onChange: l = () => {
|
|
585
594
|
} } = s, [c, n] = N(1);
|
|
586
595
|
return /* @__PURE__ */ i(z, { children: [
|
|
587
596
|
/* @__PURE__ */ i("div", { className: "grid-label", children: [
|
|
588
|
-
|
|
597
|
+
m,
|
|
589
598
|
" ",
|
|
590
|
-
/* @__PURE__ */
|
|
599
|
+
/* @__PURE__ */ a("span", { className: "unit", children: `(${t})` })
|
|
591
600
|
] }),
|
|
592
601
|
/* @__PURE__ */ i("div", { className: "caluclating-group", children: [
|
|
593
|
-
/* @__PURE__ */
|
|
594
|
-
|
|
602
|
+
/* @__PURE__ */ a(
|
|
603
|
+
A,
|
|
595
604
|
{
|
|
596
605
|
className: "range-input-lnc",
|
|
597
606
|
max: 400,
|
|
@@ -606,33 +615,33 @@ const ie = w((s, f) => {
|
|
|
606
615
|
}
|
|
607
616
|
}
|
|
608
617
|
),
|
|
609
|
-
/* @__PURE__ */
|
|
618
|
+
/* @__PURE__ */ a(
|
|
610
619
|
"input",
|
|
611
620
|
{
|
|
612
621
|
tabIndex: 2,
|
|
613
622
|
type: "text",
|
|
614
623
|
className: "calculating-input",
|
|
615
624
|
onChange: (e) => {
|
|
616
|
-
var r, o,
|
|
617
|
-
!isNaN((r = e == null ? void 0 : e.target) == null ? void 0 : r.value) && +((o = e == null ? void 0 : e.target) == null ? void 0 : o.value) >= 0 && n(
|
|
618
|
-
((
|
|
619
|
-
);
|
|
625
|
+
var r, o, g, u, v, f, p, d;
|
|
626
|
+
!isNaN((r = e == null ? void 0 : e.target) == null ? void 0 : r.value) && +((o = e == null ? void 0 : e.target) == null ? void 0 : o.value) >= 0 && (n(
|
|
627
|
+
((u = (g = e == null ? void 0 : e.target) == null ? void 0 : g.value) == null ? void 0 : u.length) > 1 ? (f = (v = e == null ? void 0 : e.target) == null ? void 0 : v.value) == null ? void 0 : f.replace(/^0+/, "") : (p = e == null ? void 0 : e.target) == null ? void 0 : p.value
|
|
628
|
+
), l == null || l((d = e == null ? void 0 : e.target) == null ? void 0 : d.value));
|
|
620
629
|
},
|
|
621
630
|
value: c == null ? void 0 : c.toString()
|
|
622
631
|
}
|
|
623
632
|
)
|
|
624
633
|
] })
|
|
625
634
|
] });
|
|
626
|
-
}), oe = w((s,
|
|
635
|
+
}), oe = w((s, x) => {
|
|
627
636
|
const {
|
|
628
|
-
text:
|
|
629
|
-
activityLevels:
|
|
637
|
+
text: m = "Activity level",
|
|
638
|
+
activityLevels: t,
|
|
630
639
|
onChange: l = () => {
|
|
631
640
|
}
|
|
632
641
|
} = s, [c, n] = N(null);
|
|
633
642
|
return /* @__PURE__ */ i(z, { children: [
|
|
634
|
-
/* @__PURE__ */
|
|
635
|
-
/* @__PURE__ */
|
|
643
|
+
/* @__PURE__ */ a("div", { className: "grid-label", children: m }),
|
|
644
|
+
/* @__PURE__ */ a("div", { className: "caluclating-group", children: t == null ? void 0 : t.map((e, r) => /* @__PURE__ */ a(
|
|
636
645
|
S,
|
|
637
646
|
{
|
|
638
647
|
type: "button",
|
|
@@ -647,12 +656,12 @@ const ie = w((s, f) => {
|
|
|
647
656
|
r
|
|
648
657
|
)) })
|
|
649
658
|
] });
|
|
650
|
-
}), se = w((s,
|
|
651
|
-
const { text:
|
|
659
|
+
}), se = w((s, x) => {
|
|
660
|
+
const { text: m = "Goal", goals: t, onChange: l = () => {
|
|
652
661
|
} } = s, [c, n] = N(null);
|
|
653
662
|
return /* @__PURE__ */ i(z, { children: [
|
|
654
|
-
/* @__PURE__ */
|
|
655
|
-
/* @__PURE__ */
|
|
663
|
+
/* @__PURE__ */ a("div", { className: "grid-label", children: m }),
|
|
664
|
+
/* @__PURE__ */ a("div", { className: "caluclating-group group-activity", children: t == null ? void 0 : t.map((e, r) => /* @__PURE__ */ a(
|
|
656
665
|
S,
|
|
657
666
|
{
|
|
658
667
|
type: "button",
|
|
@@ -663,77 +672,77 @@ const ie = w((s, f) => {
|
|
|
663
672
|
n(e == null ? void 0 : e.code), l(e == null ? void 0 : e.code);
|
|
664
673
|
},
|
|
665
674
|
children: /* @__PURE__ */ i("div", { className: "btn-cnt", children: [
|
|
666
|
-
/* @__PURE__ */
|
|
667
|
-
/* @__PURE__ */
|
|
675
|
+
/* @__PURE__ */ a("i", { className: e == null ? void 0 : e.icon }),
|
|
676
|
+
/* @__PURE__ */ a("span", { children: e == null ? void 0 : e.name })
|
|
668
677
|
] })
|
|
669
678
|
},
|
|
670
679
|
r
|
|
671
680
|
)) })
|
|
672
681
|
] });
|
|
673
|
-
}), de = w((s,
|
|
682
|
+
}), de = w((s, x) => {
|
|
674
683
|
const {
|
|
675
|
-
caloriesText:
|
|
676
|
-
carbsText:
|
|
684
|
+
caloriesText: m = "Calories",
|
|
685
|
+
carbsText: t = "Carbs",
|
|
677
686
|
proteinText: l = "Protein",
|
|
678
687
|
fatsText: c = "Fats",
|
|
679
688
|
calculateAgainText: n = "Calculate again",
|
|
680
689
|
calories: e,
|
|
681
690
|
carbs: r,
|
|
682
691
|
protein: o,
|
|
683
|
-
fats:
|
|
684
|
-
onGoBack:
|
|
692
|
+
fats: g,
|
|
693
|
+
onGoBack: u = () => {
|
|
685
694
|
}
|
|
686
695
|
} = s;
|
|
687
696
|
return /* @__PURE__ */ i(te, { children: [
|
|
688
697
|
/* @__PURE__ */ i(ae, { children: [
|
|
689
698
|
/* @__PURE__ */ i(R, { color: "var(--warning-600)", children: [
|
|
690
|
-
/* @__PURE__ */
|
|
699
|
+
/* @__PURE__ */ a("i", { className: "mng-lnc-fire" }),
|
|
691
700
|
/* @__PURE__ */ i("div", { className: "subgroup", children: [
|
|
692
701
|
/* @__PURE__ */ i("div", { children: [
|
|
693
702
|
e,
|
|
694
703
|
" kcal"
|
|
695
704
|
] }),
|
|
696
|
-
/* @__PURE__ */
|
|
705
|
+
/* @__PURE__ */ a("div", { className: "subtext", children: m })
|
|
697
706
|
] })
|
|
698
707
|
] }),
|
|
699
708
|
/* @__PURE__ */ i(R, { color: "var(--secondary-400)", children: [
|
|
700
|
-
/* @__PURE__ */
|
|
709
|
+
/* @__PURE__ */ a("i", { className: "mng-lnc-leaf" }),
|
|
701
710
|
/* @__PURE__ */ i("div", { className: "subgroup", children: [
|
|
702
711
|
/* @__PURE__ */ i("div", { children: [
|
|
703
712
|
r,
|
|
704
713
|
"g"
|
|
705
714
|
] }),
|
|
706
|
-
/* @__PURE__ */
|
|
715
|
+
/* @__PURE__ */ a("div", { className: "subtext", children: t })
|
|
707
716
|
] })
|
|
708
717
|
] }),
|
|
709
718
|
/* @__PURE__ */ i(R, { color: "var(--info-500)", children: [
|
|
710
|
-
/* @__PURE__ */
|
|
719
|
+
/* @__PURE__ */ a("i", { className: "mng-lnc-meat" }),
|
|
711
720
|
/* @__PURE__ */ i("div", { className: "subgroup", children: [
|
|
712
721
|
/* @__PURE__ */ i("div", { children: [
|
|
713
722
|
o,
|
|
714
723
|
"g"
|
|
715
724
|
] }),
|
|
716
|
-
/* @__PURE__ */
|
|
725
|
+
/* @__PURE__ */ a("div", { className: "subtext", children: l })
|
|
717
726
|
] })
|
|
718
727
|
] }),
|
|
719
728
|
/* @__PURE__ */ i(R, { color: "var(--warning-300)", children: [
|
|
720
|
-
/* @__PURE__ */
|
|
729
|
+
/* @__PURE__ */ a("i", { className: "mng-lnc-meat" }),
|
|
721
730
|
/* @__PURE__ */ i("div", { className: "subgroup", children: [
|
|
722
731
|
/* @__PURE__ */ i("div", { children: [
|
|
723
|
-
|
|
732
|
+
g,
|
|
724
733
|
"g"
|
|
725
734
|
] }),
|
|
726
|
-
/* @__PURE__ */
|
|
735
|
+
/* @__PURE__ */ a("div", { className: "subtext", children: c })
|
|
727
736
|
] })
|
|
728
737
|
] })
|
|
729
738
|
] }),
|
|
730
739
|
/* @__PURE__ */ i("div", { className: "dropdown-group", children: [
|
|
731
|
-
/* @__PURE__ */
|
|
732
|
-
/* @__PURE__ */
|
|
740
|
+
/* @__PURE__ */ a("div", { className: "vertical-line" }),
|
|
741
|
+
/* @__PURE__ */ a(
|
|
733
742
|
K,
|
|
734
743
|
{
|
|
735
744
|
color: "neutral",
|
|
736
|
-
control: /* @__PURE__ */
|
|
745
|
+
control: /* @__PURE__ */ a(
|
|
737
746
|
X,
|
|
738
747
|
{
|
|
739
748
|
borderRadius: "curved",
|
|
@@ -746,68 +755,68 @@ const ie = w((s, f) => {
|
|
|
746
755
|
),
|
|
747
756
|
offsetValue: -10,
|
|
748
757
|
placement: "bottom-end",
|
|
749
|
-
children: /* @__PURE__ */
|
|
758
|
+
children: /* @__PURE__ */ a(_, { icon: "star", onClick: u, children: n })
|
|
750
759
|
}
|
|
751
760
|
)
|
|
752
761
|
] })
|
|
753
762
|
] });
|
|
754
|
-
}), me = w((s,
|
|
763
|
+
}), me = w((s, x) => {
|
|
755
764
|
const {
|
|
756
|
-
caloriesText:
|
|
757
|
-
carbsText:
|
|
765
|
+
caloriesText: m,
|
|
766
|
+
carbsText: t,
|
|
758
767
|
proteinText: l,
|
|
759
768
|
fatsText: c,
|
|
760
769
|
calculateAgainText: n,
|
|
761
770
|
yearsText: e,
|
|
762
771
|
heightText: r,
|
|
763
772
|
weightText: o,
|
|
764
|
-
genderText:
|
|
765
|
-
calculateText:
|
|
766
|
-
closeText:
|
|
767
|
-
genders:
|
|
768
|
-
activityLevels:
|
|
769
|
-
activityLevelText:
|
|
773
|
+
genderText: g,
|
|
774
|
+
calculateText: u,
|
|
775
|
+
closeText: v,
|
|
776
|
+
genders: f,
|
|
777
|
+
activityLevels: p,
|
|
778
|
+
activityLevelText: d,
|
|
770
779
|
goalText: k,
|
|
771
|
-
goals:
|
|
772
|
-
title:
|
|
773
|
-
subtitle:
|
|
774
|
-
list:
|
|
780
|
+
goals: T,
|
|
781
|
+
title: h = "Daily calorie calculator",
|
|
782
|
+
subtitle: j = "Lorem ipsum dolor sit amet",
|
|
783
|
+
list: L = [
|
|
775
784
|
"Ovdje može pisati zašto je bitno da znamo kolika nam je dnevna kalorijska potreba.",
|
|
776
785
|
"Ovdje može pisati zašto je bitno da znamo kolikanam je dnevna kalorijska potreba.",
|
|
777
786
|
"From certified dealers from all over Europe"
|
|
778
787
|
],
|
|
779
788
|
buttonText: M = "Calculate calorie needs"
|
|
780
789
|
} = s, [W, $] = N(1), [b, B] = N(0);
|
|
781
|
-
return /* @__PURE__ */ i(J, { ref:
|
|
790
|
+
return /* @__PURE__ */ i(J, { ref: x, children: [
|
|
782
791
|
/* @__PURE__ */ i(Q, { children: [
|
|
783
|
-
/* @__PURE__ */
|
|
784
|
-
/* @__PURE__ */
|
|
792
|
+
/* @__PURE__ */ a("div", { className: "header-title", children: h }),
|
|
793
|
+
/* @__PURE__ */ a("div", { className: "header-subtitle", children: j })
|
|
785
794
|
] }),
|
|
786
|
-
W === 1 && /* @__PURE__ */
|
|
795
|
+
W === 1 && /* @__PURE__ */ a(
|
|
787
796
|
Z,
|
|
788
797
|
{
|
|
789
798
|
buttonText: M,
|
|
790
799
|
onButtonAction: () => {
|
|
791
800
|
$(2);
|
|
792
801
|
},
|
|
793
|
-
list:
|
|
802
|
+
list: L
|
|
794
803
|
}
|
|
795
804
|
),
|
|
796
|
-
W === 2 && /* @__PURE__ */
|
|
805
|
+
W === 2 && /* @__PURE__ */ a(
|
|
797
806
|
ie,
|
|
798
807
|
{
|
|
799
808
|
yearsText: e,
|
|
800
809
|
heightText: r,
|
|
801
810
|
weightText: o,
|
|
802
|
-
genderText:
|
|
803
|
-
calculateText:
|
|
804
|
-
closeText:
|
|
811
|
+
genderText: g,
|
|
812
|
+
calculateText: u,
|
|
813
|
+
closeText: v,
|
|
805
814
|
onClose: () => $(1),
|
|
806
|
-
genders:
|
|
807
|
-
activityLevels:
|
|
808
|
-
activityLevelText:
|
|
815
|
+
genders: f,
|
|
816
|
+
activityLevels: p,
|
|
817
|
+
activityLevelText: d,
|
|
809
818
|
goalText: k,
|
|
810
|
-
goals:
|
|
819
|
+
goals: T,
|
|
811
820
|
onCalculate: ({
|
|
812
821
|
gender: V,
|
|
813
822
|
year: E,
|
|
@@ -828,11 +837,11 @@ const ie = w((s, f) => {
|
|
|
828
837
|
}
|
|
829
838
|
}
|
|
830
839
|
),
|
|
831
|
-
W === 3 && /* @__PURE__ */
|
|
840
|
+
W === 3 && /* @__PURE__ */ a(
|
|
832
841
|
de,
|
|
833
842
|
{
|
|
834
|
-
caloriesText:
|
|
835
|
-
carbsText:
|
|
843
|
+
caloriesText: m,
|
|
844
|
+
carbsText: t,
|
|
836
845
|
proteinText: l,
|
|
837
846
|
fatsText: c,
|
|
838
847
|
calculateAgainText: n,
|
|
@@ -844,7 +853,7 @@ const ie = w((s, f) => {
|
|
|
844
853
|
}
|
|
845
854
|
)
|
|
846
855
|
] });
|
|
847
|
-
}), ke = w((s,
|
|
856
|
+
}), ke = w((s, x) => /* @__PURE__ */ a(me, { ref: x, ...s }));
|
|
848
857
|
export {
|
|
849
858
|
ke as default
|
|
850
859
|
};
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
height: 3rem;
|
|
131
131
|
border-radius: 999px;
|
|
132
132
|
background: ${m.linearGradientAnimation("-90deg")};
|
|
133
|
-
`,E=l.forwardRef(({},t)=>r.jsx(C,{})),W=l.forwardRef(({
|
|
133
|
+
`,E=l.forwardRef(({},t)=>r.jsx(C,{})),W=l.forwardRef(({title:t,icon:i,onSelectCard:a=()=>{}},p)=>r.jsxs(N,{onClick:a,children:[r.jsx(j,{icon:` ${i}`,className:"wrapper__icon"}),r.jsx("div",{className:"wrapper__text",children:t})]})),G=l.forwardRef(({imageUrl:t,imageComponent:i,title:a,onSelectCard:p=()=>{}},c)=>{const{theme:h}=k.useTheme();return r.jsxs($,{ref:c,theme:h,onClick:p,children:[m.isDefined(i)?i:r.jsx("img",{src:t,className:"wrapper__image"}),r.jsx("div",{className:"wrapper__content",children:r.jsx("div",{className:"wrapper__title",children:a})})]})}),R=l.forwardRef(({},t)=>r.jsx(I,{})),q=o.styled.div`
|
|
134
134
|
display: flex;
|
|
135
135
|
flex-direction: column;
|
|
136
136
|
align-items: center;
|
|
@@ -207,4 +207,4 @@
|
|
|
207
207
|
gap: 1rem;
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
-
`,z=l.forwardRef(({title:t,subtitle:i,options:a=[],limitTags:p=7,limitTagsForMobile:c=2,limit:h=3,limitForMobile:b=3,items:n=[],onSelectTag:_=()=>{},onSelectCard:
|
|
210
|
+
`,z=l.forwardRef(({title:t,subtitle:i,options:a=[],limitTags:p=7,limitTagsForMobile:c=2,limit:h=3,limitForMobile:b=3,items:n=[],onSelectTag:_=()=>{},onSelectCard:g=()=>{},isLoading:y},v)=>{var f,u;const w=e=>{_==null||_(e==null?void 0:e.uuid)},x=e=>{g==null||g(e==null?void 0:e.uuid)};return r.jsxs(q,{ref:v,limitTags:p,limitTagsForMobile:c,limitCards:h,limitCardsForMobile:b,children:[r.jsxs("div",{className:"wrapper__heading",children:[t&&r.jsx("div",{className:"wrapper__title",children:t}),i&&r.jsx("div",{className:"wrapper__subtitle",children:i})]}),r.jsx("div",{className:"wrapper__cards",children:n&&(n==null?void 0:n.length)>0?n==null?void 0:n.map((e,s)=>r.jsx(G,{imageUrl:e==null?void 0:e.imageUrl,imageComponent:e==null?void 0:e.imageComponent,title:e==null?void 0:e.title,onSelectCard:()=>x==null?void 0:x(e==null?void 0:e.uuid)},`general-with-tags-card__${s+1}`)):(f=Array.from("123"))==null?void 0:f.map((e,s)=>r.jsx(R,{},`general-with-tags-card-skeleton__${s+1}`))}),(a==null?void 0:a.length)>0&&r.jsx("div",{className:"wrapper__tags",children:a==null?void 0:a.map((e,s)=>r.jsx(W,{icon:e==null?void 0:e.icon,title:e==null?void 0:e.title,onSelectCard:()=>w==null?void 0:w(e)},`general-with-tags-card-tag__${s+1}`))}),y===!0&&!((a==null?void 0:a.length)>0)&&r.jsx("div",{className:"wrapper__tags",children:(u=Array.from("123"))==null?void 0:u.map((e,s)=>r.jsx(E,{},`general-with-tags-card-tag-skeleton__${s+1}`))})]})});module.exports=z;
|
|
@@ -138,14 +138,14 @@ const j = s.div`
|
|
|
138
138
|
border-radius: 999px;
|
|
139
139
|
background: ${b("-90deg")};
|
|
140
140
|
`, I = o(({}, r) => /* @__PURE__ */ a(T, {})), M = o(
|
|
141
|
-
({
|
|
141
|
+
({ title: r, icon: i, onSelectCard: t = () => {
|
|
142
142
|
} }, p) => /* @__PURE__ */ m(z, { onClick: t, children: [
|
|
143
143
|
/* @__PURE__ */ a(C, { icon: ` ${i}`, className: "wrapper__icon" }),
|
|
144
144
|
/* @__PURE__ */ a("div", { className: "wrapper__text", children: r })
|
|
145
145
|
] })
|
|
146
146
|
), A = o(
|
|
147
147
|
// eslint-disable-next-line react/prop-types
|
|
148
|
-
({
|
|
148
|
+
({ imageUrl: r, imageComponent: i, title: t, onSelectCard: p = () => {
|
|
149
149
|
} }, c) => {
|
|
150
150
|
const { theme: h } = W();
|
|
151
151
|
return /* @__PURE__ */ m(j, { ref: c, theme: h, onClick: p, children: [
|
|
@@ -268,7 +268,7 @@ const j = s.div`
|
|
|
268
268
|
/* @__PURE__ */ a("div", { className: "wrapper__cards", children: n && (n == null ? void 0 : n.length) > 0 ? n == null ? void 0 : n.map((e, l) => /* @__PURE__ */ a(
|
|
269
269
|
A,
|
|
270
270
|
{
|
|
271
|
-
|
|
271
|
+
imageUrl: e == null ? void 0 : e.imageUrl,
|
|
272
272
|
imageComponent: e == null ? void 0 : e.imageComponent,
|
|
273
273
|
title: e == null ? void 0 : e.title,
|
|
274
274
|
onSelectCard: () => f == null ? void 0 : f(e == null ? void 0 : e.uuid)
|
|
@@ -283,7 +283,7 @@ const j = s.div`
|
|
|
283
283
|
M,
|
|
284
284
|
{
|
|
285
285
|
icon: e == null ? void 0 : e.icon,
|
|
286
|
-
|
|
286
|
+
title: e == null ? void 0 : e.title,
|
|
287
287
|
onSelectCard: () => _ == null ? void 0 : _(e)
|
|
288
288
|
},
|
|
289
289
|
`general-with-tags-card-tag__${l + 1}`
|
package/dist/QuizSection.cjs
CHANGED
|
@@ -392,4 +392,4 @@
|
|
|
392
392
|
display: none;
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
|
-
`,ie=i.forwardRef(({title:g,subtitle:c,endTitle:f,endDescription:x,imageUrl:h,imageComponent:n,questions:r,secondsPerQuestion:C,numberOfCredits:z,startQuizText:Q="Start quiz",nextText:U="Next",giveUpText:Z="Give up",questionNoText:L="Question",continueText:$="Continue",endQuizText:o="End quiz",onStartQuiz:R=()=>{},onSelectAnswer:p=()=>{},onGiveUp:b=()=>{},onNext:u=()=>{},onContinue:E=()=>{},onEndQuiz:w=()=>{}},W)=>{const[d,a]=i.useState(l.START_QUIZ),[m,v]=i.useState(
|
|
395
|
+
`,ie=i.forwardRef(({title:g,subtitle:c,endTitle:f,endDescription:x,imageUrl:h,imageComponent:n,questions:r,secondsPerQuestion:C,numberOfCredits:z,startQuizText:Q="Start quiz",nextText:U="Next",giveUpText:Z="Give up",questionNoText:L="Question",continueText:$="Continue",endQuizText:o="End quiz",onStartQuiz:R=()=>{},onSelectAnswer:p=()=>{},onGiveUp:b=()=>{},onNext:u=()=>{},onContinue:E=()=>{},onEndQuiz:w=()=>{}},W)=>{const[d,a]=i.useState(l.START_QUIZ),[m,v]=i.useState(0),[t,D]=i.useState(null),[O,y]=i.useState(null),[P,j]=i.useState(null),A=i.useRef([]),I=i.useRef(0),B=()=>{var s;a(l.QUIZ),D((s=r==null?void 0:r.at)==null?void 0:s.call(r,m)),R==null||R()},X=(s,S)=>{j(S),y(s),p==null||p()},F=()=>{a(l.START_QUIZ),v(0),y(null),j(null),b==null||b()},G=()=>{var S;const s=P===(t==null?void 0:t.correctAnswerIndex);s?(a(l.CORRECT_ANSWER),I.current+=z||(t==null?void 0:t.numberOfCredits)):m===(r==null?void 0:r.length)-1?(a(l.START_QUIZ),v(0),y(null),j(null)):(v(m+1),D((S=r==null?void 0:r.at)==null?void 0:S.call(r,m+1)),y(null),j(null)),A.current=[...A.current,{question:t,selectedAnswer:O,isCorrect:s}],u==null||u()},H=()=>{var s;m===(r==null?void 0:r.length)-1?(a(l.START_QUIZ),v(0)):(a(l.QUIZ),v(m+1),D((s=r==null?void 0:r.at)==null?void 0:s.call(r,m+1))),y(null),j(null),E==null||E(I==null?void 0:I.current)},J=()=>{a(l.START_QUIZ),v(0),y(null),j(null),w==null||w()};return e.jsxs(ae,{ref:W,children:[e.jsxs("div",{className:"wrapper__outlet",children:[d===l.START_QUIZ&&e.jsx(ee,{title:g,description:c,startQuizText:Q,onStartQuiz:B}),d===l.QUIZ&&t&&e.jsx(re,{questionNoText:L,questionNo:m,totalQuestions:(r==null?void 0:r.length)||0,text:t==null?void 0:t.questionText,options:t==null?void 0:t.options,secondsPerQuestion:C||(t==null?void 0:t.secondsPerQuestion),correctAnswerIndex:t==null?void 0:t.correctAnswerIndex,selectedAnswer:O,nextText:U,giveUpText:Z,nextDisabled:!N.isDefined(O),onSelectAnswer:X,onGiveUp:F,onNext:G,selectedAnswerIndex:P},`quiz-question__${m}`),d===l.CORRECT_ANSWER&&e.jsx(te,{title:f,description:N.formatString(x,z||(t==null?void 0:t.numberOfCredits)),continueText:$,endQuizText:o,onContinue:H,onEndQuiz:J})]}),N.isDefined(n)?n:e.jsx("img",{src:h,className:"wrapper__image"})]})});module.exports=ie;
|
package/dist/QuizSection.js
CHANGED
|
@@ -634,22 +634,22 @@ const le = E.div`
|
|
|
634
634
|
onEndQuiz: x = () => {
|
|
635
635
|
}
|
|
636
636
|
}, L) => {
|
|
637
|
-
const [m, i] = w(l.START_QUIZ), [d, v] = w(
|
|
637
|
+
const [m, i] = w(l.START_QUIZ), [d, v] = w(0), [a, A] = w(null), [O, y] = w(null), [F, b] = w(null), X = B([]), Q = B(0), J = () => {
|
|
638
638
|
var c;
|
|
639
639
|
i(l.QUIZ), A(
|
|
640
640
|
// questions?.find((question) => question?.questionNo === questionNo)
|
|
641
|
-
(c = e == null ? void 0 : e.at) == null ? void 0 : c.call(e,
|
|
641
|
+
(c = e == null ? void 0 : e.at) == null ? void 0 : c.call(e, d)
|
|
642
642
|
), N == null || N();
|
|
643
643
|
}, K = (c, S) => {
|
|
644
644
|
b(S), y(c), p == null || p();
|
|
645
645
|
}, V = () => {
|
|
646
|
-
i(l.START_QUIZ), v(
|
|
646
|
+
i(l.START_QUIZ), v(0), y(null), b(null), k == null || k();
|
|
647
647
|
}, Y = () => {
|
|
648
648
|
var S;
|
|
649
649
|
const c = F === (a == null ? void 0 : a.correctAnswerIndex);
|
|
650
|
-
c ? (i(l.CORRECT_ANSWER), Q.current += C || (a == null ? void 0 : a.numberOfCredits)) : d === (e == null ? void 0 : e.length) ? (i(l.START_QUIZ), v(
|
|
650
|
+
c ? (i(l.CORRECT_ANSWER), Q.current += C || (a == null ? void 0 : a.numberOfCredits)) : d === (e == null ? void 0 : e.length) - 1 ? (i(l.START_QUIZ), v(0), y(null), b(null)) : (v(d + 1), A(
|
|
651
651
|
// questions?.find((question) => question?.questionNo === questionNo + 1)
|
|
652
|
-
(S = e == null ? void 0 : e.at) == null ? void 0 : S.call(e,
|
|
652
|
+
(S = e == null ? void 0 : e.at) == null ? void 0 : S.call(e, d + 1)
|
|
653
653
|
), y(null), b(null)), X.current = [
|
|
654
654
|
...X.current,
|
|
655
655
|
{
|
|
@@ -660,12 +660,12 @@ const le = E.div`
|
|
|
660
660
|
], u == null || u();
|
|
661
661
|
}, q = () => {
|
|
662
662
|
var c;
|
|
663
|
-
d === (e == null ? void 0 : e.length) ? (i(l.START_QUIZ), v(
|
|
663
|
+
d === (e == null ? void 0 : e.length) - 1 ? (i(l.START_QUIZ), v(0)) : (i(l.QUIZ), v(d + 1), A(
|
|
664
664
|
// questions?.find((question) => question?.questionNo === questionNo + 1)
|
|
665
|
-
(c = e == null ? void 0 : e.at) == null ? void 0 : c.call(e,
|
|
665
|
+
(c = e == null ? void 0 : e.at) == null ? void 0 : c.call(e, d + 1)
|
|
666
666
|
)), y(null), b(null), T == null || T(Q == null ? void 0 : Q.current);
|
|
667
667
|
}, ee = () => {
|
|
668
|
-
i(l.START_QUIZ), v(
|
|
668
|
+
i(l.START_QUIZ), v(0), y(null), b(null), x == null || x();
|
|
669
669
|
};
|
|
670
670
|
return /* @__PURE__ */ t(de, { ref: L, children: [
|
|
671
671
|
/* @__PURE__ */ t("div", { className: "wrapper__outlet", children: [
|