@pocketprep/ui-kit 3.8.4 → 3.9.0

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 (159) hide show
  1. package/dist/@pocketprep/ui-kit.css +1 -1
  2. package/dist/@pocketprep/ui-kit.js +14469 -17731
  3. package/dist/@pocketprep/ui-kit.js.map +1 -1
  4. package/dist/@pocketprep/ui-kit.umd.cjs +19 -29
  5. package/dist/@pocketprep/ui-kit.umd.cjs.map +1 -1
  6. package/eslint.config.ts +38 -11
  7. package/lib/SVGDefinitions.vue +32 -35
  8. package/lib/components/Banners/Banner.vue +10 -14
  9. package/lib/components/Blobs/Blob.vue +6 -14
  10. package/lib/components/Blobs/BlobEmptyState.vue +9 -8
  11. package/lib/components/Blobs/blob.d.ts +1 -1
  12. package/lib/components/BundleIcons/BundleIcon.vue +36 -63
  13. package/lib/components/BundleIcons/bundleIcon.d.ts +1 -1
  14. package/lib/components/Bundles/BundleList.vue +71 -59
  15. package/lib/components/Bundles/BundleSearch.vue +93 -117
  16. package/lib/components/Bundles/PremiumPill.vue +6 -12
  17. package/lib/components/Buttons/Button.vue +32 -35
  18. package/lib/components/Buttons/Link.vue +32 -31
  19. package/lib/components/Buttons/Tab.vue +14 -17
  20. package/lib/components/Calendar/Calendar.vue +87 -85
  21. package/lib/components/Charts/Bar.vue +192 -263
  22. package/lib/components/Charts/Pie.vue +55 -61
  23. package/lib/components/Charts/highcharts-wrap.ts +81 -0
  24. package/lib/components/Controls/SegmentControl.vue +26 -24
  25. package/lib/components/Controls/Slider.vue +51 -47
  26. package/lib/components/Controls/ToggleSwitch.vue +33 -31
  27. package/lib/components/EmptyStates/EmptyState.vue +69 -73
  28. package/lib/components/Exams/ExamCard.vue +59 -47
  29. package/lib/components/Exams/ExamMenuCard.vue +30 -28
  30. package/lib/components/Filters/FilterDropdown.vue +83 -86
  31. package/lib/components/Filters/FilterOptions.vue +83 -88
  32. package/lib/components/Forms/Checkbox.vue +27 -27
  33. package/lib/components/Forms/CheckboxOption.vue +30 -30
  34. package/lib/components/Forms/Errors.vue +21 -24
  35. package/lib/components/Forms/Input.vue +71 -59
  36. package/lib/components/Forms/Radio.vue +2 -2
  37. package/lib/components/Forms/RadioButton.vue +8 -8
  38. package/lib/components/Forms/Select.vue +265 -257
  39. package/lib/components/Forms/Textarea.vue +49 -35
  40. package/lib/components/Icons/IconAccordionArrow.vue +7 -9
  41. package/lib/components/Icons/IconActivity.vue +7 -9
  42. package/lib/components/Icons/IconAdd.vue +7 -11
  43. package/lib/components/Icons/IconAddCircle.vue +7 -9
  44. package/lib/components/Icons/IconArrow.vue +7 -9
  45. package/lib/components/Icons/IconBarChart.vue +7 -9
  46. package/lib/components/Icons/IconCalendar.vue +7 -9
  47. package/lib/components/Icons/IconCalendarPicker.vue +7 -9
  48. package/lib/components/Icons/IconChat.vue +7 -9
  49. package/lib/components/Icons/IconCheck.vue +7 -9
  50. package/lib/components/Icons/IconClose.vue +7 -9
  51. package/lib/components/Icons/IconConcept.vue +1 -1
  52. package/lib/components/Icons/IconCorrect.vue +7 -9
  53. package/lib/components/Icons/IconEdit.vue +7 -11
  54. package/lib/components/Icons/IconExam.vue +7 -9
  55. package/lib/components/Icons/IconExternalLink.vue +7 -9
  56. package/lib/components/Icons/IconEyeHide.vue +7 -9
  57. package/lib/components/Icons/IconEyeShow.vue +7 -9
  58. package/lib/components/Icons/IconFilter.vue +7 -9
  59. package/lib/components/Icons/IconFilterActive.vue +7 -9
  60. package/lib/components/Icons/IconFlag.vue +7 -9
  61. package/lib/components/Icons/IconFlagContent.vue +8 -9
  62. package/lib/components/Icons/IconFlagFeedback.vue +8 -10
  63. package/lib/components/Icons/IconFlagFilled.vue +7 -9
  64. package/lib/components/Icons/IconFullView.vue +7 -9
  65. package/lib/components/Icons/IconFullViewActive.vue +7 -9
  66. package/lib/components/Icons/IconGridDrag.vue +2 -2
  67. package/lib/components/Icons/IconHandle.vue +7 -9
  68. package/lib/components/Icons/IconHeart.vue +7 -9
  69. package/lib/components/Icons/IconHelp.vue +7 -9
  70. package/lib/components/Icons/IconHighlight.vue +2 -2
  71. package/lib/components/Icons/IconHourglass.vue +7 -9
  72. package/lib/components/Icons/IconImage.vue +7 -9
  73. package/lib/components/Icons/IconIncorrect.vue +7 -9
  74. package/lib/components/Icons/IconInfo.vue +7 -9
  75. package/lib/components/Icons/IconKeyboard.vue +7 -9
  76. package/lib/components/Icons/IconLaunch.vue +7 -9
  77. package/lib/components/Icons/IconLevelUp.vue +7 -9
  78. package/lib/components/Icons/IconLightbulb.vue +7 -9
  79. package/lib/components/Icons/IconLightning.vue +7 -9
  80. package/lib/components/Icons/IconLink.vue +7 -9
  81. package/lib/components/Icons/IconList.vue +7 -9
  82. package/lib/components/Icons/IconLoading.vue +7 -9
  83. package/lib/components/Icons/IconLoading2.vue +11 -11
  84. package/lib/components/Icons/IconLock.vue +7 -9
  85. package/lib/components/Icons/IconMissedQuestions.vue +7 -9
  86. package/lib/components/Icons/IconMoon.vue +7 -9
  87. package/lib/components/Icons/IconPaginationArrow.vue +7 -9
  88. package/lib/components/Icons/IconPaginationArrowDouble.vue +7 -9
  89. package/lib/components/Icons/IconPassage.vue +7 -9
  90. package/lib/components/Icons/IconPencil.vue +7 -9
  91. package/lib/components/Icons/IconPeople.vue +7 -9
  92. package/lib/components/Icons/IconPercent.vue +7 -9
  93. package/lib/components/Icons/IconPerson.vue +8 -9
  94. package/lib/components/Icons/IconPresent.vue +7 -9
  95. package/lib/components/Icons/IconPreview.vue +7 -9
  96. package/lib/components/Icons/IconQuestions.vue +7 -9
  97. package/lib/components/Icons/IconQuick10.vue +7 -9
  98. package/lib/components/Icons/IconQuickActions.vue +2 -2
  99. package/lib/components/Icons/IconRecommendedFilter.vue +1 -1
  100. package/lib/components/Icons/IconRemoveCircle.vue +7 -9
  101. package/lib/components/Icons/IconReviewFlag.vue +7 -9
  102. package/lib/components/Icons/IconSearch.vue +7 -9
  103. package/lib/components/Icons/IconShare.vue +7 -9
  104. package/lib/components/Icons/IconSideBar.vue +7 -9
  105. package/lib/components/Icons/IconSideBarActive.vue +7 -9
  106. package/lib/components/Icons/IconStar.vue +1 -1
  107. package/lib/components/Icons/IconStopwatch.vue +7 -9
  108. package/lib/components/Icons/IconStrike.vue +7 -9
  109. package/lib/components/Icons/IconSubject.vue +7 -9
  110. package/lib/components/Icons/IconText.vue +7 -9
  111. package/lib/components/Icons/IconTimer.vue +8 -9
  112. package/lib/components/Icons/IconWarning.vue +7 -9
  113. package/lib/components/Icons/icon.d.ts +1 -1
  114. package/lib/components/Loaders/SkeletonLoader.vue +1 -5
  115. package/lib/components/Modal/Modal.vue +23 -29
  116. package/lib/components/Modal/ModalContainer.vue +135 -133
  117. package/lib/components/Onboarding/EmailAuth.vue +66 -70
  118. package/lib/components/Onboarding/MagicCodeEntry.vue +88 -83
  119. package/lib/components/Pagination/QuestionReviewPagination.vue +3 -3
  120. package/lib/components/Pagination/TablePagination.vue +47 -44
  121. package/lib/components/PhonePerson/PhonePerson.vue +18 -18
  122. package/lib/components/PhonePerson/phonePerson.d.ts +1 -1
  123. package/lib/components/Quiz/FlagToggle.vue +45 -44
  124. package/lib/components/Quiz/GlobalMetricsToggle.vue +29 -28
  125. package/lib/components/Quiz/KeyboardShortcutsButton.vue +16 -23
  126. package/lib/components/Quiz/KeyboardShortcutsModal.vue +36 -37
  127. package/lib/components/Quiz/Question/BuildListChoicesContainer.vue +65 -65
  128. package/lib/components/Quiz/Question/ChoicesContainer.vue +5 -5
  129. package/lib/components/Quiz/Question/DropdownExplanation.vue +5 -5
  130. package/lib/components/Quiz/Question/Explanation.vue +6 -6
  131. package/lib/components/Quiz/Question/MPMCChoicesContainer.vue +17 -17
  132. package/lib/components/Quiz/Question/MPMCRadioGroup.vue +2 -2
  133. package/lib/components/Quiz/Question/MatrixChoicesContainer.vue +39 -39
  134. package/lib/components/Quiz/Question/MatrixRadioGroup.vue +6 -6
  135. package/lib/components/Quiz/Question/MobileMatrixChoicesContainer.vue +27 -28
  136. package/lib/components/Quiz/Question/MobileMatrixRadioGroup.vue +2 -2
  137. package/lib/components/Quiz/Question/PassageAndImage.vue +3 -3
  138. package/lib/components/Quiz/Question/PassageAndImageDropdown.vue +7 -7
  139. package/lib/components/Quiz/Question/Paywall.vue +2 -2
  140. package/lib/components/Quiz/Question/QuestionContext.vue +1 -1
  141. package/lib/components/Quiz/Question/StatsSummary.vue +2 -2
  142. package/lib/components/Quiz/Question/Summary.vue +11 -11
  143. package/lib/components/Quiz/Question.vue +90 -82
  144. package/lib/components/Quiz/QuizContainer.vue +1 -1
  145. package/lib/components/Quiz/QuizProgressBar.vue +23 -23
  146. package/lib/components/Quiz/question.d.ts +3 -3
  147. package/lib/components/Search/Pill.vue +16 -19
  148. package/lib/components/Search/Search.vue +52 -47
  149. package/lib/components/SidePanels/SidePanel.vue +168 -174
  150. package/lib/components/Tables/Table.vue +135 -122
  151. package/lib/components/Tables/TableActions.vue +81 -76
  152. package/lib/components/Tables/table.d.ts +1 -1
  153. package/lib/components/Tags/Tag.vue +49 -39
  154. package/lib/components/Toasts/Toast.vue +44 -42
  155. package/lib/components/Tooltips/OverflowTooltip.vue +39 -45
  156. package/lib/components/Tooltips/Tooltip.vue +69 -70
  157. package/lib/directives.ts +4 -4
  158. package/lib/utils.ts +13 -12
  159. package/package.json +27 -28
