@constructor-io/constructorio-ui-quizzes 1.19.10 → 1.19.11
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/dist/constructorio-ui-quizzes-bundled.js +12 -12
- package/lib/cjs/components/CioQuiz/ErrorIconSVG.js +9 -0
- package/lib/cjs/components/CioQuiz/index.js +12 -3
- package/lib/cjs/components/ZeroResults/LightbulbIconSVG.js +9 -0
- package/lib/cjs/components/ZeroResults/ZeroResults.js +5 -1
- package/lib/cjs/hooks/useQuizEvents/index.js +1 -0
- package/lib/cjs/hooks/useQuizEvents/useQuizResetClick.js +4 -2
- package/lib/cjs/version.js +1 -1
- package/lib/mjs/components/CioQuiz/ErrorIconSVG.js +5 -0
- package/lib/mjs/components/CioQuiz/index.js +12 -3
- package/lib/mjs/components/ZeroResults/LightbulbIconSVG.js +5 -0
- package/lib/mjs/components/ZeroResults/ZeroResults.js +5 -1
- package/lib/mjs/hooks/useQuizEvents/index.js +1 -0
- package/lib/mjs/hooks/useQuizEvents/useQuizResetClick.js +4 -2
- package/lib/mjs/version.js +1 -1
- package/lib/styles.css +121 -11
- package/lib/types/components/CioQuiz/ErrorIconSVG.d.ts +2 -0
- package/lib/types/components/ZeroResults/LightbulbIconSVG.d.ts +2 -0
- package/lib/types/hooks/useQuizEvents/useQuizResetClick.d.ts +2 -0
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
+
function ErrorIconSVG() {
|
|
6
|
+
return (react_1.default.createElement("svg", { width: '64', height: '64', viewBox: '0 0 64 64', fill: 'none', xmlns: 'http://www.w3.org/2000/svg' },
|
|
7
|
+
react_1.default.createElement("path", { d: 'M29.3333 40H34.6666V45.3333H29.3333V40ZM29.3333 18.6667H34.6666V34.6667H29.3333V18.6667ZM31.9733 5.33333C17.2533 5.33333 5.33331 17.28 5.33331 32C5.33331 46.72 17.2533 58.6667 31.9733 58.6667C46.72 58.6667 58.6666 46.72 58.6666 32C58.6666 17.28 46.72 5.33333 31.9733 5.33333ZM32 53.3333C20.2133 53.3333 10.6666 43.7867 10.6666 32C10.6666 20.2133 20.2133 10.6667 32 10.6667C43.7866 10.6667 53.3333 20.2133 53.3333 32C53.3333 43.7867 43.7866 53.3333 32 53.3333Z', fill: 'currentColor' })));
|
|
8
|
+
}
|
|
9
|
+
exports.default = ErrorIconSVG;
|
|
@@ -14,6 +14,7 @@ const ShareResultsModal_1 = tslib_1.__importDefault(require("../ShareResultsModa
|
|
|
14
14
|
const utils_1 = require("../../utils");
|
|
15
15
|
const ProgressBar_1 = tslib_1.__importDefault(require("../ProgressBar/ProgressBar"));
|
|
16
16
|
const actions_1 = require("./actions");
|
|
17
|
+
const ErrorIconSVG_1 = tslib_1.__importDefault(require("./ErrorIconSVG"));
|
|
17
18
|
function CioQuiz(props) {
|
|
18
19
|
var _a;
|
|
19
20
|
const { cioClient, state, events: { hydrateQuiz, resetSessionStorageState }, getAddToCartButtonProps, getAddToFavoritesButtonProps, getCoverQuestionProps, getHydrateQuizButtonProps, getNextQuestionButtonProps, getSkipQuestionButtonProps, getJumpToQuestionButtonProps, getOpenTextInputProps, getPreviousQuestionButtonProps, getQuizImageProps, getQuizResultButtonProps, getQuizResultLinkProps, getResetQuizButtonProps, getSelectInputProps, primaryColorStyles, getShareResultsButtonProps, } = (0, useQuiz_1.default)(props);
|
|
@@ -69,6 +70,16 @@ function CioQuiz(props) {
|
|
|
69
70
|
return (react_1.default.createElement("div", { className: 'cio-quiz cio-quiz-loading' },
|
|
70
71
|
react_1.default.createElement(Spinner_1.default, null)));
|
|
71
72
|
}
|
|
73
|
+
if (state.quiz.requestState === constants_1.RequestStates.Error) {
|
|
74
|
+
return (react_1.default.createElement("div", { className: 'cio-quiz cio-quiz-error' },
|
|
75
|
+
react_1.default.createElement("style", null, `.cio-quiz ${(0, utils_1.convertPrimaryColorsToString)(primaryColorStyles)}`),
|
|
76
|
+
react_1.default.createElement("div", { className: 'cio-error-message' },
|
|
77
|
+
react_1.default.createElement("div", { className: 'cio-error-icon' },
|
|
78
|
+
react_1.default.createElement(ErrorIconSVG_1.default, null)),
|
|
79
|
+
react_1.default.createElement("h3", { className: 'cio-error-title' }, "Something went wrong"),
|
|
80
|
+
react_1.default.createElement("p", { className: 'cio-error-description' }, "Something unexpected happened. Please retake the quiz to continue."),
|
|
81
|
+
react_1.default.createElement("button", Object.assign({}, getResetQuizButtonProps(), { type: 'button' }), "Retake Quiz"))));
|
|
82
|
+
}
|
|
72
83
|
const questionData = (_a = state.quiz.currentQuestion) === null || _a === void 0 ? void 0 : _a.next_question;
|
|
73
84
|
const questionType = questionData === null || questionData === void 0 ? void 0 : questionData.type;
|
|
74
85
|
const questionImages = questionData === null || questionData === void 0 ? void 0 : questionData.images;
|
|
@@ -78,9 +89,7 @@ function CioQuiz(props) {
|
|
|
78
89
|
if (state.quiz.requestState === constants_1.RequestStates.Success) {
|
|
79
90
|
return (react_1.default.createElement("div", { className: 'cio-quiz', style: { overflow: showShareModal || showSessionPrompt ? 'hidden' : undefined } },
|
|
80
91
|
displayBackgroundImage && (0, utils_1.renderImages)(questionImages, 'cio-question-background-image'),
|
|
81
|
-
react_1.default.createElement("style", null,
|
|
82
|
-
".cio-quiz ",
|
|
83
|
-
(0, utils_1.convertPrimaryColorsToString)(primaryColorStyles)),
|
|
92
|
+
react_1.default.createElement("style", null, `.cio-quiz ${(0, utils_1.convertPrimaryColorsToString)(primaryColorStyles)}`),
|
|
84
93
|
react_1.default.createElement(SessionPromptModal_1.default, { resetStoredState: resetSessionStorageState, continueSession: hydrateQuiz, showSessionPrompt: showSessionPrompt, setShowSessionPrompt: setShowSessionPrompt }),
|
|
85
94
|
state.quiz && showShareModal && (react_1.default.createElement(ShareResultsModal_1.default, { onClose: onModalClose, quizState: state.quiz, onEmailResults: callbacks === null || callbacks === void 0 ? void 0 : callbacks.onEmailResults, answers: state.answers.payload })),
|
|
86
95
|
react_1.default.createElement(context_1.default.Provider, { value: contextValue }, state.quiz.results || skipToResults ? (react_1.default.createElement(ResultContainer_1.default, { resultCardOptions: resultCardOptions, onShare: onModalOpen, resultsPageOptions: resultsPageOptions })) : (state.quiz.currentQuestion && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
+
function LightbulbIconSVG() {
|
|
6
|
+
return (react_1.default.createElement("svg", { width: '64', height: '64', viewBox: '0 0 64 64', fill: 'none', xmlns: 'http://www.w3.org/2000/svg' },
|
|
7
|
+
react_1.default.createElement("path", { d: 'M23.9999 56C23.9999 57.4667 25.1999 58.6667 26.6666 58.6667H37.3333C38.7999 58.6667 39.9999 57.4667 39.9999 56V53.3333H23.9999V56ZM31.9999 5.33333C21.7066 5.33333 13.3333 13.7067 13.3333 24C13.3333 30.3467 16.5066 35.92 21.3333 39.3067V45.3333C21.3333 46.8 22.5333 48 23.9999 48H39.9999C41.4666 48 42.6666 46.8 42.6666 45.3333V39.3067C47.4932 35.92 50.6666 30.3467 50.6666 24C50.6666 13.7067 42.2932 5.33333 31.9999 5.33333ZM39.5999 34.9333L37.3333 36.5333V42.6667H26.6666V36.5333L24.3999 34.9333C20.7999 32.4267 18.6666 28.3467 18.6666 24C18.6666 16.64 24.6399 10.6667 31.9999 10.6667C39.3599 10.6667 45.3333 16.64 45.3333 24C45.3333 28.3467 43.1999 32.4267 39.5999 34.9333Z', fill: 'currentColor' })));
|
|
8
|
+
}
|
|
9
|
+
exports.default = LightbulbIconSVG;
|
|
@@ -4,10 +4,14 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
const CTAButton_1 = tslib_1.__importDefault(require("../CTAButton/CTAButton"));
|
|
6
6
|
const context_1 = tslib_1.__importDefault(require("../CioQuiz/context"));
|
|
7
|
+
const LightbulbIconSVG_1 = tslib_1.__importDefault(require("./LightbulbIconSVG"));
|
|
7
8
|
function ZeroResults() {
|
|
8
9
|
const { getResetQuizButtonProps } = (0, react_1.useContext)(context_1.default);
|
|
9
10
|
return (react_1.default.createElement("div", { className: 'cio-zero-results' },
|
|
10
|
-
react_1.default.createElement("
|
|
11
|
+
react_1.default.createElement("div", { className: 'cio-zero-results-icon' },
|
|
12
|
+
react_1.default.createElement(LightbulbIconSVG_1.default, null)),
|
|
13
|
+
react_1.default.createElement("h3", { className: 'cio-zero-results-title' }, "Let's try something else"),
|
|
14
|
+
react_1.default.createElement("p", { className: 'cio-zero-results-description' }, "We did not find products matching all your preferences. Try adjusting a few answers to see more options."),
|
|
11
15
|
react_1.default.createElement(CTAButton_1.default, { ctaText: 'Retake Quiz', propsGetters: getResetQuizButtonProps })));
|
|
12
16
|
}
|
|
13
17
|
exports.default = ZeroResults;
|
|
@@ -38,6 +38,7 @@ const useQuizEvents = (quizOptions, cioClient, quizState) => {
|
|
|
38
38
|
dispatchLocalState,
|
|
39
39
|
dispatchApiState,
|
|
40
40
|
quizResults: quizApiState.quizResults,
|
|
41
|
+
quizRequestState: quizApiState.quizRequestState,
|
|
41
42
|
});
|
|
42
43
|
const jumpToQuestion = (0, useJumpToQuestion_1.default)({
|
|
43
44
|
dispatchLocalState,
|
|
@@ -3,12 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const actions_1 = require("../../components/CioQuiz/actions");
|
|
6
|
+
const constants_1 = require("../../constants");
|
|
6
7
|
const useQueryParams_1 = tslib_1.__importDefault(require("../useQueryParams"));
|
|
7
8
|
const useQuizResetClick = (props) => {
|
|
8
|
-
const { resetQuizSessionStorageState, dispatchLocalState, dispatchApiState, quizResults } = props;
|
|
9
|
+
const { resetQuizSessionStorageState, dispatchLocalState, dispatchApiState, quizResults, quizRequestState, } = props;
|
|
9
10
|
const { removeSharedResultsQueryParams, isSharedResultsQuery } = (0, useQueryParams_1.default)();
|
|
10
11
|
const quizResetClickHandler = (0, react_1.useCallback)(() => {
|
|
11
|
-
if (quizResults) {
|
|
12
|
+
if (quizResults || quizRequestState === constants_1.RequestStates.Error) {
|
|
12
13
|
dispatchLocalState({
|
|
13
14
|
type: actions_1.QuestionTypes.Reset,
|
|
14
15
|
});
|
|
@@ -24,6 +25,7 @@ const useQuizResetClick = (props) => {
|
|
|
24
25
|
dispatchApiState,
|
|
25
26
|
resetQuizSessionStorageState,
|
|
26
27
|
quizResults,
|
|
28
|
+
quizRequestState,
|
|
27
29
|
removeSharedResultsQueryParams,
|
|
28
30
|
isSharedResultsQuery,
|
|
29
31
|
]);
|
package/lib/cjs/version.js
CHANGED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export default function ErrorIconSVG() {
|
|
3
|
+
return (React.createElement("svg", { width: '64', height: '64', viewBox: '0 0 64 64', fill: 'none', xmlns: 'http://www.w3.org/2000/svg' },
|
|
4
|
+
React.createElement("path", { d: 'M29.3333 40H34.6666V45.3333H29.3333V40ZM29.3333 18.6667H34.6666V34.6667H29.3333V18.6667ZM31.9733 5.33333C17.2533 5.33333 5.33331 17.28 5.33331 32C5.33331 46.72 17.2533 58.6667 31.9733 58.6667C46.72 58.6667 58.6666 46.72 58.6666 32C58.6666 17.28 46.72 5.33333 31.9733 5.33333ZM32 53.3333C20.2133 53.3333 10.6666 43.7867 10.6666 32C10.6666 20.2133 20.2133 10.6667 32 10.6667C43.7866 10.6667 53.3333 20.2133 53.3333 32C53.3333 43.7867 43.7866 53.3333 32 53.3333Z', fill: 'currentColor' })));
|
|
5
|
+
}
|
|
@@ -11,6 +11,7 @@ import ShareResultsModal from '../ShareResultsModal/ShareResultsModal';
|
|
|
11
11
|
import { convertPrimaryColorsToString, renderImages } from '../../utils';
|
|
12
12
|
import ProgressBar from '../ProgressBar/ProgressBar';
|
|
13
13
|
import { QuestionTypes } from './actions';
|
|
14
|
+
import ErrorIconSVG from './ErrorIconSVG';
|
|
14
15
|
export default function CioQuiz(props) {
|
|
15
16
|
const { cioClient, state, events: { hydrateQuiz, resetSessionStorageState }, getAddToCartButtonProps, getAddToFavoritesButtonProps, getCoverQuestionProps, getHydrateQuizButtonProps, getNextQuestionButtonProps, getSkipQuestionButtonProps, getJumpToQuestionButtonProps, getOpenTextInputProps, getPreviousQuestionButtonProps, getQuizImageProps, getQuizResultButtonProps, getQuizResultLinkProps, getResetQuizButtonProps, getSelectInputProps, primaryColorStyles, getShareResultsButtonProps, } = useQuiz(props);
|
|
16
17
|
const [showSessionPrompt, setShowSessionPrompt] = useState(false);
|
|
@@ -65,6 +66,16 @@ export default function CioQuiz(props) {
|
|
|
65
66
|
return (React.createElement("div", { className: 'cio-quiz cio-quiz-loading' },
|
|
66
67
|
React.createElement(Spinner, null)));
|
|
67
68
|
}
|
|
69
|
+
if (state.quiz.requestState === RequestStates.Error) {
|
|
70
|
+
return (React.createElement("div", { className: 'cio-quiz cio-quiz-error' },
|
|
71
|
+
React.createElement("style", null, `.cio-quiz ${convertPrimaryColorsToString(primaryColorStyles)}`),
|
|
72
|
+
React.createElement("div", { className: 'cio-error-message' },
|
|
73
|
+
React.createElement("div", { className: 'cio-error-icon' },
|
|
74
|
+
React.createElement(ErrorIconSVG, null)),
|
|
75
|
+
React.createElement("h3", { className: 'cio-error-title' }, "Something went wrong"),
|
|
76
|
+
React.createElement("p", { className: 'cio-error-description' }, "Something unexpected happened. Please retake the quiz to continue."),
|
|
77
|
+
React.createElement("button", { ...getResetQuizButtonProps(), type: 'button' }, "Retake Quiz"))));
|
|
78
|
+
}
|
|
68
79
|
const questionData = state.quiz.currentQuestion?.next_question;
|
|
69
80
|
const questionType = questionData?.type;
|
|
70
81
|
const questionImages = questionData?.images;
|
|
@@ -74,9 +85,7 @@ export default function CioQuiz(props) {
|
|
|
74
85
|
if (state.quiz.requestState === RequestStates.Success) {
|
|
75
86
|
return (React.createElement("div", { className: 'cio-quiz', style: { overflow: showShareModal || showSessionPrompt ? 'hidden' : undefined } },
|
|
76
87
|
displayBackgroundImage && renderImages(questionImages, 'cio-question-background-image'),
|
|
77
|
-
React.createElement("style", null,
|
|
78
|
-
".cio-quiz ",
|
|
79
|
-
convertPrimaryColorsToString(primaryColorStyles)),
|
|
88
|
+
React.createElement("style", null, `.cio-quiz ${convertPrimaryColorsToString(primaryColorStyles)}`),
|
|
80
89
|
React.createElement(SessionPromptModal, { resetStoredState: resetSessionStorageState, continueSession: hydrateQuiz, showSessionPrompt: showSessionPrompt, setShowSessionPrompt: setShowSessionPrompt }),
|
|
81
90
|
state.quiz && showShareModal && (React.createElement(ShareResultsModal, { onClose: onModalClose, quizState: state.quiz, onEmailResults: callbacks?.onEmailResults, answers: state.answers.payload })),
|
|
82
91
|
React.createElement(QuizContext.Provider, { value: contextValue }, state.quiz.results || skipToResults ? (React.createElement(ResultContainer, { resultCardOptions: resultCardOptions, onShare: onModalOpen, resultsPageOptions: resultsPageOptions })) : (state.quiz.currentQuestion && (React.createElement(React.Fragment, null,
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export default function LightbulbIconSVG() {
|
|
3
|
+
return (React.createElement("svg", { width: '64', height: '64', viewBox: '0 0 64 64', fill: 'none', xmlns: 'http://www.w3.org/2000/svg' },
|
|
4
|
+
React.createElement("path", { d: 'M23.9999 56C23.9999 57.4667 25.1999 58.6667 26.6666 58.6667H37.3333C38.7999 58.6667 39.9999 57.4667 39.9999 56V53.3333H23.9999V56ZM31.9999 5.33333C21.7066 5.33333 13.3333 13.7067 13.3333 24C13.3333 30.3467 16.5066 35.92 21.3333 39.3067V45.3333C21.3333 46.8 22.5333 48 23.9999 48H39.9999C41.4666 48 42.6666 46.8 42.6666 45.3333V39.3067C47.4932 35.92 50.6666 30.3467 50.6666 24C50.6666 13.7067 42.2932 5.33333 31.9999 5.33333ZM39.5999 34.9333L37.3333 36.5333V42.6667H26.6666V36.5333L24.3999 34.9333C20.7999 32.4267 18.6666 28.3467 18.6666 24C18.6666 16.64 24.6399 10.6667 31.9999 10.6667C39.3599 10.6667 45.3333 16.64 45.3333 24C45.3333 28.3467 43.1999 32.4267 39.5999 34.9333Z', fill: 'currentColor' })));
|
|
5
|
+
}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
2
|
import CTAButton from '../CTAButton/CTAButton';
|
|
3
3
|
import QuizContext from '../CioQuiz/context';
|
|
4
|
+
import LightbulbIconSVG from './LightbulbIconSVG';
|
|
4
5
|
function ZeroResults() {
|
|
5
6
|
const { getResetQuizButtonProps } = useContext(QuizContext);
|
|
6
7
|
return (React.createElement("div", { className: 'cio-zero-results' },
|
|
7
|
-
React.createElement("
|
|
8
|
+
React.createElement("div", { className: 'cio-zero-results-icon' },
|
|
9
|
+
React.createElement(LightbulbIconSVG, null)),
|
|
10
|
+
React.createElement("h3", { className: 'cio-zero-results-title' }, "Let's try something else"),
|
|
11
|
+
React.createElement("p", { className: 'cio-zero-results-description' }, "We did not find products matching all your preferences. Try adjusting a few answers to see more options."),
|
|
8
12
|
React.createElement(CTAButton, { ctaText: 'Retake Quiz', propsGetters: getResetQuizButtonProps })));
|
|
9
13
|
}
|
|
10
14
|
export default ZeroResults;
|
|
@@ -35,6 +35,7 @@ const useQuizEvents = (quizOptions, cioClient, quizState) => {
|
|
|
35
35
|
dispatchLocalState,
|
|
36
36
|
dispatchApiState,
|
|
37
37
|
quizResults: quizApiState.quizResults,
|
|
38
|
+
quizRequestState: quizApiState.quizRequestState,
|
|
38
39
|
});
|
|
39
40
|
const jumpToQuestion = useJumpToQuestion({
|
|
40
41
|
dispatchLocalState,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
2
|
import { QuestionTypes, QuizAPIActionTypes, } from '../../components/CioQuiz/actions';
|
|
3
|
+
import { RequestStates } from '../../constants';
|
|
3
4
|
import useQueryParams from '../useQueryParams';
|
|
4
5
|
const useQuizResetClick = (props) => {
|
|
5
|
-
const { resetQuizSessionStorageState, dispatchLocalState, dispatchApiState, quizResults } = props;
|
|
6
|
+
const { resetQuizSessionStorageState, dispatchLocalState, dispatchApiState, quizResults, quizRequestState, } = props;
|
|
6
7
|
const { removeSharedResultsQueryParams, isSharedResultsQuery } = useQueryParams();
|
|
7
8
|
const quizResetClickHandler = useCallback(() => {
|
|
8
|
-
if (quizResults) {
|
|
9
|
+
if (quizResults || quizRequestState === RequestStates.Error) {
|
|
9
10
|
dispatchLocalState({
|
|
10
11
|
type: QuestionTypes.Reset,
|
|
11
12
|
});
|
|
@@ -21,6 +22,7 @@ const useQuizResetClick = (props) => {
|
|
|
21
22
|
dispatchApiState,
|
|
22
23
|
resetQuizSessionStorageState,
|
|
23
24
|
quizResults,
|
|
25
|
+
quizRequestState,
|
|
24
26
|
removeSharedResultsQueryParams,
|
|
25
27
|
isSharedResultsQuery,
|
|
26
28
|
]);
|
package/lib/mjs/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '1.19.
|
|
1
|
+
export default '1.19.11';
|
package/lib/styles.css
CHANGED
|
@@ -508,30 +508,106 @@
|
|
|
508
508
|
flex-direction: row;
|
|
509
509
|
flex-wrap: wrap;
|
|
510
510
|
}
|
|
511
|
+
/* Zero Results */
|
|
511
512
|
.cio-quiz .cio-zero-results {
|
|
512
|
-
margin-top: 2rem;
|
|
513
513
|
text-align: center;
|
|
514
514
|
display: flex;
|
|
515
515
|
flex-direction: column;
|
|
516
516
|
justify-content: center;
|
|
517
|
+
align-items: center;
|
|
517
518
|
max-width: 420px;
|
|
519
|
+
min-height: 300px;
|
|
518
520
|
margin-left: auto;
|
|
519
521
|
margin-right: auto;
|
|
522
|
+
padding: 1.5rem;
|
|
520
523
|
}
|
|
521
|
-
.cio-quiz .cio-zero-results-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
524
|
+
.cio-quiz .cio-zero-results-icon {
|
|
525
|
+
color: var(--primary-color);
|
|
526
|
+
margin-bottom: 24px;
|
|
527
|
+
}
|
|
528
|
+
.cio-quiz .cio-zero-results-icon svg {
|
|
529
|
+
width: 48px;
|
|
530
|
+
height: 48px;
|
|
531
|
+
}
|
|
532
|
+
.cio-quiz .cio-zero-results-title {
|
|
533
|
+
font-weight: 700;
|
|
534
|
+
font-size: 24px;
|
|
535
|
+
line-height: 124%;
|
|
536
|
+
letter-spacing: -0.04em;
|
|
537
|
+
text-align: center;
|
|
538
|
+
margin: 0 0 8px 0;
|
|
539
|
+
color: var(--gray-dust-500);
|
|
540
|
+
}
|
|
541
|
+
.cio-quiz .cio-zero-results-description {
|
|
542
|
+
font-weight: 600;
|
|
543
|
+
font-size: 14px;
|
|
544
|
+
line-height: 150%;
|
|
545
|
+
letter-spacing: 0;
|
|
546
|
+
text-align: center;
|
|
547
|
+
margin: 0 0 24px 0;
|
|
526
548
|
color: var(--gray-dust-500);
|
|
527
|
-
margin-top: 0;
|
|
528
549
|
}
|
|
529
550
|
.cio-quiz .cio-zero-results .cio-button-container {
|
|
530
|
-
width:
|
|
551
|
+
width: 100%;
|
|
552
|
+
max-width: 320px;
|
|
531
553
|
margin-right: auto;
|
|
532
554
|
margin-left: auto;
|
|
533
555
|
padding-left: 0;
|
|
534
556
|
}
|
|
557
|
+
.cio-quiz .cio-zero-results .cio-button-container button {
|
|
558
|
+
height: 48px;
|
|
559
|
+
width: 100%;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
/* Error state */
|
|
563
|
+
.cio-quiz.cio-quiz-error {
|
|
564
|
+
display: flex;
|
|
565
|
+
justify-content: center;
|
|
566
|
+
align-items: center;
|
|
567
|
+
min-height: 300px;
|
|
568
|
+
padding: 1.5rem;
|
|
569
|
+
}
|
|
570
|
+
.cio-quiz .cio-error-message {
|
|
571
|
+
text-align: center;
|
|
572
|
+
display: flex;
|
|
573
|
+
flex-direction: column;
|
|
574
|
+
justify-content: center;
|
|
575
|
+
align-items: center;
|
|
576
|
+
max-width: 420px;
|
|
577
|
+
}
|
|
578
|
+
.cio-quiz .cio-error-icon {
|
|
579
|
+
color: var(--primary-color);
|
|
580
|
+
margin-bottom: 24px;
|
|
581
|
+
}
|
|
582
|
+
.cio-quiz .cio-error-icon svg {
|
|
583
|
+
width: 48px;
|
|
584
|
+
height: 48px;
|
|
585
|
+
}
|
|
586
|
+
.cio-quiz .cio-error-title {
|
|
587
|
+
font-weight: 700;
|
|
588
|
+
font-size: 24px;
|
|
589
|
+
line-height: 124%;
|
|
590
|
+
letter-spacing: -0.04em;
|
|
591
|
+
text-align: center;
|
|
592
|
+
margin: 0 0 8px 0;
|
|
593
|
+
color: var(--gray-dust-500);
|
|
594
|
+
}
|
|
595
|
+
.cio-quiz .cio-error-description {
|
|
596
|
+
font-weight: 600;
|
|
597
|
+
font-size: 14px;
|
|
598
|
+
line-height: 150%;
|
|
599
|
+
letter-spacing: 0;
|
|
600
|
+
text-align: center;
|
|
601
|
+
margin: 0 0 24px 0;
|
|
602
|
+
color: var(--gray-dust-500);
|
|
603
|
+
}
|
|
604
|
+
.cio-quiz .cio-error-message .cio-question-cta-button {
|
|
605
|
+
width: 320px;
|
|
606
|
+
max-width: 100%;
|
|
607
|
+
height: 48px;
|
|
608
|
+
flex-grow: 0;
|
|
609
|
+
margin-left: 0;
|
|
610
|
+
}
|
|
535
611
|
|
|
536
612
|
/* Result Card component */
|
|
537
613
|
.cio-quiz .cio-result-card {
|
|
@@ -838,6 +914,43 @@
|
|
|
838
914
|
margin: 0;
|
|
839
915
|
width: 30%;
|
|
840
916
|
}
|
|
917
|
+
|
|
918
|
+
/* Zero Results — desktop */
|
|
919
|
+
.cio-quiz .cio-zero-results {
|
|
920
|
+
padding: 2rem;
|
|
921
|
+
}
|
|
922
|
+
.cio-quiz .cio-zero-results-icon {
|
|
923
|
+
margin-bottom: 32px;
|
|
924
|
+
}
|
|
925
|
+
.cio-quiz .cio-zero-results-icon svg {
|
|
926
|
+
width: 64px;
|
|
927
|
+
height: 64px;
|
|
928
|
+
}
|
|
929
|
+
.cio-quiz .cio-zero-results-title {
|
|
930
|
+
font-size: 32px;
|
|
931
|
+
margin: 0 0 12px 0;
|
|
932
|
+
}
|
|
933
|
+
.cio-quiz .cio-zero-results-description {
|
|
934
|
+
font-size: 16px;
|
|
935
|
+
margin: 0 0 32px 0;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
/* Error state — desktop */
|
|
939
|
+
.cio-quiz .cio-error-icon {
|
|
940
|
+
margin-bottom: 32px;
|
|
941
|
+
}
|
|
942
|
+
.cio-quiz .cio-error-icon svg {
|
|
943
|
+
width: 64px;
|
|
944
|
+
height: 64px;
|
|
945
|
+
}
|
|
946
|
+
.cio-quiz .cio-error-title {
|
|
947
|
+
font-size: 32px;
|
|
948
|
+
margin: 0 0 12px 0;
|
|
949
|
+
}
|
|
950
|
+
.cio-quiz .cio-error-description {
|
|
951
|
+
font-size: 16px;
|
|
952
|
+
margin: 0 0 32px 0;
|
|
953
|
+
}
|
|
841
954
|
}
|
|
842
955
|
|
|
843
956
|
/* Desktop */
|
|
@@ -862,9 +975,6 @@
|
|
|
862
975
|
.cio-quiz .cio-results-container {
|
|
863
976
|
margin-top: 3rem;
|
|
864
977
|
}
|
|
865
|
-
.cio-quiz .cio-zero-results {
|
|
866
|
-
margin-top: 7rem;
|
|
867
|
-
}
|
|
868
978
|
.cio-quiz .cio-question-content {
|
|
869
979
|
padding: 5rem;
|
|
870
980
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ActionAnswerQuestion, ActionQuizAPI } from '../../components/CioQuiz/actions';
|
|
3
3
|
import { QuizEventsReturn, QuizResultsResponse, QuizSharedResultsData } from '../../types';
|
|
4
|
+
import { RequestStates } from '../../constants';
|
|
4
5
|
type IUseQuizResetClickProps = {
|
|
5
6
|
resetQuizSessionStorageState: () => void;
|
|
6
7
|
dispatchLocalState: React.Dispatch<ActionAnswerQuestion>;
|
|
7
8
|
dispatchApiState: React.Dispatch<ActionQuizAPI>;
|
|
8
9
|
quizResults?: QuizResultsResponse | QuizSharedResultsData;
|
|
10
|
+
quizRequestState: RequestStates;
|
|
9
11
|
};
|
|
10
12
|
declare const useQuizResetClick: (props: IUseQuizResetClickProps) => QuizEventsReturn.ResetQuiz;
|
|
11
13
|
export default useQuizResetClick;
|
package/lib/types/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "1.19.
|
|
1
|
+
declare const _default: "1.19.11";
|
|
2
2
|
export default _default;
|
package/package.json
CHANGED