@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,35 @@
|
|
|
1
|
+
```vue
|
|
2
|
+
<template>
|
|
3
|
+
<div>
|
|
4
|
+
<Button @click="isDarkMode = !isDarkMode">{{ isDarkMode ? 'Disable' : 'Enable' }} Dark Mode</Button>
|
|
5
|
+
<Button @click="showToast1 = !showToast1">{{ showToast1 ? 'Hide' : 'Show' }} Toast 1</Button>
|
|
6
|
+
<Button @click="showToast2 = !showToast2">{{ showToast2 ? 'Hide' : 'Show' }} Toast 1</Button>
|
|
7
|
+
<Toast @close="showToast1 = false" :isDarkMode="isDarkMode" v-if="showToast1">
|
|
8
|
+
ATI TEAS exam added.
|
|
9
|
+
</Toast>
|
|
10
|
+
<Toast @close="showToast2 = false" :isDarkMode="isDarkMode" v-if="showToast2">
|
|
11
|
+
ATI TEAS exam added.
|
|
12
|
+
<template #subtext>
|
|
13
|
+
Edit and remove exams in Settings > Your Exams.
|
|
14
|
+
</template>
|
|
15
|
+
</Toast>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
import Button from '../Buttons/Button.vue'
|
|
21
|
+
|
|
22
|
+
export default {
|
|
23
|
+
components: {
|
|
24
|
+
Button
|
|
25
|
+
},
|
|
26
|
+
data() {
|
|
27
|
+
return {
|
|
28
|
+
isDarkMode: false,
|
|
29
|
+
showToast1: false,
|
|
30
|
+
showToast2: false
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
</script>
|
|
35
|
+
```
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
ref="toast"
|
|
4
|
+
v-dark="isDarkMode"
|
|
5
|
+
class="toast"
|
|
6
|
+
role="alert"
|
|
7
|
+
@mouseenter="clearCloseTimeout"
|
|
8
|
+
@mouseleave="setCloseTimeout"
|
|
9
|
+
>
|
|
10
|
+
<div
|
|
11
|
+
v-if="showCloseButton"
|
|
12
|
+
v-dark="isDarkMode"
|
|
13
|
+
tabindex="0"
|
|
14
|
+
class="toast__close"
|
|
15
|
+
@click="emitClose"
|
|
16
|
+
@keypress.enter="emitClose"
|
|
17
|
+
@mousedown.prevent
|
|
18
|
+
>
|
|
19
|
+
<Icon type="close" />
|
|
20
|
+
</div>
|
|
21
|
+
<div class="toast__icon">
|
|
22
|
+
<Icon type="check" />
|
|
23
|
+
</div>
|
|
24
|
+
<div class="toast__content">
|
|
25
|
+
<div v-dark="isDarkMode" class="toast__content-title">
|
|
26
|
+
<slot />
|
|
27
|
+
</div>
|
|
28
|
+
<div
|
|
29
|
+
v-if="$slots.subtext?.()"
|
|
30
|
+
v-dark="isDarkMode"
|
|
31
|
+
class="toast__content-subtext"
|
|
32
|
+
>
|
|
33
|
+
<slot name="subtext" />
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script lang="ts">
|
|
40
|
+
import { Vue, Component, Prop, Emit } from 'vue-facing-decorator'
|
|
41
|
+
import Icon from '../Icons/Icon.vue'
|
|
42
|
+
import { dark } from '../../directives'
|
|
43
|
+
|
|
44
|
+
@Component({
|
|
45
|
+
directives: {
|
|
46
|
+
dark,
|
|
47
|
+
},
|
|
48
|
+
components: {
|
|
49
|
+
Icon,
|
|
50
|
+
},
|
|
51
|
+
})
|
|
52
|
+
export default class Toast extends Vue {
|
|
53
|
+
@Prop({ default: true }) showCloseButton!: boolean
|
|
54
|
+
@Prop({ default: false }) isDarkMode!: boolean
|
|
55
|
+
|
|
56
|
+
closeTimeout: NodeJS.Timeout | null = null
|
|
57
|
+
|
|
58
|
+
mounted () {
|
|
59
|
+
this.setCloseTimeout()
|
|
60
|
+
const toastEl = this.$refs['toast'] as HTMLElement
|
|
61
|
+
|
|
62
|
+
setTimeout(() => {
|
|
63
|
+
toastEl.classList.add('toast--visible')
|
|
64
|
+
}, 1)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
setCloseTimeout () {
|
|
68
|
+
this.closeTimeout = setTimeout(() => {
|
|
69
|
+
const toastEl = this.$refs['toast'] as HTMLElement
|
|
70
|
+
toastEl?.classList.add('toast--closing')
|
|
71
|
+
|
|
72
|
+
setTimeout(() => {
|
|
73
|
+
this.emitClose()
|
|
74
|
+
}, 300)
|
|
75
|
+
}, 5000)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
clearCloseTimeout () {
|
|
79
|
+
this.closeTimeout && clearTimeout(this.closeTimeout)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@Emit('close')
|
|
83
|
+
emitClose () {
|
|
84
|
+
return true
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
</script>
|
|
88
|
+
|
|
89
|
+
<style lang="scss" scoped>
|
|
90
|
+
@import '../../styles/breakpoints';
|
|
91
|
+
@import '../../styles/colors';
|
|
92
|
+
|
|
93
|
+
.toast {
|
|
94
|
+
background-color: rgba($charcoal, 0.9);
|
|
95
|
+
width: 386px;
|
|
96
|
+
min-height: 49px;
|
|
97
|
+
position: absolute;
|
|
98
|
+
left: -100%;
|
|
99
|
+
bottom: 32px;
|
|
100
|
+
z-index: 1000000;
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: flex-start;
|
|
103
|
+
border-radius: 6px;
|
|
104
|
+
padding: 0 15px;
|
|
105
|
+
box-sizing: border-box;
|
|
106
|
+
|
|
107
|
+
&:hover {
|
|
108
|
+
background-color: $charcoal;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&--visible {
|
|
112
|
+
transition: all 0.5s ease-out;
|
|
113
|
+
left: 32px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&--closing {
|
|
117
|
+
opacity: 0;
|
|
118
|
+
transition: all 0.3s ease-out;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&--dark {
|
|
122
|
+
background-color: rgba($white, 0.9);
|
|
123
|
+
|
|
124
|
+
&:hover {
|
|
125
|
+
background-color: $white;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&__icon {
|
|
130
|
+
color: $jungle-green;
|
|
131
|
+
margin-top: 16px;
|
|
132
|
+
width: 18px;
|
|
133
|
+
height: 14px;
|
|
134
|
+
|
|
135
|
+
svg {
|
|
136
|
+
width: 100%;
|
|
137
|
+
height: 100%;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&__content {
|
|
142
|
+
padding: 15px 0 12px;
|
|
143
|
+
max-width: 313px;
|
|
144
|
+
margin-left: 6px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
&__content-title {
|
|
148
|
+
color: rgba($white, 0.86);
|
|
149
|
+
font-size: 16px;
|
|
150
|
+
line-height: 19px;
|
|
151
|
+
font-weight: 600;
|
|
152
|
+
|
|
153
|
+
&--dark {
|
|
154
|
+
color: $brand-black;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&__content-subtext {
|
|
159
|
+
font-size: 13px;
|
|
160
|
+
line-height: 16px;
|
|
161
|
+
color: rgba($white, 0.8);
|
|
162
|
+
margin-top: 1px;
|
|
163
|
+
margin-bottom: 5px;
|
|
164
|
+
|
|
165
|
+
&--dark {
|
|
166
|
+
color: $ash;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
&__close {
|
|
171
|
+
color: rgba($white, 0.8);
|
|
172
|
+
outline: none;
|
|
173
|
+
position: absolute;
|
|
174
|
+
right: 7px;
|
|
175
|
+
top: 10px;
|
|
176
|
+
cursor: pointer;
|
|
177
|
+
width: 27px;
|
|
178
|
+
height: 27px;
|
|
179
|
+
|
|
180
|
+
svg {
|
|
181
|
+
width: 100%;
|
|
182
|
+
height: 100%;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
&:hover {
|
|
186
|
+
color: $white;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
&:focus::before {
|
|
190
|
+
content: '';
|
|
191
|
+
position: absolute;
|
|
192
|
+
width: 26px;
|
|
193
|
+
height: 26px;
|
|
194
|
+
left: 0;
|
|
195
|
+
top: 0;
|
|
196
|
+
border: 1px solid $banana-bread;
|
|
197
|
+
box-sizing: border-box;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
&--dark {
|
|
201
|
+
color: $slate;
|
|
202
|
+
|
|
203
|
+
&:hover {
|
|
204
|
+
color: $brand-black;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
&:focus::before {
|
|
208
|
+
border-color: $brand-blue;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
</style>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="uikit-overflow-tooltip">
|
|
3
|
+
<Tooltip
|
|
4
|
+
v-if="textOverflows && showTooltip"
|
|
5
|
+
class="uikit-overflow-tooltip__tooltip"
|
|
6
|
+
theme="rightalign"
|
|
7
|
+
>
|
|
8
|
+
<slot />
|
|
9
|
+
</Tooltip>
|
|
10
|
+
<div
|
|
11
|
+
ref="content"
|
|
12
|
+
class="uikit-overflow-tooltip__content"
|
|
13
|
+
@mouseenter="showTooltip = true"
|
|
14
|
+
@mouseleave="showTooltip = false"
|
|
15
|
+
>
|
|
16
|
+
<slot />
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script lang="ts">
|
|
22
|
+
import { Vue, Component } from 'vue-facing-decorator'
|
|
23
|
+
import Tooltip from '../Tooltips/Tooltip.vue'
|
|
24
|
+
|
|
25
|
+
@Component({
|
|
26
|
+
components: {
|
|
27
|
+
Tooltip,
|
|
28
|
+
},
|
|
29
|
+
})
|
|
30
|
+
export default class OverflowTooltip extends Vue {
|
|
31
|
+
showTooltip = false
|
|
32
|
+
textOverflows = false
|
|
33
|
+
|
|
34
|
+
mounted () {
|
|
35
|
+
const content = this.$refs['content'] as HTMLElement
|
|
36
|
+
|
|
37
|
+
this.$nextTick(() => {
|
|
38
|
+
const truncatedWidth = content.getBoundingClientRect().width
|
|
39
|
+
content.style.display = 'inline'
|
|
40
|
+
const fullWidth = content.getBoundingClientRect().width
|
|
41
|
+
content.style.display = 'block'
|
|
42
|
+
this.textOverflows = truncatedWidth < fullWidth
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<style lang="scss">
|
|
49
|
+
@import '../../styles/breakpoints';
|
|
50
|
+
@import '../../styles/colors';
|
|
51
|
+
|
|
52
|
+
.uikit-overflow-tooltip {
|
|
53
|
+
position: relative;
|
|
54
|
+
|
|
55
|
+
&__content {
|
|
56
|
+
max-width: 100%;
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
text-overflow: ellipsis;
|
|
59
|
+
white-space: nowrap;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&__tooltip {
|
|
63
|
+
position: absolute;
|
|
64
|
+
left: 12px;
|
|
65
|
+
top: calc(-100% - 14px);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
</style>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
```vue
|
|
2
|
+
<template>
|
|
3
|
+
<div>
|
|
4
|
+
<Button @click="isDarkMode = !isDarkMode">{{ isDarkMode ? 'Disable' : 'Enable' }} Dark Mode</Button>
|
|
5
|
+
<div class="tooltips" :class="{ dark: isDarkMode }">
|
|
6
|
+
<div class="tooltip-container">
|
|
7
|
+
<Tooltip :isDarkMode="isDarkMode" v-if="showTooltip1">Regular Tooltip</Tooltip>
|
|
8
|
+
<Button @mouseover="showTooltip1 = true" @mouseout="showTooltip1 = false">Tooltip Regular</Button>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="tooltip-container">
|
|
11
|
+
<Tooltip :isDarkMode="isDarkMode" theme="leftalign" v-if="showTooltip2">Left Aligned Tooltip</Tooltip>
|
|
12
|
+
<Button @mouseover="showTooltip2 = true" @mouseout="showTooltip2 = false">Tooltip Left</Button>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="tooltip-container">
|
|
15
|
+
<Tooltip :isDarkMode="isDarkMode" theme="rightalign" v-if="showTooltip3">Right Aligned Tooltip</Tooltip>
|
|
16
|
+
<Button @mouseover="showTooltip3 = true" @mouseout="showTooltip3 = false">Tooltip Right</Button>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="tooltip-container">
|
|
19
|
+
<Tooltip
|
|
20
|
+
v-if="showTooltip4"
|
|
21
|
+
:styles="{
|
|
22
|
+
backgroundColor: '#14ca9e',
|
|
23
|
+
color: '#1f3545'
|
|
24
|
+
}"
|
|
25
|
+
>Custom Style Tooltip</Tooltip>
|
|
26
|
+
<Button @mouseover="showTooltip4 = true" @mouseout="showTooltip4 = false">Tooltip Custom</Button>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script lang="ts">
|
|
33
|
+
import Button from '../Buttons/Button.vue'
|
|
34
|
+
|
|
35
|
+
export default {
|
|
36
|
+
components: {
|
|
37
|
+
Button
|
|
38
|
+
},
|
|
39
|
+
data () {
|
|
40
|
+
return {
|
|
41
|
+
isDarkMode: false,
|
|
42
|
+
showTooltip1: false,
|
|
43
|
+
showTooltip2: false,
|
|
44
|
+
showTooltip3: false,
|
|
45
|
+
showTooltip4: false,
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
}
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<style>
|
|
52
|
+
.tooltips {
|
|
53
|
+
padding: 30px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.dark {
|
|
57
|
+
background-color: #1f3545;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.tooltip-container {
|
|
61
|
+
position: relative;
|
|
62
|
+
display: inline-block;
|
|
63
|
+
margin: 0 10px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.uikit-tooltip {
|
|
67
|
+
position: absolute;
|
|
68
|
+
left: 50%;
|
|
69
|
+
top: -100%;
|
|
70
|
+
}
|
|
71
|
+
</style>
|
|
72
|
+
```
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:id="`tooltip-container-${tooltipId}`"
|
|
4
|
+
class="uikit-tooltip"
|
|
5
|
+
>
|
|
6
|
+
<div
|
|
7
|
+
:id="`tooltip-${tooltipId}`"
|
|
8
|
+
v-dark="isDarkMode"
|
|
9
|
+
class="uikit-tooltip-popup"
|
|
10
|
+
:class="{
|
|
11
|
+
'uikit-tooltip-popup--rightalign': theme === 'rightalign',
|
|
12
|
+
'uikit-tooltip-popup--leftalign': theme === 'leftalign'
|
|
13
|
+
}"
|
|
14
|
+
>
|
|
15
|
+
<div
|
|
16
|
+
v-dark="isDarkMode"
|
|
17
|
+
class="uikit-tooltip-popup__triangle"
|
|
18
|
+
:class="{
|
|
19
|
+
'uikit-tooltip-popup__triangle--rightalign': theme === 'rightalign',
|
|
20
|
+
'uikit-tooltip-popup__triangle--leftalign': theme === 'leftalign'
|
|
21
|
+
}"
|
|
22
|
+
/>
|
|
23
|
+
<span>
|
|
24
|
+
<slot />
|
|
25
|
+
</span>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script lang="ts">
|
|
31
|
+
import { Component, Vue, Prop } from 'vue-facing-decorator'
|
|
32
|
+
import { dark } from '../../directives'
|
|
33
|
+
|
|
34
|
+
@Component({
|
|
35
|
+
directives: {
|
|
36
|
+
dark,
|
|
37
|
+
},
|
|
38
|
+
})
|
|
39
|
+
export default class Tooltip extends Vue {
|
|
40
|
+
@Prop({ default: '' }) theme!: 'leftalign' | 'rightalign'
|
|
41
|
+
@Prop({ default: null }) styles!: null | Record<string, string>
|
|
42
|
+
@Prop({ default: false }) isDarkMode!: boolean
|
|
43
|
+
|
|
44
|
+
tooltipId = Math.floor(Math.random() * 1000000)
|
|
45
|
+
|
|
46
|
+
mounted () {
|
|
47
|
+
this.$nextTick(() => {
|
|
48
|
+
const tooltipEl = document.querySelector(`.uikit-tooltip-popup#tooltip-${this.tooltipId}`) as HTMLElement
|
|
49
|
+
const tooltipWidth = tooltipEl.clientWidth
|
|
50
|
+
const body = document.querySelector('body') as HTMLElement
|
|
51
|
+
const leftOffset = this.theme === 'rightalign'
|
|
52
|
+
? 20
|
|
53
|
+
: this.theme === 'leftalign'
|
|
54
|
+
? tooltipWidth - 20
|
|
55
|
+
: Math.floor(tooltipWidth / 2)
|
|
56
|
+
const left = Math.round(tooltipEl.getBoundingClientRect().left + window.pageXOffset - leftOffset)
|
|
57
|
+
const top = Math.round(tooltipEl.getBoundingClientRect().top + window.pageYOffset)
|
|
58
|
+
|
|
59
|
+
tooltipEl.parentNode?.removeChild(tooltipEl)
|
|
60
|
+
body.appendChild(tooltipEl)
|
|
61
|
+
tooltipEl.style.zIndex = '1002'
|
|
62
|
+
tooltipEl.style.top = `${top}px`
|
|
63
|
+
tooltipEl.style.left = `${left}px`
|
|
64
|
+
tooltipEl.style.position = 'absolute'
|
|
65
|
+
const propStyle = this.styles
|
|
66
|
+
if (propStyle) {
|
|
67
|
+
Object.keys(propStyle).forEach(styleProp => {
|
|
68
|
+
tooltipEl.style[styleProp as 'color'] = propStyle[styleProp] || ''
|
|
69
|
+
})
|
|
70
|
+
if (tooltipEl.style.backgroundColor) {
|
|
71
|
+
const triangleEl = document.querySelector(
|
|
72
|
+
`.uikit-tooltip-popup#tooltip-${this.tooltipId} .uikit-tooltip-popup__triangle`
|
|
73
|
+
) as HTMLElement
|
|
74
|
+
triangleEl.style.borderColor = `${tooltipEl.style.backgroundColor} transparent transparent`
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
})
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
unmounted () {
|
|
81
|
+
const tooltipEl = document.querySelector(`.uikit-tooltip-popup#tooltip-${this.tooltipId}`) as HTMLElement
|
|
82
|
+
tooltipEl.remove()
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
</script>
|
|
86
|
+
|
|
87
|
+
<style lang="scss">
|
|
88
|
+
@import '../../styles/colors';
|
|
89
|
+
@import '../../styles/breakpoints';
|
|
90
|
+
|
|
91
|
+
.uikit-tooltip-popup {
|
|
92
|
+
color: $white;
|
|
93
|
+
background-color: rgba($brand-black, 0.95);
|
|
94
|
+
font-size: 13px;
|
|
95
|
+
font-weight: 600;
|
|
96
|
+
line-height: 18px;
|
|
97
|
+
text-align: left;
|
|
98
|
+
padding: 3px 7px;
|
|
99
|
+
position: relative;
|
|
100
|
+
margin-bottom: 6px;
|
|
101
|
+
border-radius: 4px;
|
|
102
|
+
display: inline-block;
|
|
103
|
+
cursor: default;
|
|
104
|
+
user-select: none;
|
|
105
|
+
word-wrap: none;
|
|
106
|
+
|
|
107
|
+
&--dark {
|
|
108
|
+
color: $brand-black;
|
|
109
|
+
background: $white;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
span {
|
|
113
|
+
position: relative;
|
|
114
|
+
z-index: 1;
|
|
115
|
+
white-space: nowrap;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&__triangle {
|
|
119
|
+
position: absolute;
|
|
120
|
+
left: 50%;
|
|
121
|
+
transform: translateX(-50%);
|
|
122
|
+
bottom: -6px;
|
|
123
|
+
border-left: 6px solid transparent;
|
|
124
|
+
border-right: 6px solid transparent;
|
|
125
|
+
border-top: 6px solid rgba($brand-black, 0.95);
|
|
126
|
+
|
|
127
|
+
&--leftalign {
|
|
128
|
+
left: auto;
|
|
129
|
+
right: 13px;
|
|
130
|
+
transform: none;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&--rightalign {
|
|
134
|
+
left: 14px;
|
|
135
|
+
transform: none;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&--dark {
|
|
139
|
+
border-top-color: $white;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
</style>
|