fansunited-frontend-components 0.0.39 → 0.0.40

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 (48) hide show
  1. package/ChanceGame.js +104 -102
  2. package/ClassicQuizPlay.js +45 -42
  3. package/CollectLead.js +25 -24
  4. package/Discussion.js +376 -378
  5. package/EitherOrPlay.d.ts +4 -0
  6. package/EitherOrPlay.d.ts.map +1 -0
  7. package/EitherOrPlay.js +2533 -0
  8. package/EventGamePlay.js +59 -54
  9. package/MatchQuizPlay.js +63 -57
  10. package/PersonalityQuizPlay.js +7935 -7201
  11. package/PickThePair.js +153 -151
  12. package/PollVote.js +108 -104
  13. package/chunks/{AlertMessage-C2aBXCrl.js → AlertMessage-cjTHrMUK.js} +51 -51
  14. package/chunks/ArrowRightAlt-88jKjh6A.js +8 -0
  15. package/chunks/Avatar-CQCrd1m-.js +352 -0
  16. package/chunks/ChanceGameEmbedVariant-DWqOTf4o.js +1051 -0
  17. package/chunks/{CheckCircle-D-GH16Lb.js → CheckCircle-ClY-iOQ5.js} +105 -105
  18. package/chunks/{CollectLeadForm-o9NdYQgu.js → CollectLeadForm-0vVnu4DL.js} +5 -5
  19. package/chunks/FavoriteBorder-BHnvGBrn.js +11 -0
  20. package/chunks/{useInfoPage-v91yL5SS.js → NotFoundSkeleton-B3RNa8KJ.js} +451 -646
  21. package/chunks/Notification-BTtUhfZQ.js +615 -0
  22. package/chunks/OverlayLeadAfterCollection-CaBbwZVo.js +480 -0
  23. package/chunks/{OverlayScoreStateSkeleton-xvq9lQEi.js → OverlayScoreStateSkeleton-DJn0Rim3.js} +3 -3
  24. package/chunks/Person-D0Im9_zE.js +522 -0
  25. package/chunks/{PickOneOfX-C2YpLk40.js → PickOneOfX-DYQ4c1o2.js} +7 -7
  26. package/chunks/{Portal-DWAr8MhA.js → Portal-B9wkUnY2.js} +7 -7
  27. package/chunks/{ConstantsProvider-BPJJz9fq.js → PrizeCard-gMp7I66d.js} +3593 -2860
  28. package/chunks/{Spinner-m59ZJZ35.js → Spinner-BBA89t5s.js} +50 -50
  29. package/chunks/StandardLeadAfterCollection-L1cOGfS6.js +432 -0
  30. package/chunks/{Tabs-BGihvj9C.js → Tabs-D_n8rNw3.js} +28 -28
  31. package/chunks/{Textarea-Bzlb89Zp.js → Textarea-BdN2xj4j.js} +44 -44
  32. package/chunks/{TimerOutlined-DiX8hCoC.js → TimerOutlined-DmKZDDI-.js} +1 -1
  33. package/chunks/chevron-right-DGEksBI7.js +330 -0
  34. package/chunks/default-quiz-bg-vertical-CT7rrg9o.js +5 -0
  35. package/chunks/index-2s5UkG1y.js +1607 -0
  36. package/chunks/useImageVariant-pnFelF9A.js +535 -0
  37. package/chunks/useInfoPage-DPkzE5Gn.js +204 -0
  38. package/components.d.ts +2 -1
  39. package/components.d.ts.map +1 -1
  40. package/index.d.ts +1 -0
  41. package/index.d.ts.map +1 -1
  42. package/index.js +4 -2
  43. package/package.json +1 -1
  44. package/chunks/ChanceGameEmbedVariant-BvIKBhq_.js +0 -2609
  45. package/chunks/Notification-Bwcoljir.js +0 -961
  46. package/chunks/OverlayLeadAfterCollection-B3D5ct0J.js +0 -901
  47. package/chunks/chevron-right-Dlc9ZKhv.js +0 -846
  48. package/chunks/useImageVariant-Do8kOVs2.js +0 -537
