@financial-times/qanda-ui 0.0.1-beta.2 → 0.0.1-beta.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/README.md +38 -6
  2. package/dist/cjs/components/Author/index.js +19 -0
  3. package/dist/cjs/components/Calendar/Apps.js +48 -0
  4. package/dist/cjs/components/Calendar/CalendarList.js +12 -0
  5. package/dist/cjs/components/Calendar/CalendarListItem.js +24 -0
  6. package/dist/cjs/components/Calendar/index.js +47 -0
  7. package/dist/cjs/components/CountdownTimer/index.js +91 -0
  8. package/dist/cjs/components/EmbedFormField/index.js +24 -0
  9. package/dist/cjs/components/ErrorMessage/humanReadableError.js +74 -0
  10. package/dist/cjs/components/ErrorMessage/index.js +63 -0
  11. package/dist/cjs/components/Expander/index.js +71 -0
  12. package/dist/cjs/components/ExpertDrawer/index.js +36 -0
  13. package/dist/cjs/components/FloatingActionBar/index.js +59 -0
  14. package/dist/cjs/components/Loader/index.js +7 -0
  15. package/dist/cjs/components/MessageBox/index.js +7 -0
  16. package/dist/cjs/components/Overlay/index.js +18 -0
  17. package/dist/cjs/components/Qanda.js +37 -0
  18. package/dist/cjs/components/QandaBlock/index.js +78 -0
  19. package/dist/cjs/components/QandaContainer.js +99 -0
  20. package/dist/cjs/components/QandaProvider.js +11 -0
  21. package/dist/cjs/components/QuestionForm/index.js +165 -0
  22. package/dist/cjs/components/QuestionForm/messagesByUserType.js +33 -0
  23. package/dist/cjs/components/Stream/index.js +37 -0
  24. package/dist/cjs/components/Survey/index.js +36 -0
  25. package/dist/cjs/hooks/useIsMobile.js +15 -0
  26. package/dist/cjs/index.js +53 -0
  27. package/dist/cjs/services/comments-api.js +152 -0
  28. package/dist/cjs/services/error-middleware.js +47 -0
  29. package/dist/cjs/services/reliability.js +79 -0
  30. package/dist/cjs/store/expertSlice.js +26 -0
  31. package/dist/cjs/store/index.js +30 -0
  32. package/dist/cjs/store/questionSlice.js +32 -0
  33. package/dist/cjs/store/stream.js +17 -0
  34. package/dist/cjs/store/updateComments.js +40 -0
  35. package/dist/cjs/store/user.js +51 -0
  36. package/dist/cjs/utils/auth.js +26 -0
  37. package/dist/cjs/utils/qandas.js +20 -0
  38. package/dist/cjs/utils/strings.js +16 -0
  39. package/dist/cjs/utils/tracking.js +11 -0
  40. package/dist/cjs/utils/validate-display-name.js +22 -0
  41. package/dist/esm/components/Author/index.js +14 -0
  42. package/dist/esm/components/Calendar/Apps.js +46 -0
  43. package/dist/esm/components/Calendar/CalendarList.js +7 -0
  44. package/dist/esm/components/Calendar/CalendarListItem.js +22 -0
  45. package/dist/esm/components/Calendar/index.js +42 -0
  46. package/dist/esm/components/CountdownTimer/index.js +88 -0
  47. package/dist/esm/components/EmbedFormField/index.js +22 -0
  48. package/dist/esm/components/ErrorMessage/humanReadableError.js +71 -0
  49. package/dist/esm/components/ErrorMessage/index.js +57 -0
  50. package/dist/esm/components/Expander/index.js +69 -0
  51. package/dist/esm/components/ExpertDrawer/index.js +31 -0
  52. package/dist/esm/components/FloatingActionBar/index.js +57 -0
  53. package/dist/esm/components/Loader/index.js +4 -0
  54. package/dist/esm/components/MessageBox/index.js +5 -0
  55. package/dist/esm/components/Overlay/index.js +13 -0
  56. package/dist/esm/components/Qanda.js +32 -0
  57. package/dist/esm/components/QandaBlock/index.js +73 -0
  58. package/dist/esm/components/QandaContainer.js +94 -0
  59. package/dist/esm/components/QandaProvider.js +8 -0
  60. package/dist/esm/components/QuestionForm/index.js +159 -0
  61. package/dist/esm/components/QuestionForm/messagesByUserType.js +28 -0
  62. package/dist/esm/components/Stream/index.js +32 -0
  63. package/dist/esm/components/Survey/index.js +34 -0
  64. package/dist/esm/hooks/useIsMobile.js +12 -0
  65. package/dist/esm/index.js +46 -0
  66. package/dist/esm/services/comments-api.js +147 -0
  67. package/dist/esm/services/error-middleware.js +43 -0
  68. package/dist/esm/services/reliability.js +75 -0
  69. package/dist/esm/store/expertSlice.js +22 -0
  70. package/dist/esm/store/index.js +24 -0
  71. package/dist/esm/store/questionSlice.js +28 -0
  72. package/dist/esm/store/stream.js +14 -0
  73. package/dist/esm/store/updateComments.js +36 -0
  74. package/dist/esm/store/user.js +45 -0
  75. package/dist/esm/utils/auth.js +24 -0
  76. package/dist/esm/utils/qandas.js +16 -0
  77. package/dist/esm/utils/strings.js +13 -0
  78. package/dist/esm/utils/tracking.js +7 -0
  79. package/dist/esm/utils/validate-display-name.js +19 -0
  80. package/dist/qanda.scss +802 -0
  81. package/dist/types/components/Author/index.d.ts +18 -0
  82. package/dist/types/components/Calendar/Apps.d.ts +14 -0
  83. package/dist/types/components/Calendar/CalendarList.d.ts +2 -0
  84. package/dist/types/components/Calendar/CalendarListItem.d.ts +8 -0
  85. package/dist/types/components/Calendar/index.d.ts +2 -0
  86. package/dist/types/components/CountdownTimer/index.d.ts +6 -0
  87. package/dist/types/components/EmbedFormField/index.d.ts +5 -0
  88. package/dist/types/components/ErrorMessage/humanReadableError.d.ts +29 -0
  89. package/dist/types/components/ErrorMessage/index.d.ts +8 -0
  90. package/dist/types/components/Expander/index.d.ts +8 -0
  91. package/dist/types/components/ExpertDrawer/index.d.ts +2 -0
  92. package/dist/types/components/FloatingActionBar/index.d.ts +4 -0
  93. package/dist/types/components/Loader/index.d.ts +14 -0
  94. package/dist/types/components/MessageBox/index.d.ts +10 -0
  95. package/dist/types/components/Overlay/index.d.ts +12 -0
  96. package/dist/types/components/Qanda.d.ts +3 -0
  97. package/dist/types/components/QandaBlock/index.d.ts +7 -0
  98. package/dist/types/components/QandaContainer.d.ts +6 -0
  99. package/dist/types/components/QandaProvider.d.ts +9 -0
  100. package/dist/types/components/QuestionForm/index.d.ts +1 -0
  101. package/dist/types/components/QuestionForm/messagesByUserType.d.ts +7 -0
  102. package/dist/types/components/Stream/index.d.ts +5 -0
  103. package/dist/types/components/Survey/index.d.ts +6 -0
  104. package/dist/types/hooks/useIsMobile.d.ts +1 -0
  105. package/dist/types/index.d.ts +17 -0
  106. package/dist/types/services/comments-api.d.ts +52 -0
  107. package/dist/types/services/error-middleware.d.ts +2 -0
  108. package/dist/types/services/reliability.d.ts +19 -0
  109. package/dist/types/store/expertSlice.d.ts +14 -0
  110. package/dist/types/store/index.d.ts +218 -0
  111. package/dist/types/store/questionSlice.d.ts +16 -0
  112. package/dist/types/store/stream.d.ts +7 -0
  113. package/dist/types/store/updateComments.d.ts +3 -0
  114. package/dist/types/store/user.d.ts +26 -0
  115. package/dist/types/utils/auth.d.ts +6 -0
  116. package/dist/types/utils/qandas.d.ts +2 -0
  117. package/dist/types/utils/strings.d.ts +1 -0
  118. package/dist/types/utils/tracking.d.ts +2 -0
  119. package/dist/types/utils/validate-display-name.d.ts +1 -0
  120. package/package.json +35 -29
  121. package/dist/index.html +0 -19
  122. package/dist/index.js +0 -2
  123. package/dist/index.js.LICENSE.txt +0 -15
