@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
package/eslint.config.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import stylisticTs from '@stylistic/eslint-plugin
|
|
1
|
+
import stylisticTs from '@stylistic/eslint-plugin'
|
|
2
2
|
import pluginVue from 'eslint-plugin-vue'
|
|
3
3
|
import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'
|
|
4
4
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -25,25 +25,51 @@ export default defineConfigWithVueTs(
|
|
|
25
25
|
pluginVue.configs['flat/recommended'],
|
|
26
26
|
{
|
|
27
27
|
rules: {
|
|
28
|
-
'@stylistic/
|
|
29
|
-
'@stylistic/
|
|
30
|
-
'@stylistic/
|
|
28
|
+
'@stylistic/quotes': [ 'error', 'single' ],
|
|
29
|
+
'@stylistic/quote-props': 'off',
|
|
30
|
+
'@stylistic/comma-dangle': [ 'error', {
|
|
31
31
|
'arrays': 'always-multiline',
|
|
32
32
|
'objects': 'always-multiline',
|
|
33
33
|
'imports': 'always-multiline',
|
|
34
34
|
'exports': 'always-multiline',
|
|
35
35
|
'functions': 'never',
|
|
36
36
|
}],
|
|
37
|
-
'@stylistic/
|
|
38
|
-
'@stylistic/
|
|
39
|
-
'@stylistic/
|
|
40
|
-
'@stylistic/
|
|
41
|
-
'@stylistic/
|
|
37
|
+
'@stylistic/semi': [ 'error', 'never' ],
|
|
38
|
+
'@stylistic/object-property-newline': [ 'error', { allowAllPropertiesOnSameLine: true }],
|
|
39
|
+
'@stylistic/no-extra-parens': 'off',
|
|
40
|
+
'@stylistic/lines-between-class-members': 'off',
|
|
41
|
+
'@stylistic/lines-around-comment': 'off',
|
|
42
|
+
'@stylistic/multiline-comment-style': 'off',
|
|
43
|
+
'@stylistic/array-bracket-spacing': [
|
|
44
|
+
'error',
|
|
45
|
+
'always',
|
|
46
|
+
{
|
|
47
|
+
objectsInArrays: false,
|
|
48
|
+
arraysInArrays: false,
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
'@stylistic/array-element-newline': [ 'error', 'consistent' ],
|
|
52
|
+
'@stylistic/array-bracket-newline': [ 'error', 'consistent' ],
|
|
53
|
+
'@stylistic/function-call-argument-newline': [ 'error', 'consistent' ],
|
|
54
|
+
'@stylistic/padded-blocks': 'off',
|
|
55
|
+
'@stylistic/no-multi-spaces': [ 'error', { ignoreEOLComments: true }],
|
|
56
|
+
'@stylistic/arrow-parens': 'off',
|
|
57
|
+
'@stylistic/indent-binary-ops': [ 'error', 4 ],
|
|
58
|
+
'@stylistic/operator-linebreak': [ 'error', 'before', { overrides: { '=': 'after' } }],
|
|
59
|
+
'@stylistic/multiline-ternary': [ 'error', 'always-multiline' ],
|
|
60
|
+
'@stylistic/dot-location': [ 'error', 'property' ],
|
|
61
|
+
'@stylistic/implicit-arrow-linebreak': 'off',
|
|
62
|
+
'@stylistic/function-paren-newline': 'off',
|
|
63
|
+
'@stylistic/no-confusing-arrow': 'off',
|
|
64
|
+
'@stylistic/semi-style': 'off',
|
|
65
|
+
'@stylistic/wrap-regex': 'off',
|
|
66
|
+
'@stylistic/newline-per-chained-call': [ 'error', { ignoreChainWithDepth: 3 }],
|
|
67
|
+
'@stylistic/spaced-comment': [ 'error', 'always', { 'exceptions': [ '*' ] }],
|
|
42
68
|
'no-console': 'warn',
|
|
43
69
|
'max-len': [ 'error', { 'code': 120 }],
|
|
44
70
|
'brace-style': 'error',
|
|
45
71
|
'keyword-spacing': [ 'error', { 'before': true, 'after': true }],
|
|
46
|
-
'@stylistic/
|
|
72
|
+
'@stylistic/object-curly-spacing': [ 'error', 'always' ],
|
|
47
73
|
'array-bracket-spacing': [ 'error', 'always', { 'objectsInArrays': false, 'arraysInArrays': false }],
|
|
48
74
|
'space-in-parens': [ 'error', 'never' ],
|
|
49
75
|
'space-before-function-paren': [ 'error', 'always' ],
|
|
@@ -72,7 +98,7 @@ export default defineConfigWithVueTs(
|
|
|
72
98
|
'dot-location': [ 'error', 'property' ],
|
|
73
99
|
'eqeqeq': 'error',
|
|
74
100
|
'no-implicit-globals': [ 'error', { 'lexicalBindings': true }],
|
|
75
|
-
'@stylistic/
|
|
101
|
+
'@stylistic/member-delimiter-style': [ 'error', { 'multiline': { delimiter: 'none' } }],
|
|
76
102
|
'@typescript-eslint/no-angle-bracket-type-assertion': 'off',
|
|
77
103
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
78
104
|
'@typescript-eslint/explicit-member-accessibility': 'off',
|
|
@@ -99,6 +125,7 @@ export default defineConfigWithVueTs(
|
|
|
99
125
|
'@typescript-eslint/unbound-method': 'off',
|
|
100
126
|
'@typescript-eslint/no-unused-vars': [ 'error', { caughtErrors: 'none' }],
|
|
101
127
|
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'off',
|
|
128
|
+
'@typescript-eslint/no-useless-default-assignment': 'off',
|
|
102
129
|
},
|
|
103
130
|
},
|
|
104
131
|
{
|
package/lib/SVGDefinitions.vue
CHANGED
|
@@ -37,44 +37,41 @@
|
|
|
37
37
|
<!-- eslint-enable -->
|
|
38
38
|
</template>
|
|
39
39
|
|
|
40
|
-
<script lang="ts">
|
|
41
|
-
import { Vue, Component } from 'vue-facing-decorator'
|
|
40
|
+
<script setup lang="ts">
|
|
42
41
|
import BrandColors from './pocketprep-export.module.scss'
|
|
43
42
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
color2: '#1671FF',
|
|
74
|
-
},
|
|
75
|
-
}
|
|
43
|
+
const colors = {
|
|
44
|
+
grayscale: {
|
|
45
|
+
color1: '#647D8F',
|
|
46
|
+
color2: BrandColors.brandBlack,
|
|
47
|
+
},
|
|
48
|
+
silver: {
|
|
49
|
+
color1: BrandColors.white,
|
|
50
|
+
color2: BrandColors.grayDivider,
|
|
51
|
+
},
|
|
52
|
+
red: {
|
|
53
|
+
color1: '#FF4747',
|
|
54
|
+
color2: BrandColors.redPegasus,
|
|
55
|
+
},
|
|
56
|
+
purple: {
|
|
57
|
+
color1: '#CE45FF',
|
|
58
|
+
color2: BrandColors.vibrantPurple,
|
|
59
|
+
},
|
|
60
|
+
green: {
|
|
61
|
+
color1: '#05A881',
|
|
62
|
+
color2: BrandColors.spectralGreen,
|
|
63
|
+
},
|
|
64
|
+
blue: {
|
|
65
|
+
color1: '#448EFF',
|
|
66
|
+
color2: BrandColors.brandBlue,
|
|
67
|
+
},
|
|
68
|
+
pocketprep: {
|
|
69
|
+
color1: '#0064FF',
|
|
70
|
+
color2: '#1671FF',
|
|
71
|
+
},
|
|
76
72
|
}
|
|
77
73
|
</script>
|
|
74
|
+
|
|
78
75
|
<style lang="scss">
|
|
79
76
|
.uikit-svg-definitions {
|
|
80
77
|
position: absolute;
|
|
@@ -82,4 +79,4 @@ export default class SVGDefinitions extends Vue {
|
|
|
82
79
|
top: 0;
|
|
83
80
|
z-index: -10000;
|
|
84
81
|
}
|
|
85
|
-
</style>
|
|
82
|
+
</style>
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
<div class="uikit-banner__content">
|
|
8
8
|
<slot name="bannerImage">
|
|
9
9
|
<img
|
|
10
|
-
class="uikit-banner__content-icon"
|
|
10
|
+
class="uikit-banner__content-icon"
|
|
11
11
|
src="../../assets/emojis/tada.png"
|
|
12
12
|
alt=""
|
|
13
13
|
>
|
|
14
14
|
</slot>
|
|
15
|
-
<div
|
|
15
|
+
<div
|
|
16
16
|
v-dark="isDarkMode"
|
|
17
17
|
class="uikit-banner__content-text"
|
|
18
18
|
>
|
|
@@ -25,20 +25,16 @@
|
|
|
25
25
|
</div>
|
|
26
26
|
</template>
|
|
27
27
|
|
|
28
|
-
<script lang="ts">
|
|
29
|
-
import {
|
|
30
|
-
import { dark } from '../../directives'
|
|
28
|
+
<script setup lang="ts">
|
|
29
|
+
import { dark as vDark } from '../../directives'
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
withDefaults(defineProps<{
|
|
32
|
+
text?: string
|
|
33
|
+
isDarkMode?: boolean
|
|
34
|
+
}>(), {
|
|
35
|
+
text: '',
|
|
36
|
+
isDarkMode: false,
|
|
36
37
|
})
|
|
37
|
-
export default class Banner extends Vue {
|
|
38
|
-
@Prop({ default: () => ('') }) text!: string
|
|
39
|
-
@Prop({ default: false }) isDarkMode!: boolean
|
|
40
|
-
|
|
41
|
-
}
|
|
42
38
|
</script>
|
|
43
39
|
|
|
44
40
|
<style lang="scss" scoped>
|
|
@@ -6,20 +6,12 @@
|
|
|
6
6
|
/>
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
|
-
<script lang="ts">
|
|
10
|
-
import { Vue, Component, Prop } from 'vue-facing-decorator'
|
|
9
|
+
<script setup lang="ts">
|
|
11
10
|
import BlobEmptyState from './BlobEmptyState.vue'
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
})
|
|
18
|
-
export default class Blob extends Vue {
|
|
19
|
-
@Prop() type!: string
|
|
20
|
-
@Prop() title!: string
|
|
21
|
-
@Prop() isDarkMode!: boolean
|
|
22
|
-
@Prop() primaryColor!: string
|
|
23
|
-
@Prop({ default: 'currentColor' }) secondaryColor!: string
|
|
24
|
-
}
|
|
12
|
+
defineProps<{
|
|
13
|
+
type: string
|
|
14
|
+
title?: string
|
|
15
|
+
primaryColor?: string
|
|
16
|
+
}>()
|
|
25
17
|
</script>
|
|
@@ -11,13 +11,14 @@
|
|
|
11
11
|
<!-- eslint-enable -->
|
|
12
12
|
</template>
|
|
13
13
|
|
|
14
|
-
<script lang="ts">
|
|
15
|
-
import { Vue, Component, Prop } from 'vue-facing-decorator'
|
|
14
|
+
<script setup lang="ts">
|
|
16
15
|
import BrandColors from '../../pocketprep-export.module.scss'
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
withDefaults(defineProps<{
|
|
18
|
+
title?: string
|
|
19
|
+
primaryColor?: string
|
|
20
|
+
}>(), {
|
|
21
|
+
title: '',
|
|
22
|
+
primaryColor: BrandColors.fog,
|
|
23
|
+
})
|
|
24
|
+
</script>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type TBlobType =
|
|
2
|
-
'empty'
|
|
2
|
+
'empty'
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<div class="uikit-bundle-icon">
|
|
4
4
|
<AMTA v-if="bundleId === 'VEcpw3DhnA' && theme === 'color'" />
|
|
5
5
|
<svg v-else width="209px" height="209px" viewBox="0 0 209 209" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
6
|
-
<title
|
|
6
|
+
<title></title>
|
|
7
7
|
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
8
8
|
<path :fill="`url(#${fillId})`" v-if="bundleId === 'mO5EIsoZ9H'" transform="translate(17.000000, 39.500000)" d="M143.5,0 C151.402759,0 157.828899,6.32215635 157.99664,14.1846885 L158,14.5 L158,106.079719 C158,111.653415 154.806654,116.722754 149.805173,119.137109 L149.496713,119.281591 L93.4967126,144.718582 C89.8091624,146.393585 85.5952671,146.447618 81.8737592,144.880679 L81.5032874,144.718582 L25.5032874,119.281591 C20.4285821,116.976498 17.133742,111.972532 17.0039782,106.420317 L17,106.079719 L17.0003788,36.2611986 C12.8365027,35.3406758 8.72130782,34.9623625 4.65479428,35.126259 L3.9663954,35.1595043 C1.89314634,35.2736838 0.119885158,33.6855441 0.00570570248,31.612295 C-0.0666396373,30.2986619 0.552941044,29.042775 1.63939092,28.3008233 C6.60149467,24.9144431 11.7217104,22.4414978 17.0001989,20.8822228 L17,14.5 C17,6.59724124 23.3221564,0.171101224 31.1846885,0.00336048213 L31.5,0 L143.5,0 Z M143.5,9 L31.5,9 C28.5365209,9 26.1204609,11.34378 26.0043672,14.2787929 L26,14.5 L26.0002291,19.1239124 C31.1782215,18.6135029 36.4988763,18.9263002 41.9623309,20.0625055 C59.9825747,23.8100788 76.016079,30.361181 90.0628438,39.7158122 L90.9034068,40.2802459 C91.7817882,40.8756264 92.3676626,41.814478 92.5164656,42.8651394 C93.3878402,49.0329817 96.49972,53.6634056 101.852587,56.756343 C107.17735,59.8330415 112.83623,59.9763513 118.829228,57.1862722 C119.89432,56.6883221 121.130982,56.7192801 122.170771,57.2681057 L135.037788,64.0730934 C136.873288,65.0438353 137.574312,67.3187435 136.60357,69.1542431 L136.573315,69.2102971 L136.573315,69.2102971 L118.777528,101.522173 C117.775828,103.340963 115.489369,104.003345 113.67058,103.001646 C113.646637,102.988459 113.622838,102.975012 113.599189,102.961306 L102.227266,96.3709628 C101.117783,95.7283719 100.412421,94.564579 100.355977,93.2836842 C100.065895,86.7176817 96.8023768,81.596884 90.5654214,77.9212911 C84.0528815,74.0832894 77.5665999,73.6590806 71.1065768,76.6486648 C70.4596442,76.9438326 69.9118395,77.4189005 69.5232315,78.0144052 L66.3767824,82.8783367 C65.3189188,84.5136329 63.1873364,85.0703126 61.4649539,84.1610998 L43.5424222,74.7001378 C41.7473502,73.7525536 41.0285582,71.5511685 41.9185572,69.7268602 L44.9257767,63.5627011 C45.1551028,63.0911969 45.2837168,62.57705 45.3024088,62.0530677 C45.6561716,52.3147724 39.6139791,44.8134014 27.1758313,39.5489546 C26.7835788,39.3829337 26.3917425,39.221548 26.0003224,39.0647975 L26,98.215 L36.3983255,79.5186249 C37.4173859,77.686307 39.668922,76.9614528 41.554598,77.8236699 L41.7418868,77.9151996 L59.3853871,87.1050955 C59.4175332,87.1218393 59.4494503,87.1390193 59.4811295,87.1566307 C61.349673,88.1954092 62.0609075,90.509741 61.1320077,92.4079085 L61.0336327,92.5962753 L46.413,118.894 L85.2253849,136.524316 C86.5857144,137.142222 88.1348815,137.178569 89.5174272,136.633358 L89.7746151,136.524316 L145.774615,111.087326 C147.66604,110.22818 148.905613,108.380609 148.994838,106.318556 L149,106.079719 L149,14.5 C149,11.4624339 146.537566,9 143.5,9 Z" fill-rule="nonzero"></path>
|
|
9
9
|
<path :fill="`url(#${fillId})`" v-else-if="bundleId === 'uKLwvbsbPV'" d="M160.5,39.5 C168.508129,39.5 175,45.9918711 175,54 L175,54 L175,145.579719 C175,151.267164 171.674983,156.429455 166.496713,158.781591 L166.496713,158.781591 L110.496713,184.218582 C106.686244,185.949419 102.313756,185.949419 98.5032874,184.218582 L98.5032874,184.218582 L42.5032874,158.781591 C37.3250167,156.429455 34,151.267164 34,145.579719 L34,145.579719 L34.0011059,127.105076 C30.3242184,126.140626 26.332642,125.108935 22.0263767,124.010003 L22,124 C20,123.5 18.5,121.5 18,119.5 C17.7664307,118.565723 17.6419707,113.812624 17.6266198,108.757571 L17.6257089,106.978261 C17.6361059,101.779773 17.7608696,96.6956522 18,95.5 C18.4499637,93.2501813 19.709797,92.6201015 21.7794997,93.2453488 L22.0171593,93.3410468 C26.2944372,95.0583479 30.2891026,96.6539691 34.0011553,98.1279104 L34,54 C34,45.9918711 40.4918711,39.5 48.5,39.5 L48.5,39.5 Z M160.5,48.5 L48.5,48.5 C45.4624339,48.5 43,50.9624339 43,54 L43,54 L43.0015671,101.680443 C60.4610565,108.52436 69.6272008,111.797545 70.5,111.5 C73.3345096,110.53369 77.5821351,109.454318 83.2428767,108.261885 C83.9655585,108.109652 84.7071182,108.072881 85.440045,108.15232 L85.7535477,108.193482 L111.795905,112.213057 C115.795905,113.213057 118.06249,115.579509 117.795905,119.713057 C117.52932,123.846605 113.5,124.5 107.5,124.5 C104.288095,124.5 98.8380681,125.037309 91.1499187,126.111927 C92.3647434,126.592316 93.4720866,127.031896 94.4719593,127.430668 L95.8911667,127.998219 C97.452875,128.624653 98.6854711,129.12611 99.5890132,129.502586 C101.614446,130.346516 108.163199,130.623077 112.586428,129.5 C115.698067,128.709941 119.28163,127.691921 122.827757,126.604101 L123.945747,126.258444 C129.895391,124.404529 135.586754,122.399848 138.586428,121 C146.086428,117.5 148.586428,117.5 151.586428,121 C154.538808,124.444444 150.399727,129.231698 145.334788,131.876308 L145.089013,132.002586 L107.586428,156 C104.274157,157.674334 100.32404,157.475692 97.1964522,155.477511 C89.4121824,150.695841 82.9662865,146.771573 77.8587643,143.704709 L77.0634357,143.227592 C71.5739908,139.937653 67.7195122,137.695122 65.5,136.5 C63.2513379,135.289182 55.7517147,132.956364 43.0011302,129.501545 L43,145.579719 C43,147.737026 44.2612132,149.695136 46.2253849,150.587326 L46.2253849,150.587326 L102.225385,176.024316 C103.670735,176.680841 105.329265,176.680841 106.774615,176.024316 L106.774615,176.024316 L162.774615,150.587326 C164.738787,149.695136 166,147.737026 166,145.579719 L166,145.579719 L166,54 C166,50.9624339 163.537566,48.5 160.5,48.5 L160.5,48.5 Z M124.753991,66.0904817 C127.490487,69.196825 125.438115,77.8255563 121.333371,83.3479444 C116.745685,89.5200677 112.093015,94.7425949 106.624706,100.260258 C104.964699,101.935247 104.271402,100.358787 103.222071,99.516353 L103.12566,99.4419011 L88.1533594,83.3479444 C83.0224297,76.7901086 83.0224297,70.577422 86.1009875,66.0904817 C87.7936365,63.6234775 88.8374833,62.9841384 92.600165,62.9841384 C96.3628468,62.9841384 100.809652,64.3647354 103.88821,70.577422 C106.624706,67.1259294 108.335016,65.4001832 113.123884,62.9841384 C117.912751,60.5680936 122.017495,62.9841384 124.753991,66.0904817 Z" fill-rule="nonzero"></path>
|
|
@@ -26,77 +26,50 @@
|
|
|
26
26
|
</template>
|
|
27
27
|
<!-- eslint-enable -->
|
|
28
28
|
|
|
29
|
-
<script lang="ts">
|
|
30
|
-
import { Component, Vue, Prop } from 'vue-facing-decorator'
|
|
31
|
-
import type { TBundleIds } from './bundleIcon'
|
|
29
|
+
<script setup lang="ts">
|
|
32
30
|
import AMTA from './AMTA.vue'
|
|
31
|
+
import { computed, onMounted } from 'vue'
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
const props = withDefaults(defineProps<{
|
|
34
|
+
bundleId?: string
|
|
35
|
+
grayscale?: boolean
|
|
36
|
+
theme?: 'color' | 'grayscale' | 'silver'
|
|
37
|
+
}>(), {
|
|
38
|
+
bundleId: 'mO5EIsoZ9H',
|
|
39
|
+
grayscale: false,
|
|
40
|
+
theme: 'color',
|
|
38
41
|
})
|
|
39
|
-
export default class BundleIcon extends Vue {
|
|
40
|
-
@Prop({ default: 'mO5EIsoZ9H' }) bundleId!: TBundleIds
|
|
41
|
-
@Prop({ default: false }) grayscale!: boolean
|
|
42
|
-
@Prop({ default: 'color' }) theme!: 'color' | 'grayscale' | 'silver'
|
|
43
42
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
// return 'EMS bundle icon'
|
|
51
|
-
// } else if (this.bundleId === '4dTgUX97Dk') {
|
|
52
|
-
// return 'Nursing bundle icon'
|
|
53
|
-
// } else if (this.bundleId === 'uKLwvbsbPV') {
|
|
54
|
-
// return 'Behavioral Health bundle icon'
|
|
55
|
-
// } else if (this.bundleId === '9970muCFGV') {
|
|
56
|
-
// return 'Nursing School bundle icon'
|
|
57
|
-
// } else if (this.bundleId === 'GVCNrq4ixh') {
|
|
58
|
-
// return 'Finance bundle icon'
|
|
59
|
-
// } else if (this.bundleId === '1kS20KPPkH') {
|
|
60
|
-
// return 'IT & Cybersecurity bundle icon'
|
|
61
|
-
// } else if (this.bundleId === 'DO5jBm0OJo') {
|
|
62
|
-
// return 'Essentials'
|
|
63
|
-
// } else {
|
|
64
|
-
// return 'Bundle icon'
|
|
65
|
-
// }
|
|
66
|
-
return ''
|
|
43
|
+
const fillId = computed(() => {
|
|
44
|
+
if (props.theme === 'grayscale' || props.grayscale) {
|
|
45
|
+
return 'bundle-icon-gradient-grayscale'
|
|
46
|
+
}
|
|
47
|
+
if (props.theme === 'silver') {
|
|
48
|
+
return 'bundle-icon-gradient-silver'
|
|
67
49
|
}
|
|
68
50
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
if (this.bundleId === 'vtgI9oxCI4') {
|
|
78
|
-
return 'bundle-icon-gradient-pocketprep'
|
|
79
|
-
}
|
|
80
|
-
if (this.bundleId === 'mO5EIsoZ9H' || this.bundleId === 'gAlCkoUVLl' || this.bundleId === '4dTgUX97Dk') {
|
|
81
|
-
return 'bundle-icon-gradient-red'
|
|
82
|
-
}
|
|
83
|
-
if (this.bundleId === 'uKLwvbsbPV' || this.bundleId === '9970muCFGV') {
|
|
84
|
-
return 'bundle-icon-gradient-purple'
|
|
85
|
-
}
|
|
86
|
-
if (this.bundleId === 'GVCNrq4ixh' || this.bundleId === '1kS20KPPkH') {
|
|
87
|
-
return 'bundle-icon-gradient-green'
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return 'bundle-icon-gradient-blue'
|
|
51
|
+
if (props.bundleId === 'vtgI9oxCI4') {
|
|
52
|
+
return 'bundle-icon-gradient-pocketprep'
|
|
53
|
+
}
|
|
54
|
+
if (props.bundleId === 'mO5EIsoZ9H' || props.bundleId === 'gAlCkoUVLl' || props.bundleId === '4dTgUX97Dk') {
|
|
55
|
+
return 'bundle-icon-gradient-red'
|
|
56
|
+
}
|
|
57
|
+
if (props.bundleId === 'uKLwvbsbPV' || props.bundleId === '9970muCFGV') {
|
|
58
|
+
return 'bundle-icon-gradient-purple'
|
|
91
59
|
}
|
|
60
|
+
if (props.bundleId === 'GVCNrq4ixh' || props.bundleId === '1kS20KPPkH') {
|
|
61
|
+
return 'bundle-icon-gradient-green'
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return 'bundle-icon-gradient-blue'
|
|
65
|
+
})
|
|
92
66
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
67
|
+
onMounted(() => {
|
|
68
|
+
if (!document.querySelector('.uikit-svg-definitions')) {
|
|
69
|
+
// eslint-disable-next-line no-console
|
|
70
|
+
console.error('You must include SVGDefintions.vue component somewhere in the app for bundle icons to work.')
|
|
98
71
|
}
|
|
99
|
-
}
|
|
72
|
+
})
|
|
100
73
|
</script>
|
|
101
74
|
|
|
102
75
|
<style lang="scss">
|
|
@@ -21,8 +21,9 @@
|
|
|
21
21
|
>
|
|
22
22
|
<span>
|
|
23
23
|
<BundleIcon
|
|
24
|
-
|
|
24
|
+
ref="bundleIcons"
|
|
25
25
|
class="uikit-bundle-list__icon"
|
|
26
|
+
:data-bundle-id="bundle.objectId"
|
|
26
27
|
:bundle-id="bundle.objectId"
|
|
27
28
|
:theme="isDarkMode
|
|
28
29
|
? 'silver'
|
|
@@ -40,74 +41,85 @@
|
|
|
40
41
|
</ul>
|
|
41
42
|
</template>
|
|
42
43
|
|
|
43
|
-
<script lang="ts">
|
|
44
|
-
import type
|
|
45
|
-
import { Vue, Component, Prop, Watch, Emit } from 'vue-facing-decorator'
|
|
44
|
+
<script setup lang="ts">
|
|
45
|
+
import { computed, nextTick, onMounted, ref, useTemplateRef, watch, type ComponentPublicInstance } from 'vue'
|
|
46
46
|
import BundleIcon from '../BundleIcons/BundleIcon.vue'
|
|
47
47
|
import type { Study } from '@pocketprep/types'
|
|
48
|
-
import { dark } from '../../directives'
|
|
48
|
+
import { dark as vDark } from '../../directives'
|
|
49
49
|
import PremiumPill from '../Bundles/PremiumPill.vue'
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
this.hoverBundleId = selectedBundleId
|
|
77
|
-
this.$nextTick(() => {
|
|
78
|
-
this.updateBundleColor()
|
|
79
|
-
this.selectedBundleColor = this.hoverBundleColor
|
|
51
|
+
const {
|
|
52
|
+
modelValue = null,
|
|
53
|
+
isDarkMode,
|
|
54
|
+
premiumBundleIds = [],
|
|
55
|
+
} = defineProps<{
|
|
56
|
+
bundles: Study.Class.BundleJSON[]
|
|
57
|
+
modelValue?: Study.Class.BundleJSON | null
|
|
58
|
+
isDarkMode?: boolean
|
|
59
|
+
premiumBundleIds?: string[]
|
|
60
|
+
}>()
|
|
61
|
+
|
|
62
|
+
const emit = defineEmits<{
|
|
63
|
+
'update:modelValue': [val: Study.Class.BundleJSON]
|
|
64
|
+
}>()
|
|
65
|
+
|
|
66
|
+
const hoverBundleId = ref<string | null>(null)
|
|
67
|
+
const hoverBundleColor = ref<string | null>(null)
|
|
68
|
+
const selectedBundleColor = ref<string | null>(null)
|
|
69
|
+
const bundleIconRefs = useTemplateRef<ComponentPublicInstance[]>('bundleIcons')
|
|
70
|
+
|
|
71
|
+
const hoverBundleRef = computed(() => {
|
|
72
|
+
if (hoverBundleId.value) {
|
|
73
|
+
return bundleIconRefs.value?.find(bundleIconRef => {
|
|
74
|
+
const bundleIconEl: HTMLElement = bundleIconRef.$el
|
|
75
|
+
return hoverBundleId.value === bundleIconEl.getAttribute('data-bundle-id')
|
|
80
76
|
})
|
|
81
|
-
|
|
77
|
+
} else {
|
|
78
|
+
return null
|
|
82
79
|
}
|
|
80
|
+
})
|
|
83
81
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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
|
-
}
|
|
82
|
+
onMounted(() => {
|
|
83
|
+
modelValue && selectBundle(modelValue)
|
|
84
|
+
})
|
|
98
85
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
86
|
+
const selectBundle = (bundle: Study.Class.BundleJSON) => {
|
|
87
|
+
const selectedBundleId = bundle.objectId
|
|
88
|
+
hoverBundleId.value = selectedBundleId
|
|
89
|
+
nextTick(() => {
|
|
90
|
+
updateBundleColor()
|
|
91
|
+
selectedBundleColor.value = hoverBundleColor.value
|
|
92
|
+
})
|
|
93
|
+
emitUpdateModelValue(bundle)
|
|
94
|
+
}
|
|
103
95
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
96
|
+
const updateBundleColor = () => {
|
|
97
|
+
if (hoverBundleId.value) {
|
|
98
|
+
try {
|
|
99
|
+
const gId = hoverBundleRef.value?.$el
|
|
100
|
+
?.querySelector('path')
|
|
101
|
+
?.getAttribute('fill')
|
|
102
|
+
?.split('#')[1]
|
|
103
|
+
?.split(')')[0]
|
|
104
|
+
const stopColor = document.querySelectorAll(`#${gId} stop`)[1]?.getAttribute('stop-color')
|
|
105
|
+
hoverBundleColor.value = stopColor || null
|
|
106
|
+
} catch (err) {
|
|
107
|
+
// no-op
|
|
108
|
+
}
|
|
109
|
+
} else {
|
|
110
|
+
hoverBundleColor.value = null
|
|
109
111
|
}
|
|
110
112
|
}
|
|
113
|
+
|
|
114
|
+
const emitUpdateModelValue = (val: Study.Class.BundleJSON) => {
|
|
115
|
+
emit('update:modelValue', val)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
watch(hoverBundleId, () => {
|
|
119
|
+
nextTick(() => {
|
|
120
|
+
updateBundleColor()
|
|
121
|
+
})
|
|
122
|
+
})
|
|
111
123
|
</script>
|
|
112
124
|
|
|
113
125
|
<style lang="scss">
|
|
@@ -167,4 +179,4 @@ export default class BundleSearch extends Vue {
|
|
|
167
179
|
margin-right: 9px;
|
|
168
180
|
}
|
|
169
181
|
}
|
|
170
|
-
</style>
|
|
182
|
+
</style>
|