@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.
Files changed (305) hide show
  1. package/{.eslintrc.js → .eslintrc.cjs} +16 -17
  2. package/dist/@pocketprep/ui-kit.js +18856 -0
  3. package/dist/@pocketprep/ui-kit.js.map +1 -0
  4. package/dist/@pocketprep/ui-kit.umd.cjs +28 -0
  5. package/dist/@pocketprep/ui-kit.umd.cjs.map +1 -0
  6. package/dist/style.css +1 -0
  7. package/lib/SVGDefinitions.vue +85 -0
  8. package/lib/assets/emojis/tada.png +0 -0
  9. package/lib/assets/halftones/halftone-black.png +0 -0
  10. package/lib/assets/halftones/halftone-blue.png +0 -0
  11. package/lib/assets/halftones/halftone-green.png +0 -0
  12. package/lib/assets/halftones/halftone-purple.png +0 -0
  13. package/lib/assets/halftones/halftone-red.png +0 -0
  14. package/lib/assets/halftones/halftone-yellow.png +0 -0
  15. package/lib/assets/question/paywall-dark.png +0 -0
  16. package/lib/assets/question/paywall-light.png +0 -0
  17. package/lib/components/Banners/Banner.md +41 -0
  18. package/lib/components/Banners/Banner.vue +87 -0
  19. package/lib/components/BundleIcons/AMTA.vue +134 -0
  20. package/lib/components/BundleIcons/BundleIcon.md +60 -0
  21. package/lib/components/BundleIcons/BundleIcon.vue +111 -0
  22. package/lib/components/Bundles/BundleList.md +63 -0
  23. package/lib/components/Bundles/BundleList.vue +170 -0
  24. package/lib/components/Bundles/BundleSearch.md +195 -0
  25. package/lib/components/Bundles/BundleSearch.vue +573 -0
  26. package/lib/components/Bundles/PremiumPill.md +23 -0
  27. package/lib/components/Bundles/PremiumPill.vue +43 -0
  28. package/lib/components/Buttons/Button.md +99 -0
  29. package/lib/components/Buttons/Button.vue +496 -0
  30. package/lib/components/Buttons/Link.md +58 -0
  31. package/lib/components/Buttons/Link.vue +192 -0
  32. package/lib/components/Buttons/Tab.md +35 -0
  33. package/lib/components/Buttons/Tab.vue +103 -0
  34. package/lib/components/Calendar/Calendar.md +18 -0
  35. package/lib/components/Calendar/Calendar.vue +162 -0
  36. package/lib/components/Charts/Bar.md +123 -0
  37. package/lib/components/Charts/Bar.vue +364 -0
  38. package/lib/components/Charts/Pie.md +23 -0
  39. package/lib/components/Charts/Pie.vue +105 -0
  40. package/lib/components/Controls/SegmentControl.md +47 -0
  41. package/lib/components/Controls/SegmentControl.vue +117 -0
  42. package/lib/components/Controls/Slider.md +67 -0
  43. package/lib/components/Controls/Slider.vue +358 -0
  44. package/lib/components/Controls/ToggleSwitch.md +56 -0
  45. package/lib/components/Controls/ToggleSwitch.vue +160 -0
  46. package/lib/components/Exams/ExamCard.md +45 -0
  47. package/lib/components/Exams/ExamCard.vue +257 -0
  48. package/lib/components/Exams/ExamMenuCard.md +90 -0
  49. package/lib/components/Exams/ExamMenuCard.vue +218 -0
  50. package/lib/components/Filters/FilterDropdown.md +59 -0
  51. package/lib/components/Filters/FilterDropdown.vue +176 -0
  52. package/lib/components/Filters/FilterOptions.md +65 -0
  53. package/lib/components/Filters/FilterOptions.vue +265 -0
  54. package/lib/components/Filters/filterOptions.d.ts +10 -0
  55. package/lib/components/Forms/Checkbox.md +52 -0
  56. package/lib/components/Forms/Checkbox.vue +184 -0
  57. package/lib/components/Forms/CheckboxOption.md +37 -0
  58. package/lib/components/Forms/CheckboxOption.vue +173 -0
  59. package/lib/components/Forms/Errors.md +23 -0
  60. package/lib/components/Forms/Errors.vue +109 -0
  61. package/lib/components/Forms/Input.md +63 -0
  62. package/lib/components/Forms/Input.vue +310 -0
  63. package/lib/components/Forms/Radio.md +66 -0
  64. package/lib/components/Forms/Radio.vue +312 -0
  65. package/lib/components/Forms/Select.md +133 -0
  66. package/lib/components/Forms/Select.vue +670 -0
  67. package/lib/components/Forms/Textarea.md +57 -0
  68. package/lib/components/Forms/Textarea.vue +157 -0
  69. package/lib/components/Icons/Icon.md +146 -0
  70. package/lib/components/Icons/Icon.vue +192 -0
  71. package/lib/components/Icons/IconAccordionArrow.md +7 -0
  72. package/lib/components/Icons/IconAccordionArrow.vue +23 -0
  73. package/lib/components/Icons/IconActivity.md +7 -0
  74. package/lib/components/Icons/IconActivity.vue +21 -0
  75. package/lib/components/Icons/IconAdd.md +7 -0
  76. package/lib/components/Icons/IconAdd.vue +19 -0
  77. package/lib/components/Icons/IconAddCircle.md +7 -0
  78. package/lib/components/Icons/IconAddCircle.vue +22 -0
  79. package/lib/components/Icons/IconArrow.md +7 -0
  80. package/lib/components/Icons/IconArrow.vue +21 -0
  81. package/lib/components/Icons/IconBarChart.md +7 -0
  82. package/lib/components/Icons/IconBarChart.vue +23 -0
  83. package/lib/components/Icons/IconCalendar.md +7 -0
  84. package/lib/components/Icons/IconCalendar.vue +19 -0
  85. package/lib/components/Icons/IconCheck.md +7 -0
  86. package/lib/components/Icons/IconCheck.vue +21 -0
  87. package/lib/components/Icons/IconClose.md +7 -0
  88. package/lib/components/Icons/IconClose.vue +23 -0
  89. package/lib/components/Icons/IconCorrect.md +7 -0
  90. package/lib/components/Icons/IconCorrect.vue +19 -0
  91. package/lib/components/Icons/IconEdit.md +7 -0
  92. package/lib/components/Icons/IconEdit.vue +21 -0
  93. package/lib/components/Icons/IconExam.md +7 -0
  94. package/lib/components/Icons/IconExam.vue +34 -0
  95. package/lib/components/Icons/IconExternalLink.md +7 -0
  96. package/lib/components/Icons/IconExternalLink.vue +30 -0
  97. package/lib/components/Icons/IconEyeHide.md +7 -0
  98. package/lib/components/Icons/IconEyeHide.vue +21 -0
  99. package/lib/components/Icons/IconEyeShow.md +7 -0
  100. package/lib/components/Icons/IconEyeShow.vue +21 -0
  101. package/lib/components/Icons/IconFilter.md +7 -0
  102. package/lib/components/Icons/IconFilter.vue +19 -0
  103. package/lib/components/Icons/IconFilterActive.md +7 -0
  104. package/lib/components/Icons/IconFilterActive.vue +20 -0
  105. package/lib/components/Icons/IconFlag.md +7 -0
  106. package/lib/components/Icons/IconFlag.vue +25 -0
  107. package/lib/components/Icons/IconFlagFeedback.md +11 -0
  108. package/lib/components/Icons/IconFlagFeedback.vue +24 -0
  109. package/lib/components/Icons/IconFlagFilled.md +7 -0
  110. package/lib/components/Icons/IconFlagFilled.vue +22 -0
  111. package/lib/components/Icons/IconFullView.md +7 -0
  112. package/lib/components/Icons/IconFullView.vue +30 -0
  113. package/lib/components/Icons/IconFullViewActive.md +7 -0
  114. package/lib/components/Icons/IconFullViewActive.vue +28 -0
  115. package/lib/components/Icons/IconHandle.md +7 -0
  116. package/lib/components/Icons/IconHandle.vue +23 -0
  117. package/lib/components/Icons/IconHeart.md +7 -0
  118. package/lib/components/Icons/IconHeart.vue +19 -0
  119. package/lib/components/Icons/IconHelp.md +7 -0
  120. package/lib/components/Icons/IconHelp.vue +25 -0
  121. package/lib/components/Icons/IconHourglass.md +7 -0
  122. package/lib/components/Icons/IconHourglass.vue +22 -0
  123. package/lib/components/Icons/IconImage.md +7 -0
  124. package/lib/components/Icons/IconImage.vue +21 -0
  125. package/lib/components/Icons/IconIncorrect.md +7 -0
  126. package/lib/components/Icons/IconIncorrect.vue +21 -0
  127. package/lib/components/Icons/IconInfo.md +7 -0
  128. package/lib/components/Icons/IconInfo.vue +24 -0
  129. package/lib/components/Icons/IconKeyboard.md +7 -0
  130. package/lib/components/Icons/IconKeyboard.vue +25 -0
  131. package/lib/components/Icons/IconLaunch.md +7 -0
  132. package/lib/components/Icons/IconLaunch.vue +25 -0
  133. package/lib/components/Icons/IconLightning.md +7 -0
  134. package/lib/components/Icons/IconLightning.vue +21 -0
  135. package/lib/components/Icons/IconList.md +7 -0
  136. package/lib/components/Icons/IconList.vue +26 -0
  137. package/lib/components/Icons/IconLoading.md +7 -0
  138. package/lib/components/Icons/IconLoading.vue +65 -0
  139. package/lib/components/Icons/IconLoading2.md +7 -0
  140. package/lib/components/Icons/IconLoading2.vue +52 -0
  141. package/lib/components/Icons/IconLock.md +7 -0
  142. package/lib/components/Icons/IconLock.vue +23 -0
  143. package/lib/components/Icons/IconMissedQuestions.md +7 -0
  144. package/lib/components/Icons/IconMissedQuestions.vue +22 -0
  145. package/lib/components/Icons/IconMoon.md +7 -0
  146. package/lib/components/Icons/IconMoon.vue +25 -0
  147. package/lib/components/Icons/IconPaginationArrow.md +7 -0
  148. package/lib/components/Icons/IconPaginationArrow.vue +23 -0
  149. package/lib/components/Icons/IconPassage.md +7 -0
  150. package/lib/components/Icons/IconPassage.vue +22 -0
  151. package/lib/components/Icons/IconPencil.md +7 -0
  152. package/lib/components/Icons/IconPencil.vue +19 -0
  153. package/lib/components/Icons/IconPeople.md +7 -0
  154. package/lib/components/Icons/IconPeople.vue +25 -0
  155. package/lib/components/Icons/IconQuestions.md +7 -0
  156. package/lib/components/Icons/IconQuestions.vue +25 -0
  157. package/lib/components/Icons/IconQuick10.md +7 -0
  158. package/lib/components/Icons/IconQuick10.vue +23 -0
  159. package/lib/components/Icons/IconRemoveCircle.md +7 -0
  160. package/lib/components/Icons/IconRemoveCircle.vue +22 -0
  161. package/lib/components/Icons/IconReviewFlag.md +7 -0
  162. package/lib/components/Icons/IconReviewFlag.vue +32 -0
  163. package/lib/components/Icons/IconSearch.md +7 -0
  164. package/lib/components/Icons/IconSearch.vue +23 -0
  165. package/lib/components/Icons/IconShare.md +7 -0
  166. package/lib/components/Icons/IconShare.vue +31 -0
  167. package/lib/components/Icons/IconSideBar.md +7 -0
  168. package/lib/components/Icons/IconSideBar.vue +26 -0
  169. package/lib/components/Icons/IconSideBarActive.md +7 -0
  170. package/lib/components/Icons/IconSideBarActive.vue +28 -0
  171. package/lib/components/Icons/IconStopwatch.md +7 -0
  172. package/lib/components/Icons/IconStopwatch.vue +22 -0
  173. package/lib/components/Icons/IconStrike.md +60 -0
  174. package/lib/components/Icons/IconStrike.vue +23 -0
  175. package/lib/components/Icons/IconSubject.md +7 -0
  176. package/lib/components/Icons/IconSubject.vue +22 -0
  177. package/lib/components/Icons/IconText.md +7 -0
  178. package/lib/components/Icons/IconText.vue +22 -0
  179. package/lib/components/Icons/IconWarning.md +7 -0
  180. package/lib/components/Icons/IconWarning.vue +22 -0
  181. package/lib/components/Modal/Modal.md +31 -0
  182. package/lib/components/Modal/Modal.vue +133 -0
  183. package/lib/components/Modal/ModalContainer.md +96 -0
  184. package/lib/components/Modal/ModalContainer.vue +208 -0
  185. package/lib/components/Onboarding/EmailAuth.md +40 -0
  186. package/lib/components/Onboarding/EmailAuth.vue +218 -0
  187. package/lib/components/Onboarding/MagicCodeEntry.md +20 -0
  188. package/lib/components/Onboarding/MagicCodeEntry.vue +189 -0
  189. package/lib/components/PhonePerson/PhonePerson.md +36 -0
  190. package/lib/components/PhonePerson/PhonePerson.vue +48 -0
  191. package/lib/components/PhonePerson/phoneperson-IT@2x.png +0 -0
  192. package/lib/components/PhonePerson/phoneperson-auto@2x.png +0 -0
  193. package/lib/components/PhonePerson/phoneperson-behavioralhealth@2x.png +0 -0
  194. package/lib/components/PhonePerson/phoneperson-emt@2x.png +0 -0
  195. package/lib/components/PhonePerson/phoneperson-essentials@2x.png +0 -0
  196. package/lib/components/PhonePerson/phoneperson-finance@2x.png +0 -0
  197. package/lib/components/PhonePerson/phoneperson-fitness@2x.png +0 -0
  198. package/lib/components/PhonePerson/phoneperson-medical@2x.png +0 -0
  199. package/lib/components/PhonePerson/phoneperson-nursing@2x.png +0 -0
  200. package/lib/components/PhonePerson/phoneperson-nursingschool@2x.png +0 -0
  201. package/lib/components/PhonePerson/phoneperson-professional@2x.png +0 -0
  202. package/lib/components/PhonePerson/phoneperson-skilledtrades@2x.png +0 -0
  203. package/lib/components/Quiz/FlagToggle.md +37 -0
  204. package/lib/components/Quiz/FlagToggle.vue +124 -0
  205. package/lib/components/Quiz/GlobalMetricsToggle.md +46 -0
  206. package/lib/components/Quiz/GlobalMetricsToggle.vue +124 -0
  207. package/lib/components/Quiz/KeyboardShortcutsButton.md +18 -0
  208. package/lib/components/Quiz/KeyboardShortcutsButton.vue +102 -0
  209. package/lib/components/Quiz/KeyboardShortcutsModal.md +71 -0
  210. package/lib/components/Quiz/KeyboardShortcutsModal.vue +261 -0
  211. package/lib/components/Quiz/Question.md +579 -0
  212. package/lib/components/Quiz/Question.vue +3262 -0
  213. package/lib/components/Quiz/QuizContainer.md +91 -0
  214. package/lib/components/Quiz/QuizContainer.vue +207 -0
  215. package/lib/components/Quiz/QuizProgress.md +122 -0
  216. package/lib/components/Quiz/QuizProgress.vue +188 -0
  217. package/lib/components/Quiz/QuizProgressBar.md +131 -0
  218. package/lib/components/Quiz/QuizProgressBar.vue +96 -0
  219. package/lib/components/Search/Pill.md +37 -0
  220. package/lib/components/Search/Pill.vue +117 -0
  221. package/lib/components/Search/Search.md +44 -0
  222. package/lib/components/Search/Search.vue +341 -0
  223. package/lib/components/SidePanels/SidePanel.md +126 -0
  224. package/lib/components/SidePanels/SidePanel.vue +592 -0
  225. package/lib/components/Tables/StudyTable.md +136 -0
  226. package/lib/components/Tables/Table.vue +497 -0
  227. package/lib/components/Tables/TableActions.vue +199 -0
  228. package/lib/components/Tables/TablePagination.md +19 -0
  229. package/lib/components/Tables/TablePagination.vue +109 -0
  230. package/lib/components/Tables/TeachTable.md +696 -0
  231. package/lib/components/Toasts/Toast.md +35 -0
  232. package/lib/components/Toasts/Toast.vue +213 -0
  233. package/lib/components/Tooltips/OverflowTooltip.md +14 -0
  234. package/lib/components/Tooltips/OverflowTooltip.vue +68 -0
  235. package/lib/components/Tooltips/Tooltip.md +72 -0
  236. package/lib/components/Tooltips/Tooltip.vue +143 -0
  237. package/lib/directives.ts +213 -0
  238. package/lib/index.ts +108 -0
  239. package/{pocketprep-export.module.scss → lib/pocketprep-export.module.scss} +2 -2
  240. package/{pocketprep.scss → lib/pocketprep.scss} +16 -18
  241. package/{styles → lib/styles}/_colors.scss +1 -1
  242. package/lib/styles/fonts.css +149 -0
  243. package/lib/utils.ts +53 -0
  244. package/package.json +75 -56
  245. package/{stylelint.config.js → stylelint.config.cjs} +6 -3
  246. package/assets/Fonts.md +0 -114
  247. package/assets/Images.md +0 -2
  248. package/assets/Styleguidist.vue +0 -11
  249. package/dist/@pocketprep/ui-kit.common.js +0 -29726
  250. package/dist/@pocketprep/ui-kit.common.js.map +0 -1
  251. package/dist/@pocketprep/ui-kit.umd.js +0 -29745
  252. package/dist/@pocketprep/ui-kit.umd.js.map +0 -1
  253. package/dist/@pocketprep/ui-kit.umd.min.js +0 -33
  254. package/dist/@pocketprep/ui-kit.umd.min.js.map +0 -1
  255. package/dist/demo.html +0 -1
  256. package/index.d.ts +0 -63
  257. package/src/directives.d.ts +0 -2
  258. package/src/shims.d.ts +0 -19
  259. package/src/utils.d.ts +0 -51
  260. package/styles/Colors.md +0 -53
  261. package/styles/Styles.md +0 -4
  262. package/styles/_fonts.scss +0 -149
  263. package/tests/shims-test.d.ts +0 -9
  264. /package/{assets → lib/assets}/fonts/muli/muli-400.eot +0 -0
  265. /package/{assets → lib/assets}/fonts/muli/muli-400.svg +0 -0
  266. /package/{assets → lib/assets}/fonts/muli/muli-400.ttf +0 -0
  267. /package/{assets → lib/assets}/fonts/muli/muli-400.woff +0 -0
  268. /package/{assets → lib/assets}/fonts/muli/muli-400.woff2 +0 -0
  269. /package/{assets → lib/assets}/fonts/muli/muli-400italic.eot +0 -0
  270. /package/{assets → lib/assets}/fonts/muli/muli-400italic.svg +0 -0
  271. /package/{assets → lib/assets}/fonts/muli/muli-400italic.ttf +0 -0
  272. /package/{assets → lib/assets}/fonts/muli/muli-400italic.woff +0 -0
  273. /package/{assets → lib/assets}/fonts/muli/muli-400italic.woff2 +0 -0
  274. /package/{assets → lib/assets}/fonts/muli/muli-600.eot +0 -0
  275. /package/{assets → lib/assets}/fonts/muli/muli-600.svg +0 -0
  276. /package/{assets → lib/assets}/fonts/muli/muli-600.ttf +0 -0
  277. /package/{assets → lib/assets}/fonts/muli/muli-600.woff +0 -0
  278. /package/{assets → lib/assets}/fonts/muli/muli-600.woff2 +0 -0
  279. /package/{assets → lib/assets}/fonts/muli/muli-600italic.eot +0 -0
  280. /package/{assets → lib/assets}/fonts/muli/muli-600italic.svg +0 -0
  281. /package/{assets → lib/assets}/fonts/muli/muli-600italic.ttf +0 -0
  282. /package/{assets → lib/assets}/fonts/muli/muli-600italic.woff +0 -0
  283. /package/{assets → lib/assets}/fonts/muli/muli-600italic.woff2 +0 -0
  284. /package/{assets → lib/assets}/fonts/muli/muli-700.eot +0 -0
  285. /package/{assets → lib/assets}/fonts/muli/muli-700.svg +0 -0
  286. /package/{assets → lib/assets}/fonts/muli/muli-700.ttf +0 -0
  287. /package/{assets → lib/assets}/fonts/muli/muli-700.woff +0 -0
  288. /package/{assets → lib/assets}/fonts/muli/muli-700.woff2 +0 -0
  289. /package/{assets → lib/assets}/fonts/muli/muli-700italic.eot +0 -0
  290. /package/{assets → lib/assets}/fonts/muli/muli-700italic.svg +0 -0
  291. /package/{assets → lib/assets}/fonts/muli/muli-700italic.ttf +0 -0
  292. /package/{assets → lib/assets}/fonts/muli/muli-700italic.woff +0 -0
  293. /package/{assets → lib/assets}/fonts/muli/muli-700italic.woff2 +0 -0
  294. /package/{assets → lib/assets}/images/amta.svg +0 -0
  295. /package/{assets → lib/assets}/images/favicon.ico +0 -0
  296. /package/{assets → lib/assets}/images/thumb-large-dark.svg +0 -0
  297. /package/{assets → lib/assets}/images/thumb-large.svg +0 -0
  298. /package/{assets → lib/assets}/images/thumb-small-dark.svg +0 -0
  299. /package/{assets → lib/assets}/images/thumb-small.svg +0 -0
  300. /package/{src → lib}/components/BundleIcons/bundleIcon.d.ts +0 -0
  301. /package/{src → lib}/components/Icons/icon.d.ts +0 -0
  302. /package/{src → lib}/components/PhonePerson/phonePerson.d.ts +0 -0
  303. /package/{src → lib}/components/Tables/table.d.ts +0 -0
  304. /package/{styles → lib/styles}/_breakpoints.scss +0 -0
  305. /package/{styles/_normalize.scss → lib/styles/normalize.css} +0 -0
