@propelinc/citrus-ui 0.6.0 → 1.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 (355) hide show
  1. package/README.md +54 -60
  2. package/dist/colors/colors.d.ts +31 -0
  3. package/dist/colors/theme.d.ts +2 -11
  4. package/dist/colors/util-classes.d.ts +11 -0
  5. package/dist/components/CAccordion.vue.d.ts +21 -0
  6. package/dist/components/CAccordionItem.vue.d.ts +41 -0
  7. package/dist/components/CAppBar.vue.d.ts +156 -0
  8. package/dist/components/CBadge.vue.d.ts +52 -0
  9. package/dist/components/CBottomSheet.vue.d.ts +226 -0
  10. package/dist/components/CButton/CButton.vue.d.ts +231 -0
  11. package/dist/components/CButton/types.d.ts +5 -0
  12. package/dist/components/CButtonStack.vue.d.ts +24 -0
  13. package/dist/components/CCard.vue.d.ts +107 -0
  14. package/dist/components/CCardFooter.vue.d.ts +26 -0
  15. package/dist/components/CCardHeader.vue.d.ts +3 -0
  16. package/dist/components/CCardSection.vue.d.ts +17 -0
  17. package/dist/components/CCheckbox.vue.d.ts +145 -0
  18. package/dist/components/CCol.vue.d.ts +21 -0
  19. package/dist/components/CDivider.vue.d.ts +17 -0
  20. package/dist/components/CDobField.vue.d.ts +2109 -0
  21. package/dist/components/CDobSelect.vue.d.ts +398 -0
  22. package/dist/components/CEmailField.vue.d.ts +699 -0
  23. package/dist/components/CExpandTransition.vue.d.ts +19 -0
  24. package/dist/components/CFadeTransition.vue.d.ts +3 -0
  25. package/dist/components/CFileInput.vue.d.ts +98 -0
  26. package/dist/components/CFixedPageFooter.vue.d.ts +106 -0
  27. package/dist/components/CForm.vue.d.ts +29 -0
  28. package/dist/components/CFormFieldCounter.vue.d.ts +42 -0
  29. package/dist/components/CIconButton.vue.d.ts +390 -0
  30. package/dist/components/CLabel.vue.d.ts +32 -0
  31. package/dist/components/CListItem.vue.d.ts +208 -0
  32. package/dist/components/CListItemContent.vue.d.ts +27 -0
  33. package/dist/components/CListItemIcon.vue.d.ts +54 -0
  34. package/dist/components/CLoader.vue.d.ts +73 -0
  35. package/dist/components/CLogo.vue.d.ts +19 -0
  36. package/dist/components/CMaskedTextField.vue.d.ts +2012 -0
  37. package/dist/components/CMenu.vue.d.ts +6 -0
  38. package/dist/components/CMenuItem.vue.d.ts +170 -0
  39. package/dist/components/CMenuLabel.vue.d.ts +3 -0
  40. package/dist/components/CModal.vue.d.ts +206 -0
  41. package/dist/components/CModalLoading.vue.d.ts +230 -0
  42. package/dist/components/CNotification.vue.d.ts +589 -0
  43. package/dist/components/CPhoneField.vue.d.ts +2088 -0
  44. package/dist/components/CPill.vue.d.ts +42 -0
  45. package/dist/components/CPillGroup.vue.d.ts +70 -0
  46. package/dist/components/CPopup.vue.d.ts +21 -0
  47. package/dist/components/CProgressLinear.vue.d.ts +61 -0
  48. package/dist/components/CProgressRing.vue.d.ts +103 -0
  49. package/dist/components/CRadio.vue.d.ts +73 -0
  50. package/dist/components/CRadioGroup.vue.d.ts +123 -0
  51. package/dist/components/CRebrand.vue.d.ts +28 -0
  52. package/dist/components/CRow.vue.d.ts +67 -0
  53. package/dist/components/CSafeArea.vue.d.ts +18 -0
  54. package/dist/components/CSectionHeader.vue.d.ts +28 -0
  55. package/dist/components/CSelect.vue.d.ts +293 -0
  56. package/dist/components/CSkeleton.vue.d.ts +3 -0
  57. package/dist/components/CSkeletonLoaderCard.vue.d.ts +21 -0
  58. package/dist/components/CSkeletonLoaderCircle.vue.d.ts +5 -0
  59. package/dist/components/CSkeletonLoaderText.vue.d.ts +44 -0
  60. package/dist/components/CSlideFadeTransition.vue.d.ts +58 -0
  61. package/dist/components/CSplitInput.vue.d.ts +2131 -0
  62. package/dist/components/CSquaredIcon.vue.d.ts +47 -0
  63. package/dist/components/CSsnField.vue.d.ts +2083 -0
  64. package/dist/components/CStatusDot.vue.d.ts +27 -0
  65. package/dist/components/CSwitch.vue.d.ts +54 -0
  66. package/dist/components/CSwitchListItem.vue.d.ts +392 -0
  67. package/dist/components/CTextArea.vue.d.ts +240 -0
  68. package/dist/components/CTextField.vue.d.ts +647 -0
  69. package/dist/components/CTextLink.vue.d.ts +55 -0
  70. package/dist/components/CThirdPartyLogo.vue.d.ts +128 -0
  71. package/dist/components/CTimeago.vue.d.ts +12 -0
  72. package/dist/components/CToast.vue.d.ts +458 -0
  73. package/dist/components/CToastsList.vue.d.ts +430 -0
  74. package/dist/components/CValidationMessage.vue.d.ts +45 -0
  75. package/dist/components/CZipcodeField.vue.d.ts +2080 -0
  76. package/dist/components/index.d.ts +66 -25
  77. package/dist/components/internal/CCloseButton.vue.d.ts +14 -0
  78. package/dist/composables/accessibility.d.ts +1 -0
  79. package/dist/composables/animation.d.ts +12 -0
  80. package/dist/composables/binding.d.ts +19 -0
  81. package/dist/composables/colors.d.ts +13 -0
  82. package/dist/composables/elements.d.ts +3 -0
  83. package/dist/composables/fields.d.ts +9 -0
  84. package/dist/composables/gestures.d.ts +53 -0
  85. package/dist/composables/i18n.d.ts +3 -0
  86. package/dist/composables/id.d.ts +11 -0
  87. package/dist/composables/input-mask.d.ts +18 -0
  88. package/dist/composables/router.d.ts +30 -0
  89. package/dist/composables/slots.d.ts +2 -0
  90. package/dist/composables/toast.d.ts +21 -0
  91. package/dist/composables/validations.d.ts +77 -0
  92. package/dist/index.css +1 -0
  93. package/dist/index.d.ts +5 -4
  94. package/dist/index.mjs +11738 -0
  95. package/dist/index.mjs.map +1 -0
  96. package/dist/plugin.d.ts +2 -2
  97. package/dist/services/animation.d.ts +17 -0
  98. package/dist/services/directives/index.d.ts +2 -0
  99. package/dist/services/directives/scroll-into-view.d.ts +7 -0
  100. package/dist/services/directives/tap-animation.d.ts +6 -0
  101. package/dist/services/id.d.ts +22 -0
  102. package/dist/services/injections/accordions.d.ts +3 -0
  103. package/dist/services/injections/animations.d.ts +2 -0
  104. package/dist/services/injections/buttons.d.ts +4 -0
  105. package/dist/services/injections/forms.d.ts +6 -0
  106. package/dist/services/injections/icon-buttons.d.ts +3 -0
  107. package/dist/services/injections/pills.d.ts +4 -0
  108. package/dist/services/injections/radio.d.ts +10 -0
  109. package/dist/styles/main.css +3002 -0
  110. package/dist/styles/utils.css +2319 -0
  111. package/dist/theme/icons.d.ts +35 -2
  112. package/dist/types/CForm.d.ts +12 -0
  113. package/dist/types/font-awesome.d.ts +5 -0
  114. package/dist/types.d.ts +12 -0
  115. package/index.ts +2 -0
  116. package/package.json +60 -45
  117. package/src/assets/fonts/grenette-regular.woff2 +0 -0
  118. package/src/assets/fonts/grenette-semibold.woff2 +0 -0
  119. package/src/assets/fonts/polymath.woff2 +0 -0
  120. package/src/assets/logos/propel/icon.svg +15 -0
  121. package/src/assets/logos/propel/lockup.svg +11 -0
  122. package/src/colors/colors.ts +173 -0
  123. package/src/colors/theme.ts +8 -14
  124. package/src/colors/util-classes.ts +49 -0
  125. package/src/componentResolver.js +33 -0
  126. package/src/components/CAccordion.vue +32 -7
  127. package/src/components/CAccordionItem.vue +109 -36
  128. package/src/components/CAppBar.vue +237 -0
  129. package/src/components/CBadge.vue +74 -0
  130. package/src/components/CBottomSheet.vue +430 -0
  131. package/src/components/CButton/CButton.vue +347 -0
  132. package/src/components/CButton/types.ts +5 -0
  133. package/src/components/CButtonStack.vue +36 -0
  134. package/src/components/CCard.vue +149 -41
  135. package/src/components/CCardFooter.vue +11 -27
  136. package/src/components/CCardHeader.vue +30 -21
  137. package/src/components/CCardSection.vue +23 -12
  138. package/src/components/CCheckbox.vue +191 -21
  139. package/src/components/CCol.vue +55 -0
  140. package/src/components/CDivider.vue +46 -0
  141. package/src/components/CDobField.vue +153 -0
  142. package/src/components/CDobSelect.vue +274 -0
  143. package/src/components/CEmailField.vue +61 -0
  144. package/src/components/CExpandTransition.vue +55 -0
  145. package/src/components/CFadeTransition.vue +23 -0
  146. package/src/components/CFileInput.vue +186 -0
  147. package/src/components/CFixedPageFooter.vue +76 -0
  148. package/src/components/CForm.vue +86 -0
  149. package/src/components/CFormFieldCounter.vue +40 -0
  150. package/src/components/CIconButton.vue +175 -59
  151. package/src/components/CLabel.vue +52 -0
  152. package/src/components/CListItem.vue +149 -45
  153. package/src/components/CListItemContent.vue +60 -0
  154. package/src/components/CListItemIcon.vue +27 -31
  155. package/src/components/CLoader.vue +156 -0
  156. package/src/components/CLogo.vue +23 -0
  157. package/src/components/CMaskedTextField.vue +118 -0
  158. package/src/components/CMenu.vue +24 -0
  159. package/src/components/CMenuItem.vue +106 -0
  160. package/src/components/CMenuLabel.vue +26 -0
  161. package/src/components/CModal.vue +198 -79
  162. package/src/components/CModalLoading.vue +27 -9
  163. package/src/components/CNotification.vue +86 -53
  164. package/src/components/CPhoneField.vue +69 -0
  165. package/src/components/CPill.vue +162 -0
  166. package/src/components/CPillGroup.vue +73 -0
  167. package/src/components/CPopup.vue +66 -0
  168. package/src/components/CProgressLinear.vue +52 -0
  169. package/src/components/CProgressRing.vue +126 -0
  170. package/src/components/CRadio.vue +138 -0
  171. package/src/components/CRadioGroup.vue +142 -0
  172. package/src/components/CRebrand.vue +28 -0
  173. package/src/components/CRow.vue +62 -0
  174. package/src/components/CSafeArea.vue +23 -0
  175. package/src/components/CSectionHeader.vue +50 -0
  176. package/src/components/CSelect.vue +223 -74
  177. package/src/components/CSkeleton.vue +65 -0
  178. package/src/components/CSkeletonLoaderCard.vue +29 -0
  179. package/src/components/CSkeletonLoaderCircle.vue +18 -14
  180. package/src/components/CSkeletonLoaderText.vue +127 -17
  181. package/src/components/CSlideFadeTransition.vue +100 -0
  182. package/src/components/CSplitInput.vue +111 -0
  183. package/src/components/CSquaredIcon.vue +83 -0
  184. package/src/components/CSsnField.vue +86 -0
  185. package/src/components/CStatusDot.vue +70 -0
  186. package/src/components/CSwitch.vue +125 -0
  187. package/src/components/CSwitchListItem.vue +110 -0
  188. package/src/components/CTextArea.vue +193 -47
  189. package/src/components/CTextField.vue +450 -93
  190. package/src/components/CTextLink.vue +48 -38
  191. package/src/components/CThirdPartyLogo.vue +127 -0
  192. package/src/components/CTimeago.vue +63 -0
  193. package/src/components/CToast.vue +259 -0
  194. package/src/components/CToastsList.vue +32 -0
  195. package/src/components/CValidationMessage.vue +70 -0
  196. package/src/components/CZipcodeField.vue +69 -0
  197. package/src/components/index.ts +66 -25
  198. package/src/components/internal/CCloseButton.vue +57 -0
  199. package/src/composables/accessibility.ts +29 -0
  200. package/src/composables/animation.ts +95 -0
  201. package/src/composables/binding.ts +34 -0
  202. package/src/composables/colors.ts +59 -0
  203. package/src/composables/elements.ts +72 -0
  204. package/src/composables/fields.ts +19 -0
  205. package/src/composables/gestures.ts +197 -0
  206. package/src/composables/i18n.ts +13 -0
  207. package/src/composables/id.ts +23 -0
  208. package/src/composables/input-mask.ts +139 -0
  209. package/src/composables/router.ts +64 -0
  210. package/src/composables/slots.ts +57 -0
  211. package/src/composables/toast.ts +64 -0
  212. package/src/composables/validations.ts +214 -0
  213. package/src/index.ts +7 -7
  214. package/src/plugin.ts +13 -6
  215. package/src/services/animation.ts +101 -0
  216. package/src/services/directives/index.ts +2 -0
  217. package/src/services/directives/scroll-into-view.ts +86 -0
  218. package/src/services/directives/tap-animation.ts +71 -0
  219. package/src/services/id.ts +31 -0
  220. package/src/services/injections/accordions.ts +4 -0
  221. package/src/services/injections/animations.ts +3 -0
  222. package/src/services/injections/buttons.ts +5 -0
  223. package/src/services/injections/forms.ts +8 -0
  224. package/src/services/injections/icon-buttons.ts +4 -0
  225. package/src/services/injections/pills.ts +7 -0
  226. package/src/services/injections/radio.ts +12 -0
  227. package/src/shims-vue.d.ts +6 -3
  228. package/src/styles/_animation.scss +19 -0
  229. package/src/styles/_button.scss +61 -0
  230. package/src/styles/_colors.scss +58 -11
  231. package/src/styles/_core.scss +248 -87
  232. package/src/styles/_form-fields.scss +68 -15
  233. package/src/styles/_grenette.scss +13 -0
  234. package/src/styles/_polymath.scss +14 -0
  235. package/src/styles/_reset.scss +105 -0
  236. package/src/styles/_shoelace.scss +46 -0
  237. package/src/styles/_typography.scss +40 -10
  238. package/src/styles/main.scss +6 -3
  239. package/src/styles/utils/a11y.scss +18 -0
  240. package/src/styles/utils/typography.scss +13 -0
  241. package/src/styles/utils.scss +560 -0
  242. package/src/styles/variables.scss +27 -15
  243. package/src/theme/icons.ts +16 -5
  244. package/src/types/CForm.ts +15 -0
  245. package/src/types/font-awesome.ts +6 -0
  246. package/src/types.ts +15 -0
  247. package/.browserslistrc +0 -3
  248. package/.eslintrc.js +0 -4
  249. package/.stylelintrc.js +0 -3
  250. package/babel.config.js +0 -3
  251. package/dist/citrus-ui.common.js +0 -43434
  252. package/dist/citrus-ui.common.js.map +0 -1
  253. package/dist/citrus-ui.css +0 -1
  254. package/dist/citrus-ui.umd.js +0 -43444
  255. package/dist/citrus-ui.umd.js.map +0 -1
  256. package/dist/citrus-ui.umd.min.js +0 -27
  257. package/dist/citrus-ui.umd.min.js.map +0 -1
  258. package/dist/demo.html +0 -10
  259. package/dist/fonts/Blitz-Script.85ed9abe.woff2 +0 -0
  260. package/dist/fonts/ObjectSans-Bold.5492f3d5.woff2 +0 -0
  261. package/dist/fonts/ObjectSans-BoldSlanted.29e2a87e.woff2 +0 -0
  262. package/dist/fonts/ObjectSans-Heavy.d0b2f035.woff2 +0 -0
  263. package/dist/fonts/ObjectSans-HeavySlanted.45e9c063.woff2 +0 -0
  264. package/dist/fonts/ObjectSans-Light.f885dec3.woff2 +0 -0
  265. package/dist/fonts/ObjectSans-LightSlanted.b8eb7c12.woff2 +0 -0
  266. package/dist/fonts/ObjectSans-Regular.e4ea0b90.woff2 +0 -0
  267. package/dist/fonts/ObjectSans-Slanted.57a90be9.woff2 +0 -0
  268. package/dist/fonts/ObjectSans-Thin.86d44227.woff2 +0 -0
  269. package/dist/fonts/ObjectSans-ThinSlanted.20342160.woff2 +0 -0
  270. package/jest.config.js +0 -9
  271. package/plopfile.js +0 -67
  272. package/project.json +0 -69
  273. package/src/assets/fonts/Blitz-Script.woff2 +0 -0
  274. package/src/assets/fonts/ObjectSans-Bold.woff2 +0 -0
  275. package/src/assets/fonts/ObjectSans-BoldSlanted.woff2 +0 -0
  276. package/src/assets/fonts/ObjectSans-Heavy.woff2 +0 -0
  277. package/src/assets/fonts/ObjectSans-HeavySlanted.woff2 +0 -0
  278. package/src/assets/fonts/ObjectSans-Light.woff2 +0 -0
  279. package/src/assets/fonts/ObjectSans-LightSlanted.woff2 +0 -0
  280. package/src/assets/fonts/ObjectSans-Regular.woff2 +0 -0
  281. package/src/assets/fonts/ObjectSans-Slanted.woff2 +0 -0
  282. package/src/assets/fonts/ObjectSans-Thin.woff2 +0 -0
  283. package/src/assets/fonts/ObjectSans-ThinSlanted.woff2 +0 -0
  284. package/src/components/CAlert.vue +0 -78
  285. package/src/components/CBanner.vue +0 -47
  286. package/src/components/CButton.vue +0 -146
  287. package/src/components/CListItemAction.vue +0 -29
  288. package/src/components/CSegmentedButton.vue +0 -47
  289. package/src/components/CSegmentedButtonOption.vue +0 -42
  290. package/src/components/helpers/FormField.vue +0 -48
  291. package/src/components/helpers/SelectInput.vue +0 -115
  292. package/src/shims-scss.d.ts +0 -4
  293. package/src/shims-vuetify.d.ts +0 -4
  294. package/src/styles/_blitz.scss +0 -8
  295. package/src/styles/_object-sans.scss +0 -23
  296. package/storybook-static/0.799c368cbe88266827ba.manager.bundle.js +0 -1
  297. package/storybook-static/0.a9f0a9ad.iframe.bundle.js +0 -3
  298. package/storybook-static/0.a9f0a9ad.iframe.bundle.js.LICENSE.txt +0 -8
  299. package/storybook-static/0.a9f0a9ad.iframe.bundle.js.map +0 -1
  300. package/storybook-static/1.0438fd8d.iframe.bundle.js +0 -3
  301. package/storybook-static/1.0438fd8d.iframe.bundle.js.LICENSE.txt +0 -17
  302. package/storybook-static/1.0438fd8d.iframe.bundle.js.map +0 -1
  303. package/storybook-static/1.9ebd2fb519f6726108de.manager.bundle.js +0 -1
  304. package/storybook-static/10.348d8814.iframe.bundle.js +0 -3
  305. package/storybook-static/10.348d8814.iframe.bundle.js.LICENSE.txt +0 -30
  306. package/storybook-static/10.348d8814.iframe.bundle.js.map +0 -1
  307. package/storybook-static/10.a85ea1a67689be8e19ff.manager.bundle.js +0 -1
  308. package/storybook-static/11.f4e922583ae35da460f3.manager.bundle.js +0 -2
  309. package/storybook-static/11.f4e922583ae35da460f3.manager.bundle.js.LICENSE.txt +0 -12
  310. package/storybook-static/12.1415460941f0bdcb8fa8.manager.bundle.js +0 -1
  311. package/storybook-static/2.75a17459.iframe.bundle.js +0 -3
  312. package/storybook-static/2.75a17459.iframe.bundle.js.LICENSE.txt +0 -26
  313. package/storybook-static/2.75a17459.iframe.bundle.js.map +0 -1
  314. package/storybook-static/5.f459d151315e6780c20f.manager.bundle.js +0 -2
  315. package/storybook-static/5.f459d151315e6780c20f.manager.bundle.js.LICENSE.txt +0 -8
  316. package/storybook-static/6.3bd64d820f3745f262ff.manager.bundle.js +0 -1
  317. package/storybook-static/6.ce8d99b4.iframe.bundle.js +0 -1
  318. package/storybook-static/7.3d04765dbf3f1dcd706c.manager.bundle.js +0 -1
  319. package/storybook-static/7.6633a922.iframe.bundle.js +0 -3
  320. package/storybook-static/7.6633a922.iframe.bundle.js.LICENSE.txt +0 -12
  321. package/storybook-static/7.6633a922.iframe.bundle.js.map +0 -1
  322. package/storybook-static/8.b541eadfcb9164835dfc.manager.bundle.js +0 -1
  323. package/storybook-static/8.fc5e1ebf.iframe.bundle.js +0 -1
  324. package/storybook-static/9.411ac8e451bbb10926c7.manager.bundle.js +0 -1
  325. package/storybook-static/9.724ac3ed.iframe.bundle.js +0 -3
  326. package/storybook-static/9.724ac3ed.iframe.bundle.js.LICENSE.txt +0 -15
  327. package/storybook-static/9.724ac3ed.iframe.bundle.js.map +0 -1
  328. package/storybook-static/css/main.95216119.css +0 -1
  329. package/storybook-static/css/vendors~main.02dc89bf.css +0 -1
  330. package/storybook-static/favicon.ico +0 -0
  331. package/storybook-static/fonts/Blitz-Script.85ed9abe.woff2 +0 -0
  332. package/storybook-static/fonts/ObjectSans-Bold.5492f3d5.woff2 +0 -0
  333. package/storybook-static/fonts/ObjectSans-BoldSlanted.29e2a87e.woff2 +0 -0
  334. package/storybook-static/fonts/ObjectSans-Heavy.d0b2f035.woff2 +0 -0
  335. package/storybook-static/fonts/ObjectSans-HeavySlanted.45e9c063.woff2 +0 -0
  336. package/storybook-static/fonts/ObjectSans-Light.f885dec3.woff2 +0 -0
  337. package/storybook-static/fonts/ObjectSans-LightSlanted.b8eb7c12.woff2 +0 -0
  338. package/storybook-static/fonts/ObjectSans-Regular.e4ea0b90.woff2 +0 -0
  339. package/storybook-static/fonts/ObjectSans-Slanted.57a90be9.woff2 +0 -0
  340. package/storybook-static/fonts/ObjectSans-Thin.86d44227.woff2 +0 -0
  341. package/storybook-static/fonts/ObjectSans-ThinSlanted.20342160.woff2 +0 -0
  342. package/storybook-static/iframe.html +0 -348
  343. package/storybook-static/index.html +0 -51
  344. package/storybook-static/main.7b4aec9c4352d4bb535b.manager.bundle.js +0 -1
  345. package/storybook-static/main.9e8c64c7.iframe.bundle.js +0 -1
  346. package/storybook-static/runtime~main.91a0c7330ab317d35c4a.manager.bundle.js +0 -1
  347. package/storybook-static/runtime~main.e4da100f.iframe.bundle.js +0 -1
  348. package/storybook-static/vendors~main.6660eda6.iframe.bundle.js +0 -7
  349. package/storybook-static/vendors~main.6660eda6.iframe.bundle.js.LICENSE.txt +0 -80
  350. package/storybook-static/vendors~main.6660eda6.iframe.bundle.js.map +0 -1
  351. package/storybook-static/vendors~main.f7f16cebbf3aa96a4f89.manager.bundle.js +0 -2
  352. package/storybook-static/vendors~main.f7f16cebbf3aa96a4f89.manager.bundle.js.LICENSE.txt +0 -110
  353. package/tsconfig.dist.json +0 -7
  354. package/tsconfig.json +0 -24
  355. package/vue.config.js +0 -5
