@pocketprep/ui-kit 2.0.40 → 3.0.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/{.eslintrc.js → .eslintrc.cjs} +16 -17
- package/dist/@pocketprep/ui-kit.js +18856 -0
- package/dist/@pocketprep/ui-kit.js.map +1 -0
- package/dist/@pocketprep/ui-kit.umd.cjs +28 -0
- package/dist/@pocketprep/ui-kit.umd.cjs.map +1 -0
- package/dist/style.css +1 -0
- package/lib/SVGDefinitions.vue +85 -0
- package/lib/assets/emojis/tada.png +0 -0
- package/lib/assets/halftones/halftone-black.png +0 -0
- package/lib/assets/halftones/halftone-blue.png +0 -0
- package/lib/assets/halftones/halftone-green.png +0 -0
- package/lib/assets/halftones/halftone-purple.png +0 -0
- package/lib/assets/halftones/halftone-red.png +0 -0
- package/lib/assets/halftones/halftone-yellow.png +0 -0
- package/lib/assets/question/paywall-dark.png +0 -0
- package/lib/assets/question/paywall-light.png +0 -0
- package/lib/components/Banners/Banner.md +41 -0
- package/lib/components/Banners/Banner.vue +87 -0
- package/lib/components/BundleIcons/AMTA.vue +134 -0
- package/lib/components/BundleIcons/BundleIcon.md +60 -0
- package/lib/components/BundleIcons/BundleIcon.vue +111 -0
- package/lib/components/Bundles/BundleList.md +63 -0
- package/lib/components/Bundles/BundleList.vue +170 -0
- package/lib/components/Bundles/BundleSearch.md +195 -0
- package/lib/components/Bundles/BundleSearch.vue +573 -0
- package/lib/components/Bundles/PremiumPill.md +23 -0
- package/lib/components/Bundles/PremiumPill.vue +43 -0
- package/lib/components/Buttons/Button.md +99 -0
- package/lib/components/Buttons/Button.vue +496 -0
- package/lib/components/Buttons/Link.md +58 -0
- package/lib/components/Buttons/Link.vue +192 -0
- package/lib/components/Buttons/Tab.md +35 -0
- package/lib/components/Buttons/Tab.vue +103 -0
- package/lib/components/Calendar/Calendar.md +18 -0
- package/lib/components/Calendar/Calendar.vue +162 -0
- package/lib/components/Charts/Bar.md +123 -0
- package/lib/components/Charts/Bar.vue +364 -0
- package/lib/components/Charts/Pie.md +23 -0
- package/lib/components/Charts/Pie.vue +105 -0
- package/lib/components/Controls/SegmentControl.md +47 -0
- package/lib/components/Controls/SegmentControl.vue +117 -0
- package/lib/components/Controls/Slider.md +67 -0
- package/lib/components/Controls/Slider.vue +358 -0
- package/lib/components/Controls/ToggleSwitch.md +56 -0
- package/lib/components/Controls/ToggleSwitch.vue +160 -0
- package/lib/components/Exams/ExamCard.md +45 -0
- package/lib/components/Exams/ExamCard.vue +257 -0
- package/lib/components/Exams/ExamMenuCard.md +90 -0
- package/lib/components/Exams/ExamMenuCard.vue +218 -0
- package/lib/components/Filters/FilterDropdown.md +59 -0
- package/lib/components/Filters/FilterDropdown.vue +176 -0
- package/lib/components/Filters/FilterOptions.md +65 -0
- package/lib/components/Filters/FilterOptions.vue +265 -0
- package/lib/components/Filters/filterOptions.d.ts +10 -0
- package/lib/components/Forms/Checkbox.md +52 -0
- package/lib/components/Forms/Checkbox.vue +184 -0
- package/lib/components/Forms/CheckboxOption.md +37 -0
- package/lib/components/Forms/CheckboxOption.vue +173 -0
- package/lib/components/Forms/Errors.md +23 -0
- package/lib/components/Forms/Errors.vue +109 -0
- package/lib/components/Forms/Input.md +63 -0
- package/lib/components/Forms/Input.vue +310 -0
- package/lib/components/Forms/Radio.md +66 -0
- package/lib/components/Forms/Radio.vue +312 -0
- package/lib/components/Forms/Select.md +133 -0
- package/lib/components/Forms/Select.vue +670 -0
- package/lib/components/Forms/Textarea.md +57 -0
- package/lib/components/Forms/Textarea.vue +157 -0
- package/lib/components/Icons/Icon.md +146 -0
- package/lib/components/Icons/Icon.vue +192 -0
- package/lib/components/Icons/IconAccordionArrow.md +7 -0
- package/lib/components/Icons/IconAccordionArrow.vue +23 -0
- package/lib/components/Icons/IconActivity.md +7 -0
- package/lib/components/Icons/IconActivity.vue +21 -0
- package/lib/components/Icons/IconAdd.md +7 -0
- package/lib/components/Icons/IconAdd.vue +19 -0
- package/lib/components/Icons/IconAddCircle.md +7 -0
- package/lib/components/Icons/IconAddCircle.vue +22 -0
- package/lib/components/Icons/IconArrow.md +7 -0
- package/lib/components/Icons/IconArrow.vue +21 -0
- package/lib/components/Icons/IconBarChart.md +7 -0
- package/lib/components/Icons/IconBarChart.vue +23 -0
- package/lib/components/Icons/IconCalendar.md +7 -0
- package/lib/components/Icons/IconCalendar.vue +19 -0
- package/lib/components/Icons/IconCheck.md +7 -0
- package/lib/components/Icons/IconCheck.vue +21 -0
- package/lib/components/Icons/IconClose.md +7 -0
- package/lib/components/Icons/IconClose.vue +23 -0
- package/lib/components/Icons/IconCorrect.md +7 -0
- package/lib/components/Icons/IconCorrect.vue +19 -0
- package/lib/components/Icons/IconEdit.md +7 -0
- package/lib/components/Icons/IconEdit.vue +21 -0
- package/lib/components/Icons/IconExam.md +7 -0
- package/lib/components/Icons/IconExam.vue +34 -0
- package/lib/components/Icons/IconExternalLink.md +7 -0
- package/lib/components/Icons/IconExternalLink.vue +30 -0
- package/lib/components/Icons/IconEyeHide.md +7 -0
- package/lib/components/Icons/IconEyeHide.vue +21 -0
- package/lib/components/Icons/IconEyeShow.md +7 -0
- package/lib/components/Icons/IconEyeShow.vue +21 -0
- package/lib/components/Icons/IconFilter.md +7 -0
- package/lib/components/Icons/IconFilter.vue +19 -0
- package/lib/components/Icons/IconFilterActive.md +7 -0
- package/lib/components/Icons/IconFilterActive.vue +20 -0
- package/lib/components/Icons/IconFlag.md +7 -0
- package/lib/components/Icons/IconFlag.vue +25 -0
- package/lib/components/Icons/IconFlagFeedback.md +11 -0
- package/lib/components/Icons/IconFlagFeedback.vue +24 -0
- package/lib/components/Icons/IconFlagFilled.md +7 -0
- package/lib/components/Icons/IconFlagFilled.vue +22 -0
- package/lib/components/Icons/IconFullView.md +7 -0
- package/lib/components/Icons/IconFullView.vue +30 -0
- package/lib/components/Icons/IconFullViewActive.md +7 -0
- package/lib/components/Icons/IconFullViewActive.vue +28 -0
- package/lib/components/Icons/IconHandle.md +7 -0
- package/lib/components/Icons/IconHandle.vue +23 -0
- package/lib/components/Icons/IconHeart.md +7 -0
- package/lib/components/Icons/IconHeart.vue +19 -0
- package/lib/components/Icons/IconHelp.md +7 -0
- package/lib/components/Icons/IconHelp.vue +25 -0
- package/lib/components/Icons/IconHourglass.md +7 -0
- package/lib/components/Icons/IconHourglass.vue +22 -0
- package/lib/components/Icons/IconImage.md +7 -0
- package/lib/components/Icons/IconImage.vue +21 -0
- package/lib/components/Icons/IconIncorrect.md +7 -0
- package/lib/components/Icons/IconIncorrect.vue +21 -0
- package/lib/components/Icons/IconInfo.md +7 -0
- package/lib/components/Icons/IconInfo.vue +24 -0
- package/lib/components/Icons/IconKeyboard.md +7 -0
- package/lib/components/Icons/IconKeyboard.vue +25 -0
- package/lib/components/Icons/IconLaunch.md +7 -0
- package/lib/components/Icons/IconLaunch.vue +25 -0
- package/lib/components/Icons/IconLightning.md +7 -0
- package/lib/components/Icons/IconLightning.vue +21 -0
- package/lib/components/Icons/IconList.md +7 -0
- package/lib/components/Icons/IconList.vue +26 -0
- package/lib/components/Icons/IconLoading.md +7 -0
- package/lib/components/Icons/IconLoading.vue +65 -0
- package/lib/components/Icons/IconLoading2.md +7 -0
- package/lib/components/Icons/IconLoading2.vue +52 -0
- package/lib/components/Icons/IconLock.md +7 -0
- package/lib/components/Icons/IconLock.vue +23 -0
- package/lib/components/Icons/IconMissedQuestions.md +7 -0
- package/lib/components/Icons/IconMissedQuestions.vue +22 -0
- package/lib/components/Icons/IconMoon.md +7 -0
- package/lib/components/Icons/IconMoon.vue +25 -0
- package/lib/components/Icons/IconPaginationArrow.md +7 -0
- package/lib/components/Icons/IconPaginationArrow.vue +23 -0
- package/lib/components/Icons/IconPassage.md +7 -0
- package/lib/components/Icons/IconPassage.vue +22 -0
- package/lib/components/Icons/IconPencil.md +7 -0
- package/lib/components/Icons/IconPencil.vue +19 -0
- package/lib/components/Icons/IconPeople.md +7 -0
- package/lib/components/Icons/IconPeople.vue +25 -0
- package/lib/components/Icons/IconQuestions.md +7 -0
- package/lib/components/Icons/IconQuestions.vue +25 -0
- package/lib/components/Icons/IconQuick10.md +7 -0
- package/lib/components/Icons/IconQuick10.vue +23 -0
- package/lib/components/Icons/IconRemoveCircle.md +7 -0
- package/lib/components/Icons/IconRemoveCircle.vue +22 -0
- package/lib/components/Icons/IconReviewFlag.md +7 -0
- package/lib/components/Icons/IconReviewFlag.vue +32 -0
- package/lib/components/Icons/IconSearch.md +7 -0
- package/lib/components/Icons/IconSearch.vue +23 -0
- package/lib/components/Icons/IconShare.md +7 -0
- package/lib/components/Icons/IconShare.vue +31 -0
- package/lib/components/Icons/IconSideBar.md +7 -0
- package/lib/components/Icons/IconSideBar.vue +26 -0
- package/lib/components/Icons/IconSideBarActive.md +7 -0
- package/lib/components/Icons/IconSideBarActive.vue +28 -0
- package/lib/components/Icons/IconStopwatch.md +7 -0
- package/lib/components/Icons/IconStopwatch.vue +22 -0
- package/lib/components/Icons/IconStrike.md +60 -0
- package/lib/components/Icons/IconStrike.vue +23 -0
- package/lib/components/Icons/IconSubject.md +7 -0
- package/lib/components/Icons/IconSubject.vue +22 -0
- package/lib/components/Icons/IconText.md +7 -0
- package/lib/components/Icons/IconText.vue +22 -0
- package/lib/components/Icons/IconWarning.md +7 -0
- package/lib/components/Icons/IconWarning.vue +22 -0
- package/lib/components/Modal/Modal.md +31 -0
- package/lib/components/Modal/Modal.vue +133 -0
- package/lib/components/Modal/ModalContainer.md +96 -0
- package/lib/components/Modal/ModalContainer.vue +208 -0
- package/lib/components/Onboarding/EmailAuth.md +40 -0
- package/lib/components/Onboarding/EmailAuth.vue +218 -0
- package/lib/components/Onboarding/MagicCodeEntry.md +20 -0
- package/lib/components/Onboarding/MagicCodeEntry.vue +189 -0
- package/lib/components/PhonePerson/PhonePerson.md +36 -0
- package/lib/components/PhonePerson/PhonePerson.vue +48 -0
- package/lib/components/PhonePerson/phoneperson-IT@2x.png +0 -0
- package/lib/components/PhonePerson/phoneperson-auto@2x.png +0 -0
- package/lib/components/PhonePerson/phoneperson-behavioralhealth@2x.png +0 -0
- package/lib/components/PhonePerson/phoneperson-emt@2x.png +0 -0
- package/lib/components/PhonePerson/phoneperson-essentials@2x.png +0 -0
- package/lib/components/PhonePerson/phoneperson-finance@2x.png +0 -0
- package/lib/components/PhonePerson/phoneperson-fitness@2x.png +0 -0
- package/lib/components/PhonePerson/phoneperson-medical@2x.png +0 -0
- package/lib/components/PhonePerson/phoneperson-nursing@2x.png +0 -0
- package/lib/components/PhonePerson/phoneperson-nursingschool@2x.png +0 -0
- package/lib/components/PhonePerson/phoneperson-professional@2x.png +0 -0
- package/lib/components/PhonePerson/phoneperson-skilledtrades@2x.png +0 -0
- package/lib/components/Quiz/FlagToggle.md +37 -0
- package/lib/components/Quiz/FlagToggle.vue +124 -0
- package/lib/components/Quiz/GlobalMetricsToggle.md +46 -0
- package/lib/components/Quiz/GlobalMetricsToggle.vue +124 -0
- package/lib/components/Quiz/KeyboardShortcutsButton.md +18 -0
- package/lib/components/Quiz/KeyboardShortcutsButton.vue +102 -0
- package/lib/components/Quiz/KeyboardShortcutsModal.md +71 -0
- package/lib/components/Quiz/KeyboardShortcutsModal.vue +261 -0
- package/lib/components/Quiz/Question.md +579 -0
- package/lib/components/Quiz/Question.vue +3262 -0
- package/lib/components/Quiz/QuizContainer.md +91 -0
- package/lib/components/Quiz/QuizContainer.vue +207 -0
- package/lib/components/Quiz/QuizProgress.md +122 -0
- package/lib/components/Quiz/QuizProgress.vue +188 -0
- package/lib/components/Quiz/QuizProgressBar.md +131 -0
- package/lib/components/Quiz/QuizProgressBar.vue +96 -0
- package/lib/components/Search/Pill.md +37 -0
- package/lib/components/Search/Pill.vue +117 -0
- package/lib/components/Search/Search.md +44 -0
- package/lib/components/Search/Search.vue +341 -0
- package/lib/components/SidePanels/SidePanel.md +126 -0
- package/lib/components/SidePanels/SidePanel.vue +592 -0
- package/lib/components/Tables/StudyTable.md +136 -0
- package/lib/components/Tables/Table.vue +497 -0
- package/lib/components/Tables/TableActions.vue +199 -0
- package/lib/components/Tables/TablePagination.md +19 -0
- package/lib/components/Tables/TablePagination.vue +109 -0
- package/lib/components/Tables/TeachTable.md +696 -0
- package/lib/components/Toasts/Toast.md +35 -0
- package/lib/components/Toasts/Toast.vue +213 -0
- package/lib/components/Tooltips/OverflowTooltip.md +14 -0
- package/lib/components/Tooltips/OverflowTooltip.vue +68 -0
- package/lib/components/Tooltips/Tooltip.md +72 -0
- package/lib/components/Tooltips/Tooltip.vue +143 -0
- package/lib/directives.ts +213 -0
- package/lib/index.ts +108 -0
- package/{pocketprep-export.module.scss → lib/pocketprep-export.module.scss} +2 -2
- package/{pocketprep.scss → lib/pocketprep.scss} +16 -18
- package/{styles → lib/styles}/_colors.scss +1 -1
- package/lib/styles/fonts.css +149 -0
- package/lib/utils.ts +53 -0
- package/package.json +75 -56
- package/{stylelint.config.js → stylelint.config.cjs} +6 -3
- package/assets/Fonts.md +0 -114
- package/assets/Images.md +0 -2
- package/assets/Styleguidist.vue +0 -11
- package/dist/@pocketprep/ui-kit.common.js +0 -29726
- package/dist/@pocketprep/ui-kit.common.js.map +0 -1
- package/dist/@pocketprep/ui-kit.umd.js +0 -29745
- package/dist/@pocketprep/ui-kit.umd.js.map +0 -1
- package/dist/@pocketprep/ui-kit.umd.min.js +0 -33
- package/dist/@pocketprep/ui-kit.umd.min.js.map +0 -1
- package/dist/demo.html +0 -1
- package/index.d.ts +0 -63
- package/src/directives.d.ts +0 -2
- package/src/shims.d.ts +0 -19
- package/src/utils.d.ts +0 -51
- package/styles/Colors.md +0 -53
- package/styles/Styles.md +0 -4
- package/styles/_fonts.scss +0 -149
- package/tests/shims-test.d.ts +0 -9
- /package/{assets → lib/assets}/fonts/muli/muli-400.eot +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-400.svg +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-400.ttf +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-400.woff +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-400.woff2 +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-400italic.eot +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-400italic.svg +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-400italic.ttf +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-400italic.woff +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-400italic.woff2 +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-600.eot +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-600.svg +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-600.ttf +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-600.woff +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-600.woff2 +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-600italic.eot +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-600italic.svg +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-600italic.ttf +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-600italic.woff +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-600italic.woff2 +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-700.eot +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-700.svg +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-700.ttf +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-700.woff +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-700.woff2 +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-700italic.eot +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-700italic.svg +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-700italic.ttf +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-700italic.woff +0 -0
- /package/{assets → lib/assets}/fonts/muli/muli-700italic.woff2 +0 -0
- /package/{assets → lib/assets}/images/amta.svg +0 -0
- /package/{assets → lib/assets}/images/favicon.ico +0 -0
- /package/{assets → lib/assets}/images/thumb-large-dark.svg +0 -0
- /package/{assets → lib/assets}/images/thumb-large.svg +0 -0
- /package/{assets → lib/assets}/images/thumb-small-dark.svg +0 -0
- /package/{assets → lib/assets}/images/thumb-small.svg +0 -0
- /package/{src → lib}/components/BundleIcons/bundleIcon.d.ts +0 -0
- /package/{src → lib}/components/Icons/icon.d.ts +0 -0
- /package/{src → lib}/components/PhonePerson/phonePerson.d.ts +0 -0
- /package/{src → lib}/components/Tables/table.d.ts +0 -0
- /package/{styles → lib/styles}/_breakpoints.scss +0 -0
- /package/{styles/_normalize.scss → lib/styles/normalize.css} +0 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
```vue
|
|
2
|
+
<template>
|
|
3
|
+
<div>
|
|
4
|
+
<Button @click="isDarkMode = !isDarkMode">{{ isDarkMode ? 'Disable' : 'Enable' }} Dark Mode</Button>
|
|
5
|
+
<div class="bundles" :class="{ dark: isDarkMode }">
|
|
6
|
+
<SVGDefinitions />
|
|
7
|
+
Selected Bundle: {{ selectedBundle?.objectId }}<br><br>
|
|
8
|
+
<BundleList :isDarkMode="isDarkMode" v-model="selectedBundle" :bundles="bundles" :premiumBundleIds="[ 'tVMt7KCrkQ' ]" />
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
import Button from '../Buttons/Button.vue'
|
|
15
|
+
|
|
16
|
+
const bundles = [
|
|
17
|
+
{
|
|
18
|
+
objectId: 'tVMt7KCrkQ',
|
|
19
|
+
name: 'AMTA',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
objectId: 'k9T5L3kC0U',
|
|
23
|
+
name: 'Professional',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
objectId: '1kS20KPPkH',
|
|
27
|
+
name: 'IT & Cybersecurity',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
objectId: '9970muCFGV',
|
|
31
|
+
name: 'Nursing School',
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
export default {
|
|
36
|
+
components: {
|
|
37
|
+
Button
|
|
38
|
+
},
|
|
39
|
+
data () {
|
|
40
|
+
return {
|
|
41
|
+
bundles,
|
|
42
|
+
selectedBundle: bundles[2],
|
|
43
|
+
isDarkMode: false,
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<style>
|
|
50
|
+
.bundles {
|
|
51
|
+
padding: 30px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.dark {
|
|
55
|
+
background-color: #1f3545;
|
|
56
|
+
color: #fff;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.uikit-btn {
|
|
60
|
+
margin-bottom: 30px;
|
|
61
|
+
}
|
|
62
|
+
</style>
|
|
63
|
+
```
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ul class="uikit-bundle-list">
|
|
3
|
+
<li
|
|
4
|
+
v-for="bundle in bundles"
|
|
5
|
+
:key="bundle.objectId"
|
|
6
|
+
v-dark="isDarkMode"
|
|
7
|
+
class="uikit-bundle-list__item"
|
|
8
|
+
tabindex="0"
|
|
9
|
+
:style="{
|
|
10
|
+
color: (modelValue && modelValue.objectId === bundle.objectId && selectedBundleColor)
|
|
11
|
+
|| (hoverBundleId === bundle.objectId && hoverBundleColor)
|
|
12
|
+
|| 'currentColor'
|
|
13
|
+
}"
|
|
14
|
+
@mouseenter="hoverBundleId = bundle.objectId"
|
|
15
|
+
@mouseleave="hoverBundleId = null"
|
|
16
|
+
@focus="hoverBundleId = bundle.objectId"
|
|
17
|
+
@blur="hoverBundleId = null"
|
|
18
|
+
@click="selectBundle(bundle)"
|
|
19
|
+
@keypress.enter="selectBundle(bundle)"
|
|
20
|
+
@mousedown.prevent
|
|
21
|
+
>
|
|
22
|
+
<span>
|
|
23
|
+
<BundleIcon
|
|
24
|
+
:ref="bundle.objectId"
|
|
25
|
+
class="uikit-bundle-list__icon"
|
|
26
|
+
:bundle-id="bundle.objectId"
|
|
27
|
+
:theme="isDarkMode
|
|
28
|
+
? 'silver'
|
|
29
|
+
: ![ hoverBundleId, modelValue && modelValue.objectId ].includes(bundle.objectId)
|
|
30
|
+
? 'grayscale'
|
|
31
|
+
: 'color'"
|
|
32
|
+
/>
|
|
33
|
+
{{ bundle.name }}
|
|
34
|
+
<PremiumPill
|
|
35
|
+
v-if="premiumBundleIds.includes(bundle.objectId)"
|
|
36
|
+
v-dark="isDarkMode"
|
|
37
|
+
/>
|
|
38
|
+
</span>
|
|
39
|
+
</li>
|
|
40
|
+
</ul>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<script lang="ts">
|
|
44
|
+
import type { ComponentPublicInstance } from 'vue'
|
|
45
|
+
import { Vue, Component, Prop, Watch, Emit } from 'vue-facing-decorator'
|
|
46
|
+
import BundleIcon from '../BundleIcons/BundleIcon.vue'
|
|
47
|
+
import type { Study } from '@pocketprep/types'
|
|
48
|
+
import { dark } from '../../directives'
|
|
49
|
+
import PremiumPill from '../Bundles/PremiumPill.vue'
|
|
50
|
+
|
|
51
|
+
@Component({
|
|
52
|
+
directives: {
|
|
53
|
+
dark,
|
|
54
|
+
},
|
|
55
|
+
components: {
|
|
56
|
+
BundleIcon,
|
|
57
|
+
PremiumPill,
|
|
58
|
+
},
|
|
59
|
+
})
|
|
60
|
+
export default class BundleSearch extends Vue {
|
|
61
|
+
@Prop() bundles!: Study.Class.BundleJSON[]
|
|
62
|
+
@Prop({ default: null }) modelValue!: Study.Class.BundleJSON
|
|
63
|
+
@Prop({ default: false }) isDarkMode!: boolean
|
|
64
|
+
@Prop({ default: () => ([]) }) premiumBundleIds!: string[]
|
|
65
|
+
|
|
66
|
+
hoverBundleId: string | null = null
|
|
67
|
+
hoverBundleColor: string | null = null
|
|
68
|
+
selectedBundleColor: string | null = null
|
|
69
|
+
|
|
70
|
+
mounted () {
|
|
71
|
+
this.modelValue && this.selectBundle(this.modelValue)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
selectBundle (bundle: Study.Class.BundleJSON) {
|
|
75
|
+
const selectedBundleId = bundle.objectId
|
|
76
|
+
this.hoverBundleId = selectedBundleId
|
|
77
|
+
this.$nextTick(() => {
|
|
78
|
+
this.updateBundleColor()
|
|
79
|
+
this.selectedBundleColor = this.hoverBundleColor
|
|
80
|
+
})
|
|
81
|
+
this.emitUpdateModelValue(bundle)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
updateBundleColor () {
|
|
85
|
+
if (this.hoverBundleId) {
|
|
86
|
+
try {
|
|
87
|
+
const bundleIcon = this.$refs[this.hoverBundleId] as ComponentPublicInstance[]
|
|
88
|
+
const gId = bundleIcon[0]?.$el?.querySelector('path')?.getAttribute('fill')?.split('#')[1].split(')')[0]
|
|
89
|
+
const stopColor = document.querySelectorAll(`#${gId} stop`)[1]?.getAttribute('stop-color')
|
|
90
|
+
this.hoverBundleColor = stopColor || null
|
|
91
|
+
} catch (err) {
|
|
92
|
+
// no-op
|
|
93
|
+
}
|
|
94
|
+
} else {
|
|
95
|
+
this.hoverBundleColor = null
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@Emit('update:modelValue')
|
|
100
|
+
emitUpdateModelValue (val: Study.Class.BundleJSON) {
|
|
101
|
+
return val
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@Watch('hoverBundleId')
|
|
105
|
+
hoverBundleIdChanged () {
|
|
106
|
+
this.$nextTick(() => {
|
|
107
|
+
this.updateBundleColor()
|
|
108
|
+
})
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
</script>
|
|
112
|
+
|
|
113
|
+
<style lang="scss">
|
|
114
|
+
@import '../../styles/colors';
|
|
115
|
+
|
|
116
|
+
.uikit-bundle-list {
|
|
117
|
+
box-sizing: border-box;
|
|
118
|
+
list-style-type: none;
|
|
119
|
+
margin: 0 0 38px 0;
|
|
120
|
+
padding: 0;
|
|
121
|
+
|
|
122
|
+
&__item {
|
|
123
|
+
display: flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
font-size: 14px;
|
|
126
|
+
letter-spacing: 0.2px;
|
|
127
|
+
line-height: 19px;
|
|
128
|
+
outline: none;
|
|
129
|
+
cursor: pointer;
|
|
130
|
+
user-select: none;
|
|
131
|
+
margin-bottom: 6px;
|
|
132
|
+
|
|
133
|
+
span {
|
|
134
|
+
white-space: nowrap;
|
|
135
|
+
align-items: center;
|
|
136
|
+
display: flex;
|
|
137
|
+
position: relative;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&--dark {
|
|
141
|
+
color: rgba($fog, 0.8) !important;
|
|
142
|
+
|
|
143
|
+
&:hover {
|
|
144
|
+
color: $white !important;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
&:focus span::before {
|
|
148
|
+
content: '';
|
|
149
|
+
position: absolute;
|
|
150
|
+
left: -3px;
|
|
151
|
+
top: -1px;
|
|
152
|
+
border: 1px solid $butterscotch;
|
|
153
|
+
border-radius: 2px;
|
|
154
|
+
width: calc(100% + 8px);
|
|
155
|
+
height: 100%;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
&:last-child {
|
|
160
|
+
margin-bottom: 0;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
&__icon {
|
|
165
|
+
width: 25px;
|
|
166
|
+
height: 25px;
|
|
167
|
+
margin-right: 9px;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
</style>
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
```vue
|
|
2
|
+
<template>
|
|
3
|
+
<div>
|
|
4
|
+
<Button @click="showBundleSearch = !showBundleSearch">Toggle Bundle Search</Button>
|
|
5
|
+
<Button @click="isDarkMode = !isDarkMode">{{ isDarkMode ? 'Disable' : 'Enable' }} Dark Mode</Button><br>
|
|
6
|
+
Selected Exam: {{ selectedExam?.objectId }}
|
|
7
|
+
<div class="bundle-search-container" :class="{ dark: isDarkMode }">
|
|
8
|
+
<BundleSearch
|
|
9
|
+
v-if="showBundleSearch"
|
|
10
|
+
@select="exam => selectedExam = exam"
|
|
11
|
+
:bundles="bundles"
|
|
12
|
+
:isDarkMode="isDarkMode"
|
|
13
|
+
:examMetadataById="examMetadata"
|
|
14
|
+
:premiumBundleIds="[ 'k9T5L3kC0U' ]"
|
|
15
|
+
:premiumExamIds="[ 'W54AAON6ZP', 'LIjSJZQEB1' ]"
|
|
16
|
+
/>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script>
|
|
22
|
+
const bundles = [
|
|
23
|
+
{
|
|
24
|
+
objectId: 'tVMt7KCrkQ',
|
|
25
|
+
name: 'AMTA',
|
|
26
|
+
exams: [
|
|
27
|
+
{
|
|
28
|
+
"objectId": "icX2CYGp2P"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
objectId: 'k9T5L3kC0U',
|
|
34
|
+
name: 'Professional',
|
|
35
|
+
exams: [
|
|
36
|
+
{
|
|
37
|
+
"objectId": "W54AAON6ZP"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"objectId": "LIjSJZQEB1"
|
|
41
|
+
},
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
objectId: '1kS20KPPkH',
|
|
46
|
+
name: 'IT & Cybersecurity',
|
|
47
|
+
exams: [
|
|
48
|
+
{
|
|
49
|
+
"objectId": "rGNBApGBEg"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"objectId": "rGNBApGBEg2"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"objectId": "rGNBApGBEg3"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"objectId": "rGNBApGBEg4"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"objectId": "rGNBApGBEg5"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"objectId": "rGNBApGBEg6"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"objectId": "rGNBApGBEg7"
|
|
68
|
+
},
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
objectId: '9970muCFGV',
|
|
73
|
+
name: 'Nursing School',
|
|
74
|
+
exams: [
|
|
75
|
+
{
|
|
76
|
+
"objectId": "o98Hn8iUO4"
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
const examMetadata = {
|
|
82
|
+
icX2CYGp2P: {
|
|
83
|
+
objectId: 'icX2CYGp2P',
|
|
84
|
+
nativeAppName: 'AMTA mBLEX',
|
|
85
|
+
descriptiveName: 'The AMTA Exam',
|
|
86
|
+
itemCount: '100',
|
|
87
|
+
archivedCount: '2',
|
|
88
|
+
knowledgeAreas: ['', ''],
|
|
89
|
+
},
|
|
90
|
+
W54AAON6ZP: {
|
|
91
|
+
objectId: 'W54AAON6ZP',
|
|
92
|
+
nativeAppName: 'BCSP ASP®',
|
|
93
|
+
descriptiveName: 'Associate Safety Professional Prep',
|
|
94
|
+
itemCount: '100',
|
|
95
|
+
archivedCount: '2',
|
|
96
|
+
knowledgeAreas: ['', ''],
|
|
97
|
+
},
|
|
98
|
+
LIjSJZQEB1: {
|
|
99
|
+
objectId: 'LIjSJZQEB1',
|
|
100
|
+
nativeAppName: 'ASP',
|
|
101
|
+
descriptiveName: 'Board of Certified Safety Professionals: Associate Safety Professional',
|
|
102
|
+
itemCount: '100',
|
|
103
|
+
archivedCount: '2',
|
|
104
|
+
knowledgeAreas: ['', ''],
|
|
105
|
+
},
|
|
106
|
+
rGNBApGBEg: {
|
|
107
|
+
objectId: 'rGNBApGBEg',
|
|
108
|
+
nativeAppName: 'EC-Council® CEH™',
|
|
109
|
+
descriptiveName: 'Certified Ethical Hacker™ v10 Prep',
|
|
110
|
+
itemCount: '100',
|
|
111
|
+
archivedCount: '2',
|
|
112
|
+
knowledgeAreas: ['', ''],
|
|
113
|
+
},
|
|
114
|
+
rGNBApGBEg2: {
|
|
115
|
+
objectId: 'rGNBApGBEg2',
|
|
116
|
+
nativeAppName: 'EC-Council® CEH™',
|
|
117
|
+
descriptiveName: 'Certified Ethical Hacker™ v10 Prep',
|
|
118
|
+
itemCount: '100',
|
|
119
|
+
archivedCount: '2',
|
|
120
|
+
knowledgeAreas: ['', ''],
|
|
121
|
+
},
|
|
122
|
+
rGNBApGBEg3: {
|
|
123
|
+
objectId: 'rGNBApGBEg3',
|
|
124
|
+
nativeAppName: 'EC-Council® CEH™',
|
|
125
|
+
descriptiveName: 'Certified Ethical Hacker™ v10 Prep',
|
|
126
|
+
itemCount: '100',
|
|
127
|
+
archivedCount: '2',
|
|
128
|
+
knowledgeAreas: ['', ''],
|
|
129
|
+
},
|
|
130
|
+
rGNBApGBEg4: {
|
|
131
|
+
objectId: 'rGNBApGBEg4',
|
|
132
|
+
nativeAppName: 'EC-Council® CEH™',
|
|
133
|
+
descriptiveName: 'Certified Ethical Hacker™ v10 Prep',
|
|
134
|
+
itemCount: '100',
|
|
135
|
+
archivedCount: '2',
|
|
136
|
+
knowledgeAreas: ['', ''],
|
|
137
|
+
},
|
|
138
|
+
rGNBApGBEg5: {
|
|
139
|
+
objectId: 'rGNBApGBEg5',
|
|
140
|
+
nativeAppName: 'EC-Council® CEH™',
|
|
141
|
+
descriptiveName: 'Certified Ethical Hacker™ v10 Prep',
|
|
142
|
+
itemCount: '100',
|
|
143
|
+
archivedCount: '2',
|
|
144
|
+
knowledgeAreas: ['', ''],
|
|
145
|
+
},
|
|
146
|
+
rGNBApGBEg6: {
|
|
147
|
+
objectId: 'rGNBApGBEg6',
|
|
148
|
+
nativeAppName: 'EC-Council® CEH™',
|
|
149
|
+
descriptiveName: 'Certified Ethical Hacker™ v10 Prep',
|
|
150
|
+
itemCount: '100',
|
|
151
|
+
archivedCount: '2',
|
|
152
|
+
knowledgeAreas: ['', ''],
|
|
153
|
+
},
|
|
154
|
+
rGNBApGBEg7: {
|
|
155
|
+
objectId: 'rGNBApGBEg7',
|
|
156
|
+
nativeAppName: 'EC-Council® CEH™',
|
|
157
|
+
descriptiveName: 'Certified Ethical Hacker™ v10 Prep',
|
|
158
|
+
itemCount: '100',
|
|
159
|
+
archivedCount: '2',
|
|
160
|
+
knowledgeAreas: ['', ''],
|
|
161
|
+
},
|
|
162
|
+
o98Hn8iUO4: {
|
|
163
|
+
objectId: 'o98Hn8iUO4',
|
|
164
|
+
nativeAppName: 'College Biology',
|
|
165
|
+
descriptiveName: 'College-level Biology Practice',
|
|
166
|
+
itemCount: '100',
|
|
167
|
+
archivedCount: '2',
|
|
168
|
+
knowledgeAreas: ['', ''],
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
export default {
|
|
172
|
+
data () {
|
|
173
|
+
return {
|
|
174
|
+
isDarkMode: false,
|
|
175
|
+
bundles,
|
|
176
|
+
selectedExam: null,
|
|
177
|
+
examMetadata,
|
|
178
|
+
showBundleSearch: true,
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
</script>
|
|
183
|
+
|
|
184
|
+
<style>
|
|
185
|
+
.dark {
|
|
186
|
+
background-color: #1f3545;
|
|
187
|
+
color: #fff;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.bundle-search-container {
|
|
191
|
+
height: 400px;
|
|
192
|
+
padding: 30px 0;
|
|
193
|
+
}
|
|
194
|
+
</style>
|
|
195
|
+
```
|