@@ -0,0 +1,204 @@
1
+ import { jsxs as u, jsx as r } from "react/jsx-runtime";
2
+ import { u as w, f as T, g as $, W as F, B as l, T as y } from "./PrizeCard-gMp7I66d.js";
3
+ import { a as v, s as z } from "./useImageVariant-pnFelF9A.js";
4
+ import { useState as _, useEffect as B } from "react";
5
+ import { R } from "./NotFoundSkeleton-B3RNa8KJ.js";
6
+ import "react-dom";
7
+ const D = (e) => {
8
+ var t;
9
+ return {
10
+ // Main container with background overlay
11
+ mainContainer: {
12
+ display: "flex",
13
+ flexDirection: "column",
14
+ justifyContent: "space-between",
15
+ gap: "40px",
16
+ p: e.spacingScale.xl,
17
+ boxShadow: "md",
18
+ border: (t = e.brandingColors) != null && t.borderColor ? `${e.borderSize} solid ${e.brandingColors.borderColor}` : "none",
19
+ overflow: "hidden",
20
+ backgroundImage: e.backgroundImage,
21
+ backgroundPosition: "center",
22
+ backgroundSize: "cover",
23
+ position: "relative",
24
+ borderRadius: e.mdBorderRadius,
25
+ minHeight: "250px",
26
+ "&::before": {
27
+ content: '""',
28
+ position: "absolute",
29
+ background: e.imageBackgroundGradient,
30
+ top: 0,
31
+ left: 0,
32
+ right: 0,
33
+ bottom: 0,
34
+ borderRadius: "inherit",
35
+ zIndex: 0
36
+ }
37
+ },
38
+ // Headline section wrapper
39
+ headlineSection: {
40
+ display: "flex",
41
+ justifyContent: "space-between",
42
+ flex: "1 0 0",
43
+ alignSelf: "stretch"
44
+ },
45
+ // Headline content container
46
+ headlineContent: {
47
+ display: "flex",
48
+ flexDirection: "column",
49
+ alignItems: "flex-start",
50
+ flex: "1 0 0",
51
+ gap: "16px"
52
+ },
53
+ // Headline content with z-index
54
+ headlineContentInner: {
55
+ zIndex: 10
56
+ },
57
+ // Headline typography
58
+ headlineText: {
59
+ fontWeight: 500,
60
+ lineHeight: "166%",
61
+ letterSpacing: "1px",
62
+ textAlign: { xs: "center", md: "left" },
63
+ color: e.secondaryColor,
64
+ opacity: "70%",
65
+ textTransform: "uppercase",
66
+ fontFamily: e.fontFamilySecondary,
67
+ fontSize: "0.75em"
68
+ },
69
+ // Content container
70
+ contentContainer: {
71
+ display: "flex",
72
+ flexDirection: "column",
73
+ gap: e.spacingScale["3xs"]
74
+ },
75
+ // Title typography
76
+ titleText: {
77
+ fontWeight: 700,
78
+ lineHeight: "133%",
79
+ letterSpacing: "0px",
80
+ textAlign: { xs: "center", md: "left" },
81
+ fontSize: "1.5em",
82
+ color: e.darkTextColor,
83
+ fontFamily: e.fontFamilyPrimary
84
+ },
85
+ // Description typography
86
+ descriptionText: {
87
+ fontWeight: 400,
88
+ lineHeight: "140%",
89
+ letterSpacing: "0.15px",
90
+ fontSize: "1.25em",
91
+ textAlign: { xs: "center", md: "left" },
92
+ color: e.secondaryColor,
93
+ opacity: "70%",
94
+ fontFamily: e.fontFamilyPrimary
95
+ },
96
+ // Main content section
97
+ mainContentSection: {
98
+ display: "flex",
99
+ flexDirection: "column",
100
+ gap: "24px"
101
+ }
102
+ };
103
+ }, A = ({
104
+ entity: e,
105
+ headline: t,
106
+ finalImage: d,
107
+ children: x,
108
+ rulesDisplay: o
109
+ }) => {
110
+ var b, S;
111
+ const i = w(), c = T(), g = $(
112
+ F.OVERLAY
113
+ ), s = ((b = e.branding) == null ? void 0 : b.colors) || null, m = (s == null ? void 0 : s.contentColor) || i.colorSchemes.dark.textColor, n = i.customFontFamily.dark.primary, f = i.customFontFamily.dark.secondary, h = i.customRadius.dark.md, C = (S = i.border) == null ? void 0 : S.dark.size, k = i.colorSchemes.dark.textColor, I = v(d), a = D({
114
+ spacingScale: c,
115
+ brandingColors: s,
116
+ secondaryColor: m,
117
+ fontFamilyPrimary: n,
118
+ fontFamilySecondary: f,
119
+ mdBorderRadius: h,
120
+ borderSize: C,
121
+ backgroundImage: I,
122
+ darkTextColor: k,
123
+ imageBackgroundGradient: g
124
+ });
125
+ return /* @__PURE__ */ u(l, { sx: a.mainContainer, children: [
126
+ /* @__PURE__ */ r(l, { children: /* @__PURE__ */ r(l, { sx: a.headlineSection, children: /* @__PURE__ */ r(l, { sx: a.headlineContent, children: /* @__PURE__ */ u(l, { sx: a.headlineContentInner, children: [
127
+ /* @__PURE__ */ u(
128
+ l,
129
+ {
130
+ sx: {
131
+ display: "flex",
132
+ alignItems: "center",
133
+ gap: c["3xs"]
134
+ },
135
+ children: [
136
+ /* @__PURE__ */ r(y, { level: "body-sm", sx: a.headlineText, children: t }),
137
+ /* @__PURE__ */ r(
138
+ R,
139
+ {
140
+ rulesDisplay: o,
141
+ isOverlayVariant: !0,
142
+ rules: e.rules || ""
143
+ }
144
+ )
145
+ ]
146
+ }
147
+ ),
148
+ /* @__PURE__ */ u(l, { sx: a.contentContainer, children: [
149
+ /* @__PURE__ */ r(y, { level: "h4", sx: a.titleText, children: e.title }),
150
+ e.description && /* @__PURE__ */ r(y, { level: "body-lg", sx: a.descriptionText, children: z(e.description) })
151
+ ] })
152
+ ] }) }) }) }),
153
+ /* @__PURE__ */ r(l, { sx: a.mainContentSection, children: x })
154
+ ] });
155
+ }, p = (e) => ({
156
+ id: "not-found",
157
+ title: "",
158
+ subtitle: null,
159
+ type: e,
160
+ content_type: "JSON",
161
+ body: "",
162
+ language: "",
163
+ context: null,
164
+ branding_id: null,
165
+ branding: null,
166
+ images: null,
167
+ labels: null,
168
+ created_at: "",
169
+ updated_at: ""
170
+ }), J = (e, t, d) => {
171
+ const [x, o] = _(null), i = async () => {
172
+ const c = d.helpers.getSDKConfiguration(), g = c.apiKey, s = c.clientId, m = await fetch(
173
+ `https://client.fansunitedapi.com/v1/clients/${s}/info-pages/${e}?key=${g}&disable_cache=${Date.now()}`
174
+ ), n = await m.json();
175
+ if (m.ok) {
176
+ if (n.data.type !== t) {
177
+ console.warn(
178
+ `Info page with id ${e} is not a ${t} type. Got ${n.data.type} instead.`
179
+ ), o(p(t));
180
+ return;
181
+ }
182
+ if (n.data.content_type !== "JSON") {
183
+ console.warn(
184
+ `Info page with id ${e} is not a JSON type. Got ${n.data.content_type} instead.`
185
+ ), o(p(t));
186
+ return;
187
+ }
188
+ if (n.data.branding_id) {
189
+ const f = await fetch(
190
+ `https://client.fansunitedapi.com/v1/clients/${s}/templates/brandings/${n.data.branding_id}?key=${g}&disable_cache=${Date.now()}`
191
+ ), h = await f.json();
192
+ f.ok && (n.data.branding = h.data);
193
+ }
194
+ o(n.data);
195
+ return;
196
+ }
197
+ console.warn(n), o(p(t));
198
+ };
199
+ return B(() => (i(), () => o(null)), [e, d]), { infoPage: x, setInfoPage: o };
200
+ };
201
+ export {
202
+ A as O,
203
+ J as u
204
+ };
package/components.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ClassicQuizPlayProps, PollVoteProps, CollectLeadProps, PersonalityQuizPlayProps, MatchQuizPlayProps, EventGamePlayProps, PickThePairProps, ChanceGameProps, DiscussionProps } from 'fansunited-frontend-core';
1
+ import { ClassicQuizPlayProps, PollVoteProps, CollectLeadProps, PersonalityQuizPlayProps, MatchQuizPlayProps, EventGamePlayProps, PickThePairProps, ChanceGameProps, DiscussionProps, EitherOrPlayProps } from 'fansunited-frontend-core';
2
2
 
