@constructor-io/constructorio-ui-quizzes 1.3.0 → 1.3.1
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 +2 -0
- package/dist/constructorio-ui-quizzes-bundled.js +1 -1
- package/lib/cjs/constants.js +2 -1
- package/lib/mjs/constants.js +1 -0
- package/lib/styles.css +23 -20
- package/lib/types/constants.d.ts +1 -0
- package/package.json +12 -12
package/README.md
CHANGED
|
@@ -74,6 +74,8 @@ import '@constructor-io/constructorio-ui-quizzes/styles.css';
|
|
|
74
74
|
- These starter styles are intended to be extended by layering in your own css rules
|
|
75
75
|
- If you import the starter styles, `CioQuiz` component will take up the full width and height of its parent container
|
|
76
76
|
|
|
77
|
+
> 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).
|
|
78
|
+
|
|
77
79
|
## Troubleshooting
|
|
78
80
|
|
|
79
81
|
### Known Issues
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.id="cio-quizzes-styles",e.appendChild(document.createTextNode(".cio-quiz{--blue-denim-100: #7590ee;--blue-denim-1000: #061d6e;--blue-denim-200: #5d7ce8;--blue-denim-300: #395ddb;--blue-denim-400: #2348ca;--blue-denim-500: #163ab5;--blue-denim-600: #0e2fa0;--blue-denim-700: #0b2a93;--blue-denim-800: #092587;--blue-denim-900: #07217b;--gray-dust-100: #92959c;--gray-dust-1000: #272729;--gray-dust-200: #74757b;--gray-dust-300: #606166;--gray-dust-400: #515356;--gray-dust-500: #46474a;--gray-dust-600: #3c3d3f;--gray-dust-700: #37373a;--gray-dust-800: #313134;--gray-dust-900: #2c2c2f;--white-ice-100: #f9fbfe;--white-ice-200: #ecf4fd;--white-ice-300: #e1eefd;--white-ice-400: #d3e5fb;--white-ice-500: #c8daee;--white-ice-600: #bdcde0;--white-ice-700: #b1bfd0;--white-ice-800: #97a2b0;--bottom-bar-height: 80px;--primary-color: var(--blue-denim-400);--container-image-small-height: 250px}.cio-quiz,.cio-quiz *{box-sizing:border-box;font-family:Inter,sans-serif}.cio-quiz{min-width:100%;min-height:100%;display:flex;justify-content:center;background-color:#fff;color:var(--gray-dust-500);font-size:16px}.cio-quiz button{cursor:pointer}.cio-container{display:flex;align-items:center;justify-content:center;margin-top:2rem;padding-bottom:var(--bottom-bar-height)}.cio-container--with-image{display:flex;flex-direction:column;width:100%;max-height:100vh;padding-bottom:var(--bottom-bar-height)}.cio-question-content{display:flex;flex-direction:column;height:100%;padding:1rem}.cio-question-title{font-size:2.125em;margin:0}.cio-question-description{font-size:1em;line-height:1.5;margin-top:1.5rem}.cio-question-image{width:100%;height:100%;object-fit:cover}.cio-question-image-container{box-sizing:border-box;width:100%;object-fit:cover;max-height:var(--container-image-small-height);display:flex}.cio-question-input-text{width:100%;padding:.5rem;border:0;border-bottom:1px solid var(--blue-denim-100);color:var(--blue-denim-500);padding:.8rem;outline:none;font-size:1rem}.cio-question-input-text:focus{border-bottom:1px solid var(--blue-denim-500)}.cio-question-input-text::placeholder{color:var(--blue-denim-100)}.cio-question-buttons-container{width:100%;height:var(--bottom-bar-height);padding:8px 16px;display:flex;position:fixed;bottom:0px;left:0px;background:white;background-color:#ffffffde;align-items:center}.cio-question-cta-button{background:var(--primary-color);color:var(--white-ice-100);border:1px solid var(--primary-color);border-radius:4px;height:3rem;font-size:1rem;flex-grow:1;margin-left:auto;width:100%}.cio-button-container{max-width:10rem;flex-grow:1;margin-left:auto;padding-left:1rem}.cio-question-cta-button:hover{background:var(--blue-denim-500);border:2px solid var(--blue-denim-600)}.cio-question-cta-button:active{background:var(--blue-denim-700);border:2px solid var(--blue-denim-800)}.cio-question-cta-button:disabled,.cio-question-cta-button.disabled{background:var(--blue-denim-200);border:2px solid var(--blue-denim-100)}.cio-question-back-button{color:var(--primary-color);background:#ffffff;border:1px solid var(--primary-color);border-radius:4px;height:3rem;width:3rem;font-size:1rem;margin-right:4rem}.cio-question-back-button:hover{border:2px solid var(--blue-denim-600)}.cio-question-back-button:active{border:2px solid var(--blue-denim-700)}.cio-question-back-button svg{display:inline}.cio-cover-question-container--with-image{flex-direction:column-reverse;padding:0;padding-bottom:var(--bottom-bar-height)}.cio-question-option-container{padding:1.5rem;border-radius:8px;border:1px solid var(--white-ice-700);box-shadow:0 4px 10px #5d7ce826;width:calc(50% - 10px);display:flex;flex-direction:column;cursor:pointer}.cio-question-option-container.selected,.cio-question-option-container-text-only.selected{outline:3px solid var(--blue-denim-600);box-shadow:0 4px 10px #5d7ce859}.cio-question-option-container:hover:not(.selected){outline:1px solid var(--blue-denim-600);box-shadow:0 4px 10px #5d7ce840}.cio-question-option-container-text-only:hover:not(.selected){outline:1px solid var(--blue-denim-600);box-shadow:0 4px 10px #5d7ce840}.cio-select-question-container{display:flex;flex-direction:column;align-items:center;justify-content:center;max-width:1200px;margin-bottom:var(--bottom-bar-height);padding:1rem;margin-top:2rem;width:100%}.cio-question-options-container{display:flex;justify-content:center;flex-wrap:wrap;gap:1rem;width:100%;margin-bottom:auto;margin-top:2rem}.cio-question-options-container-text-only{display:flex;flex-direction:column;gap:1rem;width:100%;padding:10px;margin-bottom:auto;margin-top:2rem}.cio-question-option-container-text-only{padding:1.5rem;border-radius:8px;border:1px solid var(--white-ice-700);box-shadow:0 4px 10px #5d7ce826;display:flex;flex-direction:column;width:100%;margin:auto;cursor:pointer}.cio-question-option-image{width:100%;height:auto;border-radius:4px;object-fit:cover;margin-bottom:16px;aspect-ratio:1/1}.cio-question-option-value{text-align:center;margin:auto 0}.cio-select-question-text{width:100%;display:flex;flex-direction:column;justify-content:space-between}.cio-select-question-text .cio-question-description{margin-bottom:0}.cio-results-container{width:100%;max-width:1200px;padding:2rem 1rem;display:flex;flex-direction:column}.cio-results-title{margin-top:0;margin-bottom:1rem;color:var(--gray-dust-500)}.cio-results-filter-container{margin-bottom:1.5rem}.cio-results-filter-container p{color:var(--gray-dust-300);margin-bottom:1.5rem}.cio-results-filter-options{display:flex;flex-wrap:wrap;gap:.5rem;cursor:default}.cio-results-filter-option{background-color:var(--white-ice-200);border:1px solid var(--primary-color);color:var(--blue-denim-500);border-radius:10000px;padding:.4rem 1.25rem;display:flex;justify-content:center;align-items:center;font-size:.75rem}.cio-results{display:flex;flex-direction:row;flex-wrap:wrap}.cio-zero-results{margin-top:2rem;text-align:center;display:flex;flex-direction:column;justify-content:center;max-width:420px;margin-left:auto;margin-right:auto}.cio-zero-results-subtitle{font-weight:500;font-size:1.25rem;line-height:1.5rem;color:var(--gray-dust-500);margin-top:0}.cio-zero-results-description{color:var(--gray-dust-100);line-height:1.25rem;margin-top:0}.cio-zero-results .cio-button-container{width:14rem;margin-right:auto;margin-left:auto;padding-left:0}.cio-result-card{background-color:transparent;height:auto;box-sizing:border-box;text-decoration:none;margin:0;margin-bottom:1.5rem;flex-basis:100%;display:flex;flex-direction:column}.cio-result-card-anchor{text-decoration:none;background-color:transparent;color:inherit;height:100%;display:flex;flex-direction:column;justify-content:space-between}.cio-result-card-image{width:auto;height:240px;margin-left:auto;margin-right:auto}.cio-result-card-image img{height:100%;width:100%;object-fit:contain}.cio-result-card-text{flex-grow:1;display:flex;flex-direction:column;justify-content:space-between}.cio-result-card-title{color:var(--gray-dust-500);margin:0;margin-bottom:1rem;font-weight:700}.cio-result-card-prices{margin-bottom:1rem;font-weight:700}.cio-result-card-sale-price{color:#bf1728;margin-right:.75rem}.cio-result-card-regular-price{color:var(--gray-dust-900)}.cio-result-card-regular-price--strike-through{text-decoration:line-through}.cio-result-card-cta-button{padding:.75rem 2.5rem;height:3rem;background:var(--primary-color);border:1px solid var(--primary-color);border-radius:4px;color:var(--white-ice-100);font-size:1rem;width:100%}.cio-result-card-cta-button:hover{background:var(--blue-denim-500);border:2px solid var(--blue-denim-600)}.cio-result-card-cta-button:active{background:var(--blue-denim-700);border:2px solid var(--blue-denim-800)}.cio-result-card-cta-button:disabled,.cio-result-card-cta-button.disabled{background:var(--blue-denim-200);border:2px solid var(--blue-denim-100)}.cio-question-redo-button{background:none;border:none;display:flex;gap:.5rem;align-items:center}.cio-question-redo-button:hover{text-decoration:underline}.cio-question-redo-button span{margin-top:1px}@media screen and (min-width: 640px){.cio-container--with-image{display:flex;justify-content:center;align-items:center;margin-bottom:0}.cio-question-image-container{height:100%;flex-basis:50%;flex-shrink:0;border-radius:4px}.cio-cover-question-container--with-image{justify-content:center;margin-bottom:0}.cio-select-question-text{margin-top:2rem}.cio-select-question-buttons{padding:1rem 3rem}.cio-results-container{padding:3rem 4rem}.cio-results-filter-and-redo-container{display:flex;justify-content:space-between;align-items:end;margin-bottom:1.5rem}.cio-results-filter-container{margin-bottom:0}.cio-results{column-gap:5%}.cio-result-card{flex-basis:30%}}@media screen and (min-width: 768px){.cio-quiz{font-size:18px}.cio-container{align-items:center;margin-top:0}.cio-container--with-image{padding:6rem 2rem;align-items:center;flex-direction:row}.cio-question-input-text{margin-bottom:1rem}.cio-question-image-container{max-height:1000px}.cio-cover-question-container--with-image .cio-question-image-container{max-height:unset}.cio-question-content{justify-content:center;height:fit-content;flex-basis:70%;flex-shrink:1;margin:0 auto;padding:3rem}.cio-question-description{margin-bottom:2rem}.cio-question-buttons-container{position:sticky;padding:0;margin:0;align-items:center}.cio-cover-question-container--with-image{padding:0}.cio-select-question-text{padding:0;padding-bottom:2rem;margin:0}.cio-select-question-buttons{padding:1rem 5rem}.cio-select-question-container{margin:0;padding:2rem;padding-bottom:0}.cio-question-option-container{width:calc(25% - 13px)}.cio-question-options-container{padding:0;margin-bottom:2rem}.cio-question-options-container-text-only{flex-direction:row;flex-wrap:wrap;justify-content:center;margin-bottom:2rem;margin-top:0}.cio-question-option-container-text-only{margin:0;width:30%}}@media screen and (min-width: 1280px){.cio-container--with-image{padding:6rem 2rem}.cio-cover-question-container--with-image{padding:0}.cio-question-option-container-text-only{width:30%}.cio-select-question-container{margin-bottom:0}.cio-select-question-text{padding:2.5rem 0rem}.cio-results-container{margin-top:3rem}.cio-zero-results{margin-top:7rem}.cio-question-content{padding:5rem}}.cio-spinner{display:inline-block;position:relative;width:80px;margin:auto}.cio-spinner div{box-sizing:border-box;display:block;position:absolute;top:-35px;width:64px;height:64px;margin:4px;border:4px solid var(--blue-denim-200);border-radius:50%;animation:cio-spinner 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:var(--blue-denim-200) transparent transparent transparent}.cio-spinner div:nth-child(1){animation-delay:-.45s}.cio-spinner div:nth-child(2){animation-delay:-.3s}.cio-spinner div:nth-child(3){animation-delay:-.15s}@keyframes cio-spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}")),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.id="cio-quizzes-styles",e.appendChild(document.createTextNode(".cio-quiz{--blue-denim-100: #7590ee;--blue-denim-1000: #061d6e;--blue-denim-200: #5d7ce8;--blue-denim-300: #395ddb;--blue-denim-400: #2348ca;--blue-denim-500: #163ab5;--blue-denim-600: #0e2fa0;--blue-denim-700: #0b2a93;--blue-denim-800: #092587;--blue-denim-900: #07217b;--gray-dust-100: #92959c;--gray-dust-1000: #272729;--gray-dust-200: #74757b;--gray-dust-300: #606166;--gray-dust-400: #515356;--gray-dust-500: #46474a;--gray-dust-600: #3c3d3f;--gray-dust-700: #37373a;--gray-dust-800: #313134;--gray-dust-900: #2c2c2f;--white-ice-100: #f9fbfe;--white-ice-200: #ecf4fd;--white-ice-300: #e1eefd;--white-ice-400: #d3e5fb;--white-ice-500: #c8daee;--white-ice-600: #bdcde0;--white-ice-700: #b1bfd0;--white-ice-800: #97a2b0;--bottom-bar-height: 80px;--primary-color: var(--blue-denim-400);--container-image-small-height: 250px;container:quiz / inline-size}.cio-quiz,.cio-quiz *{box-sizing:border-box;font-family:Inter,sans-serif}.cio-quiz{position:relative;min-width:100%;min-height:100%;height:100%;overflow:auto;display:flex;justify-content:center;background-color:#fff;color:var(--gray-dust-500);font-size:16px}.cio-quiz button{cursor:pointer}.cio-container{display:flex;align-items:center;justify-content:center;margin-top:2rem;padding-bottom:var(--bottom-bar-height)}.cio-container--with-image{display:flex;flex-direction:column;width:100%;max-height:100vh;padding-bottom:var(--bottom-bar-height)}.cio-question-content{display:flex;flex-direction:column;height:100%;padding:1rem}.cio-question-title{font-size:2.125em;margin:0}.cio-question-description{font-size:1em;line-height:1.5;margin-top:1.5rem}.cio-question-image{width:100%;height:100%;object-fit:cover}.cio-question-image-container{box-sizing:border-box;width:100%;object-fit:cover;max-height:var(--container-image-small-height);display:flex}.cio-question-input-text{width:100%;padding:.5rem;border:0;border-bottom:1px solid var(--blue-denim-100);color:var(--blue-denim-500);padding:.8rem;outline:none;font-size:1rem}.cio-question-input-text:focus{border-bottom:1px solid var(--blue-denim-500)}.cio-question-input-text::placeholder{color:var(--blue-denim-100)}.cio-question-buttons-container{width:100%;height:var(--bottom-bar-height);padding:8px 16px;display:flex;position:absolute;bottom:0px;left:0px;background:white;background-color:#ffffffde;align-items:center}.cio-question-cta-button{background:var(--primary-color);color:var(--white-ice-100);border:1px solid var(--primary-color);border-radius:4px;height:3rem;font-size:1rem;flex-grow:1;margin-left:auto;width:100%}.cio-button-container{max-width:10rem;flex-grow:1;margin-left:auto;padding-left:1rem}.cio-question-cta-button:hover{background:var(--blue-denim-500);border:2px solid var(--blue-denim-600)}.cio-question-cta-button:active{background:var(--blue-denim-700);border:2px solid var(--blue-denim-800)}.cio-question-cta-button:disabled,.cio-question-cta-button.disabled{background:var(--blue-denim-200);border:2px solid var(--blue-denim-100)}.cio-question-back-button{color:var(--primary-color);background:#ffffff;border:1px solid var(--primary-color);border-radius:4px;height:3rem;width:3rem;font-size:1rem;margin-right:4rem}.cio-question-back-button:hover{border:2px solid var(--blue-denim-600)}.cio-question-back-button:active{border:2px solid var(--blue-denim-700)}.cio-question-back-button svg{display:inline}.cio-cover-question-container--with-image{flex-direction:column-reverse;padding:0;padding-bottom:var(--bottom-bar-height)}.cio-question-option-container{padding:1.5rem;border-radius:8px;border:1px solid var(--white-ice-700);box-shadow:0 4px 10px #5d7ce826;width:calc(50% - 10px);display:flex;flex-direction:column;cursor:pointer}.cio-question-option-container.selected,.cio-question-option-container-text-only.selected{outline:3px solid var(--blue-denim-600);box-shadow:0 4px 10px #5d7ce859}.cio-question-option-container:hover:not(.selected){outline:1px solid var(--blue-denim-600);box-shadow:0 4px 10px #5d7ce840}.cio-question-option-container-text-only:hover:not(.selected){outline:1px solid var(--blue-denim-600);box-shadow:0 4px 10px #5d7ce840}.cio-select-question-container{position:relative;display:flex;flex-direction:column;align-items:center;align-self:start;max-width:1200px;padding:1rem;margin-top:2rem;min-height:calc(100% - 3rem);width:100%}.cio-question-options-container{display:flex;justify-content:center;flex-wrap:wrap;gap:1rem;width:100%;margin-bottom:var(--bottom-bar-height);margin-top:2rem}.cio-question-options-container-text-only{display:flex;flex-direction:column;gap:1rem;width:100%;padding:10px;margin-bottom:auto;margin-top:2rem}.cio-question-option-container-text-only{padding:1.5rem;border-radius:8px;border:1px solid var(--white-ice-700);box-shadow:0 4px 10px #5d7ce826;display:flex;flex-direction:column;width:100%;margin:auto;cursor:pointer}.cio-question-option-image{width:100%;height:auto;border-radius:4px;object-fit:cover;margin-bottom:16px;aspect-ratio:1/1}.cio-question-option-value{text-align:center;margin:auto 0}.cio-select-question-text{width:100%;display:flex;flex-direction:column;justify-content:space-between}.cio-select-question-text .cio-question-description{margin-bottom:0}.cio-results-container{width:100%;max-width:1200px;padding:2rem 1rem;display:flex;flex-direction:column}.cio-results-title{margin-top:0;margin-bottom:1rem;color:var(--gray-dust-500)}.cio-results-filter-container{margin-bottom:1.5rem}.cio-results-filter-container p{color:var(--gray-dust-300);margin-bottom:1.5rem}.cio-results-filter-options{display:flex;flex-wrap:wrap;gap:.5rem;cursor:default}.cio-results-filter-option{background-color:var(--white-ice-200);border:1px solid var(--primary-color);color:var(--blue-denim-500);border-radius:10000px;padding:.4rem 1.25rem;display:flex;justify-content:center;align-items:center;font-size:.75rem}.cio-results{display:flex;flex-direction:row;flex-wrap:wrap}.cio-zero-results{margin-top:2rem;text-align:center;display:flex;flex-direction:column;justify-content:center;max-width:420px;margin-left:auto;margin-right:auto}.cio-zero-results-subtitle{font-weight:500;font-size:1.25rem;line-height:1.5rem;color:var(--gray-dust-500);margin-top:0}.cio-zero-results-description{color:var(--gray-dust-100);line-height:1.25rem;margin-top:0}.cio-zero-results .cio-button-container{width:14rem;margin-right:auto;margin-left:auto;padding-left:0}.cio-result-card{background-color:transparent;height:auto;box-sizing:border-box;text-decoration:none;margin:0;margin-bottom:1.5rem;flex-basis:100%;display:flex;flex-direction:column}.cio-result-card-anchor{text-decoration:none;background-color:transparent;color:inherit;height:100%;display:flex;flex-direction:column;justify-content:space-between}.cio-result-card-image{width:auto;height:240px;margin-left:auto;margin-right:auto}.cio-result-card-image img{height:100%;width:100%;object-fit:contain}.cio-result-card-text{flex-grow:1;display:flex;flex-direction:column;justify-content:space-between}.cio-result-card-title{color:var(--gray-dust-500);margin:0;margin-bottom:1rem;font-weight:700}.cio-result-card-prices{margin-bottom:1rem;font-weight:700}.cio-result-card-sale-price{color:#bf1728;margin-right:.75rem}.cio-result-card-regular-price{color:var(--gray-dust-900)}.cio-result-card-regular-price--strike-through{text-decoration:line-through}.cio-result-card-cta-button{padding:.75rem 2.5rem;height:3rem;background:var(--primary-color);border:1px solid var(--primary-color);border-radius:4px;color:var(--white-ice-100);font-size:1rem;width:100%}.cio-result-card-cta-button:hover{background:var(--blue-denim-500);border:2px solid var(--blue-denim-600)}.cio-result-card-cta-button:active{background:var(--blue-denim-700);border:2px solid var(--blue-denim-800)}.cio-result-card-cta-button:disabled,.cio-result-card-cta-button.disabled{background:var(--blue-denim-200);border:2px solid var(--blue-denim-100)}.cio-question-redo-button{background:none;border:none;display:flex;gap:.5rem;align-items:center}.cio-question-redo-button:hover{text-decoration:underline}.cio-question-redo-button span{margin-top:1px}@container quiz (min-width: 640px){.cio-container{padding-bottom:0}.cio-container--with-image{display:flex;justify-content:center;align-items:center;margin-bottom:0;padding-bottom:0}.cio-question-image-container{height:100%;flex-basis:50%;flex-shrink:0;border-radius:4px}.cio-cover-question-container--with-image{justify-content:center;margin-bottom:0;padding-bottom:0}.cio-select-question-text{margin-top:2rem}.cio-select-question-buttons{padding:1rem 3rem}.cio-results-container{padding:3rem 4rem}.cio-results-filter-and-redo-container{display:flex;justify-content:space-between;align-items:end;margin-bottom:1.5rem}.cio-results-filter-container{margin-bottom:0}.cio-results{column-gap:5%}.cio-result-card{flex-basis:30%}}@container quiz (min-width: 768px){.cio-container{align-items:center;margin-top:0}.cio-container--with-image{padding:6% 2%;align-items:center;flex-direction:row}.cio-question-input-text{margin-bottom:1rem}.cio-question-image-container{max-height:100%}.cio-cover-question-container--with-image .cio-question-image-container{max-height:unset}.cio-question-content{justify-content:center;height:fit-content;flex-basis:70%;flex-shrink:1;margin:0 auto;padding:3rem}.cio-question-description{margin-bottom:2rem}.cio-question-buttons-container{position:sticky;padding:0;margin:0;align-items:center}.cio-cover-question-container--with-image{padding:0}.cio-select-question-text{padding:0;padding-bottom:2rem;margin:0}.cio-select-question-buttons{padding:1rem 5rem}.cio-select-question-container{justify-content:center;margin:0;padding:2rem;padding-bottom:0}.cio-question-option-container{width:calc(25% - 13px)}.cio-question-options-container{padding:0;margin-bottom:2rem}.cio-question-options-container-text-only{flex-direction:row;flex-wrap:wrap;justify-content:center;margin-bottom:2rem;margin-top:0}.cio-question-option-container-text-only{margin:0;width:30%}}@container quiz (min-width: 1280px){.cio-cover-question-container--with-image{padding:0}.cio-question-option-container-text-only{width:30%}.cio-select-question-container{margin-bottom:0}.cio-select-question-text{padding:2.5rem 0rem}.cio-results-container{margin-top:3rem}.cio-zero-results{margin-top:7rem}.cio-question-content{padding:5rem}}.cio-spinner{display:inline-block;position:relative;width:80px;margin:auto}.cio-spinner div{box-sizing:border-box;display:block;position:absolute;top:-35px;width:64px;height:64px;margin:4px;border:4px solid var(--blue-denim-200);border-radius:50%;animation:cio-spinner 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:var(--blue-denim-200) transparent transparent transparent}.cio-spinner div:nth-child(1){animation-delay:-.45s}.cio-spinner div:nth-child(2){animation-delay:-.3s}.cio-spinner div:nth-child(3){animation-delay:-.15s}@keyframes cio-spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}")),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
|
|
2
2
|
var kt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Af(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $={},Df={get exports(){return $},set exports(e){$=e}},Q={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react.production.min.js
|
package/lib/cjs/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RequestStates = exports.cioJsClientDescription = exports.basicDescription = exports.componentDescription = exports.quizId = exports.apiKey = void 0;
|
|
3
|
+
exports.RequestStates = exports.smallContainerDescription = exports.cioJsClientDescription = exports.basicDescription = exports.componentDescription = exports.quizId = exports.apiKey = void 0;
|
|
4
4
|
// Autocomplete key index
|
|
5
5
|
exports.apiKey = 'key_wJSdZSiesX5hiVLt';
|
|
6
6
|
exports.quizId = 'coffee-quiz';
|
|
@@ -28,6 +28,7 @@ exports.basicDescription = `Pass an \`apiKey\` and a \`quizId\` to request quest
|
|
|
28
28
|
exports.cioJsClientDescription = `If you are already using an instance of the \`ConstructorIOClient\`, you can pass a \`cioJsClient\` instead of an \`apiKey\` to request results from Constructor's servers
|
|
29
29
|
|
|
30
30
|
> Note: \`cioJsClient\` refers to an instance of the [constructorio-client-javascript](https://www.npmjs.com/package/@constructor-io/constructorio-client-javascript)`;
|
|
31
|
+
exports.smallContainerDescription = `If you are using the provided styles, CioQuiz component will respect the height and width of its parent container and use responsive styles based on the parent container's dimensions`;
|
|
31
32
|
var RequestStates;
|
|
32
33
|
(function (RequestStates) {
|
|
33
34
|
RequestStates[RequestStates["Stale"] = 0] = "Stale";
|
package/lib/mjs/constants.js
CHANGED
|
@@ -25,6 +25,7 @@ export const basicDescription = `Pass an \`apiKey\` and a \`quizId\` to request
|
|
|
25
25
|
export const cioJsClientDescription = `If you are already using an instance of the \`ConstructorIOClient\`, you can pass a \`cioJsClient\` instead of an \`apiKey\` to request results from Constructor's servers
|
|
26
26
|
|
|
27
27
|
> Note: \`cioJsClient\` refers to an instance of the [constructorio-client-javascript](https://www.npmjs.com/package/@constructor-io/constructorio-client-javascript)`;
|
|
28
|
+
export const smallContainerDescription = `If you are using the provided styles, CioQuiz component will respect the height and width of its parent container and use responsive styles based on the parent container's dimensions`;
|
|
28
29
|
export var RequestStates;
|
|
29
30
|
(function (RequestStates) {
|
|
30
31
|
RequestStates[RequestStates["Stale"] = 0] = "Stale";
|
package/lib/styles.css
CHANGED
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
--bottom-bar-height: 80px;
|
|
32
32
|
--primary-color: var(--blue-denim-400);
|
|
33
33
|
--container-image-small-height: 250px;
|
|
34
|
+
container: quiz / inline-size;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
/* Mobile + global styles */
|
|
@@ -40,8 +41,11 @@
|
|
|
40
41
|
font-family: 'Inter', sans-serif;
|
|
41
42
|
}
|
|
42
43
|
.cio-quiz {
|
|
44
|
+
position: relative;
|
|
43
45
|
min-width: 100%;
|
|
44
46
|
min-height: 100%;
|
|
47
|
+
height: 100%;
|
|
48
|
+
overflow: auto;
|
|
45
49
|
display: flex;
|
|
46
50
|
justify-content: center;
|
|
47
51
|
background-color: #ffffff;
|
|
@@ -128,7 +132,7 @@
|
|
|
128
132
|
height: var(--bottom-bar-height);
|
|
129
133
|
padding: 8px 16px;
|
|
130
134
|
display: flex;
|
|
131
|
-
position:
|
|
135
|
+
position: absolute;
|
|
132
136
|
bottom: 0px;
|
|
133
137
|
left: 0px;
|
|
134
138
|
background: white;
|
|
@@ -223,14 +227,15 @@
|
|
|
223
227
|
box-shadow: 0px 4px 10px rgba(93, 124, 232, 0.25);
|
|
224
228
|
}
|
|
225
229
|
.cio-select-question-container {
|
|
230
|
+
position: relative;
|
|
226
231
|
display: flex;
|
|
227
232
|
flex-direction: column;
|
|
228
233
|
align-items: center;
|
|
229
|
-
|
|
234
|
+
align-self: start;
|
|
230
235
|
max-width: 1200px;
|
|
231
|
-
margin-bottom: var(--bottom-bar-height);
|
|
232
236
|
padding: 1rem;
|
|
233
237
|
margin-top: 2rem;
|
|
238
|
+
min-height: calc(100% - 3rem); /* Full height - padding - margin */
|
|
234
239
|
width: 100%;
|
|
235
240
|
}
|
|
236
241
|
.cio-question-options-container {
|
|
@@ -239,7 +244,7 @@
|
|
|
239
244
|
flex-wrap: wrap;
|
|
240
245
|
gap: 1rem;
|
|
241
246
|
width: 100%;
|
|
242
|
-
margin-bottom:
|
|
247
|
+
margin-bottom: var(--bottom-bar-height);
|
|
243
248
|
margin-top: 2rem;
|
|
244
249
|
}
|
|
245
250
|
.cio-question-options-container-text-only {
|
|
@@ -464,13 +469,18 @@
|
|
|
464
469
|
/* Media Queries */
|
|
465
470
|
|
|
466
471
|
/* Small Tablet */
|
|
467
|
-
@
|
|
468
|
-
|
|
472
|
+
@container quiz (min-width: 640px) {
|
|
473
|
+
.cio-container {
|
|
474
|
+
padding-bottom: 0;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/* Container */
|
|
469
478
|
.cio-container--with-image {
|
|
470
479
|
display: flex;
|
|
471
480
|
justify-content: center;
|
|
472
481
|
align-items: center;
|
|
473
482
|
margin-bottom: 0;
|
|
483
|
+
padding-bottom: 0;
|
|
474
484
|
}
|
|
475
485
|
|
|
476
486
|
/* Image */
|
|
@@ -485,6 +495,7 @@
|
|
|
485
495
|
.cio-cover-question-container--with-image {
|
|
486
496
|
justify-content: center;
|
|
487
497
|
margin-bottom: 0;
|
|
498
|
+
padding-bottom: 0;
|
|
488
499
|
}
|
|
489
500
|
|
|
490
501
|
/* Select Component */
|
|
@@ -519,23 +530,18 @@
|
|
|
519
530
|
}
|
|
520
531
|
|
|
521
532
|
/* Big Tablet */
|
|
522
|
-
@
|
|
523
|
-
/* Quiz */
|
|
524
|
-
.cio-quiz {
|
|
525
|
-
font-size: 18px;
|
|
526
|
-
}
|
|
527
|
-
|
|
533
|
+
@container quiz (min-width: 768px) {
|
|
528
534
|
/* Container */
|
|
529
535
|
.cio-container {
|
|
530
536
|
align-items: center;
|
|
531
537
|
margin-top: 0;
|
|
532
538
|
}
|
|
533
539
|
.cio-container--with-image {
|
|
534
|
-
padding:
|
|
540
|
+
padding: 6% 2%;
|
|
535
541
|
align-items: center;
|
|
536
542
|
flex-direction: row;
|
|
537
543
|
}
|
|
538
|
-
|
|
544
|
+
|
|
539
545
|
/* Input */
|
|
540
546
|
.cio-question-input-text {
|
|
541
547
|
margin-bottom: 1rem;
|
|
@@ -543,7 +549,7 @@
|
|
|
543
549
|
|
|
544
550
|
/* Image */
|
|
545
551
|
.cio-question-image-container {
|
|
546
|
-
max-height:
|
|
552
|
+
max-height: 100%;
|
|
547
553
|
}
|
|
548
554
|
.cio-cover-question-container--with-image .cio-question-image-container {
|
|
549
555
|
max-height: unset;
|
|
@@ -587,6 +593,7 @@
|
|
|
587
593
|
padding: 1rem 5rem;
|
|
588
594
|
}
|
|
589
595
|
.cio-select-question-container {
|
|
596
|
+
justify-content: center;
|
|
590
597
|
margin: 0;
|
|
591
598
|
padding: 2rem;
|
|
592
599
|
padding-bottom: 0;
|
|
@@ -612,11 +619,8 @@
|
|
|
612
619
|
}
|
|
613
620
|
|
|
614
621
|
/* Desktop */
|
|
615
|
-
@
|
|
622
|
+
@container quiz (min-width: 1280px) {
|
|
616
623
|
/* Container */
|
|
617
|
-
.cio-container--with-image {
|
|
618
|
-
padding: 6rem 2rem;
|
|
619
|
-
}
|
|
620
624
|
.cio-cover-question-container--with-image {
|
|
621
625
|
padding: 0;
|
|
622
626
|
}
|
|
@@ -632,7 +636,6 @@
|
|
|
632
636
|
padding: 2.5rem 0rem;
|
|
633
637
|
}
|
|
634
638
|
|
|
635
|
-
|
|
636
639
|
/* Results component */
|
|
637
640
|
.cio-results-container {
|
|
638
641
|
margin-top: 3rem;
|
package/lib/types/constants.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export declare const quizId = "coffee-quiz";
|
|
|
3
3
|
export declare const componentDescription = "- import `CioQuiz` to render in your JSX.\n- This component handles state management, data fetching, and rendering logic.\n- To use this component, `quizId`, `resultsPageOptions`, and one of `apiKey` or `cioJsClient` are required.\n- `resultsPageOptions` lets you configure the results page\n - `onAddToCartClick` is a callback function that will be called when the \"Add to cart\" button is clicked\n - `onQuizResultClick` is an optional callback function that will be called when the result card is clicked. The default behavior is redirecting the user to the item's URL\n - `onQuizResultsLoaded` is an optional callback function that will be called when the quiz results are loaded\n - `resultCardRegularPriceKey` is a parameter that specifies the metadata field name for the regular price\n - `resultCardSalePriceKey` is an optional parameter that specifies the metadata field name for the sale price\n- Use different props to configure the behavior of this component.\n- The following stories show how different props affect the component's behavior\n\n> Note: `cioJsClient` refers to an instance of the [constructorio-client-javascript](https://www.npmjs.com/package/@constructor-io/constructorio-client-javascript)\n";
|
|
4
4
|
export declare const basicDescription = "Pass an `apiKey` and a `quizId` to request questions and quiz results from Constructor's servers";
|
|
5
5
|
export declare const cioJsClientDescription = "If you are already using an instance of the `ConstructorIOClient`, you can pass a `cioJsClient` instead of an `apiKey` to request results from Constructor's servers\n\n> Note: `cioJsClient` refers to an instance of the [constructorio-client-javascript](https://www.npmjs.com/package/@constructor-io/constructorio-client-javascript)";
|
|
6
|
+
export declare const smallContainerDescription = "If you are using the provided styles, CioQuiz component will respect the height and width of its parent container and use responsive styles based on the parent container's dimensions";
|
|
6
7
|
export declare enum RequestStates {
|
|
7
8
|
Stale = 0,
|
|
8
9
|
Loading = 1,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constructor-io/constructorio-ui-quizzes",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Constructor.io Quizzes UI library for web applications",
|
|
5
5
|
"author": "constructor.io",
|
|
6
6
|
"license": "MIT",
|
|
@@ -61,15 +61,15 @@
|
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@cspell/eslint-plugin": "^6.18.1",
|
|
64
|
-
"@storybook/addon-a11y": "^7.0.
|
|
65
|
-
"@storybook/addon-actions": "7.0.
|
|
66
|
-
"@storybook/addon-essentials": "7.0.
|
|
67
|
-
"@storybook/addon-interactions": "^7.0.
|
|
68
|
-
"@storybook/addon-links": "7.0.
|
|
69
|
-
"@storybook/jest": "^0.
|
|
70
|
-
"@storybook/react-webpack5": "7.0.
|
|
71
|
-
"@storybook/test-runner": "0.10.0
|
|
72
|
-
"@storybook/testing-library": "^0.0
|
|
64
|
+
"@storybook/addon-a11y": "^7.0.11",
|
|
65
|
+
"@storybook/addon-actions": "7.0.11",
|
|
66
|
+
"@storybook/addon-essentials": "7.0.11",
|
|
67
|
+
"@storybook/addon-interactions": "^7.0.11",
|
|
68
|
+
"@storybook/addon-links": "7.0.11",
|
|
69
|
+
"@storybook/jest": "^0.1.0",
|
|
70
|
+
"@storybook/react-webpack5": "7.0.11",
|
|
71
|
+
"@storybook/test-runner": "0.10.0",
|
|
72
|
+
"@storybook/testing-library": "^0.1.0",
|
|
73
73
|
"@types/react": "^18.0.26",
|
|
74
74
|
"@types/react-dom": "^18.0.9",
|
|
75
75
|
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
|
@@ -83,13 +83,13 @@
|
|
|
83
83
|
"eslint-plugin-prettier": "^4.2.1",
|
|
84
84
|
"eslint-plugin-react": "^7.31.11",
|
|
85
85
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
86
|
-
"eslint-plugin-storybook": "^0.6.
|
|
86
|
+
"eslint-plugin-storybook": "^0.6.12",
|
|
87
87
|
"husky": "^8.0.1",
|
|
88
88
|
"license-checker": "^25.0.1",
|
|
89
89
|
"react": "^18.2.0",
|
|
90
90
|
"react-dom": "^18.2.0",
|
|
91
91
|
"start-server-and-test": "^2.0.0",
|
|
92
|
-
"storybook": "7.0.
|
|
92
|
+
"storybook": "7.0.11",
|
|
93
93
|
"typescript": "^4.9.4",
|
|
94
94
|
"webpack": "^5.75.0",
|
|
95
95
|
"vite": "^4.2.1",
|