fansunited-frontend-components 0.0.1-RC4 → 0.0.1-RC5

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 (141) hide show
  1. package/{components.js → classic-quiz-play.es.js} +1 -1
  2. package/classic-quiz-play.umd.js +174 -0
  3. package/index.d.ts +3 -0
  4. package/package.json +2 -2
  5. package/src/components/ClassicQuizNotFound.d.ts +4 -0
  6. package/src/components/ClassicQuizNotFound.d.ts.map +1 -0
  7. package/src/components/ClassicQuizNotFound.js +55 -0
  8. package/src/components/ClassicQuizPlay.d.ts +5 -0
  9. package/src/components/ClassicQuizPlay.d.ts.map +1 -0
  10. package/src/components/ClassicQuizPlay.js +321 -0
  11. package/src/components/Leads/CollectLead.d.ts +22 -0
  12. package/src/components/Leads/CollectLead.d.ts.map +1 -0
  13. package/src/components/Leads/CollectLead.js +20 -0
  14. package/src/components/Leads/LeadAgreementCheckbox.d.ts +10 -0
  15. package/src/components/Leads/LeadAgreementCheckbox.d.ts.map +1 -0
  16. package/src/components/Leads/LeadAgreementCheckbox.js +45 -0
  17. package/src/components/Leads/LeadForm.d.ts +20 -0
  18. package/src/components/Leads/LeadForm.d.ts.map +1 -0
  19. package/src/components/Leads/LeadForm.js +289 -0
  20. package/src/components/Shared/AlertMessage.d.ts +10 -0
  21. package/src/components/Shared/AlertMessage.d.ts.map +1 -0
  22. package/src/components/Shared/AlertMessage.js +37 -0
  23. package/src/components/Shared/Answers/Answers.d.ts +14 -0
  24. package/src/components/Shared/Answers/Answers.d.ts.map +1 -0
  25. package/src/components/Shared/Answers/Answers.js +31 -0
  26. package/src/components/Shared/Answers/Option.d.ts +13 -0
  27. package/src/components/Shared/Answers/Option.d.ts.map +1 -0
  28. package/src/components/Shared/Answers/Option.js +118 -0
  29. package/src/components/Shared/Button.d.ts +12 -0
  30. package/src/components/Shared/Button.d.ts.map +1 -0
  31. package/src/components/Shared/Button.js +43 -0
  32. package/src/components/Shared/MainCard.d.ts +10 -0
  33. package/src/components/Shared/MainCard.d.ts.map +1 -0
  34. package/src/components/Shared/MainCard.js +24 -0
  35. package/src/components/Shared/Pagination.d.ts +10 -0
  36. package/src/components/Shared/Pagination.d.ts.map +1 -0
  37. package/src/components/Shared/Pagination.js +118 -0
  38. package/src/components/Shared/PresentedBy.d.ts +8 -0
  39. package/src/components/Shared/PresentedBy.d.ts.map +1 -0
  40. package/src/components/Shared/PresentedBy.js +51 -0
  41. package/src/components/Shared/ScoreStateWrapper.d.ts +13 -0
  42. package/src/components/Shared/ScoreStateWrapper.d.ts.map +1 -0
  43. package/src/components/Shared/ScoreStateWrapper.js +254 -0
  44. package/src/components/Shared/Stepper.d.ts +11 -0
  45. package/src/components/Shared/Stepper.d.ts.map +1 -0
  46. package/src/components/Shared/Stepper.js +75 -0
  47. package/src/components/Shared/Stopwatch.d.ts +12 -0
  48. package/src/components/Shared/Stopwatch.d.ts.map +1 -0
  49. package/src/components/Shared/Stopwatch.js +103 -0
  50. package/src/components/Variants/Overlay/AuthError/OverlayAuthError.d.ts +8 -0
  51. package/src/components/Variants/Overlay/AuthError/OverlayAuthError.d.ts.map +1 -0
  52. package/src/components/Variants/Overlay/AuthError/OverlayAuthError.js +68 -0
  53. package/src/components/Variants/Overlay/AuthError/OverlayAuthError.styles.d.ts +118 -0
  54. package/src/components/Variants/Overlay/AuthError/OverlayAuthError.styles.d.ts.map +1 -0
  55. package/src/components/Variants/Overlay/AuthError/OverlayAuthError.styles.js +103 -0
  56. package/src/components/Variants/Overlay/OverlayVariant.d.ts +5 -0
  57. package/src/components/Variants/Overlay/OverlayVariant.d.ts.map +1 -0
  58. package/src/components/Variants/Overlay/OverlayVariant.js +100 -0
  59. package/src/components/Variants/Overlay/OverlayVariant.styles.d.ts +286 -0
  60. package/src/components/Variants/Overlay/OverlayVariant.styles.d.ts.map +1 -0
  61. package/src/components/Variants/Overlay/OverlayVariant.styles.js +266 -0
  62. package/src/components/Variants/Overlay/ScoreState/OverlayScoreState.d.ts +16 -0
  63. package/src/components/Variants/Overlay/ScoreState/OverlayScoreState.d.ts.map +1 -0
  64. package/src/components/Variants/Overlay/ScoreState/OverlayScoreState.js +90 -0
  65. package/src/components/Variants/Overlay/ScoreState/OverlayScoreState.styles.d.ts +364 -0
  66. package/src/components/Variants/Overlay/ScoreState/OverlayScoreState.styles.d.ts.map +1 -0
  67. package/src/components/Variants/Overlay/ScoreState/OverlayScoreState.styles.js +374 -0
  68. package/src/components/Variants/Split/AuthError/SplitAuthError.d.ts +8 -0
  69. package/src/components/Variants/Split/AuthError/SplitAuthError.d.ts.map +1 -0
  70. package/src/components/Variants/Split/AuthError/SplitAuthError.js +44 -0
  71. package/src/components/Variants/Split/AuthError/SplitAuthError.styles.d.ts +126 -0
  72. package/src/components/Variants/Split/AuthError/SplitAuthError.styles.d.ts.map +1 -0
  73. package/src/components/Variants/Split/AuthError/SplitAuthError.styles.js +95 -0
  74. package/src/components/Variants/Split/ScoreState/SplitScoreState.d.ts +16 -0
  75. package/src/components/Variants/Split/ScoreState/SplitScoreState.d.ts.map +1 -0
  76. package/src/components/Variants/Split/ScoreState/SplitScoreState.js +84 -0
  77. package/src/components/Variants/Split/ScoreState/SplitScoreState.styles.d.ts +403 -0
  78. package/src/components/Variants/Split/ScoreState/SplitScoreState.styles.d.ts.map +1 -0
  79. package/src/components/Variants/Split/ScoreState/SplitScoreState.styles.js +400 -0
  80. package/src/components/Variants/Split/SplitVariant.d.ts +5 -0
  81. package/src/components/Variants/Split/SplitVariant.d.ts.map +1 -0
  82. package/src/components/Variants/Split/SplitVariant.js +79 -0
  83. package/src/components/Variants/Split/SplitVariant.styles.d.ts +252 -0
  84. package/src/components/Variants/Split/SplitVariant.styles.d.ts.map +1 -0
  85. package/src/components/Variants/Split/SplitVariant.styles.js +216 -0
  86. package/src/components/Variants/Standard/AuthError/StandardAuthError.d.ts +9 -0
  87. package/src/components/Variants/Standard/AuthError/StandardAuthError.d.ts.map +1 -0
  88. package/src/components/Variants/Standard/AuthError/StandardAuthError.js +43 -0
  89. package/src/components/Variants/Standard/AuthError/StandardAuthError.styles.d.ts +231 -0
  90. package/src/components/Variants/Standard/AuthError/StandardAuthError.styles.d.ts.map +1 -0
  91. package/src/components/Variants/Standard/AuthError/StandardAuthError.styles.js +201 -0
  92. package/src/components/Variants/Standard/ScoreState/StandardScoreState.d.ts +17 -0
  93. package/src/components/Variants/Standard/ScoreState/StandardScoreState.d.ts.map +1 -0
  94. package/src/components/Variants/Standard/ScoreState/StandardScoreState.js +78 -0
  95. package/src/components/Variants/Standard/ScoreState/StandardScoreState.styles.d.ts +350 -0
  96. package/src/components/Variants/Standard/ScoreState/StandardScoreState.styles.d.ts.map +1 -0
  97. package/src/components/Variants/Standard/ScoreState/StandardScoreState.styles.js +349 -0
  98. package/src/components/Variants/Standard/StandardVariant.d.ts +10 -0
  99. package/src/components/Variants/Standard/StandardVariant.d.ts.map +1 -0
  100. package/src/components/Variants/Standard/StandardVariant.js +82 -0
  101. package/src/components/Variants/Standard/StandardVariant.styles.d.ts +414 -0
  102. package/src/components/Variants/Standard/StandardVariant.styles.d.ts.map +1 -0
  103. package/src/components/Variants/Standard/StandardVariant.styles.js +373 -0
  104. package/src/constants/constants.d.ts +7 -0
  105. package/src/constants/constants.d.ts.map +1 -0
  106. package/src/constants/constants.js +446 -0
  107. package/src/hooks/useClassicQuizById.d.ts +3 -0
  108. package/src/hooks/useClassicQuizById.d.ts.map +1 -0
  109. package/src/hooks/useClassicQuizById.js +20 -0
  110. package/src/hooks/useEmbedCodeContainer.d.ts +2 -0
  111. package/src/hooks/useEmbedCodeContainer.d.ts.map +1 -0
  112. package/src/hooks/useEmbedCodeContainer.js +38 -0
  113. package/src/hooks/useMyParticipation.d.ts +3 -0
  114. package/src/hooks/useMyParticipation.d.ts.map +1 -0
  115. package/src/hooks/useMyParticipation.js +22 -0
  116. package/src/hooks/useScoreStateHelpers.d.ts +18 -0
  117. package/src/hooks/useScoreStateHelpers.d.ts.map +1 -0
  118. package/src/hooks/useScoreStateHelpers.js +156 -0
  119. package/src/index.d.ts +2 -3
  120. package/src/index.d.ts.map +1 -1
  121. package/src/index.js +2 -0
  122. package/src/main.d.ts +5 -0
  123. package/src/main.d.ts.map +1 -0
  124. package/src/main.js +53 -0
  125. package/src/services/service.d.ts +1 -0
  126. package/src/services/service.d.ts.map +1 -0
  127. package/src/services/service.js +1 -0
  128. package/src/styles/form.styles.d.ts +19 -0
  129. package/src/styles/form.styles.d.ts.map +1 -0
  130. package/src/styles/form.styles.js +18 -0
  131. package/src/types/types.d.ts +28 -0
  132. package/src/types/types.d.ts.map +1 -0
  133. package/src/types/types.js +1 -0
  134. package/tsconfig.tsbuildinfo +1 -0
  135. package/components.d.ts +0 -1
  136. package/src/indexUmd.d.ts +0 -2
  137. package/src/indexUmd.d.ts.map +0 -1
  138. package/vite.config.d.ts +0 -3
  139. package/vite.config.d.ts.map +0 -1
  140. package/vite.config.umd.d.ts +0 -3
  141. package/vite.config.umd.d.ts.map +0 -1