@@ -1,3 +1,36 @@
1
- import type { VuetifyIcons } from 'vuetify/types/services/icons';
2
- declare const Icons: Partial<VuetifyIcons>;
1
+ import { DefineComponent } from 'vue';
2
+ import { FontAwesomeIconProps } from '@fortawesome/vue-fontawesome';
3
+ import { IconDefinition } from '@fortawesome/pro-light-svg-icons';
4
+ declare const Icons: {
5
+ readonly citrusCheckboxOn: {
6
+ readonly component: DefineComponent<FontAwesomeIconProps>;
7
+ readonly props: {
8
+ readonly icon: IconDefinition;
9
+ };
10
+ };
11
+ readonly citrusCheckboxOff: {
12
+ readonly component: DefineComponent<FontAwesomeIconProps>;
13
+ readonly props: {
14
+ readonly icon: IconDefinition;
15
+ };
16
+ };
17
+ readonly citrusRadioOn: {
18
+ readonly component: DefineComponent<FontAwesomeIconProps>;
19
+ readonly props: {
20
+ readonly icon: IconDefinition;
21
+ };
22
+ };
23
+ readonly citrusRadioOff: {
24
+ readonly component: DefineComponent<FontAwesomeIconProps>;
25
+ readonly props: {
26
+ readonly icon: IconDefinition;
27
+ };
28
+ };
29
+ readonly citrusClear: {
30
+ readonly component: DefineComponent<FontAwesomeIconProps>;
31
+ readonly props: {
32
+ readonly icon: IconDefinition;
33
+ };
34
+ };
35
+ };
3
36
  export default Icons;
