@pocketprep/ui-kit 3.5.0 → 3.5.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.
Files changed (85) hide show
  1. package/README.md +2 -2
  2. package/dist/@pocketprep/ui-kit.css +1 -0
  3. package/dist/@pocketprep/ui-kit.js +14256 -14792
  4. package/dist/@pocketprep/ui-kit.js.map +1 -1
  5. package/dist/@pocketprep/ui-kit.umd.cjs +11 -11
  6. package/dist/@pocketprep/ui-kit.umd.cjs.map +1 -1
  7. package/eslint.config.ts +111 -0
  8. package/lib/components/Banners/Banner.vue +2 -2
  9. package/lib/components/Bundles/BundleList.vue +1 -1
  10. package/lib/components/Bundles/BundleSearch.vue +2 -1
  11. package/lib/components/Bundles/PremiumPill.vue +2 -2
  12. package/lib/components/Buttons/Button.vue +19 -18
  13. package/lib/components/Buttons/Link.vue +9 -8
  14. package/lib/components/Buttons/Tab.vue +4 -3
  15. package/lib/components/Calendar/Calendar.vue +14 -2
  16. package/lib/components/Charts/Bar.vue +3 -3
  17. package/lib/components/Charts/Pie.vue +4 -4
  18. package/lib/components/Controls/SegmentControl.vue +8 -7
  19. package/lib/components/Controls/Slider.vue +2 -3
  20. package/lib/components/Controls/ToggleSwitch.vue +3 -2
  21. package/lib/components/EmptyStates/EmptyState.vue +3 -2
  22. package/lib/components/Exams/ExamCard.vue +3 -3
  23. package/lib/components/Exams/ExamMenuCard.vue +2 -2
  24. package/lib/components/Filters/FilterDropdown.vue +2 -2
  25. package/lib/components/Filters/FilterOptions.vue +2 -2
  26. package/lib/components/Forms/Checkbox.vue +2 -2
  27. package/lib/components/Forms/CheckboxOption.vue +2 -2
  28. package/lib/components/Forms/Errors.vue +2 -2
  29. package/lib/components/Forms/Input.vue +2 -2
  30. package/lib/components/Forms/Radio.vue +37 -39
  31. package/lib/components/Forms/RadioButton.vue +1 -1
  32. package/lib/components/Forms/Select.vue +7 -6
  33. package/lib/components/Forms/Textarea.vue +2 -2
  34. package/lib/components/Icons/Icon.vue +1 -0
  35. package/lib/components/Icons/IconEdit.vue +4 -2
  36. package/lib/components/Icons/IconFullViewActive.vue +1 -1
  37. package/lib/components/Icons/IconLoading2.vue +1 -3
  38. package/lib/components/Loaders/SkeletonLoader.vue +2 -2
  39. package/lib/components/Messaging/InfoMessage.vue +2 -2
  40. package/lib/components/Modal/Modal.vue +2 -2
  41. package/lib/components/Modal/ModalContainer.vue +2 -2
  42. package/lib/components/Onboarding/EmailAuth.vue +5 -5
  43. package/lib/components/Onboarding/MagicCodeEntry.vue +3 -4
  44. package/lib/components/Pagination/QuestionReviewPagination.vue +4 -4
  45. package/lib/components/Pagination/TablePagination.vue +2 -2
  46. package/lib/components/Quiz/FlagToggle.vue +2 -2
  47. package/lib/components/Quiz/GlobalMetricsToggle.vue +3 -2
  48. package/lib/components/Quiz/KeyboardShortcutsButton.vue +1 -1
  49. package/lib/components/Quiz/KeyboardShortcutsModal.vue +1 -1
  50. package/lib/components/Quiz/Question/ChoicesContainer.vue +4 -3
  51. package/lib/components/Quiz/Question/DropdownExplanation.vue +2 -2
  52. package/lib/components/Quiz/Question/Explanation.vue +2 -2
  53. package/lib/components/Quiz/Question/MatrixChoicesContainer.vue +12 -17
  54. package/lib/components/Quiz/Question/MatrixRadioGroup.vue +2 -2
  55. package/lib/components/Quiz/Question/MobileMatrixChoicesContainer.vue +19 -26
  56. package/lib/components/Quiz/Question/MobileMatrixRadioGroup.vue +7 -5
  57. package/lib/components/Quiz/Question/PassageAndImage.vue +2 -2
  58. package/lib/components/Quiz/Question/PassageAndImageDropdown.vue +7 -6
  59. package/lib/components/Quiz/Question/Paywall.vue +2 -2
  60. package/lib/components/Quiz/Question/QuestionContext.vue +2 -3
  61. package/lib/components/Quiz/Question/StatsSummary.vue +2 -2
  62. package/lib/components/Quiz/Question/Summary.vue +2 -2
  63. package/lib/components/Quiz/Question.vue +29 -28
  64. package/lib/components/Quiz/QuizContainer.vue +31 -37
  65. package/lib/components/Quiz/QuizProgress.vue +73 -77
  66. package/lib/components/Quiz/QuizProgressBar.vue +3 -2
  67. package/lib/components/Search/Pill.vue +2 -2
  68. package/lib/components/Search/Search.vue +2 -2
  69. package/lib/components/SidePanels/SidePanel.vue +8 -3
  70. package/lib/components/Tables/Table.vue +4 -3
  71. package/lib/components/Tables/TableActions.vue +3 -3
  72. package/lib/components/Tags/Tag.vue +2 -2
  73. package/lib/components/Toasts/Toast.vue +5 -3
  74. package/lib/components/Tooltips/OverflowTooltip.vue +2 -2
  75. package/lib/components/Tooltips/Tooltip.vue +2 -2
  76. package/lib/directives.ts +1 -1
  77. package/lib/pocketprep-export.module.scss +3 -2
  78. package/lib/pocketprep.scss +2 -2
  79. package/lib/styles/_breakpoints.scss +6 -12
  80. package/lib/styles/_colors.scss +0 -1
  81. package/package.json +36 -27
  82. package/stylelint.config.js +38 -0
  83. package/.eslintrc.cjs +0 -74
  84. package/dist/style.css +0 -1
  85. package/stylelint.config.cjs +0 -22