@@ -0,0 +1,802 @@
1
+ $system-code: 'qanda';
2
+ $app-bg-color: #fff2e8;
3
+ $app-text-color: #333;
4
+ $app-header-color: #007acc;
5
+ @import '@financial-times/o-colors/main';
6
+ @import '@financial-times/o-forms/main';
7
+ @import '@financial-times/o-icons/main';
8
+ @import '@financial-times/o-labels/main';
9
+ @import '@financial-times/o-message/main';
10
+ @import '@financial-times/o3-foundation/css/core.css';
11
+ /* Inlined from ../components/Author/styles.css */
12
+ .qanda-container {
13
+ .qanda-block__answer__author {
14
+ display: flex;
15
+ gap: var(--o3-spacing-4xs);
16
+ }
17
+
18
+ .qanda-block__answer__author-headshot {
19
+ height: 44px;
20
+ width: 44px;
21
+ background-color: var(--o3-color-palette-wheat);
22
+ border-radius: 50%;
23
+ }
24
+
25
+ .qanda-block__answer__author-info {
26
+ display: flex;
27
+ flex-direction: column;
28
+ }
29
+
30
+ .qanda-block__answer__author-name a {
31
+ color: var(--o3-color-use-case-body-text);
32
+ text-decoration: none;
33
+ }
34
+ }
35
+
36
+ /* Inlined from ../components/Calendar/styles.css */
37
+ @import '@financial-times/o3-button/css/core.css';
38
+
39
+ .qanda-container {
40
+ .live-qa-calendar-container {
41
+ width: 100%;
42
+ }
43
+
44
+ .live-qa-calendar-button {
45
+ width: 100%;
46
+ }
47
+
48
+ .live-qa-calendar-button.dropdown-visible {
49
+ color: var(--o3-color-palette-white-80, #fffcfa);
50
+ background-color: var(
51
+ --o3-button-secondary-mono-active-background,
52
+ #262a33
53
+ );
54
+ }
55
+
56
+ .live-qa-calendar-list {
57
+ display: flex;
58
+ margin-top: 0;
59
+ flex-direction: column;
60
+ align-items: flex-start;
61
+ gap: 8px;
62
+ border-radius: 0 0 2px 2px;
63
+ background: var(--o3-color-palette-white-80, #fffcfa);
64
+ list-style-type: none;
65
+ padding: 0 0 8px 0;
66
+ }
67
+
68
+ .live-qa-calendar-list__item {
69
+ width: 100%;
70
+ }
71
+
72
+ .live-qa-calendar-list__item__link {
73
+ padding: 0 var(--o3-spacing-4xs, 8px);
74
+ display: flex;
75
+ height: 44px;
76
+ width: 100%;
77
+ align-items: center;
78
+ gap: var(--o3-spacing-4xs, 8px);
79
+ align-self: stretch;
80
+ text-decoration: none;
81
+ color: var(--Primary-FT-Grey, #333);
82
+ font-family: var(--o3-type-body-base-font-family);
83
+ font-weight: var(--o3-type-body-base-font-weight);
84
+ font-size: var(--o3-type-body-base-font-size);
85
+ line-height: var(--o3-type-body-base-line-height);
86
+ }
87
+
88
+ .live-qa-calendar-list__item:hover {
89
+ background: var(--o3-color-use-case-link-inverse-text-hover, #d4d4d6);
90
+ }
91
+
92
+ .live-qa-calendar-list__item:active {
93
+ background: #727071;
94
+ a {
95
+ color: var(--o3-color-palette-white, #fff);
96
+ }
97
+ .live-qa-calendar-icon {
98
+ filter: invert(1);
99
+ }
100
+ }
101
+
102
+ .live-qa-calendar-list__item:focus {
103
+ background: #c9cacc;
104
+ box-shadow:
105
+ 0 0 0 4px #4d4845,
106
+ 0 0 0 8px var(--o3-color-palette-white, #fff);
107
+ }
108
+
109
+ .live-qa-calendar-list__item__icon {
110
+ padding: 0 var(--o3-spacing-4xs, 8px);
111
+ width: 24px;
112
+ height: 24px;
113
+ aspect-ratio: 1/1;
114
+ }
115
+
116
+ .live-qa-calendar-list__item__text {
117
+ text-align: center;
118
+ font-family: 'Metric 2 VF';
119
+ font-size: 16px;
120
+ font-style: normal;
121
+ font-weight: 400;
122
+ line-height: 24px;
123
+ }
124
+ }
125
+
126
+ /* Inlined from ../components/CountdownTimer/styles.css */
127
+ @import '@financial-times/o3-foundation/css/core.css';
128
+
129
+ .qanda-portal.countdown-wrapper {
130
+ display: flex;
131
+ justify-content: center;
132
+ align-items: baseline;
133
+ width: 100%;
134
+
135
+ .countdown-block {
136
+ display: flex;
137
+ align-items: center;
138
+ white-space: nowrap;
139
+ width: 100%;
140
+ padding: var(--o3-spacing-s) 0;
141
+ &::before,
142
+ &::after {
143
+ content: '';
144
+ flex-grow: 1;
145
+ height: 1px;
146
+ background-color: var(--o3-color-palette-black-20, #ccc1b7);
147
+ }
148
+ &::before {
149
+ margin-right: 8px;
150
+ }
151
+ &::after {
152
+ margin-left: 8px;
153
+ }
154
+ }
155
+
156
+ .countdown {
157
+ margin: 0;
158
+ }
159
+ }
160
+
161
+ /* Inlined from ../components/FloatingActionBar/styles.css */
162
+ :root {
163
+ --floating-action-bar__live-icon-size: 10px;
164
+ }
165
+
166
+ .qanda-container {
167
+ .floating-action-bar__container {
168
+ position: fixed;
169
+ bottom: 0;
170
+ left: 0;
171
+ right: 0;
172
+ display: flex;
173
+ /* Ensure FAB is on top of ...
174
+ 1. some dinamically loaded teasers at the bottom of the article
175
+ 2. the sharing bar on mobile
176
+ */
177
+ z-index: 7;
178
+ }
179
+
180
+ .floating-action-bar__fade-overlay {
181
+ position: fixed;
182
+ top: 0;
183
+ bottom: 0;
184
+ left: 0;
185
+ right: 0;
186
+ background: linear-gradient(
187
+ 0deg,
188
+ var(--o3-color-palette-paper) 0%,
189
+ rgba(255, 241, 229, 0.5) 12%,
190
+ rgba(255, 241, 229, 0) 20%
191
+ );
192
+ pointer-events: none;
193
+ z-index: 5;
194
+ }
195
+
196
+ .floating-action-bar {
197
+ position: relative;
198
+ height: 48px;
199
+ background: var(--o3-color-palette-white-60);
200
+ border-radius: 100px;
201
+ margin: auto;
202
+ margin-bottom: var(--o3-spacing-s);
203
+ padding: 0 var(--o3-spacing-2xs);
204
+ display: flex;
205
+ align-items: center;
206
+ gap: var(--o3-spacing-2xs);
207
+ box-shadow:
208
+ 0px 1px 4px 0px rgba(0, 0, 0, 0.2),
209
+ 0px 6px 10px 0px rgba(0, 0, 0, 0.15);
210
+ z-index: 6;
211
+ }
212
+
213
+ .floating-action-bar__live-container {
214
+ background-color: var(--o3-color-palette-crimson);
215
+ padding: var(--o3-spacing-5xs) var(--o3-spacing-4xs);
216
+ color: var(--o3-color-palette-white);
217
+ border-radius: 2px;
218
+ }
219
+
220
+ .floating-action-bar__live-label::before {
221
+ margin-right: var(--o3-spacing-4xs);
222
+ }
223
+
224
+ .floating-action-bar__live-icon {
225
+ display: inline-block;
226
+ width: var(--floating-action-bar__live-icon-size);
227
+ height: var(--floating-action-bar__live-icon-size);
228
+ background-color: var(--o3-color-palette-white);
229
+ mask-repeat: no-repeat;
230
+ mask-size: contain;
231
+ margin-right: var(--o3-spacing-5xs);
232
+ animation: _o-labels-live-pulse 1.2s ease-in-out infinite;
233
+ }
234
+
235
+ .floating-action-bar__buttons {
236
+ display: flex;
237
+ gap: var(--o3-spacing-4xs);
238
+ }
239
+
240
+ .floating-action-bar__buttons button {
241
+ padding: var(--o3-spacing-4xs);
242
+ }
243
+
244
+ .floating-action-bar__updates-counter {
245
+ position: absolute;
246
+ top: 0;
247
+ right: 0;
248
+ margin-top: calc(var(--o3-spacing-3xs) * -1);
249
+ margin-right: var(--o3-spacing-3xs);
250
+ background-color: var(--o3-color-palette-claret);
251
+ color: var(--o3-color-palette-white);
252
+ border-radius: 100px;
253
+ padding: 2px var(--o3-spacing-5xs);
254
+ min-width: var(--o3-spacing-2xs);
255
+ }
256
+
257
+ /* ToDo: using an SVG for this icon until it becomes part of Origami */
258
+ .o3-button-icon.o3-button-icon--edit::before {
259
+ mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'><path fill-rule='evenodd' clip-rule='evenodd' d='M2 4.5625C2 4.25184 2.25184 4 2.5625 4H9.4375C9.74816 4 10 4.25184 10 4.5625V5.5C10 5.81066 9.74816 6 9.4375 6H4V20H18V14.5C18 14.1893 18.1893 13.9375 18.5 13.9375H19.4375C19.7482 13.9375 20 14.1893 20 14.5V21.4375C20 21.7482 19.7482 22 19.4375 22H2.5625C2.25184 22 2 21.7482 2 21.4375V4.5625Z' fill='black'/><path fill-rule='evenodd' clip-rule='evenodd' d='M7.00001 11.5C7.01639 11.4328 7.04922 11.3714 7.09513 11.3224L15.7827 2.97148C15.9253 2.819 16.1564 2.81946 16.2984 2.97252L21.0856 7.72154C21.2271 7.87405 21.2268 8.12048 21.0848 8.27254L12.4879 16.8694C12.4421 16.9185 12.385 16.9535 12.3223 16.9711L6.75835 17.6629C6.48908 17.7381 6.24367 17.4752 6.31392 17.1868L7.00001 11.5ZM11.3344 15.1016C11.397 15.0841 11.4542 15.0491 11.5 15L18.5 8L16 5.49997L8.75109 12.4947C8.70519 12.5438 8.67236 12.6051 8.65598 12.6724L8.50025 15.5L11.3344 15.1016Z' fill='black'/></svg>");
260
+ }
261
+ }
262
+
263
+ /* Inlined from ../components/EmbedFormField/styles.css */
264
+ :root {
265
+ --embed-form-field__icon-size: 24px;
266
+ }
267
+
268
+ .qanda-portal.embed-form-field__container {
269
+ max-width: 300px;
270
+ display: flex;
271
+ flex-direction: column;
272
+ gap: var(--o3-spacing-4xs);
273
+ margin: var(--o3-spacing-s) auto;
274
+ text-align: left;
275
+
276
+ .embed-form-field__text-input {
277
+ display: flex;
278
+ padding: var(--o3-spacing-4xs);
279
+ align-items: center;
280
+ gap: var(--o3-spacing-4xs);
281
+ border-radius: 2px;
282
+ border: 1.5px solid var(--o3-color-palette-black-50);
283
+ background-color: var(--o3-color-palette-white);
284
+ color: var(--o3-color-use-case-muted-text);
285
+ cursor: pointer;
286
+ }
287
+
288
+ .embed-form-field__icon {
289
+ background-color: var(--o3-color-palette-wheat);
290
+ border-radius: 50%;
291
+ padding: 10px;
292
+ }
293
+
294
+ .embed-form-field__icon i {
295
+ display: block;
296
+ height: var(--embed-form-field__icon-size);
297
+ width: var(--embed-form-field__icon-size);
298
+ background-color: var(--o3-color-palette-black-60);
299
+ }
300
+ }
301
+
302
+ /* Inlined from ../components/Expander/styles.css */
303
+ @import '@financial-times/o3-foundation/css/core.css';
304
+
305
+ .expander__link {
306
+ /* Override some o-button styles */
307
+ padding: 0px var(--o3-spacing-5xs, 4px) !important;
308
+ color: var(--o3-color-, #33302e);
309
+ float: right;
310
+ margin-top: var(--o3-spacing-2xs);
311
+ }
312
+
313
+ /* Inlined from ../components/Loader/styles.scss */
314
+ @import '@financial-times/o-loading/main';
315
+
316
+ @include oLoading(
317
+ $opts: (
318
+ 'themes': (
319
+ 'light',
320
+ 'dark',
321
+ ),
322
+ 'sizes': (
323
+ 'mini',
324
+ 'small',
325
+ 'medium',
326
+ 'large',
327
+ ),
328
+ )
329
+ );
330
+
331
+ /* Inlined from ../components/Overlay/styles.css */
332
+ @import '@financial-times/o3-button/css/core.css';
333
+
334
+ :root {
335
+ --overlay__header-icon-size: 48px;
336
+ }
337
+
338
+ @keyframes slideUp {
339
+ from {
340
+ transform: translateY(100%);
341
+ }
342
+
343
+ to {
344
+ transform: translateY(44px);
345
+ }
346
+ }
347
+
348
+ @keyframes slideIn {
349
+ from {
350
+ transform: translateX(100%);
351
+ }
352
+
353
+ to {
354
+ transform: translateX(0);
355
+ }
356
+ }
357
+
358
+ @keyframes fadeIn {
359
+ from {
360
+ opacity: 0;
361
+ }
362
+
363
+ to {
364
+ opacity: 0.4;
365
+ }
366
+ }
367
+
368
+ .qanda-container {
369
+ .overlay {
370
+ position: fixed;
371
+ top: 0;
372
+ left: 0;
373
+ /* Just going on top of the main navigation */
374
+ z-index: 100;
375
+ visibility: visible;
376
+ }
377
+
378
+ .overlay__outer {
379
+ position: fixed;
380
+ top: 0;
381
+ left: 0;
382
+ right: 0;
383
+ bottom: 0;
384
+ z-index: 19;
385
+ animation: fadeIn 1s ease forwards;
386
+ background: var(--o3-color-palette-black-90);
387
+ }
388
+
389
+ .overlay__outer--no-background {
390
+ background: none;
391
+ }
392
+
393
+ .overlay__inner {
394
+ border-radius: var(--o3-spacing-2xs) var(--o3-spacing-2xs) 0 0;
395
+ background: var(--o3-color-use-case-page-background);
396
+ position: fixed;
397
+ height: 100%;
398
+ width: 100%;
399
+ z-index: 20;
400
+ animation: slideUp 1s ease forwards;
401
+
402
+ @media (min-width: 740px) {
403
+ width: 375px;
404
+ right: 0;
405
+ top: 0;
406
+ border-radius: 0;
407
+ animation: slideIn 1s ease forwards;
408
+ }
409
+ }
410
+
411
+ .overlay__inner--shadow {
412
+ @media (min-width: 740px) {
413
+ width: 420px;
414
+ box-shadow:
415
+ -4px 6px 10px 0 rgba(0, 0, 0, 0.15),
416
+ -4px 4px 4px 0 rgba(0, 0, 0, 0.25);
417
+ }
418
+ }
419
+
420
+ .overlay__header {
421
+ border-bottom: 1px solid var(--o3-color-palette-black-10);
422
+ display: flex;
423
+ flex-direction: column;
424
+ align-items: flex-start;
425
+ align-self: stretch;
426
+ padding: 0 var(--o3-spacing-2xs);
427
+ }
428
+
429
+ .overlay__header-bar {
430
+ display: flex;
431
+ width: 100%;
432
+ }
433
+
434
+ .overlay__header:before {
435
+ @media (max-width: 740px) {
436
+ content: '';
437
+ width: var(--o3-spacing-m);
438
+ height: var(--o3-spacing-5xs);
439
+ border-radius: var(--o3-spacing-4xl);
440
+ background: var(--o3-color-palette-black-50);
441
+ margin: auto;
442
+ margin-top: var(--o3-spacing-3xs);
443
+ }
444
+ }
445
+
446
+ .overlay__header-title {
447
+ flex-grow: 1;
448
+ align-content: center;
449
+ text-align: left;
450
+ }
451
+
452
+ .overlay__header-close {
453
+ width: var(--overlay__header-icon-size);
454
+ height: var(--overlay__header-icon-size);
455
+ }
456
+
457
+ .overlay__content {
458
+ padding: var(--o3-spacing-2xs);
459
+ display: flex;
460
+ flex-direction: column;
461
+ align-items: flex-start;
462
+ align-self: stretch;
463
+ gap: var(--o3-spacing-2xs);
464
+ overflow-y: auto;
465
+ height: calc(100% - 140px);
466
+
467
+ @media (min-width: 740px) {
468
+ height: calc(100% - 80px);
469
+ }
470
+ }
471
+
472
+ .overlay__content-box {
473
+ width: 100%;
474
+ padding: var(--o3-spacing-2xs);
475
+ box-sizing: border-box;
476
+ text-align: left;
477
+ }
478
+
479
+ .overlay__form-box {
480
+ border: 1px solid var(--o3-color-palette-black-10);
481
+ background: var(--o3-color-palette-white-40);
482
+ }
483
+
484
+ .overlay__submit-button {
485
+ width: 100%;
486
+ margin: var(--o3-spacing-s) 0 var(--o3-spacing-4xs) 0;
487
+ }
488
+
489
+ .overlay__user-container-display-name {
490
+ display: flex;
491
+ gap: var(--o3-spacing-3xs);
492
+ margin-bottom: var(--o3-spacing-s);
493
+ }
494
+
495
+ .overlay__message-icon {
496
+ display: inline-block;
497
+ width: 24px;
498
+ height: 24px;
499
+ background-color: currentColor;
500
+ mask-repeat: no-repeat;
501
+ mask-size: contain;
502
+ }
503
+ }
504
+
505
+ /* Inlined from ../components/QandaBlock/styles.css */
506
+ @import '@financial-times/o3-foundation/css/core.css';
507
+
508
+ :root {
509
+ --speech-triangle-width: 24px;
510
+ --speech-triangle-height: 17px;
511
+ }
512
+
513
+ .qanda-container {
514
+ .qanda-block {
515
+ display: flex;
516
+ flex-direction: column;
517
+ gap: var(--o3-spacing-xl);
518
+ }
519
+
520
+ .qanda-block__comment {
521
+ padding: var(--o3-spacing-s) var(--o3-spacing-2xs);
522
+ position: relative;
523
+ filter: drop-shadow(0 1px 2px var(--o3-color-palette-black-20, #ccc1b7));
524
+ will-change: filter;
525
+ }
526
+
527
+ .qanda-block__question {
528
+ background: var(--o3-color-palette-wheat);
529
+ margin-right: var(--o3-spacing-2xs);
530
+ }
531
+
532
+ .qanda-block__answer {
533
+ background: var(--o3-color-palette-white-80);
534
+ margin-left: var(--o3-spacing-2xs);
535
+ }
536
+
537
+ .qanda-block__question::after {
538
+ content: '';
539
+ position: absolute;
540
+ bottom: calc(var(--speech-triangle-height) * -1 + 1px);
541
+ right: 0;
542
+ border-left: var(--speech-triangle-width) solid transparent;
543
+ border-top: var(--speech-triangle-height) solid
544
+ var(--o3-color-palette-wheat);
545
+ }
546
+
547
+ .qanda-block__answer::before {
548
+ content: '';
549
+ position: absolute;
550
+ top: calc(var(--speech-triangle-height) * -1 + 1px);
551
+ left: 0;
552
+ border-right: var(--speech-triangle-width) solid transparent;
553
+ border-bottom: var(--speech-triangle-height) solid
554
+ var(--o3-color-palette-white-80);
555
+ }
556
+
557
+ .qanda-block__question-subtitle {
558
+ margin-bottom: var(--o3-spacing-4xs);
559
+ }
560
+
561
+ .qanda-block__answer-header {
562
+ display: flex;
563
+ }
564
+
565
+ .qanda-block__comment-byline {
566
+ flex-grow: 1;
567
+ }
568
+
569
+ .qanda-block__comment-byline p {
570
+ margin: 0;
571
+ font-size: var(--o3-type-body-highlight-font-size);
572
+ }
573
+
574
+ .qanda-block__comment-text {
575
+ margin-top: var(--o3-spacing-s);
576
+ }
577
+
578
+ .qanda-block__comment-text p {
579
+ margin: 0;
580
+ font-size: var(--o3-type-body-base-font-size);
581
+ }
582
+
583
+ .qanda-block__text {
584
+ /* Ellipses for question and answer based on container size */
585
+ container-type: inline-size;
586
+
587
+ &.expander--collapsed p:not(:first-of-type) {
588
+ display: none;
589
+ }
590
+ }
591
+
592
+ /* Mobile will show 3 lines of text before ellipse */
593
+ @container (max-width: 490px) {
594
+ .qanda-block__text.expander--collapsed
595
+ .expander__text--multiline
596
+ > p:first-of-type {
597
+ display: block;
598
+ display: -webkit-box;
599
+ /* Note: This need to stay aligned with the JS for the expander */
600
+ line-clamp: 3;
601
+ -webkit-line-clamp: 3;
602
+ -webkit-box-orient: vertical;
603
+ overflow: hidden;
604
+ text-overflow: ellipsis;
605
+ /* Without this the letter like `g` may be visually cut.
606
+ To be tested with final font */
607
+ padding-bottom: 1px;
608
+ }
609
+ }
610
+
611
+ /* Above mobile it will show 1 line of text before ellipse */
612
+ @container (min-width: 491px) {
613
+ .qanda-block__text.expander--collapsed
614
+ .expander__text--multiline
615
+ > p:first-of-type {
616
+ white-space: nowrap;
617
+ text-overflow: ellipsis;
618
+ overflow: hidden;
619
+ }
620
+ }
621
+ }
622
+
623
+ /* Inlined from ../components/QuestionForm/style.scss */
624
+ .qanda-container {
625
+ .question-form__displayname-input {
626
+ gap: var(--o3-spacing-3xs, 12px);
627
+
628
+ .question-form__displayname__title {
629
+ font-size: var(--o3-type-body-highlight-font-size, 16px);
630
+ font-weight: 700px;
631
+ }
632
+
633
+ /* this is a temp hack as this styling is consistent with o3-form but is not in o-forms */
634
+ .question-form__displayname__input {
635
+ margin-top: 0;
636
+
637
+ .question-form__displayname__input__field {
638
+ padding: var(--o3-spacing-3xs, 12px) var(--o3-spacing-2xs, 16px);
639
+ }
640
+
641
+ &.o-forms-input--invalid {
642
+ .question-form__displayname__input__field {
643
+ color: var(--o3-color-use-case-body-text, #33302e);
644
+ border-radius: 2px;
645
+ border: 1.5px solid var(--o3-color-use-case-error, #c00);
646
+ background: var(
647
+ --o3-color-use-case-error-background,
648
+ rgba(204, 0, 0, 0.06)
649
+ );
650
+ }
651
+ }
652
+ }
653
+
654
+ .question-form__displayname__input__error {
655
+ padding-top: var(--o3-spacing-3xs, 12px);
656
+ margin-top: 0;
657
+ display: flex;
658
+ align-items: flex-start;
659
+ gap: 4px;
660
+ align-self: stretch;
661
+ color: var(--o3-color-use-case-error, #c00);
662
+ }
663
+ }
664
+
665
+ .question-form__question__input {
666
+ margin-bottom: var(--o3-spacing-4xs, 8px);
667
+ }
668
+ }
669
+
670
+ /* Inlined from ../components/Stream/styles.css */
671
+ @import '@financial-times/o3-foundation/css/core.css';
672
+
673
+ .qanda-container {
674
+ .qanda__stream {
675
+ margin-top: var(--o3-spacing-l);
676
+ }
677
+
678
+ .qanda__stream-title {
679
+ margin: 0 0 var(--o3-spacing-s);
680
+ }
681
+
682
+ .qanda__stream-loader {
683
+ align-self: center;
684
+ }
685
+
686
+ .qanda__blocks-container {
687
+ max-width: 1220px;
688
+ margin: auto;
689
+ display: flex;
690
+ flex-direction: column;
691
+ gap: var(--o3-spacing-l);
692
+ margin-bottom: var(--o3-spacing-l);
693
+ }
694
+ }
695
+
696
+ /* Inlined from ../components/MessageBox/styles.css */
697
+ @import '@financial-times/o3-button/css/core.css';
698
+
699
+ .qanda-container {
700
+ .message-box__container {
701
+ width: 100%;
702
+ text-align: left;
703
+ }
704
+
705
+ .message-box__content {
706
+ display: flex;
707
+ flex-direction: column;
708
+ gap: var(--o3-spacing-4xs);
709
+ }
710
+
711
+ .message-box__content-link {
712
+ color: var(--o3-color-use-case-body-text);
713
+ text-decoration-color: var(--o3-color-use-case-body-text);
714
+ }
715
+ }
716
+
717
+
718
+ @include oForms(
719
+ $opts: (
720
+ 'elements': (
721
+ 'text',
722
+ 'checkbox',
723
+ 'textarea',
724
+ ),
725
+ 'features': (
726
+ 'disabled',
727
+ 'inline',
728
+ ),
729
+ )
730
+ );
731
+
732
+ @include oLabels(
733
+ $opts: (
734
+ 'indicators': (
735
+ 'status': (
736
+ 'live',
737
+ ),
738
+ ),
739
+ )
740
+ );
741
+
742
+ @include oMessage(
743
+ $opts: (
744
+ 'types': (
745
+ 'alert',
746
+ 'notice',
747
+ ),
748
+ 'states': (
749
+ 'error',
750
+ 'inform',
751
+ 'success',
752
+ ),
753
+ )
754
+ );
755
+
756
+ @include oMessageAddState(
757
+ $name: 'survey',
758
+ $opts: (
759
+ 'background-color': 'o3-color-palette-black-5',
760
+ 'foreground-color': 'o3-color-palette-slate',
761
+ 'text-align': 'left',
762
+ ),
763
+ $types: (
764
+ 'action',
765
+ )
766
+ );
767
+
768
+ .qanda-container {
769
+ body {
770
+ margin: 0;
771
+ font-family: Georgia, serif;
772
+ background-color: $app-bg-color;
773
+ color: $app-text-color;
774
+ text-align: left;
775
+ }
776
+
777
+ .qanda-block {
778
+ font-family: Georgia, serif;
779
+ text-align: left;
780
+ }
781
+
782
+ h1 {
783
+ color: $app-header-color;
784
+ font-size: 2.5rem;
785
+ }
786
+
787
+ p {
788
+ font-size: 1.2rem;
789
+ margin-top: 10px;
790
+ }
791
+
792
+ .qanda-block__answer__author-opinion-icon {
793
+ @include oIconsContent(
794
+ $icon-name: 'speech-left',
795
+ $color: oColorsByName('oxford'),
796
+ $size: 44
797
+ );
798
+
799
+ background-color: var(--o3-color-palette-wheat);
800
+ border-radius: 50%;
801
+ }
802
+ }