mainstack-design-system 0.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 (481) hide show
  1. package/.env.sample +1 -0
  2. package/.eslintignore +5 -0
  3. package/.eslintrc.json +96 -0
  4. package/.github/PULL_REQUEST_TEMPLATE.md +15 -0
  5. package/.husky/commit-msg +4 -0
  6. package/.husky/pre-commit +6 -0
  7. package/.prettierignore +7 -0
  8. package/.prettierrc +9 -0
  9. package/.storybook/main.ts +22 -0
  10. package/.storybook/preview.ts +20 -0
  11. package/.vscode/extensions.json +10 -0
  12. package/README.md +139 -0
  13. package/commitlint.config.cjs +1 -0
  14. package/index.html +31 -0
  15. package/package.json +98 -0
  16. package/public/_redirects +1 -0
  17. package/public/manifest.json +15 -0
  18. package/public/robots.txt +3 -0
  19. package/public/vite.svg +1 -0
  20. package/src/app.tsx +25 -0
  21. package/src/assets/fonts/Degular-Medium.woff2 +0 -0
  22. package/src/assets/fonts/Degular-Medium_Italic.woff2 +0 -0
  23. package/src/assets/fonts/Degular-Semibold.woff2 +0 -0
  24. package/src/assets/fonts/Degular-Semibold_Italic.woff2 +0 -0
  25. package/src/assets/fonts/Degular_Display-Bold.woff2 +0 -0
  26. package/src/assets/fonts/Degular_Display-Bold_Italic.woff2 +0 -0
  27. package/src/assets/fonts/Degular_Display-Semibold.woff2 +0 -0
  28. package/src/assets/fonts/Degular_Display-Semibold_Italic.woff2 +0 -0
  29. package/src/assets/fonts/Sohne-Buch.otf +0 -0
  30. package/src/assets/fonts/So/302/246/303/252hne-Buch.otf +0 -0
  31. package/src/assets/fonts/So/302/246/303/252hne-BuchKursiv.otf +0 -0
  32. package/src/assets/fonts/So/302/246/303/252hne-Dreiviertelfett.otf +0 -0
  33. package/src/assets/fonts/So/302/246/303/252hne-DreiviertelfettKursiv.otf +0 -0
  34. package/src/assets/fonts/So/302/246/303/252hne-Extrafett.otf +0 -0
  35. package/src/assets/fonts/So/302/246/303/252hne-Fett.otf +0 -0
  36. package/src/assets/fonts/So/302/246/303/252hne-Halbfett.otf +0 -0
  37. package/src/assets/fonts/So/302/246/303/252hne-HalbfettKursiv.otf +0 -0
  38. package/src/assets/fonts/So/302/246/303/252hne-Kra/302/246/303/252ftig.otf +0 -0
  39. package/src/assets/fonts/So/302/246/303/252hne-Kra/302/246/303/252ftigKursiv.otf +0 -0
  40. package/src/assets/fonts/So/302/246/303/252hne-Leicht.otf +0 -0
  41. package/src/assets/fonts/soehne-buch-kursiv.woff2 +0 -0
  42. package/src/assets/fonts/soehne-buch.woff2 +0 -0
  43. package/src/assets/fonts/soehne-dreiviertelfett-kursiv.woff2 +0 -0
  44. package/src/assets/fonts/soehne-dreiviertelfett.woff2 +0 -0
  45. package/src/assets/fonts/soehne-extrafett.woff2 +0 -0
  46. package/src/assets/fonts/soehne-fett.woff2 +0 -0
  47. package/src/assets/fonts/soehne-halbfett-kursiv.woff2 +0 -0
  48. package/src/assets/fonts/soehne-halbfett.woff2 +0 -0
  49. package/src/assets/fonts/soehne-kraftig-kursiv.woff2 +0 -0
  50. package/src/assets/fonts/soehne-kraftig.woff2 +0 -0
  51. package/src/assets/fonts/soehne-leicht.woff2 +0 -0
  52. package/src/assets/styles/index.css +486 -0
  53. package/src/assets/svgs/check_circle.svg +8 -0
  54. package/src/assets/svgs/close-circle.svg +3 -0
  55. package/src/assets/svgs/error_message_icon.svg +8 -0
  56. package/src/assets/svgs/personal_profile_avatar.svg +13 -0
  57. package/src/assets/svgs/search-normal.svg +4 -0
  58. package/src/assets/svgs/store_avatar.svg +13 -0
  59. package/src/assets/svgs/viewIcon.svg +8 -0
  60. package/src/assets/svgs/viewOffIcon.svg +3 -0
  61. package/src/assets/themes/baseThemes.ts +40 -0
  62. package/src/components/Accordion/index.tsx +111 -0
  63. package/src/components/Avatars/index.tsx +111 -0
  64. package/src/components/Button/IconButton.tsx +119 -0
  65. package/src/components/Button/index.tsx +173 -0
  66. package/src/components/InputFields/Input.tsx +177 -0
  67. package/src/components/InputFields/MarkdownEditor.tsx +246 -0
  68. package/src/components/InputFields/SearchInput.tsx +80 -0
  69. package/src/components/InputFields/SelectInput/CountrySelect.tsx +142 -0
  70. package/src/components/InputFields/SelectInput/PhoneNumberInput.tsx +89 -0
  71. package/src/components/InputFields/SelectInput/SelectInput.tsx +395 -0
  72. package/src/components/InputFields/SelectInput/index.ts +9 -0
  73. package/src/components/InputFields/TextArea.tsx +150 -0
  74. package/src/components/InputFields/UsernameInput.tsx +145 -0
  75. package/src/components/Tiles/index.tsx +95 -0
  76. package/src/components/Typography/Display.tsx +84 -0
  77. package/src/components/Typography/Heading.tsx +136 -0
  78. package/src/components/Typography/Paragraph.tsx +105 -0
  79. package/src/components/Typography/Subtitle.tsx +148 -0
  80. package/src/components/Uploader/FileUploader.tsx +132 -0
  81. package/src/components/Uploader/ImageUploader.tsx +311 -0
  82. package/src/components/controls/Chip.tsx +78 -0
  83. package/src/components/controls/DoubleTab.tsx +80 -0
  84. package/src/components/controls/Pagination.tsx +164 -0
  85. package/src/components/controls/RadioButton.tsx +135 -0
  86. package/src/components/controls/RectangleCheckButton.tsx +106 -0
  87. package/src/components/controls/RoundCheckButton.tsx +106 -0
  88. package/src/components/controls/Stepper.tsx +84 -0
  89. package/src/components/controls/TabMenu.tsx +114 -0
  90. package/src/components/controls/ToggleButton.tsx +123 -0
  91. package/src/components/notifications/Banner.tsx +175 -0
  92. package/src/components/notifications/ClickTooltip.tsx +108 -0
  93. package/src/components/notifications/HoverTooltip.tsx +34 -0
  94. package/src/components/notifications/Snackbar.tsx +138 -0
  95. package/src/components/styleGuide/Colors.tsx +176 -0
  96. package/src/hooks/useImageUpload.ts +78 -0
  97. package/src/icons/AccountBalanceIcon.tsx +35 -0
  98. package/src/icons/AccountBalanceWalletFilledIcon.tsx +35 -0
  99. package/src/icons/AccountBalanceWalletIcon.tsx +35 -0
  100. package/src/icons/AccountCircleFilledIcon.tsx +35 -0
  101. package/src/icons/AccountCircleIcon.tsx +35 -0
  102. package/src/icons/AddAPhotoIcon.tsx +35 -0
  103. package/src/icons/AddBusinessFilledIcon.tsx +35 -0
  104. package/src/icons/AddBusinessIcon.tsx +35 -0
  105. package/src/icons/AddCircleFilledIcon.tsx +35 -0
  106. package/src/icons/AddCircleIcon.tsx +35 -0
  107. package/src/icons/AddIcon.tsx +35 -0
  108. package/src/icons/AddPhotoAlternateIcon.tsx +35 -0
  109. package/src/icons/AddShoppingCartIcon.tsx +35 -0
  110. package/src/icons/AddToSocialsIcon.tsx +48 -0
  111. package/src/icons/AddsClickIcon.tsx +35 -0
  112. package/src/icons/AdminPanelSettingsIcon.tsx +35 -0
  113. package/src/icons/AirplaneModeActiveIcon.tsx +35 -0
  114. package/src/icons/AlarmIcon.tsx +35 -0
  115. package/src/icons/AllInboxIcon.tsx +35 -0
  116. package/src/icons/AnimationIcon.tsx +35 -0
  117. package/src/icons/AppsFilledIcon.tsx +35 -0
  118. package/src/icons/AppsIcon.tsx +35 -0
  119. package/src/icons/ArchiveIcon.tsx +35 -0
  120. package/src/icons/ArrowBackIcon.tsx +35 -0
  121. package/src/icons/ArrowCircleDownFilledIcon.tsx +35 -0
  122. package/src/icons/ArrowCircleUpFilledIcon.tsx +35 -0
  123. package/src/icons/ArrowDropDownIcon.tsx +32 -0
  124. package/src/icons/ArrowDropUpIcon.tsx +37 -0
  125. package/src/icons/ArrowForwardIcon.tsx +35 -0
  126. package/src/icons/ArtTrackIcon.tsx +35 -0
  127. package/src/icons/ArticleFilledIcon.tsx +35 -0
  128. package/src/icons/ArticleIcon.tsx +35 -0
  129. package/src/icons/AttachMoneyIcon.tsx +35 -0
  130. package/src/icons/AttachmentIcon.tsx +35 -0
  131. package/src/icons/AudioFileFilledIcon.tsx +35 -0
  132. package/src/icons/AutoAwesomeMosaicFilledIcon.tsx +35 -0
  133. package/src/icons/AutoAwesomeMosaicIcon.tsx +35 -0
  134. package/src/icons/AutoFixFilledIcon.tsx +35 -0
  135. package/src/icons/AutoFixIcon.tsx +35 -0
  136. package/src/icons/AutoGraphIcon.tsx +35 -0
  137. package/src/icons/AwardStarFilledIcon.tsx +35 -0
  138. package/src/icons/AwardStarIcon.tsx +35 -0
  139. package/src/icons/BarChartFilledIcon.tsx +35 -0
  140. package/src/icons/BlockIcon.tsx +35 -0
  141. package/src/icons/BoltFilledIcon.tsx +35 -0
  142. package/src/icons/BoltIcon.tsx +35 -0
  143. package/src/icons/BookOnlineIcon.tsx +35 -0
  144. package/src/icons/BugReportIcon.tsx +35 -0
  145. package/src/icons/BusinessCenterFilledIcon.tsx +35 -0
  146. package/src/icons/BusinessCenterIcon.tsx +35 -0
  147. package/src/icons/CalendarMonthFilledIcon.tsx +35 -0
  148. package/src/icons/CalendarMonthIcon.tsx +35 -0
  149. package/src/icons/CalendarTodayIcon.tsx +35 -0
  150. package/src/icons/CallMadeIcon.tsx +35 -0
  151. package/src/icons/CallMissedIcon.tsx +35 -0
  152. package/src/icons/CallMissedOutgoingIcon.tsx +35 -0
  153. package/src/icons/CallRecievedIcon.tsx +35 -0
  154. package/src/icons/CampaignFilledIcon.tsx +22 -0
  155. package/src/icons/CampaignIcon.tsx +35 -0
  156. package/src/icons/CancelFilledIcon.tsx +22 -0
  157. package/src/icons/CancelIcon.tsx +22 -0
  158. package/src/icons/CaptivePortalIcon.tsx +35 -0
  159. package/src/icons/CardLayoutIcon.tsx +22 -0
  160. package/src/icons/CasesFilledIcon.tsx +35 -0
  161. package/src/icons/CasesIcon.tsx +35 -0
  162. package/src/icons/CategoryIcon.tsx +35 -0
  163. package/src/icons/ChairIcon.tsx +35 -0
  164. package/src/icons/ChangeCircleIcon.tsx +35 -0
  165. package/src/icons/ChatBubbleFilledIcon.tsx +35 -0
  166. package/src/icons/ChatBubbleIcon.tsx +35 -0
  167. package/src/icons/ChatFilledIcon.tsx +35 -0
  168. package/src/icons/ChatIcon.tsx +35 -0
  169. package/src/icons/CheckCircleFilledIcon.tsx +35 -0
  170. package/src/icons/CheckCircleIcon.tsx +35 -0
  171. package/src/icons/CheckIcon.tsx +35 -0
  172. package/src/icons/ChevronLeftIcon.tsx +43 -0
  173. package/src/icons/ChevronRightIcon.tsx +43 -0
  174. package/src/icons/CloseIcon.tsx +35 -0
  175. package/src/icons/CloudUploadIcon.tsx +35 -0
  176. package/src/icons/CodeIcon.tsx +35 -0
  177. package/src/icons/CoffeeIcon.tsx +35 -0
  178. package/src/icons/CollectionsBookmarkIcon.tsx +35 -0
  179. package/src/icons/ColorPickerIcon.tsx +22 -0
  180. package/src/icons/CommentCircleAltChatMessageIcon.tsx +24 -0
  181. package/src/icons/ConfirmationNumberIcon.tsx +35 -0
  182. package/src/icons/ContactMailFilledIcon.tsx +35 -0
  183. package/src/icons/ContactMailIcon.tsx +35 -0
  184. package/src/icons/ContactPageIcon.tsx +22 -0
  185. package/src/icons/ContactPhoneFilledIcon.tsx +35 -0
  186. package/src/icons/ContactPhoneIcon.tsx +35 -0
  187. package/src/icons/ContactsIcon.tsx +22 -0
  188. package/src/icons/ContentCopyIcon.tsx +35 -0
  189. package/src/icons/CopyIcon.tsx +35 -0
  190. package/src/icons/CreditCardFilledIcon.tsx +35 -0
  191. package/src/icons/CreditCardIcon.tsx +35 -0
  192. package/src/icons/DarkModeIcon.tsx +35 -0
  193. package/src/icons/DashboardFilledIcon.tsx +35 -0
  194. package/src/icons/DashboardIcon.tsx +35 -0
  195. package/src/icons/DatabaseFilledIcon.tsx +35 -0
  196. package/src/icons/DeleteIcon.tsx +35 -0
  197. package/src/icons/DescriptionIcon.tsx +35 -0
  198. package/src/icons/DesktopMacIcon.tsx +35 -0
  199. package/src/icons/DevicesIcon.tsx +35 -0
  200. package/src/icons/DiamondFilledIcon.tsx +35 -0
  201. package/src/icons/DiamondIcon.tsx +35 -0
  202. package/src/icons/DigitalProductsIcon.tsx +58 -0
  203. package/src/icons/DiscountIcon.tsx +24 -0
  204. package/src/icons/Diversity1Icon.tsx +22 -0
  205. package/src/icons/Diversity2Icon.tsx +22 -0
  206. package/src/icons/Diversity3Icon.tsx +22 -0
  207. package/src/icons/DnsIcon.tsx +35 -0
  208. package/src/icons/DoNotDisturbOnFilledIcon.tsx +35 -0
  209. package/src/icons/DoNotDisturbOnIcon.tsx +35 -0
  210. package/src/icons/DomainAddIcon.tsx +35 -0
  211. package/src/icons/DomainIcon.tsx +35 -0
  212. package/src/icons/DomainVerificationIcon.tsx +35 -0
  213. package/src/icons/DownloadIcon.tsx +35 -0
  214. package/src/icons/DraftsIcon.tsx +35 -0
  215. package/src/icons/DragHandleIcon.tsx +35 -0
  216. package/src/icons/DragIndicatorIcon.tsx +35 -0
  217. package/src/icons/EditFilledIcon.tsx +35 -0
  218. package/src/icons/EditIcon.tsx +35 -0
  219. package/src/icons/EmojiEventsFilledIcon.tsx +35 -0
  220. package/src/icons/EmojiEventsIcon.tsx +35 -0
  221. package/src/icons/EmojiFoodBeverageIcon.tsx +35 -0
  222. package/src/icons/EmojiIcon.tsx +35 -0
  223. package/src/icons/EmptyIcon.tsx +22 -0
  224. package/src/icons/ErrorFilledIcon.tsx +35 -0
  225. package/src/icons/ErrorIcon.tsx +35 -0
  226. package/src/icons/EventFilledIcon.tsx +35 -0
  227. package/src/icons/EventIcon.tsx +35 -0
  228. package/src/icons/EventTicketIcon.tsx +54 -0
  229. package/src/icons/ExpandLessIcon.tsx +40 -0
  230. package/src/icons/ExpandMoreIcon.tsx +35 -0
  231. package/src/icons/FastActionPricingIcon.tsx +58 -0
  232. package/src/icons/FeedFilledIcon.tsx +35 -0
  233. package/src/icons/FeedIcon.tsx +35 -0
  234. package/src/icons/FilePresentIcon.tsx +35 -0
  235. package/src/icons/FilterListIcon.tsx +35 -0
  236. package/src/icons/FitbitArrowDownIcon.tsx +35 -0
  237. package/src/icons/FitbitArrowUpwardIcon.tsx +35 -0
  238. package/src/icons/FlagIcon.tsx +35 -0
  239. package/src/icons/FormatAlignCenterIcon.tsx +35 -0
  240. package/src/icons/FormatAlignJustifyIcon.tsx +35 -0
  241. package/src/icons/FormatAlignLeftIcon.tsx +35 -0
  242. package/src/icons/FormatAlignRightIcon.tsx +35 -0
  243. package/src/icons/FormatBoldIcon.tsx +35 -0
  244. package/src/icons/FormatItalicIcon.tsx +35 -0
  245. package/src/icons/FormatListBulletedIcon.tsx +35 -0
  246. package/src/icons/FormatListNumberedIcon.tsx +35 -0
  247. package/src/icons/FormatSizeIcon.tsx +35 -0
  248. package/src/icons/FormatUnderlineIcon.tsx +35 -0
  249. package/src/icons/ForumIcon.tsx +35 -0
  250. package/src/icons/ForwardToInboxIcon.tsx +35 -0
  251. package/src/icons/GalleryThumbnailIcon.tsx +35 -0
  252. package/src/icons/GppBadFilledIcon.tsx +35 -0
  253. package/src/icons/GppBadIcon.tsx +35 -0
  254. package/src/icons/GppMaybeFilledIcon.tsx +35 -0
  255. package/src/icons/GppMaybeIcon.tsx +35 -0
  256. package/src/icons/GridViewIcon.tsx +35 -0
  257. package/src/icons/GroupFilledIcon.tsx +35 -0
  258. package/src/icons/GroupIcon.tsx +35 -0
  259. package/src/icons/HeadphonesIcon.tsx +35 -0
  260. package/src/icons/HomeFilledIcon.tsx +35 -0
  261. package/src/icons/HomeIcon.tsx +35 -0
  262. package/src/icons/HomePinIcon.tsx +35 -0
  263. package/src/icons/HourGlassEmptyIcon.tsx +35 -0
  264. package/src/icons/HubIcon.tsx +22 -0
  265. package/src/icons/InfoFilledIcon.tsx +35 -0
  266. package/src/icons/InfoGradientFilledIcon.tsx +49 -0
  267. package/src/icons/InfoIcon.tsx +35 -0
  268. package/src/icons/InsertChartFilledIcon.tsx +35 -0
  269. package/src/icons/InsertChartIcon.tsx +35 -0
  270. package/src/icons/InventoryIcon.tsx +22 -0
  271. package/src/icons/IosShareIcon.tsx +35 -0
  272. package/src/icons/KeyboardBackspaceIcon.tsx +35 -0
  273. package/src/icons/LanguageIcon.tsx +35 -0
  274. package/src/icons/LibraryMusicIcon.tsx +35 -0
  275. package/src/icons/LinkIcon.tsx +35 -0
  276. package/src/icons/LinkOffIcon.tsx +35 -0
  277. package/src/icons/LocalActivityIcon.tsx +35 -0
  278. package/src/icons/LocalFloristFilledIcon.tsx +35 -0
  279. package/src/icons/LocalFloristIcon.tsx +35 -0
  280. package/src/icons/LocationOnIcon.tsx +35 -0
  281. package/src/icons/LockIcon.tsx +35 -0
  282. package/src/icons/LoginIcon.tsx +35 -0
  283. package/src/icons/LogoutIcon.tsx +43 -0
  284. package/src/icons/MailIcon.tsx +35 -0
  285. package/src/icons/MarkUnreadChatIcon.tsx +35 -0
  286. package/src/icons/MasterClassIcon.tsx +74 -0
  287. package/src/icons/MediaLinkFilledIcon.tsx +35 -0
  288. package/src/icons/MediaLinkIcon.tsx +35 -0
  289. package/src/icons/MenuIcon.tsx +35 -0
  290. package/src/icons/MenuOpenIcon.tsx +35 -0
  291. package/src/icons/MilitaryTechFilledIcon.tsx +35 -0
  292. package/src/icons/MilitaryTechIcon.tsx +35 -0
  293. package/src/icons/MonitoringIcon.tsx +35 -0
  294. package/src/icons/MoreHorizontalIcon.tsx +35 -0
  295. package/src/icons/MoreHorizontalSmallIcon.tsx +35 -0
  296. package/src/icons/MoreVerticalIcon.tsx +35 -0
  297. package/src/icons/NotificationsFilledIcon.tsx +40 -0
  298. package/src/icons/NotificationsIcon.tsx +35 -0
  299. package/src/icons/OpenInNewIcon.tsx +35 -0
  300. package/src/icons/OthersIcon.tsx +58 -0
  301. package/src/icons/PageViewIcon.tsx +35 -0
  302. package/src/icons/PaidIcon.tsx +35 -0
  303. package/src/icons/PaletteFilledIcon.tsx +35 -0
  304. package/src/icons/PaletteIcon.tsx +35 -0
  305. package/src/icons/PauseIcon.tsx +22 -0
  306. package/src/icons/PayInTranchesIcon.tsx +29 -0
  307. package/src/icons/PaymentsFilledIcon.tsx +35 -0
  308. package/src/icons/PaymentsIcon.tsx +35 -0
  309. package/src/icons/PendingActionsIcon.tsx +35 -0
  310. package/src/icons/PermMediaIcon.tsx +35 -0
  311. package/src/icons/PersonAddIcon.tsx +35 -0
  312. package/src/icons/PersonIcon.tsx +35 -0
  313. package/src/icons/PhotoCameraIcon.tsx +35 -0
  314. package/src/icons/PhotoFilledIcon.tsx +35 -0
  315. package/src/icons/PhotoIcon.tsx +35 -0
  316. package/src/icons/PhotoLibraryFilledIcon.tsx +35 -0
  317. package/src/icons/PhotoLibraryIcon.tsx +35 -0
  318. package/src/icons/PictureAsPdfFilledIcon.tsx +35 -0
  319. package/src/icons/PictureAsPdfIcon.tsx +35 -0
  320. package/src/icons/PlayArrowIcon.tsx +32 -0
  321. package/src/icons/PlayCircleFilledIcon.tsx +35 -0
  322. package/src/icons/PlayCircleIcon.tsx +22 -0
  323. package/src/icons/PowerRoundedIcon.tsx +35 -0
  324. package/src/icons/PreviewIcon.tsx +35 -0
  325. package/src/icons/PublicIcon.tsx +22 -0
  326. package/src/icons/PublishIcon.tsx +35 -0
  327. package/src/icons/PushPinFilledIcon.tsx +35 -0
  328. package/src/icons/PushPinIcon.tsx +35 -0
  329. package/src/icons/QrCode2Icon.tsx +35 -0
  330. package/src/icons/RadioButtonCheckedIcon.tsx +35 -0
  331. package/src/icons/RadioButtonUncheckedIcon.tsx +35 -0
  332. package/src/icons/RecieptLongFilledIcon.tsx +35 -0
  333. package/src/icons/RecieptLongIcon.tsx +35 -0
  334. package/src/icons/RecordVoiceOverIcon.tsx +35 -0
  335. package/src/icons/RedeemIcon.tsx +35 -0
  336. package/src/icons/RedoIcon.tsx +35 -0
  337. package/src/icons/RemoveIcon.tsx +32 -0
  338. package/src/icons/RemoveRoadIcon.tsx +35 -0
  339. package/src/icons/ReportFilledIcon.tsx +35 -0
  340. package/src/icons/ReportIcon.tsx +35 -0
  341. package/src/icons/ReviewsIcon.tsx +43 -0
  342. package/src/icons/SavingsFilledIcon.tsx +35 -0
  343. package/src/icons/SavingsIcon.tsx +35 -0
  344. package/src/icons/ScheduleIcon.tsx +35 -0
  345. package/src/icons/ScheduleSendIcon.tsx +35 -0
  346. package/src/icons/SearchNormalIcon.tsx +32 -0
  347. package/src/icons/SellIcon.tsx +35 -0
  348. package/src/icons/SendIcon.tsx +35 -0
  349. package/src/icons/ServicesIcon.tsx +39 -0
  350. package/src/icons/SettingsFilledIcon.tsx +35 -0
  351. package/src/icons/SettingsIcon.tsx +35 -0
  352. package/src/icons/ShareIcon.tsx +35 -0
  353. package/src/icons/ShareWithContactsIcon.tsx +62 -0
  354. package/src/icons/ShareWithSocialsIcon.tsx +64 -0
  355. package/src/icons/ShoppingCartFilledIcon.tsx +35 -0
  356. package/src/icons/ShoppingCartIcon.tsx +35 -0
  357. package/src/icons/ShuffleIcon.tsx +35 -0
  358. package/src/icons/SmartPhoneIcon.tsx +35 -0
  359. package/src/icons/SocialLeaderboardIcon.tsx +35 -0
  360. package/src/icons/StarFilledIcon.tsx +35 -0
  361. package/src/icons/StarHalfIcon.tsx +35 -0
  362. package/src/icons/StarIcon.tsx +35 -0
  363. package/src/icons/StoreFrontFilledIcon.tsx +35 -0
  364. package/src/icons/StoreFrontIcon.tsx +35 -0
  365. package/src/icons/StrikeThroughSIcon.tsx +35 -0
  366. package/src/icons/StyleIcon.tsx +35 -0
  367. package/src/icons/SubscriptionIcon.tsx +46 -0
  368. package/src/icons/SubscriptionsFilledIcon.tsx +35 -0
  369. package/src/icons/SubscriptionsIcon.tsx +35 -0
  370. package/src/icons/SupervisorAccountIcon.tsx +35 -0
  371. package/src/icons/SwitchAccountFilledIcon.tsx +35 -0
  372. package/src/icons/SwitchAccountIcon.tsx +35 -0
  373. package/src/icons/SyncSavedLocallyIcon.tsx +35 -0
  374. package/src/icons/TabletIcon.tsx +35 -0
  375. package/src/icons/ThumbDownFilledIcon.tsx +22 -0
  376. package/src/icons/ThumbDownIcon.tsx +22 -0
  377. package/src/icons/ThumbUpFilledIcon.tsx +22 -0
  378. package/src/icons/ThumbUpIcon.tsx +22 -0
  379. package/src/icons/TocIcon.tsx +35 -0
  380. package/src/icons/TrainingsIcon.tsx +37 -0
  381. package/src/icons/TrashDeleteBinIcon.tsx +36 -0
  382. package/src/icons/TrendingUpIcon.tsx +35 -0
  383. package/src/icons/UndoIcon.tsx +35 -0
  384. package/src/icons/UnfoldMoreIcon.tsx +35 -0
  385. package/src/icons/UploadIcon.tsx +35 -0
  386. package/src/icons/VerifiedIcon.tsx +24 -0
  387. package/src/icons/ViewAgendaIcon.tsx +22 -0
  388. package/src/icons/ViewArrayIcon.tsx +35 -0
  389. package/src/icons/ViewCarouselIcon.tsx +35 -0
  390. package/src/icons/ViewCozyIcon.tsx +22 -0
  391. package/src/icons/ViewModuleIcon.tsx +35 -0
  392. package/src/icons/VisibilityIcon.tsx +35 -0
  393. package/src/icons/VisibilityOffIcon.tsx +35 -0
  394. package/src/icons/VolunteerActivismFilledIcon.tsx +35 -0
  395. package/src/icons/VolunteerActivismIcon.tsx +35 -0
  396. package/src/icons/WBSunnyIcon.tsx +35 -0
  397. package/src/icons/WarningFilledIcon.tsx +35 -0
  398. package/src/icons/WarningIcon.tsx +35 -0
  399. package/src/icons/WebinarsIcon.tsx +57 -0
  400. package/src/icons/WidgetsFilledIcon.tsx +35 -0
  401. package/src/icons/WidgetsIcon.tsx +35 -0
  402. package/src/icons/WorkshopsIcon.tsx +50 -0
  403. package/src/icons/index.ts +305 -0
  404. package/src/pages/Home.tsx +30 -0
  405. package/src/pages/Login.tsx +13 -0
  406. package/src/pages/Page404.tsx +13 -0
  407. package/src/pages/index.tsx +21 -0
  408. package/src/routes/index.tsx +7 -0
  409. package/src/stories/Accordion/Accordion.stories.tsx +100 -0
  410. package/src/stories/Accordion/AccordionWrapper.tsx +16 -0
  411. package/src/stories/Avatars/Avatar.stories.ts +57 -0
  412. package/src/stories/Buttons/Button.stories.tsx +95 -0
  413. package/src/stories/Buttons/IconButton.stories.ts +68 -0
  414. package/src/stories/Buttons/IconButtonWrapper.tsx +14 -0
  415. package/src/stories/Colors.mdx +12 -0
  416. package/src/stories/Configure.mdx +371 -0
  417. package/src/stories/InputFields/InputFields.stories.ts +54 -0
  418. package/src/stories/InputFields/MarkdownEditor.stories.ts +20 -0
  419. package/src/stories/InputFields/SearchInput.stories.ts +22 -0
  420. package/src/stories/InputFields/SearchInput.tsx +19 -0
  421. package/src/stories/InputFields/Select/CountrySelect.stories.tsx +21 -0
  422. package/src/stories/InputFields/Select/CountrySelectWrapper.tsx +25 -0
  423. package/src/stories/InputFields/Select/CreatableSelect.stories.tsx +48 -0
  424. package/src/stories/InputFields/Select/CreatableSelectWrapper.tsx +25 -0
  425. package/src/stories/InputFields/Select/PhoneNumberInput.stories.tsx +33 -0
  426. package/src/stories/InputFields/Select/PhoneNumberInputWrapper.tsx +21 -0
  427. package/src/stories/InputFields/Select/Select.stories.tsx +49 -0
  428. package/src/stories/InputFields/Select/SelectWrapper.tsx +25 -0
  429. package/src/stories/InputFields/TextArea.stories.ts +22 -0
  430. package/src/stories/InputFields/UsernameInput.stories.ts +22 -0
  431. package/src/stories/Tiles/Tile.stories.tsx +71 -0
  432. package/src/stories/Tiles/TileWrapper.tsx +17 -0
  433. package/src/stories/Typography/DisplayText.stories.ts +52 -0
  434. package/src/stories/Typography/HeadingText.stories.ts +86 -0
  435. package/src/stories/Typography/ParagraphText.stories.ts +62 -0
  436. package/src/stories/Typography/SubtitleText.stories.ts +93 -0
  437. package/src/stories/Uploaders/FileUploadWrapper.tsx +25 -0
  438. package/src/stories/Uploaders/FileUploader.stories.tsx +17 -0
  439. package/src/stories/Uploaders/ImageUploadWrapper.tsx +30 -0
  440. package/src/stories/Uploaders/ImageUploader.stories.tsx +19 -0
  441. package/src/stories/assets/accessibility.png +0 -0
  442. package/src/stories/assets/accessibility.svg +5 -0
  443. package/src/stories/assets/addon-library.png +0 -0
  444. package/src/stories/assets/assets.png +0 -0
  445. package/src/stories/assets/context.png +0 -0
  446. package/src/stories/assets/discord.svg +15 -0
  447. package/src/stories/assets/docs.png +0 -0
  448. package/src/stories/assets/figma-plugin.png +0 -0
  449. package/src/stories/assets/github.svg +3 -0
  450. package/src/stories/assets/share.png +0 -0
  451. package/src/stories/assets/styling.png +0 -0
  452. package/src/stories/assets/testing.png +0 -0
  453. package/src/stories/assets/theming.png +0 -0
  454. package/src/stories/assets/tutorials.svg +12 -0
  455. package/src/stories/assets/youtube.svg +4 -0
  456. package/src/stories/colors/index.ts +4 -0
  457. package/src/stories/controls/Chip.stories.ts +42 -0
  458. package/src/stories/controls/DoubleTab.stories.ts +32 -0
  459. package/src/stories/controls/DoubleTabWrapper.tsx +15 -0
  460. package/src/stories/controls/Pagination.stories.ts +21 -0
  461. package/src/stories/controls/PaginationWrapper.tsx +23 -0
  462. package/src/stories/controls/RadioButton.stories.ts +49 -0
  463. package/src/stories/controls/RectangleCheckButton.stories.ts +41 -0
  464. package/src/stories/controls/RoundCheckButton.stories.ts +41 -0
  465. package/src/stories/controls/Stepper.stories.ts +37 -0
  466. package/src/stories/controls/StepperDemoCmp.tsx +37 -0
  467. package/src/stories/controls/TabMenu.stories.ts +33 -0
  468. package/src/stories/controls/TabMenuWrapper.tsx +14 -0
  469. package/src/stories/controls/ToggleButton.stories.ts +41 -0
  470. package/src/stories/icons/Icons.mdx +26 -0
  471. package/src/stories/icons/index.ts +613 -0
  472. package/src/stories/notifications/Banner.stories.ts +88 -0
  473. package/src/stories/notifications/ClickTooltip.stories.ts +21 -0
  474. package/src/stories/notifications/ClickTooltipWrapper.tsx +19 -0
  475. package/src/stories/notifications/HoverTooltip.stories.ts +35 -0
  476. package/src/stories/notifications/HoverTooltipWrapper.tsx +16 -0
  477. package/src/stories/notifications/Snackbar.stories.ts +17 -0
  478. package/src/stories/notifications/SnackbarWrapper.tsx +107 -0
  479. package/src/utils/countries-flag.json +1752 -0
  480. package/tsconfig.json +34 -0
  481. package/vite.config.ts +27 -0
