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.
- package/.env.sample +1 -0
- package/.eslintignore +5 -0
- package/.eslintrc.json +96 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +15 -0
- package/.husky/commit-msg +4 -0
- package/.husky/pre-commit +6 -0
- package/.prettierignore +7 -0
- package/.prettierrc +9 -0
- package/.storybook/main.ts +22 -0
- package/.storybook/preview.ts +20 -0
- package/.vscode/extensions.json +10 -0
- package/README.md +139 -0
- package/commitlint.config.cjs +1 -0
- package/index.html +31 -0
- package/package.json +98 -0
- package/public/_redirects +1 -0
- package/public/manifest.json +15 -0
- package/public/robots.txt +3 -0
- package/public/vite.svg +1 -0
- package/src/app.tsx +25 -0
- package/src/assets/fonts/Degular-Medium.woff2 +0 -0
- package/src/assets/fonts/Degular-Medium_Italic.woff2 +0 -0
- package/src/assets/fonts/Degular-Semibold.woff2 +0 -0
- package/src/assets/fonts/Degular-Semibold_Italic.woff2 +0 -0
- package/src/assets/fonts/Degular_Display-Bold.woff2 +0 -0
- package/src/assets/fonts/Degular_Display-Bold_Italic.woff2 +0 -0
- package/src/assets/fonts/Degular_Display-Semibold.woff2 +0 -0
- package/src/assets/fonts/Degular_Display-Semibold_Italic.woff2 +0 -0
- package/src/assets/fonts/Sohne-Buch.otf +0 -0
- package/src/assets/fonts/So/302/246/303/252hne-Buch.otf +0 -0
- package/src/assets/fonts/So/302/246/303/252hne-BuchKursiv.otf +0 -0
- package/src/assets/fonts/So/302/246/303/252hne-Dreiviertelfett.otf +0 -0
- package/src/assets/fonts/So/302/246/303/252hne-DreiviertelfettKursiv.otf +0 -0
- package/src/assets/fonts/So/302/246/303/252hne-Extrafett.otf +0 -0
- package/src/assets/fonts/So/302/246/303/252hne-Fett.otf +0 -0
- package/src/assets/fonts/So/302/246/303/252hne-Halbfett.otf +0 -0
- package/src/assets/fonts/So/302/246/303/252hne-HalbfettKursiv.otf +0 -0
- package/src/assets/fonts/So/302/246/303/252hne-Kra/302/246/303/252ftig.otf +0 -0
- package/src/assets/fonts/So/302/246/303/252hne-Kra/302/246/303/252ftigKursiv.otf +0 -0
- package/src/assets/fonts/So/302/246/303/252hne-Leicht.otf +0 -0
- package/src/assets/fonts/soehne-buch-kursiv.woff2 +0 -0
- package/src/assets/fonts/soehne-buch.woff2 +0 -0
- package/src/assets/fonts/soehne-dreiviertelfett-kursiv.woff2 +0 -0
- package/src/assets/fonts/soehne-dreiviertelfett.woff2 +0 -0
- package/src/assets/fonts/soehne-extrafett.woff2 +0 -0
- package/src/assets/fonts/soehne-fett.woff2 +0 -0
- package/src/assets/fonts/soehne-halbfett-kursiv.woff2 +0 -0
- package/src/assets/fonts/soehne-halbfett.woff2 +0 -0
- package/src/assets/fonts/soehne-kraftig-kursiv.woff2 +0 -0
- package/src/assets/fonts/soehne-kraftig.woff2 +0 -0
- package/src/assets/fonts/soehne-leicht.woff2 +0 -0
- package/src/assets/styles/index.css +486 -0
- package/src/assets/svgs/check_circle.svg +8 -0
- package/src/assets/svgs/close-circle.svg +3 -0
- package/src/assets/svgs/error_message_icon.svg +8 -0
- package/src/assets/svgs/personal_profile_avatar.svg +13 -0
- package/src/assets/svgs/search-normal.svg +4 -0
- package/src/assets/svgs/store_avatar.svg +13 -0
- package/src/assets/svgs/viewIcon.svg +8 -0
- package/src/assets/svgs/viewOffIcon.svg +3 -0
- package/src/assets/themes/baseThemes.ts +40 -0
- package/src/components/Accordion/index.tsx +111 -0
- package/src/components/Avatars/index.tsx +111 -0
- package/src/components/Button/IconButton.tsx +119 -0
- package/src/components/Button/index.tsx +173 -0
- package/src/components/InputFields/Input.tsx +177 -0
- package/src/components/InputFields/MarkdownEditor.tsx +246 -0
- package/src/components/InputFields/SearchInput.tsx +80 -0
- package/src/components/InputFields/SelectInput/CountrySelect.tsx +142 -0
- package/src/components/InputFields/SelectInput/PhoneNumberInput.tsx +89 -0
- package/src/components/InputFields/SelectInput/SelectInput.tsx +395 -0
- package/src/components/InputFields/SelectInput/index.ts +9 -0
- package/src/components/InputFields/TextArea.tsx +150 -0
- package/src/components/InputFields/UsernameInput.tsx +145 -0
- package/src/components/Tiles/index.tsx +95 -0
- package/src/components/Typography/Display.tsx +84 -0
- package/src/components/Typography/Heading.tsx +136 -0
- package/src/components/Typography/Paragraph.tsx +105 -0
- package/src/components/Typography/Subtitle.tsx +148 -0
- package/src/components/Uploader/FileUploader.tsx +132 -0
- package/src/components/Uploader/ImageUploader.tsx +311 -0
- package/src/components/controls/Chip.tsx +78 -0
- package/src/components/controls/DoubleTab.tsx +80 -0
- package/src/components/controls/Pagination.tsx +164 -0
- package/src/components/controls/RadioButton.tsx +135 -0
- package/src/components/controls/RectangleCheckButton.tsx +106 -0
- package/src/components/controls/RoundCheckButton.tsx +106 -0
- package/src/components/controls/Stepper.tsx +84 -0
- package/src/components/controls/TabMenu.tsx +114 -0
- package/src/components/controls/ToggleButton.tsx +123 -0
- package/src/components/notifications/Banner.tsx +175 -0
- package/src/components/notifications/ClickTooltip.tsx +108 -0
- package/src/components/notifications/HoverTooltip.tsx +34 -0
- package/src/components/notifications/Snackbar.tsx +138 -0
- package/src/components/styleGuide/Colors.tsx +176 -0
- package/src/hooks/useImageUpload.ts +78 -0
- package/src/icons/AccountBalanceIcon.tsx +35 -0
- package/src/icons/AccountBalanceWalletFilledIcon.tsx +35 -0
- package/src/icons/AccountBalanceWalletIcon.tsx +35 -0
- package/src/icons/AccountCircleFilledIcon.tsx +35 -0
- package/src/icons/AccountCircleIcon.tsx +35 -0
- package/src/icons/AddAPhotoIcon.tsx +35 -0
- package/src/icons/AddBusinessFilledIcon.tsx +35 -0
- package/src/icons/AddBusinessIcon.tsx +35 -0
- package/src/icons/AddCircleFilledIcon.tsx +35 -0
- package/src/icons/AddCircleIcon.tsx +35 -0
- package/src/icons/AddIcon.tsx +35 -0
- package/src/icons/AddPhotoAlternateIcon.tsx +35 -0
- package/src/icons/AddShoppingCartIcon.tsx +35 -0
- package/src/icons/AddToSocialsIcon.tsx +48 -0
- package/src/icons/AddsClickIcon.tsx +35 -0
- package/src/icons/AdminPanelSettingsIcon.tsx +35 -0
- package/src/icons/AirplaneModeActiveIcon.tsx +35 -0
- package/src/icons/AlarmIcon.tsx +35 -0
- package/src/icons/AllInboxIcon.tsx +35 -0
- package/src/icons/AnimationIcon.tsx +35 -0
- package/src/icons/AppsFilledIcon.tsx +35 -0
- package/src/icons/AppsIcon.tsx +35 -0
- package/src/icons/ArchiveIcon.tsx +35 -0
- package/src/icons/ArrowBackIcon.tsx +35 -0
- package/src/icons/ArrowCircleDownFilledIcon.tsx +35 -0
- package/src/icons/ArrowCircleUpFilledIcon.tsx +35 -0
- package/src/icons/ArrowDropDownIcon.tsx +32 -0
- package/src/icons/ArrowDropUpIcon.tsx +37 -0
- package/src/icons/ArrowForwardIcon.tsx +35 -0
- package/src/icons/ArtTrackIcon.tsx +35 -0
- package/src/icons/ArticleFilledIcon.tsx +35 -0
- package/src/icons/ArticleIcon.tsx +35 -0
- package/src/icons/AttachMoneyIcon.tsx +35 -0
- package/src/icons/AttachmentIcon.tsx +35 -0
- package/src/icons/AudioFileFilledIcon.tsx +35 -0
- package/src/icons/AutoAwesomeMosaicFilledIcon.tsx +35 -0
- package/src/icons/AutoAwesomeMosaicIcon.tsx +35 -0
- package/src/icons/AutoFixFilledIcon.tsx +35 -0
- package/src/icons/AutoFixIcon.tsx +35 -0
- package/src/icons/AutoGraphIcon.tsx +35 -0
- package/src/icons/AwardStarFilledIcon.tsx +35 -0
- package/src/icons/AwardStarIcon.tsx +35 -0
- package/src/icons/BarChartFilledIcon.tsx +35 -0
- package/src/icons/BlockIcon.tsx +35 -0
- package/src/icons/BoltFilledIcon.tsx +35 -0
- package/src/icons/BoltIcon.tsx +35 -0
- package/src/icons/BookOnlineIcon.tsx +35 -0
- package/src/icons/BugReportIcon.tsx +35 -0
- package/src/icons/BusinessCenterFilledIcon.tsx +35 -0
- package/src/icons/BusinessCenterIcon.tsx +35 -0
- package/src/icons/CalendarMonthFilledIcon.tsx +35 -0
- package/src/icons/CalendarMonthIcon.tsx +35 -0
- package/src/icons/CalendarTodayIcon.tsx +35 -0
- package/src/icons/CallMadeIcon.tsx +35 -0
- package/src/icons/CallMissedIcon.tsx +35 -0
- package/src/icons/CallMissedOutgoingIcon.tsx +35 -0
- package/src/icons/CallRecievedIcon.tsx +35 -0
- package/src/icons/CampaignFilledIcon.tsx +22 -0
- package/src/icons/CampaignIcon.tsx +35 -0
- package/src/icons/CancelFilledIcon.tsx +22 -0
- package/src/icons/CancelIcon.tsx +22 -0
- package/src/icons/CaptivePortalIcon.tsx +35 -0
- package/src/icons/CardLayoutIcon.tsx +22 -0
- package/src/icons/CasesFilledIcon.tsx +35 -0
- package/src/icons/CasesIcon.tsx +35 -0
- package/src/icons/CategoryIcon.tsx +35 -0
- package/src/icons/ChairIcon.tsx +35 -0
- package/src/icons/ChangeCircleIcon.tsx +35 -0
- package/src/icons/ChatBubbleFilledIcon.tsx +35 -0
- package/src/icons/ChatBubbleIcon.tsx +35 -0
- package/src/icons/ChatFilledIcon.tsx +35 -0
- package/src/icons/ChatIcon.tsx +35 -0
- package/src/icons/CheckCircleFilledIcon.tsx +35 -0
- package/src/icons/CheckCircleIcon.tsx +35 -0
- package/src/icons/CheckIcon.tsx +35 -0
- package/src/icons/ChevronLeftIcon.tsx +43 -0
- package/src/icons/ChevronRightIcon.tsx +43 -0
- package/src/icons/CloseIcon.tsx +35 -0
- package/src/icons/CloudUploadIcon.tsx +35 -0
- package/src/icons/CodeIcon.tsx +35 -0
- package/src/icons/CoffeeIcon.tsx +35 -0
- package/src/icons/CollectionsBookmarkIcon.tsx +35 -0
- package/src/icons/ColorPickerIcon.tsx +22 -0
- package/src/icons/CommentCircleAltChatMessageIcon.tsx +24 -0
- package/src/icons/ConfirmationNumberIcon.tsx +35 -0
- package/src/icons/ContactMailFilledIcon.tsx +35 -0
- package/src/icons/ContactMailIcon.tsx +35 -0
- package/src/icons/ContactPageIcon.tsx +22 -0
- package/src/icons/ContactPhoneFilledIcon.tsx +35 -0
- package/src/icons/ContactPhoneIcon.tsx +35 -0
- package/src/icons/ContactsIcon.tsx +22 -0
- package/src/icons/ContentCopyIcon.tsx +35 -0
- package/src/icons/CopyIcon.tsx +35 -0
- package/src/icons/CreditCardFilledIcon.tsx +35 -0
- package/src/icons/CreditCardIcon.tsx +35 -0
- package/src/icons/DarkModeIcon.tsx +35 -0
- package/src/icons/DashboardFilledIcon.tsx +35 -0
- package/src/icons/DashboardIcon.tsx +35 -0
- package/src/icons/DatabaseFilledIcon.tsx +35 -0
- package/src/icons/DeleteIcon.tsx +35 -0
- package/src/icons/DescriptionIcon.tsx +35 -0
- package/src/icons/DesktopMacIcon.tsx +35 -0
- package/src/icons/DevicesIcon.tsx +35 -0
- package/src/icons/DiamondFilledIcon.tsx +35 -0
- package/src/icons/DiamondIcon.tsx +35 -0
- package/src/icons/DigitalProductsIcon.tsx +58 -0
- package/src/icons/DiscountIcon.tsx +24 -0
- package/src/icons/Diversity1Icon.tsx +22 -0
- package/src/icons/Diversity2Icon.tsx +22 -0
- package/src/icons/Diversity3Icon.tsx +22 -0
- package/src/icons/DnsIcon.tsx +35 -0
- package/src/icons/DoNotDisturbOnFilledIcon.tsx +35 -0
- package/src/icons/DoNotDisturbOnIcon.tsx +35 -0
- package/src/icons/DomainAddIcon.tsx +35 -0
- package/src/icons/DomainIcon.tsx +35 -0
- package/src/icons/DomainVerificationIcon.tsx +35 -0
- package/src/icons/DownloadIcon.tsx +35 -0
- package/src/icons/DraftsIcon.tsx +35 -0
- package/src/icons/DragHandleIcon.tsx +35 -0
- package/src/icons/DragIndicatorIcon.tsx +35 -0
- package/src/icons/EditFilledIcon.tsx +35 -0
- package/src/icons/EditIcon.tsx +35 -0
- package/src/icons/EmojiEventsFilledIcon.tsx +35 -0
- package/src/icons/EmojiEventsIcon.tsx +35 -0
- package/src/icons/EmojiFoodBeverageIcon.tsx +35 -0
- package/src/icons/EmojiIcon.tsx +35 -0
- package/src/icons/EmptyIcon.tsx +22 -0
- package/src/icons/ErrorFilledIcon.tsx +35 -0
- package/src/icons/ErrorIcon.tsx +35 -0
- package/src/icons/EventFilledIcon.tsx +35 -0
- package/src/icons/EventIcon.tsx +35 -0
- package/src/icons/EventTicketIcon.tsx +54 -0
- package/src/icons/ExpandLessIcon.tsx +40 -0
- package/src/icons/ExpandMoreIcon.tsx +35 -0
- package/src/icons/FastActionPricingIcon.tsx +58 -0
- package/src/icons/FeedFilledIcon.tsx +35 -0
- package/src/icons/FeedIcon.tsx +35 -0
- package/src/icons/FilePresentIcon.tsx +35 -0
- package/src/icons/FilterListIcon.tsx +35 -0
- package/src/icons/FitbitArrowDownIcon.tsx +35 -0
- package/src/icons/FitbitArrowUpwardIcon.tsx +35 -0
- package/src/icons/FlagIcon.tsx +35 -0
- package/src/icons/FormatAlignCenterIcon.tsx +35 -0
- package/src/icons/FormatAlignJustifyIcon.tsx +35 -0
- package/src/icons/FormatAlignLeftIcon.tsx +35 -0
- package/src/icons/FormatAlignRightIcon.tsx +35 -0
- package/src/icons/FormatBoldIcon.tsx +35 -0
- package/src/icons/FormatItalicIcon.tsx +35 -0
- package/src/icons/FormatListBulletedIcon.tsx +35 -0
- package/src/icons/FormatListNumberedIcon.tsx +35 -0
- package/src/icons/FormatSizeIcon.tsx +35 -0
- package/src/icons/FormatUnderlineIcon.tsx +35 -0
- package/src/icons/ForumIcon.tsx +35 -0
- package/src/icons/ForwardToInboxIcon.tsx +35 -0
- package/src/icons/GalleryThumbnailIcon.tsx +35 -0
- package/src/icons/GppBadFilledIcon.tsx +35 -0
- package/src/icons/GppBadIcon.tsx +35 -0
- package/src/icons/GppMaybeFilledIcon.tsx +35 -0
- package/src/icons/GppMaybeIcon.tsx +35 -0
- package/src/icons/GridViewIcon.tsx +35 -0
- package/src/icons/GroupFilledIcon.tsx +35 -0
- package/src/icons/GroupIcon.tsx +35 -0
- package/src/icons/HeadphonesIcon.tsx +35 -0
- package/src/icons/HomeFilledIcon.tsx +35 -0
- package/src/icons/HomeIcon.tsx +35 -0
- package/src/icons/HomePinIcon.tsx +35 -0
- package/src/icons/HourGlassEmptyIcon.tsx +35 -0
- package/src/icons/HubIcon.tsx +22 -0
- package/src/icons/InfoFilledIcon.tsx +35 -0
- package/src/icons/InfoGradientFilledIcon.tsx +49 -0
- package/src/icons/InfoIcon.tsx +35 -0
- package/src/icons/InsertChartFilledIcon.tsx +35 -0
- package/src/icons/InsertChartIcon.tsx +35 -0
- package/src/icons/InventoryIcon.tsx +22 -0
- package/src/icons/IosShareIcon.tsx +35 -0
- package/src/icons/KeyboardBackspaceIcon.tsx +35 -0
- package/src/icons/LanguageIcon.tsx +35 -0
- package/src/icons/LibraryMusicIcon.tsx +35 -0
- package/src/icons/LinkIcon.tsx +35 -0
- package/src/icons/LinkOffIcon.tsx +35 -0
- package/src/icons/LocalActivityIcon.tsx +35 -0
- package/src/icons/LocalFloristFilledIcon.tsx +35 -0
- package/src/icons/LocalFloristIcon.tsx +35 -0
- package/src/icons/LocationOnIcon.tsx +35 -0
- package/src/icons/LockIcon.tsx +35 -0
- package/src/icons/LoginIcon.tsx +35 -0
- package/src/icons/LogoutIcon.tsx +43 -0
- package/src/icons/MailIcon.tsx +35 -0
- package/src/icons/MarkUnreadChatIcon.tsx +35 -0
- package/src/icons/MasterClassIcon.tsx +74 -0
- package/src/icons/MediaLinkFilledIcon.tsx +35 -0
- package/src/icons/MediaLinkIcon.tsx +35 -0
- package/src/icons/MenuIcon.tsx +35 -0
- package/src/icons/MenuOpenIcon.tsx +35 -0
- package/src/icons/MilitaryTechFilledIcon.tsx +35 -0
- package/src/icons/MilitaryTechIcon.tsx +35 -0
- package/src/icons/MonitoringIcon.tsx +35 -0
- package/src/icons/MoreHorizontalIcon.tsx +35 -0
- package/src/icons/MoreHorizontalSmallIcon.tsx +35 -0
- package/src/icons/MoreVerticalIcon.tsx +35 -0
- package/src/icons/NotificationsFilledIcon.tsx +40 -0
- package/src/icons/NotificationsIcon.tsx +35 -0
- package/src/icons/OpenInNewIcon.tsx +35 -0
- package/src/icons/OthersIcon.tsx +58 -0
- package/src/icons/PageViewIcon.tsx +35 -0
- package/src/icons/PaidIcon.tsx +35 -0
- package/src/icons/PaletteFilledIcon.tsx +35 -0
- package/src/icons/PaletteIcon.tsx +35 -0
- package/src/icons/PauseIcon.tsx +22 -0
- package/src/icons/PayInTranchesIcon.tsx +29 -0
- package/src/icons/PaymentsFilledIcon.tsx +35 -0
- package/src/icons/PaymentsIcon.tsx +35 -0
- package/src/icons/PendingActionsIcon.tsx +35 -0
- package/src/icons/PermMediaIcon.tsx +35 -0
- package/src/icons/PersonAddIcon.tsx +35 -0
- package/src/icons/PersonIcon.tsx +35 -0
- package/src/icons/PhotoCameraIcon.tsx +35 -0
- package/src/icons/PhotoFilledIcon.tsx +35 -0
- package/src/icons/PhotoIcon.tsx +35 -0
- package/src/icons/PhotoLibraryFilledIcon.tsx +35 -0
- package/src/icons/PhotoLibraryIcon.tsx +35 -0
- package/src/icons/PictureAsPdfFilledIcon.tsx +35 -0
- package/src/icons/PictureAsPdfIcon.tsx +35 -0
- package/src/icons/PlayArrowIcon.tsx +32 -0
- package/src/icons/PlayCircleFilledIcon.tsx +35 -0
- package/src/icons/PlayCircleIcon.tsx +22 -0
- package/src/icons/PowerRoundedIcon.tsx +35 -0
- package/src/icons/PreviewIcon.tsx +35 -0
- package/src/icons/PublicIcon.tsx +22 -0
- package/src/icons/PublishIcon.tsx +35 -0
- package/src/icons/PushPinFilledIcon.tsx +35 -0
- package/src/icons/PushPinIcon.tsx +35 -0
- package/src/icons/QrCode2Icon.tsx +35 -0
- package/src/icons/RadioButtonCheckedIcon.tsx +35 -0
- package/src/icons/RadioButtonUncheckedIcon.tsx +35 -0
- package/src/icons/RecieptLongFilledIcon.tsx +35 -0
- package/src/icons/RecieptLongIcon.tsx +35 -0
- package/src/icons/RecordVoiceOverIcon.tsx +35 -0
- package/src/icons/RedeemIcon.tsx +35 -0
- package/src/icons/RedoIcon.tsx +35 -0
- package/src/icons/RemoveIcon.tsx +32 -0
- package/src/icons/RemoveRoadIcon.tsx +35 -0
- package/src/icons/ReportFilledIcon.tsx +35 -0
- package/src/icons/ReportIcon.tsx +35 -0
- package/src/icons/ReviewsIcon.tsx +43 -0
- package/src/icons/SavingsFilledIcon.tsx +35 -0
- package/src/icons/SavingsIcon.tsx +35 -0
- package/src/icons/ScheduleIcon.tsx +35 -0
- package/src/icons/ScheduleSendIcon.tsx +35 -0
- package/src/icons/SearchNormalIcon.tsx +32 -0
- package/src/icons/SellIcon.tsx +35 -0
- package/src/icons/SendIcon.tsx +35 -0
- package/src/icons/ServicesIcon.tsx +39 -0
- package/src/icons/SettingsFilledIcon.tsx +35 -0
- package/src/icons/SettingsIcon.tsx +35 -0
- package/src/icons/ShareIcon.tsx +35 -0
- package/src/icons/ShareWithContactsIcon.tsx +62 -0
- package/src/icons/ShareWithSocialsIcon.tsx +64 -0
- package/src/icons/ShoppingCartFilledIcon.tsx +35 -0
- package/src/icons/ShoppingCartIcon.tsx +35 -0
- package/src/icons/ShuffleIcon.tsx +35 -0
- package/src/icons/SmartPhoneIcon.tsx +35 -0
- package/src/icons/SocialLeaderboardIcon.tsx +35 -0
- package/src/icons/StarFilledIcon.tsx +35 -0
- package/src/icons/StarHalfIcon.tsx +35 -0
- package/src/icons/StarIcon.tsx +35 -0
- package/src/icons/StoreFrontFilledIcon.tsx +35 -0
- package/src/icons/StoreFrontIcon.tsx +35 -0
- package/src/icons/StrikeThroughSIcon.tsx +35 -0
- package/src/icons/StyleIcon.tsx +35 -0
- package/src/icons/SubscriptionIcon.tsx +46 -0
- package/src/icons/SubscriptionsFilledIcon.tsx +35 -0
- package/src/icons/SubscriptionsIcon.tsx +35 -0
- package/src/icons/SupervisorAccountIcon.tsx +35 -0
- package/src/icons/SwitchAccountFilledIcon.tsx +35 -0
- package/src/icons/SwitchAccountIcon.tsx +35 -0
- package/src/icons/SyncSavedLocallyIcon.tsx +35 -0
- package/src/icons/TabletIcon.tsx +35 -0
- package/src/icons/ThumbDownFilledIcon.tsx +22 -0
- package/src/icons/ThumbDownIcon.tsx +22 -0
- package/src/icons/ThumbUpFilledIcon.tsx +22 -0
- package/src/icons/ThumbUpIcon.tsx +22 -0
- package/src/icons/TocIcon.tsx +35 -0
- package/src/icons/TrainingsIcon.tsx +37 -0
- package/src/icons/TrashDeleteBinIcon.tsx +36 -0
- package/src/icons/TrendingUpIcon.tsx +35 -0
- package/src/icons/UndoIcon.tsx +35 -0
- package/src/icons/UnfoldMoreIcon.tsx +35 -0
- package/src/icons/UploadIcon.tsx +35 -0
- package/src/icons/VerifiedIcon.tsx +24 -0
- package/src/icons/ViewAgendaIcon.tsx +22 -0
- package/src/icons/ViewArrayIcon.tsx +35 -0
- package/src/icons/ViewCarouselIcon.tsx +35 -0
- package/src/icons/ViewCozyIcon.tsx +22 -0
- package/src/icons/ViewModuleIcon.tsx +35 -0
- package/src/icons/VisibilityIcon.tsx +35 -0
- package/src/icons/VisibilityOffIcon.tsx +35 -0
- package/src/icons/VolunteerActivismFilledIcon.tsx +35 -0
- package/src/icons/VolunteerActivismIcon.tsx +35 -0
- package/src/icons/WBSunnyIcon.tsx +35 -0
- package/src/icons/WarningFilledIcon.tsx +35 -0
- package/src/icons/WarningIcon.tsx +35 -0
- package/src/icons/WebinarsIcon.tsx +57 -0
- package/src/icons/WidgetsFilledIcon.tsx +35 -0
- package/src/icons/WidgetsIcon.tsx +35 -0
- package/src/icons/WorkshopsIcon.tsx +50 -0
- package/src/icons/index.ts +305 -0
- package/src/pages/Home.tsx +30 -0
- package/src/pages/Login.tsx +13 -0
- package/src/pages/Page404.tsx +13 -0
- package/src/pages/index.tsx +21 -0
- package/src/routes/index.tsx +7 -0
- package/src/stories/Accordion/Accordion.stories.tsx +100 -0
- package/src/stories/Accordion/AccordionWrapper.tsx +16 -0
- package/src/stories/Avatars/Avatar.stories.ts +57 -0
- package/src/stories/Buttons/Button.stories.tsx +95 -0
- package/src/stories/Buttons/IconButton.stories.ts +68 -0
- package/src/stories/Buttons/IconButtonWrapper.tsx +14 -0
- package/src/stories/Colors.mdx +12 -0
- package/src/stories/Configure.mdx +371 -0
- package/src/stories/InputFields/InputFields.stories.ts +54 -0
- package/src/stories/InputFields/MarkdownEditor.stories.ts +20 -0
- package/src/stories/InputFields/SearchInput.stories.ts +22 -0
- package/src/stories/InputFields/SearchInput.tsx +19 -0
- package/src/stories/InputFields/Select/CountrySelect.stories.tsx +21 -0
- package/src/stories/InputFields/Select/CountrySelectWrapper.tsx +25 -0
- package/src/stories/InputFields/Select/CreatableSelect.stories.tsx +48 -0
- package/src/stories/InputFields/Select/CreatableSelectWrapper.tsx +25 -0
- package/src/stories/InputFields/Select/PhoneNumberInput.stories.tsx +33 -0
- package/src/stories/InputFields/Select/PhoneNumberInputWrapper.tsx +21 -0
- package/src/stories/InputFields/Select/Select.stories.tsx +49 -0
- package/src/stories/InputFields/Select/SelectWrapper.tsx +25 -0
- package/src/stories/InputFields/TextArea.stories.ts +22 -0
- package/src/stories/InputFields/UsernameInput.stories.ts +22 -0
- package/src/stories/Tiles/Tile.stories.tsx +71 -0
- package/src/stories/Tiles/TileWrapper.tsx +17 -0
- package/src/stories/Typography/DisplayText.stories.ts +52 -0
- package/src/stories/Typography/HeadingText.stories.ts +86 -0
- package/src/stories/Typography/ParagraphText.stories.ts +62 -0
- package/src/stories/Typography/SubtitleText.stories.ts +93 -0
- package/src/stories/Uploaders/FileUploadWrapper.tsx +25 -0
- package/src/stories/Uploaders/FileUploader.stories.tsx +17 -0
- package/src/stories/Uploaders/ImageUploadWrapper.tsx +30 -0
- package/src/stories/Uploaders/ImageUploader.stories.tsx +19 -0
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +5 -0
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +15 -0
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +3 -0
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +12 -0
- package/src/stories/assets/youtube.svg +4 -0
- package/src/stories/colors/index.ts +4 -0
- package/src/stories/controls/Chip.stories.ts +42 -0
- package/src/stories/controls/DoubleTab.stories.ts +32 -0
- package/src/stories/controls/DoubleTabWrapper.tsx +15 -0
- package/src/stories/controls/Pagination.stories.ts +21 -0
- package/src/stories/controls/PaginationWrapper.tsx +23 -0
- package/src/stories/controls/RadioButton.stories.ts +49 -0
- package/src/stories/controls/RectangleCheckButton.stories.ts +41 -0
- package/src/stories/controls/RoundCheckButton.stories.ts +41 -0
- package/src/stories/controls/Stepper.stories.ts +37 -0
- package/src/stories/controls/StepperDemoCmp.tsx +37 -0
- package/src/stories/controls/TabMenu.stories.ts +33 -0
- package/src/stories/controls/TabMenuWrapper.tsx +14 -0
- package/src/stories/controls/ToggleButton.stories.ts +41 -0
- package/src/stories/icons/Icons.mdx +26 -0
- package/src/stories/icons/index.ts +613 -0
- package/src/stories/notifications/Banner.stories.ts +88 -0
- package/src/stories/notifications/ClickTooltip.stories.ts +21 -0
- package/src/stories/notifications/ClickTooltipWrapper.tsx +19 -0
- package/src/stories/notifications/HoverTooltip.stories.ts +35 -0
- package/src/stories/notifications/HoverTooltipWrapper.tsx +16 -0
- package/src/stories/notifications/Snackbar.stories.ts +17 -0
- package/src/stories/notifications/SnackbarWrapper.tsx +107 -0
- package/src/utils/countries-flag.json +1752 -0
- package/tsconfig.json +34 -0
- package/vite.config.ts +27 -0
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
|
|
3
|
+
/* eslint-disable import/named */
|
|
4
|
+
import { Box, FormLabel } from "@chakra-ui/react";
|
|
5
|
+
import Paragraph from "components/Typography/Paragraph";
|
|
6
|
+
import Colors from "components/styleGuide/Colors";
|
|
7
|
+
import { motion } from "framer-motion";
|
|
8
|
+
import { CancelFilledIcon, CloseIcon, ExpandMoreIcon } from "icons";
|
|
9
|
+
import { useRef, useState } from "react";
|
|
10
|
+
import Select, {
|
|
11
|
+
ClearIndicatorProps,
|
|
12
|
+
DropdownIndicatorProps,
|
|
13
|
+
GroupBase,
|
|
14
|
+
IndicatorSeparatorProps,
|
|
15
|
+
IndicatorsContainerProps,
|
|
16
|
+
MultiValueProps,
|
|
17
|
+
MultiValueRemoveProps,
|
|
18
|
+
OptionProps,
|
|
19
|
+
StylesConfig,
|
|
20
|
+
components,
|
|
21
|
+
} from "react-select";
|
|
22
|
+
import CreatableSelect from "react-select/creatable";
|
|
23
|
+
import SelectType from "react-select/dist/declarations/src/Select";
|
|
24
|
+
|
|
25
|
+
export const selectStyles: StylesConfig<any, boolean, GroupBase<any>> = {
|
|
26
|
+
control: (styles, state) => ({
|
|
27
|
+
// ...styles,
|
|
28
|
+
display: "flex",
|
|
29
|
+
height: "auto",
|
|
30
|
+
fontFamily: "Degular",
|
|
31
|
+
fontWeight: 500,
|
|
32
|
+
fontSize: "1rem",
|
|
33
|
+
lineHeight: "24px",
|
|
34
|
+
letterSpacing: "-0.2px",
|
|
35
|
+
padding: "0 16px 0 0px",
|
|
36
|
+
backgroundColor: Colors.white100,
|
|
37
|
+
borderRadius: "12px",
|
|
38
|
+
// borderColor: state.isFocused ? Colors.black300 : "#FFFFFF",
|
|
39
|
+
border: state.isFocused
|
|
40
|
+
? `3px solid ${Colors.black300}`
|
|
41
|
+
: `1px solid ${Colors.gray50}`,
|
|
42
|
+
boxShadow: "none",
|
|
43
|
+
outlineOffset: "0px",
|
|
44
|
+
transition: "all 100ms ease-in-out",
|
|
45
|
+
":hover": {
|
|
46
|
+
border: `3px solid ${Colors.black300}`,
|
|
47
|
+
boxShadow: "none",
|
|
48
|
+
cursor: "text",
|
|
49
|
+
backgroundColor: Colors.gray50,
|
|
50
|
+
transition: "all 100ms ease-in-out",
|
|
51
|
+
},
|
|
52
|
+
}),
|
|
53
|
+
singleValue: (styles) => ({
|
|
54
|
+
...styles,
|
|
55
|
+
margin: "0px",
|
|
56
|
+
color: Colors.black300,
|
|
57
|
+
p: {
|
|
58
|
+
margin: "0px",
|
|
59
|
+
fontSize: "1rem",
|
|
60
|
+
},
|
|
61
|
+
}),
|
|
62
|
+
valueContainer: (styles, state) => ({
|
|
63
|
+
...styles,
|
|
64
|
+
padding: `${
|
|
65
|
+
state.isMulti && state.hasValue ? "8px 16px 8px 8px" : "12px 16px"
|
|
66
|
+
}`,
|
|
67
|
+
gap: "8px",
|
|
68
|
+
}),
|
|
69
|
+
multiValue: (styles) => ({
|
|
70
|
+
// ...styles,
|
|
71
|
+
display: "flex",
|
|
72
|
+
alignItems: "center",
|
|
73
|
+
backgroundColor: Colors.black300,
|
|
74
|
+
borderRadius: "100px",
|
|
75
|
+
color: Colors.white100,
|
|
76
|
+
padding: "6px 12px 6px 20px",
|
|
77
|
+
}),
|
|
78
|
+
|
|
79
|
+
multiValueLabel: (styles) => ({
|
|
80
|
+
fontFamily: "Degular",
|
|
81
|
+
fontWeight: 500,
|
|
82
|
+
fontSize: "0.875rem",
|
|
83
|
+
letterSpacing: "-0.0125rem",
|
|
84
|
+
lineHeight: "1rem",
|
|
85
|
+
Color: Colors.white100,
|
|
86
|
+
}),
|
|
87
|
+
|
|
88
|
+
multiValueRemove: (styles) => ({
|
|
89
|
+
...styles,
|
|
90
|
+
color: Colors.white100,
|
|
91
|
+
cursor: "pointer",
|
|
92
|
+
marginTop: "2px",
|
|
93
|
+
":hover": {
|
|
94
|
+
backgroundColor: Colors.black300,
|
|
95
|
+
color: Colors.white100,
|
|
96
|
+
},
|
|
97
|
+
}),
|
|
98
|
+
menu: (styles) => ({
|
|
99
|
+
...styles,
|
|
100
|
+
backgroundColor: Colors.white100,
|
|
101
|
+
boxShadow:
|
|
102
|
+
"0px 2px 4px 0px rgba(45, 59, 67, 0.05), 0px 2px 6px 0px rgba(45, 59, 67, 0.06)",
|
|
103
|
+
backdropFilter: "blur(8px)",
|
|
104
|
+
borderRadius: "12px",
|
|
105
|
+
position: "absolute",
|
|
106
|
+
top: "100%",
|
|
107
|
+
zIndex: 10000000000000,
|
|
108
|
+
}),
|
|
109
|
+
menuList: (styles) => ({
|
|
110
|
+
...styles,
|
|
111
|
+
maxHeight: "264px",
|
|
112
|
+
}),
|
|
113
|
+
option: () => ({
|
|
114
|
+
padding: "14px",
|
|
115
|
+
margin: `0rem 8px`,
|
|
116
|
+
fontSize: `16px`,
|
|
117
|
+
fontWeight: 600,
|
|
118
|
+
borderRadius: "12px",
|
|
119
|
+
":hover": {
|
|
120
|
+
backgroundColor: "#EFF1F6",
|
|
121
|
+
},
|
|
122
|
+
cursor: "pointer",
|
|
123
|
+
p: {
|
|
124
|
+
margin: "0px",
|
|
125
|
+
},
|
|
126
|
+
}),
|
|
127
|
+
placeholder: (styles) => ({
|
|
128
|
+
...styles,
|
|
129
|
+
margin: "0px",
|
|
130
|
+
color: Colors.black300,
|
|
131
|
+
}),
|
|
132
|
+
input: (styles) => ({
|
|
133
|
+
...styles,
|
|
134
|
+
margin: "0px",
|
|
135
|
+
padding: "0px",
|
|
136
|
+
}),
|
|
137
|
+
indicatorsContainer: (styles) => ({
|
|
138
|
+
...styles,
|
|
139
|
+
margin: "0px",
|
|
140
|
+
padding: "0px",
|
|
141
|
+
}),
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export type OptionType = {
|
|
145
|
+
value: string;
|
|
146
|
+
label: string;
|
|
147
|
+
};
|
|
148
|
+
export interface ISelectInputProps {
|
|
149
|
+
label: string;
|
|
150
|
+
id: string;
|
|
151
|
+
name: string;
|
|
152
|
+
placeholder?: string;
|
|
153
|
+
onChange?: (e: any) => void;
|
|
154
|
+
onBlur?: (e: any) => void;
|
|
155
|
+
options: Array<OptionType>;
|
|
156
|
+
value?: any;
|
|
157
|
+
defaultValue?: string;
|
|
158
|
+
isMulti?: boolean;
|
|
159
|
+
hideSelectedOptions?: boolean;
|
|
160
|
+
CustomOption?: React.ComponentType<OptionProps<any, boolean, GroupBase<any>>>;
|
|
161
|
+
CustomMultiValue?: React.ComponentType<
|
|
162
|
+
MultiValueProps<any, boolean, GroupBase<any>>
|
|
163
|
+
>;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export const DropdownIndicator = (props: DropdownIndicatorProps) => {
|
|
167
|
+
return (
|
|
168
|
+
<>
|
|
169
|
+
{props.isMulti ? (
|
|
170
|
+
<></>
|
|
171
|
+
) : (
|
|
172
|
+
<components.DropdownIndicator {...props}>
|
|
173
|
+
<motion.div animate={{ rotate: props.isFocused ? "180deg" : "0deg" }}>
|
|
174
|
+
<ExpandMoreIcon boxSize={"20px"} />
|
|
175
|
+
</motion.div>
|
|
176
|
+
</components.DropdownIndicator>
|
|
177
|
+
)}
|
|
178
|
+
</>
|
|
179
|
+
);
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
const ClearIndicator = (props: ClearIndicatorProps) => {
|
|
183
|
+
return (
|
|
184
|
+
<components.ClearIndicator {...props}>
|
|
185
|
+
<CancelFilledIcon boxSize={"20px"} color={Colors.black300} />
|
|
186
|
+
</components.ClearIndicator>
|
|
187
|
+
);
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
const IndicatorSeparator = ({ innerProps }: IndicatorSeparatorProps) => {
|
|
191
|
+
return <></>;
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
const MultiValueRemove = (props: MultiValueRemoveProps) => {
|
|
195
|
+
return (
|
|
196
|
+
<components.MultiValueRemove {...props}>
|
|
197
|
+
<CloseIcon boxSize={"20px"} />
|
|
198
|
+
</components.MultiValueRemove>
|
|
199
|
+
);
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
export const SelectInput = ({
|
|
203
|
+
label,
|
|
204
|
+
id,
|
|
205
|
+
name,
|
|
206
|
+
placeholder,
|
|
207
|
+
onBlur,
|
|
208
|
+
onChange,
|
|
209
|
+
value,
|
|
210
|
+
defaultValue,
|
|
211
|
+
options,
|
|
212
|
+
isMulti,
|
|
213
|
+
hideSelectedOptions,
|
|
214
|
+
CustomOption,
|
|
215
|
+
CustomMultiValue,
|
|
216
|
+
}: ISelectInputProps) => {
|
|
217
|
+
const customComponents: Record<string, React.ComponentType<any>> = {};
|
|
218
|
+
if (isMulti) {
|
|
219
|
+
const Option = CustomOption;
|
|
220
|
+
const MultiValue = CustomMultiValue;
|
|
221
|
+
if (Option) {
|
|
222
|
+
customComponents.Option = Option;
|
|
223
|
+
}
|
|
224
|
+
if (MultiValue) {
|
|
225
|
+
customComponents.MultiValue = MultiValue;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
const selectRef = useRef<SelectType<any, boolean, GroupBase<any>> | null>(
|
|
230
|
+
null
|
|
231
|
+
);
|
|
232
|
+
|
|
233
|
+
return (
|
|
234
|
+
<Box w="full" fontFamily={"Degular"} fontWeight={500}>
|
|
235
|
+
{label && (
|
|
236
|
+
<FormLabel
|
|
237
|
+
fontSize={"1rem"}
|
|
238
|
+
lineHeight="1.25rem"
|
|
239
|
+
fontWeight={600}
|
|
240
|
+
fontFamily="Degular"
|
|
241
|
+
letterSpacing="-0.004rem"
|
|
242
|
+
mb="12px"
|
|
243
|
+
htmlFor={id}
|
|
244
|
+
>
|
|
245
|
+
{label}
|
|
246
|
+
</FormLabel>
|
|
247
|
+
)}
|
|
248
|
+
<Select
|
|
249
|
+
isMulti={isMulti}
|
|
250
|
+
isClearable={isMulti}
|
|
251
|
+
defaultInputValue={defaultValue}
|
|
252
|
+
value={value}
|
|
253
|
+
onChange={(e: any) => {
|
|
254
|
+
if (onChange) {
|
|
255
|
+
onChange(e);
|
|
256
|
+
selectRef?.current?.blur();
|
|
257
|
+
}
|
|
258
|
+
}}
|
|
259
|
+
ref={selectRef}
|
|
260
|
+
onBlur={(e: any) => onBlur && onBlur(e)}
|
|
261
|
+
components={{
|
|
262
|
+
ClearIndicator,
|
|
263
|
+
DropdownIndicator,
|
|
264
|
+
IndicatorSeparator,
|
|
265
|
+
MultiValueRemove,
|
|
266
|
+
// IndicatorsContainer,
|
|
267
|
+
...customComponents,
|
|
268
|
+
}}
|
|
269
|
+
id={id}
|
|
270
|
+
options={options}
|
|
271
|
+
styles={selectStyles}
|
|
272
|
+
name={name}
|
|
273
|
+
placeholder={placeholder}
|
|
274
|
+
hideSelectedOptions={hideSelectedOptions}
|
|
275
|
+
closeMenuOnSelect={!isMulti}
|
|
276
|
+
/>
|
|
277
|
+
</Box>
|
|
278
|
+
);
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
export const CreatableSelectInput = ({
|
|
282
|
+
label,
|
|
283
|
+
id,
|
|
284
|
+
name,
|
|
285
|
+
placeholder,
|
|
286
|
+
onBlur,
|
|
287
|
+
onChange,
|
|
288
|
+
value,
|
|
289
|
+
defaultValue,
|
|
290
|
+
options,
|
|
291
|
+
isMulti,
|
|
292
|
+
hideSelectedOptions,
|
|
293
|
+
CustomOption,
|
|
294
|
+
CustomMultiValue,
|
|
295
|
+
}: ISelectInputProps) => {
|
|
296
|
+
const [optionsState, setOptions] = useState<OptionType[]>(options);
|
|
297
|
+
const customComponents: Record<string, React.ComponentType<any>> = {};
|
|
298
|
+
if (isMulti) {
|
|
299
|
+
const Option = CustomOption;
|
|
300
|
+
const MultiValue = CustomMultiValue;
|
|
301
|
+
if (Option) {
|
|
302
|
+
customComponents.Option = Option;
|
|
303
|
+
}
|
|
304
|
+
if (MultiValue) {
|
|
305
|
+
customComponents.MultiValue = MultiValue;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
const handleCreate = (inputValue: string) => {
|
|
310
|
+
const newOption = {
|
|
311
|
+
label: inputValue,
|
|
312
|
+
value: inputValue.toLowerCase().replace(/\W/g, ""),
|
|
313
|
+
};
|
|
314
|
+
setOptions((prev) => [...prev, newOption]);
|
|
315
|
+
if (onChange) {
|
|
316
|
+
if (isMulti) {
|
|
317
|
+
onChange([...value, newOption]);
|
|
318
|
+
} else onChange(newOption);
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
const onKeyDown = (e: any) => {
|
|
323
|
+
if (e.keyCode === 188) {
|
|
324
|
+
e.preventDefault();
|
|
325
|
+
handleCreate(e.target.value);
|
|
326
|
+
|
|
327
|
+
// if (this.state.inputValue !== "") {
|
|
328
|
+
// this.handleCreate(this.selectRef.state.inputValue.slice(0, -1));
|
|
329
|
+
// }
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
const selectRef = useRef<SelectType<any, boolean, GroupBase<any>> | null>(
|
|
334
|
+
null
|
|
335
|
+
);
|
|
336
|
+
|
|
337
|
+
return (
|
|
338
|
+
<Box w="full" fontFamily={"Degular"} fontWeight={500}>
|
|
339
|
+
{label && (
|
|
340
|
+
<FormLabel
|
|
341
|
+
fontSize={"1rem"}
|
|
342
|
+
lineHeight="1.25rem"
|
|
343
|
+
fontWeight={600}
|
|
344
|
+
fontFamily="Degular"
|
|
345
|
+
letterSpacing="-0.004rem"
|
|
346
|
+
mb="12px"
|
|
347
|
+
htmlFor={id}
|
|
348
|
+
>
|
|
349
|
+
{label}
|
|
350
|
+
</FormLabel>
|
|
351
|
+
)}
|
|
352
|
+
|
|
353
|
+
<CreatableSelect
|
|
354
|
+
isMulti={isMulti}
|
|
355
|
+
isClearable
|
|
356
|
+
onChange={(e: any) => {
|
|
357
|
+
if (onChange) {
|
|
358
|
+
if (isMulti) {
|
|
359
|
+
onChange(e);
|
|
360
|
+
selectRef?.current?.blur();
|
|
361
|
+
} else {
|
|
362
|
+
onChange(e);
|
|
363
|
+
selectRef?.current?.blur();
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}}
|
|
367
|
+
ref={selectRef}
|
|
368
|
+
onBlur={(e: any) => onBlur && onBlur(e)}
|
|
369
|
+
onKeyDown={onKeyDown}
|
|
370
|
+
onCreateOption={handleCreate}
|
|
371
|
+
options={options}
|
|
372
|
+
value={value}
|
|
373
|
+
id={id}
|
|
374
|
+
styles={selectStyles}
|
|
375
|
+
name={name}
|
|
376
|
+
placeholder={placeholder}
|
|
377
|
+
hideSelectedOptions={hideSelectedOptions}
|
|
378
|
+
closeMenuOnSelect={!isMulti}
|
|
379
|
+
components={{
|
|
380
|
+
ClearIndicator,
|
|
381
|
+
DropdownIndicator,
|
|
382
|
+
IndicatorSeparator,
|
|
383
|
+
MultiValueRemove,
|
|
384
|
+
...customComponents,
|
|
385
|
+
}}
|
|
386
|
+
/>
|
|
387
|
+
|
|
388
|
+
{isMulti && (
|
|
389
|
+
<Paragraph size={"xxs"} color={Colors.gray400} mt={"8px"}>
|
|
390
|
+
Comma seperated
|
|
391
|
+
</Paragraph>
|
|
392
|
+
)}
|
|
393
|
+
</Box>
|
|
394
|
+
);
|
|
395
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
|
|
3
|
+
export { SelectInput } from "./SelectInput";
|
|
4
|
+
export { CreatableSelectInput } from "./SelectInput";
|
|
5
|
+
export type { ISelectInputProps } from "./SelectInput";
|
|
6
|
+
export { default as CountrySelect } from "./CountrySelect";
|
|
7
|
+
export type { ICountrySelectProps } from "./CountrySelect";
|
|
8
|
+
export { default as PhoneNumberInput } from "./PhoneNumberInput";
|
|
9
|
+
export type { IPhoneNumberInputProps } from "./PhoneNumberInput";
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
Box,
|
|
5
|
+
Textarea as ChakraTextarea,
|
|
6
|
+
Flex,
|
|
7
|
+
Text,
|
|
8
|
+
TextareaProps,
|
|
9
|
+
} from "@chakra-ui/react";
|
|
10
|
+
import Paragraph from "components/Typography/Paragraph";
|
|
11
|
+
import Colors from "components/styleGuide/Colors";
|
|
12
|
+
import { useState } from "react";
|
|
13
|
+
// This will change when we build icon components
|
|
14
|
+
import { ReactComponent as ErrorIcon } from "assets/svgs/error_message_icon.svg";
|
|
15
|
+
|
|
16
|
+
interface ITextArea extends TextareaProps {
|
|
17
|
+
label: string;
|
|
18
|
+
name: string;
|
|
19
|
+
value?: any;
|
|
20
|
+
id: string;
|
|
21
|
+
onChange?: () => void;
|
|
22
|
+
defaultValue?: any;
|
|
23
|
+
placeholder?: any;
|
|
24
|
+
error?: boolean;
|
|
25
|
+
errorMessage?: string;
|
|
26
|
+
hint?: string;
|
|
27
|
+
textLimit?: number;
|
|
28
|
+
height?: string;
|
|
29
|
+
width?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const TextArea = ({
|
|
33
|
+
label,
|
|
34
|
+
name,
|
|
35
|
+
id,
|
|
36
|
+
value,
|
|
37
|
+
onChange,
|
|
38
|
+
defaultValue,
|
|
39
|
+
placeholder,
|
|
40
|
+
error,
|
|
41
|
+
errorMessage,
|
|
42
|
+
textLimit,
|
|
43
|
+
height,
|
|
44
|
+
width,
|
|
45
|
+
}: ITextArea) => {
|
|
46
|
+
const [count, setCount] = useState<number>(0);
|
|
47
|
+
const [exceedLimit, setExceedLimit] = useState<boolean>(false);
|
|
48
|
+
|
|
49
|
+
const handleTextLimit = (e: any) => {
|
|
50
|
+
const textValue = e?.target?.value;
|
|
51
|
+
setCount(textValue.length);
|
|
52
|
+
if (textValue.length > (textLimit || 200)) {
|
|
53
|
+
setExceedLimit(true);
|
|
54
|
+
} else setExceedLimit(false);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<Box w={width || "full"} position={"relative"}>
|
|
59
|
+
<Text
|
|
60
|
+
fontFamily={"Degular"}
|
|
61
|
+
fontSize={"16px"}
|
|
62
|
+
lineHeight={"20px"}
|
|
63
|
+
letterSpacing={"-0.064px"}
|
|
64
|
+
fontWeight={600}
|
|
65
|
+
mb="10px"
|
|
66
|
+
mt="0"
|
|
67
|
+
>
|
|
68
|
+
{label}
|
|
69
|
+
</Text>
|
|
70
|
+
<Box
|
|
71
|
+
w="fit-content"
|
|
72
|
+
right={"20px"}
|
|
73
|
+
top={"38px"}
|
|
74
|
+
position="absolute"
|
|
75
|
+
zIndex={10}
|
|
76
|
+
>
|
|
77
|
+
<Paragraph color={Colors.gray200} size={"xxs"}>
|
|
78
|
+
{count}/{textLimit || 200}
|
|
79
|
+
</Paragraph>
|
|
80
|
+
</Box>
|
|
81
|
+
<ChakraTextarea
|
|
82
|
+
name={name}
|
|
83
|
+
id={id}
|
|
84
|
+
value={value}
|
|
85
|
+
defaultValue={defaultValue}
|
|
86
|
+
onChange={(e) => {
|
|
87
|
+
handleTextLimit(e);
|
|
88
|
+
if (onChange) {
|
|
89
|
+
onChange();
|
|
90
|
+
}
|
|
91
|
+
}}
|
|
92
|
+
placeholder={placeholder || "Type something..."}
|
|
93
|
+
bg={Colors.white100}
|
|
94
|
+
borderRadius="12px"
|
|
95
|
+
border="none"
|
|
96
|
+
fontFamily={"Degular"}
|
|
97
|
+
fontSize={"16px"}
|
|
98
|
+
lineHeight={"24px"}
|
|
99
|
+
letterSpacing={"-0.2px"}
|
|
100
|
+
fontWeight={500}
|
|
101
|
+
outlineOffset={"none"}
|
|
102
|
+
outline={error || exceedLimit ? "2px solid" : "1px solid"}
|
|
103
|
+
_placeholder={{ color: `${Colors.gray200}` }}
|
|
104
|
+
outlineColor={error || exceedLimit ? Colors.red500 : Colors.gray50}
|
|
105
|
+
_focus={{
|
|
106
|
+
outline: `3px solid ${
|
|
107
|
+
error || exceedLimit ? Colors.red500 : Colors.black300
|
|
108
|
+
}`,
|
|
109
|
+
background: `${Colors.white100}`,
|
|
110
|
+
}}
|
|
111
|
+
_focusVisible={{
|
|
112
|
+
outline: `3px solid ${
|
|
113
|
+
error || exceedLimit ? Colors.red500 : Colors.black300
|
|
114
|
+
}`,
|
|
115
|
+
background: `${Colors.white100}`,
|
|
116
|
+
}}
|
|
117
|
+
_hover={{
|
|
118
|
+
outline: `3px solid ${
|
|
119
|
+
error || exceedLimit ? Colors.red500 : Colors.black300
|
|
120
|
+
}`,
|
|
121
|
+
background: `${Colors.gray50}`,
|
|
122
|
+
}}
|
|
123
|
+
h={height || "120px"}
|
|
124
|
+
w="full"
|
|
125
|
+
px="16px"
|
|
126
|
+
pt="30px"
|
|
127
|
+
resize={"none"}
|
|
128
|
+
/>
|
|
129
|
+
<Box mt="8px">
|
|
130
|
+
{error && errorMessage ? (
|
|
131
|
+
<Flex alignItems={"center"} gap="6px">
|
|
132
|
+
<ErrorIcon />
|
|
133
|
+
<Paragraph color={Colors.red500} size={"xxs"}>
|
|
134
|
+
{errorMessage}
|
|
135
|
+
</Paragraph>
|
|
136
|
+
</Flex>
|
|
137
|
+
) : exceedLimit ? (
|
|
138
|
+
<Flex alignItems={"center"} gap="6px">
|
|
139
|
+
<ErrorIcon />
|
|
140
|
+
<Paragraph color={Colors.red500} size={"xxs"}>
|
|
141
|
+
Text cannot be more than {textLimit || 200} characters long.
|
|
142
|
+
</Paragraph>
|
|
143
|
+
</Flex>
|
|
144
|
+
) : null}
|
|
145
|
+
</Box>
|
|
146
|
+
</Box>
|
|
147
|
+
);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export default TextArea;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
|
|
3
|
+
// import React from "react";
|
|
4
|
+
import {
|
|
5
|
+
Input as ChakraInput,
|
|
6
|
+
Flex,
|
|
7
|
+
InputGroup,
|
|
8
|
+
InputProps,
|
|
9
|
+
InputLeftElement,
|
|
10
|
+
InputRightElement,
|
|
11
|
+
Spinner,
|
|
12
|
+
Text,
|
|
13
|
+
Box,
|
|
14
|
+
} from "@chakra-ui/react";
|
|
15
|
+
import Paragraph from "components/Typography/Paragraph";
|
|
16
|
+
import Colors from "components/styleGuide/Colors";
|
|
17
|
+
// This will change when we build icon components
|
|
18
|
+
import { ReactComponent as ErrorIcon } from "assets/svgs/error_message_icon.svg";
|
|
19
|
+
import { ReactComponent as SuccessIcon } from "assets/svgs/check_circle.svg";
|
|
20
|
+
|
|
21
|
+
interface IInput extends InputProps {
|
|
22
|
+
label: string;
|
|
23
|
+
name: string;
|
|
24
|
+
value?: any;
|
|
25
|
+
id: string;
|
|
26
|
+
onChange?: () => void;
|
|
27
|
+
defaultValue?: any;
|
|
28
|
+
placeholder?: any;
|
|
29
|
+
type?: "text";
|
|
30
|
+
errorMessage?: string;
|
|
31
|
+
inputLeftMargin?: string;
|
|
32
|
+
isChecking?: boolean;
|
|
33
|
+
isAvailable?: boolean;
|
|
34
|
+
isNotAvailable?: boolean;
|
|
35
|
+
width?: string;
|
|
36
|
+
}
|
|
37
|
+
const UsernameInput = ({
|
|
38
|
+
label,
|
|
39
|
+
name,
|
|
40
|
+
id,
|
|
41
|
+
value,
|
|
42
|
+
onChange,
|
|
43
|
+
defaultValue,
|
|
44
|
+
placeholder,
|
|
45
|
+
inputLeftMargin,
|
|
46
|
+
isChecking,
|
|
47
|
+
isAvailable,
|
|
48
|
+
isNotAvailable,
|
|
49
|
+
errorMessage,
|
|
50
|
+
width,
|
|
51
|
+
}: IInput) => {
|
|
52
|
+
const usernameprefix = "username";
|
|
53
|
+
return (
|
|
54
|
+
<Box w={width || "full"}>
|
|
55
|
+
<Text
|
|
56
|
+
fontFamily={"Degular"}
|
|
57
|
+
fontSize={"16px"}
|
|
58
|
+
lineHeight={"20px"}
|
|
59
|
+
letterSpacing={"-0.064px"}
|
|
60
|
+
fontWeight={600}
|
|
61
|
+
mb="10px"
|
|
62
|
+
mt="0"
|
|
63
|
+
>
|
|
64
|
+
{label}
|
|
65
|
+
</Text>
|
|
66
|
+
<InputGroup position={"relative"}>
|
|
67
|
+
<InputLeftElement w={"fit-content"} py="24px" ml="16px">
|
|
68
|
+
<Paragraph color={Colors.gray200} size={"xs"}>
|
|
69
|
+
{usernameprefix}/
|
|
70
|
+
</Paragraph>
|
|
71
|
+
</InputLeftElement>
|
|
72
|
+
<InputRightElement py="24px">
|
|
73
|
+
{isChecking && <Spinner size={"sm"} />}
|
|
74
|
+
{isAvailable && <SuccessIcon />}
|
|
75
|
+
</InputRightElement>
|
|
76
|
+
<ChakraInput
|
|
77
|
+
name={name}
|
|
78
|
+
id={id}
|
|
79
|
+
value={value}
|
|
80
|
+
defaultValue={defaultValue}
|
|
81
|
+
onChange={onChange}
|
|
82
|
+
placeholder={placeholder}
|
|
83
|
+
type="text"
|
|
84
|
+
_placeholder={{ color: `${Colors.gray200}` }}
|
|
85
|
+
bg={Colors.white100}
|
|
86
|
+
borderRadius="12px"
|
|
87
|
+
border="none"
|
|
88
|
+
fontFamily={"Degular"}
|
|
89
|
+
fontSize={"16px"}
|
|
90
|
+
lineHeight={"24px"}
|
|
91
|
+
letterSpacing={"-0.2px"}
|
|
92
|
+
fontWeight={500}
|
|
93
|
+
px="16px"
|
|
94
|
+
py="24px"
|
|
95
|
+
outlineOffset={"none"}
|
|
96
|
+
outline={isNotAvailable ? "2px solid" : "1px solid"}
|
|
97
|
+
outlineColor={isNotAvailable ? Colors.red500 : Colors.gray50}
|
|
98
|
+
_focus={{
|
|
99
|
+
outline: `3px solid ${
|
|
100
|
+
isNotAvailable
|
|
101
|
+
? Colors.red500
|
|
102
|
+
: isAvailable
|
|
103
|
+
? Colors.green600
|
|
104
|
+
: Colors.black300
|
|
105
|
+
}`,
|
|
106
|
+
background: `${Colors.white100}`,
|
|
107
|
+
}}
|
|
108
|
+
_focusVisible={{
|
|
109
|
+
outline: `3px solid ${
|
|
110
|
+
isNotAvailable
|
|
111
|
+
? Colors.red500
|
|
112
|
+
: isAvailable
|
|
113
|
+
? Colors.green600
|
|
114
|
+
: Colors.black300
|
|
115
|
+
}`,
|
|
116
|
+
background: `${Colors.white100}`,
|
|
117
|
+
}}
|
|
118
|
+
_hover={{
|
|
119
|
+
outline: `3px solid ${
|
|
120
|
+
isNotAvailable
|
|
121
|
+
? Colors.red500
|
|
122
|
+
: isAvailable
|
|
123
|
+
? Colors.green600
|
|
124
|
+
: Colors.black300
|
|
125
|
+
}`,
|
|
126
|
+
background: `${Colors.gray50}`,
|
|
127
|
+
}}
|
|
128
|
+
pl={inputLeftMargin || `${11 * "username".length}px`}
|
|
129
|
+
/>
|
|
130
|
+
</InputGroup>
|
|
131
|
+
<Box mt="8px">
|
|
132
|
+
{isNotAvailable && errorMessage && (
|
|
133
|
+
<Flex alignItems={"center"} gap="6px">
|
|
134
|
+
<ErrorIcon />
|
|
135
|
+
<Paragraph color={Colors.red500} size={"xxs"}>
|
|
136
|
+
{errorMessage}
|
|
137
|
+
</Paragraph>
|
|
138
|
+
</Flex>
|
|
139
|
+
)}
|
|
140
|
+
</Box>
|
|
141
|
+
</Box>
|
|
142
|
+
);
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export default UsernameInput;
|