3
3
  export declare const ClassicQuizPlay: React.FC<ClassicQuizPlayProps>;
4
4
  export declare const PollVote: React.FC<PollVoteProps>;
@@ -9,4 +9,5 @@ export declare const EventGamePlay: React.FC<EventGamePlayProps>;
9
9
  export declare const PickThePair: React.FC<PickThePairProps>;
10
10
  export declare const ChanceGame: React.FC<ChanceGameProps>;
11
11
  export declare const Discussion: React.FC<DiscussionProps>;
12
+ export declare const EitherOrPlay: React.FC<EitherOrPlayProps>;
12
13
  //# sourceMappingURL=components.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/components.tsx"],"names":[],"mappings":"AASA,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,wBAAwB,EACxB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,eAAe,EAChB,MAAM,0BAA0B,CAAC;AAIlC,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CACjC,CAAC;AAE3B,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAAqB,CAAC;AAEnE,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAAwB,CAAC;AAE5E,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CACrC,CAAC;AAE/B,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAC/B,CAAC;AAEzB,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC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EAAE,CAAC,iBAAiB,CAAyB,CAAC"}
package/index.d.ts CHANGED
@@ -7,4 +7,5 @@ export { EventGamePlay } from './EventGamePlay';
7
7
  export { PickThePair } from './PickThePairComponent';
