@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,7 @@
1
+ ```vue
2
+ <template>
3
+ <div>
4
+ <Icon type="subject" />
5
+ </div>
6
+ </template>
7
+ ```
@@ -0,0 +1,22 @@
1
+ <template>
2
+ <!-- eslint-disable -->
3
+ <svg width="25px" height="24px" viewBox="0 0 25 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
4
+ <title>{{ title }}</title>
5
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6
+ <g transform="translate(3.500000, 2.000000)" fill="currentColor">
7
+ <rect fill-opacity="0.1" x="1" y="1" width="4" height="18"></rect>
8
+ <path d="M14,0 C16.209139,0 18,1.790861 18,4 L18,4 L18,16 C18,18.209139 16.209139,20 14,20 L14,20 L3,20 C1.34314575,20 0,18.6568542 0,17 L0,17 L0,3 C0,1.34314575 1.34314575,0 3,0 L3,0 Z M14,2 L5,2 L5,18 L14,18 C15.0543618,18 15.9181651,17.1841222 15.9945143,16.1492623 L16,16 L16,4 C16,2.8954305 15.1045695,2 14,2 L14,2 Z M4,2 L3,2 C2.44771525,2 2,2.44771525 2,3 L2,3 L2,17 C2,17.5522847 2.44771525,18 3,18 L3,18 L4,18 L4,2 Z M13.5,4.5 C13.7761424,4.5 14,4.72385763 14,5 L14,9 C14,9.27614237 13.7761424,9.5 13.5,9.5 L7.5,9.5 C7.22385763,9.5 7,9.27614237 7,9 L7,5 C7,4.72385763 7.22385763,4.5 7.5,4.5 L13.5,4.5 Z M13,5.5 L8,5.5 L8,8.5 L13,8.5 L13,5.5 Z" fill-rule="nonzero"></path>
9
+ </g>
10
+ </g>
11
+ </svg>
12
+ <!-- eslint-enable -->
13
+ </template>
14
+
15
+ <script lang="ts">
16
+ import { Component, Prop, Vue } from 'vue-facing-decorator'
17
+
18
+ @Component
19
+ export default class IconSubject extends Vue {
20
+ @Prop() title!: string
21
+ }
22
+ </script>
@@ -0,0 +1,7 @@
1
+ ```vue
2
+ <template>
3
+ <div>
4
+ <Icon type="text" title="test" />
5
+ </div>
6
+ </template>
7
+ ```
@@ -0,0 +1,22 @@
1
+ <template>
2
+ <!-- eslint-disable -->
3
+ <svg width="30px" height="30px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
4
+ <title>{{ title }}</title>
5
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6
+ <rect x="0" y="0" width="30" height="30" rx="6"></rect>
7
+ <g transform="translate(6.000000, 8.000000)" fill="currentColor">
8
+ <path d="M9.27941176,11 C9.9697677,11 10.5294118,11.5596441 10.5294118,12.25 C10.5294118,12.8972087 10.0375371,13.4295339 9.407217,13.4935464 L9.27941176,13.5 L1.25,13.5 C0.559644063,13.5 0,12.9403559 0,12.25 C0,11.6027913 0.491874664,11.0704661 1.12219476,11.0064536 L1.25,11 L9.27941176,11 Z M16.3088235,5.5 C16.9991795,5.5 17.5588235,6.05964406 17.5588235,6.75 C17.5588235,7.39720869 17.0669489,7.9295339 16.4366288,7.99354639 L16.3088235,8 L1.25,8 C0.559644063,8 4.40536496e-13,7.44035594 4.40536496e-13,6.75 C4.40536496e-13,6.10279131 0.491874664,5.5704661 1.12219476,5.50645361 L1.25,5.5 L16.3088235,5.5 Z M12.5441176,0 C13.2344736,0 13.7941176,0.559644063 13.7941176,1.25 C13.7941176,1.89720869 13.302243,2.4295339 12.6719229,2.49354639 L12.5441176,2.5 L1.25,2.5 C0.559644063,2.5 0,1.94035594 0,1.25 C0,0.602791309 0.491874664,0.0704661011 1.12219476,0.00645360909 L1.25,0 L12.5441176,0 Z"></path>
9
+ </g>
10
+ </g>
11
+ </svg>
12
+ <!-- eslint-enable -->
13
+ </template>
14
+
15
+ <script lang="ts">
16
+ import { Component, Vue, Prop } from 'vue-facing-decorator'
17
+
18
+ @Component
19
+ export default class IconText extends Vue {
20
+ @Prop() title!: string
21
+ }
22
+ </script>
@@ -0,0 +1,7 @@
1
+ ```vue
2
+ <template>
3
+ <div>
4
+ <Icon type="warning" title="test" />
5
+ </div>
6
+ </template>
7
+ ```
@@ -0,0 +1,22 @@
1
+ <template>
2
+ <!-- eslint-disable -->
3
+ <svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
4
+ <title>{{ title }}</title>
5
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6
+ <g transform="translate(-486.000000, -808.000000)"></g>
7
+ <g fill="currentColor">
8
+ <path d="M8.97109821,0.188436935 C9.29757834,0.369814785 9.56674905,0.638985494 9.7481269,0.965465625 L15.7899605,11.8407661 C16.3263869,12.8063335 15.9784993,14.0239401 15.0129318,14.5603665 C14.7158158,14.7254309 14.3815344,14.8120519 14.0416459,14.8120519 L1.95797877,14.8120519 C0.853409272,14.8120519 -0.0420212285,13.9166214 -0.0420212285,12.8120519 C-0.0420212285,12.4721634 0.0445997731,12.1378821 0.209664219,11.8407661 L6.2514978,0.965465625 C6.78792417,-0.000101840421 8.00553075,-0.347989435 8.97109821,0.188436935 Z M8.03242624,10.484962 C7.8001238,10.484962 7.60787351,10.5630637 7.45567537,10.7192671 C7.30347722,10.8754704 7.22737815,11.0617129 7.22737815,11.2779945 C7.22737815,11.4862656 7.30547983,11.6685029 7.46168319,11.8247062 C7.61788655,11.9809096 7.80813423,12.0590113 8.03242624,12.0590113 C8.26472867,12.0590113 8.45697896,11.978907 8.60917711,11.8186984 C8.76137526,11.6584898 8.83747433,11.47425 8.83747433,11.2659788 C8.83747433,11.0496972 8.76137526,10.8654574 8.60917711,10.7132592 C8.45697896,10.5610611 8.26472867,10.484962 8.03242624,10.484962 Z M8.62119275,4.25545113 L7.43164408,4.25545113 L7.43164408,9.49967927 L8.62119275,9.49967927 L8.62119275,4.25545113 Z"></path>
9
+ </g>
10
+ </g>
11
+ </svg>
12
+ <!-- eslint-enable -->
13
+ </template>
14
+
15
+ <script lang="ts">
16
+ import { Component, Vue, Prop } from 'vue-facing-decorator'
17
+
18
+ @Component
19
+ export default class IconWarning extends Vue {
20
+ @Prop() title!: string
21
+ }
22
+ </script>
@@ -0,0 +1,31 @@
1
+ ```vue
2
+ <template>
3
+ <div class="custom-modal-container">
4
+ <Modal :showCloseButton="true">
5
+ <template #head>
6
+ Head section
7
+ </template>
8
+ <div class="modal-content">
9
+ Custom modal component
10
+ </div>
11
+ </Modal>
12
+ </div>
13
+ </template>
14
+
15
+ <script>
16
+ export default {
17
+
18
+ }
19
+ </script>
20
+
21
+ <style>
22
+ .custom-modal-container {
23
+ position: relative;
24
+ }
25
+
26
+ .modal-content {
27
+ background: white;
28
+ padding: 20px;
29
+ }
30
+ </style>
31
+ ```
@@ -0,0 +1,133 @@
1
+ <template>
2
+ <div v-dark="isDarkMode" class="uikit-modal">
3
+ <div
4
+ v-if="showCloseButton"
5
+ v-dark="isDarkMode"
6
+ class="uikit-modal__close"
7
+ tabindex="0"
8
+ aria-label="Close"
9
+ :style="customCloseStyles"
10
+ @mousedown.prevent
11
+ @click="emitClose"
12
+ @keydown.enter="emitClose"
13
+ >
14
+ <IconClose title="close" />
15
+ </div>
16
+ <div v-if="hasHeadSlot" class="uikit-modal__head">
17
+ <slot name="head" />
18
+ </div>
19
+ <slot />
20
+ </div>
21
+ </template>
22
+
23
+ <script lang="ts">
24
+ import { Vue, Component, Prop, Emit } from 'vue-facing-decorator'
25
+ import IconClose from '../Icons/IconClose.vue'
26
+ import { dark } from '../../directives'
27
+
28
+ @Component({
29
+ components: {
30
+ IconClose,
31
+ },
32
+ directives: {
33
+ dark,
34
+ },
35
+ })
36
+ export default class Modal extends Vue {
37
+ @Prop({ default: false }) showCloseButton!: boolean
38
+ @Prop({ default: () => ({}) }) customCloseStyles?: { [key: string]: string }
39
+ @Prop({ default: false }) isDarkMode!: boolean
40
+
41
+ get hasHeadSlot () {
42
+ // See https://github.com/vuejs/core/issues/7002
43
+ return !!(this.$slots.head?.()[0]?.children?.length)
44
+ }
45
+
46
+ @Emit('close')
47
+ emitClose () {
48
+ return true
49
+ }
50
+ }
51
+ </script>
52
+
53
+ <style lang="scss">
54
+ @import '../../styles/colors';
55
+ @import '../../styles/breakpoints';
56
+
57
+ .uikit-modal {
58
+ border-radius: 12px;
59
+ box-shadow: 0 2px 30px 0 rgba($brand-black, 0.1);
60
+ z-index: 10001;
61
+ background-color: $white;
62
+
63
+ &--dark {
64
+ background-color: $moonlit-ocean;
65
+ color: $white;
66
+ box-shadow: 0 1px 6px 0 rgba($jet, 0.3);
67
+ }
68
+
69
+ &__head {
70
+ position: relative;
71
+ width: 100%;
72
+ height: 56px;
73
+ display: flex;
74
+ padding: 0 18px;
75
+ box-sizing: border-box;
76
+ align-items: center;
77
+
78
+ @include breakpoint(brown-bear) {
79
+ padding: 0 16px;
80
+ }
81
+ }
82
+
83
+ &__close {
84
+ position: absolute;
85
+ right: 14px;
86
+ top: 14px;
87
+ z-index: 10;
88
+ color: $brand-blue;
89
+ width: 30px;
90
+ height: 30px;
91
+ cursor: pointer;
92
+ user-select: none;
93
+ outline: none;
94
+
95
+ @include breakpoint(black-bear) {
96
+ right: 16px;
97
+ top: 16px;
98
+ }
99
+
100
+ &:hover {
101
+ color: $brand-black;
102
+ }
103
+
104
+ &:focus::before {
105
+ content: '';
106
+ left: -1px;
107
+ top: -1px;
108
+ width: 100%;
109
+ height: 100%;
110
+ position: absolute;
111
+ border: 1px solid $brand-blue;
112
+ border-radius: 5px;
113
+ }
114
+
115
+ &--dark {
116
+ color: $banana-bread;
117
+
118
+ &:hover {
119
+ color: $butterscotch;
120
+ }
121
+
122
+ &:focus::before {
123
+ border-color: $banana-bread;
124
+ }
125
+ }
126
+
127
+ svg {
128
+ width: 100%;
129
+ height: 100%;
130
+ }
131
+ }
132
+ }
133
+ </style>
@@ -0,0 +1,96 @@
1
+ ```vue
2
+ <template>
3
+ <div>
4
+ <Button @click="showModal1 = true">Show Modal 1</Button>
5
+ <ModalContainer v-if="showModal1" :showCloseButton="true" @close="showModal1 = false">
6
+ <template #head>
7
+ Head section
8
+ </template>
9
+ <div class="modal1">
10
+ Modal 1 with head section and close button
11
+ </div>
12
+ </ModalContainer>
13
+ <Button @click="showModal2 = true">Show Dark Mode Modal 2</Button>
14
+ <ModalContainer v-if="showModal2" :showCloseButton="true" @close="showModal2 = false" :isDarkMode="true">
15
+ <template #head>
16
+ Head section
17
+ </template>
18
+ <div class="modal2">
19
+ Modal 2 with head section and close button
20
+ </div>
21
+ </ModalContainer>
22
+ <Button @click="showModal3 = true">Show Modal 3</Button>
23
+ <ModalContainer v-if="showModal3" :showCloseButton="true" @close="showModal3 = false">
24
+ <template #modal>
25
+ <Modal class="modal3">
26
+ Modal 3 using Modal component for style overrides
27
+ <ul class="modal3__list">
28
+ <li class="modal3__list-item">ABC</li>
29
+ <li class="modal3__list-item">DEF</li>
30
+ <li class="modal3__list-item">GHI</li>
31
+ <li class="modal3__list-item">JKL</li>
32
+ <li class="modal3__list-item">MNO</li>
33
+ <li class="modal3__list-item">PQR</li>
34
+ <li class="modal3__list-item">STU</li>
35
+ <li class="modal3__list-item">VWX</li>
36
+ </ul>
37
+ </Modal>
38
+ </template>
39
+ </ModalContainer>
40
+ </div>
41
+ </template>
42
+
43
+ <script>
44
+ export default {
45
+ data() {
46
+ return {
47
+ showModal1: false,
48
+ showModal2: false,
49
+ showModal3: false,
50
+ }
51
+ }
52
+ }
53
+ </script>
54
+
55
+ <style>
56
+ .modal1,
57
+ .modal2 {
58
+ padding: 20px;
59
+ }
60
+
61
+ .modal3 {
62
+ position: absolute;
63
+ top: 10px;
64
+ right: 10px;
65
+ height: 50px;
66
+ padding: 20px;
67
+ background-color: #0064ff;
68
+ color: white;
69
+ border-radius: 30px;
70
+ }
71
+
72
+ .modal3__list {
73
+ padding: 0;
74
+ list-style: none;
75
+ background-color: white;
76
+ border: 1px solid black;
77
+ color: black;
78
+ }
79
+
80
+ .modal3__list-item {
81
+ padding: 5px;
82
+ }
83
+
84
+ .modal3__list-item:nth-child(-n+7) {
85
+ border-bottom: 1px solid gray;
86
+ }
87
+
88
+ @media (max-width: 767px) {
89
+ .modal3 {
90
+ left: 10px;
91
+ right: 10px;
92
+ height: 90%;
93
+ }
94
+ }
95
+ </style>
96
+ ```
@@ -0,0 +1,208 @@
1
+ <template>
2
+ <div
3
+ ref="modalContainer"
4
+ v-dark="isDarkMode"
5
+ class="uikit-modal-container"
6
+ role="dialog"
7
+ aria-modal="true"
8
+ tabindex="-1"
9
+ @keydown.self.esc="emitClose"
10
+ @keydown.self.enter="emitClose"
11
+ @keydown="keydownListener"
12
+ >
13
+ <div
14
+ class="uikit-modal-container__clickable"
15
+ @click.self="emitClose"
16
+ @mousedown.self.prevent
17
+ />
18
+ <slot name="modal">
19
+ <Modal
20
+ class="uikit-modal-container__modal"
21
+ :show-close-button="showCloseButton"
22
+ :custom-close-styles="customCloseStyles"
23
+ :is-dark-mode="isDarkMode"
24
+ @close="emitClose"
25
+ >
26
+ <template #head>
27
+ <slot name="head" />
28
+ </template>
29
+ <slot />
30
+ </Modal>
31
+ </slot>
32
+ </div>
33
+ </template>
34
+
35
+ <script lang="ts">
36
+ import { Vue, Component, Prop, Emit } from 'vue-facing-decorator'
37
+ import Modal from '../Modal/Modal.vue'
38
+ import { dark } from '../../directives'
39
+
40
+ @Component({
41
+ directives: {
42
+ dark,
43
+ },
44
+ components: {
45
+ Modal,
46
+ },
47
+ })
48
+ export default class ModalContainer extends Vue {
49
+ @Prop({ default: false }) showCloseButton!: boolean
50
+ @Prop({ default: () => ({}) }) customCloseStyles?: { [key: string]: unknown }
51
+ @Prop({ default: false }) isDarkMode!: boolean
52
+
53
+ focusListener: Parameters<typeof addEventListener>[1] | null = null
54
+ savedYPosition = 0
55
+
56
+ mounted () {
57
+ const focusableSelectors = 'button, [href], input, select, textarea, [tabindex]'
58
+
59
+ // Reset focus to last element in modal so next tab will move it to top
60
+ const modalContainerEl = this.$refs['modalContainer'] as HTMLElement
61
+ const modalFocusableEls = Array.from<HTMLElement>(modalContainerEl.querySelectorAll(focusableSelectors))
62
+ if (modalFocusableEls.length) {
63
+ modalFocusableEls[modalFocusableEls.length - 1]?.focus()
64
+ modalFocusableEls[modalFocusableEls.length - 1]?.blur()
65
+ }
66
+
67
+ // Trap the user's focus within the modal - don't allow focusing elements behind the overlay
68
+ this.focusListener = event => {
69
+ const target = (event as FocusEvent).target as HTMLElement // The element receiving focus
70
+ const isFocusOutside = target && modalContainerEl && !modalContainerEl.contains(target)
71
+ const hasCalendarClass = target
72
+ && Array.from(target.classList).find(
73
+ c => c === 'button-next-month' || c === 'button-previous-month' || c === 'day-item'
74
+ )
75
+ if (isFocusOutside && !hasCalendarClass) {
76
+ const focusableModalChildren = Array.from<HTMLElement>(modalContainerEl.querySelectorAll(
77
+ focusableSelectors
78
+ ))
79
+ const firstFocusableModalChild = focusableModalChildren.find(
80
+ el => !!el.getBoundingClientRect().width
81
+ )
82
+ const reversedModalChildren = [ ...focusableModalChildren ].reverse()
83
+ const lastFocusableModalChild = reversedModalChildren.find(
84
+ el => !!el.getBoundingClientRect().width
85
+ )
86
+ if (firstFocusableModalChild) {
87
+ const relatedTarget = (event as FocusEvent).relatedTarget // The element last focused
88
+ if (relatedTarget === firstFocusableModalChild && lastFocusableModalChild) {
89
+ // If focus moves from first element -> outside modal, focus the last element instead
90
+ lastFocusableModalChild.focus()
91
+ } else if (relatedTarget === lastFocusableModalChild && firstFocusableModalChild) {
92
+ // If focus moves from last element -> outside modal, focus the first element instead
93
+ firstFocusableModalChild.focus()
94
+ } else if (relatedTarget && relatedTarget instanceof HTMLElement) {
95
+ // If focus goes outside in a different way, return focus to where it came from if possible
96
+ relatedTarget.focus()
97
+ } else {
98
+ // Otherwise, just return focus to the first element
99
+ firstFocusableModalChild.focus()
100
+ }
101
+ } else {
102
+ // If the modal doesn't have any focusable children, focus the container instead
103
+ if (modalContainerEl.tabIndex === -1) {
104
+ modalContainerEl.tabIndex = 0
105
+ }
106
+ modalContainerEl.focus()
107
+ }
108
+ }
109
+ }
110
+ document.addEventListener('focusin', this.focusListener)
111
+
112
+ // prevent scrolling outside of modal
113
+ const openModalCount = Number(document.body.getAttribute('data-openModalCount'))
114
+ document.body.setAttribute('data-openModalCount', String(openModalCount + 1))
115
+ document.body.classList.add('uikit-modal-open')
116
+ }
117
+
118
+ beforeUnmount () {
119
+ if (this.focusListener) {
120
+ document.removeEventListener('focusin', this.focusListener)
121
+ }
122
+
123
+ const openModalCount = Number(document.body.getAttribute('data-openModalCount'))
124
+ document.body.setAttribute('data-openModalCount', String(openModalCount - 1))
125
+ if (openModalCount <= 1) {
126
+ document.body.classList.remove('uikit-modal-open')
127
+ }
128
+ }
129
+
130
+ keydownListener (e: Event | KeyboardEvent) {
131
+ if (!('key' in e)) {
132
+ return
133
+ }
134
+
135
+ if (e.key.match(/^[A-Za-z0-9\s\-_@]$/)) {
136
+ e.stopPropagation()
137
+ }
138
+
139
+ if (e.key === 'Escape') {
140
+ this.emitClose()
141
+ }
142
+ }
143
+
144
+ @Emit('close')
145
+ emitClose () {
146
+ return true
147
+ }
148
+ }
149
+ </script>
150
+
151
+ <style lang="scss">
152
+ @import '../../styles/colors';
153
+ @import '../../styles/breakpoints';
154
+
155
+ .uikit-modal-container {
156
+ position: absolute;
157
+ top: 0;
158
+ bottom: 0;
159
+ left: 0;
160
+ right: 0;
161
+ background-color: rgba($brand-black, 0.4);
162
+ z-index: 10000;
163
+ overflow: auto;
164
+ -webkit-overflow-scrolling: touch;
165
+ outline: none;
166
+
167
+ @include breakpoint(black-bear) {
168
+ overflow: initial;
169
+ }
170
+
171
+ &--dark {
172
+ background-color: rgba($charcoal, 0.8);
173
+ }
174
+
175
+ &__clickable {
176
+ position: absolute;
177
+ left: 0;
178
+ top: 0;
179
+ width: 100%;
180
+ height: 100%;
181
+ z-index: -1;
182
+ }
183
+
184
+ &__modal {
185
+ position: absolute;
186
+ top: 84px;
187
+ left: 50%;
188
+ transform: translateX(-50%);
189
+ overflow: hidden;
190
+
191
+ @include breakpoint(brown-bear) {
192
+ top: 69px;
193
+ }
194
+
195
+ @include breakpoint(black-bear) {
196
+ top: 0;
197
+ bottom: 0;
198
+ left: 0;
199
+ right: 0;
200
+ transform: none;
201
+ margin: 0;
202
+ border-radius: 0;
203
+ box-shadow: none;
204
+ overflow: auto;
205
+ }
206
+ }
207
+ }
208
+ </style>
@@ -0,0 +1,40 @@
1
+ ```vue
2
+ <template>
3
+ <div>
4
+ <pre>
5
+ Code: {{ code }}
6
+ </pre>
7
+ <EmailAuth
8
+ class="email-auth"
9
+ email="test@pocketprep.com"
10
+ @resend="resendEmail"
11
+ @submit="submitEmailAuth"
12
+ v-model="code"
13
+ />
14
+ </div>
15
+ </template>
16
+
17
+ <script>
18
+ export default {
19
+ data () {
20
+ return {
21
+ code: ''
22
+ }
23
+ },
24
+ methods: {
25
+ resendEmail: function () {
26
+ alert('Resend email')
27
+ },
28
+ submitEmailAuth: function ({ email, code }) {
29
+ alert(`Form submit with data- { email: ${email}, code: ${ code } }`)
30
+ }
31
+ }
32
+ }
33
+ </script>
34
+
35
+ <style>
36
+ .email-auth {
37
+ background-color: #fff9ef;
38
+ }
39
+ </style>
40
+ ```