@@ -0,0 +1,12 @@
1
+ import { Ref } from 'vue';
2
+ import { default as CForm } from '../components/CForm.vue';
3
+ export interface ValidationState {
4
+ id: string;
5
+ validate: () => boolean;
6
+ valid: Ref<boolean>;
7
+ field?: Ref<HTMLElement | null>;
8
+ }
9
+ export type CFormRef = typeof CForm & {
10
+ validate: () => boolean;
11
+ inputs: ValidationState[];
12
+ };
@@ -0,0 +1,5 @@
1
+ import { IconDefinition, IconName, IconPrefix } from '@fortawesome/fontawesome-svg-core';
2
+ import { PropType } from 'vue';
3
+ export type FaIconArray = [IconPrefix, IconName];
4
+ export type FaIcon = IconName | FaIconArray | IconDefinition;
5
+ export type FaPropType = PropType<FaIcon>;
@@ -0,0 +1,12 @@
1
+ export interface SplitInputField {
2
+ characters: number;
3
+ placeholder?: string;
4
+ separator?: string;
5
+ }
6
+ export type SplitInputRule = (v: string) => string | boolean;
7
+ export declare enum InputVariants {
8
+ DEFAULT = "default",
9
+ CONTAINED = "contained",
10
+ SEGMENTED = "segmented"
11
+ }
12
+ export type ToastVariant = 'info' | 'success' | 'error' | 'warning';
package/index.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { default } from './src';
2
+ export * from './src';
package/package.json CHANGED
@@ -1,61 +1,76 @@
1
1
  {
2
2
  "name": "@propelinc/citrus-ui",
3
- "version": "0.6.0",
3
+ "version": "1.0.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/propelinc/citrus-ui"
7
7
  },
