fansunited-frontend-components 0.0.29 → 0.0.31-RC1

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 (3) hide show
  1. package/README.md +65 -0
  2. package/components.js +25242 -21098
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -72,6 +72,7 @@ Interactive quiz component with multiple templates and customization options.
72
72
  | `userIsLoggedIn` | `boolean` | Determine if the user is logged in |
73
73
  | `signInCTA` | `SignInCTADetails` | Sign in call to action button configuration |
74
74
  | `additionalCTA` | `AdditionalCTADetails` | Additional call to action button configuration |
75
+ | `rulesDisplay` | `RulesDisplay` | Game rules display configuration |
75
76
 
76
77
  #### Templates
77
78
 
@@ -370,6 +371,63 @@ const additionalCTA: AdditionalCTADetails = {
370
371
  - **Split variant**: Displayed after "Play Again" button in the thank you container
371
372
  - **Overlay variant**: Displayed after "Play Again" and "Share Result" buttons
372
373
 
374
+ #### Rules Display Configuration
375
+
376
+ Display game rules and instructions to users with a clickable info icon in the component headline using the `rulesDisplay` prop.
377
+
378
+ ```tsx
379
+ import { RulesDisplay } from "fansunited-frontend-core";
380
+
381
+ // Display rules in a modal dialog (default)
382
+ const rulesDisplay: RulesDisplay = {
383
+ type: "modal",
384
+ };
385
+
386
+ // Display rules as a clickable link
387
+ const rulesDisplay: RulesDisplay = {
388
+ type: "link",
389
+ url: "https://your-website.com/quiz-rules",
390
+ target: "_blank", // or "_self"
391
+ };
392
+
393
+ // Custom rules content component
394
+ const rulesDisplay: RulesDisplay = {
395
+ type: "modal",
396
+ component: <CustomRulesContent />,
397
+ };
398
+
399
+ <ClassicQuizPlay
400
+ {...otherProps}
401
+ rulesDisplay={rulesDisplay}
402
+ />;
403
+ ```
404
+
405
+ **Display Types:**
406
+
407
+ 1. **Modal** - Opens rules in a modal dialog overlay (default behavior)
408
+ - Uses the quiz's `rules` field from the backend
409
+ - Displays in a centered modal with close button
410
+ - Supports HTML content rendering
411
+
412
+ 2. **Link** - Opens rules URL in a new tab/window
413
+ - Requires `url` property
414
+ - Optional `target` property (`_blank` or `_self`)
415
+ - Useful for external documentation or detailed rule pages
416
+
417
+ **Features:**
418
+
419
+ - **Info Icon**: Displays a small info icon (ⓘ) next to the component headline
420
+ - **Responsive**: Adapts to all three templates (Standard, Split, Overlay)
421
+ - **Theme-Aware**: Automatically adjusts colors based on theme mode and variant
422
+ - **Accessible**: Keyboard navigable and screen reader friendly
423
+ - **Non-Intrusive**: Icon only appears when rules are configured
424
+
425
+ **Behavior:**
426
+
427
+ - The rules icon appears in the headline section across all component states (main view, sign-in, error, score state, lead collection)
428
+ - Modal dialogs can be closed by clicking the close button, clicking outside, or pressing Escape
429
+ - Link type opens in a new tab by default for better user experience
430
+
373
431
  #### TypeScript Support
374
432
 
375
433
  This package is built with TypeScript and provides full type definitions. Import types from `fansunited-frontend-core`:
@@ -381,6 +439,9 @@ import {
381
439
  MainProps,
382
440
  CustomThemeOptions,
383
441
  LeadsOptions,
442
+ RulesDisplay,
443
+ SignInCTADetails,
444
+ AdditionalCTADetails,
384
445
  AnalyticsEvent,
385
446
  } from "fansunited-frontend-core";
386
447
  ```
@@ -468,6 +529,7 @@ Interactive poll voting component with real-time results, multiple choice suppor
468
529
  | `userIsLoggedIn` | `boolean` | Determine if the user is logged in |
469
530
  | `signInCTA` | `SignInCTADetails` | Sign in call to action button configuration |
470
531
  | `additionalCTA` | `AdditionalCTADetails` | Additional call to action button configuration |
532
+ | `rulesDisplay` | `RulesDisplay` | Poll rules display configuration |
471
533
 
472
534
  #### Templates
473
535
 
@@ -1005,6 +1067,7 @@ Interactive personality quiz component that matches users with personas based on
1005
1067
  | `signInCTA` | `SignInCTADetails` | Sign in call to action button configuration |
1006
1068
  | `additionalCTA` | `AdditionalCTADetails` | Additional call to action button configuration |
1007
1069
  | `optionsLayout` | `OptionsLayout` | Layout for answer options |
1070
+ | `rulesDisplay` | `RulesDisplay` | Quiz rules display configuration |
1008
1071
 
1009
1072
  #### Templates
1010
1073
 
@@ -1302,6 +1365,7 @@ Interactive match prediction quiz component that allows users to make prediction
1302
1365
  | `showTeamLabels` | `boolean` | Show team name labels in fixture components |
1303
1366
  | `showPoints` | `boolean` | Show points display for each fixture |
1304
1367
  | `showPredictionDetails` | `boolean` | Show detailed prediction results after completion |
1368
+ | `rulesDisplay` | `RulesDisplay` | Match quiz rules display configuration |
1305
1369
 
1306
1370
  #### Templates
1307
1371
 
@@ -1641,6 +1705,7 @@ Interactive event prediction component for sports and entertainment events. Feat
1641
1705
  | `showCountdown` | `boolean` | Show countdown timer when Event Game is open |
1642
1706
  | `showPoints` | `boolean` | Show points display for each fixture |
1643
1707
  | `showPredictionDetails` | `boolean` | Show detailed prediction results after completion |
1708
+ | `rulesDisplay` | `RulesDisplay` | Event game rules display configuration |
1644
1709
 
1645
1710
  #### Templates
1646
1711