@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
@@ -0,0 +1,81 @@
1
+ import Highcharts from 'highcharts'
2
+ import Accessibility from 'highcharts/modules/accessibility'
3
+
4
+ type TCustomSeries = Highcharts.Series & {
5
+ options: {
6
+ borderRadiusTopLeft: number
7
+ borderRadiusTopRight: number
8
+ borderRadiusBottomRight: number
9
+ borderRadiusBottomLeft: number
10
+ }
11
+ }
12
+
13
+ type TShapeArgs = {
14
+ d?: Highcharts.SVGPathArray
15
+ width?: number
16
+ height?: number
17
+ x?: number
18
+ y?: number
19
+ }
20
+
21
+ type TCustomPoint = Highcharts.Point & {
22
+ shapeArgs: TShapeArgs
23
+ shapeType: string
24
+ dlBox: TShapeArgs
25
+ }
26
+
27
+ type TCustomHighcharts = typeof Highcharts & {
28
+ seriesTypes: {
29
+ column: {
30
+ prototype: Record<string, unknown>
31
+ }
32
+ }
33
+ }
34
+
35
+ Accessibility(Highcharts);
36
+ (function (H) {
37
+ H.wrap((H.seriesTypes.column.prototype), 'translate', function (this: TCustomSeries, proceed: () => void) {
38
+ const options = this.options
39
+
40
+ proceed.call(this);
41
+
42
+ (this.points as TCustomPoint[]).forEach(function (point) {
43
+ if (options.borderRadiusTopLeft || options.borderRadiusTopRight) {
44
+ const w = Number(point.shapeArgs.width)
45
+ const h = Number(point.shapeArgs.height)
46
+ const x = Number(point.shapeArgs.x)
47
+ const y = Number(point.shapeArgs.y)
48
+ const maxR = Math.min(w, h) / 2
49
+
50
+ let radiusTopLeft = H.relativeLength(options.borderRadiusTopLeft || 0, w)
51
+ let radiusTopRight = H.relativeLength(options.borderRadiusTopRight || 0, w)
52
+
53
+
54
+ radiusTopLeft = radiusTopLeft > maxR ? maxR : radiusTopLeft
55
+ radiusTopRight = radiusTopRight > maxR ? maxR : radiusTopRight
56
+
57
+ point.dlBox = point.shapeArgs
58
+
59
+ point.shapeType = 'path'
60
+ /* eslint-disable @stylistic/array-element-newline */
61
+ const d = [
62
+ 'M', x + radiusTopLeft, y,
63
+ 'L', x + w - radiusTopRight, y,
64
+ 'C', x + w - (radiusTopRight / 2), y, x + w, y + (radiusTopRight / 2), x + w, y + radiusTopRight,
65
+ 'L', x + w, y + h,
66
+ 'C', x + w, y + h, x + w, y + h, x + w, y + h,
67
+ 'L', x, y + h,
68
+ 'C', x, y + h, x, y + h, x, y + h,
69
+ 'L', x, y + radiusTopLeft,
70
+ 'C', x, y + (radiusTopLeft / 2), x + (radiusTopLeft / 2), y, x + radiusTopLeft, y,
71
+ 'Z',
72
+ ] as unknown as Highcharts.SVGPathArray
73
+ /* eslint-enable */
74
+ point.shapeArgs = {
75
+ d,
76
+ }
77
+ }
78
+
79
+ })
80
+ })
81
+ }(Highcharts as TCustomHighcharts))
@@ -23,36 +23,38 @@
23
23
  </div>
24
24
  </template>
25
25
 
26
- <script lang="ts">
27
- import { Component, Vue, Prop, Emit } from 'vue-facing-decorator'
26
+ <script setup lang="ts">
27
+ import { onBeforeMount, ref } from 'vue'
28
28
 