@@ -169,7 +169,6 @@ const emit = defineEmits<{
169
169
 
170
170
  const {
171
171
  // questionEl is used by the breakpoint directive
172
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
173
172
  questionEl,
174
173
  question,
175
174
  isMatrixQuestionCorrect,
@@ -298,7 +297,7 @@ const correctlySelectedChoice = (rowIndex: number, columnIndex: number) => {
298
297
  const incorrectlySelectedChoice = (rowIndex: number, columnIndex: number) => {
299
298
  if (selectedMatrixChoices.value && matrixAnswerKeys.value) {
300
299
  const selectedChoice = selectedChoiceKey(rowIndex, columnIndex)
301
- if (selectedChoice && selectedChoice.startsWith('d')) {
300
+ if (selectedChoice?.startsWith('d')) {
302
301
  return true
303
302
  }
304
303
  }
@@ -312,11 +311,11 @@ const correctAnswerButNotSelected = (rowIndex: number, columnIndex: number) => {
312
311
  }
313
312
 
314
313
  const checkboxContainerStyling = (rowIndex: number, columnIndex: number) => {
315
- const isReviewMode = showMatrixAnswers.value || reviewMode
314
+ const isReviewMode = showMatrixAnswers.value || reviewMode.value
316
315
 
317
316
  // check box is correctlySelected
318
317
  if (isReviewMode && correctlySelectedChoice(rowIndex, columnIndex)) {
319
- const borderColor = isDarkMode ? brandColors.jungleGreen : brandColors.cadaverous
318
+ const borderColor = isDarkMode.value ? brandColors.jungleGreen : brandColors.cadaverous
320
319
  return {
321
320
  borderColor: `${borderColor} !important`,
322
321
  background: `${borderColor} !important`,
@@ -339,9 +338,9 @@ const checkboxContainerStyling = (rowIndex: number, columnIndex: number) => {
339
338
  }
340
339
 
341
340
  const checkboxCheckStyling = (rowIndex: number, columnIndex: number) => {
342
- const isReviewMode = showMatrixAnswers.value || reviewMode
341
+ const isReviewMode = showMatrixAnswers.value || reviewMode.value
343
342
  if (isReviewMode && correctAnswerButNotSelected(rowIndex, columnIndex)) {
344
- const color = isDarkMode ? brandColors.jungleGreen : brandColors.cadaverous
343
+ const color = isDarkMode.value ? brandColors.jungleGreen : brandColors.cadaverous
345
344
  return {
346
345
  color: `${color} !important`,
347
346
  }
@@ -349,11 +348,10 @@ const checkboxCheckStyling = (rowIndex: number, columnIndex: number) => {
349
348
  }
350
349
 
351
350
  const correctRow = (rowIndex: number) => {
352
- if (matrixChoiceLayout.value && matrixChoiceLayout.value[rowIndex]) {
351
+ if (matrixChoiceLayout.value?.[rowIndex]) {
353
352
  if (
354
353
  question?.value.type === 'Matrix Checkbox' &&
355
- matrixCheckboxGrid.value &&
356
- matrixCheckboxGrid.value[rowIndex]
354
+ matrixCheckboxGrid.value?.[rowIndex]
357
355
  ) {
358
356
  const correctAnswerKeys = matrixChoiceLayout.value[rowIndex]?.filter(choice =>
359
357
  choice.startsWith('a')
@@ -371,8 +369,7 @@ const correctRow = (rowIndex: number) => {
371
369
 
372
370
  if (
373
371
  question?.value.type === 'Matrix Radio Button' &&
374
- matrixRadioGrid.value &&
375
- matrixRadioGrid.value[rowIndex]
372
+ matrixRadioGrid.value?.[rowIndex]
376
373
  ) {
377
374
  const rowVal = matrixRadioGrid.value[rowIndex]?.value
378
375
  if (rowVal) {
@@ -402,7 +399,7 @@ const convertSelectedMatrixChoiceToCheckboxGrid = () => {
402
399
  selectedMatrixChoices.value.forEach(choice => {
403
400
  const rowIndex = Number(choice.substring(1, choice.indexOf('_'))) - 1
404
401
  const columnIndex = Number(choice.split('_').pop()) - 1
405
- const row = checkboxGrid && checkboxGrid[rowIndex]
402
+ const row = checkboxGrid?.[rowIndex]
406
403
  if (row) {
407
404
  row[columnIndex] = true
408
405
  if (selectedColumnHeaders.value[rowIndex] && question.value.matrixLabels?.columns[columnIndex]) {
@@ -441,7 +438,7 @@ const convertSelectedMatrixChoiceToRadioBtnGrid = () => {
441
438
  selectedColumnHeaders.value[rowIndex]?.push(columnHeader)
442
439
  }
443
440
  }
444
- const radioBtnGridRow = radioBtnGrid && radioBtnGrid[rowIndex]
441
+ const radioBtnGridRow = radioBtnGrid?.[rowIndex]
445
442
  if (radioBtnGridRow) {
446
443
  radioBtnGridRow.value = choice
447
444
  }
@@ -450,12 +447,12 @@ const convertSelectedMatrixChoiceToRadioBtnGrid = () => {
450
447
  }
451
448
 
452
449
  const checkboxRowClicked = (rowIndex: number, columnIndex: number) => {
453
- const matrixCheckboxGridRow = matrixCheckboxGrid.value && matrixCheckboxGrid.value[rowIndex]
450
+ const matrixCheckboxGridRow = matrixCheckboxGrid.value?.[rowIndex]
454
451
  if (matrixCheckboxGridRow) {
455
452
  matrixCheckboxGridRow[columnIndex] = !matrixCheckboxGridRow[columnIndex]
456
453
  const columnHeader = question.value.matrixLabels?.columns[columnIndex]
457
454
 
458
- if (selectedColumnHeaders.value && selectedColumnHeaders.value[rowIndex] && columnHeader) {
455
+ if (selectedColumnHeaders.value?.[rowIndex] && columnHeader) {
459
456
  if (selectedColumnHeaders.value[rowIndex]?.includes(columnHeader)) {
460
457
  const columnHeaderIndex = selectedColumnHeaders.value[rowIndex]?.indexOf(columnHeader)
461
458
  if (columnHeaderIndex !== undefined && columnHeaderIndex !== -1) {
@@ -493,16 +490,12 @@ const emitSelectedMatrixChoice = (matrixChoiceKeys: TMatrixChoiceKey[]) => {
493
490
  }
494
491
 
495
492
  watch(matrixCheckboxGrid, () => {
496
- if (matrixChoiceLayout.value && matrixCheckboxGrid.value && (!reviewMode || !showMatrixAnswers.value)) {
493
+ if (matrixChoiceLayout.value && matrixCheckboxGrid.value && (!reviewMode.value || !showMatrixAnswers.value)) {
497
494
  const selectedCheckboxChoices: TMatrixChoiceKey[] = []
498
495
 
499
496
  matrixCheckboxGrid.value.forEach((row, rowIndex) => {
500
497
  row.forEach((choice, choiceIndex) => {
501
- if (
502
- choice &&
503
- matrixChoiceLayout.value?.[rowIndex] &&
504
- matrixChoiceLayout.value?.[rowIndex]?.[choiceIndex]
505
- ) {
498
+ if (choice && matrixChoiceLayout?.value?.[rowIndex]?.[choiceIndex]) {
506
499
  const choiceKey = matrixChoiceLayout.value?.[rowIndex]?.[choiceIndex] as TMatrixChoiceKey
507
500
  if (choiceKey) {
508
501
  selectedCheckboxChoices.push(choiceKey)
@@ -516,7 +509,7 @@ watch(matrixCheckboxGrid, () => {
516
509
  }, { deep: true })
517
510
 
518
511
  watch(matrixRadioGrid, () => {
519
- if (matrixChoiceLayout.value && matrixRadioGrid.value && (!reviewMode || !showMatrixAnswers.value)) {
512
+ if (matrixChoiceLayout.value && matrixRadioGrid.value && (!reviewMode.value || !showMatrixAnswers.value)) {
520
513
  const selectedRadioButtonChoices: TMatrixChoiceKey[] = []
521
514
 
522
515
  matrixRadioGrid.value.forEach((row) => {
@@ -536,12 +529,12 @@ watch(showMatrixAnswers, () => {
536
529
  })
537
530
 
538
531
  watch(selectedMatrixChoices, () => {
539
- if ((reviewMode || showMatrixAnswers.value) && question.value.type === 'Matrix Checkbox') {
532
+ if ((reviewMode.value || showMatrixAnswers.value) && question.value.type === 'Matrix Checkbox') {
540
533
  const selectedCheckboxGrid = convertSelectedMatrixChoiceToCheckboxGrid()
541
534
  matrixCheckboxGrid.value = selectedCheckboxGrid ? selectedCheckboxGrid : defaultCheckboxGrid.value
542
535
  }
543
536
 
544
- if ((reviewMode || showMatrixAnswers.value) && question.value.type === 'Matrix Radio Button') {
537
+ if ((reviewMode.value || showMatrixAnswers.value) && question.value.type === 'Matrix Radio Button') {
545
538
  const selectedRadioBtnGrid = convertSelectedMatrixChoiceToRadioBtnGrid()
546
539
  matrixRadioGrid.value = selectedRadioBtnGrid
547
540
  }
@@ -549,8 +542,8 @@ watch(selectedMatrixChoices, () => {
549
542
  </script>
550
543
 
551
544
  <style lang="scss">
552
- @import '../../../styles/colors';
553
- @import '../../../styles/breakpoints';
545
+ @use '@/styles/breakpoints' as *;
546
+ @use '@/styles/colors' as *;
554
547
 
555
548
  .uikit-question-mobile-matrix-choices-container {
556
549
  width: 100%;
@@ -4,15 +4,17 @@ import { dark as vDark } from '../../../directives'
4
4
  import type { TMatrixChoiceKey } from '../question'
5
5
 
6
6
  interface Props {
7
- isDarkMode: boolean
7
+ isDarkMode?: boolean
8
8
  choices?: TMatrixChoiceKey[]
9
9
  labels?: string[]
10
- showAnswers: boolean
11
- disabled: boolean
10
+ showAnswers?: boolean
11
+ disabled?: boolean
12
12
  }
13
13
 
14
14
  const props = withDefaults(defineProps<Props>(), {
15
15
  isDarkMode: false,
16
+ choices: () => [],
17
+ labels: () => [],
16
18
  showAnswers: false,
17
19
  disabled: false,
18
20
  })
@@ -91,8 +93,8 @@ const stripHtmlTags = (string?: string) => {
91
93
  </template>
92
94
 
93
95
  <style lang="scss" scoped>
94
- @import '../../../styles/breakpoints';
95
- @import '../../../styles/colors';
96
+ @use '@/styles/breakpoints' as *;
97
+ @use '@/styles/colors' as *;
96
98
 
97
99
  .uikit-mobile-matrix-radio-group {
98
100
  list-style: none;
@@ -102,8 +102,8 @@ const emitMoveFocusToPrompt = () => {
102
102
  </script>
103
103
 
104
104
  <style lang="scss">
105
- @import '../../../styles/colors';
106
- @import '../../../styles/breakpoints';
105
+ @use '@/styles/breakpoints' as *;
106
+ @use '@/styles/colors' as *;
107
107
 
108
108
  .uikit-question-passage-and-image {
109
109
  position: relative;
@@ -141,8 +141,9 @@ const togglePassageImageLongAltDropdown = () => {
141
141
  </script>
142
142
 
143
143
  <style lang="scss">
144
- @import '../../../styles/colors';
145
- @import '../../../styles/breakpoints';
144
+ @use 'sass:color';
145
+ @use '@/styles/breakpoints' as *;
146
+ @use '@/styles/colors' as *;
146
147
 
147
148
  .uikit-question-passage-and-image-dropdown {
148
149
  &__passage-and-image-dropdown-btn {
@@ -161,11 +162,11 @@ const togglePassageImageLongAltDropdown = () => {
161
162
 
162
163
  &:hover {
163
164
  .uikit-question-passage-and-image-dropdown__passage-and-image-dropdown-text {
164
- color: mix($brand-blue, black, 90%);
165
+ color: color.mix($brand-blue, black, 90%);
165
166
  }
166
167
 
167
168
  .uikit-question-passage-and-image-dropdown__passage-and-image-dropdown-arrow {
168
- color: mix($brand-blue, black, 90%);
169
+ color: color.mix($brand-blue, black, 90%);
169
170
  }
170
171
 
171
172
  &::before {
@@ -261,7 +262,7 @@ const togglePassageImageLongAltDropdown = () => {
261
262
  line-height: 24px;
262
263
  font-size: 16px;
263
264
  font-weight: 400;
264
- letter-spacing: -0.1;
265
+ letter-spacing: -0.1px;
265
266
 
266
267
  &--mobile {
267
268
  line-height: 24px;
@@ -315,7 +316,7 @@ const togglePassageImageLongAltDropdown = () => {
315
316
  font-size: 15px;
316
317
  line-height: 22px;
317
318
  font-weight: 500;
318
- letter-spacing: -0.2;
319
+ letter-spacing: -0.2px;
319
320
 
320
321
  &--dark {
321
322
  color: $fog;
@@ -66,8 +66,8 @@ const emitUpgradeClick = () => {
66
66
  </script>
67
67
 
68
68
  <style lang="scss">
69
- @import '../../../styles/colors';
70
- @import '../../../styles/breakpoints';
69
+ @use '@/styles/breakpoints' as *;
70
+ @use '@/styles/colors' as *;
71
71
 
72
72
  .uikit-question-paywall {
73
73
  width: 100%;
@@ -65,7 +65,6 @@ import { useQuestionContext } from './composables'
65
65
 
66
66
  const {
67
67
  // questionEl is used by the breakpoint directive
68
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
69
68
  questionEl,
70
69
  breakpointsWithEl,
71
70
  quizLength,
@@ -85,8 +84,8 @@ defineExpose({
85
84
  </script>
86
85
 
87
86
  <style lang="scss">
88
- @import '../../../styles/colors';
89
- @import '../../../styles/breakpoints';
87
+ @use '@/styles/breakpoints' as *;
88
+ @use '@/styles/colors' as *;
90
89
 
91
90
  .uikit-question-context {
92
91
  display: flex;
@@ -42,8 +42,8 @@ const {
42
42
  </script>
43
43
 
44
44
  <style lang="scss">
45
- @import '../../../styles/colors';
46
- @import '../../../styles/breakpoints';
45
+ @use '@/styles/breakpoints' as *;
46
+ @use '@/styles/colors' as *;
47
47
 
48
48
  .uikit-question-stats-summary {
49
49
  margin-top: 24px;
@@ -180,8 +180,8 @@ const toggleSummaryExplanationImageLongAlt = () => {
180
180
  </script>
181
181
 
182
182
  <style lang="scss">
183
- @import '../../../styles/colors';
184
- @import '../../../styles/breakpoints';
183
+ @use '@/styles/breakpoints' as *;
184
+ @use '@/styles/colors' as *;
185
185
 
186
186
  .uikit-question-summary {
187
187
  position: relative;
@@ -167,22 +167,22 @@
167
167
  <slot name="explanationTopExperiment"></slot>
168
168
  </template>
169
169
  <template #motivationalMoment="{
170
- isCorrect,
170
+ isCorrect:isCorrectMM,
171
171
  choiceKey,
172
- showAnswers,
173
- answerKeys,
172
+ showAnswers:showAnswersMM,
173
+ answerKeys:answerKeysMM,
174
174
  }">
175
175
  <slot
176
176
  name="motivationalMoment"
177
- :showAnswers="showAnswers"
178
- :answerKeys="answerKeys"
177
+ :showAnswers="showAnswersMM"
178
+ :answerKeys="answerKeysMM"
179
179
  :choiceKey="choiceKey"
180
- :isCorrect="isCorrect"
180
+ :isCorrect="isCorrectMM"
181
181
  />
182
182
  </template>
183
183
  <template #showNamesTable="{
184
184
  choiceKey,
185
- }" >
185
+ }">
186
186
  <slot
187
187
  name="showNamesTable"
188
188
  :choiceKey="choiceKey"
@@ -200,17 +200,17 @@
200
200
  @emitSelectedMatrixChoice="selectMatrixChoice"
201
201
  >
202
202
  <template #motivationalMoment="{
203
- isCorrect,
203
+ isCorrect:isCorrectMM,
204
204
  choiceKey,
205
- showAnswers,
206
- answerKeys,
205
+ showAnswers:showAnswersMM,
206
+ answerKeys:answerKeysMM,
207
207
  }">
208
208
  <slot
209
209
  name="motivationalMoment"
210
- :showAnswers="showAnswers"
211
- :answerKeys="answerKeys"
210
+ :showAnswers="showAnswersMM"
211
+ :answerKeys="answerKeysMM"
212
212
  :choiceKey="choiceKey"
213
- :isCorrect="isCorrect"
213
+ :isCorrect="isCorrectMM"
214
214
  />
215
215
  </template>
216
216
  <template #explanationBottomExperiment>
@@ -225,18 +225,18 @@
225
225
  >
226
226
  <template
227
227
  #motivationalMoment="{
228
- isCorrect,
228
+ isCorrect:isCorrectMM,
229
229
  choiceKey,
230
- showAnswers,
231
- answerKeys,
230
+ showAnswers:showAnswersMM,
231
+ answerKeys:answerKeysMM,
232
232
  }"
233
233
  >
234
234
  <slot
235
235
  name="motivationalMoment"
236
- :showAnswers="showAnswers"
237
- :answerKeys="answerKeys"
236
+ :showAnswers="showAnswersMM"
237
+ :answerKeys="answerKeysMM"
238
238
  :choiceKey="choiceKey"
239
- :isCorrect="isCorrect"
239
+ :isCorrect="isCorrectMM"
240
240
  />
241
241
  </template>
242
242
  <template #explanationBottomExperiment>
@@ -424,7 +424,7 @@ const props = withDefaults(defineProps<{
424
424
  hideReferences?: boolean
425
425
  isTeachReview?: boolean
426
426
  isTeachGroupReview?: boolean
427
- keywordDefinitions: { keyword: string; definition: string }[]
427
+ keywordDefinitions?: { keyword: string; definition: string }[]
428
428
  }>(), {
429
429
  imageUrlPrefix: '',
430
430
  quizMode: 'quick10',
@@ -621,7 +621,7 @@ const passageAndImageTitle = computed(() => {
621
621
  } else if (!props.question.passage && passageImageUrl.value) {
622
622
  return 'Image'
623
623
  } else {
624
- return props.question.passageLabel ? `${props.question.passageLabel}` :
624
+ return props.question.passageLabel ? props.question.passageLabel :
625
625
  'Passage'
626
626
  }
627
627
  })
@@ -737,7 +737,7 @@ const isMatrixQuestionAnswered = computed(() => {
737
737
  // Matrix questions are answered if each row has a selected choice
738
738
  if (isMatrixQuestion.value) {
739
739
  const answeredRowNums = selectedMatrixChoices.value.map(choice => {
740
- if (choice as TMatrixChoiceKey) {
740
+ if (choice) {
741
741
  return Number(choice.split('_')[0]?.slice(1))
742
742
  }
743
743
  return
@@ -834,7 +834,7 @@ const moveFocusToPassage = () => {
834
834
  }
835
835
  }
836
836
 
837
- const moveFocusToPrompt = async () => {
837
+ const moveFocusToPrompt = () => {
838
838
  promptEl?.value?.focus()
839
839
  }
840
840
 
@@ -861,7 +861,7 @@ const startReviewMode = () => {
861
861
  } else {
862
862
  showMatrixAnswers.value = true
863
863
  showExplanation.value = props.defaultShowExplanation === null ? true : props.defaultShowExplanation
864
- selectedMatrixChoices.value = matrixAnswerKeys.value as TMatrixChoiceKey[]
864
+ selectedMatrixChoices.value = matrixAnswerKeys.value
865
865
  }
866
866
  }
867
867
 
@@ -956,7 +956,7 @@ const handleTouchMove = (event: TouchEvent) => {
956
956
  }
957
957
  }
958
958
 
959
- const handleTouchEnd = (option: {choiceKey: TChoiceKey; event: TouchEvent}) => {
959
+ const handleTouchEnd = (option: { choiceKey: TChoiceKey; event: TouchEvent }) => {
960
960
  const choiceKey = option.choiceKey
961
961
  const event = option.event
962
962
  const targetEl = event.target as Ref
@@ -1237,7 +1237,7 @@ if (isMatrixQuestion.value && props.previousMatrixChoices) {
1237
1237
  updateSelectedMatrixChoices(props.previousMatrixChoices)
1238
1238
  }
1239
1239
 
1240
- onMounted(async () => {
1240
+ onMounted(() => {
1241
1241
  questionEl.value = props.containerEl || questionRef.value
1242
1242
 
1243
1243
  if (props.initialShowAnswers) {
@@ -1315,8 +1315,8 @@ provide(InjectionKeys.isTeachGroupReviewKey, isTeachGroupReview)
1315
1315
  </script>
1316
1316
 
1317
1317
  <style lang="scss">
1318
- @import '../../styles/colors';
1319
- @import '../../styles/breakpoints';
1318
+ @use '@/styles/breakpoints' as *;
1319
+ @use '@/styles/colors' as *;
1320
1320
 
1321
1321
  .uikit-question {
1322
1322
  position: relative;
@@ -1812,6 +1812,7 @@ provide(InjectionKeys.isTeachGroupReviewKey, isTeachGroupReview)
1812
1812
 
1813
1813
  &__matrix-choices-container {
1814
1814
  display: block;
1815
+
1815
1816
  @include breakpoint(black-bear) {
1816
1817
  display: none;
1817
1818
  }
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div
3
- ref="quiz-container"
3
+ ref="quiz-container-ref"
4
4
  v-breakpoint
5
5
  v-dark="isDarkMode"
6
6
  class="uikit-quiz-container"
@@ -47,49 +47,43 @@
47
47
  </div>
48
48
  </template>
49
49
 
50
- <script lang="ts">
51
- import { breakpoint, dark } from '../../directives'
52
- import { Component, Prop, Vue } from 'vue-facing-decorator'
53
- import Icon from '../Icons/Icon.vue'
54
-
55
- @Component({
56
- directives: {
57
- breakpoint,
58
- dark,
59
- },
60
- components: {
61
- Icon,
62
- },
50
+ <script setup lang="ts">
51
+ import { onBeforeUnmount, onMounted, useTemplateRef } from 'vue'
52
+ import { dark as vDark, breakpoint as vBreakpoint } from '../../directives'
53
+
54
+ withDefaults(defineProps<{
55
+ showSide?: boolean
56
+ isDarkMode?: boolean
57
+ customHeaderStyles?: Record<string, string>
58
+ customMainStyles?: Record<string, string>
59
+ customFooterStyles?: Record<string, string>
60
+ }>(), {
61
+ showSide: false,
62
+ isDarkMode: false,
63
+ customHeaderStyles: () => ({}),
64
+ customMainStyles: () => ({}),
65
+ customFooterStyles: () => ({}),
63
66
  })
64
- export default class QuizContainer extends Vue {
65
- @Prop({ default: false }) showSide!: boolean
66
- @Prop({ default: false }) isDarkMode!: boolean
67
- @Prop({ default: () => ({}) }) customHeaderStyles!: Record<string, string>
68
- @Prop({ default: () => ({}) }) customMainStyles!: Record<string, string>
69
- @Prop({ default: () => ({}) }) customFooterStyles!: Record<string, string>
70
-
71
- quizContainerEl: HTMLElement | null = null
72
-
73
- beforeUnmount () {
74
- const bodyEl = document.getElementsByTagName('body')[0]
75
- if (bodyEl) {
76
- bodyEl.style.overflow = ''
77
- }
67
+
68
+ const quizContainerEl = useTemplateRef('quiz-container-ref')
69
+
70
+ onBeforeUnmount(() => {
71
+ const bodyEl = document.getElementsByTagName('body')[0]
72
+ if (bodyEl) {
73
+ bodyEl.style.overflow = ''
78
74
  }
75
+ })
79
76
 
80
- mounted () {
81
- const bodyEl = document.getElementsByTagName('body')[0]
82
- if (bodyEl) {
83
- bodyEl.style.overflow = 'hidden'
84
- }
85
- const quizContainerEl = this.$refs['quiz-container'] as HTMLElement || null
86
- this.quizContainerEl = quizContainerEl
77
+ onMounted(() => {
78
+ const bodyEl = document.getElementsByTagName('body')[0]
79
+ if (bodyEl) {
80
+ bodyEl.style.overflow = 'hidden'
87
81
  }
88
- }
82
+ })
89
83
  </script>
90
84
 
91
85
  <style lang="scss">
92
- @import '../../styles/colors';
86
+ @use '@/styles/colors' as *;
93
87
 
94
88
  .uikit-quiz-container {
95
89
  display: flex;