8
8
  export { ChanceGame } from './ChanceGameComponent';
9
9
  export { Discussion } from './Discussion';
10
+ export { EitherOrPlay } from './EitherOrPlay';
10
11
  //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
package/index.js CHANGED
@@ -5,13 +5,15 @@ import { PersonalityQuizPlay as i } from "./PersonalityQuizPlay.js";
5
5
  import { MatchQuizPlay as x } from "./MatchQuizPlay.js";
6
6
  import { EventGamePlay as c } from "./EventGamePlay.js";
7
7
  import { PickThePair as y } from "./PickThePair.js";
8
- import { ChanceGame as u } from "./ChanceGame.js";
8
+ import { ChanceGame as n } from "./ChanceGame.js";
9
9
  import { Discussion as z } from "./Discussion.js";
10
+ import { EitherOrPlay as Q } from "./EitherOrPlay.js";
10
11
  export {
11
- u as ChanceGame,
12
+ n as ChanceGame,
12
13
  e as ClassicQuizPlay,
13
14
  l as CollectLead,
14
15
  z as Discussion,
16
+ Q as EitherOrPlay,
15
17
  c as EventGamePlay,
16
18
  x as MatchQuizPlay,
17
19
  i as PersonalityQuizPlay,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fansunited-frontend-components",
3
- "version": "0.0.39",
3
+ "version": "0.0.40",
4
4
  "description": "Various user centric components for Fans United features",
5
5
  "type": "module",
6
6
  "main": "index.js",