@@ -0,0 +1,218 @@
1
+ <template>
2
+ <div class="uikit-email-auth__form">
3
+ <h1 class="uikit-email-auth__text-big" role="alert">
4
+ Check your email
5
+ </h1>
6
+ <div class="uikit-email-auth__text-small">
7
+ Tap the button in the email we sent to {{ email }} or enter code from email below.
8
+ </div>
9
+ <MagicCodeEntry
10
+ class="uikit-email-auth__magic-code-entry"
11
+ :class="{
12
+ 'uikit-email-auth__magic-code-entry--error': errorMessage,
13
+ }"
14
+ :error="errorMessage"
15
+ @update:modelValue="magicCodeChange"
16
+ @error="(err: string) => errorMessage = err"
17
+ @submit="submitSignIn"
18
+ />
19
+ <div v-if="errorMessage" class="uikit-email-auth__error-message">
20
+ <Icon class="uikit-email-auth__error-message-icon" type="warning" />
21
+ <span>{{ errorMessage }}</span>
22
+ </div>
23
+ <Button
24
+ class="uikit-email-auth__sign-in-btn"
25
+ :class="{
26
+ 'uikit-email-auth__sign-in-btn--error': errorMessage,
27
+ }"
28
+ :disabled="code.length !== 6 || isLoading"
29
+ :autofocus="code.length === 6"
30
+ @click="submitSignIn"
31
+ >
32
+ Sign In
33
+ </Button>
34
+ <Button
35
+ type="tertiary"
36
+ class="uikit-email-auth__resend-email-btn"
37
+ :disabled="isResending"
38
+ @click="resendEmail"
39
+ >
40
+ Resend Email
41
+ </Button>
42
+ </div>
43
+ </template>
44
+
45
+ <script lang="ts">
46
+ import { Vue, Component, Prop, Watch, Emit } from 'vue-facing-decorator'
47
+ import Icon from '../Icons/Icon.vue'
48
+ import Button from '../Buttons/Button.vue'
49
+ import Link from '../Buttons/Link.vue'
50
+ import MagicCodeEntry from '../Onboarding/MagicCodeEntry.vue'
51
+
52
+ @Component({
53
+ components: {
54
+ Button,
55
+ Link,
56
+ Icon,
57
+ MagicCodeEntry,
58
+ },
59
+ })
60
+ export default class EmailAuth extends Vue {
61
+ @Prop({ default: '' }) parentError!: string
62
+ @Prop() email!: string
63
+
64
+ code = ''
65
+ errorMessage = ''
66
+ isLoading = false
67
+ isResending = false
68
+ highlightInput = false
69
+
70
+ @Watch('parentError')
71
+ parentErrorChanged (newVal: string, oldVal: string) {
72
+ if (newVal !== oldVal) {
73
+ this.errorMessage = newVal
74
+ }
75
+ }
76
+
77
+ async submitSignIn () {
78
+ this.isLoading = true
79
+ this.errorMessage = ''
80
+
81
+ if (this.email && this.code) {
82
+ if (this.code.trim().length !== 6) {
83
+ this.errorMessage = 'Code must be six digits'
84
+ } else {
85
+ this.emitSubmit({ email: this.email, code: this.code })
86
+ }
87
+ }
88
+
89
+ this.isLoading = false
90
+ }
91
+
92
+ async resendEmail () {
93
+ this.errorMessage = ''
94
+ this.isResending = true
95
+ this.emitResend({ email: this.email })
96
+ this.isResending = false
97
+ }
98
+
99
+ magicCodeChange (code: string) {
100
+ this.code = code
101
+ this.emitUpdateModelValue(code)
102
+ }
103
+
104
+ @Emit('submit')
105
+ emitSubmit (results: { email: string; code: string}) {
106
+ return results
107
+ }
108
+
109
+ @Emit('resend')
110
+ emitResend (resendInfo: { email: string }) {
111
+ return resendInfo
112
+ }
113
+
114
+ @Emit('update:modelValue')
115
+ emitUpdateModelValue (code: string) {
116
+ return code
117
+ }
118
+ }
119
+ </script>
120
+
121
+ <style lang="scss">
122
+ @import '../../styles/colors';
123
+ @import '../../styles/breakpoints';
124
+
125
+ .uikit-email-auth {
126
+ &__form {
127
+ position: relative;
128
+ display: flex;
129
+ flex-direction: column;
130
+ align-items: center;
131
+ min-height: 503px;
132
+
133
+ @include breakpoint(black-bear) {
134
+ min-height: 550px;
135
+ }
136
+ }
137
+
138
+ &__text-big {
139
+ font-size: 36px;
140
+ line-height: 46px;
141
+ font-weight: 700;
142
+ margin-top: 105px;
143
+ margin-bottom: 13px;
144
+
145
+ @include breakpoint(black-bear) {
146
+ margin-top: 128px;
147
+ }
148
+ }
149
+
150
+ &__text-small {
151
+ font-size: 16px;
152
+ line-height: 23px;
153
+ width: 453px;
154
+ text-align: center;
155
+ margin-bottom: 39px;
156
+
157
+ @include breakpoint(black-bear) {
158
+ width: 303px;
159
+ margin-bottom: 37px;
160
+ }
161
+ }
162
+
163
+ &__magic-code-entry {
164
+ margin-bottom: 27px;
165
+ overflow: hidden;
166
+
167
+ &--error {
168
+ margin-bottom: 15px;
169
+ }
170
+ }
171
+
172
+ &__error-message {
173
+ box-sizing: border-box;
174
+ display: flex;
175
+ align-items: center;
176
+ width: 320px;
177
+ height: 36px;
178
+ background-color: $red-hint;
179
+ border: 1px solid rgba($red-pegasus, 0.5);
180
+ border-radius: 3px;
181
+ font-size: 14px;
182
+ line-height: 17px;
183
+ padding-left: 13px;
184
+ margin-bottom: 28px;
185
+ }
186
+
187
+ &__error-message-icon {
188
+ margin-right: 7px;
189
+ }
190
+
191
+ &__sign-in-btn {
192
+ margin-bottom: 95px;
193
+
194
+ &--error {
195
+ margin-bottom: 41px;
196
+ }
197
+
198
+ @include breakpoint(black-bear) {
199
+ margin-bottom: 106px;
200
+
201
+ &--error {
202
+ margin-bottom: 52px;
203
+ }
204
+ }
205
+ }
206
+
207
+ &__resend-email-btn {
208
+ position: absolute;
209
+ left: 50%;
210
+ transform: translateX(-50%);
211
+ bottom: 24px;
212
+
213
+ @include breakpoint(black-bear) {
214
+ bottom: 44px;
215
+ }
216
+ }
217
+ }
218
+ </style>
@@ -0,0 +1,20 @@
1
+ ```vue
2
+ <template>
3
+ <div>
4
+ <pre>
5
+ Code: {{ code }}
6
+ </pre>
7
+ <MagicCodeEntry v-model="code" />
8
+ </div>
9
+ </template>
10
+
11
+ <script>
12
+ export default {
13
+ data () {
14
+ return {
15
+ code: ''
16
+ }
17
+ }
18
+ }
19
+ </script>
20
+ ```
@@ -0,0 +1,189 @@
1
+ <template>
2
+ <div class="uikit-magic-code" @keydown="handleKeyDown">
3
+ <div
4
+ v-for="n in 6"
5
+ :key="n"
6
+ class="uikit-magic-code__code-input-box"
7
+ :class="{
8
+ 'uikit-magic-code__code-input-box--active': highlightInput && n === cursorIndex + 1,
9
+ 'uikit-magic-code__code-input-box--error': error,
10
+ }"
11
+ />
12
+ <input
13
+ v-model="code"
14
+ aria-label="Magic code input field"
15
+ class="uikit-magic-code__code-input"
16
+ type="text"
17
+ maxlength="6"
18
+ :autofocus="code.length !== 6"
19
+ @focus="highlightInput = true"
20
+ @blur="highlightInput = false"
21
+ @click="handleClick"
22
+ @paste="handlePaste"
23
+ >
24
+ </div>
25
+ </template>
26
+
27
+ <script lang="ts">
28
+ import { Vue, Component, Watch, Prop, Emit } from 'vue-facing-decorator'
29
+
30
+ @Component
31
+ export default class MagicCodeEntry extends Vue {
32
+ @Prop({ default: false }) error!: boolean
33
+
34
+ highlightInput = false
35
+ cursorIndex = 0
36
+ code = ''
37
+
38
+ mounted () {
39
+ // Ensure proper letter spacing for magic code in case of a11y browser extension overrides
40
+ setTimeout(() => {
41
+ const codeInputEl = document.querySelector('.uikit-magic-code__code-input') as HTMLElement | null
42
+ if (codeInputEl) {
43
+ codeInputEl.style.letterSpacing = '35.5px'
44
+ }
45
+ }, 500)
46
+ }
47
+
48
+ handleKeyDown (event: Event | KeyboardEvent) {
49
+ if (!('key' in event)) {
50
+ return
51
+ }
52
+
53
+ // Allow tab, refresh, and paste events to pass through, otherwise prevent default keydown behavior
54
+ if (
55
+ !event.metaKey
56
+ && (
57
+ event.key.match(/^[0-9]$/)
58
+ || event.key === 'ArrowLeft'
59
+ || event.key === 'ArrowRight'
60
+ || event.key === 'Backspace'
61
+ || event.key === 'Enter'
62
+ )
63
+ ) {
64
+ event.preventDefault()
65
+ }
66
+
67
+ if (event.key.match(/[0-9]/)) {
68
+ this.code = this.code.slice(0, this.cursorIndex) + event.key + this.code.slice(this.cursorIndex + 1)
69
+ this.cursorIndex = Math.min(this.cursorIndex + 1, 5)
70
+ } else if (event.key === 'ArrowLeft') {
71
+ this.cursorIndex = Math.max(this.cursorIndex - 1, 0)
72
+ } else if (event.key === 'ArrowRight') {
73
+ this.cursorIndex = Math.min(this.cursorIndex + 1, 5)
74
+ } else if (event.key === 'Backspace') {
75
+ if (this.code[this.cursorIndex]) {
76
+ this.code = (this.code.slice(0, this.cursorIndex) + ' ' + this.code.slice(this.cursorIndex + 1))
77
+ .trimRight()
78
+ }
79
+ this.cursorIndex = Math.min(Math.max(this.cursorIndex - 1, 0), this.code.length)
80
+ } else if (event.key === 'Enter') {
81
+ this.emitSubmit()
82
+ }
83
+ }
84
+
85
+ handleClick (event: MouseEvent) {
86
+ const selectionEnd = (event.target as HTMLInputElement)?.selectionEnd
87
+ if (selectionEnd !== null) {
88
+ this.cursorIndex = selectionEnd
89
+ }
90
+ }
91
+
92
+ handlePaste (event: ClipboardEvent) {
93
+ this.emitError('')
94
+ const pasteValue = event.clipboardData?.getData('text')
95
+ if (pasteValue && typeof Number(pasteValue) === 'number' && pasteValue.length === 6) {
96
+ this.code = ''
97
+ this.cursorIndex = Math.min(pasteValue.length, 5)
98
+ } else if (pasteValue) {
99
+ this.emitError(`Invalid code: ${pasteValue}. Code must be six digits`)
100
+ event.preventDefault()
101
+ }
102
+ }
103
+
104
+ @Watch('code')
105
+ codeChanged (newVal: string) {
106
+ this.emitUpdateModelValue(newVal)
107
+ }
108
+
109
+ @Emit('submit')
110
+ emitSubmit () {
111
+ return true
112
+ }
113
+
114
+ @Emit('error')
115
+ emitError (errorMessage: string) {
116
+ return errorMessage
117
+ }
118
+
119
+ @Emit('update:modelValue')
120
+ emitUpdateModelValue (code: string) {
121
+ return code
122
+ }
123
+ }
124
+ </script>
125
+
126
+ <style lang="scss">
127
+ @import '../../styles/colors';
128
+
129
+ .uikit-magic-code {
130
+ position: relative;
131
+ display: flex;
132
+ padding-left: 39px;
133
+ min-height: 52px;
134
+
135
+ &__code-input-box {
136
+ position: relative;
137
+ background-color: white;
138
+ border: 1px solid $steel;
139
+ border-radius: 4px;
140
+ width: 42px;
141
+ height: 50px;
142
+ margin-right: 10px;
143
+ box-sizing: border-box;
144
+
145
+ &--active {
146
+ border-width: 2px;
147
+ border-color: $brand-blue;
148
+ }
149
+
150
+ &--error {
151
+ border-width: 2px;
152
+ border-color: $red-pegasus;
153
+ }
154
+
155
+ &::after {
156
+ content: '';
157
+ position: absolute;
158
+ top: 0;
159
+ right: -11px;
160
+ width: 9px;
161
+ height: 100%;
162
+ z-index: 2;
163
+ }
164
+ }
165
+
166
+ &__code-input {
167
+ box-sizing: border-box;
168
+ position: absolute;
169
+ font-family: monospace;
170
+ width: 328px;
171
+ height: 50px;
172
+ font-size: 28px;
173
+ line-height: 38px;
174
+ font-weight: 600;
175
+ letter-spacing: 35.5px;
176
+ padding-left: 12px;
177
+ background: none;
178
+ border: none;
179
+ outline: none;
180
+ caret-color: white;
181
+ appearance: none;
182
+
183
+ &::selection {
184
+ color: none;
185
+ background: none;
186
+ }
187
+ }
188
+ }
189
+ </style>
@@ -0,0 +1,36 @@
1
+ ```vue
2
+ <template>
3
+ <div class="phone-people">
4
+ <PhonePerson bundleId="mO5EIsoZ9H" />
5
+ <PhonePerson bundleId="uKLwvbsbPV" />
6
+ <PhonePerson bundleId="gAlCkoUVLl" />
7
+ <PhonePerson bundleId="GVCNrq4ixh" />
8
+ <PhonePerson bundleId="PusoOu7qGQ" />
9
+ <PhonePerson bundleId="1kS20KPPkH" />
10
+ <PhonePerson bundleId="tVMt7KCrkQ" />
11
+ <PhonePerson bundleId="4dTgUX97Dk" />
12
+ <PhonePerson bundleId="9970muCFGV" />
13
+ <PhonePerson bundleId="k9T5L3kC0U" />
14
+ <PhonePerson bundleId="DO5jBm0OJo" />
15
+ </div>
16
+ </template>
17
+
18
+ <script>
19
+ export default {
20
+ data () {
21
+ return {}
22
+ }
23
+ }
24
+ </script>
25
+
26
+ <style>
27
+ .phone-people {
28
+ display: flex;
29
+ flex-wrap: wrap;
30
+ }
31
+
32
+ .phone-people img {
33
+ width: 150px;
34
+ }
35
+ </style>
36
+ ```
@@ -0,0 +1,48 @@
1
+ <template>
2
+ <img v-if="bundleId === 'mO5EIsoZ9H'" :src="urls.PhonePersonSkilledTrades">
3
+ <img v-else-if="bundleId === 'uKLwvbsbPV'" :src="urls.PhonePersonBehavioralHealth">
4
+ <img v-else-if="bundleId === 'gAlCkoUVLl'" :src="urls.PhonePersonEMT">
5
+ <img v-else-if="bundleId === 'DO5jBm0OJo'" :src="urls.PhonePersonEssentials">
6
+ <img v-else-if="bundleId === 'GVCNrq4ixh'" :src="urls.PhonePersonFinance">
7
+ <img v-else-if="bundleId === 'PusoOu7qGQ'" :src="urls.PhonePersonFitness">
8
+ <img v-else-if="bundleId === '1kS20KPPkH'" :src="urls.PhonePersonIT">
9
+ <img v-else-if="bundleId === 'tVMt7KCrkQ'" :src="urls.PhonePersonMedical">
10
+ <img v-else-if="bundleId === '4dTgUX97Dk'" :src="urls.PhonePersonNursing">
11
+ <img v-else-if="bundleId === '9970muCFGV'" :src="urls.PhonePersonNursingSchool">
12
+ <img v-else-if="bundleId === 'k9T5L3kC0U'" :src="urls.PhonePersonProfessional">
13
+ </template>
14
+
15
+ <script lang="ts">
16
+ import { Component, Vue, Prop } from 'vue-facing-decorator'
17
+ import type { TBundleIds } from './phonePerson'
18
+ import PhonePersonBehavioralHealth from './phoneperson-behavioralhealth@2x.png'
19
+ import PhonePersonEMT from './phoneperson-emt@2x.png'
20
+ import PhonePersonEssentials from './phoneperson-essentials@2x.png'
21
+ import PhonePersonFinance from './phoneperson-finance@2x.png'
22
+ import PhonePersonFitness from './phoneperson-fitness@2x.png'
23
+ import PhonePersonIT from './phoneperson-IT@2x.png'
24
+ import PhonePersonMedical from './phoneperson-medical@2x.png'
25
+ import PhonePersonNursing from './phoneperson-nursing@2x.png'
26
+ import PhonePersonNursingSchool from './phoneperson-nursingschool@2x.png'
27
+ import PhonePersonProfessional from './phoneperson-professional@2x.png'
28
+ import PhonePersonSkilledTrades from './phoneperson-skilledtrades@2x.png'
29
+
30
+ @Component
31
+ export default class PhonePerson extends Vue {
32
+ @Prop({ default: 'mO5EIsoZ9H' }) bundleId!: TBundleIds
33
+
34
+ urls = {
35
+ PhonePersonBehavioralHealth,
36
+ PhonePersonEMT,
37
+ PhonePersonEssentials,
38
+ PhonePersonFinance,
39
+ PhonePersonFitness,
40
+ PhonePersonIT,
41
+ PhonePersonMedical,
42
+ PhonePersonNursing,
43
+ PhonePersonNursingSchool,
44
+ PhonePersonProfessional,
45
+ PhonePersonSkilledTrades,
46
+ }
47
+ }
48
+ </script>
@@ -0,0 +1,37 @@
1
+ ```vue
2
+ <template>
3
+ <div class="docs-flag-toggle">
4
+ <FlagToggle
5
+ :is-flagged="isFlagged"
6
+ @toggleFlag="toggleFlag"
7
+ />
8
+ </div>
9
+ </template>
10
+
11
+ <script>
12
+ export default {
13
+ data () {
14
+ return {
15
+ isFlagged: false,
16
+ }
17
+ },
18
+ methods: {
19
+ toggleFlag (newVal) {
20
+ this.isFlagged = newVal
21
+ },
22
+ },
23
+ }
24
+ </script>
25
+
26
+ <style>
27
+ .docs-flag-toggle {
28
+ display: flex;
29
+ align-items: center;
30
+ justify-content: center;
31
+ width: 200px;
32
+ height: 200px;
33
+ background-color: #1f3545;
34
+ color: white;
35
+ }
36
+ </style>
37
+ ```