8
8
  "license": "UNLICENSED",
9
- "scripts": {
10
- "generate:component": "plop component"
11
- },
12
- "main": "./dist/citrus-ui.common.js",
13
- "types": "./dist/index.d.ts",
9
+ "main": "./dist/index.mjs",
10
+ "files": [
11
+ "dist",
12
+ "src",
13
+ "index.ts"
14
+ ],
14
15
  "dependencies": {
15
- "@fortawesome/fontawesome-svg-core": "1.2.35",
16
- "@fortawesome/pro-light-svg-icons": "5.15.3",
17
- "@fortawesome/pro-solid-svg-icons": "5.15.3",
18
- "@fortawesome/vue-fontawesome": "^2.0.2",
19
- "core-js": "^3.6.5",
20
- "vue": "^2.6.10",
21
- "vue-class-component": "^7.2.3",
22
- "vue-property-decorator": "^9.1.2",
23
- "vuetify": "2.2.26"
16
+ "@fortawesome/fontawesome-svg-core": "6.6.0",
17
+ "@fortawesome/pro-light-svg-icons": "6.6.0",
18
+ "@fortawesome/pro-regular-svg-icons": "6.6.0",
19
+ "@fortawesome/pro-solid-svg-icons": "6.6.0",
20
+ "@fortawesome/vue-fontawesome": "3.1.2",
21
+ "@shoelace-style/shoelace": "2.15.0",
22
+ "core-js": "3.21.0",
23
+ "dayjs": "1.11.13",
24
+ "i18next": "19.0.0",
25
+ "lodash": "4.17.23",
26
+ "maska": "^2.1.11",
27
+ "scroll-into-view-if-needed": "^3.1.0",
28
+ "vue": "3.5.18",
29
+ "@propelinc/shared-utils": "0.0.0"
24
30
  },
