@constructor-io/constructorio-ui-quizzes 1.3.6 → 1.3.8

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/README.md CHANGED
@@ -31,28 +31,29 @@ import CioQuiz from '@constructor-io/constructorio-ui-quizzes';
31
31
  function YourComponent() {
32
32
  return (
33
33
  <div>
34
- <CioQuiz quizId="coffee-quiz" apiKey="key_wJSdZSiesX5hiVLt" />
34
+ <CioQuiz quizId='coffee-quiz' apiKey='key_wJSdZSiesX5hiVLt' />
35
35
  </div>
36
36
  );
37
37
  }
38
38
  ```
39
+
39
40
  ### Using the Javascript Bundle
40
41
 
41
42
  This is a framework agnostic method that can be used in any JavaScript project. The `CioQuiz` function provides a simple interface to inject an entire Quizzes UI into the provided `selector`.
42
43
  In addition to [Quiz component props](https://constructor-io.github.io/constructorio-ui-quizzes/?path=/docs/quiz-component--docs), this function also accepts `selector` and `includeCSS`.
43
44
 
44
45
  ```js
45
- import CioQuiz from "@constructor-io/constructorio-ui-quizzes/constructorio-ui-quizzes-bundled";
46
+ import CioQuiz from '@constructor-io/constructorio-ui-quizzes/constructorio-ui-quizzes-bundled';
46
47
 
47
48
  CioQuiz({
48
- selector: "#quiz-container",
49
- quizId: "coffee-quiz",
50
- apiKey: "key_wJSdZSiesX5hiVLt",
49
+ selector: '#quiz-container',
50
+ quizId: 'coffee-quiz',
51
+ apiKey: 'key_wJSdZSiesX5hiVLt',
51
52
  includeCSS: true, // Include the default CSS styles. Defaults to true.
52
53
  resultsPageOptions: {
53
54
  onAddToCartClick: (item) => console.dir(item),
54
- resultCardRegularPriceKey: "price",
55
- }
55
+ resultCardRegularPriceKey: 'price',
56
+ },
56
57
  // ... additional arguments
57
58
  });
58
59
  ```
@@ -69,11 +70,11 @@ If you wish to use some starter styles from this library, add an import statemen
69
70
  import '@constructor-io/constructorio-ui-quizzes/styles.css';
70
71
  ```
71
72
 
72
- - These starter styles can be used as a foundation to build on top of, or just as a reference for you to replace completely.
73
- - To opt out of all default styling, do not import the `styles.css` stylesheet.
74
- - All starter styles in this library are scoped within the `.cio-quiz` css selector.
75
- - These starter styles are intended to be extended by layering in your own css rules
76
- - If you import the starter styles, `CioQuiz` component will take up the full width and height of its parent container
73
+ - These starter styles can be used as a foundation to build on top of, or just as a reference for you to replace completely.
74
+ - To opt out of all default styling, do not import the `styles.css` stylesheet.
75
+ - All starter styles in this library are scoped within the `.cio-quiz` css selector.
76
+ - These starter styles are intended to be extended by layering in your own css rules
77
+ - If you import the starter styles, `CioQuiz` component will take up the full width and height of its parent container
77
78
 
78
79
  > Please note the starter styles utilize @container queries and enable responsive styles for our quizzes based on the size of their container element. Since this feature is supported by modern browsers, polyfills have not been included in this library. However, if you want to support older browsers, you can add fallback styles or use a [polyfill](https://github.com/GoogleChromeLabs/container-query-polyfill).
79
80
 
@@ -114,3 +115,10 @@ npm run build-storybook # generate storybook static bundle for deploy with GH
114
115
 
115
116
  - [Storybook 7 Introduction](https://storybook.js.org/docs/7.0/react/get-started/introduction)
116
117
  - [Typescript Docs](https://www.typescriptlang.org/docs/)
118
+
119
+ ## Demoing quizzes in a sandbox environment
120
+
121
+ Please fork from the following code sandboxes to experiment with the quizzes UI library integrated in various approaches.
122
+
123
+ - [Simple React app](https://codesandbox.io/s/quizzes-ui-integration-3cggdh)
124
+ - [Plain HTML, CSS, JS](https://codesandbox.io/s/quizzes-ui-integration-plain-4f4dns)