@constructor-io/constructorio-ui-quizzes 1.0.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/LICENSE +21 -0
- package/README.md +88 -0
- package/lib/cjs/components/BackButton/BackButton.js +12 -0
- package/lib/cjs/components/CTAButton/CTAButton.js +10 -0
- package/lib/cjs/components/CioQuiz/actions.js +12 -0
- package/lib/cjs/components/CioQuiz/context.js +5 -0
- package/lib/cjs/components/CioQuiz/index.js +115 -0
- package/lib/cjs/components/CioQuiz/reducer.js +32 -0
- package/lib/cjs/components/ControlBar/ControlBar.js +13 -0
- package/lib/cjs/components/CoverTypeQuestion/CoverTypeQuestion.js +42 -0
- package/lib/cjs/components/OpenTextTypeQuestion/OpenTextTypeQuestion.js +66 -0
- package/lib/cjs/components/QuestionDescription/QuestionDescription.js +9 -0
- package/lib/cjs/components/QuestionTitle/QuestionTitle.js +9 -0
- package/lib/cjs/components/QuizQuestions/index.js +17 -0
- package/lib/cjs/components/RedoButton/RedoButton.js +12 -0
- package/lib/cjs/components/RedoButton/RedoSVG.js +15 -0
- package/lib/cjs/components/ResultCard/ResultCard.js +45 -0
- package/lib/cjs/components/ResultContainer/ResultContainer.js +39 -0
- package/lib/cjs/components/ResultCtaButton/ResultCtaButton.js +16 -0
- package/lib/cjs/components/ResultFilters/ResultFilters.js +30 -0
- package/lib/cjs/components/Results/Results.js +16 -0
- package/lib/cjs/components/SelectTypeQuestion/SelectTypeQuestion.js +90 -0
- package/lib/cjs/components/Spinner/Spinner.js +12 -0
- package/lib/cjs/components/ZeroResults/ZeroResults.js +13 -0
- package/lib/cjs/constants.js +36 -0
- package/lib/cjs/hooks/useCioClient.js +11 -0
- package/lib/cjs/index.js +5 -0
- package/lib/cjs/stories/Quiz/argTypes.js +30 -0
- package/lib/cjs/types.js +2 -0
- package/lib/cjs/utils.js +97 -0
- package/lib/mjs/components/BackButton/BackButton.js +9 -0
- package/lib/mjs/components/CTAButton/CTAButton.js +7 -0
- package/lib/mjs/components/CioQuiz/actions.js +9 -0
- package/lib/mjs/components/CioQuiz/context.js +2 -0
- package/lib/mjs/components/CioQuiz/index.js +111 -0
- package/lib/mjs/components/CioQuiz/reducer.js +55 -0
- package/lib/mjs/components/ControlBar/ControlBar.js +10 -0
- package/lib/mjs/components/CoverTypeQuestion/CoverTypeQuestion.js +37 -0
- package/lib/mjs/components/OpenTextTypeQuestion/OpenTextTypeQuestion.js +61 -0
- package/lib/mjs/components/QuestionDescription/QuestionDescription.js +6 -0
- package/lib/mjs/components/QuestionTitle/QuestionTitle.js +6 -0
- package/lib/mjs/components/QuizQuestions/index.js +13 -0
- package/lib/mjs/components/RedoButton/RedoButton.js +9 -0
- package/lib/mjs/components/RedoButton/RedoSVG.js +12 -0
- package/lib/mjs/components/ResultCard/ResultCard.js +37 -0
- package/lib/mjs/components/ResultContainer/ResultContainer.js +34 -0
- package/lib/mjs/components/ResultCtaButton/ResultCtaButton.js +12 -0
- package/lib/mjs/components/ResultFilters/ResultFilters.js +27 -0
- package/lib/mjs/components/Results/Results.js +9 -0
- package/lib/mjs/components/SelectTypeQuestion/SelectTypeQuestion.js +85 -0
- package/lib/mjs/components/Spinner/Spinner.js +8 -0
- package/lib/mjs/components/ZeroResults/ZeroResults.js +10 -0
- package/lib/mjs/constants.js +33 -0
- package/lib/mjs/hooks/useCioClient.js +9 -0
- package/lib/mjs/index.js +2 -0
- package/lib/mjs/stories/Quiz/argTypes.js +27 -0
- package/lib/mjs/types.js +1 -0
- package/lib/mjs/utils.js +83 -0
- package/lib/styles.css +689 -0
- package/lib/types/components/BackButton/BackButton.d.ts +3 -0
- package/lib/types/components/CTAButton/CTAButton.d.ts +6 -0
- package/lib/types/components/CioQuiz/actions.d.ts +25 -0
- package/lib/types/components/CioQuiz/context.d.ts +17 -0
- package/lib/types/components/CioQuiz/index.d.ts +14 -0
- package/lib/types/components/CioQuiz/reducer.d.ts +12 -0
- package/lib/types/components/ControlBar/ControlBar.d.ts +10 -0
- package/lib/types/components/CoverTypeQuestion/CoverTypeQuestion.d.ts +2 -0
- package/lib/types/components/OpenTextTypeQuestion/OpenTextTypeQuestion.d.ts +7 -0
- package/lib/types/components/QuestionDescription/QuestionDescription.d.ts +6 -0
- package/lib/types/components/QuestionTitle/QuestionTitle.d.ts +6 -0
- package/lib/types/components/QuizQuestions/index.d.ts +5 -0
- package/lib/types/components/RedoButton/RedoButton.d.ts +6 -0
- package/lib/types/components/RedoButton/RedoSVG.d.ts +3 -0
- package/lib/types/components/ResultCard/ResultCard.d.ts +11 -0
- package/lib/types/components/ResultContainer/ResultContainer.d.ts +7 -0
- package/lib/types/components/ResultCtaButton/ResultCtaButton.d.ts +9 -0
- package/lib/types/components/ResultFilters/ResultFilters.d.ts +6 -0
- package/lib/types/components/Results/Results.d.ts +10 -0
- package/lib/types/components/SelectTypeQuestion/SelectTypeQuestion.d.ts +3 -0
- package/lib/types/components/Spinner/Spinner.d.ts +2 -0
- package/lib/types/components/ZeroResults/ZeroResults.d.ts +6 -0
- package/lib/types/constants.d.ts +11 -0
- package/lib/types/hooks/useCioClient.d.ts +8 -0
- package/lib/types/index.d.ts +2 -0
- package/lib/types/stories/Quiz/argTypes.d.ts +30 -0
- package/lib/types/types.d.ts +1 -0
- package/lib/types/utils.d.ts +31 -0
- package/package.json +91 -0
package/lib/styles.css
ADDED
|
@@ -0,0 +1,689 @@
|
|
|
1
|
+
/* Theme colors */
|
|
2
|
+
.cio-quiz {
|
|
3
|
+
--blue-denim-100: #7590ee;
|
|
4
|
+
--blue-denim-1000: #061d6e;
|
|
5
|
+
--blue-denim-200: #5d7ce8;
|
|
6
|
+
--blue-denim-300: #395ddb;
|
|
7
|
+
--blue-denim-400: #2348ca;
|
|
8
|
+
--blue-denim-500: #163ab5;
|
|
9
|
+
--blue-denim-600: #0e2fa0;
|
|
10
|
+
--blue-denim-700: #0b2a93;
|
|
11
|
+
--blue-denim-800: #092587;
|
|
12
|
+
--blue-denim-900: #07217b;
|
|
13
|
+
--gray-dust-100: #92959c;
|
|
14
|
+
--gray-dust-1000: #272729;
|
|
15
|
+
--gray-dust-200: #74757b;
|
|
16
|
+
--gray-dust-300: #606166;
|
|
17
|
+
--gray-dust-400: #515356;
|
|
18
|
+
--gray-dust-500: #46474a;
|
|
19
|
+
--gray-dust-600: #3c3d3f;
|
|
20
|
+
--gray-dust-700: #37373a;
|
|
21
|
+
--gray-dust-800: #313134;
|
|
22
|
+
--gray-dust-900: #2c2c2f;
|
|
23
|
+
--white-ice-100: #f9fbfe;
|
|
24
|
+
--white-ice-200: #ecf4fd;
|
|
25
|
+
--white-ice-300: #e1eefd;
|
|
26
|
+
--white-ice-400: #d3e5fb;
|
|
27
|
+
--white-ice-500: #c8daee;
|
|
28
|
+
--white-ice-600: #bdcde0;
|
|
29
|
+
--white-ice-700: #b1bfd0;
|
|
30
|
+
--white-ice-800: #97a2b0;
|
|
31
|
+
--bottom-bar-height: 80px;
|
|
32
|
+
--primary-color: var(--blue-denim-400);
|
|
33
|
+
--container-image-small-height: 250px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* Mobile + global styles */
|
|
37
|
+
.cio-quiz,
|
|
38
|
+
.cio-quiz * {
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
font-family: 'Inter', sans-serif;
|
|
41
|
+
}
|
|
42
|
+
.cio-quiz {
|
|
43
|
+
min-width: 100%;
|
|
44
|
+
min-height: 100%;
|
|
45
|
+
display: flex;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
background-color: #ffffff;
|
|
48
|
+
color: var(--gray-dust-500);
|
|
49
|
+
font-size: 16px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.cio-quiz button {
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* Container */
|
|
57
|
+
.cio-container {
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
margin-top: 2rem;
|
|
62
|
+
padding-bottom: var(--bottom-bar-height);
|
|
63
|
+
}
|
|
64
|
+
.cio-container--with-image {
|
|
65
|
+
display: flex;
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
width: 100%;
|
|
68
|
+
max-height: 100vh;
|
|
69
|
+
padding-bottom: var(--bottom-bar-height);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* Content */
|
|
73
|
+
.cio-question-content {
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: column;
|
|
76
|
+
height: 100%;
|
|
77
|
+
padding: 1rem;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* Title */
|
|
81
|
+
.cio-question-title {
|
|
82
|
+
font-size: 2.125em;
|
|
83
|
+
margin: 0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* Description */
|
|
87
|
+
.cio-question-description {
|
|
88
|
+
font-size: 1em;
|
|
89
|
+
line-height: 1.5;
|
|
90
|
+
margin-top: 1.5rem;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Image */
|
|
94
|
+
.cio-question-image {
|
|
95
|
+
width: 100%;
|
|
96
|
+
height: 100%;
|
|
97
|
+
object-fit: cover;
|
|
98
|
+
}
|
|
99
|
+
.cio-question-image-container {
|
|
100
|
+
box-sizing: border-box;
|
|
101
|
+
width: 100%;
|
|
102
|
+
object-fit: cover;
|
|
103
|
+
max-height: var(--container-image-small-height);
|
|
104
|
+
display: flex;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* Input */
|
|
108
|
+
.cio-question-input-text {
|
|
109
|
+
width: 100%;
|
|
110
|
+
padding: 0.5rem;
|
|
111
|
+
border: 0;
|
|
112
|
+
border-bottom: 1px solid var(--blue-denim-100);
|
|
113
|
+
color: var(--blue-denim-500);
|
|
114
|
+
padding: 0.8rem;
|
|
115
|
+
outline: none;
|
|
116
|
+
font-size: 1rem;
|
|
117
|
+
}
|
|
118
|
+
.cio-question-input-text:focus {
|
|
119
|
+
border-bottom: 1px solid var(--blue-denim-500);
|
|
120
|
+
}
|
|
121
|
+
.cio-question-input-text::placeholder {
|
|
122
|
+
color: var(--blue-denim-100);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* CTA Button Component */
|
|
126
|
+
.cio-question-buttons-container {
|
|
127
|
+
width: 100%;
|
|
128
|
+
height: var(--bottom-bar-height);
|
|
129
|
+
padding: 8px 16px;
|
|
130
|
+
display: flex;
|
|
131
|
+
position: fixed;
|
|
132
|
+
bottom: 0px;
|
|
133
|
+
left: 0px;
|
|
134
|
+
background: white;
|
|
135
|
+
background-color: rgba(255, 255, 255, 0.87);
|
|
136
|
+
align-items: center;
|
|
137
|
+
}
|
|
138
|
+
.cio-question-cta-button {
|
|
139
|
+
background: var(--primary-color);
|
|
140
|
+
color: var(--white-ice-100);
|
|
141
|
+
border: 1px solid var(--primary-color);
|
|
142
|
+
border-radius: 4px;
|
|
143
|
+
height: 3rem;
|
|
144
|
+
font-size: 1rem;
|
|
145
|
+
flex-grow: 1;
|
|
146
|
+
margin-left: auto;
|
|
147
|
+
width: 100%;
|
|
148
|
+
}
|
|
149
|
+
.cio-button-container {
|
|
150
|
+
max-width: 10rem;
|
|
151
|
+
flex-grow: 1;
|
|
152
|
+
margin-left: auto;
|
|
153
|
+
padding-left: 1rem;
|
|
154
|
+
}
|
|
155
|
+
.cio-question-cta-button:hover {
|
|
156
|
+
background: var(--blue-denim-500);
|
|
157
|
+
border: 2px solid var(--blue-denim-600);
|
|
158
|
+
}
|
|
159
|
+
.cio-question-cta-button:active {
|
|
160
|
+
background: var(--blue-denim-700);
|
|
161
|
+
border: 2px solid var(--blue-denim-800);
|
|
162
|
+
}
|
|
163
|
+
.cio-question-cta-button:disabled,
|
|
164
|
+
.cio-question-cta-button.disabled {
|
|
165
|
+
background: var(--blue-denim-200);
|
|
166
|
+
border: 2px solid var(--blue-denim-100);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/* Back Button Component */
|
|
170
|
+
.cio-question-back-button {
|
|
171
|
+
color: var(--primary-color);
|
|
172
|
+
background: #ffffff;
|
|
173
|
+
border: 1px solid var(--primary-color);
|
|
174
|
+
border-radius: 4px;
|
|
175
|
+
height: 3rem;
|
|
176
|
+
width: 3rem;
|
|
177
|
+
font-size: 1rem;
|
|
178
|
+
margin-right: 4rem;
|
|
179
|
+
}
|
|
180
|
+
.cio-question-back-button:hover {
|
|
181
|
+
border: 2px solid var(--blue-denim-600);
|
|
182
|
+
}
|
|
183
|
+
.cio-question-back-button:active {
|
|
184
|
+
border: 2px solid var(--blue-denim-700);
|
|
185
|
+
}
|
|
186
|
+
.cio-question-back-button svg {
|
|
187
|
+
display: inline;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/* Cover Page Component */
|
|
191
|
+
.cio-cover-question-container--with-image {
|
|
192
|
+
flex-direction: column-reverse;
|
|
193
|
+
padding: 0;
|
|
194
|
+
padding-bottom: var(--bottom-bar-height);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/** Select Component */
|
|
198
|
+
/* Options */
|
|
199
|
+
.cio-question-option-container {
|
|
200
|
+
padding: 1.5rem;
|
|
201
|
+
border-radius: 8px;
|
|
202
|
+
border: 1px solid var(--white-ice-700);
|
|
203
|
+
box-shadow: 0px 4px 10px rgba(93, 124, 232, 0.15);
|
|
204
|
+
width: calc(50% - 10px);
|
|
205
|
+
display: flex;
|
|
206
|
+
flex-direction: column;
|
|
207
|
+
cursor: pointer;
|
|
208
|
+
}
|
|
209
|
+
.cio-question-option-container.selected {
|
|
210
|
+
outline: 3px solid var(--blue-denim-600);
|
|
211
|
+
box-shadow: 0px 4px 10px rgba(93, 124, 232, 0.35);
|
|
212
|
+
}
|
|
213
|
+
.cio-question-option-container-text-only.selected {
|
|
214
|
+
outline: 3px solid var(--blue-denim-600);
|
|
215
|
+
box-shadow: 0px 4px 10px rgba(93, 124, 232, 0.35);
|
|
216
|
+
}
|
|
217
|
+
.cio-question-option-container:hover:not(.selected) {
|
|
218
|
+
outline: 1px solid var(--blue-denim-600);
|
|
219
|
+
box-shadow: 0px 4px 10px rgba(93, 124, 232, 0.25);
|
|
220
|
+
}
|
|
221
|
+
.cio-question-option-container-text-only:hover:not(.selected) {
|
|
222
|
+
outline: 1px solid var(--blue-denim-600);
|
|
223
|
+
box-shadow: 0px 4px 10px rgba(93, 124, 232, 0.25);
|
|
224
|
+
}
|
|
225
|
+
.cio-select-question-container {
|
|
226
|
+
display: flex;
|
|
227
|
+
flex-direction: column;
|
|
228
|
+
align-items: center;
|
|
229
|
+
justify-content: center;
|
|
230
|
+
max-width: 1200px;
|
|
231
|
+
margin-bottom: var(--bottom-bar-height);
|
|
232
|
+
padding: 1rem;
|
|
233
|
+
margin-top: 2rem;
|
|
234
|
+
width: 100%;
|
|
235
|
+
}
|
|
236
|
+
.cio-question-options-container {
|
|
237
|
+
display: flex;
|
|
238
|
+
justify-content: center;
|
|
239
|
+
flex-wrap: wrap;
|
|
240
|
+
gap: 1rem;
|
|
241
|
+
width: 100%;
|
|
242
|
+
margin-bottom: auto;
|
|
243
|
+
margin-top: 2rem;
|
|
244
|
+
}
|
|
245
|
+
.cio-question-options-container-text-only {
|
|
246
|
+
display: flex;
|
|
247
|
+
flex-direction: column;
|
|
248
|
+
gap: 1rem;
|
|
249
|
+
width: 100%;
|
|
250
|
+
padding: 10px;
|
|
251
|
+
margin-bottom: auto;
|
|
252
|
+
margin-top: 2rem;
|
|
253
|
+
}
|
|
254
|
+
.cio-question-option-container-text-only {
|
|
255
|
+
padding: 1.5rem;
|
|
256
|
+
border-radius: 8px;
|
|
257
|
+
border: 1px solid var(--white-ice-700);
|
|
258
|
+
box-shadow: 0px 4px 10px rgba(93, 124, 232, 0.15);
|
|
259
|
+
display: flex;
|
|
260
|
+
flex-direction: column;
|
|
261
|
+
width: 100%;
|
|
262
|
+
margin: auto;
|
|
263
|
+
cursor: pointer;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/* Option Image */
|
|
267
|
+
.cio-question-option-image {
|
|
268
|
+
width: 100%;
|
|
269
|
+
height: auto;
|
|
270
|
+
border-radius: 4px;
|
|
271
|
+
object-fit: cover;
|
|
272
|
+
margin-bottom: 16px;
|
|
273
|
+
aspect-ratio: 1/1;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/* Select Option Value */
|
|
277
|
+
.cio-question-option-value {
|
|
278
|
+
text-align: center;
|
|
279
|
+
margin: auto 0;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/* Select Text and Description */
|
|
283
|
+
.cio-select-question-text {
|
|
284
|
+
width: 100%;
|
|
285
|
+
display: flex;
|
|
286
|
+
flex-direction: column;
|
|
287
|
+
justify-content: space-between;
|
|
288
|
+
}
|
|
289
|
+
.cio-select-question-text .cio-question-description {
|
|
290
|
+
margin-bottom: 0;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/* Results component */
|
|
294
|
+
.cio-results-container {
|
|
295
|
+
width: 100%;
|
|
296
|
+
max-width: 1200px;
|
|
297
|
+
padding: 2rem 1rem;
|
|
298
|
+
display: flex;
|
|
299
|
+
flex-direction: column;
|
|
300
|
+
}
|
|
301
|
+
.cio-results-title {
|
|
302
|
+
margin-top: 0;
|
|
303
|
+
margin-bottom: 1rem;
|
|
304
|
+
color: var(--gray-dust-500);
|
|
305
|
+
}
|
|
306
|
+
.cio-results-filter-container {
|
|
307
|
+
margin-bottom: 1.5rem;
|
|
308
|
+
}
|
|
309
|
+
.cio-results-filter-container p {
|
|
310
|
+
color: var(--gray-dust-300);
|
|
311
|
+
margin-bottom: 1.5rem;
|
|
312
|
+
}
|
|
313
|
+
.cio-results-filter-options {
|
|
314
|
+
display: flex;
|
|
315
|
+
flex-wrap: wrap;
|
|
316
|
+
gap: 0.5rem;
|
|
317
|
+
cursor: default;
|
|
318
|
+
}
|
|
319
|
+
.cio-results-filter-option {
|
|
320
|
+
background-color: var(--white-ice-200);
|
|
321
|
+
border: 1px solid var(--primary-color);
|
|
322
|
+
color: var(--blue-denim-500);
|
|
323
|
+
border-radius: 10000px;
|
|
324
|
+
padding: 0.4rem 1.25rem;
|
|
325
|
+
display: flex;
|
|
326
|
+
justify-content: center;
|
|
327
|
+
align-items: center;
|
|
328
|
+
font-size: 0.75rem;
|
|
329
|
+
}
|
|
330
|
+
.cio-results {
|
|
331
|
+
display: flex;
|
|
332
|
+
flex-direction: row;
|
|
333
|
+
flex-wrap: wrap;
|
|
334
|
+
}
|
|
335
|
+
.cio-zero-results {
|
|
336
|
+
margin-top: 2rem;
|
|
337
|
+
text-align: center;
|
|
338
|
+
display: flex;
|
|
339
|
+
flex-direction: column;
|
|
340
|
+
justify-content: center;
|
|
341
|
+
max-width: 420px;
|
|
342
|
+
margin-left: auto;
|
|
343
|
+
margin-right: auto;
|
|
344
|
+
}
|
|
345
|
+
.cio-zero-results-subtitle {
|
|
346
|
+
font-weight: 500;
|
|
347
|
+
font-size: 1.25rem;
|
|
348
|
+
line-height: 1.5rem;
|
|
349
|
+
color: var(--gray-dust-500);
|
|
350
|
+
margin-top: 0;
|
|
351
|
+
}
|
|
352
|
+
.cio-zero-results-description {
|
|
353
|
+
color: var(--gray-dust-100);
|
|
354
|
+
line-height: 1.25rem;
|
|
355
|
+
margin-top: 0;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.cio-zero-results .cio-button-container {
|
|
359
|
+
width: 14rem;
|
|
360
|
+
margin-right: auto;
|
|
361
|
+
margin-left: auto;
|
|
362
|
+
padding-left: 0;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/* Result Card component */
|
|
366
|
+
.cio-result-card {
|
|
367
|
+
background-color: transparent;
|
|
368
|
+
height: auto;
|
|
369
|
+
box-sizing: border-box;
|
|
370
|
+
text-decoration: none;
|
|
371
|
+
margin: 0;
|
|
372
|
+
margin-bottom: 1.5rem;
|
|
373
|
+
flex-basis: 100%;
|
|
374
|
+
display: flex;
|
|
375
|
+
flex-direction: column;
|
|
376
|
+
}
|
|
377
|
+
.cio-result-card-anchor {
|
|
378
|
+
text-decoration: none;
|
|
379
|
+
background-color: transparent;
|
|
380
|
+
color: inherit;
|
|
381
|
+
height: 100%;
|
|
382
|
+
display: flex;
|
|
383
|
+
flex-direction: column;
|
|
384
|
+
justify-content: space-between;
|
|
385
|
+
}
|
|
386
|
+
.cio-result-card-image {
|
|
387
|
+
width: auto;
|
|
388
|
+
height: 240px;
|
|
389
|
+
margin-left: auto;
|
|
390
|
+
margin-right: auto;
|
|
391
|
+
}
|
|
392
|
+
.cio-result-card-image img {
|
|
393
|
+
height: 100%;
|
|
394
|
+
width: 100%;
|
|
395
|
+
object-fit: contain;
|
|
396
|
+
}
|
|
397
|
+
.cio-result-card-text {
|
|
398
|
+
flex-grow: 1;
|
|
399
|
+
display: flex;
|
|
400
|
+
flex-direction: column;
|
|
401
|
+
justify-content: space-between;
|
|
402
|
+
}
|
|
403
|
+
.cio-result-card-title {
|
|
404
|
+
color: var(--gray-dust-500);
|
|
405
|
+
margin: 0;
|
|
406
|
+
margin-bottom: 1rem;
|
|
407
|
+
font-weight: 700;
|
|
408
|
+
}
|
|
409
|
+
.cio-result-card-prices {
|
|
410
|
+
margin-bottom: 1rem;
|
|
411
|
+
font-weight: 700;
|
|
412
|
+
}
|
|
413
|
+
.cio-result-card-sale-price {
|
|
414
|
+
color: #bf1728;
|
|
415
|
+
margin-right: 0.75rem;
|
|
416
|
+
}
|
|
417
|
+
.cio-result-card-regular-price {
|
|
418
|
+
color: var(--gray-dust-900);
|
|
419
|
+
}
|
|
420
|
+
.cio-result-card-regular-price--strike-through {
|
|
421
|
+
text-decoration: line-through;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/* Result CTA Button */
|
|
425
|
+
.cio-result-card-cta-button {
|
|
426
|
+
padding: 0.75rem 2.5rem;
|
|
427
|
+
height: 3rem;
|
|
428
|
+
background: var(--primary-color);
|
|
429
|
+
border: 1px solid var(--primary-color);
|
|
430
|
+
border-radius: 4px;
|
|
431
|
+
color: var(--white-ice-100);
|
|
432
|
+
font-size: 1rem;
|
|
433
|
+
width: 100%;
|
|
434
|
+
}
|
|
435
|
+
.cio-result-card-cta-button:hover {
|
|
436
|
+
background: var(--blue-denim-500);
|
|
437
|
+
border: 2px solid var(--blue-denim-600);
|
|
438
|
+
}
|
|
439
|
+
.cio-result-card-cta-button:active {
|
|
440
|
+
background: var(--blue-denim-700);
|
|
441
|
+
border: 2px solid var(--blue-denim-800);
|
|
442
|
+
}
|
|
443
|
+
.cio-result-card-cta-button:disabled,
|
|
444
|
+
.cio-result-card-cta-button.disabled {
|
|
445
|
+
background: var(--blue-denim-200);
|
|
446
|
+
border: 2px solid var(--blue-denim-100);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
/* Redo Button Component */
|
|
450
|
+
.cio-question-redo-button {
|
|
451
|
+
background: none;
|
|
452
|
+
border: none;
|
|
453
|
+
display: flex;
|
|
454
|
+
gap: 0.5rem;
|
|
455
|
+
align-items: center;
|
|
456
|
+
}
|
|
457
|
+
.cio-question-redo-button:hover {
|
|
458
|
+
text-decoration: underline;
|
|
459
|
+
}
|
|
460
|
+
.cio-question-redo-button span {
|
|
461
|
+
margin-top: 1px;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/* Media Queries */
|
|
465
|
+
|
|
466
|
+
/* Small Tablet */
|
|
467
|
+
@media screen and (min-width: 640px) {
|
|
468
|
+
/* Container */
|
|
469
|
+
.cio-container--with-image {
|
|
470
|
+
display: flex;
|
|
471
|
+
justify-content: center;
|
|
472
|
+
align-items: center;
|
|
473
|
+
margin-bottom: 0;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
/* Image */
|
|
477
|
+
.cio-question-image-container {
|
|
478
|
+
height: 100%;
|
|
479
|
+
flex-basis: 50%;
|
|
480
|
+
flex-shrink: 0;
|
|
481
|
+
border-radius: 4px;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/* Cover Page Component */
|
|
485
|
+
.cio-cover-question-container--with-image {
|
|
486
|
+
justify-content: center;
|
|
487
|
+
margin-bottom: 0;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
/* Select Component */
|
|
491
|
+
.cio-select-question-text {
|
|
492
|
+
margin-top: 2rem;
|
|
493
|
+
}
|
|
494
|
+
.cio-select-question-buttons {
|
|
495
|
+
padding: 1rem 3rem;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/* Results component */
|
|
499
|
+
.cio-results-container {
|
|
500
|
+
padding: 3rem 4rem;
|
|
501
|
+
}
|
|
502
|
+
.cio-results-filter-and-redo-container {
|
|
503
|
+
display: flex;
|
|
504
|
+
justify-content: space-between;
|
|
505
|
+
align-items: end;
|
|
506
|
+
margin-bottom: 1.5rem;
|
|
507
|
+
}
|
|
508
|
+
.cio-results-filter-container {
|
|
509
|
+
margin-bottom: 0;
|
|
510
|
+
}
|
|
511
|
+
.cio-results {
|
|
512
|
+
column-gap: 5%;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
/* Result Card component */
|
|
516
|
+
.cio-result-card {
|
|
517
|
+
flex-basis: 30%;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
/* Big Tablet */
|
|
522
|
+
@media screen and (min-width: 768px) {
|
|
523
|
+
/* Quiz */
|
|
524
|
+
.cio-quiz {
|
|
525
|
+
font-size: 18px;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
/* Container */
|
|
529
|
+
.cio-container {
|
|
530
|
+
align-items: center;
|
|
531
|
+
margin-top: 0;
|
|
532
|
+
}
|
|
533
|
+
.cio-container--with-image {
|
|
534
|
+
padding: 6rem 2rem;
|
|
535
|
+
align-items: center;
|
|
536
|
+
flex-direction: row;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
/* Input */
|
|
540
|
+
.cio-question-input-text {
|
|
541
|
+
margin-bottom: 1rem;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
/* Image */
|
|
545
|
+
.cio-question-image-container {
|
|
546
|
+
max-height: 1000px;
|
|
547
|
+
}
|
|
548
|
+
.cio-cover-question-container--with-image .cio-question-image-container {
|
|
549
|
+
max-height: unset;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
/* Content */
|
|
553
|
+
.cio-question-content {
|
|
554
|
+
justify-content: center;
|
|
555
|
+
height: fit-content;
|
|
556
|
+
flex-basis: 70%;
|
|
557
|
+
flex-shrink: 1;
|
|
558
|
+
margin: 0 auto;
|
|
559
|
+
padding: 3rem;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
/* Description */
|
|
563
|
+
.cio-question-description {
|
|
564
|
+
margin-bottom: 2rem;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
/* CTA Button Component */
|
|
568
|
+
.cio-question-buttons-container {
|
|
569
|
+
position: sticky;
|
|
570
|
+
padding: 0;
|
|
571
|
+
margin: 0;
|
|
572
|
+
align-items: center;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
/* Cover Component */
|
|
576
|
+
.cio-cover-question-container--with-image {
|
|
577
|
+
padding: 0;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
/* Select Component */
|
|
581
|
+
.cio-select-question-text {
|
|
582
|
+
padding: 0;
|
|
583
|
+
padding-bottom: 2rem;
|
|
584
|
+
margin: 0;
|
|
585
|
+
}
|
|
586
|
+
.cio-select-question-buttons {
|
|
587
|
+
padding: 1rem 5rem;
|
|
588
|
+
}
|
|
589
|
+
.cio-select-question-container {
|
|
590
|
+
margin: 0;
|
|
591
|
+
padding: 2rem;
|
|
592
|
+
padding-bottom: 0;
|
|
593
|
+
}
|
|
594
|
+
.cio-question-option-container {
|
|
595
|
+
width: calc(25% - 13px);
|
|
596
|
+
}
|
|
597
|
+
.cio-question-options-container {
|
|
598
|
+
padding: 0;
|
|
599
|
+
margin-bottom: 2rem;
|
|
600
|
+
}
|
|
601
|
+
.cio-question-options-container-text-only {
|
|
602
|
+
flex-direction: row;
|
|
603
|
+
flex-wrap: wrap;
|
|
604
|
+
justify-content: center;
|
|
605
|
+
margin-bottom: 2rem;
|
|
606
|
+
margin-top: 0;
|
|
607
|
+
}
|
|
608
|
+
.cio-question-option-container-text-only {
|
|
609
|
+
margin: 0;
|
|
610
|
+
width: 30%;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
/* Desktop */
|
|
615
|
+
@media screen and (min-width: 1280px) {
|
|
616
|
+
/* Container */
|
|
617
|
+
.cio-container--with-image {
|
|
618
|
+
padding: 6rem 2rem;
|
|
619
|
+
}
|
|
620
|
+
.cio-cover-question-container--with-image {
|
|
621
|
+
padding: 0;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
/* Select component */
|
|
625
|
+
.cio-question-option-container-text-only {
|
|
626
|
+
width: 30%;
|
|
627
|
+
}
|
|
628
|
+
.cio-select-question-container {
|
|
629
|
+
margin-bottom: 0;
|
|
630
|
+
}
|
|
631
|
+
.cio-select-question-text {
|
|
632
|
+
padding: 2.5rem 0rem;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
/* Results component */
|
|
637
|
+
.cio-results-container {
|
|
638
|
+
margin-top: 3rem;
|
|
639
|
+
}
|
|
640
|
+
.cio-zero-results {
|
|
641
|
+
margin-top: 7rem;
|
|
642
|
+
}
|
|
643
|
+
.cio-question-content {
|
|
644
|
+
padding: 5rem;
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
/* Spinner Styles */
|
|
649
|
+
.cio-spinner {
|
|
650
|
+
display: inline-block;
|
|
651
|
+
position: relative;
|
|
652
|
+
width: 80px;
|
|
653
|
+
margin: auto;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
.cio-spinner div {
|
|
657
|
+
box-sizing: border-box;
|
|
658
|
+
display: block;
|
|
659
|
+
position: absolute;
|
|
660
|
+
top: -35px;
|
|
661
|
+
width: 64px;
|
|
662
|
+
height: 64px;
|
|
663
|
+
margin: 4px;
|
|
664
|
+
border: 4px solid var(--blue-denim-200);
|
|
665
|
+
border-radius: 50%;
|
|
666
|
+
animation: cio-spinner 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
|
|
667
|
+
border-color: var(--blue-denim-200) transparent transparent transparent;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
.cio-spinner div:nth-child(1) {
|
|
671
|
+
animation-delay: -0.45s;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
.cio-spinner div:nth-child(2) {
|
|
675
|
+
animation-delay: -0.3s;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
.cio-spinner div:nth-child(3) {
|
|
679
|
+
animation-delay: -0.15s;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
@keyframes cio-spinner {
|
|
683
|
+
0% {
|
|
684
|
+
transform: rotate(0deg);
|
|
685
|
+
}
|
|
686
|
+
100% {
|
|
687
|
+
transform: rotate(360deg);
|
|
688
|
+
}
|
|
689
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare enum QuestionTypes {
|
|
2
|
+
OpenText = "open",
|
|
3
|
+
Cover = "cover",
|
|
4
|
+
SingleSelect = "single",
|
|
5
|
+
MultipleSelect = "multiple",
|
|
6
|
+
Back = "back",
|
|
7
|
+
Reset = "reset"
|
|
8
|
+
}
|
|
9
|
+
export interface QuestionAnswer<Value> {
|
|
10
|
+
questionId: number;
|
|
11
|
+
input: Value;
|
|
12
|
+
isLastQuestion?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export type SelectQuestionPayload = QuestionAnswer<string[]>;
|
|
15
|
+
export type OpenTextQuestionPayload = QuestionAnswer<string>;
|
|
16
|
+
export type CoverQuestionPayload = {
|
|
17
|
+
isLastQuestion?: boolean;
|
|
18
|
+
};
|
|
19
|
+
interface Action<Type, Payload = {}> {
|
|
20
|
+
type: Type;
|
|
21
|
+
payload?: Payload;
|
|
22
|
+
}
|
|
23
|
+
export type ActionAnswerInputQuestion = Action<QuestionTypes.OpenText, OpenTextQuestionPayload> | Action<QuestionTypes.SingleSelect, SelectQuestionPayload> | Action<QuestionTypes.MultipleSelect, SelectQuestionPayload>;
|
|
24
|
+
export type ActionAnswerQuestion = ActionAnswerInputQuestion | Action<QuestionTypes.Cover, CoverQuestionPayload> | Action<QuestionTypes.Back> | Action<QuestionTypes.Reset>;
|
|
25
|
+
export {};
|