25
31
  "devDependencies": {
26
- "@babel/core": "7.17.2",
27
- "@storybook/addon-essentials": "^6.0.26",
28
- "@storybook/addon-links": "^6.0.26",
29
- "@storybook/storybook-deployer": "2.8.7",
30
- "@storybook/vue": "^6.0.26",
31
- "@types/jest": "^24.0.19",
32
- "@vue/cli-plugin-babel": "~4.5.0",
33
- "@vue/cli-plugin-eslint": "~4.5.0",
34
- "@vue/cli-plugin-typescript": "~4.5.0",
35
- "@vue/cli-plugin-unit-jest": "~4.5.0",
36
- "@vue/cli-service": "~4.5.0",
37
- "@vue/test-utils": "^1.1.4",
38
- "babel-loader": "8.2.3",
39
- "css-loader": "5.2.7",
40
- "plop": "2.7.4",
41
- "postcss": "8.2.13",
42
- "prettier": "^2.2.1",
43
- "react": "17.0.2",
44
- "react-dom": "17.0.2",
45
- "sass": "1.32.0",
46
- "sass-loader": "~8.0.2",
47
- "tsc-alias": "1.3.7",
48
- "typescript": "~4.1.5",
49
- "vue-cli-plugin-storybook": "~2.0.0",
50
- "vue-cli-plugin-vuetify": "~2.4.0",
51
- "vue-loader": "15.7.0",
52
- "vue-router": "^3.5.1",
53
- "vue-template-compiler": "^2.6.11",
54
- "vuetify-loader": "^1.7.0"
32
+ "@chromatic-com/storybook": "3.2.7",
33
+ "@storybook/addon-a11y": "8.6.15",
34
+ "@storybook/addon-essentials": "8.6.15",
35
+ "@storybook/addon-links": "8.6.15",
36
+ "@storybook/addon-mdx-gfm": "8.6.15",
37
+ "@storybook/blocks": "8.6.15",
38
+ "@storybook/vue3-vite": "8.6.15",
39
+ "@types/lodash": "4.17.23",
40
+ "@vitejs/plugin-vue": "6.0.0",
41
+ "@vue/test-utils": "2.4.6",
42
+ "@vue/vue3-jest": "^29.2.6",
43
+ "autoprefixer": "^10.4.21",
44
+ "react-syntax-highlighter": "15.6.6",
45
+ "sass": "1.45.0",
46
+ "storybook": "8.6.15",
47
+ "storybook-addon-vue-mdx": "1.0.6",
48
+ "storybook-vue3-router": "5.0.0",
49
+ "vite": "6.4.1",
50
+ "vite-plugin-dts": "^4.0.0",
51
+ "vitest": "3.1.4",
52
+ "vue-router": "4.5.1",
53
+ "vue-tsc": "3.1.0",
54
+ "@propelinc/test-utils": "0.0.1"
55
55
  },
56
56
  "lint-staged": {
57
57
  "*.{js,ts,vue}": "eslint --fix",
58
58
  "*.{scss,vue}": "stylelint --fix",
59
59
  "*": "prettier --write --ignore-unknown --ignore-path='../../.prettierignore'"
60
+ },
61
+ "scripts": {
62
+ "build": "vite build && pnpm run build:styles",
63
+ "build:styles": "node scripts/build-styles.mjs"
64
+ },
65
+ "module": "./dist/index.mjs",
66
+ "types": "./dist/index.d.ts",
67
+ "exports": {
68
+ ".": {
69
+ "types": "./dist/index.d.ts",
70
+ "import": "./dist/index.mjs"
71
+ },
72
+ "./styles/main.css": "./dist/styles/main.css",
73
+ "./styles/utils.css": "./dist/styles/utils.css",
74
+ "./src/*": "./src/*"
60
75
  }
