@lanaco/lnc-react-ui 4.0.32 → 4.0.34
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/dist/Accordion.cjs +1 -1
- package/dist/Accordion.js +1 -1
- package/dist/AccordionSummary.cjs +1 -1
- package/dist/AccordionSummary.js +1 -1
- package/dist/ActionsToolbar.cjs +1 -1
- package/dist/ActionsToolbar.js +1 -1
- package/dist/Alert.cjs +1 -1
- package/dist/Alert.js +1 -1
- package/dist/Avatar.cjs +1 -1
- package/dist/Avatar.js +1 -1
- package/dist/Badge.cjs +1 -1
- package/dist/Badge.js +1 -1
- package/dist/BannerSectionBasic.cjs +1 -1
- package/dist/BannerSectionBasic.js +1 -1
- package/dist/BannerSectionCarousel.cjs +1 -1
- package/dist/BannerSectionCarousel.js +2 -2
- package/dist/BannerSectionGrid.cjs +1 -1
- package/dist/BannerSectionGrid.js +3 -3
- package/dist/BannerSectionSimple.cjs +1 -1
- package/dist/BannerSectionSimple.js +2 -2
- package/dist/BannerSectionWithList.cjs +1 -1
- package/dist/BannerSectionWithList.js +2 -2
- package/dist/BannerSectionWithListImage.cjs +1 -1
- package/dist/BannerSectionWithListImage.js +1 -1
- package/dist/BlogsSectionDetailed.cjs +111 -0
- package/dist/BlogsSectionDetailed.js +224 -0
- package/dist/BlogsSectionLarge.cjs +101 -0
- package/dist/BlogsSectionLarge.js +177 -0
- package/dist/BlogsSectionSimple.cjs +71 -0
- package/dist/BlogsSectionSimple.js +158 -0
- package/dist/BlogsSectionSimpleCentered.cjs +78 -0
- package/dist/BlogsSectionSimpleCentered.js +149 -0
- package/dist/BlogsSectionWithFilters.cjs +173 -0
- package/dist/BlogsSectionWithFilters.js +559 -0
- package/dist/BrandHitsSection.cjs +11 -7
- package/dist/BrandHitsSection.js +10 -6
- package/dist/Breadcrumbs.cjs +1 -1
- package/dist/Breadcrumbs.js +1 -1
- package/dist/Button.cjs +1 -1
- package/dist/Button.js +1 -1
- package/dist/ButtonGroup.cjs +1 -1
- package/dist/ButtonGroup.js +1 -1
- package/dist/CheckBoxInput.cjs +1 -1
- package/dist/CheckBoxInput.js +1 -1
- package/dist/Chip.cjs +1 -1
- package/dist/Chip.js +1 -1
- package/dist/ColorInput.cjs +1 -1
- package/dist/ColorInput.js +1 -1
- package/dist/ConfirmationForm.cjs +1 -1
- package/dist/ConfirmationForm.js +1 -1
- package/dist/CustomLoanMapSection.cjs +240 -0
- package/dist/CustomLoanMapSection.js +410 -0
- package/dist/{CustomStyles-DuADCM-0.js → CustomStyles-BWOJ2IOk.js} +1 -1
- package/dist/{CustomStyles-CBON9fD-.cjs → CustomStyles-DyqGX2oY.cjs} +1 -1
- package/dist/DateInput.cjs +1 -1
- package/dist/DateInput.js +1 -1
- package/dist/DecimalInput.cjs +1 -1
- package/dist/DecimalInput.js +1 -1
- package/dist/DecimalInputV2.cjs +1 -1
- package/dist/DecimalInputV2.js +1 -1
- package/dist/DetailedProductsSection.cjs +1 -1
- package/dist/DetailedProductsSection.js +5 -5
- package/dist/DetailsView.cjs +1 -1
- package/dist/DetailsView.js +1 -1
- package/dist/DoubleRangeSlider.cjs +1 -1
- package/dist/DoubleRangeSlider.js +1 -1
- package/dist/DragAndDropFile.cjs +1 -1
- package/dist/DragAndDropFile.js +1 -1
- package/dist/DragDropFiles.cjs +1 -1
- package/dist/DragDropFiles.js +1 -1
- package/dist/Drawer.cjs +1 -1
- package/dist/Drawer.js +1 -1
- package/dist/Dropdown.cjs +1 -1
- package/dist/Dropdown.js +2 -2
- package/dist/DropdownItem.cjs +1 -1
- package/dist/DropdownItem.js +1 -1
- package/dist/DropdownLookup.cjs +1 -1
- package/dist/DropdownLookup.js +1 -1
- package/dist/DropdownMenu.cjs +1 -1
- package/dist/DropdownMenu.js +1 -1
- package/dist/EditableTable.cjs +1 -1
- package/dist/EditableTable.js +1 -1
- package/dist/FieldOfInterestsMasonrySection.cjs +7 -7
- package/dist/FieldOfInterestsMasonrySection.js +24 -24
- package/dist/FieldOfInterestsWithAvatarsCardsSection.cjs +11 -7
- package/dist/FieldOfInterestsWithAvatarsCardsSection.js +62 -58
- package/dist/FieldOfInterestsWithTagsCardsSection.cjs +37 -17
- package/dist/FieldOfInterestsWithTagsCardsSection.js +69 -49
- package/dist/FileInput.cjs +1 -1
- package/dist/FileInput.js +1 -1
- package/dist/FlexGridItem.cjs +1 -1
- package/dist/FlexGridItem.js +1 -1
- package/dist/FormField.cjs +1 -1
- package/dist/FormField.js +1 -1
- package/dist/FormView.cjs +1 -1
- package/dist/FormView.js +1 -1
- package/dist/GeneralWithTagsCardsSection.cjs +198 -0
- package/dist/GeneralWithTagsCardsSection.js +287 -0
- package/dist/GiftCardsSection.cjs +11 -7
- package/dist/GiftCardsSection.js +34 -30
- package/dist/Icon.cjs +1 -1
- package/dist/Icon.js +1 -1
- package/dist/IconButton.cjs +1 -1
- package/dist/IconButton.js +1 -1
- package/dist/Kanban.cjs +1 -1
- package/dist/Kanban.js +1 -1
- package/dist/KanbanActionsToolbar.cjs +1 -1
- package/dist/KanbanActionsToolbar.js +1 -1
- package/dist/KanbanView.cjs +1 -1
- package/dist/KanbanView.js +1 -1
- package/dist/Link.cjs +1 -1
- package/dist/Link.js +1 -1
- package/dist/MasonryGeneralCardsSection.cjs +6 -6
- package/dist/MasonryGeneralCardsSection.js +38 -36
- package/dist/MenuItem.cjs +1 -1
- package/dist/MenuItem.js +1 -1
- package/dist/Modal.cjs +1 -1
- package/dist/Modal.js +1 -1
- package/dist/MultiSelectDropdown.cjs +1 -1
- package/dist/MultiSelectDropdown.js +1 -1
- package/dist/MultiSelectDropdownLookup.cjs +1 -1
- package/dist/MultiSelectDropdownLookup.js +1 -1
- package/dist/NestedDropdownItem.cjs +1 -1
- package/dist/NestedDropdownItem.js +1 -1
- package/dist/NestedMenuItem.cjs +1 -1
- package/dist/NestedMenuItem.js +1 -1
- package/dist/NotificationContainer.cjs +1 -1
- package/dist/NotificationContainer.js +1 -1
- package/dist/NotificationMessage.cjs +1 -1
- package/dist/NotificationMessage.js +1 -1
- package/dist/NumberInput.cjs +1 -1
- package/dist/NumberInput.js +1 -1
- package/dist/OverlayGeneralCardsSection.cjs +127 -0
- package/dist/OverlayGeneralCardsSection.js +183 -0
- package/dist/PasswordInput.cjs +1 -1
- package/dist/PasswordInput.js +1 -1
- package/dist/PopoverContent.cjs +1 -1
- package/dist/PopoverContent.js +1 -1
- package/dist/ProductsWithBannerSection.cjs +1 -1
- package/dist/ProductsWithBannerSection.js +4 -4
- package/dist/ProgressBar.cjs +1 -1
- package/dist/ProgressBar.js +1 -1
- package/dist/QuizSection.cjs +387 -0
- package/dist/QuizSection.js +697 -0
- package/dist/RadioInput.cjs +1 -1
- package/dist/RadioInput.js +1 -1
- package/dist/RangeSlider.cjs +1 -1
- package/dist/RangeSlider.js +1 -1
- package/dist/Separator.cjs +1 -1
- package/dist/Separator.js +1 -1
- package/dist/ShopCardsSection.cjs +8 -8
- package/dist/ShopCardsSection.js +50 -50
- package/dist/Sidebar.cjs +1 -1
- package/dist/Sidebar.js +1 -1
- package/dist/SimpleCategoriesSection.cjs +81 -0
- package/dist/SimpleCategoriesSection.js +153 -0
- package/dist/SimpleProductsSection.cjs +1 -1
- package/dist/SimpleProductsSection.js +4 -4
- package/dist/Spinner.cjs +1 -1
- package/dist/Spinner.js +1 -1
- package/dist/Surface.cjs +1 -1
- package/dist/Surface.js +1 -1
- package/dist/SwipeableDrawer.cjs +1 -1
- package/dist/SwipeableDrawer.js +1 -1
- package/dist/TabItem.cjs +1 -1
- package/dist/TabItem.js +1 -1
- package/dist/Table.cjs +1 -1
- package/dist/Table.js +1 -1
- package/dist/TableView.cjs +1 -1
- package/dist/TableView.js +1 -1
- package/dist/TextAreaInput.cjs +1 -1
- package/dist/TextAreaInput.js +1 -1
- package/dist/TextInput.cjs +1 -1
- package/dist/TextInput.js +1 -1
- package/dist/ThemeProvider.cjs +1 -1
- package/dist/ThemeProvider.js +25 -25
- package/dist/TimeInput.cjs +1 -1
- package/dist/TimeInput.js +1 -1
- package/dist/Toggle.cjs +1 -1
- package/dist/Toggle.js +1 -1
- package/dist/TreeMenuSeparator.cjs +1 -1
- package/dist/TreeMenuSeparator.js +1 -1
- package/dist/UploadedFile.cjs +1 -1
- package/dist/UploadedFile.js +1 -1
- package/dist/UrgentSaleProductsSection.cjs +1 -1
- package/dist/UrgentSaleProductsSection.js +3 -3
- package/dist/consts-C1uHV4xc.js +6 -0
- package/dist/consts-CtNoHdBj.cjs +1 -0
- package/dist/{index-jVpIwR2G.js → index-7XMd1kAv.js} +2 -2
- package/dist/{index-C2M7QHPq.cjs → index-B67WqHGh.cjs} +1 -1
- package/dist/{index-BlV3tdJ8.cjs → index-B6kVbS_M.cjs} +1 -1
- package/dist/{index-DcYg32le.js → index-CTJZaJ_S.js} +1 -1
- package/dist/{index-DGl-lSfF.js → index-HV_Ku4ub.js} +1 -1
- package/dist/{index-LdP7U1Yl.cjs → index-mIxT8eNX.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +51 -47
- package/dist/{style-C3OB0uad.cjs → style-BEUISPP7.cjs} +5 -5
- package/dist/{style-Ch-xOasu.js → style-BGQ1B_dp.js} +7 -8
- package/dist/{useDetectMobile-BookNOsk.js → useDetectMobile-BC6EGaBc.js} +1 -1
- package/dist/{useDetectMobile-rBe0FiP2.cjs → useDetectMobile-D6d5LpdL.cjs} +1 -1
- package/dist/{utils-CE6bljYe.cjs → utils-C0YSTwcn.cjs} +7 -7
- package/dist/{utils-DtEdJZWa.js → utils-CqvISfv9.js} +43 -36
- package/package.json +12 -1
- package/vite.config.js +40 -0
- package/dist/consts-DNVz1x1I.js +0 -4
- package/dist/consts-dNz9tpt4.cjs +0 -1
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { jsx as r, Fragment as _, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as p } from "react";
|
|
3
|
+
import f from "./Button.js";
|
|
4
|
+
import { useTheme as x } from "./ThemeProvider.js";
|
|
5
|
+
import { n as m } from "./emotion-styled.browser.esm-BiK8DcgW.js";
|
|
6
|
+
import { m as i, t as s } from "./utils-CqvISfv9.js";
|
|
7
|
+
import { M as h } from "./consts-C1uHV4xc.js";
|
|
8
|
+
import { R as u } from "./style-BGQ1B_dp.js";
|
|
9
|
+
const v = m.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
align-items: flex-start;
|
|
13
|
+
border-radius: 0.75rem;
|
|
14
|
+
position: relative;
|
|
15
|
+
max-height: 28.75rem;
|
|
16
|
+
|
|
17
|
+
& .wrapper__overlay {
|
|
18
|
+
position: relative;
|
|
19
|
+
|
|
20
|
+
&::after {
|
|
21
|
+
content: "";
|
|
22
|
+
position: absolute;
|
|
23
|
+
border-radius: 0.75rem;
|
|
24
|
+
left: 0;
|
|
25
|
+
top: 0;
|
|
26
|
+
width: 100%;
|
|
27
|
+
height: 99%;
|
|
28
|
+
max-height: 28.75rem;
|
|
29
|
+
background: ${(t) => t == null ? void 0 : t.overlay};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
& .wrapper__image {
|
|
34
|
+
border-radius: 0.75rem;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
& .wrapper__image--skeleton {
|
|
38
|
+
width: 100%;
|
|
39
|
+
border-radius: 0.75rem;
|
|
40
|
+
background-color: ${i("-90deg")};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
& .wrapper__text {
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
align-items: flex-start;
|
|
47
|
+
padding: 1rem;
|
|
48
|
+
position: absolute;
|
|
49
|
+
top: 0;
|
|
50
|
+
left: 0;
|
|
51
|
+
|
|
52
|
+
& .text__title {
|
|
53
|
+
color: var(--white);
|
|
54
|
+
font-size: 1rem;
|
|
55
|
+
font-style: normal;
|
|
56
|
+
font-weight: 500;
|
|
57
|
+
line-height: 1.5rem;
|
|
58
|
+
${s(2)}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
& .text__description {
|
|
62
|
+
color: var(--white);
|
|
63
|
+
font-size: 1.375rem;
|
|
64
|
+
font-style: normal;
|
|
65
|
+
font-weight: 600;
|
|
66
|
+
line-height: 1.75rem;
|
|
67
|
+
${s(2)}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
& .text__title--skeleton {
|
|
71
|
+
background-color: ${i("-90deg")};
|
|
72
|
+
height: 1rem;
|
|
73
|
+
width: 9rem;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
& .text__description--skeleton {
|
|
77
|
+
background-color: ${i("-90deg")};
|
|
78
|
+
height: 1rem;
|
|
79
|
+
width: 12rem;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
& .text__action {
|
|
84
|
+
background: var(--white);
|
|
85
|
+
color: var(--black);
|
|
86
|
+
position: absolute;
|
|
87
|
+
bottom: 1rem;
|
|
88
|
+
left: 1rem;
|
|
89
|
+
|
|
90
|
+
&:hover {
|
|
91
|
+
background: var(--primary-500, #f59e0b);
|
|
92
|
+
color: var(--white);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
& .text__action--skeleton {
|
|
97
|
+
background-color: ${i("-90deg")};
|
|
98
|
+
height: 2rem;
|
|
99
|
+
width: 9rem;
|
|
100
|
+
position: absolute;
|
|
101
|
+
bottom: 1rem;
|
|
102
|
+
left: 1rem;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@media (max-width: ${h + "px"}) {
|
|
106
|
+
max-height: 100%;
|
|
107
|
+
|
|
108
|
+
& .wrapper__overlay {
|
|
109
|
+
&::after {
|
|
110
|
+
max-height: 100%;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
& .wrapper__text {
|
|
115
|
+
top: 1rem;
|
|
116
|
+
left: 1rem;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
& .text__action {
|
|
120
|
+
bottom: 2rem;
|
|
121
|
+
left: 2rem;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
`, w = p(
|
|
125
|
+
({
|
|
126
|
+
title: t,
|
|
127
|
+
image: a,
|
|
128
|
+
overlay: l,
|
|
129
|
+
description: n,
|
|
130
|
+
actionText: c,
|
|
131
|
+
actionLink: e,
|
|
132
|
+
handleClick: o = () => {
|
|
133
|
+
}
|
|
134
|
+
}, y) => {
|
|
135
|
+
const { theme: g } = x();
|
|
136
|
+
return /* @__PURE__ */ r(_, { children: /* @__PURE__ */ d(v, { theme: g, overlay: l, onClick: o, children: [
|
|
137
|
+
/* @__PURE__ */ r("div", { className: "wrapper__overlay", children: /* @__PURE__ */ r("img", { src: a, className: "wrapper__image" }) }),
|
|
138
|
+
/* @__PURE__ */ d("div", { className: "wrapper__text", children: [
|
|
139
|
+
/* @__PURE__ */ r("div", { className: "text__title", children: t }),
|
|
140
|
+
/* @__PURE__ */ r("div", { className: "text__description", children: n })
|
|
141
|
+
] }),
|
|
142
|
+
/* @__PURE__ */ r(
|
|
143
|
+
f,
|
|
144
|
+
{
|
|
145
|
+
text: c,
|
|
146
|
+
onClick: o,
|
|
147
|
+
className: "text__action"
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
] }) });
|
|
151
|
+
}
|
|
152
|
+
), b = m.div`
|
|
153
|
+
display: grid;
|
|
154
|
+
grid-template-columns: ${(t) => `repeat(${t.limit}, 1fr)`};
|
|
155
|
+
gap: 1.25rem;
|
|
156
|
+
justify-items: center;
|
|
157
|
+
|
|
158
|
+
@media (max-width: ${h + "px"}) {
|
|
159
|
+
display: flex;
|
|
160
|
+
flex-direction: column;
|
|
161
|
+
gap: 1rem;
|
|
162
|
+
}
|
|
163
|
+
`, j = p(
|
|
164
|
+
({ title: t, items: a, limit: l = 2, onSelectCard: n = () => {
|
|
165
|
+
} }, c) => /* @__PURE__ */ d(u, { children: [
|
|
166
|
+
/* @__PURE__ */ r("div", { className: "regular-title center", children: /* @__PURE__ */ r("div", { className: "regular-title-text", children: /* @__PURE__ */ r("span", { children: t }) }) }),
|
|
167
|
+
/* @__PURE__ */ r(b, { limit: l, children: a && (a == null ? void 0 : a.map((e, o) => /* @__PURE__ */ r(
|
|
168
|
+
w,
|
|
169
|
+
{
|
|
170
|
+
title: e == null ? void 0 : e.title,
|
|
171
|
+
image: e == null ? void 0 : e.image,
|
|
172
|
+
description: e == null ? void 0 : e.description,
|
|
173
|
+
actionText: e == null ? void 0 : e.actionText,
|
|
174
|
+
overlay: e == null ? void 0 : e.overlay,
|
|
175
|
+
handleClick: () => n(e == null ? void 0 : e.uuid)
|
|
176
|
+
},
|
|
177
|
+
`landing-page-overlay-general-card__${o + 1}`
|
|
178
|
+
))) })
|
|
179
|
+
] })
|
|
180
|
+
);
|
|
181
|
+
export {
|
|
182
|
+
j as default
|
|
183
|
+
};
|
package/dist/PasswordInput.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const a=require("react/jsx-runtime"),s=require("react"),n=require("./index-BPVoEhTF.cjs"),L=require("./index-DaiUAQVF.cjs"),D=require("./Icon.cjs"),h=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),r=require("./utils-
|
|
1
|
+
"use strict";const a=require("react/jsx-runtime"),s=require("react"),n=require("./index-BPVoEhTF.cjs"),L=require("./index-DaiUAQVF.cjs"),D=require("./Icon.cjs"),h=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),r=require("./utils-C0YSTwcn.cjs"),A=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs"),G=h.newStyled.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
|
package/dist/PasswordInput.js
CHANGED
|
@@ -4,7 +4,7 @@ import { P as n } from "./index-S5Cd7WrG.js";
|
|
|
4
4
|
import { d as J } from "./index-CNBqQrtK.js";
|
|
5
5
|
import K from "./Icon.js";
|
|
6
6
|
import { n as m } from "./emotion-styled.browser.esm-BiK8DcgW.js";
|
|
7
|
-
import { d as g, a, b as M, e as Q, h as O, g as X } from "./utils-
|
|
7
|
+
import { d as g, a, b as M, e as Q, h as O, g as X } from "./utils-CqvISfv9.js";
|
|
8
8
|
import { u as Y } from "./emotion-element-5486c51c.browser.esm-Bb4VkP8U.js";
|
|
9
9
|
const Z = m.div`
|
|
10
10
|
display: flex;
|
package/dist/PopoverContent.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const n=require("react/jsx-runtime"),c=require("react"),s=require("./floating-ui.react.esm-C4vrBVJU.cjs"),i=require("./index-BPVoEhTF.cjs"),x=require("./PopoverContext.cjs"),h=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),a=require("./utils-
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),c=require("react"),s=require("./floating-ui.react.esm-C4vrBVJU.cjs"),i=require("./index-BPVoEhTF.cjs"),x=require("./PopoverContext.cjs"),h=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),a=require("./utils-C0YSTwcn.cjs"),y=require("./motion-Oud-wpUz.cjs"),f=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs"),P=h.newStyled(y.motion.div)`
|
|
2
2
|
font-family: ${e=>{var t,r;return(r=(t=e.theme)==null?void 0:t.typography)==null?void 0:r.fontFamily}};
|
|
3
3
|
animation: fadeIn 0.4s;
|
|
4
4
|
box-shadow: ${e=>a.getComponentPropValue(e.theme,"Popover",e.color,"enabled","boxShadow")};
|
package/dist/PopoverContent.js
CHANGED
|
@@ -4,7 +4,7 @@ import { a as f, F as u, b as g } from "./floating-ui.react.esm-72DKnou_.js";
|
|
|
4
4
|
import { P as a } from "./index-S5Cd7WrG.js";
|
|
5
5
|
import h from "./PopoverContext.js";
|
|
6
6
|
import { n as x } from "./emotion-styled.browser.esm-BiK8DcgW.js";
|
|
7
|
-
import { c as y, b as P, a as v } from "./utils-
|
|
7
|
+
import { c as y, b as P, a as v } from "./utils-CqvISfv9.js";
|
|
8
8
|
import { m as w } from "./motion-ecIGZGwI.js";
|
|
9
9
|
import { u as C } from "./emotion-element-5486c51c.browser.esm-Bb4VkP8U.js";
|
|
10
10
|
const F = x(w.div)`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const i=require("react/jsx-runtime"),p=require("react"),c=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),g=require("./consts-
|
|
1
|
+
"use strict";const i=require("react/jsx-runtime"),p=require("react"),c=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),g=require("./consts-CtNoHdBj.cjs"),b=require("./useDetectMobile-D6d5LpdL.cjs"),f=require("./style-BEUISPP7.cjs"),a=require("./utils-C0YSTwcn.cjs"),j=c.newStyled.div`
|
|
2
2
|
width: 100%;
|
|
3
3
|
height: 22.5rem;
|
|
4
4
|
min-height: 22.5rem;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as m, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as g } from "react";
|
|
3
3
|
import { n as s } from "./emotion-styled.browser.esm-BiK8DcgW.js";
|
|
4
|
-
import { M as f } from "./consts-
|
|
5
|
-
import { u as w } from "./useDetectMobile-
|
|
6
|
-
import { R as v } from "./style-
|
|
7
|
-
import { t as k, m as h, l as y, k as N } from "./utils-
|
|
4
|
+
import { M as f } from "./consts-C1uHV4xc.js";
|
|
5
|
+
import { u as w } from "./useDetectMobile-BC6EGaBc.js";
|
|
6
|
+
import { R as v } from "./style-BGQ1B_dp.js";
|
|
7
|
+
import { t as k, m as h, l as y, k as N } from "./utils-CqvISfv9.js";
|
|
8
8
|
const S = s.div`
|
|
9
9
|
width: 100%;
|
|
10
10
|
height: 22.5rem;
|
package/dist/ProgressBar.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const a=require("react/jsx-runtime"),i=require("react"),r=require("./index-BPVoEhTF.cjs"),l=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),o=require("./utils-
|
|
1
|
+
"use strict";const a=require("react/jsx-runtime"),i=require("react"),r=require("./index-BPVoEhTF.cjs"),l=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),o=require("./utils-C0YSTwcn.cjs"),P=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs"),f=l.newStyled.div`
|
|
2
2
|
width: 100%;
|
|
3
3
|
position: relative;
|
|
4
4
|
background-color: ${e=>o.getColorRgbaValue(e.theme,"Progress",e.color,"enabled","unfilled")};
|
package/dist/ProgressBar.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsxs as g, jsx as h } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as f, isValidElement as P, cloneElement as y } from "react";
|
|
3
3
|
import { P as r } from "./index-S5Cd7WrG.js";
|
|
4
4
|
import { n as t } from "./emotion-styled.browser.esm-BiK8DcgW.js";
|
|
5
|
-
import { a as n, g as x } from "./utils-
|
|
5
|
+
import { a as n, g as x } from "./utils-CqvISfv9.js";
|
|
6
6
|
import { u as w } from "./emotion-element-5486c51c.browser.esm-Bb4VkP8U.js";
|
|
7
7
|
const $ = t.div`
|
|
8
8
|
width: 100%;
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),i=require("react"),z=require("./utils-C0YSTwcn.cjs"),k=require("./Button.cjs"),S=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),p=require("./consts-CtNoHdBj.cjs"),A=require("./Icon.cjs"),H=require("./ProgressBar.cjs"),J=S.newStyled.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
align-items: flex-start;
|
|
6
|
+
gap: 2rem;
|
|
7
|
+
flex: 1 0 0;
|
|
8
|
+
|
|
9
|
+
& .wrapper__content {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
|
|
13
|
+
& .wrapper__title {
|
|
14
|
+
color: var(--gray-950, #14161a);
|
|
15
|
+
font-size: 1.75rem;
|
|
16
|
+
font-style: normal;
|
|
17
|
+
font-weight: 600;
|
|
18
|
+
line-height: 2.25rem;
|
|
19
|
+
letter-spacing: -0.59px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
& .wrapper__description {
|
|
23
|
+
color: var(--gray-950, #14161a);
|
|
24
|
+
font-size: 1rem;
|
|
25
|
+
font-style: normal;
|
|
26
|
+
font-weight: 500;
|
|
27
|
+
line-height: 1.5rem;
|
|
28
|
+
letter-spacing: -0.18px;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
& .wrapper__action {
|
|
33
|
+
background: var(--gray-950, #14161a);
|
|
34
|
+
font-size: 0.875rem;
|
|
35
|
+
font-style: normal;
|
|
36
|
+
font-weight: 500;
|
|
37
|
+
line-height: 1.25rem;
|
|
38
|
+
letter-spacing: -0.09px;
|
|
39
|
+
padding: 0.625rem 0.75rem;
|
|
40
|
+
|
|
41
|
+
&:hover {
|
|
42
|
+
color: var(--white, #fff);
|
|
43
|
+
background: var(---gray-600, #676e79);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&:focus {
|
|
47
|
+
outline: none;
|
|
48
|
+
background: var(--gray-950, #14161a);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@media (max-width: ${p.MOBILE_SIZE_PX+"px"}) {
|
|
53
|
+
& .wrapper__title {
|
|
54
|
+
font-size: 1.375rem;
|
|
55
|
+
line-height: 1.75rem;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
& .wrapper__description {
|
|
59
|
+
font-size: 0.875rem;
|
|
60
|
+
line-height: 1.25rem;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
`,K=S.newStyled.div`
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
align-items: flex-start;
|
|
67
|
+
gap: 1.5rem;
|
|
68
|
+
align-self: stretch;
|
|
69
|
+
|
|
70
|
+
& .wrapper__headline {
|
|
71
|
+
display: flex;
|
|
72
|
+
align-items: flex-start;
|
|
73
|
+
justify-items: space-between;
|
|
74
|
+
gap: 32px;
|
|
75
|
+
width: 100%;
|
|
76
|
+
|
|
77
|
+
& .wrapper__question-no {
|
|
78
|
+
display: flex;
|
|
79
|
+
flex-direction: column;
|
|
80
|
+
justify-content: center;
|
|
81
|
+
align-items: flex-start;
|
|
82
|
+
gap: 0.75rem;
|
|
83
|
+
width: 100%;
|
|
84
|
+
|
|
85
|
+
& .question-no__text {
|
|
86
|
+
color: var(--gray-950, #14161a);
|
|
87
|
+
font-size: 1.375rem;
|
|
88
|
+
font-style: normal;
|
|
89
|
+
font-weight: 600;
|
|
90
|
+
line-height: 1.75rem;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
& .question-no__progress-bar {
|
|
94
|
+
height: 0.25rem;
|
|
95
|
+
& > div {
|
|
96
|
+
background: var(--yellow-600, #d97706);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
& .wrapper__timer {
|
|
102
|
+
position: relative;
|
|
103
|
+
width: 3.75rem;
|
|
104
|
+
height: 3.75rem;
|
|
105
|
+
background-color: #f0f0f0;
|
|
106
|
+
border-radius: 50%;
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
|
|
111
|
+
& .timer__display {
|
|
112
|
+
position: absolute;
|
|
113
|
+
top: 50%;
|
|
114
|
+
left: 50%;
|
|
115
|
+
transform: translate(-50%, -50%);
|
|
116
|
+
z-index: 10;
|
|
117
|
+
|
|
118
|
+
& .timer__text {
|
|
119
|
+
color: var(--red-600, #e11d48);
|
|
120
|
+
font-size: 0.75rem;
|
|
121
|
+
font-style: normal;
|
|
122
|
+
font-weight: 500;
|
|
123
|
+
line-height: 1rem;
|
|
124
|
+
letter-spacing: 0.5px;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
& .wrapper__content {
|
|
131
|
+
display: flex;
|
|
132
|
+
flex-direction: column;
|
|
133
|
+
align-items: flex-start;
|
|
134
|
+
gap: 2.5rem;
|
|
135
|
+
width: 100%;
|
|
136
|
+
|
|
137
|
+
& .wrapper__item {
|
|
138
|
+
display: flex;
|
|
139
|
+
flex-direction: column;
|
|
140
|
+
align-items: flex-start;
|
|
141
|
+
gap: 1.25rem;
|
|
142
|
+
align-self: stretch;
|
|
143
|
+
|
|
144
|
+
& .wrapper__text {
|
|
145
|
+
color: var(--gray-950, #14161a);
|
|
146
|
+
font-size: 1rem;
|
|
147
|
+
font-style: normal;
|
|
148
|
+
font-weight: 600;
|
|
149
|
+
line-height: 1.5rem;
|
|
150
|
+
letter-spacing: 0.1px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
& .wrapper__answers {
|
|
154
|
+
display: flex;
|
|
155
|
+
align-items: flex-start;
|
|
156
|
+
gap: 0.75rem;
|
|
157
|
+
align-self: stretch;
|
|
158
|
+
|
|
159
|
+
& .wrapper__answer {
|
|
160
|
+
display: flex;
|
|
161
|
+
padding: 1rem 0.75rem;
|
|
162
|
+
align-items: flex-start;
|
|
163
|
+
justify-content: space-between;
|
|
164
|
+
border-radius: 0.75rem;
|
|
165
|
+
border: 1px solid var(--neutral-95012, rgba(20, 22, 26, 0.12));
|
|
166
|
+
color: var(--gray-950, #14161a);
|
|
167
|
+
font-size: 0.875rem;
|
|
168
|
+
font-style: normal;
|
|
169
|
+
font-weight: 500;
|
|
170
|
+
line-height: 1.25rem;
|
|
171
|
+
letter-spacing: -0.09px;
|
|
172
|
+
width: 100%;
|
|
173
|
+
|
|
174
|
+
&:hover {
|
|
175
|
+
cursor: pointer;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
&.active {
|
|
179
|
+
border: 2px solid var(--yellow-600, #d97706);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
& .wrapper__icon {
|
|
183
|
+
color: var(--yellow-600, #d97706);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
& .wrapper__actions {
|
|
190
|
+
display: flex;
|
|
191
|
+
justify-content: flex-end;
|
|
192
|
+
gap: 0.5rem;
|
|
193
|
+
align-items: center;
|
|
194
|
+
align-self: stretch;
|
|
195
|
+
width: 100%;
|
|
196
|
+
font-size: 0.875rem;
|
|
197
|
+
font-style: normal;
|
|
198
|
+
font-weight: 500;
|
|
199
|
+
line-height: 1.25rem;
|
|
200
|
+
letter-spacing: -0.09px;
|
|
201
|
+
|
|
202
|
+
& .wrapper__action {
|
|
203
|
+
padding: 0.625rem 0.75rem;
|
|
204
|
+
font-size: 0.875rem;
|
|
205
|
+
font-style: normal;
|
|
206
|
+
font-weight: 500;
|
|
207
|
+
line-height: 1.25rem;
|
|
208
|
+
letter-spacing: -0.09px;
|
|
209
|
+
min-width: 5rem;
|
|
210
|
+
|
|
211
|
+
&.action__give-up {
|
|
212
|
+
background: transparent;
|
|
213
|
+
color: var(--gray-950, #14161a);
|
|
214
|
+
|
|
215
|
+
&:hover {
|
|
216
|
+
background: var(--neutral-9504, rgba(20, 22, 26, 0.12));
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
&:focus {
|
|
220
|
+
outline: none;
|
|
221
|
+
background: transparent;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
&.action__next {
|
|
226
|
+
background: var(--gray-950, #14161a);
|
|
227
|
+
|
|
228
|
+
&:hover {
|
|
229
|
+
background: var(---gray-600, #676e79);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
&:focus {
|
|
233
|
+
outline: none;
|
|
234
|
+
background: var(--gray-950, #14161a);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
&:disabled {
|
|
238
|
+
color: var(--white, #fff);
|
|
239
|
+
background: var(--neutral-9504, rgba(20, 22, 26, 0.12));
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
@media (max-width: ${p.MOBILE_SIZE_PX+"px"}) {
|
|
247
|
+
& .wrapper__content {
|
|
248
|
+
& .wrapper__item {
|
|
249
|
+
& .wrapper__answers {
|
|
250
|
+
flex-direction: column;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
`,V=S.newStyled.div`
|
|
256
|
+
display: flex;
|
|
257
|
+
flex-direction: column;
|
|
258
|
+
align-items: flex-start;
|
|
259
|
+
gap: 1.5rem;
|
|
260
|
+
|
|
261
|
+
& .wrapper__content {
|
|
262
|
+
display: flex;
|
|
263
|
+
flex-direction: column;
|
|
264
|
+
align-items: center;
|
|
265
|
+
gap: 1rem;
|
|
266
|
+
align-self: stretch;
|
|
267
|
+
|
|
268
|
+
& .wrapper__info {
|
|
269
|
+
display: flex;
|
|
270
|
+
flex-direction: column;
|
|
271
|
+
align-items: flex-start;
|
|
272
|
+
gap: 0.25rem;
|
|
273
|
+
align-self: stretch;
|
|
274
|
+
color: var(--gray-950, #14161a);
|
|
275
|
+
|
|
276
|
+
align-items: center;
|
|
277
|
+
|
|
278
|
+
& .wrapper__title {
|
|
279
|
+
font-size: 1.75rem;
|
|
280
|
+
font-style: normal;
|
|
281
|
+
font-weight: 600;
|
|
282
|
+
line-height: 2.25rem;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
& .wrapper__description {
|
|
286
|
+
font-size: 1rem;
|
|
287
|
+
font-style: normal;
|
|
288
|
+
font-weight: 400;
|
|
289
|
+
line-height: 1.5rem;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
& .wrapper__actions {
|
|
295
|
+
display: flex;
|
|
296
|
+
flex-direction: column;
|
|
297
|
+
align-items: center;
|
|
298
|
+
gap: 0.5rem;
|
|
299
|
+
width: 100%;
|
|
300
|
+
font-size: 0.875rem;
|
|
301
|
+
font-style: normal;
|
|
302
|
+
font-weight: 500;
|
|
303
|
+
line-height: 1.25rem;
|
|
304
|
+
letter-spacing: -0.09px;
|
|
305
|
+
|
|
306
|
+
& .wrapper__action {
|
|
307
|
+
padding: 0.625rem 0.75rem;
|
|
308
|
+
font-size: 0.875rem;
|
|
309
|
+
font-style: normal;
|
|
310
|
+
font-weight: 500;
|
|
311
|
+
line-height: 1.25rem;
|
|
312
|
+
letter-spacing: -0.09px;
|
|
313
|
+
min-width: 22rem;
|
|
314
|
+
width: 100%;
|
|
315
|
+
|
|
316
|
+
&.action__end-quiz {
|
|
317
|
+
background: transparent;
|
|
318
|
+
color: var(--gray-950, #14161a);
|
|
319
|
+
|
|
320
|
+
&:hover {
|
|
321
|
+
background: var(--neutral-9504, rgba(20, 22, 26, 0.12));
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
&:focus {
|
|
325
|
+
outline: none;
|
|
326
|
+
background: transparent;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
&.action__continue {
|
|
331
|
+
background: var(--gray-950, #14161a);
|
|
332
|
+
|
|
333
|
+
&:hover {
|
|
334
|
+
background: var(---gray-600, #676e79);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
&:focus {
|
|
338
|
+
outline: none;
|
|
339
|
+
background: var(--gray-950, #14161a);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
@media (max-width: ${p.MOBILE_SIZE_PX+"px"}) {
|
|
346
|
+
width: 100%;
|
|
347
|
+
|
|
348
|
+
& .wrapper__actions {
|
|
349
|
+
& .wrapper__action {
|
|
350
|
+
width: 100%;
|
|
351
|
+
min-width: 100%;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
`,Y=i.forwardRef(({title:d,description:s,startQuizText:m="Start quiz",onStartQuiz:f=()=>{}},c)=>e.jsxs(J,{children:[e.jsxs("div",{className:"wrapper__content",children:[e.jsx("div",{className:"wrapper__title",children:d}),e.jsx("div",{className:"wrapper__description",children:s})]}),e.jsx(k,{text:m,size:"medium",className:"wrapper__action",onClick:f})]})),q=i.forwardRef(({questionNoText:d,questionNo:s,totalQuestions:m,text:f,answers:c,selectedAnswer:_,secondsPerQuestion:r,nextText:E="Next",giveUpText:C="Give up",nextDisabled:T=!0,onSelectAnswer:Q=()=>{},onGiveUp:U=()=>{},onNext:Z=()=>{}},W)=>{const[g,N]=i.useState(r),[x,I]=i.useState(!0),u=i.useRef(null);i.useEffect(()=>(x&&g>0&&(u.current=setInterval(()=>{N(a=>a>0?a-1:0)},1e3)),()=>clearInterval(u.current)),[x,g]);const b=g>0?g/r*p.CIRCLE_CIRCUMFERENCE:0,w=a=>(_==null?void 0:_.uuid)===a;return e.jsxs(K,{children:[e.jsxs("div",{className:"wrapper__headline",children:[e.jsxs("div",{className:"wrapper__question-no",children:[e.jsx("div",{className:"question-no__text",children:`${d} ${s} / ${m}`}),e.jsx(H,{progressPercentage:s/m*100,className:"question-no__progress-bar"})]}),e.jsxs("div",{className:"wrapper__timer",children:[e.jsxs("svg",{className:"timer__ring",width:"60",height:"60",children:[e.jsx("circle",{className:"ring__progres-background",cx:"30",cy:"30",r:p.CIRCLE_RADIUS,stroke:"#e0e0e0",strokeWidth:"4",fill:"transparent"}),e.jsx("circle",{className:"ring__progres",cx:"30",cy:"30",r:p.CIRCLE_RADIUS,stroke:"#d97706",strokeWidth:"4",fill:"transparent",strokeLinecap:"round",transform:"rotate(-90 30 30)",strokeDasharray:p.CIRCLE_CIRCUMFERENCE,strokeDashoffset:p.CIRCLE_CIRCUMFERENCE-b})]}),e.jsx("div",{className:"timer__display",children:e.jsx("span",{className:"timer__text",children:z.formatTimerText(g)})})]})]}),e.jsxs("div",{className:"wrapper__content",children:[e.jsxs("div",{className:"wrapper__item",children:[e.jsx("div",{className:"wrapper__text",children:f}),e.jsx("div",{className:"wrapper__answers",children:c&&(c==null?void 0:c.map((a,v)=>e.jsxs("div",{className:`wrapper__answer ${w(a==null?void 0:a.uuid)?"active":""}`,onClick:()=>Q(a),children:[`${String.fromCharCode(65+v)}: ${a==null?void 0:a.label}`,w(a==null?void 0:a.uuid)&&e.jsx(A,{icon:" mng-lnc-checkmark--filled",sizeInUnits:"1.25rem",className:"wrapper__icon"})]},`quiz-answer__${v+1}`)))})]}),e.jsxs("div",{className:"wrapper__actions",children:[e.jsx(k,{text:C,borderRadius:"curved",size:"medium",className:"wrapper__action action__give-up",onClick:U}),e.jsx(k,{text:E,borderRadius:"curved",size:"medium",className:"wrapper__action action__next",disabled:T,onClick:Z})]})]})]})}),ee=i.forwardRef(({title:d,description:s,continueText:m="Continue",endQuizText:f="End quiz",onContinue:c=()=>{},onEndQuiz:_=()=>{}},r)=>e.jsxs(V,{children:[e.jsxs("div",{className:"wrapper__content",children:[e.jsx(A,{icon:" mng-lnc-checkmark--outline",color:"success",sizeInUnits:"4rem",className:"wrapper__icon"}),e.jsxs("div",{className:"wrapper__info",children:[d&&e.jsx("div",{className:"wrapper__title",children:d}),s&&e.jsx("div",{className:"wrapper__description",children:s})]})]}),e.jsxs("div",{className:"wrapper__actions",children:[e.jsx(k,{text:m,borderRadius:"curved",size:"medium",className:"wrapper__action action__continue",onClick:c}),e.jsx(k,{text:f,borderRadius:"curved",size:"medium",className:"wrapper__action action__end-quiz",onClick:_})]})]})),l={START_QUIZ:0,QUIZ:1,CORRECT_ANSWER:2},re=S.newStyled.div`
|
|
356
|
+
display: flex;
|
|
357
|
+
width: 100%;
|
|
358
|
+
align-items: center;
|
|
359
|
+
gap: 2rem;
|
|
360
|
+
|
|
361
|
+
& .wrapper__outlet {
|
|
362
|
+
display: flex;
|
|
363
|
+
padding: 2rem 3rem;
|
|
364
|
+
flex-direction: column;
|
|
365
|
+
justify-content: center;
|
|
366
|
+
align-items: center;
|
|
367
|
+
width: 100%;
|
|
368
|
+
align-self: stretch;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
& .wrapper__image {
|
|
372
|
+
width: 100%;
|
|
373
|
+
height: auto;
|
|
374
|
+
aspect-ratio: 1 / 1;
|
|
375
|
+
max-width: 22.5rem;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
@media (max-width: ${p.MOBILE_SIZE_PX+"px"}) {
|
|
379
|
+
& .wrapper__outlet {
|
|
380
|
+
padding: 0;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
& .wrapper__image {
|
|
384
|
+
display: none;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
`,te=i.forwardRef(({welcomeTitle:d,welcomeDescription:s,endTitle:m,endDescription:f,image:c,imageComponent:_,questions:r,secondsPerQuestion:E,numOfCredits:C,startQuizText:T="Start quiz",nextText:Q="Next",giveUpText:U="Give up",questionNoText:Z="Question",continueText:W="Continue",endQuizText:g="End quiz",onStartQuiz:N=()=>{},onSelectAnswer:x=()=>{},onGiveUp:I=()=>{},onNext:u=()=>{},onContinue:b=()=>{},onEndQuiz:w=()=>{}},a)=>{const[v,h]=i.useState(l.START_QUIZ),[o,y]=i.useState(1),[t,L]=i.useState(null),[j,R]=i.useState(null),O=i.useRef([]),D=i.useRef(0),M=()=>{h(l.QUIZ),L(r==null?void 0:r.find(n=>(n==null?void 0:n.questionNo)===o)),N==null||N()},P=n=>{R(n),x==null||x()},B=()=>{h(l.START_QUIZ),y(1),R(null),I==null||I()},X=()=>{let n=(j==null?void 0:j.uuid)===(t==null?void 0:t.correctAnswer);n?(h(l.CORRECT_ANSWER),D.current+=C||(t==null?void 0:t.numOfCredits)):o===(r==null?void 0:r.length)?(h(l.START_QUIZ),y(1),R(null)):(y(o+1),L(r==null?void 0:r.find($=>($==null?void 0:$.questionNo)===o+1)),R(null)),O.current=[...O.current,{question:t,selectedAnswer:j,isCorrect:n}],u==null||u()},F=()=>{o===(r==null?void 0:r.length)?(h(l.START_QUIZ),y(1)):(h(l.QUIZ),y(o+1),L(r==null?void 0:r.find(n=>(n==null?void 0:n.questionNo)===o+1))),R(null),b==null||b()},G=()=>{h(l.START_QUIZ),y(1),R(null),w==null||w()};return e.jsxs(re,{children:[e.jsxs("div",{className:"wrapper__outlet",children:[v===l.START_QUIZ&&e.jsx(Y,{title:d,description:s,startQuizText:T,onStartQuiz:M}),v===l.QUIZ&&t&&e.jsx(q,{questionNoText:Z,questionNo:o,totalQuestions:(r==null?void 0:r.length)||0,text:t==null?void 0:t.text,answers:t==null?void 0:t.answers,secondsPerQuestion:E||(t==null?void 0:t.secondsPerQuestion),selectedAnswer:j,nextText:Q,giveUpText:U,nextDisabled:!z.isDefined(j),onSelectAnswer:P,onGiveUp:B,onNext:X},`quiz-question__${o}`),v===l.CORRECT_ANSWER&&e.jsx(ee,{title:m,description:z.formatString(f,C||(t==null?void 0:t.numOfCredits)),continueText:W,endQuizText:g,onContinue:F,onEndQuiz:G})]}),z.isDefined(_)?_:e.jsx("img",{src:c,className:"wrapper__image"})]})});module.exports=te;
|