29
- /**
30
- * @see [Designs for Controls](https://marvelapp.com/adf8ab3/screen/69484212)
31
- */
32
- @Component
33
- export default class SegmentControl extends Vue {
34
- @Prop({ default: 'Option 1' }) option1!: string
35
- @Prop({ default: 'Option 2' }) option2!: string
36
- @Prop({ default: 1 }) defaultOption!: number
29
+ const {
30
+ option1 = 'Option 1',
31
+ option2 = 'Option 2',
32
+ defaultOption = 1,
33
+ } = defineProps<{
34
+ option1?: string
35
+ option2?: string
36
+ defaultOption?: number
37
+ }>()
37
38
 
38
- activeOption = 1
39
+ const emit = defineEmits<{
40
+ 'change': [option: number]
41
+ }>()
39
42
 
40
- @Emit('change')
41
- toggleOption () {
42
- this.activeOption = this.activeOption === 2 ? 1 : 2
43
- return this.activeOption
44
- }
43
+ const activeOption = ref(1)
45
44
 
46
- @Emit('change')
47
- optionClicked (option: number) {
48
- this.activeOption = option
49
- return option
50
- }
45
+ const toggleOption = () => {
46
+ activeOption.value = activeOption.value === 2 ? 1 : 2
47
+ emit('change', activeOption.value)
48
+ }
51
49
 
52
- created () {
53
- this.activeOption = this.defaultOption
54
- }
50
+ const optionClicked = (option: number) => {
51
+ activeOption.value = option
52
+ emit('change', option)
55
53
  }
54
+
55
+ onBeforeMount(() => {
56
+ activeOption.value = defaultOption
57
+ })
56
58
  </script>
57
59
 
58
60
  <style lang="scss">
@@ -39,61 +39,65 @@
39
39
  </div>
40
40
  </template>
41
41
 
42
- <script lang="ts">
43
- import { Vue, Component, Prop, Watch, Emit } from 'vue-facing-decorator'
44
- import { dark } from '../../directives'
45
-
46
- @Component({
47
- directives: {
48
- dark,
49
- },
42
+ <script setup lang="ts">
43
+ import { computed, onMounted, ref, watch } from 'vue'
44
+ import { dark as vDark } from '../../directives'
45
+
46
+ const {
47
+ min = 0,
48
+ max,
49
+ step = 1,
50
+ modelValue,
51
+ size = 'large',
52
+ isDarkMode = false,
53
+ inputId = null,
54
+ disabled = false,
55
+ } = defineProps<{
56
+ min?: number
57
+ max: number
58
+ step?: number
59
+ modelValue: number
60
+ size?: 'small' | 'large'
61
+ isDarkMode?: boolean
62
+ inputId?: string | null
63
+ disabled?: boolean
64
+ }>()
65
+
66
+ const emit = defineEmits<{
67
+ 'update:modelValue': [sliderValue: number]
68
+ }>()
69
+
70
+ const sliderValue = ref(0)
71
+
72
+ const filledWidth = computed(() => {
73
+ return ((modelValue - min) / (max - min)) * 100
74
+ })
75
+
76
+ onMounted(() => {
77
+ sliderValue.value = modelValue
78
+ sliderValueChanged()
50
79
  })
51
- export default class Slider extends Vue {
52
- @Prop({ default: 0 }) min!: number
53
- @Prop() max!: number
54
- @Prop({ default: 1 }) step!: number
55
- @Prop() modelValue!: number
56
- @Prop({ default: 'large' }) size!: 'small' | 'large'
57
- @Prop({ default: false }) isDarkMode!: boolean
58
- @Prop({ default: null }) inputId!: string | null
59
- @Prop({ default: false }) disabled!: boolean
60
-
61
- sliderValue = 0
62
-
63
- get filledWidth () {
64
- return ((this.modelValue - this.min) / (this.max - this.min)) * 100
65
- }
66
80
 
67
- mounted () {
68
- this.sliderValue = this.modelValue
69
- this.sliderValueChanged()
81
+ const sliderValueChanged = () => {
82
+ if (sliderValue.value % step !== 0) {
83
+ sliderValue.value = Math.round(sliderValue.value / step) * step || 0
70
84
  }
71
85
 
72
- @Watch('modelValue')
73
- valueChanged () {
74
- this.sliderValue = this.modelValue
86
+ if (sliderValue.value > max) {
87
+ sliderValue.value = max
88
+ } else if (sliderValue.value < min) {
89
+ sliderValue.value = min
75
90
  }
76
91
 
77
- @Watch('sliderValue')
78
- sliderValueChanged () {
79
- if (this.sliderValue % this.step !== 0) {
80
- this.sliderValue = Math.round(this.sliderValue / this.step) * this.step || 0
81
- }
92
+ emit('update:modelValue', sliderValue.value)
93
+ }
82
94
 
83
- if (this.sliderValue > this.max) {
84
- this.sliderValue = this.max
85
- } else if (this.sliderValue < this.min) {
86
- this.sliderValue = this.min
87
- }
95
+ watch(() => modelValue, () => {
96
+ sliderValue.value = modelValue
97
+ })
88
98
 
89
- this.emitUpdateModelValue(this.sliderValue)
90
- }
99
+ watch(sliderValue, sliderValueChanged)
91
100
 
92
- @Emit('update:modelValue')
93
- emitUpdateModelValue (sliderValue: number) {
94
- return sliderValue
95
- }
96
- }
97
101
  </script>
98
102
  <style lang="scss">
99
103
  @use '@/styles/colors' as *;
@@ -420,4 +424,4 @@ export default class Slider extends Vue {
420
424
  }
421
425
  }
422
426
  }
423
- </style>
427
+ </style>
@@ -2,10 +2,10 @@
2
2
  <div
3
3
  v-dark="isDarkMode"
4
4
  class="uikit-toggle-switch"
5
- :class="{
6
- 'uikit-toggle-switch--enabled': modelValue,
5
+ :class="{
6
+ 'uikit-toggle-switch--enabled': modelValue,
7
7
  'uikit-toggle-switch--disabled': disabled,
8
- [`uikit-toggle-switch--${size}`]: true
8
+ [`uikit-toggle-switch--${size}`]: true
9
9
  }"
10
10
  tabindex="0"
11
11
  role="checkbox"
@@ -16,9 +16,9 @@
16
16
  @click="!disabled && toggleOption()"
17
17
  >
18
18
  <div
19
- v-dark="isDarkMode"
20
- class="uikit-toggle-switch__handle"
21
- :class="{
19
+ v-dark="isDarkMode"
20
+ class="uikit-toggle-switch__handle"
21
+ :class="{
22
22
  [`uikit-toggle-switch__handle--${size}`]: true,
23
23
  [`uikit-toggle-switch__handle--${size}--enabled`]: modelValue,
24
24
  'uikit-toggle-switch__handle--enabled': modelValue,
@@ -27,25 +27,27 @@
27
27
  </div>
28
28
  </template>
29
29
 
30
- <script lang="ts">
31
- import { Component, Vue, Prop, Emit } from 'vue-facing-decorator'
32
- import { dark } from '../../directives'
33
-
34
- @Component({
35
- directives: {
36
- dark,
37
- },
38
- })
39
- export default class ToggleSwitch extends Vue {
40
- @Prop({ default: false }) modelValue!: boolean
41
- @Prop({ default: false }) isDarkMode!: boolean
42
- @Prop({ default: false }) disabled!: boolean
43
- @Prop({ default: 'small' }) size!: 'small' | 'large'
44
-
45
- @Emit('update:modelValue')
46
- toggleOption () {
47
- return !this.modelValue
48
- }
30
+ <script setup lang="ts">
31
+ import { dark as vDark } from '../../directives'
32
+
33
+ const {
34
+ modelValue,
35
+ isDarkMode = false,
36
+ disabled = false,
37
+ size = 'small',
38
+ } = defineProps<{
39
+ modelValue: boolean
40
+ isDarkMode?: boolean
41
+ disabled?: boolean
42
+ size?: 'small' | 'large'
43
+ }>()
44
+
45
+ const emit = defineEmits<{
46
+ 'update:modelValue': [val: boolean]
47
+ }>()
48
+
49
+ const toggleOption = () => {
50
+ emit('update:modelValue', !modelValue)
49
51
  }
50
52
  </script>
51
53
 
@@ -128,9 +130,9 @@ export default class ToggleSwitch extends Vue {
128
130
 
129
131
  &__handle {
130
132
  background-color: $white;
131
- border: 0.5px solid rgba(0, 0, 0, 0.04);
133
+ border: 0.5px solid rgb(0, 0, 0, 0.04);
132
134
  border-radius: 100px;
133
- box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.1);
135
+ box-shadow: 0 2px 6px 0 rgb(0, 0, 0, 0.1);
134
136
  width: 16px;
135
137
  height: 16px;
136
138
  position: absolute;
@@ -141,16 +143,16 @@ export default class ToggleSwitch extends Vue {
141
143
 
142
144
  &--dark {
143
145
  background: $charcoal;
144
- box-shadow: 0 3px 8px 0 rgba(0, 0, 0, 0.1);
146
+ box-shadow: 0 3px 8px 0 rgb(0, 0, 0, 0.1);
145
147
  }
146
148
 
147
149
  &--enabled {
148
- box-shadow: 0 2px 1px 0 rgba(0, 0, 0, 0.1), 0 2px 6px 0 rgba(0, 0, 0, 0.15);
150
+ box-shadow: 0 2px 1px 0 rgb(0, 0, 0, 0.1), 0 2px 6px 0 rgb(0, 0, 0, 0.15);
149
151
  left: 20px;
150
152
  transition: left 0.1s linear;
151
153
 
152
154
  &--dark {
153
- box-shadow: 0 3px 1px 0 rgba(0, 0, 0, 0.1), 0 3px 8px 0 rgba(0, 0, 0, 0.15);
155
+ box-shadow: 0 3px 1px 0 rgb(0, 0, 0, 0.1), 0 3px 8px 0 rgb(0, 0, 0, 0.15);
154
156
  }
155
157
  }
156
158
 
@@ -165,4 +167,4 @@ export default class ToggleSwitch extends Vue {
165
167
  }
166
168
  }
167
169
  }
168
- </style>
170
+ </style>
@@ -21,7 +21,7 @@
21
21
  class="uikit-empty-state__icon"
22
22
  :type="iconType"
23
23
  :style="{ color: iconColor }"
24
- :secondary-color="brandColors.bananaBread"
24
+ :secondary-color="BrandColors.bananaBread"
25
25
  />
26
26
  </slot>
27
27
  </slot>
@@ -40,88 +40,84 @@
40
40
  </div>
41
41
  </template>
42
42
 
43
- <script lang="ts">
44
- import { Vue, Component, Prop } from 'vue-facing-decorator'
43
+ <script setup lang="ts">
45
44
  import Icon from '../Icons/Icon.vue'
46
45
  import BrandColors from '../../pocketprep-export.module.scss'
47
46
  import Blob from '../Blobs/Blob.vue'
48
- import { dark } from '../../directives'
49
-
50
- @Component({
51
- name: 'EmptyState',
52
- components: {
53
- Icon,
54
- Blob,
55
- },
56
- directives: {
57
- dark,
58
- },
47
+ import { dark as vDark } from '../../directives'
48
+ import { computed } from 'vue'
49
+
50
+ const {
51
+ message = null,
52
+ title = null,
53
+ backgroundColor = null,
54
+ state = null,
55
+ isDarkMode = false,
56
+ customBlobColor = null,
57
+ customIconColor = null,
58
+ } = defineProps<{
59
+ message?: string
60
+ title?: string
61
+ backgroundColor?: 'white' | null
62
+ state?: 'answered' | 'incorrect' | 'correct' | 'flagged' | 'assignment' | null
63
+ isDarkMode?: boolean
64
+ customBlobColor?: string | null
65
+ customIconColor?: string | null
66
+ }>()
67
+
68
+ const iconType = computed(() => {
69
+ if (state === 'incorrect') {
70
+ return 'incorrect'
71
+ } else if (state === 'correct') {
72
+ return 'correct'
73
+ } else if (state === 'flagged') {
74
+ return 'flagFeedback'
75
+ } else if (state === 'assignment') {
76
+ return 'assignment'
77
+ }
78
+ // Default to activity icon
79
+ return 'activity'
59
80
  })
60
- export default class EmptyState extends Vue {
61
- @Prop() message!: string
62
- @Prop() title!: string
63
- @Prop() backgroundColor!: 'white'
64
- @Prop() state!: 'answered' | 'incorrect' | 'correct' | 'flagged' | 'assignment'
65
- @Prop({ default: false }) isDarkMode!: boolean
66
- @Prop() customBlobColor?: string
67
- @Prop() customIconColor?: string
68
-
69
- brandColors = BrandColors
70
-
71
- get iconType () {
72
- if (this.state === 'incorrect') {
73
- return 'incorrect'
74
- } else if (this.state === 'correct') {
75
- return 'correct'
76
- } else if (this.state === 'flagged') {
77
- return 'flagFeedback'
78
- } else if (this.state === 'assignment') {
79
- return 'assignment'
80
- }
81
- // Default to activity icon
82
- return 'activity'
81
+
82
+ const blobColor = computed(() => {
83
+ if (customBlobColor) {
84
+ return customBlobColor
85
+ }
86
+ if (isDarkMode) {
87
+ return BrandColors.moonlitOcean
83
88
  }
89
+ if (backgroundColor && backgroundColor === 'white') {
90
+ return BrandColors.white
91
+ } else if (state === 'incorrect') {
92
+ return BrandColors.barelyRed
93
+ } else if (state === 'correct') {
94
+ return BrandColors.barelyGreen
95
+ }
96
+ return BrandColors.manilla
97
+ })
84
98
 
85
- get blobColor () {
86
- if (this.customBlobColor) {
87
- return this.customBlobColor
88
- }
89
- if (this.isDarkMode) {
90
- return this.brandColors.moonlitOcean
99
+ const iconColor = computed(() => {
100
+ if (state === 'incorrect') {
101
+ if (isDarkMode) {
102
+ return BrandColors.rosa
91
103
  }
92
- if (this.backgroundColor && this.backgroundColor === 'white') {
93
- return this.brandColors.white
94
- } else if (this.state === 'incorrect') {
95
- return this.brandColors.barelyRed
96
- } else if (this.state === 'correct') {
97
- return this.brandColors.barelyGreen
104
+ return BrandColors.pepper
105
+ } else if (state === 'correct') {
106
+ if (isDarkMode) {
107
+ return BrandColors.jungleGreen
98
108
  }
99
- return this.brandColors.manilla
109
+ return BrandColors.cadaverous
100
110
  }
101
111
 
102
- get iconColor () {
103
- if (this.state === 'incorrect') {
104
- if (this.isDarkMode) {
105
- return this.brandColors.rosa
106
- }
107
- return this.brandColors.pepper
108
- } else if (this.state === 'correct') {
109
- if (this.isDarkMode) {
110
- return this.brandColors.jungleGreen
111
- }
112
- return this.brandColors.cadaverous
113
- }
114
-
115
- if (this.customIconColor) {
116
- return this.customIconColor
117
- }
118
- // Default to caramel
119
- if (this.isDarkMode) {
120
- return this.brandColors.butterscotch
121
- }
122
- return this.brandColors.caramel
112
+ if (customIconColor) {
113
+ return customIconColor
123
114
  }
124
- }
115
+ // Default to caramel
116
+ if (isDarkMode) {
117
+ return BrandColors.butterscotch
118
+ }
119
+ return BrandColors.caramel
120
+ })
125
121
  </script>
126
122
 
127
123
  <style lang="scss">
@@ -198,4 +194,4 @@ export default class EmptyState extends Vue {
198
194
  }
199
195
  }
200
196
  }
201
- </style>
197
+ </style>