61
- }
76
+ }
Binary file
@@ -0,0 +1,15 @@
1
+ <svg width="30" height="37" viewBox="0 0 30 37" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_911_9050)">
3
+ <path d="M7.39438 0.692966C7.39438 0.692966 6.35052 1.4649 5.56982 2.23683C5.3242 2.44735 5.35052 2.66665 5.36806 2.98244C5.44701 4.04384 5.64876 6.40349 7.25403 8.14033C8.85052 9.87718 10.9119 9.64033 10.9119 9.64033L15.2979 8.67542L7.39438 0.692966Z" fill="black" stroke="black" stroke-width="0.964912" stroke-linecap="round" stroke-linejoin="round"/>
4
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M0.482422 22.6316C0.482422 29.6754 6.42979 35.386 13.7719 35.386C21.114 35.386 27.0614 29.6754 27.0614 22.6316C27.0614 15.5877 21.114 9.8772 13.7719 9.8772C6.42979 9.8772 0.482422 15.5877 0.482422 22.6316ZM7.8947 22.6316C7.8947 25.9123 10.6666 28.5702 14.0877 28.5702C17.5087 28.5702 20.2807 25.9123 20.2807 22.6316C20.2807 19.3509 17.5087 16.693 14.0877 16.693C10.6666 16.693 7.8947 19.3509 7.8947 22.6316Z" fill="black" stroke="black" stroke-width="0.964912" stroke-linecap="round" stroke-linejoin="round"/>
5
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M2.73633 22.0965C2.73633 29.4912 8.72755 35.4824 16.1223 35.4824C23.517 35.4824 29.5083 29.4912 29.5083 22.0965C29.5083 14.7017 23.517 8.71051 16.1223 8.71051C8.72755 8.71051 2.73633 14.7017 2.73633 22.0965ZM9.88545 22.0965C9.88545 25.5438 12.6749 28.3333 16.1223 28.3333C19.5697 28.3333 22.3591 25.5438 22.3591 22.0965C22.3591 18.6491 19.5697 15.8596 16.1223 15.8596C12.6749 15.8596 9.88545 18.6491 9.88545 22.0965Z" fill="#FFC120" stroke="black" stroke-width="0.978516" stroke-linecap="round" stroke-linejoin="round"/>
6
+ <path d="M4.88672 13.1491C7.41303 10.9912 9.76391 9.74562 13.3078 9.00001" stroke="black" stroke-width="0.973684" stroke-miterlimit="10" stroke-linecap="round"/>
7
+ <path d="M9.53516 34.7193C12.7808 35.7193 15.7281 35.8597 18.9211 35.193" stroke="black" stroke-width="0.973684" stroke-miterlimit="10" stroke-linecap="round"/>
8
+ <path d="M15.2988 8.67545C15.4742 8.64036 15.6321 8.54387 15.7286 8.38598C16.4567 7.21054 16.1672 4.71054 14.6146 3.28948C12.869 1.7544 11.5707 2.0965 8.44792 0.614046C7.6409 0.228081 6.99178 0.736853 7.11459 1.71054C7.23739 2.68422 8.04441 6.3772 10.3339 7.91229C11.9655 9.00001 14.4655 8.85966 15.2988 8.68422V8.67545Z" fill="#8BC95A" stroke="black" stroke-width="0.978516" stroke-linecap="round" stroke-linejoin="round"/>
9
+ </g>
10
+ <defs>
11
+ <clipPath id="clip0_911_9050">
12
+ <rect width="30" height="36.0877" fill="white"/>
13
+ </clipPath>
14
+ </defs>
15
+ </svg>
@@ -0,0 +1,11 @@
1
+ <svg width="120" height="38" viewBox="0 0 120 38" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M40.3101 22.5039H36.5387C36.383 22.5039 36.2563 22.6306 36.2563 22.7863V29.808C36.2563 30.018 36.0862 30.1881 35.8763 30.1881H32.2206C32.0107 30.1881 31.8406 30.018 31.8406 29.808V8.18892C31.8406 7.98261 32.0107 7.8125 32.2206 7.8125H40.3101C44.5847 7.8125 48.0594 10.5488 48.0594 15.1419C48.0594 19.735 44.5847 22.5039 40.3101 22.5039ZM36.2563 18.2764C36.2563 18.432 36.383 18.5587 36.5387 18.5587H40.1364C42.4275 18.5587 43.6437 17.1109 43.6437 15.1383C43.6437 13.1657 42.4275 11.7505 40.1364 11.7505H36.5387C36.383 11.7505 36.2563 11.8772 36.2563 12.0328V18.2728V18.2764Z" fill="black"/>
3
+ <path d="M53.7021 14.5594V15.3919C53.7021 15.533 53.8723 15.5945 53.9664 15.4932C54.7771 14.6064 56.2937 14.0454 57.9116 14.0454H58.9214C59.1313 14.0454 59.3015 14.2155 59.3015 14.4255V17.7119C59.3015 17.9219 59.1313 18.092 58.9214 18.092H57.879C55.1499 18.092 53.7021 19.8438 53.7021 22.4064V29.8118C53.7021 30.0218 53.532 30.1919 53.3221 30.1919H49.8329C49.623 30.1919 49.4529 30.0218 49.4529 29.8118V14.5594C49.4529 14.3495 49.623 14.1793 49.8329 14.1793H53.3221C53.532 14.1793 53.7021 14.3495 53.7021 14.5594Z" fill="black"/>
4
+ <path d="M76.9102 22.1999C76.9102 27.0174 73.1713 30.6224 68.2162 30.6224C63.2611 30.6224 59.5222 27.0174 59.5222 22.1999C59.5222 17.3824 63.2611 13.7412 68.2162 13.7412C73.1713 13.7412 76.9102 17.3462 76.9102 22.1999ZM63.7715 22.1999C63.7715 24.8639 65.6898 26.7134 68.2198 26.7134C70.7498 26.7134 72.6681 24.8602 72.6681 22.1999C72.6681 19.5396 70.7462 17.6502 68.2198 17.6502C65.6934 17.6502 63.7715 19.5034 63.7715 22.1999Z" fill="black"/>
5
+ <path d="M87.5261 30.6224C85.9046 30.6224 84.2505 30.1193 83.1538 29.2181C83.0307 29.1167 82.8425 29.2 82.8425 29.3629V36.6814C82.8425 36.8914 82.6724 37.0615 82.4625 37.0615H78.9733C78.7634 37.0615 78.5933 36.8914 78.5933 36.6814V14.5556C78.5933 14.3457 78.7634 14.1756 78.9733 14.1756H82.4625C82.6724 14.1756 82.8425 14.3457 82.8425 14.5556V15.0478C82.8425 15.1781 82.9909 15.2469 83.0886 15.1637C84.1853 14.2335 85.8684 13.7412 87.5261 13.7412C92.6803 13.7412 95.7134 17.7842 95.7134 22.1637C95.7134 26.5433 92.6803 30.6224 87.5261 30.6224ZM87.1895 17.6502C84.931 17.6502 82.676 19.1342 82.676 22.1637C82.676 25.1932 84.9346 26.7134 87.1895 26.7134C89.7159 26.7134 91.4677 24.625 91.4677 22.1637C91.4677 19.7025 89.7159 17.6502 87.1895 17.6502Z" fill="black"/>
6
+ <path d="M112.989 25.3344C113.264 25.3344 113.449 25.6167 113.337 25.8664C111.983 28.791 108.917 30.6224 105.674 30.6224C100.686 30.6224 97.0127 27.0174 97.0127 22.1637C97.0127 17.31 100.549 13.7412 105.504 13.7412C110.459 13.7412 113.829 17.3824 113.829 22.0986C113.829 22.5184 113.829 22.855 113.796 23.2351C113.778 23.4305 113.615 23.5826 113.42 23.5826H101.801C101.609 23.5826 101.468 23.7708 101.53 23.9518C102.091 25.6601 103.72 26.717 105.674 26.717C106.955 26.717 108.114 26.3515 108.863 25.4755C108.939 25.3887 109.044 25.3344 109.156 25.3344H112.989ZM108.968 20.4119C109.149 20.4119 109.286 20.2418 109.243 20.0644C108.838 18.4103 107.332 17.3788 105.504 17.3788C103.676 17.3788 102.033 18.4393 101.602 20.0608C101.555 20.2382 101.696 20.4119 101.877 20.4119H108.968Z" fill="black"/>
7
+ <path d="M120 8.18912V29.8082C120 30.0182 119.83 30.1883 119.62 30.1883H116.131C115.921 30.1883 115.751 30.0182 115.751 29.8082V8.18912C115.751 7.97919 115.921 7.80908 116.131 7.80908H119.62C119.83 7.80908 120 7.97919 120 8.18912Z" fill="black"/>
8
+ <path d="M13.725 7.37832C14.1268 6.19475 13.7757 4.37054 12.556 3.25212C11.6909 2.49203 10.9561 2.26762 10.0259 1.98531C9.3672 1.78623 8.6252 1.56182 7.61899 1.08405C7.17018 0.8705 6.71774 0.892218 6.37751 1.14196C6.34132 1.1673 6.30512 1.19988 6.27255 1.22884C6.08795 1.37 5.40025 1.89481 4.85009 2.43412C4.50262 2.74539 4.52796 3.1001 4.54606 3.3607V3.3969C4.61483 4.24023 4.77046 6.22008 6.14224 7.7113C6.5802 8.18545 7.05435 8.49312 7.50317 8.69219C6.46438 9.15186 5.49436 9.73821 4.49539 10.4947C4.29993 10.6395 4.10448 10.7915 3.91989 10.9507C3.86922 10.9905 3.81854 11.0304 3.76787 11.0738C3.74615 11.0919 3.72806 11.11 3.71358 11.1281C1.43693 13.1441 0 16.0904 0 19.3696C0 24.3102 3.26476 28.5016 7.74929 29.8987C7.77463 29.9095 7.79634 29.9204 7.8253 29.9276C9.39615 30.3873 10.8946 30.6153 12.3967 30.6153C13.5332 30.6153 14.6697 30.485 15.8352 30.2244C15.8388 30.2244 15.8461 30.2208 15.8497 30.2208C21.0581 29.1024 24.9707 24.4622 24.9707 18.9244C24.9707 12.6555 19.9505 7.53757 13.7214 7.37469L13.725 7.37832ZM12.7333 23.5827C11.738 23.4379 10.815 22.9782 10.0911 22.2544C9.2007 21.364 8.71207 20.184 8.71207 18.9244C8.71207 17.2341 9.60608 15.7502 10.9489 14.9213C11.0539 14.9141 11.1625 14.9068 11.271 14.9068C13.7323 14.9068 15.7338 16.9084 15.7338 19.3696C15.7338 21.3169 14.4779 22.9746 12.7369 23.5827H12.7333Z" fill="black"/>
9
+ <path d="M11.9405 3.93626C11.2347 3.31371 10.6447 3.13636 9.75796 2.86852C9.10284 2.66945 8.28846 2.42332 7.22433 1.91659C7.14832 1.8804 7.07231 1.8623 7.0144 1.8623C6.97459 1.8623 6.94201 1.86954 6.9203 1.88763C6.86238 1.93107 6.80447 2.06499 6.83705 2.30026C6.95649 3.20875 7.60438 5.79666 9.15713 6.83183C10.2502 7.56297 12.0418 7.50506 12.6897 7.36752C12.7151 7.36028 12.7295 7.34942 12.7368 7.33856C13.3449 6.34682 12.6861 4.62034 11.9405 3.93626Z" fill="#8BC95A"/>
10
+ <path d="M13.4209 8.29395C7.55737 8.29395 2.79053 13.0644 2.79053 18.9243C2.79053 21.7656 3.89809 24.4332 5.90327 26.442C7.91208 28.4508 10.5796 29.5547 13.4209 29.5547C19.2845 29.5547 24.0513 24.7843 24.0513 18.9243C24.0513 13.0644 19.2808 8.29395 13.4209 8.29395ZM17.4023 22.9058C16.3382 23.9699 14.9266 24.5526 13.4209 24.5526C11.9188 24.5526 10.5036 23.9663 9.4395 22.9058C8.37537 21.8453 7.79264 20.43 7.79264 18.9243C7.79264 15.8224 10.319 13.2961 13.4209 13.2961C16.5228 13.2961 19.0492 15.8224 19.0492 18.9243C19.0492 20.4264 18.4628 21.8416 17.4023 22.9058Z" fill="#FFC120"/>
11
+ </svg>
@@ -0,0 +1,173 @@
1
+ // NOTE(ej): This file is a manual copy of /styles/colors.scss
2
+ // These files should be kept in sync.
3
+ // NOTE(cshdllr): The navy colors are still here for backwards compatibility.
4
+
5
+ export type HexColor = `#${string}`;
6
+ export type RgbaColor = `rgba(${number}, ${number}, ${number}, ${number})`;
7
+
8
+ /**
9
+ * CSS color value from the palette (hex or rgba). Use this type when a value
10
+ * may be either format, e.g. gray colors are rgba, others are hex.
11
+ */
12
+ export type CssColor = HexColor | RgbaColor;
13
+
14
+ const BLACK = '#000000';
15
+ const GRAY_100 = 'rgba(0, 0, 0, 0.04)';
16
+ const GRAY_200 = 'rgba(0, 0, 0, 0.1)';
17
+ const GRAY_300 = 'rgba(0, 0, 0, 0.31)';
18
+ const GRAY_400 = 'rgba(0, 0, 0, 0.48)';
19
+ const GRAY_500 = 'rgba(0, 0, 0, 0.69)';
20
+ const GREEN_500 = '#1f7400';
21
+ const GOLD_500 = '#f47500';
22
+ const RED_500 = '#cd000c';
23
+
24
+ /**
25
+ * Maps a color name to its corresponding CSS color (hex or rgba).
26
+ * Gray neutrals use rgba for transparency; other colors use hex.
27
+ *
28
+ * NOTE: Please write hex codes in lowercase letters
29
+ */
30
+ const Colors: Record<string, CssColor> = {
31
+ ACCENT_BLUE: '#5560cb',
32
+ ACCENT_BLUE_SHADE_1: '#404898',
33
+ ACCENT_BLUE_SHADE_2: '#2f3570',
34
+ ACCENT_GREEN: '#49a24c',
35
+ ACCENT_GREEN_SHADE_1: '#3a823d',
36
+ ACCENT_GREEN_SHADE_2: '#17551a',
37
+ ACCENT_ORANGE: '#ffa895',
38
+ ACCENT_ORANGE_SHADE_1: '#e15c1b',
39
+ ACCENT_ORANGE_SHADE_2: '#a9440b',
40
+ ACCENT_PINK: '#d75fae',
41
+ ACCENT_PINK_SHADE_1: '#7c3872',
42
+ ACCENT_PINK_SHADE_2: '#56204e',
43
+ ACCENT_RED_SHADE_1: '#981d31',
44
+ ACCENT_RED_SHADE_2: '#701323',
45
+ ALERT_RED: '#c34459',
46
+ BACKGROUND: GRAY_100,
47
+ BLACK,
48
+ GRAY_100,
49
+ // NOTE(slanden): the in-app browser cannot handle transparency in rgba colors,
50
+ // which get rendered as black, so we fall back to the hex color instead.
51
+ GRAY_100_HEX: '#f5f4f3',
52
+ GRAY_200,
53
+ GRAY_300,
54
+ GRAY_400,
55
+ GRAY_500,
56
+ NAVY: BLACK,
57
+ NAVY_TINT_1: GRAY_500,
58
+ NAVY_TINT_2: GRAY_400,
59
+ NAVY_TINT_3: GRAY_300,
60
+ NAVY_TINT_4: GRAY_200,
61
+ NAVY_TINT_5: GRAY_100,
62
+ NEUTRAL: GRAY_100,
63
+ NEUTRAL_SHADE: GRAY_200,
64
+ NEUTRAL_SHADE_2: '#707070',
65
+ ORANGE: '#ffa895',
66
+ ORANGE_TINT_1: '#fdcab7',
67
+ ORANGE_TINT_2: '#ffdbce',
68
+ PINK: '#f6a0d1',
69
+ PINK_TINT_1: '#fdc3e4',
70
+ PINK_TINT_2: '#ffdef1',
71
+ PROVIDERS_BLUE: '#a3b0f9',
72
+ PROVIDERS_BLUE_TINT_1: '#d1d7fc',
73
+ PROVIDERS_BLUE_TINT_2: '#e8ebfd',
74
+ PROVIDERS_GREEN: '#49a24c',
75
+ PROVIDERS_GREEN_TINT_1: '#b3f6a2',
76
+ PROVIDERS_GREEN_TINT_2: '#d1fac7',
77
+ TEXT_PRIMARY: BLACK,
78
+ TEXT_SECONDARY: GRAY_500,
79
+ TEXT_PLACEHOLDER: GRAY_400,
80
+ TEXT_DISABLED: GRAY_300,
81
+ WHITE: '#ffffff',
82
+ YELLOW: '#ffc200',
83
+ YELLOW_100: '#ffdc6b',
84
+ YELLOW_TINT_1: '#ffdc6b',
85
+ YELLOW_TINT_2: '#fee69a',
86
+ BLUE_100: '#e0edff',
87
+ BLUE_200: '#b2cffa',
88
+ BLUE_300: '#7a95f8',
89
+ BLUE_400: '#496ae0',
90
+ BLUE_500: '#1a43d7',
91
+ BORDER: GRAY_200,
92
+ BUTTON_BACKGROUND: BLACK,
93
+ GOLD_500,
94
+ GOLD_400: '#f99500',
95
+ GOLD_300: '#ffc120',
96
+ GOLD_200: '#fcde74',
97
+ GOLD_100: '#fff0ba',
98
+ GREEN_500,
99
+ GREEN_400: '#3fa41c',
100
+ GREEN_300: '#8bc95a',
101
+ GREEN_200: '#b8da96',
102
+ GREEN_100: '#dcf2cb',
103
+ PURPLE_500: '#6431d0',
104
+ PURPLE_400: '#804fe8',
105
+ PURPLE_300: '#ac8eff',
106
+ PURPLE_200: '#cdbcff',
107
+ PURPLE_100: '#ebe4ff',
108
+ RED_500,
109
+ RED_400: '#f52323',
110
+ RED_300: '#ff6969',
111
+ RED_200: '#ffaaa5',
112
+ RED_100: '#ffe5dd',
113
+ STATUS_SUCCESS: GREEN_500,
114
+ STATUS_WARNING: GOLD_500,
115
+ STATUS_ERROR: RED_500,
116
+ };
117
+
118
+ export default Colors;
119
+
120
+ /**
121
+ * This is a type predicate that will allow TypeScript to know that the string tested is a
122
+ * HexColor within the scope of the narrowing.
123
+ */
124
+ export function isHexColor(color?: string): color is HexColor {
125
+ if (!color) {
126
+ return false;
127
+ }
128
+
129
+ return /^#([0-9A-Fa-f]{3}){1,2}$/i.test(color);
130
+ }
131
+
132
+ export function isRgbaColor(color?: string): color is RgbaColor {
133
+ if (!color) {
134
+ return false;
135
+ }
136
+
137
+ // Alpha may be integer 0–255 or decimal 0–1 (e.g. 0.04, 0.69)
138
+ return /^rgba\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*[\d.]+\s*\)$/i.test(color);
139
+ }
140
+
141
+ export function isCssColor(color?: string): color is CssColor {
142
+ return isHexColor(color) || isRgbaColor(color);
143
+ }
144
+
145
+ /**
146
+ * This is a type predicate that will allow TypeScript to know that the string tested is a
147
+ * key of the Colors object.
148
+ */
149
+ export function isColorKey(color?: string): color is keyof typeof Colors {
150
+ if (!color) {
151
+ return false;
152
+ }
153
+
154
+ return Object.keys(Colors).includes(color);
155
+ }
156
+
157
+ /**
158
+ * Validates a string as either a hex color or a color key.
159
+ */
160
+ export function isValidColor(value: string): boolean {
161
+ if (value === 'default') {
162
+ return true;
163
+ }
164
+
165
+ if (isHexColor(value)) {
166
+ return true;
167
+ }
168
+
169
+ // Normalize any strings to SCREAMING_CASE
170
+ const normalizedKey = value.toUpperCase().replace(/-/g, '_');
171
+
172
+ return isColorKey(normalizedKey);
173
+ }
@@ -1,20 +1,14 @@
1
- import type { VuetifyThemeVariant } from 'vuetify/types/services/theme';
1
+ import Colors from '@propelinc/citrus-ui/src/colors/colors';
2
2
 