@@ -0,0 +1,246 @@
1
+ /** @format */
2
+ import { useMemo, useRef } from "react";
3
+ import ReactQuill from "react-quill";
4
+ import { Box, Text, Flex, FormLabel } from "@chakra-ui/react";
5
+ import { AutoFixIcon } from "icons";
6
+ import Colors from "components/styleGuide/Colors";
7
+ import "react-quill/dist/quill.snow.css";
8
+ import "assets/styles/index.css";
9
+ // import { ClipLoader } from "react-spinners";
10
+
11
+ interface IMarkdownEditor {
12
+ onChange: (val: string) => void;
13
+ border?: string;
14
+ placeholder?: string;
15
+ onHandleFile: (e: File) => void;
16
+ label?: string;
17
+ }
18
+
19
+ type MarkdownEditorWithExclusiveValues =
20
+ | (IMarkdownEditor & { value?: string; defaultValue?: never })
21
+ | (IMarkdownEditor & { defaultValue?: string; value?: never });
22
+
23
+ interface ICustomtoolBar {
24
+ setValue: (e: any) => void;
25
+ handleGenerateAiDescription?: () => void;
26
+ isLoading?: boolean;
27
+ }
28
+
29
+ const CustomToolbar = ({
30
+ setValue,
31
+ handleGenerateAiDescription,
32
+ isLoading,
33
+ }: ICustomtoolBar) => {
34
+ return (
35
+ <div id="toolbar">
36
+ <span className="ql-formats">
37
+ <span className="ql-hello">
38
+ <Box borderRight={`1px solid ${Colors.gray100}`} pr={"4px"}>
39
+ <Flex
40
+ justifyContent={"center"}
41
+ alignItems={"center"}
42
+ borderRadius={"100px"}
43
+ px={"12px"}
44
+ py={"6px"}
45
+ bg={Colors.purple50}
46
+ gap={"8px"}
47
+ cursor={isLoading ? "not-allowed" : "pointer"}
48
+ className="aiBtn"
49
+ onClick={handleGenerateAiDescription}
50
+ minWidth={{ md: "150px", base: "auto" }}
51
+ >
52
+ {isLoading ? (
53
+ // <ClipLoader
54
+ // size={pixel2rem(20)}
55
+ // color={Colors.purple400 || ""}
56
+ // />
57
+ <></>
58
+ ) : (
59
+ <>
60
+ <Text
61
+ color={Colors.purple400}
62
+ fontFamily={"Degular"}
63
+ fontSize={"0.875rem"}
64
+ fontWeight={600}
65
+ lineHeight={"1rem"}
66
+ letterSpacing={"-0.4px"}
67
+ display={{ md: "block", base: "none" }}
68
+ >
69
+ Generate with AI
70
+ </Text>
71
+ <AutoFixIcon
72
+ color={Colors.purple400}
73
+ boxSize={"20px"}
74
+ mt={1}
75
+ className="aiBtn__icon"
76
+ />
77
+ </>
78
+ )}
79
+ </Flex>
80
+ </Box>
81
+ </span>
82
+ </span>
83
+ <span className="ql-formats">
84
+ <select
85
+ className="ql-header"
86
+ defaultValue={""}
87
+ onChange={(e) => e.persist()}
88
+ >
89
+ <option value="1" />
90
+ <option value="2" />
91
+ <option value="3" />
92
+ <option value="4" />
93
+ <option value="5" />
94
+ <option value="6" />
95
+ <option selected />
96
+ </select>
97
+ </span>
98
+
99
+ <span className="ql-formats">
100
+ <button className="ql-bold"></button>
101
+ <button className="ql-italic"></button>
102
+ <button className="ql-underline"></button>
103
+ <button className="ql-strike"></button>
104
+ </span>
105
+ <span className="ql-formats">
106
+ <button className="ql-blockquote"></button>
107
+ <button className="ql-code-block"></button>
108
+ </span>
109
+ <span className="ql-formats">
110
+ <button className="ql-list" value="ordered"></button>
111
+ <button className="ql-list" value="bullet"></button>
112
+ </span>
113
+ <span className="ql-formats">
114
+ <button className="ql-script" value="sub"></button>
115
+ <button className="ql-script" value="super"></button>
116
+ </span>
117
+ <span className="ql-formats">
118
+ <button className="ql-indent" value="-1"></button>
119
+ <button className="ql-indent" value="+1"></button>
120
+ </span>
121
+ <span className="ql-formats">
122
+ <button className="ql-direction" value="rtl"></button>
123
+ </span>
124
+ <span className="ql-formats">
125
+ <button className="ql-link"></button>
126
+ <button className="ql-image"></button>
127
+ <button className="ql-video"></button>
128
+ </span>
129
+ <span className="ql-formats">
130
+ <button className="ql-clean"></button>
131
+ </span>
132
+ </div>
133
+ );
134
+ };
135
+
136
+ export const MarkdownEditor = ({
137
+ defaultValue,
138
+ onChange,
139
+ border,
140
+ placeholder = "Type your message here...",
141
+ value,
142
+ onHandleFile,
143
+ label,
144
+ }: MarkdownEditorWithExclusiveValues) => {
145
+ const quillRef = useRef<any>(null);
146
+
147
+ const fileToDataUri = (file: File) =>
148
+ new Promise((resolve) => {
149
+ const reader = new FileReader();
150
+ reader.onload = (event) => {
151
+ resolve(event?.target?.result);
152
+ };
153
+ reader.readAsDataURL(file);
154
+ });
155
+
156
+ const imageHandler = () => {
157
+ const input = document.createElement("input");
158
+ const editor = quillRef.current.getEditor();
159
+
160
+ input.setAttribute("type", "file");
161
+ input.setAttribute("accept", "image/*");
162
+ input.click();
163
+
164
+ input.onchange = () => {
165
+ const file: File | null = input && input.files && input.files[0];
166
+ if (file) {
167
+ onHandleFile(file);
168
+ // if (/^image\//.test(file.type)) {
169
+ // fileToDataUri(file).then(async (dataURL) => {
170
+ // const data = {
171
+ // images: [
172
+ // {
173
+ // alt: "",
174
+ // buffer: dataURL,
175
+ // },
176
+ // ],
177
+ // };
178
+
179
+ // const res = await Request.post(
180
+ // `/upload-images?account_id=${account_id}`,
181
+ // data
182
+ // );
183
+
184
+ // const url = res.data && res?.data[0]?.path;
185
+ // editor.insertEmbed(editor.getSelection(), "image", url);
186
+ // });
187
+ // } else {
188
+ // customToast("You can only upload an image.", ToastType.error);
189
+ // }
190
+ }
191
+ };
192
+ };
193
+
194
+ const modules = useMemo(
195
+ () => ({
196
+ toolbar: {
197
+ container: "#toolbar",
198
+ handlers: {
199
+ image: imageHandler,
200
+ },
201
+ },
202
+ }),
203
+ // eslint-disable-next-line
204
+ []
205
+ );
206
+
207
+ return (
208
+ <Box w="full" fontFamily={"Degular"} fontWeight={500}>
209
+ {label && (
210
+ <FormLabel
211
+ fontSize={"1rem"}
212
+ lineHeight="1.25rem"
213
+ fontWeight={600}
214
+ fontFamily="Degular"
215
+ letterSpacing="-0.004rem"
216
+ mb="12px"
217
+ >
218
+ {label}
219
+ </FormLabel>
220
+ )}
221
+ <Box
222
+ border={border ?? `1px solid ${Colors.gray50}`}
223
+ borderRadius="12px"
224
+ className="markdown-container"
225
+ p="16px"
226
+ _hover={{
227
+ background: Colors.gray50,
228
+ border: `3px solid ${Colors.black300}`,
229
+ }}
230
+ transition={"all 0.2s ease-in-out"}
231
+ >
232
+ <CustomToolbar setValue={onChange} />
233
+ <ReactQuill
234
+ modules={modules}
235
+ theme="snow"
236
+ onChange={onChange}
237
+ defaultValue={value}
238
+ ref={quillRef}
239
+ placeholder={placeholder}
240
+ style={{ fontSize: "20px" }}
241
+ value={value}
242
+ />
243
+ </Box>
244
+ </Box>
245
+ );
246
+ };
@@ -0,0 +1,80 @@
1
+ /** @format */
2
+
3
+ import {
4
+ Input as ChakraInput,
5
+ InputGroup,
6
+ InputLeftElement,
7
+ InputProps,
8
+ InputRightElement,
9
+ } from "@chakra-ui/react";
10
+ import Colors from "components/styleGuide/Colors";
11
+ // This will change when we build icon components
12
+ import { ReactComponent as CloseIcon } from "assets/svgs/close-circle.svg";
13
+ import { ReactComponent as SearchIcon } from "assets/svgs/search-normal.svg";
14
+
15
+ export interface ISearchInput extends InputProps {
16
+ name: string;
17
+ value?: string;
18
+ id: string;
19
+ onChange?: (e?: any) => void;
20
+ defaultValue?: any;
21
+ placeholder?: any;
22
+ error?: boolean;
23
+ errorMessage?: string;
24
+ success?: boolean;
25
+ successMessage?: string;
26
+ hint?: string;
27
+ onClear?: any;
28
+ }
29
+
30
+ const SearchInput = ({
31
+ name,
32
+ id,
33
+ value,
34
+ onChange,
35
+ defaultValue,
36
+ placeholder,
37
+ onClear,
38
+ }: ISearchInput) => {
39
+ return (
40
+ <InputGroup>
41
+ <InputLeftElement py="12px" ml="4px">
42
+ <SearchIcon />
43
+ </InputLeftElement>
44
+ {value && (
45
+ <InputRightElement py="12px" mr="8px" onClick={onClear}>
46
+ <CloseIcon />
47
+ </InputRightElement>
48
+ )}
49
+
50
+ <ChakraInput
51
+ name={name}
52
+ id={id}
53
+ value={value}
54
+ defaultValue={defaultValue}
55
+ onChange={onChange}
56
+ placeholder={placeholder || "Search..."}
57
+ bg={Colors.gray50}
58
+ borderRadius="100px"
59
+ border="none"
60
+ fontFamily={"Degular"}
61
+ fontSize={"16px"}
62
+ lineHeight={"24px"}
63
+ letterSpacing={"-0.2px"}
64
+ fontWeight={500}
65
+ _focus={{
66
+ outline: `none !important`,
67
+ }}
68
+ _focusVisible={{
69
+ outline: `none !important`,
70
+ }}
71
+ py="12px"
72
+ px="16px"
73
+ type="text"
74
+ _placeholder={{ color: `${Colors.gray200}` }}
75
+ />
76
+ </InputGroup>
77
+ );
78
+ };
79
+
80
+ export default SearchInput;
@@ -0,0 +1,142 @@
1
+ /** @format */
2
+
3
+ import { Box, Circle, Flex, FormLabel, Text } from "@chakra-ui/react";
4
+ import AsyncSelect from "react-select/async";
5
+ import countries_flag from "utils/countries-flag.json";
6
+ import {
7
+ DropdownIndicator,
8
+ ISelectInputProps,
9
+ OptionType,
10
+ selectStyles,
11
+ } from "./SelectInput";
12
+ import { useRef } from "react";
13
+ // eslint-disable-next-line import/named
14
+ import { GroupBase } from "react-select";
15
+ import Select from "react-select/dist/declarations/src/Select";
16
+
17
+ const CustomOption = ({
18
+ value,
19
+ flag,
20
+ abr,
21
+ }: {
22
+ value: string;
23
+ flag: string;
24
+ abr: string;
25
+ }) => {
26
+ return (
27
+ <Flex alignItems="center" cursor={"pointer"} gap="12px">
28
+ {flag && (
29
+ <Circle
30
+ bg={`url(${flag})`}
31
+ bgSize="cover"
32
+ bgPosition="center"
33
+ bgRepeat="no-repeat"
34
+ size="20px"
35
+ ></Circle>
36
+ )}
37
+ <Text
38
+ fontSize="17px"
39
+ lineHeight={"120%"}
40
+ fontWeight={600}
41
+ fontFamily="Degular Display"
42
+ letterSpacing="0.1px"
43
+ >
44
+ {value}
45
+ </Text>
46
+ </Flex>
47
+ );
48
+ };
49
+
50
+ const countries = countries_flag
51
+ ?.sort((a, b) => a.name.localeCompare(b.name))
52
+ ?.map((i) => ({
53
+ value: i.name,
54
+ label: i.name,
55
+ flag: i.flag,
56
+ // @ts-ignore
57
+ abr: i.alpha3Code,
58
+ code: i.alpha2Code,
59
+ }));
60
+
61
+ export interface ICountrySelectProps {
62
+ valueType?: "full" | "code";
63
+ options?: any;
64
+ label?: string;
65
+ placeholder?: string;
66
+ onChange?: (e: any) => void;
67
+ onBlur?: (e: any) => void;
68
+ value?: any;
69
+ }
70
+
71
+ const CountrySelect = ({
72
+ value,
73
+ onChange,
74
+ label = "Country",
75
+ valueType = "full",
76
+ placeholder = "Select your country",
77
+ options = countries,
78
+ }: ICountrySelectProps) => {
79
+ const loadOptions = (
80
+ searchValue: string,
81
+ callBack: (options: any[]) => void
82
+ ) => {
83
+ const filteredOptions = options?.filter((option: OptionType) =>
84
+ option.label.toLowerCase().includes(searchValue.toLowerCase())
85
+ );
86
+ callBack(filteredOptions);
87
+ };
88
+
89
+ const selectRef = useRef<Select<any, boolean, GroupBase<any>> | null>(null);
90
+
91
+ return (
92
+ <Box w="full" fontFamily={"Degular"} fontWeight={500}>
93
+ {label && (
94
+ <FormLabel
95
+ fontSize={"1rem"}
96
+ lineHeight="1.25rem"
97
+ fontWeight={600}
98
+ fontFamily="Degular"
99
+ letterSpacing="-0.004rem"
100
+ mb="12px"
101
+ htmlFor={"country"}
102
+ >
103
+ {label}
104
+ </FormLabel>
105
+ )}
106
+
107
+ <AsyncSelect
108
+ components={{
109
+ DropdownIndicator,
110
+ IndicatorSeparator: () => null,
111
+ // Option: CustomOption,
112
+ }}
113
+ loadOptions={loadOptions}
114
+ cacheOptions
115
+ defaultOptions={options}
116
+ id="country"
117
+ placeholder={placeholder}
118
+ styles={selectStyles}
119
+ formatOptionLabel={CustomOption}
120
+ name="country"
121
+ onChange={(e: any) => {
122
+ if (onChange) {
123
+ onChange(valueType === "code" ? e : e?.value);
124
+ selectRef?.current?.blur();
125
+ }
126
+ }}
127
+ ref={selectRef}
128
+ value={
129
+ value
130
+ ? {
131
+ value,
132
+ abr: options?.find((i: any) => i?.value === value)?.abr,
133
+ flag: options?.find((i: any) => i?.value === value)?.flag,
134
+ }
135
+ : null
136
+ }
137
+ />
138
+ </Box>
139
+ );
140
+ };
141
+
142
+ export default CountrySelect;
@@ -0,0 +1,89 @@
1
+ /** @format */
2
+
3
+ import {
4
+ Box,
5
+ FormControl,
6
+ FormErrorMessage,
7
+ FormLabel,
8
+ } from "@chakra-ui/react";
9
+ import Paragraph from "components/Typography/Paragraph";
10
+ import Colors from "components/styleGuide/Colors";
11
+ import { useEffect } from "react";
12
+ import PhoneInput from "react-phone-input-2";
13
+ import "react-phone-input-2/lib/style.css";
14
+ import "assets/styles/index.css";
15
+
16
+ export interface IPhoneNumberInputProps {
17
+ value?: string;
18
+ onChange?: (value: string) => void;
19
+ enableSearch?: boolean;
20
+ placeholder?: string;
21
+ label?: string;
22
+ id?: string;
23
+ subtext?: string;
24
+ }
25
+
26
+ const PhoneNumberInput = ({
27
+ value,
28
+ onChange,
29
+ enableSearch,
30
+ placeholder,
31
+ label,
32
+ id,
33
+ subtext,
34
+ }: IPhoneNumberInputProps) => {
35
+ const dropdown = `<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
36
+ <mask id="mask0_1047_15277" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="20" height="20">
37
+ <rect width="20" height="20" fill="#C4C4C4"/>
38
+ </mask>
39
+ <g mask="url(#mask0_1047_15277)">
40
+ <path d="M9.99942 13.0211C9.8789 13.0211 9.76673 13.0019 9.66289 12.9634C9.55904 12.925 9.46032 12.8589 9.36674 12.7653L4.87252 8.27112C4.73405 8.13267 4.66322 7.95864 4.66002 7.74902C4.6568 7.53941 4.72763 7.36217 4.87252 7.2173C5.01738 7.07243 5.19302 7 5.39942 7C5.60582 7 5.78145 7.07243 5.92632 7.2173L9.99942 11.2904L14.0725 7.2173C14.211 7.07885 14.385 7.00802 14.5946 7.0048C14.8042 7.0016 14.9814 7.07243 15.1263 7.2173C15.2712 7.36217 15.3436 7.53781 15.3436 7.74422C15.3436 7.95062 15.2712 8.12626 15.1263 8.27112L10.6321 12.7653C10.5385 12.8589 10.4398 12.925 10.3359 12.9634C10.2321 13.0019 10.1199 13.0211 9.99942 13.0211Z" fill="#131316"/>
41
+ </g>
42
+ </svg>`;
43
+ useEffect(() => {
44
+ if (window) {
45
+ const el = document.querySelector(".phone_container_class .arrow");
46
+ if (el) {
47
+ // @ts-ignore
48
+ el.innerHTML = dropdown;
49
+ }
50
+ }
51
+ }, []);
52
+
53
+ return (
54
+ <Box w="full" fontFamily={"Degular"} fontWeight={500}>
55
+ {label && (
56
+ <FormLabel
57
+ fontSize={"1rem"}
58
+ lineHeight="1.25rem"
59
+ fontWeight={600}
60
+ fontFamily="Degular"
61
+ letterSpacing="-0.004rem"
62
+ mb="12px"
63
+ htmlFor={id ?? ""}
64
+ >
65
+ {label}
66
+ </FormLabel>
67
+ )}
68
+ <PhoneInput
69
+ enableSearch={enableSearch}
70
+ countryCodeEditable={false}
71
+ value={value}
72
+ onChange={onChange}
73
+ containerClass={`phone-input-container phone_container_class`}
74
+ placeholder={placeholder}
75
+ inputClass="phone_input"
76
+ buttonClass="phone_country_button"
77
+ dropdownClass="phone_country_dropdown"
78
+ />
79
+
80
+ {subtext && (
81
+ <Paragraph size={"xxs"} color={Colors.gray400} mt={"8px"}>
82
+ {subtext}
83
+ </Paragraph>
84
+ )}
85
+ </Box>
86
+ );
87
+ };
88
+
89
+ export default PhoneNumberInput;