@@ -0,0 +1,231 @@
1
+ import { CustomBorderRadius, CustomSpacingScale } from "@fansunited/common";
2
+ import { BrandingColorsModel } from "fansunited-sdk-esm";
3
+ import { CSSProperties } from "react";
4
+ interface StyleProps {
5
+ quizImage: string | null;
6
+ spacingScale: CustomSpacingScale;
7
+ borderRadius: CustomBorderRadius;
8
+ fontFamilyPrimary: string;
9
+ fontFamilySecondary: string;
10
+ darkTextColor: string;
11
+ textColor: string;
12
+ secondaryColor: string;
13
+ brandingColors: BrandingColorsModel;
14
+ opacity: string;
15
+ imagePosition: "left" | "right";
16
+ }
17
+ export declare const createStyles: (props: StyleProps) => {
18
+ mobileHeadlineWithImage: {
19
+ display: {
20
+ xs: string;
21
+ md: string;
22
+ };
23
+ flexDirection: string;
24
+ justifyContent: string;
25
+ gap: string;
26
+ backgroundImage: string;
27
+ backgroundSize: string;
28
+ backgroundPosition: string;
29
+ borderTopLeftRadius: string;
30
+ borderTopRightRadius: string;
31
+ position: string;
32
+ minHeight: string;
33
+ overflow: string;
34
+ height: string;
35
+ "&::before": {
36
+ content: string;
37
+ position: string;
38
+ width: string;
39
+ height: string;
40
+ background: string;
41
+ borderTopLeftRadius: string;
42
+ borderTopRightRadius: string;
43
+ };
44
+ };
45
+ mobileHeadlineContent: {
46
+ zIndex: number;
47
+ height: string;
48
+ p: string;
49
+ gap: string;
50
+ display: string;
51
+ flexDirection: string;
52
+ justifyContent: string;
53
+ };
54
+ mobileHeadlineWithoutImage: {
55
+ display: {
56
+ xs: string;
57
+ md: string;
58
+ };
59
+ flex: string;
60
+ flexDirection: string;
61
+ justifyContent: string;
62
+ p: string;
63
+ gap: string;
64
+ };
65
+ headlineTypographyMobileImage: {
66
+ fontWeight: number;
67
+ lineHeight: string;
68
+ letterSpacing: string;
69
+ fontSize: string;
70
+ color: string;
71
+ opacity: string;
72
+ textTransform: string;
73
+ fontFamily: string;
74
+ textAlign: string;
75
+ };
76
+ headlineTypography: {
77
+ fontWeight: number;
78
+ lineHeight: string;
79
+ letterSpacing: string;
80
+ textTransform: string;
81
+ fontSize: string;
82
+ color: string;
83
+ opacity: string;
84
+ fontFamily: string;
85
+ textAlign: string;
86
+ };
87
+ titleTypographyMobileImage: {
88
+ fontWeight: number;
89
+ lineHeight: string;
90
+ fontSize: string;
91
+ letterSpacing: string;
92
+ color: string;
93
+ fontFamily: string;
94
+ textAlign: string;
95
+ };
96
+ titleTypography: {
97
+ fontWeight: number;
98
+ lineHeight: string;
99
+ letterSpacing: string;
100
+ fontSize: string;
101
+ color: string;
102
+ fontFamily: string;
103
+ textAlign: {
104
+ xs: string;
105
+ md: string;
106
+ };
107
+ };
108
+ descriptionTypographyMobileImage: {
109
+ fontWeight: number;
110
+ lineHeight: string;
111
+ fontSize: string;
112
+ letterSpacing: string;
113
+ color: string;
114
+ opacity: string;
115
+ fontFamily: string;
116
+ textAlign: string;
117
+ };
118
+ descriptionTypography: {
119
+ fontWeight: number;
120
+ lineHeight: string;
121
+ letterSpacing: string;
122
+ fontSize: string;
123
+ color: string;
124
+ opacity: string;
125
+ fontFamily: string;
126
+ textAlign: {
127
+ xs: string;
128
+ md: string;
129
+ };
130
+ };
131
+ titleTypographyDesktop: {
132
+ fontWeight: number;
133
+ lineHeight: string;
134
+ letterSpacing: string;
135
+ fontSize: string;
136
+ color: string;
137
+ fontFamily: string;
138
+ };
139
+ descriptionTypographyDesktop: {
140
+ fontWeight: number;
141
+ lineHeight: string;
142
+ letterSpacing: string;
143
+ fontSize: string;
144
+ color: string;
145
+ opacity: string;
146
+ fontFamily: string;
147
+ };
148
+ imageContainerLeft: {
149
+ display: {
150
+ xs: string;
151
+ md: string;
152
+ };
153
+ flex: string;
154
+ borderTopLeftRadius: string;
155
+ borderBottomLeftRadius: string;
156
+ overflow: string;
157
+ height: string;
158
+ position: string;
159
+ };
160
+ imageContainerRight: {
161
+ display: {
162
+ xs: string;
163
+ md: string;
164
+ };
165
+ flex: string;
166
+ borderTopRightRadius: string;
167
+ borderBottomRightRadius: string;
168
+ overflow: string;
169
+ height: string;
170
+ position: string;
171
+ };
172
+ mainContentArea: {
173
+ flex: {
174
+ xs: string;
175
+ md: string;
176
+ };
177
+ display: {
178
+ md: string;
179
+ };
180
+ flexDirection: string;
181
+ p: string;
182
+ gap: {
183
+ xs: string;
184
+ md: string;
185
+ };
186
+ };
187
+ desktopHeadlineContainer: {
188
+ display: {
189
+ xs: string;
190
+ md: string;
191
+ };
192
+ flexDirection: string;
193
+ justifyContent: string;
194
+ gap: string;
195
+ textAlign: string;
196
+ };
197
+ contentContainer: {
198
+ display: string;
199
+ flexDirection: string;
200
+ gap: string;
201
+ };
202
+ questionArea: {
203
+ display: string;
204
+ flexDirection: string;
205
+ p: string;
206
+ };
207
+ questionContainer: {
208
+ display: string;
209
+ flexDirection: string;
210
+ gap: {
211
+ xs: string;
212
+ md: string;
213
+ };
214
+ };
215
+ alertContainer: {
216
+ px: string;
217
+ pt: string;
218
+ pb: string;
219
+ gap: string;
220
+ display: string;
221
+ flexDirection: string;
222
+ backdropFilter: string;
223
+ };
224
+ quizImage: {
225
+ width: string;
226
+ height: string;
227
+ objectFit: CSSProperties["objectFit"];
228
+ };
229
+ };
230
+ export {};
231
+ //# sourceMappingURL=StandardAuthError.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StandardAuthError.styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Variants/Standard/AuthError/StandardAuthError.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,UAAU,UAAU;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,EAAE,kBAAkB,CAAC;IACjC,YAAY,EAAE,kBAAkB,CAAC;IACjC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,mBAAmB,CAAC;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC;CACjC;AAED,eAAO,MAAM,YAAY,UAAW,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBA0NpB,aAAa,CAAC,WAAW,CAAC;;CAElD,CAAC"}
@@ -0,0 +1,201 @@
1
+ export const createStyles = (props) => ({
2
+ // Mobile headline with image background
3
+ mobileHeadlineWithImage: {
4
+ display: { xs: "flex", md: "none" },
5
+ flexDirection: "column",
6
+ justifyContent: "space-between",
7
+ gap: "10px",
8
+ backgroundImage: `url(${props.quizImage})`,
9
+ backgroundSize: "cover",
10
+ backgroundPosition: "center",
11
+ borderTopLeftRadius: "5px",
12
+ borderTopRightRadius: "5px",
13
+ position: "relative",
14
+ minHeight: "210px",
15
+ overflow: "hidden",
16
+ height: "auto",
17
+ "&::before": {
18
+ content: '""',
19
+ position: "absolute",
20
+ width: "100%",
21
+ height: "100%",
22
+ background: "linear-gradient(rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.7) 100%)",
23
+ borderTopLeftRadius: "5px",
24
+ borderTopRightRadius: "5px",
25
+ },
26
+ },
27
+ // Content inside mobile headline with image
28
+ mobileHeadlineContent: {
29
+ zIndex: 1,
30
+ height: "100%",
31
+ p: props.spacingScale.xl,
32
+ gap: props.spacingScale["2xl"],
33
+ display: "flex",
34
+ flexDirection: "column",
35
+ justifyContent: "space-between",
36
+ },
37
+ // Mobile headline without image
38
+ mobileHeadlineWithoutImage: {
39
+ display: { xs: "flex", md: "none" },
40
+ flex: "0.5",
41
+ flexDirection: "column",
42
+ justifyContent: "space-between",
43
+ p: props.spacingScale.lg,
44
+ gap: props.spacingScale["2xl"],
45
+ },
46
+ // Headline typography (mobile with image)
47
+ headlineTypographyMobileImage: {
48
+ fontWeight: 500,
49
+ lineHeight: "166%",
50
+ letterSpacing: "1px",
51
+ fontSize: "0.75rem",
52
+ color: props.brandingColors?.secondaryColor || props.darkTextColor,
53
+ opacity: "70%",
54
+ textTransform: "uppercase",
55
+ fontFamily: props.fontFamilySecondary,
56
+ textAlign: "center",
57
+ },
58
+ // Headline typography (mobile without image & desktop)
59
+ headlineTypography: {
60
+ fontWeight: 500,
61
+ lineHeight: "166%",
62
+ letterSpacing: "1px",
63
+ textTransform: "uppercase",
64
+ fontSize: "0.75rem",
65
+ color: props.secondaryColor,
66
+ opacity: props.opacity,
67
+ fontFamily: props.fontFamilySecondary,
68
+ textAlign: "center",
69
+ },
70
+ // Title typography (mobile with image)
71
+ titleTypographyMobileImage: {
72
+ fontWeight: 700,
73
+ lineHeight: "133%",
74
+ fontSize: "1.5rem",
75
+ letterSpacing: "0.15px",
76
+ color: props.brandingColors?.contentColor || props.darkTextColor,
77
+ fontFamily: props.fontFamilyPrimary,
78
+ textAlign: "center",
79
+ },
80
+ // Title typography (mobile without image & desktop)
81
+ titleTypography: {
82
+ fontWeight: 700,
83
+ lineHeight: "133%",
84
+ letterSpacing: "0px",
85
+ fontSize: "1.5rem",
86
+ color: props.textColor,
87
+ fontFamily: props.fontFamilyPrimary,
88
+ textAlign: { xs: "center", md: "left" },
89
+ },
90
+ // Description typography (mobile with image)
91
+ descriptionTypographyMobileImage: {
92
+ fontWeight: 500,
93
+ lineHeight: "140%",
94
+ fontSize: "1.25rem",
95
+ letterSpacing: "0.15px",
96
+ color: props.brandingColors?.secondaryColor || props.darkTextColor,
97
+ opacity: "70%",
98
+ fontFamily: props.fontFamilyPrimary,
99
+ textAlign: "center",
100
+ },
101
+ // Description typography (mobile without image & desktop)
102
+ descriptionTypography: {
103
+ fontWeight: 500,
104
+ lineHeight: "140%",
105
+ letterSpacing: "0.15px",
106
+ fontSize: "1.25rem",
107
+ color: props.secondaryColor,
108
+ opacity: props.opacity,
109
+ fontFamily: props.fontFamilyPrimary,
110
+ textAlign: { xs: "center", md: "left" },
111
+ },
112
+ // Desktop title typography (centered)
113
+ titleTypographyDesktop: {
114
+ fontWeight: 700,
115
+ lineHeight: "133%",
116
+ letterSpacing: "0px",
117
+ fontSize: "1.5rem",
118
+ color: props.textColor,
119
+ fontFamily: props.fontFamilyPrimary,
120
+ },
121
+ // Desktop description typography (centered)
122
+ descriptionTypographyDesktop: {
123
+ fontWeight: 500,
124
+ lineHeight: "140%",
125
+ letterSpacing: "0.15px",
126
+ fontSize: "1.25rem",
127
+ color: props.secondaryColor,
128
+ opacity: props.opacity,
129
+ fontFamily: props.fontFamilyPrimary,
130
+ },
131
+ // Image container (left position)
132
+ imageContainerLeft: {
133
+ display: { xs: "none", md: "block" },
134
+ flex: "0.3",
135
+ borderTopLeftRadius: props.borderRadius.md,
136
+ borderBottomLeftRadius: props.borderRadius.md,
137
+ overflow: "hidden",
138
+ height: "auto",
139
+ position: "relative",
140
+ },
141
+ // Image container (right position)
142
+ imageContainerRight: {
143
+ display: { xs: "none", md: "block" },
144
+ flex: "0.3",
145
+ borderTopRightRadius: "5px",
146
+ borderBottomRightRadius: "5px",
147
+ overflow: "hidden",
148
+ height: "auto",
149
+ position: "relative",
150
+ },
151
+ // Main content area
152
+ mainContentArea: {
153
+ flex: { xs: "1", md: props.quizImage ? "0.7" : "1" },
154
+ display: { md: "flex" },
155
+ flexDirection: "column",
156
+ p: props.spacingScale.md,
157
+ gap: { xs: props.spacingScale.sm, md: props.spacingScale.md },
158
+ },
159
+ // Desktop headline container
160
+ desktopHeadlineContainer: {
161
+ display: { xs: "none", md: "flex" },
162
+ flexDirection: "column",
163
+ justifyContent: "space-between",
164
+ gap: props.spacingScale["2xl"],
165
+ textAlign: "center",
166
+ },
167
+ // Content container
168
+ contentContainer: {
169
+ display: "flex",
170
+ flexDirection: "column",
171
+ gap: props.spacingScale["3xs"],
172
+ },
173
+ // Question area
174
+ questionArea: {
175
+ display: "flex",
176
+ flexDirection: "column",
177
+ p: props.spacingScale.md,
178
+ },
179
+ // Question container
180
+ questionContainer: {
181
+ display: "flex",
182
+ flexDirection: "column",
183
+ gap: { xs: props.spacingScale.lg, md: props.spacingScale.md },
184
+ },
185
+ // Alert container
186
+ alertContainer: {
187
+ px: props.spacingScale.md,
188
+ pt: props.spacingScale.md,
189
+ pb: props.spacingScale.lg,
190
+ gap: props.spacingScale.md,
191
+ display: "flex",
192
+ flexDirection: "column",
193
+ backdropFilter: "blur(4px)",
194
+ },
195
+ // Quiz image
196
+ quizImage: {
197
+ width: "100%",
198
+ height: "100%",
199
+ objectFit: "cover",
200
+ },
201
+ });
@@ -0,0 +1,17 @@
1
+ import { ClassicQuizUserParticipationModel, ClassicQuizFullModel, FansUnitedSDKModel } from "fansunited-sdk-esm";
2
+ import React from "react";
3
+ import { LeadsOptions } from "@fansunited/common";
4
+ type StandardScoreStateProps = {
5
+ imagePosition?: "left" | "right";
6
+ summary: ClassicQuizUserParticipationModel;
7
+ totalTime: number;
8
+ showAnswerExplanations: boolean;
9
+ classicQuiz: ClassicQuizFullModel;
10
+ maxAttemptsReached: boolean;
11
+ sdk: FansUnitedSDKModel;
12
+ leads?: LeadsOptions;
13
+ playAgain: () => void;
14
+ };
15
+ declare const StandardScoreState: React.FC<StandardScoreStateProps>;
16
+ export default StandardScoreState;
17
+ //# sourceMappingURL=StandardScoreState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StandardScoreState.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Variants/Standard/ScoreState/StandardScoreState.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,EACjC,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAEL,YAAY,EAUb,MAAM,oBAAoB,CAAC;AAY5B,KAAK,uBAAuB,GAAG;IAC7B,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACjC,OAAO,EAAE,iCAAiC,CAAC;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB,EAAE,OAAO,CAAC;IAChC,WAAW,EAAE,oBAAoB,CAAC;IAClC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,GAAG,EAAE,kBAAkB,CAAC;IACxB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAiSzD,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,78 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Box, Button, Typography } from "@mui/joy";
3
+ import { useImageUrl, hexToRgb, WidgetTemplate, isMobile, useBorderSize, useColors, useCornerRadius, useFontFamily, useInternalTheme, useSpacingScale, } from "@fansunited/common";
4
+ import ReplayIcon from "@mui/icons-material/Replay";
5
+ import share from "../../../../assets/share.svg";
6
+ import MainCard from "../../../Shared/MainCard";
7
+ import ScoreStateWrapper from "../../../Shared/ScoreStateWrapper";
8
+ import { useTranslation } from "react-i18next";
9
+ import PresentedBy from "../../../Shared/PresentedBy";
10
+ import CollectLead from "../../../Leads/CollectLead";
11
+ import { createStyles } from "./StandardScoreState.styles";
12
+ import AlertMessage from "../../../Shared/AlertMessage";
13
+ import { useScoreStateHelpers } from "../../../../hooks/useScoreStateHelpers";
14
+ const StandardScoreState = (props) => {
15
+ const theme = useInternalTheme();
16
+ const quizImage = useImageUrl(props.classicQuiz.images);
17
+ const { t } = useTranslation();
18
+ const brandingColors = props.classicQuiz.branding?.colors || null;
19
+ const brandingLogo = isMobile()
20
+ ? props.classicQuiz.branding?.images.mobileLogo ||
21
+ props.classicQuiz.branding?.images.mainLogo ||
22
+ ""
23
+ : props.classicQuiz.branding?.images.mainLogo || "";
24
+ const imagePosition = props.imagePosition || "left";
25
+ const { getHexagonBackground, formatTime, displayCongratulations, getRandomEmoji, shareResult, } = useScoreStateHelpers({
26
+ summary: props.summary,
27
+ totalTime: props.totalTime,
28
+ classicQuiz: props.classicQuiz,
29
+ variant: WidgetTemplate.STANDARD,
30
+ });
31
+ // Styling variables
32
+ const textPrimary = useColors().textPrimary;
33
+ const primaryColor = brandingColors?.primaryColor || useColors().palette.primary.plainColor;
34
+ const textColor = brandingColors?.contentColor || useColors().textColor;
35
+ const fontFamilySecondary = useFontFamily().secondary;
36
+ const fontFamilyPrimary = useFontFamily().primary;
37
+ const bgcolor = brandingColors?.backgroundColor || useColors().surface;
38
+ const onSurfaceColor = useColors().onSurface;
39
+ const borderRadius = useCornerRadius();
40
+ const borderSize = useBorderSize().size;
41
+ const spacingScale = useSpacingScale();
42
+ const showLead = props.leads?.position === "after" &&
43
+ props.classicQuiz.authRequirement === "LEAD";
44
+ const surfaceVariant = `rgba(${hexToRgb(useColors().surfaceVariant || "")}, 0.5)`;
45
+ // Create styles with current props/theme values
46
+ const styles = createStyles({
47
+ quizImage,
48
+ spacingScale,
49
+ borderRadius,
50
+ fontFamilyPrimary,
51
+ fontFamilySecondary,
52
+ textPrimary,
53
+ primaryColor,
54
+ textColor,
55
+ bgcolor,
56
+ onSurfaceColor,
57
+ borderSize,
58
+ surfaceVariant,
59
+ brandingColors,
60
+ imagePosition,
61
+ successColor: theme.colorSchemes.light.palette.success.plainColor,
62
+ dangerColor: theme.colorSchemes.light.palette.danger.plainColor,
63
+ onPrimaryColor: theme.colorSchemes.light.palette.primary.onPrimary,
64
+ });
65
+ const renderMainContent = () => {
66
+ return (_jsxs(Box, { sx: styles.mainContentArea, children: [props.summary.classicQuizId ? (_jsxs(_Fragment, { children: [_jsx(Box, { sx: styles.contentWrapper, children: _jsx(Box, { sx: styles.contentScoreContainer, children: _jsx(Box, { sx: styles.scoreSection, children: _jsxs(Box, { sx: styles.scoreContentWrapper, children: [_jsxs(Box, { sx: styles.achievementBadgeContainer, children: [_jsx("img", { style: styles.hexagonBackground, src: getHexagonBackground(), alt: "achievement-badge-background" }), _jsx("img", { style: styles.achievementEmoji, src: getRandomEmoji("light"), alt: "achievement-badge" })] }), _jsxs(Box, { sx: styles.textSection, children: [_jsx(Typography, { level: "body-lg", sx: styles.congratulationsText, children: props.maxAttemptsReached
67
+ ? t("classicQuiz.maxAttemptsReached")
68
+ : displayCongratulations() }), _jsx(Box, { sx: styles.scoreContainer, children: _jsxs(Box, { sx: styles.scoreNumbersContainer, children: [_jsx(Typography, { level: "h2", sx: styles.correctScoreText(props.summary.correct), children: props.summary.correct }), _jsxs(Typography, { level: "h2", sx: styles.totalScoreText(props.summary.correct), children: ["/", props.summary.classicQuizQuestions] })] }) }), props.totalTime ? (_jsxs(Typography, { level: "body-md", sx: styles.timeText, children: [t("classicQuiz.youDidItFor"), " ", formatTime()] })) : null, props.classicQuiz.scored ? (_jsxs(Typography, { level: "body-lg", sx: styles.pointsText, children: [t("classicQuiz.youWon"), " ", props.summary.correct * props.classicQuiz.points, " ", t("common.labels.points")] })) : null] })] }) }) }) }), !props.maxAttemptsReached && showLead ? (_jsx(Box, { sx: styles.leadCollectionContainer, children: _jsx(Box, { sx: styles.leadQuestionContainer, children: _jsx(Box, { sx: styles.leadContentContainer, children: _jsx(CollectLead, { sdk: props.sdk, contentType: "quiz", 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 }) }) }) })) : null, _jsx(Box, { sx: styles.ctaContainer, children: _jsxs(Box, { sx: styles.ctaContentWrapper, children: [_jsx(Typography, { level: "body-lg", sx: styles.thanksText, children: t("classicQuiz.thanksForPlaying") }), _jsxs(Box, { sx: styles.buttonsContainer, children: [!props.maxAttemptsReached ? (_jsx(Button, { sx: styles.playAgainButton, onClick: props.playAgain, children: _jsxs(Box, { sx: styles.playAgainButtonContent, children: [_jsx(ReplayIcon, { sx: styles.playAgainIcon }), _jsx(Typography, { sx: styles.playAgainText, children: t("classicQuiz.buttons.playAgain") })] }) })) : null, _jsx(Button, { sx: styles.shareButton, onClick: shareResult, children: _jsxs(Box, { sx: styles.shareButtonContent, children: [_jsx("img", { src: share, alt: "share-icon", style: styles.shareIcon }), _jsx(Typography, { sx: styles.shareText, children: t("classicQuiz.buttons.share") })] }) })] })] }) })] })) : (_jsx(_Fragment, { children: _jsx(AlertMessage, { variant: "error", title: t("common.authentication.accessRequired"), message: t("common.authentication.invalidOrMissingAuth") }) })), _jsx(Box, { sx: styles.presentedByContainer, children: _jsx(PresentedBy, { brandingLogo: brandingLogo, textColor: textColor }) })] }));
69
+ };
70
+ return (_jsx(MainCard, { brandingBorderColor: brandingColors?.borderColor || null, children: props.showAnswerExplanations ? (_jsx(ScoreStateWrapper, { questions: props.classicQuiz.questions, userParticipation: props.summary.answers, brandingColors: props.classicQuiz.branding?.colors, resultsTabPanelSxProps: {
71
+ display: "flex",
72
+ flexDirection: { xs: "column", md: "row" },
73
+ px: 0,
74
+ pb: 0,
75
+ pt: 0,
76
+ }, children: _jsxs(Box, { sx: styles.scoreStateWrapperContainer, children: [quizImage && imagePosition === "left" && (_jsx(Box, { sx: styles.imageContainerLeft, children: _jsx("img", { src: quizImage, alt: "Quiz illustration", style: styles.quizImage }) })), renderMainContent(), quizImage && imagePosition === "right" && (_jsx(Box, { sx: styles.imageContainerRight, children: _jsx("img", { src: quizImage, alt: "Quiz illustration", style: styles.quizImage }) }))] }) })) : (_jsxs(_Fragment, { children: [quizImage && imagePosition === "left" && (_jsx(Box, { sx: styles.imageContainerLeftNoExplanations, children: _jsx("img", { src: quizImage, alt: "Quiz illustration", style: styles.quizImage }) })), renderMainContent(), quizImage && imagePosition === "right" && (_jsx(Box, { sx: styles.imageContainerRightNoExplanations, children: _jsx("img", { src: quizImage, alt: "Quiz illustration", style: styles.quizImage }) }))] })) }));
77
+ };
78
+ export default StandardScoreState;