@lanaco/lnc-react-ui 4.0.72 → 4.0.73
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.
|
@@ -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: [
|