fansunited-frontend-components 0.0.1-RC5 → 0.0.1-RC6

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.
Files changed (88) hide show
  1. package/classic-quiz-play.es.js +4 -4
  2. package/classic-quiz-play.umd.js +1 -1
  3. package/package.json +1 -1
  4. package/src/components/ClassicQuizNotFound.d.ts +2 -1
  5. package/src/components/ClassicQuizPlay.d.ts +3 -2
  6. package/src/components/Leads/CollectLead.d.ts +2 -1
  7. package/src/components/Leads/LeadAgreementCheckbox.d.ts +3 -2
  8. package/src/components/Leads/LeadForm.d.ts +2 -1
  9. package/src/components/Shared/Answers/Answers.d.ts +3 -2
  10. package/src/components/Shared/Answers/Option.d.ts +3 -2
  11. package/src/components/Shared/Button.d.ts +2 -1
  12. package/src/components/Shared/MainCard.d.ts +2 -1
  13. package/src/components/Shared/Pagination.d.ts +3 -2
  14. package/src/components/Shared/PresentedBy.d.ts +2 -1
  15. package/src/components/Shared/ScoreStateWrapper.d.ts +4 -3
  16. package/src/components/Shared/Stepper.d.ts +3 -2
  17. package/src/components/Shared/Stopwatch.d.ts +2 -1
  18. package/src/components/Variants/Overlay/AuthError/OverlayAuthError.d.ts +3 -2
  19. package/src/components/Variants/Overlay/AuthError/OverlayAuthError.styles.d.ts +3 -2
  20. package/src/components/Variants/Overlay/OverlayVariant.d.ts +3 -2
  21. package/src/components/Variants/Overlay/OverlayVariant.styles.d.ts +4 -3
  22. package/src/components/Variants/Overlay/ScoreState/OverlayScoreState.d.ts +4 -3
  23. package/src/components/Variants/Overlay/ScoreState/OverlayScoreState.styles.d.ts +4 -3
  24. package/src/components/Variants/Split/AuthError/SplitAuthError.d.ts +3 -2
  25. package/src/components/Variants/Split/AuthError/SplitAuthError.styles.d.ts +3 -2
  26. package/src/components/Variants/Split/ScoreState/SplitScoreState.d.ts +4 -3
  27. package/src/components/Variants/Split/ScoreState/SplitScoreState.styles.d.ts +4 -3
  28. package/src/components/Variants/Split/SplitVariant.d.ts +3 -2
  29. package/src/components/Variants/Split/SplitVariant.styles.d.ts +4 -3
  30. package/src/components/Variants/Standard/AuthError/StandardAuthError.d.ts +3 -2
  31. package/src/components/Variants/Standard/AuthError/StandardAuthError.styles.d.ts +4 -3
  32. package/src/components/Variants/Standard/ScoreState/StandardScoreState.d.ts +4 -3
  33. package/src/components/Variants/Standard/ScoreState/StandardScoreState.styles.d.ts +4 -3
  34. package/src/components/Variants/Standard/StandardVariant.d.ts +4 -3
  35. package/src/components/Variants/Standard/StandardVariant.styles.d.ts +4 -3
  36. package/src/constants/constants.d.ts +2 -1
  37. package/src/hooks/useClassicQuizById.d.ts +2 -1
  38. package/src/hooks/useEmbedCodeContainer.d.ts +1 -1
  39. package/src/hooks/useMyParticipation.d.ts +2 -1
  40. package/src/hooks/useScoreStateHelpers.d.ts +3 -2
  41. package/src/index.d.ts +2 -1
  42. package/src/main.d.ts +3 -2
  43. package/src/main.d.ts.map +1 -1
  44. package/src/types/types.d.ts +3 -2
  45. package/src/components/ClassicQuizNotFound.js +0 -55
  46. package/src/components/ClassicQuizPlay.js +0 -321
  47. package/src/components/Leads/CollectLead.js +0 -20
  48. package/src/components/Leads/LeadAgreementCheckbox.js +0 -45
  49. package/src/components/Leads/LeadForm.js +0 -289
  50. package/src/components/Shared/AlertMessage.js +0 -37
  51. package/src/components/Shared/Answers/Answers.js +0 -31
  52. package/src/components/Shared/Answers/Option.js +0 -118
  53. package/src/components/Shared/Button.js +0 -43
  54. package/src/components/Shared/MainCard.js +0 -24
  55. package/src/components/Shared/Pagination.js +0 -118
  56. package/src/components/Shared/PresentedBy.js +0 -51
  57. package/src/components/Shared/ScoreStateWrapper.js +0 -254
  58. package/src/components/Shared/Stepper.js +0 -75
  59. package/src/components/Shared/Stopwatch.js +0 -103
  60. package/src/components/Variants/Overlay/AuthError/OverlayAuthError.js +0 -68
  61. package/src/components/Variants/Overlay/AuthError/OverlayAuthError.styles.js +0 -103
  62. package/src/components/Variants/Overlay/OverlayVariant.js +0 -100
  63. package/src/components/Variants/Overlay/OverlayVariant.styles.js +0 -266
  64. package/src/components/Variants/Overlay/ScoreState/OverlayScoreState.js +0 -90
  65. package/src/components/Variants/Overlay/ScoreState/OverlayScoreState.styles.js +0 -374
  66. package/src/components/Variants/Split/AuthError/SplitAuthError.js +0 -44
  67. package/src/components/Variants/Split/AuthError/SplitAuthError.styles.js +0 -95
  68. package/src/components/Variants/Split/ScoreState/SplitScoreState.js +0 -84
  69. package/src/components/Variants/Split/ScoreState/SplitScoreState.styles.js +0 -400
  70. package/src/components/Variants/Split/SplitVariant.js +0 -79
  71. package/src/components/Variants/Split/SplitVariant.styles.js +0 -216
  72. package/src/components/Variants/Standard/AuthError/StandardAuthError.js +0 -43
  73. package/src/components/Variants/Standard/AuthError/StandardAuthError.styles.js +0 -201
  74. package/src/components/Variants/Standard/ScoreState/StandardScoreState.js +0 -78
  75. package/src/components/Variants/Standard/ScoreState/StandardScoreState.styles.js +0 -349
  76. package/src/components/Variants/Standard/StandardVariant.js +0 -82
  77. package/src/components/Variants/Standard/StandardVariant.styles.js +0 -373
  78. package/src/constants/constants.js +0 -446
  79. package/src/hooks/useClassicQuizById.js +0 -20
  80. package/src/hooks/useEmbedCodeContainer.js +0 -38
  81. package/src/hooks/useMyParticipation.js +0 -22
  82. package/src/hooks/useScoreStateHelpers.js +0 -156
  83. package/src/index.js +0 -2
  84. package/src/main.js +0 -53
  85. package/src/services/service.js +0 -1
  86. package/src/styles/form.styles.js +0 -18
  87. package/src/types/types.js +0 -1
  88. package/tsconfig.tsbuildinfo +0 -1
