@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,184 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-dark="isDarkMode"
|
|
4
|
+
class="uikit-checkbox"
|
|
5
|
+
:class="{
|
|
6
|
+
'uikit-checkbox--focus': focus,
|
|
7
|
+
'uikit-checkbox--disabled': disabled,
|
|
8
|
+
'uikit-checkbox--checked': modelValue === true,
|
|
9
|
+
'uikit-checkbox--checked--disabled': disabled && modelValue === true,
|
|
10
|
+
'uikit-checkbox--indeterminate': modelValue === null
|
|
11
|
+
}"
|
|
12
|
+
:tabindex="disabled ? -1 : 0"
|
|
13
|
+
:aria-checked="modelValue === true ? true : modelValue === null ? 'mixed' : false"
|
|
14
|
+
role="checkbox"
|
|
15
|
+
:aria-hidden="hasLabel"
|
|
16
|
+
@keypress.enter.prevent="!disabled && toggleCheckbox()"
|
|
17
|
+
@keypress.space.prevent="!disabled && toggleCheckbox()"
|
|
18
|
+
@click="!disabled && toggleCheckbox()"
|
|
19
|
+
@focus="focus = true"
|
|
20
|
+
@blur="focus = false"
|
|
21
|
+
@mousedown.prevent
|
|
22
|
+
>
|
|
23
|
+
<Icon
|
|
24
|
+
v-if="modelValue === true"
|
|
25
|
+
v-dark="isDarkMode"
|
|
26
|
+
type="check"
|
|
27
|
+
class="uikit-checkbox__check"
|
|
28
|
+
/>
|
|
29
|
+
<div
|
|
30
|
+
v-if="modelValue === null"
|
|
31
|
+
v-dark="isDarkMode"
|
|
32
|
+
class="uikit-checkbox__line"
|
|
33
|
+
:class="{ 'uikit-checkbox__line--disabled': disabled }"
|
|
34
|
+
/>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script lang="ts">
|
|
39
|
+
import { Component, Vue, Prop, Emit } from 'vue-facing-decorator'
|
|
40
|
+
import Icon from '../Icons/Icon.vue'
|
|
41
|
+
import { dark } from '../../directives'
|
|
42
|
+
|
|
43
|
+
@Component({
|
|
44
|
+
components: {
|
|
45
|
+
Icon,
|
|
46
|
+
},
|
|
47
|
+
directives: {
|
|
48
|
+
dark,
|
|
49
|
+
},
|
|
50
|
+
})
|
|
51
|
+
export default class Checkbox extends Vue {
|
|
52
|
+
@Prop() modelValue!: boolean | null
|
|
53
|
+
@Prop() disabled?: boolean
|
|
54
|
+
@Prop({ default: false }) isDarkMode!: boolean
|
|
55
|
+
@Prop({ default: false }) hasLabel!: boolean
|
|
56
|
+
|
|
57
|
+
hover = false
|
|
58
|
+
focus = false
|
|
59
|
+
|
|
60
|
+
@Emit('update:modelValue')
|
|
61
|
+
toggleCheckbox () {
|
|
62
|
+
return !this.modelValue
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<style lang="scss">
|
|
68
|
+
@import '../../styles/colors';
|
|
69
|
+
@import '../../styles/breakpoints';
|
|
70
|
+
|
|
71
|
+
.uikit-checkbox {
|
|
72
|
+
background: $white;
|
|
73
|
+
border: 1px solid $steel;
|
|
74
|
+
border-radius: 2px;
|
|
75
|
+
width: 18px;
|
|
76
|
+
height: 18px;
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
justify-content: center;
|
|
80
|
+
outline: none;
|
|
81
|
+
box-sizing: border-box;
|
|
82
|
+
position: relative;
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
|
|
85
|
+
&::before {
|
|
86
|
+
content: '';
|
|
87
|
+
left: -3px;
|
|
88
|
+
top: -3px;
|
|
89
|
+
position: absolute;
|
|
90
|
+
width: calc(100% + 6px);
|
|
91
|
+
height: calc(100% + 6px);
|
|
92
|
+
border: 1px solid $brand-blue;
|
|
93
|
+
border-radius: 2px;
|
|
94
|
+
box-sizing: border-box;
|
|
95
|
+
display: none;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&--dark {
|
|
99
|
+
border-color: $pewter;
|
|
100
|
+
background-color: transparent;
|
|
101
|
+
|
|
102
|
+
&::before {
|
|
103
|
+
border-color: $banana-bread;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&--focus:not(&--disabled)::before {
|
|
108
|
+
display: block;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&--checked {
|
|
112
|
+
background: $brand-blue;
|
|
113
|
+
border: 1px solid $brand-blue;
|
|
114
|
+
|
|
115
|
+
&--dark {
|
|
116
|
+
background: $banana-bread;
|
|
117
|
+
border-color: $banana-bread;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&--disabled--dark {
|
|
121
|
+
border-color: $ash !important;
|
|
122
|
+
background: $ash !important;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&--indeterminate {
|
|
127
|
+
border-color: $brand-blue;
|
|
128
|
+
|
|
129
|
+
&--dark {
|
|
130
|
+
border-color: $banana-bread;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&--disabled {
|
|
135
|
+
background: $fog;
|
|
136
|
+
border: 1px solid $steel;
|
|
137
|
+
cursor: default;
|
|
138
|
+
|
|
139
|
+
&--dark {
|
|
140
|
+
background-color: $moonlit-ocean;
|
|
141
|
+
border-color: $slate;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
&--checked#{&}--disabled {
|
|
146
|
+
background: $steel;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&__check {
|
|
150
|
+
color: $white;
|
|
151
|
+
width: 12px;
|
|
152
|
+
height: 11.5px;
|
|
153
|
+
margin-top: 2px;
|
|
154
|
+
|
|
155
|
+
&--dark {
|
|
156
|
+
color: $brand-black;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
&__line {
|
|
161
|
+
width: 10px;
|
|
162
|
+
height: 2px;
|
|
163
|
+
position: absolute;
|
|
164
|
+
top: 50%;
|
|
165
|
+
left: 50%;
|
|
166
|
+
margin-left: -5px;
|
|
167
|
+
margin-top: -1px;
|
|
168
|
+
border-radius: 2px;
|
|
169
|
+
background-color: $brand-blue;
|
|
170
|
+
|
|
171
|
+
&--dark {
|
|
172
|
+
background-color: $banana-bread;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
&--disabled {
|
|
176
|
+
background-color: $steel;
|
|
177
|
+
|
|
178
|
+
&--dark {
|
|
179
|
+
background-color: $slate;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
</style>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
```vue
|
|
2
|
+
<template>
|
|
3
|
+
<div>
|
|
4
|
+
<div class="light">
|
|
5
|
+
<CheckboxOption label="Test Label" v-model="checkboxValue1" />
|
|
6
|
+
</div>
|
|
7
|
+
<div class="dark">
|
|
8
|
+
<CheckboxOption :isDarkMode="true" label="Test Label" v-model="checkboxValue1" />
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
export default {
|
|
15
|
+
data() {
|
|
16
|
+
return {
|
|
17
|
+
checkboxValue1: true,
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<style>
|
|
24
|
+
.light,
|
|
25
|
+
.dark {
|
|
26
|
+
padding: 30px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.dark {
|
|
30
|
+
background-color: #1f3545;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
button {
|
|
34
|
+
margin-bottom: 20px;
|
|
35
|
+
}
|
|
36
|
+
</style>
|
|
37
|
+
```
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="checkboxId"
|
|
4
|
+
v-dark="isDarkMode"
|
|
5
|
+
class="uikit-checkbox-option"
|
|
6
|
+
:class="{ 'uikit-checkbox-option--selected': modelValue }"
|
|
7
|
+
tabindex="0"
|
|
8
|
+
:aria-labelledby="checkboxId"
|
|
9
|
+
role="checkbox"
|
|
10
|
+
:aria-checked="modelValue === true ? true : modelValue === null ? 'mixed' : false"
|
|
11
|
+
@click="emitUpdateModelValue(!modelValue)"
|
|
12
|
+
@keydown.enter="emitUpdateModelValue(!modelValue)"
|
|
13
|
+
@mousedown.prevent
|
|
14
|
+
>
|
|
15
|
+
<Checkbox
|
|
16
|
+
:modelValue="modelValue"
|
|
17
|
+
tabindex="-1"
|
|
18
|
+
:disabled="false"
|
|
19
|
+
class="uikit-checkbox-option__checkbox"
|
|
20
|
+
:is-dark-mode="isDarkMode"
|
|
21
|
+
:has-label="true"
|
|
22
|
+
/>
|
|
23
|
+
<label :id="checkboxId" class="uikit-checkbox-option__label">
|
|
24
|
+
{{ label }}
|
|
25
|
+
</label>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script lang="ts">
|
|
30
|
+
import { Vue, Component, Prop, Emit } from 'vue-facing-decorator'
|
|
31
|
+
import Checkbox from '../Forms/Checkbox.vue'
|
|
32
|
+
import { dark } from '../../directives'
|
|
33
|
+
|
|
34
|
+
@Component({
|
|
35
|
+
directives: {
|
|
36
|
+
dark,
|
|
37
|
+
},
|
|
38
|
+
components: {
|
|
39
|
+
Checkbox,
|
|
40
|
+
},
|
|
41
|
+
})
|
|
42
|
+
export default class CheckboxOption extends Vue {
|
|
43
|
+
@Prop({ default: false }) modelValue!: boolean | null
|
|
44
|
+
@Prop({ default: false }) isDarkMode!: boolean
|
|
45
|
+
@Prop() label!: string
|
|
46
|
+
|
|
47
|
+
checkboxId: null | string = null
|
|
48
|
+
|
|
49
|
+
mounted () {
|
|
50
|
+
this.checkboxId = `checkbox-${Math.round(Math.random() * 1000000)}`
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@Emit('update:modelValue')
|
|
54
|
+
emitUpdateModelValue (val: boolean) {
|
|
55
|
+
return val
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<style lang="scss">
|
|
61
|
+
@import '../../styles/breakpoints';
|
|
62
|
+
@import '../../styles/colors';
|
|
63
|
+
|
|
64
|
+
.uikit-checkbox-option {
|
|
65
|
+
font-size: 15px;
|
|
66
|
+
line-height: 20px;
|
|
67
|
+
color: $slate;
|
|
68
|
+
padding: 4px 0;
|
|
69
|
+
border-radius: 4px;
|
|
70
|
+
cursor: default;
|
|
71
|
+
display: flex;
|
|
72
|
+
align-items: flex-start;
|
|
73
|
+
user-select: none;
|
|
74
|
+
outline: none;
|
|
75
|
+
position: relative;
|
|
76
|
+
z-index: 1;
|
|
77
|
+
|
|
78
|
+
&:hover {
|
|
79
|
+
label {
|
|
80
|
+
color: $slate-03;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&::before {
|
|
84
|
+
display: block;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&:focus {
|
|
89
|
+
label {
|
|
90
|
+
color: $brand-blue;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&::after {
|
|
94
|
+
display: block;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&--dark {
|
|
99
|
+
color: rgba($white, 0.72);
|
|
100
|
+
|
|
101
|
+
&:hover {
|
|
102
|
+
label {
|
|
103
|
+
color: rgba($white, 0.72);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&::before {
|
|
107
|
+
background-color: $pickled-bluewood;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&:focus {
|
|
112
|
+
label {
|
|
113
|
+
color: $white;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&::after {
|
|
117
|
+
border-color: $butterscotch;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&::before {
|
|
123
|
+
content: '';
|
|
124
|
+
top: 0;
|
|
125
|
+
left: -6px;
|
|
126
|
+
right: -6px;
|
|
127
|
+
width: calc(100% + 12px);
|
|
128
|
+
height: 100%;
|
|
129
|
+
display: none;
|
|
130
|
+
position: absolute;
|
|
131
|
+
background: $gray-background;
|
|
132
|
+
border-radius: 4px;
|
|
133
|
+
z-index: -1;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
&::after {
|
|
137
|
+
content: '';
|
|
138
|
+
top: 0;
|
|
139
|
+
left: -6px;
|
|
140
|
+
right: -6px;
|
|
141
|
+
width: calc(100% + 12px);
|
|
142
|
+
height: 100%;
|
|
143
|
+
display: none;
|
|
144
|
+
position: absolute;
|
|
145
|
+
border: 1px solid $brand-blue;
|
|
146
|
+
border-radius: 4px;
|
|
147
|
+
z-index: -1;
|
|
148
|
+
box-sizing: border-box;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
&--selected {
|
|
152
|
+
color: $brand-black;
|
|
153
|
+
|
|
154
|
+
&--dark {
|
|
155
|
+
color: $white;
|
|
156
|
+
|
|
157
|
+
label {
|
|
158
|
+
color: $white !important;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&__label {
|
|
164
|
+
margin-left: 12px;
|
|
165
|
+
width: calc(100% - 27px);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
&__checkbox {
|
|
169
|
+
cursor: auto;
|
|
170
|
+
margin-top: 1px;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
</style>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
```vue
|
|
2
|
+
<template>
|
|
3
|
+
<div>
|
|
4
|
+
<div class="light">
|
|
5
|
+
<Errors :errors="['Error example', 'This is another possible error']" />
|
|
6
|
+
</div>
|
|
7
|
+
<div class="dark">
|
|
8
|
+
<Errors :isDarkMode="true" :errors="['Error example', 'This is another possible error']" />
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<style>
|
|
14
|
+
.light,
|
|
15
|
+
.dark {
|
|
16
|
+
padding: 30px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.dark {
|
|
20
|
+
background-color: #1f3545;
|
|
21
|
+
}
|
|
22
|
+
</style>
|
|
23
|
+
```
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
ref="uikit-errors"
|
|
4
|
+
v-dark="isDarkMode"
|
|
5
|
+
class="uikit-errors"
|
|
6
|
+
:class="{ 'uikit-errors__list': filteredErrors.length > 1 }"
|
|
7
|
+
tabindex="-1"
|
|
8
|
+
>
|
|
9
|
+
<Icon
|
|
10
|
+
v-dark="isDarkMode"
|
|
11
|
+
class="uikit-errors__icon"
|
|
12
|
+
type="warning"
|
|
13
|
+
/>
|
|
14
|
+
<slot name="errors">
|
|
15
|
+
<div
|
|
16
|
+
v-for="error in filteredErrors"
|
|
17
|
+
:key="error"
|
|
18
|
+
v-dark="isDarkMode"
|
|
19
|
+
class="uikit-errors__error"
|
|
20
|
+
>
|
|
21
|
+
<slot name="error" :error="error">
|
|
22
|
+
{{ error }}
|
|
23
|
+
</slot>
|
|
24
|
+
</div>
|
|
25
|
+
</slot>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script lang="ts">
|
|
30
|
+
import { Vue, Component, Prop } from 'vue-facing-decorator'
|
|
31
|
+
import Icon from '../Icons/Icon.vue'
|
|
32
|
+
import { dark } from '../../directives'
|
|
33
|
+
|
|
34
|
+
@Component({
|
|
35
|
+
directives: {
|
|
36
|
+
dark,
|
|
37
|
+
},
|
|
38
|
+
components: {
|
|
39
|
+
Icon,
|
|
40
|
+
},
|
|
41
|
+
})
|
|
42
|
+
export default class Errors extends Vue {
|
|
43
|
+
@Prop({ default: () => ([]) }) errors!: string[]
|
|
44
|
+
@Prop({ default: false }) isDarkMode!: boolean
|
|
45
|
+
|
|
46
|
+
get filteredErrors () {
|
|
47
|
+
return [ ...new Set(this.errors) ]
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
mounted () {
|
|
51
|
+
const errorsEl = this.$refs['uikit-errors'] as HTMLElement | undefined
|
|
52
|
+
errorsEl?.focus()
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
</script>
|
|
56
|
+
|
|
57
|
+
<style lang="scss">
|
|
58
|
+
@import '../../styles/colors';
|
|
59
|
+
@import '../../styles/breakpoints';
|
|
60
|
+
|
|
61
|
+
.uikit-errors {
|
|
62
|
+
border: 1px solid rgba($red-pegasus, 0.5);
|
|
63
|
+
position: relative;
|
|
64
|
+
border-radius: 3px;
|
|
65
|
+
padding: 8px 8px 7px 38px;
|
|
66
|
+
background-color: $red-hint;
|
|
67
|
+
outline: none;
|
|
68
|
+
|
|
69
|
+
&--dark {
|
|
70
|
+
background-color: rgba($brand-red, 0.3);
|
|
71
|
+
border-color: rgba($rosa, 0.5);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&__list {
|
|
75
|
+
.uikit-errors__error {
|
|
76
|
+
&::before {
|
|
77
|
+
content: '•';
|
|
78
|
+
display: inline-block;
|
|
79
|
+
margin-right: 5px;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&__icon {
|
|
85
|
+
position: absolute;
|
|
86
|
+
top: 8px;
|
|
87
|
+
left: 12px;
|
|
88
|
+
height: 20px;
|
|
89
|
+
|
|
90
|
+
&--dark {
|
|
91
|
+
color: $white;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&__error {
|
|
96
|
+
color: $brand-black;
|
|
97
|
+
font-size: 14px;
|
|
98
|
+
line-height: 19px;
|
|
99
|
+
|
|
100
|
+
&--dark {
|
|
101
|
+
color: $white;
|
|
102
|
+
|
|
103
|
+
&::before {
|
|
104
|
+
color: $white;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
</style>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
```vue
|
|
2
|
+
<template>
|
|
3
|
+
<div class="inputs" :class="{ dark: isDarkMode }">
|
|
4
|
+
<Button @click="isDarkMode = !isDarkMode">{{ isDarkMode ? 'Disable' : 'Enable' }} Dark Mode</Button>
|
|
5
|
+
<Input
|
|
6
|
+
label="Standard Input Field"
|
|
7
|
+
placeholder="Transfiguration Year Ones"
|
|
8
|
+
v-model="inputVal1"
|
|
9
|
+
:isDarkMode="isDarkMode"
|
|
10
|
+
/>
|
|
11
|
+
<Input
|
|
12
|
+
label="Disabled Input Field"
|
|
13
|
+
placeholder="Transfiguration Year Ones"
|
|
14
|
+
:disabled="true"
|
|
15
|
+
v-model="inputVal2"
|
|
16
|
+
:isDarkMode="isDarkMode"
|
|
17
|
+
/>
|
|
18
|
+
<Input
|
|
19
|
+
label="Password Field"
|
|
20
|
+
placeholder="6+ characters"
|
|
21
|
+
v-model="inputVal3"
|
|
22
|
+
fieldType="password"
|
|
23
|
+
:isDarkMode="isDarkMode"
|
|
24
|
+
/>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
import Button from '../Buttons/Button.vue'
|
|
30
|
+
|
|
31
|
+
export default {
|
|
32
|
+
components: {
|
|
33
|
+
Button
|
|
34
|
+
},
|
|
35
|
+
data() {
|
|
36
|
+
return {
|
|
37
|
+
inputVal1: null,
|
|
38
|
+
inputVal2: null,
|
|
39
|
+
inputVal3: null,
|
|
40
|
+
isDarkMode: false
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<style>
|
|
47
|
+
.inputs {
|
|
48
|
+
padding: 30px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.dark {
|
|
52
|
+
background-color: #1f3545;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.uikit-btn {
|
|
56
|
+
margin-bottom: 30px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.uikit-input {
|
|
60
|
+
margin-bottom: 20px;
|
|
61
|
+
}
|
|
62
|
+
</style>
|
|
63
|
+
```
|