@@ -28,101 +28,106 @@
28
28
  </div>
29
29
  </template>
30
30
 
31
- <script lang="ts">
32
- import { Vue, Component, Prop, Emit } from 'vue-facing-decorator'
33
-
34
- @Component
35
- export default class MagicCodeEntry extends Vue {
36
- @Prop({ default: false }) error!: boolean
37
- @Prop({ default: '' }) modelValue!: string
38
-
39
- highlightInput = false
40
- cursorIndex = 0
41
-
42
- mounted () {
43
- // Ensure proper letter spacing for magic code in case of a11y browser extension overrides
44
- setTimeout(() => {
45
- const codeInputEl = document.querySelector('.uikit-magic-code__code-input')
46
- if (codeInputEl instanceof HTMLElement) {
47
- codeInputEl.style.letterSpacing = '35.5px'
48
- }
49
- }, 500)
50
- }
51
-
52
- handleKeyDown (event: Event | KeyboardEvent) {
53
- if (!('key' in event)) {
54
- return
55
- }
56
-
57
- // Allow tab, refresh, and paste events to pass through, otherwise prevent default keydown behavior
58
- if (
59
- !event.metaKey
60
- && (
61
- event.key.match(/^[0-9]$/)
62
- || event.key === 'ArrowLeft'
63
- || event.key === 'ArrowRight'
64
- || event.key === 'Backspace'
65
- || event.key === 'Enter'
66
- )
67
- ) {
68
- event.preventDefault()
31
+ <script setup lang="ts">
32
+ import { onMounted, ref } from 'vue'
33
+
34
+ const {
35
+ error = false,
36
+ modelValue = '',
37
+ } = defineProps<{
38
+ error?: boolean
39
+ modelValue?: string
40
+ }>()
41
+
42
+ const emit = defineEmits<{
43
+ 'submit': []
44
+ 'error': [errorMessage: string]
45
+ 'update:modelValue': [code: string]
46
+ }>()
47
+
48
+ const highlightInput = ref(false)
49
+ const cursorIndex = ref(0)
50
+
51
+ onMounted(() => {
52
+ // Ensure proper letter spacing for magic code in case of a11y browser extension overrides
53
+ setTimeout(() => {
54
+ const codeInputEl = document.querySelector('.uikit-magic-code__code-input')
55
+ if (codeInputEl instanceof HTMLElement) {
56
+ codeInputEl.style.letterSpacing = '35.5px'
69
57
  }
58
+ }, 500)
59
+ })
70
60
 
71
- if (event.key.match(/[0-9]/)) {
72
- const code = this.modelValue.slice(0, this.cursorIndex)
73
- + event.key + this.modelValue.slice(this.cursorIndex + 1)
74
- this.emitUpdateModelValue(code)
75
- this.cursorIndex = Math.min(this.cursorIndex + 1, 5)
76
- } else if (event.key === 'ArrowLeft') {
77
- this.cursorIndex = Math.max(this.cursorIndex - 1, 0)
78
- } else if (event.key === 'ArrowRight') {
79
- this.cursorIndex = Math.min(this.cursorIndex + 1, 5)
80
- } else if (event.key === 'Backspace') {
81
- if (this.modelValue[this.cursorIndex]) {
82
- const code = (
83
- this.modelValue.slice(0, this.cursorIndex) + ' ' + this.modelValue.slice(this.cursorIndex + 1)
84
- ).trimEnd()
85
- this.emitUpdateModelValue(code)
86
- }
87
- this.cursorIndex = Math.min(Math.max(this.cursorIndex - 1, 0), this.modelValue.length)
88
- } else if (event.key === 'Enter') {
89
- this.emitSubmit()
90
- }
61
+ const handleKeyDown = (event: Event | KeyboardEvent) => {
62
+ if (!('key' in event)) {
63
+ return
91
64
  }
92
65
 
93
- handleClick (event: MouseEvent) {
94
- const selectionEnd = (event.target as HTMLInputElement)?.selectionEnd
95
- if (selectionEnd !== null) {
96
- this.cursorIndex = selectionEnd
97
- }
66
+ // Allow tab, refresh, and paste events to pass through, otherwise prevent default keydown behavior
67
+ if (
68
+ !event.metaKey
69
+ && (
70
+ event.key.match(/^[0-9]$/)
71
+ || event.key === 'ArrowLeft'
72
+ || event.key === 'ArrowRight'
73
+ || event.key === 'Backspace'
74
+ || event.key === 'Enter'
75
+ )
76
+ ) {
77
+ event.preventDefault()
98
78
  }
99
79
 
100
- handlePaste (event: ClipboardEvent) {
101
- this.emitError('')
102
- const pasteValue = event.clipboardData?.getData('text')
103
- if (pasteValue && typeof Number(pasteValue) === 'number' && pasteValue.length === 6) {
104
- this.emitUpdateModelValue('')
105
- this.cursorIndex = Math.min(pasteValue.length, 5)
106
- } else if (pasteValue) {
107
- this.emitError(`Invalid code: ${pasteValue}. Code must be six digits`)
108
- event.preventDefault()
80
+ if (event.key.match(/[0-9]/)) {
81
+ const code = modelValue.slice(0, cursorIndex.value)
82
+ + event.key + modelValue.slice(cursorIndex.value + 1)
83
+ emitUpdateModelValue(code)
84
+ cursorIndex.value = Math.min(cursorIndex.value + 1, 5)
85
+ } else if (event.key === 'ArrowLeft') {
86
+ cursorIndex.value = Math.max(cursorIndex.value - 1, 0)
87
+ } else if (event.key === 'ArrowRight') {
88
+ cursorIndex.value = Math.min(cursorIndex.value + 1, 5)
89
+ } else if (event.key === 'Backspace') {
90
+ if (modelValue[cursorIndex.value]) {
91
+ const code = (
92
+ modelValue.slice(0, cursorIndex.value) + ' ' + modelValue.slice(cursorIndex.value + 1)
93
+ ).trimEnd()
94
+ emitUpdateModelValue(code)
109
95
  }
96
+ cursorIndex.value = Math.min(Math.max(cursorIndex.value - 1, 0), modelValue.length)
97
+ } else if (event.key === 'Enter') {
98
+ emitSubmit()
110
99
  }
100
+ }
111
101
 
112
- @Emit('submit')
113
- emitSubmit () {
114
- return true
102
+ const handleClick = (event: MouseEvent) => {
103
+ const selectionEnd = (event.target as HTMLInputElement)?.selectionEnd
104
+ if (selectionEnd !== null) {
105
+ cursorIndex.value = selectionEnd
115
106
  }
107
+ }
116
108
 
117
- @Emit('error')
118
- emitError (errorMessage: string) {
119
- return errorMessage
109
+ const handlePaste = (event: ClipboardEvent) => {
110
+ emitError('')
111
+ const pasteValue = event.clipboardData?.getData('text')
112
+ if (pasteValue && typeof Number(pasteValue) === 'number' && pasteValue.length === 6) {
113
+ emitUpdateModelValue('')
114
+ cursorIndex.value = Math.min(pasteValue.length, 5)
115
+ } else if (pasteValue) {
116
+ emitError(`Invalid code: ${pasteValue}. Code must be six digits`)
117
+ event.preventDefault()
120
118
  }
119
+ }
121
120
 
122
- @Emit('update:modelValue')
123
- emitUpdateModelValue (code: string) {
124
- return code
125
- }
121
+ const emitSubmit = () => {
122
+ emit('submit')
123
+ }
124
+
125
+ const emitError = (errorMessage: string) => {
126
+ emit('error', errorMessage)
127
+ }
128
+
129
+ const emitUpdateModelValue = (code: string) => {
130
+ emit('update:modelValue', code)
126
131
  }
127
132
  </script>
128
133
 
@@ -188,4 +193,4 @@ export default class MagicCodeEntry extends Vue {
188
193
  }
189
194
  }
190
195
  }
191
- </style>
196
+ </style>
@@ -15,7 +15,7 @@
15
15
  <Icon
16
16
  type="paginationArrow"
17
17
  class="uikit-question-review-pagination__previous-icon"
18
- />
18
+ />
19
19
  </div>
20
20
  <span class="uikit-question-review-pagination__info">
21
21
  {{ currentPage + 1 }} / {{ total }} <slot />
@@ -35,7 +35,7 @@
35
35
  <Icon
36
36
  type="paginationArrow"
37
37
  class="uikit-question-review-pagination__next-icon"
38
- />
38
+ />
39
39
  </div>
40
40
  </div>
41
41
  </template>
@@ -119,4 +119,4 @@ const changePage = (direction: 'next' | 'previous') => {
119
119
  height: 24px;
120
120
  }
121
121
  }
122
- </style>
122
+ </style>
@@ -1,9 +1,9 @@
1
1
  <template>
2
- <div
2
+ <div
3
3
  v-dark="isDarkMode"
4
4
  class="uikit-table-pagination"
5
5
  >
6
- <div
6
+ <div
7
7
  ref="pagination_info"
8
8
  v-dark="isDarkMode"
9
9
  class="uikit-table-pagination__info"
@@ -70,52 +70,55 @@
70
70
  </div>
71
71
  </template>
72
72
 
73
- <script lang="ts">
74
- import { Vue, Component, Prop, Emit } from 'vue-facing-decorator'
73
+ <script setup lang="ts">
75
74
  import Icon from '../Icons/Icon.vue'
76
- import { dark } from '../../directives'
77
-
78
- @Component({
79
- components: {
80
- Icon,
81
- },
82
- directives: {
83
- dark,
84
- },
75
+ import { dark as vDark } from '../../directives'
76
+ import { computed, useTemplateRef } from 'vue'
77
+
78
+ const {
79
+ perPage = 10,
80
+ currentPage = 0,
81
+ total,
82
+ unit,
83
+ isDarkMode = false,
84
+ showFirstAndLastBtn = false,
85
+ } = defineProps<{
86
+ perPage?: number
87
+ currentPage?: number
88
+ total: number
89
+ unit: string
90
+ isDarkMode?: boolean
91
+ showFirstAndLastBtn?: boolean
92
+ }>()
93
+
94
+ const emit = defineEmits<{
95
+ 'changePage': [pageNum: number]
96
+ }>()
97
+
98
+ const paginationInfoRef = useTemplateRef<HTMLElement>('pagination_info')
99
+
100
+ const nextPageDisabled = computed(() => {
101
+ return currentPage >= Math.floor((total - 1) / perPage)
85
102
  })
86
- export default class TablePagination extends Vue {
87
- @Prop({ default: 10 }) perPage!: number
88
- @Prop({ default: 0 }) currentPage!: number
89
- @Prop() total!: number
90
- @Prop() unit!: string
91
- @Prop({ default: false }) isDarkMode!: boolean
92
- @Prop({ default: false }) showFirstAndLastBtn!: boolean
93
-
94
- get nextPageDisabled () {
95
- return this.currentPage >= Math.floor((this.total - 1) / this.perPage)
96
- }
97
103
 
98
- get showAdvancedPagination () {
99
- if (!this.showFirstAndLastBtn) {
100
- return false
101
- } else {
102
- return Math.floor((this.total - 1) / this.perPage) >= 3
103
- }
104
+ const showAdvancedPagination = computed(() => {
105
+ if (!showFirstAndLastBtn) {
106
+ return false
107
+ } else {
108
+ return Math.floor((total - 1) / perPage) >= 3
104
109
  }
110
+ })
105
111
 
106
- @Emit('changePage')
107
- changePage (direction: 'next' | 'previous' | 'first' | 'last') {
108
- const paginationInfo = this.$refs['pagination_info'] as HTMLElement
109
- paginationInfo.focus()
110
- if (direction === 'next') {
111
- return this.nextPageDisabled ? this.currentPage : this.currentPage + 1
112
- } else if (direction === 'first') {
113
- return 0
114
- } else if (direction === 'last') {
115
- return Math.floor((this.total - 1) / this.perPage)
116
- } else {
117
- return Math.max(0, this.currentPage - 1)
118
- }
112
+ const changePage = (direction: 'next' | 'previous' | 'first' | 'last') => {
113
+ paginationInfoRef.value?.focus()
114
+ if (direction === 'next') {
115
+ emit('changePage', nextPageDisabled.value ? currentPage : currentPage + 1)
116
+ } else if (direction === 'first') {
117
+ emit('changePage', 0)
118
+ } else if (direction === 'last') {
119
+ emit('changePage', Math.floor((total - 1) / perPage))
120
+ } else {
121
+ emit('changePage', Math.max(0, currentPage - 1))
119
122
  }
120
123
  }
121
124
  </script>
@@ -234,4 +237,4 @@ export default class TablePagination extends Vue {
234
237
  }
235
238
  }
236
239
  }
237
- </style>
240
+ </style>
@@ -12,8 +12,7 @@
12
12
  <img v-else-if="bundleId === 'k9T5L3kC0U'" :src="urls.PhonePersonProfessional">
13
13
  </template>
14
14
 
15
- <script lang="ts">
16
- import { Component, Vue, Prop } from 'vue-facing-decorator'
15
+ <script setup lang="ts">
17
16
  import type { TBundleIds } from './phonePerson'
18
17
  import PhonePersonBehavioralHealth from './phoneperson-behavioralhealth@2x.png'
19
18
  import PhonePersonEMT from './phoneperson-emt@2x.png'
@@ -27,22 +26,23 @@ import PhonePersonNursingSchool from './phoneperson-nursingschool@2x.png'
27
26
  import PhonePersonProfessional from './phoneperson-professional@2x.png'
28
27
  import PhonePersonSkilledTrades from './phoneperson-skilledtrades@2x.png'
29
28
 
30
- @Component
31
- export default class PhonePerson extends Vue {
32
- @Prop({ default: 'mO5EIsoZ9H' }) bundleId!: TBundleIds
29
+ const {
30
+ bundleId = 'mO5EIsoZ9H',
31
+ } = defineProps<{
32
+ bundleId?: TBundleIds
33
+ }>()
33
34
 
34
- urls = {
35
- PhonePersonBehavioralHealth,
36
- PhonePersonEMT,
37
- PhonePersonEssentials,
38
- PhonePersonFinance,
39
- PhonePersonFitness,
40
- PhonePersonIT,
41
- PhonePersonMedical,
42
- PhonePersonNursing,
43
- PhonePersonNursingSchool,
44
- PhonePersonProfessional,
45
- PhonePersonSkilledTrades,
46
- }
35
+ const urls = {
36
+ PhonePersonBehavioralHealth,
37
+ PhonePersonEMT,
38
+ PhonePersonEssentials,
39
+ PhonePersonFinance,
40
+ PhonePersonFitness,
41
+ PhonePersonIT,
42
+ PhonePersonMedical,
43
+ PhonePersonNursing,
44
+ PhonePersonNursingSchool,
45
+ PhonePersonProfessional,
46
+ PhonePersonSkilledTrades,
47
47
  }
48
48
  </script>
@@ -1,4 +1,4 @@
1
- export type TBundleIds =
1
+ export type TBundleIds =
2
2
  'mO5EIsoZ9H'
3
3
  | 'uKLwvbsbPV'
4
4
  | 'gAlCkoUVLl'
@@ -16,11 +16,11 @@
16
16
  >
17
17
  <Tooltip
18
18
  v-if="showFlagTooltip && enableFlagTooltip && !disabled"
19
- :key="isFlagged"
19
+ :key="String(isFlagged)"
20
20
  class="uikit-flag-toggle__tooltip"
21
21
  :styles="{
22
- backgroundColor: brandColors.grayDivider,
23
- color: brandColors.brandBlack,
22
+ backgroundColor: BrandColors.grayDivider || 'gray',
23
+ color: BrandColors.brandBlack || 'black',
24
24
  }"
25
25
  >
26
26
  {{ isFlagged ? 'Unflag' : 'Flag' }}
@@ -36,59 +36,60 @@
36
36
  </div>
37
37
  </template>
38
38
 
39
- <script lang="ts">
40
- import { Component, Emit, Prop, Vue } from 'vue-facing-decorator'
39
+ <script setup lang="ts">
41
40
  import Tooltip from '../Tooltips/Tooltip.vue'
42
41
  import Icon from '../Icons/Icon.vue'
43
42
  import BrandColors from '../../pocketprep-export.module.scss'
43
+ import { onBeforeUnmount, onMounted, ref } from 'vue'
44
+
45
+ const {
46
+ isFlagged = false,
47
+ enableFlagKeyboardShortcut = false,
48
+ enableFlagTooltip = true,
49
+ disabled = false,
50
+ } = defineProps<{
51
+ isFlagged?: boolean
52
+ enableFlagKeyboardShortcut?: boolean
53
+ enableFlagTooltip?: boolean
54
+ disabled?: boolean
55
+ }>()
56
+
57
+ const emit = defineEmits<{
58
+ 'toggleFlag': [isFlagged: boolean]
59
+ }>()
60
+
61
+ const showFlagTooltip = ref(false)
62
+
63
+ onMounted(() => {
64
+ if (enableFlagKeyboardShortcut) {
65
+ window.addEventListener('keydown', keydownListener)
66
+ }
67
+ })
44
68
 
45
- @Component({
46
- components: {
47
- Tooltip,
48
- Icon,
49
- },
69
+ onBeforeUnmount(() => {
70
+ window.removeEventListener('keydown', keydownListener)
50
71
  })
51
- export default class FlagToggle extends Vue {
52
- @Prop() isFlagged!: boolean
53
- @Prop({ default: false }) enableFlagKeyboardShortcut!: boolean
54
- @Prop({ default: true }) enableFlagTooltip!: boolean
55
- @Prop({ default: false }) disabled!: boolean
56
-
57
- brandColors = BrandColors
58
- showFlagTooltip = false
59
-
60
- mounted () {
61
- if (this.enableFlagKeyboardShortcut) {
62
- window.addEventListener('keydown', this.keydownListener)
63
- }
64
- }
65
72
 
66
- beforeUnmount () {
67
- window.removeEventListener('keydown', this.keydownListener)
73
+ const keydownListener = (e: KeyboardEvent) => {
74
+ if (disabled) {
75
+ return
68
76
  }
69
77
 
70
- keydownListener (e: KeyboardEvent) {
71
- if (this.disabled) {
72
- return
73
- }
74
-
75
- if (e.code === 'KeyP') {
76
- this.emitToggleFlag(!this.isFlagged)
77
- }
78
+ if (e.code === 'KeyP') {
79
+ emitToggleFlag(!isFlagged)
78
80
  }
81
+ }
79
82
 
80
- toggleFlag () {
81
- if (this.disabled) {
82
- return
83
- }
84
-
85
- this.emitToggleFlag(!this.isFlagged)
83
+ const toggleFlag = () => {
84
+ if (disabled) {
85
+ return
86
86
  }
87
87
 
88
- @Emit('toggleFlag')
89
- emitToggleFlag (isFlagged: boolean) {
90
- return isFlagged
91
- }
88
+ emitToggleFlag(!isFlagged)
89
+ }
90
+
91
+ const emitToggleFlag = (newIsFlagged: boolean) => {
92
+ emit('toggleFlag', newIsFlagged)
92
93
  }
93
94
  </script>
94
95
 
@@ -16,11 +16,11 @@
16
16
  >
17
17
  <Tooltip
18
18
  v-if="!disabled && showGlobalMetricsToolTip"
19
- :key="showGlobalMetrics"
19
+ :key="String(showGlobalMetrics)"
20
20
  :theme="tooltipTheme"
21
21
  :styles="{
22
- backgroundColor: brandColors.grayDivider,
23
- color: brandColors.brandBlack,
22
+ backgroundColor: BrandColors.grayDivider || 'gray',
23
+ color: BrandColors.brandBlack || 'black',
24
24
  ...customTooltipStyles,
25
25
  }"
26
26
  :is-dark-mode="isDarkMode"
@@ -40,37 +40,38 @@
40
40
  </div>
41
41
  </template>
42
42
 
43
- <script lang="ts">
44
- import { Component, Emit, Prop, Vue } from 'vue-facing-decorator'
43
+ <script setup lang="ts">
45
44
  import Tooltip from '../Tooltips/Tooltip.vue'
46
45
  import Icon from '../Icons/Icon.vue'
47
46
  import BrandColors from '../../pocketprep-export.module.scss'
47
+ import { ref } from 'vue'
48
48
 
49
- @Component({
50
- name: 'GlobalMetricsToggle',
51
- components: {
52
- Tooltip,
53
- Icon,
54
- },
55
- })
56
- export default class GlobalMetricsToggle extends Vue {
57
- @Prop() showGlobalMetrics!: boolean
58
- @Prop({ default: false }) disabled!: boolean
59
- @Prop() customTooltipStyles!: { [key: string]: unknown }
60
- @Prop() tooltipTheme!: 'leftalign' | 'rightalign'
61
- @Prop({ default: false }) isDarkMode!: boolean
49
+ const {
50
+ showGlobalMetrics,
51
+ disabled = false,
52
+ customTooltipStyles = {},
53
+ tooltipTheme = '',
54
+ isDarkMode = false,
55
+ } = defineProps<{
56
+ showGlobalMetrics?: boolean
57
+ disabled?: boolean
58
+ customTooltipStyles?: Record<string, unknown>
59
+ tooltipTheme?: 'leftalign' | 'rightalign' | ''
60
+ isDarkMode?: boolean
61
+ }>()
62
62
 
63
- brandColors = BrandColors
64
- showGlobalMetricsToolTip = false
63
+ const emit = defineEmits<{
64
+ 'toggleGlobalMetrics': [showGlobalMetrics: boolean]
65
+ }>()
65
66
 
66
- toggleGlobalMetrics () {
67
- this.emitToggleGlobalMetrics(!this.showGlobalMetrics)
68
- }
67
+ const showGlobalMetricsToolTip = ref(false)
69
68
 
70
- @Emit('toggleGlobalMetrics')
71
- emitToggleGlobalMetrics (showGlobalMetrics: boolean) {
72
- return showGlobalMetrics
73
- }
69
+ const toggleGlobalMetrics = () => {
70
+ emitToggleGlobalMetrics(!showGlobalMetrics)
71
+ }
72
+
73
+ const emitToggleGlobalMetrics = (newShowGlobalMetrics: boolean) => {
74
+ emit('toggleGlobalMetrics', newShowGlobalMetrics)
74
75
  }
75
76
  </script>
76
77
 
@@ -124,4 +125,4 @@ export default class GlobalMetricsToggle extends Vue {
124
125
  }
125
126
  }
126
127
  }
127
- </style>
128
+ </style>
@@ -24,8 +24,8 @@
24
24
  v-if="showKeyboardTooltip"
25
25
  :theme="tooltipTheme"
26
26
  :styles="{
27
- backgroundColor: brandColors.grayDivider,
28
- color: brandColors.brandBlack,
27
+ ...(BrandColors.grayDivider && { backgroundColor: BrandColors.grayDivider}),
28
+ ...(BrandColors.brandBlack && { color: BrandColors.brandBlack }),
29
29
  }"
30
30
  >
31
31
  Keyboard Shortcuts
@@ -38,33 +38,26 @@
38
38
  </div>
39
39
  </template>
40
40
 
41
- <script lang="ts">
42
- import { Component, Prop, Vue } from 'vue-facing-decorator'
43
- import KeyboardShortcutsModal from '../Quiz/KeyboardShortcutsModal.vue'
41
+ <script setup lang="ts">
44
42
  import Tooltip from '../Tooltips/Tooltip.vue'
45
43
  import Icon from '../Icons/Icon.vue'
46
44
  import BrandColors from '../../pocketprep-export.module.scss'
45
+ import { ref } from 'vue'
47
46
 
48
- @Component({
49
- components: {
50
- KeyboardShortcutsModal,
51
- Tooltip,
52
- Icon,
53
- },
54
- })
55
- export default class KeyboardShortcutsButton extends Vue {
56
- @Prop() tooltipTheme!: 'leftalign' | 'rightalign'
57
- @Prop({ default: false }) isDarkMode!: boolean
58
- @Prop() disabled?: boolean
47
+ const {
48
+ tooltipTheme = '',
49
+ disabled = false,
50
+ } = defineProps<{
51
+ tooltipTheme?: 'leftalign' | 'rightalign'
52
+ disabled?: boolean
53
+ }>()
59
54
 
60
- brandColors = BrandColors
61
- showKeyboardTooltip = false
62
- showKeyboardShortcutsModal = false
55
+ const showKeyboardTooltip = ref(false)
56
+ const showKeyboardShortcutsModal = ref(false)
63
57
 
64
- toggleShowModal () {
65
- if (!this.disabled) {
66
- this.showKeyboardShortcutsModal = !this.showKeyboardShortcutsModal
67
- }
58
+ const toggleShowModal = () => {
59
+ if (!disabled) {
60
+ showKeyboardShortcutsModal.value = !showKeyboardShortcutsModal.value
68
61
  }
69
62
  }
70
63
  </script>