@@ -1,400 +0,0 @@
1
- export const createStyles = (props) => ({
2
- // Desktop image section with overlay
3
- desktopImageSection: (isTabulated) => ({
4
- display: { lg: "flex", xs: "none" },
5
- flexDirection: "column",
6
- justifyContent: "space-between",
7
- gap: "10px",
8
- flex: "0.5",
9
- backgroundImage: `url(${props.quizImage || props.imagePlaceholder})`,
10
- backgroundSize: "cover",
11
- backgroundPosition: "center",
12
- borderTopLeftRadius: isTabulated ? 0 : props.borderRadius.md,
13
- borderTopRightRadius: {
14
- xs: isTabulated ? 0 : props.borderRadius.md,
15
- md: "0",
16
- },
17
- borderBottomLeftRadius: {
18
- xs: 0,
19
- md: props.borderRadius.md,
20
- },
21
- overflow: "hidden",
22
- height: "auto",
23
- position: "relative",
24
- minHeight: { xs: "210px", md: "430px" },
25
- "&::before": {
26
- content: '""',
27
- position: "absolute",
28
- width: "100%",
29
- height: "100%",
30
- background: "linear-gradient(rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.7) 100%)",
31
- borderTopLeftRadius: "5px",
32
- borderTopRightRadius: "5px",
33
- },
34
- }),
35
- // Image section content
36
- imageSectionContent: {
37
- zIndex: 1,
38
- height: "100%",
39
- p: props.spacingScale.xl,
40
- display: "flex",
41
- flexDirection: "column",
42
- justifyContent: "space-between",
43
- },
44
- // Quiz headline typography
45
- quizHeadlineText: {
46
- fontWeight: 500,
47
- lineHeight: "166%",
48
- letterSpacing: "1px",
49
- fontSize: "0.75rem",
50
- color: props.brandingColors?.secondaryColor || props.darkTextColor,
51
- opacity: "70%",
52
- textTransform: "uppercase",
53
- fontFamily: props.fontFamilySecondary,
54
- textAlign: { xs: "center", md: "left" },
55
- },
56
- // Content container
57
- contentContainer: {
58
- display: "flex",
59
- flexDirection: "column",
60
- gap: props.spacingScale["3xs"],
61
- },
62
- // Quiz title typography
63
- quizTitleText: {
64
- fontWeight: 700,
65
- lineHeight: "133%",
66
- fontSize: "1.5rem",
67
- letterSpacing: "0.15px",
68
- color: props.brandingColors?.contentColor || props.darkTextColor,
69
- fontFamily: props.fontFamilyPrimary,
70
- textAlign: { xs: "center", md: "left" },
71
- },
72
- // Quiz description typography
73
- quizDescriptionText: {
74
- fontWeight: 500,
75
- lineHeight: "140%",
76
- fontSize: "1.25rem",
77
- letterSpacing: "0.15px",
78
- color: props.brandingColors?.secondaryColor || props.darkTextColor,
79
- opacity: "70%",
80
- fontFamily: props.fontFamilyPrimary,
81
- textAlign: { xs: "center", md: "left" },
82
- },
83
- // Presented by desktop container
84
- presentedByDesktop: {
85
- display: { xs: "none", md: "block" },
86
- },
87
- // Main question area
88
- questionArea: {
89
- flex: { lg: "0.5", xs: "1" },
90
- },
91
- // Question area content wrapper
92
- questionAreaContent: {
93
- p: props.spacingScale.lg,
94
- display: "flex",
95
- flexDirection: "column",
96
- justifyContent: "center",
97
- gap: "16px",
98
- },
99
- // Score container (main card)
100
- scoreContainer: {
101
- p: props.spacingScale.lg,
102
- gap: props.spacingScale.md,
103
- display: "flex",
104
- flexDirection: "column",
105
- backdropFilter: "blur(4px)",
106
- bgcolor: `rgba(${props.bgcolor ? props.bgcolor.replace(/[^\d,]/g, "") : ""}, 0.5)`,
107
- borderRadius: props.borderRadius.sm,
108
- boxShadow: "lg",
109
- },
110
- // Score content wrapper
111
- scoreContentWrapper: {
112
- display: "flex",
113
- flexDirection: "column",
114
- justifyContent: "center",
115
- alignItems: "center",
116
- alignSelf: "stretch",
117
- },
118
- // Score content container
119
- scoreContentContainer: {
120
- display: "flex",
121
- flexDirection: "column",
122
- alignItems: "center",
123
- gap: props.spacingScale["3xl"],
124
- alignSelf: "stretch",
125
- },
126
- // Score section
127
- scoreSection: {
128
- display: "flex",
129
- gap: props.spacingScale.xs,
130
- justifyContent: "center",
131
- alignSelf: "stretch",
132
- alignItems: "center",
133
- },
134
- // Score section wrapper
135
- scoreSectionWrapper: {
136
- display: "flex",
137
- flexDirection: { xs: "column", md: "row" },
138
- minWidth: "200px",
139
- p: props.spacingScale.xs,
140
- justifyContent: "center",
141
- alignItems: "center",
142
- gap: props.spacingScale.md,
143
- flex: "1 0 0",
144
- },
145
- // Achievement badge container
146
- achievementBadgeContainer: {
147
- display: "flex",
148
- width: { xs: "172px", md: "auto" },
149
- height: { xs: "160px", md: "auto" },
150
- flexDirection: "column",
151
- justifyContent: "center",
152
- alignItems: "center",
153
- position: "relative",
154
- },
155
- // Hexagon background
156
- hexagonBackground: {
157
- width: "160px",
158
- height: "160px",
159
- position: "absolute",
160
- top: "55%",
161
- left: "50%",
162
- transform: "translate(-50%, -50%)",
163
- },
164
- // Achievement emoji
165
- achievementEmoji: {
166
- maxWidth: "80px",
167
- maxHeight: "80px",
168
- position: "relative",
169
- },
170
- // Text section
171
- textSection: {
172
- display: "flex",
173
- flexDirection: "column",
174
- alignItems: "center",
175
- boxSizing: "border-box",
176
- },
177
- // Congratulations text
178
- congratulationsText: {
179
- color: props.textPrimary,
180
- textAlign: "center",
181
- fontFamily: props.fontFamilyPrimary,
182
- fontSize: "1.5rem",
183
- fontStyle: "normal",
184
- fontWeight: 400,
185
- lineHeight: "133.4%",
186
- px: 2,
187
- },
188
- // Score numbers container
189
- scoreNumbersContainer: {
190
- display: "flex",
191
- alignItems: "center",
192
- gap: "4px",
193
- },
194
- // Score numbers wrapper
195
- scoreNumbersWrapper: {
196
- display: "flex",
197
- alignItems: "flex-end",
198
- gap: "4px",
199
- },
200
- // Correct score text
201
- correctScoreText: (correct) => ({
202
- textAlign: "center",
203
- color: correct > 0 ? props.successColor : props.dangerColor,
204
- fontFamily: props.fontFamilyPrimary,
205
- fontSize: "3.75rem",
206
- fontStyle: "normal",
207
- fontWeight: 500,
208
- lineHeight: "120%",
209
- letterSpacing: "-0.5px",
210
- }),
211
- // Total score text
212
- totalScoreText: (correct) => ({
213
- textAlign: "center",
214
- color: correct > 0 ? props.successColor : props.dangerColor,
215
- fontFamily: props.fontFamilyPrimary,
216
- fontSize: "3.75rem",
217
- fontStyle: "normal",
218
- fontWeight: 500,
219
- lineHeight: "120%",
220
- letterSpacing: "-0.5px",
221
- }),
222
- // Time text
223
- timeText: {
224
- textAlign: "center",
225
- color: props.textPrimary,
226
- fontFamily: props.fontFamilySecondary,
227
- fontSize: "0.875rem",
228
- fontStyle: "normal",
229
- fontWeight: 700,
230
- lineHeight: "143%",
231
- letterSpacing: "0.024px",
232
- },
233
- // Points text
234
- pointsText: {
235
- textAlign: "center",
236
- color: props.textPrimary,
237
- fontFamily: props.fontFamilyPrimary,
238
- fontSize: "1.25rem",
239
- fontStyle: "normal",
240
- fontWeight: 500,
241
- lineHeight: "120%",
242
- letterSpacing: "0.15px",
243
- },
244
- // CTA container
245
- ctaContainer: {
246
- display: "flex",
247
- flexDirection: "column",
248
- alignItems: "center",
249
- gap: "24px",
250
- },
251
- // CTA content wrapper
252
- ctaContentWrapper: {
253
- display: "flex",
254
- flexDirection: "column",
255
- justifyContent: "center",
256
- alignItems: "center",
257
- gap: "16px",
258
- },
259
- // Thanks for playing text
260
- thanksText: {
261
- color: props.textPrimary,
262
- textAlign: "center",
263
- fontFamily: props.fontFamilyPrimary,
264
- fontSize: "1.25rem",
265
- fontStyle: "normal",
266
- fontWeight: 500,
267
- lineHeight: "120%",
268
- letterSpacing: "0.15px",
269
- },
270
- // Buttons container
271
- buttonsContainer: {
272
- display: "flex",
273
- flexDirection: { xs: "column", md: "row" },
274
- gap: "16px",
275
- },
276
- // Play again button
277
- playAgainButton: {
278
- display: "flex",
279
- py: props.spacingScale.xs,
280
- px: "16px",
281
- flexDirection: "column",
282
- justifyContent: "center",
283
- alignItems: "center",
284
- gap: "8px",
285
- borderRadius: props.borderRadius.xl,
286
- color: props.textPrimary,
287
- bgcolor: props.surfaceColor,
288
- "&:hover": {
289
- bgcolor: props.onSurfaceColor,
290
- },
291
- },
292
- // Play again button content
293
- playAgainButtonContent: {
294
- display: "flex",
295
- justifyContent: "center",
296
- alignItems: "center",
297
- gap: "8px",
298
- alignSelf: "stretch",
299
- },
300
- // Play again icon
301
- playAgainIcon: {
302
- display: "flex",
303
- width: "16px",
304
- height: "16px",
305
- justifyContent: "flex-end",
306
- alignItems: "center",
307
- color: props.textPrimary,
308
- },
309
- // Play again text
310
- playAgainText: {
311
- color: props.textPrimary,
312
- textAlign: "center",
313
- fontFamily: props.fontFamilyPrimary,
314
- fontSize: "0.8125rem",
315
- fontStyle: "normal",
316
- fontWeight: 500,
317
- lineHeight: "22px",
318
- letterSpacing: "0.46px",
319
- textTransform: "uppercase",
320
- },
321
- // Share button
322
- shareButton: {
323
- display: "flex",
324
- py: props.spacingScale.xs,
325
- px: "16px",
326
- flexDirection: "column",
327
- justifyContent: "center",
328
- alignItems: "center",
329
- gap: "10px",
330
- borderRadius: props.borderRadius.xl,
331
- bgcolor: props.primaryColor,
332
- "&:hover": {
333
- bgcolor: props.primaryColor,
334
- },
335
- },
336
- // Share button content
337
- shareButtonContent: {
338
- display: "flex",
339
- justifyContent: "center",
340
- alignItems: "center",
341
- gap: "8px",
342
- alignSelf: "stretch",
343
- },
344
- // Share icon
345
- shareIcon: {
346
- display: "flex",
347
- width: "16px",
348
- height: "16px",
349
- justifyContent: "center",
350
- alignItems: "center",
351
- color: props.onPrimaryColor,
352
- },
353
- // Share text
354
- shareText: {
355
- color: props.onPrimaryColor,
356
- textAlign: "center",
357
- fontFamily: props.fontFamilyPrimary,
358
- fontSize: "0.8125rem",
359
- fontStyle: "normal",
360
- fontWeight: 500,
361
- lineHeight: "22px",
362
- letterSpacing: "0.46px",
363
- textTransform: "uppercase",
364
- },
365
- // Presented by mobile
366
- presentedByMobile: {
367
- display: { xs: "block", md: "none" },
368
- },
369
- // Lead collection container
370
- leadCollectionContainer: {
371
- p: props.spacingScale.lg,
372
- gap: props.spacingScale.md,
373
- display: "flex",
374
- flexDirection: "column",
375
- backdropFilter: "blur(4px)",
376
- bgcolor: `rgba(${props.bgcolor ? props.bgcolor.replace(/[^\d,]/g, "") : ""}, 0.5)`,
377
- borderRadius: props.borderRadius.sm,
378
- boxShadow: "lg",
379
- },
380
- // Lead content wrapper
381
- leadContentWrapper: {
382
- display: "flex",
383
- flexDirection: "column",
384
- justifyContent: "center",
385
- alignItems: "center",
386
- alignSelf: "stretch",
387
- },
388
- alertMessageArea: {
389
- flex: {
390
- lg: 0.5,
391
- xs: 1,
392
- },
393
- display: "flex",
394
- flexDirection: "column",
395
- justifyContent: "center",
396
- },
397
- alertMessageWrapper: {
398
- p: props.spacingScale.lg,
399
- },
400
- });
@@ -1,79 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import React from "react";
3
- import { Box, Typography, Button as JoyButton, AspectRatio } from "@mui/joy";
4
- import { hexToRgb, stripHtmlTags, useImageUrl, isMobile, useColors, useCornerRadius, useFontFamily, useInternalTheme, useSpacingScale, } from "@fansunited/common";
5
- import Answers from "../../Shared/Answers/Answers";
6
- import Button from "../../Shared/Button";
7
- import ArrowRightAltIcon from "@mui/icons-material/ArrowRightAlt";
8
- import Stopwatch from "../../Shared/Stopwatch";
9
- import MainCard from "../../Shared/MainCard";
10
- import bgImage from "../../../assets/default-quiz-bg.png";
11
- import mobileBgImage from "../../../assets/default-quiz-bg-vertical.jpg";
12
- import { useTranslation } from "react-i18next";
13
- import PresentedBy from "../../Shared/PresentedBy";
14
- import CollectLead from "../../Leads/CollectLead";
15
- import { quizTypes } from "../../../constants/constants";
16
- import { useEmbedCode } from "../../../hooks/useEmbedCodeContainer";
17
- import { createStyles } from "./SplitVariant.styles";
18
- const SplitVariant = (props) => {
19
- const [showLead, setShowLead] = React.useState(props.leads?.position === "before" &&
20
- props.classicQuiz.authRequirement === "LEAD");
21
- const theme = useInternalTheme();
22
- const quizImage = useImageUrl(props.classicQuiz.images);
23
- const questionImage = useImageUrl(props.question.images);
24
- const { t } = useTranslation();
25
- const brandingColors = props.classicQuiz.branding?.colors || null;
26
- const brandingLogo = isMobile()
27
- ? props.classicQuiz.branding?.images.mobileLogo ||
28
- props.classicQuiz.branding?.images.mainLogo ||
29
- ""
30
- : props.classicQuiz.branding?.images.mainLogo || "";
31
- const imagePlaceholder = isMobile() ? mobileBgImage : bgImage;
32
- const embedContainerRef = useEmbedCode(props.question.embedCode, props.applyFilterScreen);
33
- // Styling variables
34
- const secondaryColor = brandingColors?.contentColor || useColors().textColor;
35
- const fontFamilySecondary = useFontFamily().secondary;
36
- const opacity = "60%";
37
- const fontFamilyPrimary = useFontFamily().primary;
38
- const buttonRadius = useCornerRadius().xl;
39
- const backgroundColor = brandingColors?.backgroundColor || useColors().surfaceVariant;
40
- const primaryColor = brandingColors?.primaryColor || useColors().palette?.primary?.plainColor;
41
- const onPrimaryColor = useColors().palette?.primary?.onPrimary;
42
- const textColor = useColors().textColor;
43
- const spacingScale = useSpacingScale();
44
- const borderRadius = useCornerRadius();
45
- const bgcolor = hexToRgb(backgroundColor || "");
46
- // Create styles with current props/theme values
47
- const styles = createStyles({
48
- quizImage,
49
- questionImage,
50
- imagePlaceholder,
51
- spacingScale,
52
- borderRadius,
53
- fontFamilyPrimary,
54
- fontFamilySecondary,
55
- secondaryColor,
56
- opacity,
57
- buttonRadius,
58
- bgcolor,
59
- primaryColor,
60
- onPrimaryColor,
61
- textColor,
62
- brandingColors,
63
- darkTextColor: theme.colorSchemes.dark.textColor,
64
- applyFilterScreen: props.applyFilterScreen,
65
- });
66
- const closeLeadForm = () => {
67
- setShowLead(false);
68
- };
69
- const renderPresentedBy = (textColor) => (_jsx(PresentedBy, { brandingLogo: brandingLogo, textColor: textColor }));
70
- return (_jsxs(MainCard, { brandingBorderColor: brandingColors?.borderColor || null, children: [_jsx(Box, { sx: styles.headlineSection, children: _jsxs(Box, { sx: styles.headlineContent, children: [_jsxs(Box, { children: [_jsx(Typography, { level: "body-sm", sx: styles.quizHeadlineText, children: t("classicQuiz.headline") }), _jsxs(Box, { sx: styles.contentContainer, children: [_jsx(Typography, { level: "body-lg", sx: styles.quizTitleText, children: props.classicQuiz.title }), _jsx(Typography, { level: "body-md", sx: styles.quizDescriptionText, children: stripHtmlTags(props.classicQuiz.description) })] })] }), props.applyFilterScreen ? (_jsx(Box, { children: _jsxs(Box, { sx: styles.filterScreenBottomContainer, children: [renderPresentedBy(brandingColors?.contentColor ||
71
- theme.colorSchemes.dark.textColor), _jsx(JoyButton, { variant: "soft", sx: {
72
- ...styles.startButton,
73
- ...styles.pulseAnimation,
74
- }, endDecorator: _jsx(ArrowRightAltIcon, {}), onClick: props.startPlaying, children: _jsx(Typography, { sx: styles.startButtonText, children: t("classicQuiz.buttons.start") }) })] }) })) : (_jsx(Box, { sx: styles.presentedByDesktop, children: renderPresentedBy(brandingColors?.contentColor ||
75
- theme.colorSchemes.dark.textColor) }))] }) }), _jsx(Box, { sx: styles.questionArea, children: showLead ? (_jsx(Box, { sx: styles.leadContentContainer, children: _jsx(CollectLead, { sdk: props.sdk, contentType: "quiz", startGame: closeLeadForm, contentId: props.classicQuiz.id, contentName: props.classicQuiz.title, brandingColors: props.classicQuiz.branding?.colors, brandingUrls: props.classicQuiz.branding?.urls, campaignId: props.leads?.campaignId, campaignName: props.leads?.campaignName, fields: props.leads?.fields, leadTitle: props.classicQuiz.labels?.leadTitle, leadDescription: props.classicQuiz.labels?.leadDescription, leadCta: props.classicQuiz.labels?.leadCta, leadSuccessTitle: props.classicQuiz.labels?.leadSuccessTitle, leadSuccessDescription: props.classicQuiz.labels?.leadSuccessDescription }) })) : (_jsxs(_Fragment, { children: [quizTypes.includes(props.classicQuiz.type?.toLocaleLowerCase()) && (_jsx(Box, { sx: styles.stopwatchContainer, children: _jsx(Stopwatch, { brandingPrimaryColor: brandingColors?.primaryColor || null, isRunning: props.isStopwatchRunning, timer: props.stopwatchTime, quizType: props.classicQuiz.type, initialTime: props.classicQuiz.time || 10, onTimeUpdate: props.onTimeUpdate }) })), _jsxs(Box, { sx: styles.mainContentContainer, children: [props.question.embedCode && (_jsx(AspectRatio, { ratio: "16/9", sx: styles.aspectRatioContainer, children: _jsx(Box, { ref: embedContainerRef }) })), !props.question.embedCode && questionImage && (_jsx(AspectRatio, { ratio: "16/9", sx: styles.questionImageContainer, children: _jsx(Box, { sx: styles.questionImageBox, children: _jsx("img", { src: questionImage, alt: "Question illustration", style: styles.questionImage }) }) })), _jsxs(Box, { sx: styles.questionSection, children: [_jsxs(Typography, { level: "body-lg", sx: styles.questionStepsText, children: [props.currentQuestion, "/", props.classicQuiz.questionsCount] }), _jsx(Typography, { level: "body-lg", sx: styles.questionText, children: props.question.question })] }), _jsx(Answers, { options: props.question.options || [], answerQuestion: props.answerQuestion, selectedOption: props.selectedOption, showAnswer: props.showAnswer, twoByTwo: true, questionImage: questionImage, brandingColors: brandingColors }), _jsxs(Box, { sx: styles.buttonFooterContainer, children: [_jsx(Button, { showAnswer: props.showAnswer, selectedOption: props.selectedOption, endDecorator: _jsx(ArrowRightAltIcon, {}), label: props.currentQuestion === props.classicQuiz.questionsCount
76
- ? t("classicQuiz.buttons.finish")
77
- : t("classicQuiz.buttons.next"), buttonColor: primaryColor, onClick: props.handleNext }), _jsx(Box, { sx: styles.presentedByMobile, children: renderPresentedBy(brandingColors?.contentColor || textColor) })] })] })] })) })] }));
78
- };
79
- export default SplitVariant;
@@ -1,216 +0,0 @@
1
- export const createStyles = (props) => ({
2
- // Pulse animation for buttons
3
- pulseAnimation: {
4
- "@keyframes pulse": {
5
- "0%": { transform: "scale(1)" },
6
- "50%": { transform: "scale(1.05)" },
7
- "100%": { transform: "scale(1)" },
8
- },
9
- },
10
- // Main headline section with background image
11
- headlineSection: {
12
- display: "flex",
13
- flexDirection: "column",
14
- justifyContent: "space-between",
15
- gap: "10px",
16
- flex: "0.5",
17
- backgroundImage: `url(${props.quizImage || props.imagePlaceholder})`,
18
- backgroundSize: "cover",
19
- backgroundPosition: "center",
20
- borderTopLeftRadius: props.borderRadius.md,
21
- borderTopRightRadius: { xs: props.borderRadius.md, md: "0" },
22
- borderBottomLeftRadius: { xs: 0, md: props.borderRadius.md },
23
- overflow: "hidden",
24
- height: "auto",
25
- position: "relative",
26
- minHeight: { xs: "210px", md: "430px" },
27
- "&::before": {
28
- content: '""',
29
- position: "absolute",
30
- width: "100%",
31
- height: "100%",
32
- background: "linear-gradient(270deg, rgba(255, 255, 255, 0) 0%, rgba(18, 18, 18, 0.8) 100%)",
33
- borderTopLeftRadius: "5px",
34
- borderTopRightRadius: "5px",
35
- },
36
- },
37
- // Headline content wrapper
38
- headlineContent: {
39
- zIndex: 1,
40
- height: "100%",
41
- p: props.spacingScale.xl,
42
- gap: props.spacingScale.xl,
43
- display: "flex",
44
- flexDirection: "column",
45
- justifyContent: "space-between",
46
- },
47
- // Quiz headline typography
48
- quizHeadlineText: {
49
- fontWeight: 500,
50
- lineHeight: "166%",
51
- letterSpacing: "1px",
52
- fontSize: "0.75rem",
53
- color: props.brandingColors?.secondaryColor || props.darkTextColor,
54
- opacity: "70%",
55
- textTransform: "uppercase",
56
- fontFamily: props.fontFamilySecondary,
57
- textAlign: { xs: "center", md: "left" },
58
- },
59
- // Content container
60
- contentContainer: {
61
- display: "flex",
62
- flexDirection: "column",
63
- gap: props.spacingScale["3xs"],
64
- },
65
- // Quiz title typography
66
- quizTitleText: {
67
- fontWeight: 700,
68
- lineHeight: "133%",
69
- fontSize: "1.5rem",
70
- letterSpacing: "0.15px",
71
- color: props.brandingColors?.contentColor || props.darkTextColor,
72
- fontFamily: props.fontFamilyPrimary,
73
- textAlign: { xs: "center", md: "left" },
74
- },
75
- // Quiz description typography
76
- quizDescriptionText: {
77
- fontWeight: 500,
78
- lineHeight: "140%",
79
- fontSize: "1.25rem",
80
- letterSpacing: "0.15px",
81
- color: props.brandingColors?.secondaryColor || props.darkTextColor,
82
- opacity: "70%",
83
- fontFamily: props.fontFamilyPrimary,
84
- textAlign: { xs: "center", md: "left" },
85
- },
86
- // Filter screen bottom container
87
- filterScreenBottomContainer: {
88
- display: "flex",
89
- flexDirection: { md: "row", xs: "column-reverse" },
90
- justifyContent: "space-between",
91
- alignItems: "center",
92
- gap: props.spacingScale.lg,
93
- },
94
- // Start button (filter screen)
95
- startButton: {
96
- borderRadius: props.buttonRadius,
97
- bgcolor: props.primaryColor,
98
- color: props.onPrimaryColor,
99
- "&:hover": {
100
- bgcolor: props.primaryColor,
101
- },
102
- "&:active": {
103
- color: props.onPrimaryColor,
104
- },
105
- animation: "pulse 1s infinite",
106
- },
107
- // Start button text
108
- startButtonText: {
109
- fontFamily: props.fontFamilyPrimary,
110
- fontWeight: 500,
111
- fontSize: "0.9375rem",
112
- lineHeight: "24px",
113
- letterSpacing: "0.46px",
114
- textTransform: "uppercase",
115
- color: "#FFFFFF",
116
- gap: "8px",
117
- display: "flex",
118
- alignItems: "center",
119
- },
120
- // Presented by desktop container
121
- presentedByDesktop: {
122
- display: { xs: "none", md: "block" },
123
- },
124
- // Question area
125
- questionArea: {
126
- flex: "0.5",
127
- display: props.applyFilterScreen ? "none" : "flex",
128
- flexDirection: "column",
129
- justifyContent: "center",
130
- gap: "10px",
131
- p: props.spacingScale.lg,
132
- },
133
- // Stopwatch container
134
- stopwatchContainer: {
135
- display: "flex",
136
- justifyContent: "center",
137
- },
138
- // Lead content container (filter screen)
139
- leadContentContainer: {
140
- p: props.spacingScale.md,
141
- gap: props.spacingScale.md,
142
- display: "flex",
143
- flexDirection: "column",
144
- backdropFilter: "blur(4px)",
145
- bgcolor: `rgba(${props.bgcolor ? props.bgcolor.replace(/[^\d,]/g, "") : ""}, 0.5)`,
146
- borderRadius: props.borderRadius.sm,
147
- },
148
- // Main content container
149
- mainContentContainer: {
150
- p: props.spacingScale.lg,
151
- gap: props.spacingScale.md,
152
- display: "flex",
153
- flexDirection: "column",
154
- backdropFilter: "blur(4px)",
155
- bgcolor: `rgba(${props.bgcolor ? props.bgcolor.replace(/[^\d,]/g, "") : ""}, 0.5)`,
156
- borderRadius: props.borderRadius.sm,
157
- },
158
- // Aspect ratio container for embed/image
159
- aspectRatioContainer: {
160
- borderRadius: props.borderRadius.sm,
161
- },
162
- // Question image container
163
- questionImageContainer: {
164
- overflow: "hidden",
165
- borderRadius: props.borderRadius.sm,
166
- },
167
- // Question image box
168
- questionImageBox: {
169
- borderRadius: props.borderRadius.sm,
170
- overflow: "hidden",
171
- height: "auto",
172
- },
173
- // Question image
174
- questionImage: {
175
- width: "100%",
176
- height: "100%",
177
- objectFit: "cover",
178
- },
179
- // Question section
180
- questionSection: {
181
- gap: "8px",
182
- display: { md: "flex", xs: "block" },
183
- justifyContent: "center",
184
- },
185
- // Question steps typography
186
- questionStepsText: {
187
- fontFamily: props.fontFamilyPrimary,
188
- lineHeight: "150%",
189
- letterSpacing: "0.15px",
190
- fontWeight: 500,
191
- fontSize: "1.25rem",
192
- color: props.secondaryColor,
193
- opacity: props.opacity,
194
- textAlign: "center",
195
- },
196
- // Question text
197
- questionText: {
198
- fontFamily: props.fontFamilyPrimary,
199
- lineHeight: "150%",
200
- letterSpacing: "0.15px",
201
- fontWeight: 500,
202
- fontSize: "1.25rem",
203
- textAlign: "center",
204
- color: props.textColor,
205
- },
206
- // Button and footer container
207
- buttonFooterContainer: {
208
- display: "flex",
209
- flexDirection: "column",
210
- gap: props.spacingScale.lg,
211
- },
212
- // Presented by mobile container
213
- presentedByMobile: {
214
- display: { xs: "block", md: "none" },
215
- },
216
- });