3
- import Colors from '@/styles/_colors.scss';
3
+ type Theme = Record<string, string>;
4
4
 
5
- const VuetifyConfig = {
6
- primary: Colors.ACCENT_BLUE,
7
- secondary: Colors.ACCENT_GREEN,
8
- info: Colors.PROVIDERS_BLUE,
9
- success: Colors.ACCENT_BLUE,
10
- warning: Colors.YELLOW,
11
- error: Colors.ALERT_RED,
12
- } as Partial<VuetifyThemeVariant>;
13
-
14
- const CitrusTheme = Object.entries(Colors).reduce((theme, [colorName, hex]) => {
5
+ const CitrusTheme = Object.entries(Colors).reduce<Theme>((theme, [colorName, hex]) => {
15
6
  const kebabCaseName = colorName.toLowerCase().replace(/_/g, '-');
16
7
  theme[kebabCaseName] = hex;
17
8
  return theme;
18
- }, {} as Partial<VuetifyThemeVariant>);
9
+ }, {});
19
10
 
20
- export default { ...CitrusTheme, ...VuetifyConfig };
11
+ // NOTE(mohan): Jest tests don't properly import scss files, leading to
12
+ // undefined values. Clear them since we don't need these things to be defined
13
+ // in unit tests anyways.
14
+ export default process.env.NODE_ENV === 'test' ? {} : CitrusTheme;
@@ -0,0 +1,49 @@
1
+ import Colors from '@propelinc/citrus-ui/src/colors/colors';
2
+
3
+ const ALIASES = {
4
+ ERROR: Colors.ALERT_RED,
5
+ PRIMARY: Colors.BLACK,
6
+ SECONDARY: Colors.TEXT_SECONDARY,
7
+ PLACEHOLDER: Colors.TEXT_PLACEHOLDER,
8
+ DISABLED: Colors.TEXT_DISABLED,
9
+ };
10
+
11
+ function generateColorUtils(): string {
12
+ let classes = '';
13
+
14
+ Object.entries({ ...Colors, ...ALIASES }).forEach(([colorName, colorValue]) => {
15
+ const kebabColorName = colorName.toLowerCase().replaceAll('_', '-');
16
+
17
+ classes += `
18
+ .${kebabColorName} {
19
+ background-color: ${colorValue} !important;
20
+ border-color: ${colorValue} !important;
21
+ }
22
+ .${kebabColorName}--text {
23
+ color: ${colorValue} !important;
24
+ }`;
25
+ });
26
+
27
+ return classes;
28
+ }
29
+
30
+ /**
31
+ * Generates utility classes for each Citrus color.
32
+ *
33
+ * For example, for blue-500 it creates:
34
+ * - `.blue-500` - sets background and border
35
+ * - `.blue-500--text` - sets text color
36
+ *
37
+ * This matches the syntax of Vuetify's utils:
38
+ * https://vuetifyjs.com/en/styles/colors/#classes
39
+ */
40
+ export function addColorUtils(): void {
41
+ if (document.querySelector('[data-color-utils]')) {
42
+ return;
43
+ }
44
+
45
+ const styles = document.createElement('style');
46
+ styles.dataset.colorUtils = 'true';
47
+ styles.textContent = generateColorUtils();
48
+ document.head.appendChild(styles);
49
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * This function is intended to be used in an app's Vite config to resolve
3
+ * Citrus UI components. We export this so that apps don't need to know about changes
4
+ * to the internal structure of the Citrus UI library.
5
+ *
6
+ * NOTE(kyleshevlin): This is a JS file because our vite configs are JS files.
7
+ */
8
+
9
+ const CITRUS_UI_COMPONENT_NAME_REGEX = /^C[A-Z]/;
10
+
11
+ /**
12
+ * These components have irregular paths that cannot be handled with the regex match.
13
+ */
14
+ const CITRUS_UI_COMPONENT_NAME_TO_IRREGULAR_PATH = {
15
+ CButton: '@propelinc/citrus-ui/src/components/CButton/CButton.vue',
16
+ CCloseButton: '@propelinc/citrus-ui/src/components/internal/CCloseButton.vue',
17
+ };
18
+
19
+ function citrusComponentResolver(componentName) {
20
+ if (CITRUS_UI_COMPONENT_NAME_TO_IRREGULAR_PATH[componentName]) {
21
+ return { from: CITRUS_UI_COMPONENT_NAME_TO_IRREGULAR_PATH[componentName] };
22
+ }
23
+
24
+ if (CITRUS_UI_COMPONENT_NAME_REGEX.test(componentName)) {
25
+ return { from: `@propelinc/citrus-ui/src/components/${componentName}.vue` };
26
+ }
27
+
28
+ if (componentName === 'FontAwesomeIcon') {
29
+ return { name: componentName, from: '@fortawesome/vue-fontawesome' };
30
+ }
31
+ }
32
+
33
+ module.exports = { citrusComponentResolver };
@@ -1,14 +1,39 @@
1
1
  <template>
2
- <v-expansion-panels :data-test="dataTest" accordion multiple flat>
2
+ <div ref="accordion" data-test="accordion">
3
3
  <slot />
4
- </v-expansion-panels>
4
+ </div>
5
5
  </template>
6
6
 
7
7
  <script lang="ts">
8
- import { Component, Vue, Prop } from 'vue-property-decorator';
8
+ import type SlDetails from '@shoelace-style/shoelace/dist/components/details/details';
9
+ import { defineComponent, nextTick, provide, ref, toRefs } from 'vue';
9
10
 
10
- @Component({ name: 'CAccordion' })
11
- export default class CAccordion extends Vue {
12
- @Prop({ type: String, default: 'accordion' }) dataTest!: string;
13
- }
11
+ import { FLUID, ON_TOGGLE } from '@propelinc/citrus-ui/src/services/injections/accordions';
12
+
13
+ export default defineComponent({
14
+ name: 'CAccordion',
15
+ props: {
16
+ /** Removes horizontal padding for all items inside */
17
+ fluid: { type: Boolean, default: false },
18
+ },
19
+ emits: ['change'],
20
+ setup(props, { emit }) {
21
+ const { fluid } = toRefs(props);
22
+ provide(FLUID, fluid);
23
+
24
+ const accordion = ref<HTMLDivElement | null>(null);
25
+ provide(ON_TOGGLE, async () => {
26
+ await nextTick();
27
+ const accordionItems: SlDetails[] = Array.from(
28
+ accordion.value!.querySelectorAll('[data-accordion-item]')
29
+ );
30
+ const openItems = accordionItems.reduce<number[]>((acc, item, index) => {
31
+ return item.hasAttribute('open') ? [...acc, index] : acc;
32
+ }, []);
33
+ emit('change', openItems);
34
+ });
35
+
36
+ return { accordion };
37
+ },
38
+ });
14
39
  </script>