@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.
- package/dist/@pocketprep/ui-kit.css +1 -1
- package/dist/@pocketprep/ui-kit.js +14469 -17731
- package/dist/@pocketprep/ui-kit.js.map +1 -1
- package/dist/@pocketprep/ui-kit.umd.cjs +19 -29
- package/dist/@pocketprep/ui-kit.umd.cjs.map +1 -1
- package/eslint.config.ts +38 -11
- package/lib/SVGDefinitions.vue +32 -35
- package/lib/components/Banners/Banner.vue +10 -14
- package/lib/components/Blobs/Blob.vue +6 -14
- package/lib/components/Blobs/BlobEmptyState.vue +9 -8
- package/lib/components/Blobs/blob.d.ts +1 -1
- package/lib/components/BundleIcons/BundleIcon.vue +36 -63
- package/lib/components/BundleIcons/bundleIcon.d.ts +1 -1
- package/lib/components/Bundles/BundleList.vue +71 -59
- package/lib/components/Bundles/BundleSearch.vue +93 -117
- package/lib/components/Bundles/PremiumPill.vue +6 -12
- package/lib/components/Buttons/Button.vue +32 -35
- package/lib/components/Buttons/Link.vue +32 -31
- package/lib/components/Buttons/Tab.vue +14 -17
- package/lib/components/Calendar/Calendar.vue +87 -85
- package/lib/components/Charts/Bar.vue +192 -263
- package/lib/components/Charts/Pie.vue +55 -61
- package/lib/components/Charts/highcharts-wrap.ts +81 -0
- package/lib/components/Controls/SegmentControl.vue +26 -24
- package/lib/components/Controls/Slider.vue +51 -47
- package/lib/components/Controls/ToggleSwitch.vue +33 -31
- package/lib/components/EmptyStates/EmptyState.vue +69 -73
- package/lib/components/Exams/ExamCard.vue +59 -47
- package/lib/components/Exams/ExamMenuCard.vue +30 -28
- package/lib/components/Filters/FilterDropdown.vue +83 -86
- package/lib/components/Filters/FilterOptions.vue +83 -88
- package/lib/components/Forms/Checkbox.vue +27 -27
- package/lib/components/Forms/CheckboxOption.vue +30 -30
- package/lib/components/Forms/Errors.vue +21 -24
- package/lib/components/Forms/Input.vue +71 -59
- package/lib/components/Forms/Radio.vue +2 -2
- package/lib/components/Forms/RadioButton.vue +8 -8
- package/lib/components/Forms/Select.vue +265 -257
- package/lib/components/Forms/Textarea.vue +49 -35
- package/lib/components/Icons/IconAccordionArrow.vue +7 -9
- package/lib/components/Icons/IconActivity.vue +7 -9
- package/lib/components/Icons/IconAdd.vue +7 -11
- package/lib/components/Icons/IconAddCircle.vue +7 -9
- package/lib/components/Icons/IconArrow.vue +7 -9
- package/lib/components/Icons/IconBarChart.vue +7 -9
- package/lib/components/Icons/IconCalendar.vue +7 -9
- package/lib/components/Icons/IconCalendarPicker.vue +7 -9
- package/lib/components/Icons/IconChat.vue +7 -9
- package/lib/components/Icons/IconCheck.vue +7 -9
- package/lib/components/Icons/IconClose.vue +7 -9
- package/lib/components/Icons/IconConcept.vue +1 -1
- package/lib/components/Icons/IconCorrect.vue +7 -9
- package/lib/components/Icons/IconEdit.vue +7 -11
- package/lib/components/Icons/IconExam.vue +7 -9
- package/lib/components/Icons/IconExternalLink.vue +7 -9
- package/lib/components/Icons/IconEyeHide.vue +7 -9
- package/lib/components/Icons/IconEyeShow.vue +7 -9
- package/lib/components/Icons/IconFilter.vue +7 -9
- package/lib/components/Icons/IconFilterActive.vue +7 -9
- package/lib/components/Icons/IconFlag.vue +7 -9
- package/lib/components/Icons/IconFlagContent.vue +8 -9
- package/lib/components/Icons/IconFlagFeedback.vue +8 -10
- package/lib/components/Icons/IconFlagFilled.vue +7 -9
- package/lib/components/Icons/IconFullView.vue +7 -9
- package/lib/components/Icons/IconFullViewActive.vue +7 -9
- package/lib/components/Icons/IconGridDrag.vue +2 -2
- package/lib/components/Icons/IconHandle.vue +7 -9
- package/lib/components/Icons/IconHeart.vue +7 -9
- package/lib/components/Icons/IconHelp.vue +7 -9
- package/lib/components/Icons/IconHighlight.vue +2 -2
- package/lib/components/Icons/IconHourglass.vue +7 -9
- package/lib/components/Icons/IconImage.vue +7 -9
- package/lib/components/Icons/IconIncorrect.vue +7 -9
- package/lib/components/Icons/IconInfo.vue +7 -9
- package/lib/components/Icons/IconKeyboard.vue +7 -9
- package/lib/components/Icons/IconLaunch.vue +7 -9
- package/lib/components/Icons/IconLevelUp.vue +7 -9
- package/lib/components/Icons/IconLightbulb.vue +7 -9
- package/lib/components/Icons/IconLightning.vue +7 -9
- package/lib/components/Icons/IconLink.vue +7 -9
- package/lib/components/Icons/IconList.vue +7 -9
- package/lib/components/Icons/IconLoading.vue +7 -9
- package/lib/components/Icons/IconLoading2.vue +11 -11
- package/lib/components/Icons/IconLock.vue +7 -9
- package/lib/components/Icons/IconMissedQuestions.vue +7 -9
- package/lib/components/Icons/IconMoon.vue +7 -9
- package/lib/components/Icons/IconPaginationArrow.vue +7 -9
- package/lib/components/Icons/IconPaginationArrowDouble.vue +7 -9
- package/lib/components/Icons/IconPassage.vue +7 -9
- package/lib/components/Icons/IconPencil.vue +7 -9
- package/lib/components/Icons/IconPeople.vue +7 -9
- package/lib/components/Icons/IconPercent.vue +7 -9
- package/lib/components/Icons/IconPerson.vue +8 -9
- package/lib/components/Icons/IconPresent.vue +7 -9
- package/lib/components/Icons/IconPreview.vue +7 -9
- package/lib/components/Icons/IconQuestions.vue +7 -9
- package/lib/components/Icons/IconQuick10.vue +7 -9
- package/lib/components/Icons/IconQuickActions.vue +2 -2
- package/lib/components/Icons/IconRecommendedFilter.vue +1 -1
- package/lib/components/Icons/IconRemoveCircle.vue +7 -9
- package/lib/components/Icons/IconReviewFlag.vue +7 -9
- package/lib/components/Icons/IconSearch.vue +7 -9
- package/lib/components/Icons/IconShare.vue +7 -9
- package/lib/components/Icons/IconSideBar.vue +7 -9
- package/lib/components/Icons/IconSideBarActive.vue +7 -9
- package/lib/components/Icons/IconStar.vue +1 -1
- package/lib/components/Icons/IconStopwatch.vue +7 -9
- package/lib/components/Icons/IconStrike.vue +7 -9
- package/lib/components/Icons/IconSubject.vue +7 -9
- package/lib/components/Icons/IconText.vue +7 -9
- package/lib/components/Icons/IconTimer.vue +8 -9
- package/lib/components/Icons/IconWarning.vue +7 -9
- package/lib/components/Icons/icon.d.ts +1 -1
- package/lib/components/Loaders/SkeletonLoader.vue +1 -5
- package/lib/components/Modal/Modal.vue +23 -29
- package/lib/components/Modal/ModalContainer.vue +135 -133
- package/lib/components/Onboarding/EmailAuth.vue +66 -70
- package/lib/components/Onboarding/MagicCodeEntry.vue +88 -83
- package/lib/components/Pagination/QuestionReviewPagination.vue +3 -3
- package/lib/components/Pagination/TablePagination.vue +47 -44
- package/lib/components/PhonePerson/PhonePerson.vue +18 -18
- package/lib/components/PhonePerson/phonePerson.d.ts +1 -1
- package/lib/components/Quiz/FlagToggle.vue +45 -44
- package/lib/components/Quiz/GlobalMetricsToggle.vue +29 -28
- package/lib/components/Quiz/KeyboardShortcutsButton.vue +16 -23
- package/lib/components/Quiz/KeyboardShortcutsModal.vue +36 -37
- package/lib/components/Quiz/Question/BuildListChoicesContainer.vue +65 -65
- package/lib/components/Quiz/Question/ChoicesContainer.vue +5 -5
- package/lib/components/Quiz/Question/DropdownExplanation.vue +5 -5
- package/lib/components/Quiz/Question/Explanation.vue +6 -6
- package/lib/components/Quiz/Question/MPMCChoicesContainer.vue +17 -17
- package/lib/components/Quiz/Question/MPMCRadioGroup.vue +2 -2
- package/lib/components/Quiz/Question/MatrixChoicesContainer.vue +39 -39
- package/lib/components/Quiz/Question/MatrixRadioGroup.vue +6 -6
- package/lib/components/Quiz/Question/MobileMatrixChoicesContainer.vue +27 -28
- package/lib/components/Quiz/Question/MobileMatrixRadioGroup.vue +2 -2
- package/lib/components/Quiz/Question/PassageAndImage.vue +3 -3
- package/lib/components/Quiz/Question/PassageAndImageDropdown.vue +7 -7
- package/lib/components/Quiz/Question/Paywall.vue +2 -2
- package/lib/components/Quiz/Question/QuestionContext.vue +1 -1
- package/lib/components/Quiz/Question/StatsSummary.vue +2 -2
- package/lib/components/Quiz/Question/Summary.vue +11 -11
- package/lib/components/Quiz/Question.vue +90 -82
- package/lib/components/Quiz/QuizContainer.vue +1 -1
- package/lib/components/Quiz/QuizProgressBar.vue +23 -23
- package/lib/components/Quiz/question.d.ts +3 -3
- package/lib/components/Search/Pill.vue +16 -19
- package/lib/components/Search/Search.vue +52 -47
- package/lib/components/SidePanels/SidePanel.vue +168 -174
- package/lib/components/Tables/Table.vue +135 -122
- package/lib/components/Tables/TableActions.vue +81 -76
- package/lib/components/Tables/table.d.ts +1 -1
- package/lib/components/Tags/Tag.vue +49 -39
- package/lib/components/Toasts/Toast.vue +44 -42
- package/lib/components/Tooltips/OverflowTooltip.vue +39 -45
- package/lib/components/Tooltips/Tooltip.vue +69 -70
- package/lib/directives.ts +4 -4
- package/lib/utils.ts +13 -12
- 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 {
|
|
26
|
+
<script setup lang="ts">
|
|
27
|
+
import { onBeforeMount, ref } from 'vue'
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
39
|
+
const emit = defineEmits<{
|
|
40
|
+
'change': [option: number]
|
|
41
|
+
}>()
|
|
39
42
|
|
|
40
|
-
|
|
41
|
-
toggleOption () {
|
|
42
|
-
this.activeOption = this.activeOption === 2 ? 1 : 2
|
|
43
|
-
return this.activeOption
|
|
44
|
-
}
|
|
43
|
+
const activeOption = ref(1)
|
|
45
44
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
45
|
+
const toggleOption = () => {
|
|
46
|
+
activeOption.value = activeOption.value === 2 ? 1 : 2
|
|
47
|
+
emit('change', activeOption.value)
|
|
48
|
+
}
|
|
51
49
|
|
|
52
|
-
|
|
53
|
-
|
|
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 {
|
|
44
|
-
import { dark } from '../../directives'
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
81
|
+
const sliderValueChanged = () => {
|
|
82
|
+
if (sliderValue.value % step !== 0) {
|
|
83
|
+
sliderValue.value = Math.round(sliderValue.value / step) * step || 0
|
|
70
84
|
}
|
|
71
85
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
86
|
+
if (sliderValue.value > max) {
|
|
87
|
+
sliderValue.value = max
|
|
88
|
+
} else if (sliderValue.value < min) {
|
|
89
|
+
sliderValue.value = min
|
|
75
90
|
}
|
|
76
91
|
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
this.sliderValue = this.min
|
|
87
|
-
}
|
|
95
|
+
watch(() => modelValue, () => {
|
|
96
|
+
sliderValue.value = modelValue
|
|
97
|
+
})
|
|
88
98
|
|
|
89
|
-
|
|
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 {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
|
133
|
+
border: 0.5px solid rgb(0, 0, 0, 0.04);
|
|
132
134
|
border-radius: 100px;
|
|
133
|
-
box-shadow: 0 2px 6px 0
|
|
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
|
|
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
|
|
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
|
|
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="
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
return
|
|
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
|
|
109
|
+
return BrandColors.cadaverous
|
|
100
110
|
}
|
|
101
111
|
|
|
102
|
-
|
|
103
|
-
|
|
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>
|