mainstack-design-system 0.7.45 → 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.
- package/README.md +702 -15
- package/dist/FormCountryOptionsList-BTIDLbxV.cjs +8 -0
- package/dist/FormCountryOptionsList-BWbi-SZ_.js +1790 -0
- package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
- package/dist/_commonjsHelpers-DwGv2jUC.cjs +1 -0
- package/dist/clsx-C11secjj.cjs +1 -0
- package/dist/clsx-OuTLNxxd.js +16 -0
- package/dist/components/Accordion/AccordionContent.js +1 -0
- package/dist/components/Accordion/AccordionHeader.js +1 -0
- package/dist/components/Accordion/AccordionItem.js +1 -0
- package/dist/components/Accordion/AccordionRoot.js +1 -0
- package/dist/components/Accordion/AccordionSubtitle.js +1 -0
- package/dist/components/Accordion/AccordionTitle.js +1 -0
- package/dist/components/Accordion/AccordionTrigger.js +1 -0
- package/dist/components/Accordion/index.js +1 -0
- package/dist/components/Avatar/Avatar.js +2 -0
- package/dist/components/Avatar/avatarVariants.js +1 -0
- package/dist/components/Avatar/getAvatarSize.js +1 -0
- package/dist/components/Avatar/index.js +1 -0
- package/dist/components/Banner/BannerAction.js +1 -0
- package/dist/components/Banner/BannerContent.js +1 -0
- package/dist/components/Banner/BannerHeader.js +1 -0
- package/dist/components/Banner/BannerIcon.js +1 -0
- package/dist/components/Banner/BannerRoot.js +1 -0
- package/dist/components/Banner/BannerText.js +1 -0
- package/dist/components/Banner/bannerVariants.js +1 -0
- package/dist/components/Banner/index.js +1 -0
- package/dist/components/Button/Button.js +1 -0
- package/dist/components/Button/ButtonIcon.js +1 -0
- package/dist/components/Button/ButtonLabel.js +1 -0
- package/dist/components/Button/ButtonRoot.js +1 -0
- package/dist/components/Button/buttonVariants.js +87 -0
- package/dist/components/Button/index.js +1 -0
- package/dist/components/Checkbox/CheckboxIndicator.js +2 -0
- package/dist/components/Checkbox/CheckboxLabel.js +1 -0
- package/dist/components/Checkbox/CheckboxRoot.js +1 -0
- package/dist/components/Checkbox/CheckboxSubtext.js +1 -0
- package/dist/components/Checkbox/CheckboxTitle.js +1 -0
- package/dist/components/Checkbox/index.js +1 -0
- package/dist/components/Chip/Chip.js +1 -0
- package/dist/components/Chip/ChipLabel.js +1 -0
- package/dist/components/Chip/ChipRoot.js +1 -0
- package/dist/components/Chip/ChipSlot.js +1 -0
- package/dist/components/Chip/chipVariants.js +1 -0
- package/dist/components/Chip/index.js +1 -0
- package/dist/components/Form/FormCharacterCounter.js +1 -0
- package/dist/components/Form/FormCountrySelect/FormCountryOptions.js +1 -0
- package/dist/components/Form/FormCountrySelect/FormCountryOptionsList.js +1 -0
- package/dist/components/Form/FormCountrySelect/FormCountryOptionsSearchField.js +1 -0
- package/dist/components/Form/FormCountrySelect/FormCountrySelect.js +1 -0
- package/dist/components/Form/FormCountrySelect/constant.js +1 -0
- package/dist/components/Form/FormCountrySelect/getCountryFlagComp.js +1 -0
- package/dist/components/Form/FormItem.js +1 -0
- package/dist/components/Form/FormLabel.js +1 -0
- package/dist/components/Form/FormStatus/FormErrorStatus.js +1 -0
- package/dist/components/Form/FormStatus/FormHintStatus.js +1 -0
- package/dist/components/Form/FormStatus/FormStatusRoot.js +1 -0
- package/dist/components/Form/FormStatus/FormStatusText.js +1 -0
- package/dist/components/Form/FormStatus/FormSuccessStatus.js +1 -0
- package/dist/components/Form/index.js +1 -0
- package/dist/components/Icons/AccountBalanceIcon.js +1 -0
- package/dist/components/Icons/AccountBalanceWalletIcon.js +1 -0
- package/dist/components/Icons/AccountCircleIcon.js +1 -0
- package/dist/components/Icons/AdGroupIcon.js +1 -0
- package/dist/components/Icons/AdaptiveAudioMicIcon.js +1 -0
- package/dist/components/Icons/AddAPhotoIcon.js +1 -0
- package/dist/components/Icons/AddBusinessIcon.js +1 -0
- package/dist/components/Icons/AddCircleIcon.js +1 -0
- package/dist/components/Icons/AddIcon.js +1 -0
- package/dist/components/Icons/AddLinkIcon.js +1 -0
- package/dist/components/Icons/AddPhotoAlternateIcon.js +1 -0
- package/dist/components/Icons/AddShoppingCartIcon.js +1 -0
- package/dist/components/Icons/AdminPanelSettingsIcon.js +1 -0
- package/dist/components/Icons/AdsClickIcon.js +1 -0
- package/dist/components/Icons/AlarmIcon.js +1 -0
- package/dist/components/Icons/AllInboxIcon.js +1 -0
- package/dist/components/Icons/AnimationIcon.js +1 -0
- package/dist/components/Icons/ApartmentIcon.js +1 -0
- package/dist/components/Icons/AppsIcon.js +1 -0
- package/dist/components/Icons/ArchiveIcon.js +1 -0
- package/dist/components/Icons/ArrowBackIcon.js +1 -0
- package/dist/components/Icons/ArrowCircleDownIcon.js +1 -0
- package/dist/components/Icons/ArrowCircleUpIcon.js +1 -0
- package/dist/components/Icons/ArrowDownwardIcon.js +1 -0
- package/dist/components/Icons/ArrowDropDownIcon.js +1 -0
- package/dist/components/Icons/ArrowDropUpIcon.js +1 -0
- package/dist/components/Icons/ArrowForwardIcon.js +1 -0
- package/dist/components/Icons/ArrowUpwardIcon.js +1 -0
- package/dist/components/Icons/ArtTrackIcon.js +1 -0
- package/dist/components/Icons/ArticleIcon.js +1 -0
- package/dist/components/Icons/AttachMoneyIcon.js +1 -0
- package/dist/components/Icons/AttachmentIcon.js +1 -0
- package/dist/components/Icons/AudioFileIcon.js +1 -0
- package/dist/components/Icons/AutoAwesomeMosaic.js +1 -0
- package/dist/components/Icons/AvatarIcon.js +1 -0
- package/dist/components/Icons/AwardStarIcon.js +1 -0
- package/dist/components/Icons/BarChartIcon.js +1 -0
- package/dist/components/Icons/BarcodeScannerIcon.js +1 -0
- package/dist/components/Icons/BlockIcon.js +1 -0
- package/dist/components/Icons/BoltIcon.js +1 -0
- package/dist/components/Icons/Book5Icon.js +1 -0
- package/dist/components/Icons/BookOnlineIcon.js +1 -0
- package/dist/components/Icons/BugReportIcon.js +1 -0
- package/dist/components/Icons/BusinessCenterIcon.js +1 -0
- package/dist/components/Icons/CalendarAddOnIcon.js +1 -0
- package/dist/components/Icons/CalendarClockIcon.js +1 -0
- package/dist/components/Icons/CalendarMonthIcon.js +1 -0
- package/dist/components/Icons/CalendarTodayIcon.js +1 -0
- package/dist/components/Icons/CallIcon.js +1 -0
- package/dist/components/Icons/CallMadeIcon.js +1 -0
- package/dist/components/Icons/CallMissedIcon.js +1 -0
- package/dist/components/Icons/CallMissedOutgoingIcon.js +1 -0
- package/dist/components/Icons/CallReceivedIcon.js +1 -0
- package/dist/components/Icons/CampaignIcon.js +1 -0
- package/dist/components/Icons/CancelIcon.js +1 -0
- package/dist/components/Icons/CancelScheduleSendIcon.js +1 -0
- package/dist/components/Icons/CaptivePortalIcon.js +1 -0
- package/dist/components/Icons/CardLayoutIcon.js +1 -0
- package/dist/components/Icons/CasesIcon.js +1 -0
- package/dist/components/Icons/CategoryIcon.js +1 -0
- package/dist/components/Icons/ChairIcon.js +1 -0
- package/dist/components/Icons/ChangeCircleIcon.js +1 -0
- package/dist/components/Icons/ChatBubbleIcon.js +1 -0
- package/dist/components/Icons/ChatIcon.js +1 -0
- package/dist/components/Icons/CheckBoxIcon.js +1 -0
- package/dist/components/Icons/CheckBoxOutlineBlankIcon.js +1 -0
- package/dist/components/Icons/CheckCircleIcon.js +1 -0
- package/dist/components/Icons/CheckIcon.js +1 -0
- package/dist/components/Icons/ChevronLeftIcon.js +1 -0
- package/dist/components/Icons/ChevronRightIcon.js +1 -0
- package/dist/components/Icons/ClinicalNoteIcon.js +1 -0
- package/dist/components/Icons/CloseIcon.js +1 -0
- package/dist/components/Icons/CloudUploadIcon.js +1 -0
- package/dist/components/Icons/CodeIcon.js +1 -0
- package/dist/components/Icons/CoffeeIcon.js +1 -0
- package/dist/components/Icons/CollectionsBookmarkIcon.js +1 -0
- package/dist/components/Icons/ColorPickerIcon.js +1 -0
- package/dist/components/Icons/CompareArrowsIcon.js +1 -0
- package/dist/components/Icons/ConfirmationNumberIcon.js +1 -0
- package/dist/components/Icons/ContactMailIcon.js +1 -0
- package/dist/components/Icons/ContactPageIcon.js +1 -0
- package/dist/components/Icons/ContactPhoneIcon.js +1 -0
- package/dist/components/Icons/ContactSupportIcon.js +1 -0
- package/dist/components/Icons/ContactsIcon.js +1 -0
- package/dist/components/Icons/ContentCopyIcon.js +1 -0
- package/dist/components/Icons/CreditCardGearIcon.js +1 -0
- package/dist/components/Icons/CreditCardIcon.js +1 -0
- package/dist/components/Icons/CsvIcon.js +1 -0
- package/dist/components/Icons/CurrencyExchangeIcon.js +1 -0
- package/dist/components/Icons/DNSIcon.js +1 -0
- package/dist/components/Icons/DangerousIcon.js +1 -0
- package/dist/components/Icons/DarkModeIcon.js +1 -0
- package/dist/components/Icons/DashboardIcon.js +1 -0
- package/dist/components/Icons/DataCheckIcon.js +1 -0
- package/dist/components/Icons/DataObjectIcon.js +1 -0
- package/dist/components/Icons/DatabaseIcon.js +1 -0
- package/dist/components/Icons/DehazeIcon.js +1 -0
- package/dist/components/Icons/DeployedCodeAccountIcon.js +1 -0
- package/dist/components/Icons/DescriptionIcon.js +1 -0
- package/dist/components/Icons/DesktopMacIcon.js +1 -0
- package/dist/components/Icons/DevicesIcon.js +1 -0
- package/dist/components/Icons/DiamondIcon.js +1 -0
- package/dist/components/Icons/DirectionsWalkIcon.js +1 -0
- package/dist/components/Icons/Diversity1Icon.js +1 -0
- package/dist/components/Icons/Diversity2Icon.js +1 -0
- package/dist/components/Icons/Diversity3Icon.js +1 -0
- package/dist/components/Icons/DoNotDisturbOnIcon.js +1 -0
- package/dist/components/Icons/DomainAddIcon.js +1 -0
- package/dist/components/Icons/DomainIcon.js +1 -0
- package/dist/components/Icons/DomainVerificationIcon.js +1 -0
- package/dist/components/Icons/DownloadIcon.js +1 -0
- package/dist/components/Icons/DraftsIcon.js +1 -0
- package/dist/components/Icons/DragHandleIcon.js +1 -0
- package/dist/components/Icons/DragIndicatorIcon.js +1 -0
- package/dist/components/Icons/DuoIcon.js +1 -0
- package/dist/components/Icons/EarlyOnIcon.js +1 -0
- package/dist/components/Icons/EditIcon.js +1 -0
- package/dist/components/Icons/EmojiFoodBeverageIcon.js +1 -0
- package/dist/components/Icons/EmojiIcon.js +1 -0
- package/dist/components/Icons/EncryptedIcon.js +1 -0
- package/dist/components/Icons/EnterpriseIcon.js +1 -0
- package/dist/components/Icons/EqualIcon.js +1 -0
- package/dist/components/Icons/ErrorIcon.js +1 -0
- package/dist/components/Icons/EventBusyIcon.js +1 -0
- package/dist/components/Icons/EventIcon.js +1 -0
- package/dist/components/Icons/ExpandAllIcon.js +1 -0
- package/dist/components/Icons/FastForwardIcon.js +1 -0
- package/dist/components/Icons/FastRewindIcon.js +1 -0
- package/dist/components/Icons/FavoriteIcon.js +1 -0
- package/dist/components/Icons/FeaturedSeasonalAndGiftsIcon.js +1 -0
- package/dist/components/Icons/FeedIcon.js +1 -0
- package/dist/components/Icons/FilePresentIcon.js +1 -0
- package/dist/components/Icons/FilterListIcon.js +1 -0
- package/dist/components/Icons/FingerPrintIcon.js +1 -0
- package/dist/components/Icons/FlagIcon.js +1 -0
- package/dist/components/Icons/FolderCopyIcon.js +1 -0
- package/dist/components/Icons/FolderIcon.js +1 -0
- package/dist/components/Icons/FolderZipIcon.js +1 -0
- package/dist/components/Icons/FootPrintIcon.js +1 -0
- package/dist/components/Icons/FormatAlignCenterIcon.js +1 -0
- package/dist/components/Icons/FormatAlignJustifyIcon.js +1 -0
- package/dist/components/Icons/FormatAlignLeftIcon.js +1 -0
- package/dist/components/Icons/FormatAlignRightIcon.js +1 -0
- package/dist/components/Icons/FormatBoldIcon.js +1 -0
- package/dist/components/Icons/FormatItalicIcon.js +1 -0
- package/dist/components/Icons/FormatListBulletedIcon.js +1 -0
- package/dist/components/Icons/FormatListNumberedIcon.js +1 -0
- package/dist/components/Icons/FormatSizeIcon.js +1 -0
- package/dist/components/Icons/FormatUnderlinedIcon.js +1 -0
- package/dist/components/Icons/ForumIcon.js +1 -0
- package/dist/components/Icons/ForwardToInboxIcon.js +1 -0
- package/dist/components/Icons/FullScreenIcon.js +1 -0
- package/dist/components/Icons/GalleryThumbnailIcon.js +1 -0
- package/dist/components/Icons/GppBadIcon.js +1 -0
- package/dist/components/Icons/GppMaybeIcon.js +1 -0
- package/dist/components/Icons/GridViewIcon.js +1 -0
- package/dist/components/Icons/GroupIcon.js +1 -0
- package/dist/components/Icons/GroupsTwoIcon.js +1 -0
- package/dist/components/Icons/HandShakeIcon.js +1 -0
- package/dist/components/Icons/HeadphonesIcon.js +1 -0
- package/dist/components/Icons/HelpIcon.js +1 -0
- package/dist/components/Icons/HomeIcon.js +1 -0
- package/dist/components/Icons/HomePinIcon.js +1 -0
- package/dist/components/Icons/HomeRepairServiceIcon.js +1 -0
- package/dist/components/Icons/HourGlassTopIcon.js +1 -0
- package/dist/components/Icons/HourglassEmptyIcon.js +1 -0
- package/dist/components/Icons/HubIcon.js +1 -0
- package/dist/components/Icons/IFrameIcon.js +1 -0
- package/dist/components/Icons/IconWrapper.js +1 -0
- package/dist/components/Icons/IdCardIcon.js +1 -0
- package/dist/components/Icons/IndeterminateCheckBoxIcon.js +1 -0
- package/dist/components/Icons/InfoIcon.js +1 -0
- package/dist/components/Icons/InsertChartIcon.js +1 -0
- package/dist/components/Icons/IntegrationInstructionsIcon.js +1 -0
- package/dist/components/Icons/Inventory2Icon.js +1 -0
- package/dist/components/Icons/IosShareIcon.js +1 -0
- package/dist/components/Icons/KeepIcon.js +1 -0
- package/dist/components/Icons/KeyIcon.js +1 -0
- package/dist/components/Icons/KeyOffIcon.js +1 -0
- package/dist/components/Icons/KeyboardArrowDownIcon.js +1 -0
- package/dist/components/Icons/KeyboardArrowUpIcon.js +1 -0
- package/dist/components/Icons/KeyboardBackSpaceIcon.js +1 -0
- package/dist/components/Icons/KeyboardDoubleArrowDownIcon.js +1 -0
- package/dist/components/Icons/LabProfileIcon.js +1 -0
- package/dist/components/Icons/LabelIcon.js +1 -0
- package/dist/components/Icons/LabelOffIcon.js +1 -0
- package/dist/components/Icons/LanguageIcon.js +1 -0
- package/dist/components/Icons/LeftPanelCloseIcon.js +1 -0
- package/dist/components/Icons/LeftPanelOpenIcon.js +1 -0
- package/dist/components/Icons/LibraryMusicIcon.js +1 -0
- package/dist/components/Icons/LinkIcon.js +1 -0
- package/dist/components/Icons/LinkOffIcon.js +1 -0
- package/dist/components/Icons/LocalActivityIcon.js +1 -0
- package/dist/components/Icons/LocalFloristIcon.js +1 -0
- package/dist/components/Icons/LocalLibraryIcon.js +1 -0
- package/dist/components/Icons/LocationOnIcon.js +1 -0
- package/dist/components/Icons/LockIcon.js +1 -0
- package/dist/components/Icons/LockOpenIcon.js +1 -0
- package/dist/components/Icons/LoginIcon.js +1 -0
- package/dist/components/Icons/LogoutIcon.js +1 -0
- package/dist/components/Icons/MailIcon.js +1 -0
- package/dist/components/Icons/ManageAccountsIcon.js +1 -0
- package/dist/components/Icons/MarkUnreadChatAltIcon.js +1 -0
- package/dist/components/Icons/MediaLinkIcon.js +1 -0
- package/dist/components/Icons/MenuOpenIcon.js +1 -0
- package/dist/components/Icons/MetabolismIcon.js +1 -0
- package/dist/components/Icons/MilitaryTechIcon.js +1 -0
- package/dist/components/Icons/MoneyBagIcon.js +1 -0
- package/dist/components/Icons/MonitorIcon.js +1 -0
- package/dist/components/Icons/MonitoringIcon.js +1 -0
- package/dist/components/Icons/MoreHorizIcon.js +1 -0
- package/dist/components/Icons/MoreVertIcon.js +1 -0
- package/dist/components/Icons/MotionPhotosPausedIcon.js +1 -0
- package/dist/components/Icons/NotificationsIcon.js +1 -0
- package/dist/components/Icons/OpenInNewIcon.js +1 -0
- package/dist/components/Icons/Package2Icon.js +1 -0
- package/dist/components/Icons/PageviewIcon.js +1 -0
- package/dist/components/Icons/PaidIcon.js +1 -0
- package/dist/components/Icons/PaletteIcon.js +1 -0
- package/dist/components/Icons/PatientListIcon.js +1 -0
- package/dist/components/Icons/PauseIcon.js +1 -0
- package/dist/components/Icons/PaymentsIcon.js +1 -0
- package/dist/components/Icons/PendingActionsIcon.js +1 -0
- package/dist/components/Icons/PercentIcon.js +1 -0
- package/dist/components/Icons/PermMediaIcon.js +1 -0
- package/dist/components/Icons/PersonAddIcon.js +1 -0
- package/dist/components/Icons/PersonBookIcon.js +1 -0
- package/dist/components/Icons/PersonIcon.js +1 -0
- package/dist/components/Icons/PhotoCameraIcon.js +1 -0
- package/dist/components/Icons/PhotoIcon.js +1 -0
- package/dist/components/Icons/PhotoLibraryIcon.js +1 -0
- package/dist/components/Icons/PictureAsPdfIcon.js +1 -0
- package/dist/components/Icons/PlayArrowIcon.js +1 -0
- package/dist/components/Icons/PlayCircleIcon.js +1 -0
- package/dist/components/Icons/PolicyIcon.js +1 -0
- package/dist/components/Icons/PowerSettingsCircleIcon.js +1 -0
- package/dist/components/Icons/PowerSettingsNewIcon.js +1 -0
- package/dist/components/Icons/PreviewIcon.js +1 -0
- package/dist/components/Icons/PriorityHighIcon.js +1 -0
- package/dist/components/Icons/PsychologyAltIcon.js +1 -0
- package/dist/components/Icons/PublicIcon.js +1 -0
- package/dist/components/Icons/PublishIcon.js +1 -0
- package/dist/components/Icons/QRCode2Icon.js +1 -0
- package/dist/components/Icons/QuestionMarkIcon.js +1 -0
- package/dist/components/Icons/QuizIcon.js +1 -0
- package/dist/components/Icons/RadioButtonCheckedIcon.js +1 -0
- package/dist/components/Icons/RadioButtonUncheckedIcon.js +1 -0
- package/dist/components/Icons/RateReviewIcon.js +1 -0
- package/dist/components/Icons/ReceiptLongIcon.js +1 -0
- package/dist/components/Icons/RecordVoiceOverIcon.js +1 -0
- package/dist/components/Icons/RedeemIcon.js +1 -0
- package/dist/components/Icons/RedoIcon.js +1 -0
- package/dist/components/Icons/RemoveIcon.js +1 -0
- package/dist/components/Icons/RemoveRoadIcon.js +1 -0
- package/dist/components/Icons/RequestQuoteIcon.js +1 -0
- package/dist/components/Icons/ReviewIcon.js +1 -0
- package/dist/components/Icons/SavingsIcon.js +1 -0
- package/dist/components/Icons/ScheduleIcon.js +1 -0
- package/dist/components/Icons/ScheduleSendIcon.js +1 -0
- package/dist/components/Icons/SearchIcon.js +1 -0
- package/dist/components/Icons/SellIcon.js +1 -0
- package/dist/components/Icons/SendIcon.js +1 -0
- package/dist/components/Icons/SettingsIcon.js +1 -0
- package/dist/components/Icons/ShareIcon.js +1 -0
- package/dist/components/Icons/ShoppingCartIcon.js +1 -0
- package/dist/components/Icons/ShoppingModeIcon.js +1 -0
- package/dist/components/Icons/ShuffleIcon.js +1 -0
- package/dist/components/Icons/SocialLeaderBoardIcon.js +1 -0
- package/dist/components/Icons/Speed15xIcon.js +1 -0
- package/dist/components/Icons/Speed1xIcon.js +1 -0
- package/dist/components/Icons/Speed2xIcon.js +1 -0
- package/dist/components/Icons/StarHalfIcon.js +1 -0
- package/dist/components/Icons/StarIcon.js +1 -0
- package/dist/components/Icons/StorefrontIcon.js +1 -0
- package/dist/components/Icons/StrikethroughSIcon.js +1 -0
- package/dist/components/Icons/SubscriptionsIcon.js +1 -0
- package/dist/components/Icons/SupervisorAccountIcon.js +1 -0
- package/dist/components/Icons/SwitchAccountIcon.js +1 -0
- package/dist/components/Icons/SwitchesIcon.js +1 -0
- package/dist/components/Icons/SyncSavedLocallyIcon.js +1 -0
- package/dist/components/Icons/TabletIcon.js +1 -0
- package/dist/components/Icons/ThumbDownIcon.js +1 -0
- package/dist/components/Icons/ThumbUpIcon.js +1 -0
- package/dist/components/Icons/TocIcon.js +1 -0
- package/dist/components/Icons/TrashDeleteBinIcon.js +1 -0
- package/dist/components/Icons/TrendingUpIcon.js +1 -0
- package/dist/components/Icons/TrophyIcon.js +1 -0
- package/dist/components/Icons/UndoIcon.js +1 -0
- package/dist/components/Icons/UnfoldMoreIcon.js +1 -0
- package/dist/components/Icons/UnsubscribeIcon.js +1 -0
- package/dist/components/Icons/UploadIcon.js +1 -0
- package/dist/components/Icons/VerifiedIcon.js +1 -0
- package/dist/components/Icons/VideoCamIcon.js +1 -0
- package/dist/components/Icons/VideoFileIcon.js +1 -0
- package/dist/components/Icons/ViewAgendaIcon.js +1 -0
- package/dist/components/Icons/ViewArrayIcon.js +1 -0
- package/dist/components/Icons/ViewCarouselIcon.js +1 -0
- package/dist/components/Icons/ViewCozyIcon.js +1 -0
- package/dist/components/Icons/ViewModuleIcon.js +1 -0
- package/dist/components/Icons/VisibilityIcon.js +1 -0
- package/dist/components/Icons/VisibilityOffIcon.js +1 -0
- package/dist/components/Icons/VolumeUpIcon.js +1 -0
- package/dist/components/Icons/VolunteerActivismIcon.js +1 -0
- package/dist/components/Icons/WandStarsGradientIcon.js +1 -0
- package/dist/components/Icons/WandStarsIcon.js +1 -0
- package/dist/components/Icons/WarningIcon.js +1 -0
- package/dist/components/Icons/WbSunnyIcon.js +1 -0
- package/dist/components/Icons/WebAssetIcon.js +1 -0
- package/dist/components/Icons/WebTrafficIcon.js +1 -0
- package/dist/components/Icons/WebhookIcon.js +1 -0
- package/dist/components/Icons/WidgetsIcon.js +1 -0
- package/dist/components/Icons/WorkHistoryIcon.js +1 -0
- package/dist/components/Icons/WorkIcon.js +1 -0
- package/dist/components/Icons/enums.js +1 -0
- package/dist/components/Icons/icons.js +1 -0
- package/dist/components/Icons/index.js +1 -0
- package/dist/components/Icons/types.js +1 -0
- package/dist/components/Input/Input.js +1 -0
- package/dist/components/Input/InputField.js +1 -0
- package/dist/components/Input/InputRoot.js +1 -0
- package/dist/components/Input/index.js +1 -0
- package/dist/components/PasswordField/PasswordField.js +2 -0
- package/dist/components/PasswordField/index.js +1 -0
- package/dist/components/PhoneNumber/PhoneNumberDigitField.js +3 -0
- package/dist/components/PhoneNumber/PhoneNumberFields.js +2 -0
- package/dist/components/PhoneNumber/PhoneNumberFlagField.js +2 -0
- package/dist/components/PhoneNumber/PhoneNumberInput.js +2 -0
- package/dist/components/PhoneNumber/PhoneNumberOptions.js +2 -0
- package/dist/components/PhoneNumber/PhoneNumberOptionsList.js +2 -0
- package/dist/components/PhoneNumber/PhoneNumberOptionsSearchField.js +2 -0
- package/dist/components/PhoneNumber/PhoneNumberPortal.js +2 -0
- package/dist/components/PhoneNumber/PhoneNumberRoot.js +2 -0
- package/dist/components/PhoneNumber/index.js +1 -0
- package/dist/components/PhoneNumber/phoneNumberContext.js +1 -0
- package/dist/components/PriceField/PriceFieldDigitField.js +2 -0
- package/dist/components/PriceField/PriceFieldFields.js +2 -0
- package/dist/components/PriceField/PriceFieldFlagField.js +2 -0
- package/dist/components/PriceField/PriceFieldInput.js +2 -0
- package/dist/components/PriceField/PriceFieldOptions.js +2 -0
- package/dist/components/PriceField/PriceFieldOptionsList.js +2 -0
- package/dist/components/PriceField/PriceFieldOptionsSearchField.js +2 -0
- package/dist/components/PriceField/PriceFieldPortal.js +2 -0
- package/dist/components/PriceField/PriceFieldRoot.js +2 -0
- package/dist/components/PriceField/index.js +1 -0
- package/dist/components/PriceField/priceFieldContext.js +1 -0
- package/dist/components/Provider/MainstackDesignSystemProvider.js +1 -0
- package/dist/components/Provider/index.js +1 -0
- package/dist/components/Provider/providerContext.js +1 -0
- package/dist/components/Provider/useMainstackDesignSystemTheme.js +1 -0
- package/dist/components/Radio/RadioItem.js +1 -0
- package/dist/components/Radio/RadioItemIndicator.js +1 -0
- package/dist/components/Radio/RadioItemLabel.js +1 -0
- package/dist/components/Radio/RadioItemSubtext.js +1 -0
- package/dist/components/Radio/RadioItemTitle.js +1 -0
- package/dist/components/Radio/RadioRoot.js +1 -0
- package/dist/components/Radio/index.js +1 -0
- package/dist/components/SearchField/SearchField.js +2 -0
- package/dist/components/SearchField/index.js +1 -0
- package/dist/components/Select/MultiSelect.js +2 -0
- package/dist/components/Select/Select.js +2 -0
- package/dist/components/Select/SelectInputField.js +2 -0
- package/dist/components/Select/SelectOptionInputPreview.js +2 -0
- package/dist/components/Select/SelectOptionItem.js +2 -0
- package/dist/components/Select/SelectOptionItemWithCheckbox.js +2 -0
- package/dist/components/Select/SelectOptions.js +2 -0
- package/dist/components/Select/SelectPortal.js +2 -0
- package/dist/components/Select/SelectRoot.js +2 -0
- package/dist/components/Select/index.js +1 -0
- package/dist/components/Select/selectContext.js +1 -0
- package/dist/components/Select/utils.js +1 -0
- package/dist/components/Tab/TabsContent.js +1 -0
- package/dist/components/Tab/TabsContext.js +1 -0
- package/dist/components/Tab/TabsList.js +1 -0
- package/dist/components/Tab/TabsRoot.js +1 -0
- package/dist/components/Tab/TabsTrigger.js +1 -0
- package/dist/components/Tab/index.js +1 -0
- package/dist/components/Tab/tabsVariants.js +1 -0
- package/dist/components/Tag/Tag.js +1 -0
- package/dist/components/Tag/TagIcon.js +1 -0
- package/dist/components/Tag/TagLabel.js +1 -0
- package/dist/components/Tag/TagRoot.js +1 -0
- package/dist/components/Tag/index.js +1 -0
- package/dist/components/Tag/tagVariants.js +1 -0
- package/dist/components/TextEditor/TextEditorField.js +4 -0
- package/dist/components/TextEditor/TextEditorInput.js +2 -0
- package/dist/components/TextEditor/TextEditorMenuBar/BoldMenu.js +2 -0
- package/dist/components/TextEditor/TextEditorMenuBar/CodeMenu.js +2 -0
- package/dist/components/TextEditor/TextEditorMenuBar/ColorPickerMenu.js +2 -0
- package/dist/components/TextEditor/TextEditorMenuBar/GenerateWithAiMenu.js +2 -0
- package/dist/components/TextEditor/TextEditorMenuBar/ImageUploadMenu.js +2 -0
- package/dist/components/TextEditor/TextEditorMenuBar/ItalicMenu.js +2 -0
- package/dist/components/TextEditor/TextEditorMenuBar/LinkMenu.js +6 -0
- package/dist/components/TextEditor/TextEditorMenuBar/OrderedListMenu.js +2 -0
- package/dist/components/TextEditor/TextEditorMenuBar/StrikethroughMenu.js +2 -0
- package/dist/components/TextEditor/TextEditorMenuBar/TextAlignMenu.js +2 -0
- package/dist/components/TextEditor/TextEditorMenuBar/TextEditorMenuAction.js +2 -0
- package/dist/components/TextEditor/TextEditorMenuBar/TextEditorMenuBar.js +2 -0
- package/dist/components/TextEditor/TextEditorMenuBar/TextSizesMenu.js +2 -0
- package/dist/components/TextEditor/TextEditorMenuBar/UnderlineMenu.js +2 -0
- package/dist/components/TextEditor/TextEditorMenuBar/UnorderedListMenu.js +2 -0
- package/dist/components/TextEditor/TextEditorRoot.js +42 -0
- package/dist/components/TextEditor/index.js +1 -0
- package/dist/components/TextEditor/textEditorContext.js +1 -0
- package/dist/components/Textarea/Textarea.js +1 -0
- package/dist/components/Textarea/TextareaField.js +1 -0
- package/dist/components/Textarea/TextareaRoot.js +1 -0
- package/dist/components/Textarea/index.js +1 -0
- package/dist/components/Tile/TileCheckbox.js +1 -0
- package/dist/components/Tile/TileContent.js +1 -0
- package/dist/components/Tile/TileDescription.js +1 -0
- package/dist/components/Tile/TileHeader.js +1 -0
- package/dist/components/Tile/TileMedia.js +3 -0
- package/dist/components/Tile/TileRoot.js +2 -0
- package/dist/components/Tile/TileTitle.js +1 -0
- package/dist/components/Tile/index.js +1 -0
- package/dist/components/Tile/tileVariants.js +1 -0
- package/dist/components/Toggle/Toggle.js +1 -0
- package/dist/components/Toggle/ToggleLabel.js +1 -0
- package/dist/components/Toggle/ToggleRoot.js +1 -0
- package/dist/components/Toggle/ToggleSubtext.js +1 -0
- package/dist/components/Toggle/ToggleSwitch.js +2 -0
- package/dist/components/Toggle/ToggleTitle.js +1 -0
- package/dist/components/Toggle/index.js +1 -0
- package/dist/components/Toggle/toggleVariants.js +1 -0
- package/dist/components/Tooltip/TooltipArrow.js +1 -0
- package/dist/components/Tooltip/TooltipBody.js +1 -0
- package/dist/components/Tooltip/TooltipContent.js +1 -0
- package/dist/components/Tooltip/TooltipContext.js +1 -0
- package/dist/components/Tooltip/TooltipFooter.js +1 -0
- package/dist/components/Tooltip/TooltipHeader.js +1 -0
- package/dist/components/Tooltip/TooltipRoot.js +2 -0
- package/dist/components/Tooltip/TooltipTitle.js +1 -0
- package/dist/components/Tooltip/TooltipTrigger.js +1 -0
- package/dist/components/Tooltip/index.js +1 -0
- package/dist/components/Tooltip/useTooltipContext.js +1 -0
- package/dist/components/Typography/BodyText/BodyText.js +1 -0
- package/dist/components/Typography/BodyText/bodyTextVariants.js +1 -0
- package/dist/components/Typography/BodyText/index.js +1 -0
- package/dist/components/Typography/DisplayText/DisplayText.js +1 -0
- package/dist/components/Typography/DisplayText/displayTextVariants.js +1 -0
- package/dist/components/Typography/DisplayText/index.js +1 -0
- package/dist/components/Typography/HeadlineText/HeadlineText.js +1 -0
- package/dist/components/Typography/HeadlineText/headlineTextVariants.js +1 -0
- package/dist/components/Typography/HeadlineText/index.js +1 -0
- package/dist/en.json-BPy-6DYI.cjs +1 -0
- package/dist/en.json-VbJG9vrN.js +263 -0
- package/dist/floating-ui.dom-C224prEy.cjs +1 -0
- package/dist/floating-ui.dom-CauyjNxS.js +1131 -0
- package/dist/fonts/degular/Degular-Black.woff2 +0 -0
- package/dist/fonts/degular/Degular-Black_Italic.woff2 +0 -0
- package/dist/fonts/degular/Degular-Bold.woff2 +0 -0
- package/dist/fonts/degular/Degular-Bold_Italic.woff2 +0 -0
- package/dist/fonts/degular/Degular-Italic.woff2 +0 -0
- package/dist/fonts/degular/Degular-Light.woff2 +0 -0
- package/dist/fonts/degular/Degular-Light_Italic.woff2 +0 -0
- package/dist/fonts/degular/Degular-Medium.woff2 +0 -0
- package/dist/fonts/degular/Degular-Medium_Italic.woff2 +0 -0
- package/dist/fonts/degular/Degular-Regular.woff2 +0 -0
- package/dist/fonts/degular/Degular-Semibold.woff2 +0 -0
- package/dist/fonts/degular/Degular-Semibold_Italic.woff2 +0 -0
- package/dist/fonts/degular/Degular-Thin.woff2 +0 -0
- package/dist/fonts/degular/Degular-Thin_Italic.woff2 +0 -0
- package/dist/fonts/suisseIntl/SuisseIntl-Black.woff2 +0 -0
- package/dist/fonts/suisseIntl/SuisseIntl-BlackIt.woff2 +0 -0
- package/dist/fonts/suisseIntl/SuisseIntl-Bold.woff2 +0 -0
- package/dist/fonts/suisseIntl/SuisseIntl-BoldIt.woff2 +0 -0
- package/dist/fonts/suisseIntl/SuisseIntl-Book.woff2 +0 -0
- package/dist/fonts/suisseIntl/SuisseIntl-BookIt.woff2 +0 -0
- package/dist/fonts/suisseIntl/SuisseIntl-Medium.woff2 +0 -0
- package/dist/fonts/suisseIntl/SuisseIntl-MediumIt.woff2 +0 -0
- package/dist/fonts/suisseIntl/SuisseIntl-Regular.woff2 +0 -0
- package/dist/fonts/suisseIntl/SuisseIntl-RegularIt.woff2 +0 -0
- package/dist/fonts/suisseIntl/SuisseIntl-Semibold.woff2 +0 -0
- package/dist/fonts/suisseIntl/SuisseIntl-SemiboldIt.woff2 +0 -0
- package/dist/getInternationalPhoneNumberPrefix-C4Qc97tE.cjs +34 -0
- package/dist/getInternationalPhoneNumberPrefix-C8O8VTpp.js +4368 -0
- package/dist/index-0ioNhtNM.js +10 -0
- package/dist/index-437EL2iq.js +52 -0
- package/dist/index-5Bhkapwi.js +82 -0
- package/dist/index-B0dI0L76.cjs +2 -0
- package/dist/index-BGQepRFJ.js +27 -0
- package/dist/index-BGfrl8IX.js +71 -0
- package/dist/index-BI11g55_.cjs +42 -0
- package/dist/index-BRRTyZ1e.js +75 -0
- package/dist/index-BZCybroW.cjs +2 -0
- package/dist/index-BZPx6jYI.js +8 -0
- package/dist/index-B_Bwy8wX.cjs +1 -0
- package/dist/index-BbQbyYHN.cjs +2 -0
- package/dist/index-BfKbXbc8.cjs +1 -0
- package/dist/index-BvWMjxZ5.js +675 -0
- package/dist/index-Bx2vBAJ5.cjs +2 -0
- package/dist/index-ByaXH_ih.js +10 -0
- package/dist/index-C2mPf2xD.cjs +1 -0
- package/dist/index-C8aODXfJ.cjs +1 -0
- package/dist/index-CAgJYdlN.cjs +1 -0
- package/dist/index-CCKe-Mpx.js +6 -0
- package/dist/index-CRDKsB5y.cjs +2 -0
- package/dist/index-CRdNenpR.js +422 -0
- package/dist/index-CajSSBH7.cjs +1 -0
- package/dist/index-Cje7xxa1.cjs +1 -0
- package/dist/index-CpDnqHCm.js +36 -0
- package/dist/index-CsK1LjrZ.cjs +2 -0
- package/dist/index-CvknVH0W.js +754 -0
- package/dist/index-CwR-dC8j.cjs +2 -0
- package/dist/index-CyFz8fal.cjs +131 -0
- package/dist/index-CzY-WZXL.cjs +1 -0
- package/dist/index-D-KHlZ2P.js +20 -0
- package/dist/index-D29mdTf5.js +34 -0
- package/dist/index-D9S-9HH_.js +332 -0
- package/dist/index-DCXkdCW2.js +227 -0
- package/dist/index-DLcgu_3m.js +159 -0
- package/dist/index-DVuTCIJE.cjs +2 -0
- package/dist/index-DWQmix6e.js +234 -0
- package/dist/index-DYxWvftI.cjs +1 -0
- package/dist/index-DgIcguCG.cjs +2 -0
- package/dist/index-DmeJCEwx.js +181 -0
- package/dist/index-Dt3HnaYe.js +48 -0
- package/dist/index-Dz5LHXX9.js +145 -0
- package/dist/index-MQ0c3ZX_.cjs +1 -0
- package/dist/index-ZhUVW4CS.cjs +2 -0
- package/dist/index-bSPhqlcX.cjs +1 -0
- package/dist/index-fw7dUmQl.js +352 -0
- package/dist/index-ojFnBVkh.cjs +2 -0
- package/dist/index-q-4o5Ie4.cjs +2 -0
- package/dist/index-twi8FX77.js +13814 -0
- package/dist/index-xqkGMOJ8.js +13 -0
- package/dist/index.d.ts +68 -0
- package/dist/index.js +1 -0
- package/dist/lib/useElementWidth.js +1 -0
- package/dist/lib/utils.js +1 -0
- package/dist/types/index.js +1 -0
- package/package.json +89 -66
- package/build/index.css +0 -6
- package/build/index.d.ts +0 -1419
- package/build/mainstack-design-system.js +0 -25463
package/README.md
CHANGED
|
@@ -1,22 +1,707 @@
|
|
|
1
1
|
<!--@@joggrdoc@@-->
|
|
2
2
|
<!-- @joggr:version(v2):end -->
|
|
3
3
|
<!-- @joggr:warning:start -->
|
|
4
|
-
<!--
|
|
5
|
-
_ _ _ __ __ _ ____ _ _ ___ _ _ ____ _ _ _
|
|
4
|
+
<!--
|
|
5
|
+
_ _ _ __ __ _ ____ _ _ ___ _ _ ____ _ _ _
|
|
6
6
|
| | | | | | \ \ / / / \ | _ \ | \ | | |_ _| | \ | | / ___| | | | | | |
|
|
7
7
|
| | | | | | \ \ /\ / / / _ \ | |_) | | \| | | | | \| | | | _ | | | | | |
|
|
8
8
|
|_| |_| |_| \ V V / / ___ \ | _ < | |\ | | | | |\ | | |_| | |_| |_| |_|
|
|
9
9
|
(_) (_) (_) \_/\_/ /_/ \_\ |_| \_\ |_| \_| |___| |_| \_| \____| (_) (_) (_)
|
|
10
|
-
|
|
11
|
-
This document is managed by Joggr. Editing this document could break Joggr's core features, i.e. our
|
|
12
|
-
ability to auto-maintain this document. Please use the Joggr editor to edit this document
|
|
10
|
+
|
|
11
|
+
This document is managed by Joggr. Editing this document could break Joggr's core features, i.e. our
|
|
12
|
+
ability to auto-maintain this document. Please use the Joggr editor to edit this document
|
|
13
13
|
(link at bottom of the page).
|
|
14
14
|
-->
|
|
15
15
|
<!-- @joggr:warning:end -->
|
|
16
|
+
|
|
16
17
|
## Storybook Documentation
|
|
17
18
|
|
|
18
19
|
To view the design system documentation, visit this [link](https://mainstack-design-system.vercel.app/).
|
|
19
20
|
|
|
21
|
+
# Design System Development Guide
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Design Tokens
|
|
26
|
+
|
|
27
|
+
### Token Naming Convention
|
|
28
|
+
|
|
29
|
+
All custom CSS variables must follow the `--ms-name-of-variable` pattern using kebab-case.
|
|
30
|
+
|
|
31
|
+
```css
|
|
32
|
+
/* ✅ Correct */
|
|
33
|
+
--ms-primary-color: #3b82f6;
|
|
34
|
+
--ms-text-base: 1rem;
|
|
35
|
+
|
|
36
|
+
/* ❌ Incorrect */
|
|
37
|
+
--primaryColor: #3b82f6;
|
|
38
|
+
--ms_text_base: 1rem;
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Token Inference
|
|
42
|
+
|
|
43
|
+
Tokens should be inferred directly from design documentation on Figma.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
# Component Architecture
|
|
48
|
+
|
|
49
|
+
## Composition Component Pattern Guide
|
|
50
|
+
|
|
51
|
+
### Overview
|
|
52
|
+
|
|
53
|
+
Our design system uses a composition architecture pattern that provides both **simple** and **advanced** APIs for components. This guide explains when and how to use each pattern.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Pattern 1: Direct Composition (`Comp.Root`)
|
|
58
|
+
|
|
59
|
+
**Use when:** The component requires multiple sub-components in most use cases.
|
|
60
|
+
|
|
61
|
+
### Structure
|
|
62
|
+
|
|
63
|
+
```tsx
|
|
64
|
+
// Most common usage requires composition
|
|
65
|
+
Dialog.Root;
|
|
66
|
+
Dialog.Trigger;
|
|
67
|
+
Dialog.Content;
|
|
68
|
+
Dialog.Header;
|
|
69
|
+
Dialog.Footer;
|
|
70
|
+
|
|
71
|
+
DialogRoot;
|
|
72
|
+
DialogTrigger;
|
|
73
|
+
DialogContent;
|
|
74
|
+
DialogHeader;
|
|
75
|
+
DialogFooter;
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Example: Dialog Component
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
//Dialog almost always needs multiple parts
|
|
82
|
+
import { Dialog } from "@/components/dialog";
|
|
83
|
+
|
|
84
|
+
<Dialog.Root open={open} onOpenChange={setOpen}>
|
|
85
|
+
<Dialog.Trigger asChild>
|
|
86
|
+
<button>Open Dialog</button>
|
|
87
|
+
</Dialog.Trigger>
|
|
88
|
+
|
|
89
|
+
<Dialog.Content>
|
|
90
|
+
<Dialog.Header>
|
|
91
|
+
<Dialog.Title>Confirm Action</Dialog.Title>
|
|
92
|
+
</Dialog.Header>
|
|
93
|
+
|
|
94
|
+
<p>Are you sure you want to continue?</p>
|
|
95
|
+
|
|
96
|
+
<Dialog.Footer>
|
|
97
|
+
<Dialog.Close asChild>
|
|
98
|
+
<button>Cancel</button>
|
|
99
|
+
</Dialog.Close>
|
|
100
|
+
<button>Confirm</button>
|
|
101
|
+
</Dialog.Footer>
|
|
102
|
+
</Dialog.Content>
|
|
103
|
+
</Dialog.Root>;
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
```tsx
|
|
107
|
+
// Tree shaking example
|
|
108
|
+
import {
|
|
109
|
+
DialogRoot,
|
|
110
|
+
DialogTrigger,
|
|
111
|
+
DialogContent,
|
|
112
|
+
DialogHeader,
|
|
113
|
+
DialogFooter,
|
|
114
|
+
} from "@/components/dialog";
|
|
115
|
+
|
|
116
|
+
<DialogRoot open={open} onOpenChange={setOpen}>
|
|
117
|
+
<DialogTrigger asChild>
|
|
118
|
+
<button>Open Dialog</button>
|
|
119
|
+
</DialogTrigger>
|
|
120
|
+
|
|
121
|
+
<DialogContent>
|
|
122
|
+
<DialogHeader>
|
|
123
|
+
<Dialog.Title>Confirm Action</Dialog.Title>
|
|
124
|
+
</DialogHeader>
|
|
125
|
+
|
|
126
|
+
<p>Are you sure you want to continue?</p>
|
|
127
|
+
|
|
128
|
+
<DialogFooter>
|
|
129
|
+
<DialogClose asChild>
|
|
130
|
+
<button>Cancel</button>
|
|
131
|
+
</DialogClose>
|
|
132
|
+
<button>Confirm</button>
|
|
133
|
+
</DialogFooter>
|
|
134
|
+
</DialogContent>
|
|
135
|
+
</DialogRoot>;
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### When to Use
|
|
139
|
+
|
|
140
|
+
- Component is **interactive** and requires multiple parts to function
|
|
141
|
+
- **No simplified version** makes sense
|
|
142
|
+
- Examples: Dialog, Dropdown, Accordion, Tabs,
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Pattern 2: Simple + Composition (`Comp` + `CompGroup.Root` or `CompRoot`)
|
|
147
|
+
|
|
148
|
+
**Use when:** The component is **presentational** and typically only needs **one sub-component** (like a label), but can be extended with additional parts.
|
|
149
|
+
|
|
150
|
+
### Structure
|
|
151
|
+
|
|
152
|
+
```tsx
|
|
153
|
+
// Simple component for common case
|
|
154
|
+
Comp;
|
|
155
|
+
|
|
156
|
+
// Composiition for tree shaking
|
|
157
|
+
CompRoot;
|
|
158
|
+
CompLabel;
|
|
159
|
+
CompIcon;
|
|
160
|
+
|
|
161
|
+
// Composition for advanced cases
|
|
162
|
+
CompGroup.Root;
|
|
163
|
+
CompGroup.Label;
|
|
164
|
+
CompGroup.Icon;
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Example: Tag Component
|
|
168
|
+
|
|
169
|
+
```tsx
|
|
170
|
+
// SIMPLE (80% of use cases)
|
|
171
|
+
import { Tag } from '@/components/tag'
|
|
172
|
+
|
|
173
|
+
<Tag>React</Tag>
|
|
174
|
+
<Tag variant="success">Active</Tag>
|
|
175
|
+
<Tag>TypeScript</Tag>
|
|
176
|
+
|
|
177
|
+
// ADVANCED with tree shaking (10% of use cases)
|
|
178
|
+
import { TagRoot, TagIcon, TagLabel } from '@/components/tag'
|
|
179
|
+
|
|
180
|
+
<TagRoot variant="success">
|
|
181
|
+
<TagIcon>
|
|
182
|
+
<Check className="h-3 w-3" />
|
|
183
|
+
</TagIcon>
|
|
184
|
+
<TagLabel>Verified User</TagLabel>
|
|
185
|
+
</TagRoot>
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
// ADVANCED import all composables (10% of use cases)
|
|
189
|
+
import { TagGroup } from '@/components/tag'
|
|
190
|
+
|
|
191
|
+
<TagGroup.Root variant="success">
|
|
192
|
+
<TagGroup.Icon>
|
|
193
|
+
<Check className="h-3 w-3" />
|
|
194
|
+
</TagGroup.Icon>
|
|
195
|
+
<TagGroup.Label>Verified User</TagGroup.Label>
|
|
196
|
+
</TagGroup.Root>
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### When to Use
|
|
200
|
+
|
|
201
|
+
- Component is **presentational** (non-interactive by default)
|
|
202
|
+
- **Most use cases** only need text/label
|
|
203
|
+
- Can be extended with icons, badges, or other decorations
|
|
204
|
+
- Examples: Tag, Button, Chip,
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Pattern 3: Single Component with Props
|
|
209
|
+
|
|
210
|
+
**Use when:** The component has variations but doesn't need composition.
|
|
211
|
+
|
|
212
|
+
### Structure
|
|
213
|
+
|
|
214
|
+
```tsx
|
|
215
|
+
// Single component with variants
|
|
216
|
+
Avatar;
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Example: Button Component
|
|
220
|
+
|
|
221
|
+
```tsx
|
|
222
|
+
// ✅ Props handle all variations
|
|
223
|
+
import { Avatar } from "@/components/Avatar";
|
|
224
|
+
|
|
225
|
+
<Avatar variant="picture">Click me</Avatar>;
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### When to Use
|
|
229
|
+
|
|
230
|
+
- Component variations are handled by **props** (variant, size, state)
|
|
231
|
+
- No need for multiple sub-components
|
|
232
|
+
- Example: Avatar
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
#### Controlled vs Uncontrolled
|
|
237
|
+
|
|
238
|
+
Components should support both controlled and uncontrolled usage for maximum flexibility.
|
|
239
|
+
This can ba achieved with `@radix-ui/react-use-controllable-state`
|
|
240
|
+
|
|
241
|
+
#### asChild Pattern
|
|
242
|
+
|
|
243
|
+
**Default to `asChild` with Radix Slot for interactive components.**
|
|
244
|
+
|
|
245
|
+
```tsx
|
|
246
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
247
|
+
|
|
248
|
+
interface ButtonProps {
|
|
249
|
+
asChild?: boolean;
|
|
250
|
+
// other props
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
const Button = ({ asChild = false, ...props }: ButtonProps) => {
|
|
254
|
+
const Comp = asChild ? Slot : "button";
|
|
255
|
+
return <Comp {...props} />;
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
// Usage
|
|
259
|
+
<Button asChild>
|
|
260
|
+
<a href="/home">Go Home</a>
|
|
261
|
+
</Button>;
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
**Use `as` prop only for non-interactive primitives** (Typography, Tags, etc.)
|
|
265
|
+
|
|
266
|
+
```tsx
|
|
267
|
+
// ✅ Correct - Non-interactive primitive
|
|
268
|
+
<Text as="h1">Heading</Text>
|
|
269
|
+
<Text as="p">Paragraph</Text>
|
|
270
|
+
|
|
271
|
+
// ❌ Incorrect - Interactive component
|
|
272
|
+
<Button as="a" href="/home">Link</Button> // Use asChild instead
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## Styling Conventions
|
|
278
|
+
|
|
279
|
+
### Class Names
|
|
280
|
+
|
|
281
|
+
**Always use kebab-case for class names.**
|
|
282
|
+
|
|
283
|
+
```tsx
|
|
284
|
+
// ✅ Correct
|
|
285
|
+
className = "button-primary";
|
|
286
|
+
className = "dialog-content";
|
|
287
|
+
className = "form-field-error";
|
|
288
|
+
|
|
289
|
+
// ❌ Incorrect
|
|
290
|
+
className = "buttonPrimary";
|
|
291
|
+
className = "DialogContent";
|
|
292
|
+
className = "form_field_error";
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
Pass user classes and props last as overrides to variants and any other component styling.
|
|
296
|
+
|
|
297
|
+
### State Management with data-state
|
|
298
|
+
|
|
299
|
+
**Use `data-state` attributes for styling element states.**
|
|
300
|
+
|
|
301
|
+
```tsx
|
|
302
|
+
// Component
|
|
303
|
+
<button
|
|
304
|
+
data-state={isOpen ? "open" : "closed"}
|
|
305
|
+
data-disabled={disabled}
|
|
306
|
+
data-loading={isLoading}
|
|
307
|
+
>
|
|
308
|
+
{children}
|
|
309
|
+
</button>
|
|
310
|
+
|
|
311
|
+
// CSS/Tailwind
|
|
312
|
+
<button
|
|
313
|
+
className="
|
|
314
|
+
data-[state=open]:opacity-50
|
|
315
|
+
data-[disabled]:cursor-not-allowed
|
|
316
|
+
data-[loading]:bg-primary
|
|
317
|
+
"
|
|
318
|
+
>
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
### data-slot for Composition Styling
|
|
322
|
+
|
|
323
|
+
**Use `data-slot` for styling specific parts in composition patterns.**
|
|
324
|
+
|
|
325
|
+
```tsx
|
|
326
|
+
// Component
|
|
327
|
+
const Card = {
|
|
328
|
+
Root: ({ children }) => (
|
|
329
|
+
<div data-slot="root" className="card">
|
|
330
|
+
{children}
|
|
331
|
+
</div>
|
|
332
|
+
),
|
|
333
|
+
Header: ({ children }) => (
|
|
334
|
+
<div data-slot="header" className="card-header">
|
|
335
|
+
{children}
|
|
336
|
+
</div>
|
|
337
|
+
),
|
|
338
|
+
Body: ({ children }) => (
|
|
339
|
+
<div data-slot="body" className="card-body">
|
|
340
|
+
{children}
|
|
341
|
+
</div>
|
|
342
|
+
),
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// CSS targeting
|
|
346
|
+
.card [data-slot="header"] {
|
|
347
|
+
/* Header-specific styles when inside card */
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
.card [data-slot="body"] {
|
|
351
|
+
/* Body-specific styles when inside card */
|
|
352
|
+
}
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
# Client And Server Component Approach
|
|
356
|
+
|
|
357
|
+
The design system is built on React 19 and as such component built should support SSR, Server component (if applicable) and Client Component. Please reference react doc [here](https://react.dev/reference/rsc/use-client#when-to-use-use-client) for more info.
|
|
358
|
+
|
|
359
|
+
> **Please Note:** That SSR is different from React Server Component. This article [here](https://www.joshwcomeau.com/react/server-components/) explained it better.
|
|
360
|
+
|
|
361
|
+
## Server Component Support
|
|
362
|
+
|
|
363
|
+
The rule of thumb here is components with only styling, presentation component with no client-side interactivity, state management, context provider usage or browser APIs usage should be server compatible.
|
|
364
|
+
|
|
365
|
+
So server component can't have `useState` or `useEffect` in them, hence why they are presentational component with styling alone.
|
|
366
|
+
|
|
367
|
+
E.g Typograhy and Icon components; `DisplayText`, `BodyText` and `HeadlineText`
|
|
368
|
+
|
|
369
|
+
> **Please Note:** This component should not be exported with the `use client` directives
|
|
370
|
+
|
|
371
|
+
## Client Component Support And SSR
|
|
372
|
+
|
|
373
|
+
The rule of thumb here is components with client-side interactivity, state management, context provider usage or browser APIs usage should be client compatible and as such have the `use client` directives.
|
|
374
|
+
|
|
375
|
+
E.g `ImageUploader`, `Tooltip`
|
|
376
|
+
|
|
377
|
+
> **Please Note:** This component should be exported with the `use client` directives
|
|
378
|
+
|
|
379
|
+
That being said there are cases where Radix UI doesn't serve all your needs and you would need to build the component your self while keeping SSR in mind.
|
|
380
|
+
|
|
381
|
+
- Avoid Browser-Specific APIs in Rendering Logic: Browser APIs like window, document, localStorage, or sessionStorage.
|
|
382
|
+
- Always use `useEffect` hook for any side effect. Also use the `typeof window !== 'undefined'` to ensure browser-specific code only executes on the client.
|
|
383
|
+
- Avoid Time-Dependent Logic: Do not use time-dependent APIs like `Date()` constructors in your rendering logic, as the server and client might render at slightly different times, causing a mismatch.
|
|
384
|
+
|
|
385
|
+
While using the composition Component Pattern, only mark component as client with the `use client` directive on a per component level.
|
|
386
|
+
|
|
387
|
+
**Example:**
|
|
388
|
+
|
|
389
|
+
```tsx
|
|
390
|
+
"use client";
|
|
391
|
+
import { useState, useEffect } from "react";
|
|
392
|
+
|
|
393
|
+
interface DialogRootProps {
|
|
394
|
+
// dialog props
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
export const DialogRoot = ({ asChild = false, ...props }: DialogRootProps) => {
|
|
398
|
+
const [dialogOpen, setDialogOpen] = useState();
|
|
399
|
+
const Comp = asChild ? Slot : "div";
|
|
400
|
+
|
|
401
|
+
useEffect(() => {
|
|
402
|
+
// Make some side effect
|
|
403
|
+
}, []);
|
|
404
|
+
return <Comp open={dialogOpen} onOpen={setDialogOpen} {...props} />;
|
|
405
|
+
};
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
```tsx
|
|
409
|
+
interface DialogBodyProps {
|
|
410
|
+
// dialog props
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
export const DialogBody = ({ asChild = false, ...props }: DialogBodyProps) => {
|
|
414
|
+
const Comp = asChild ? Slot : "div";
|
|
415
|
+
return <Comp open={dialogOpen} onOpen={setDialogOpen} {...props} />;
|
|
416
|
+
};
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
```tsx
|
|
420
|
+
import { DialogRoot, DialogBody } from "./dialog";
|
|
421
|
+
|
|
422
|
+
const App = () => {
|
|
423
|
+
return (
|
|
424
|
+
<DialogRoot>
|
|
425
|
+
<DialogBody>// Your content</DialogBody>
|
|
426
|
+
</DialogRoot>
|
|
427
|
+
);
|
|
428
|
+
};
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
In the example above `DialogBody` is a composable component that's meant to be used with `DialogRoot` but we only mark `DialogRoot` as client because it's using a state and an effect.
|
|
432
|
+
|
|
433
|
+
If `DialogBody` and `DialogRoot` were imported into a React server component, `DialogBody` will render on the server while `DialogRoot` will render on client. This works as a result of react [module dependency tree](https://react.dev/reference/rsc/use-client#how-use-client-marks-client-code)
|
|
434
|
+
|
|
435
|
+
Summary:
|
|
436
|
+
|
|
437
|
+
- If the component uses any React State or context provider, mark as client.
|
|
438
|
+
- If the component uses any Browser API, mark as client.
|
|
439
|
+
|
|
440
|
+
---
|
|
441
|
+
|
|
442
|
+
## Folder Structure
|
|
443
|
+
|
|
444
|
+
### Component Organization
|
|
445
|
+
|
|
446
|
+
**Every component must be in a named folder with barrel exports.**
|
|
447
|
+
|
|
448
|
+
```
|
|
449
|
+
src/components/Button/
|
|
450
|
+
├── Button.tsx # Main component
|
|
451
|
+
├── Button.stories.tsx # Storybook stories
|
|
452
|
+
├── Button.test.tsx # Tests
|
|
453
|
+
├── useButton.ts # Component-specific hook (if needed)
|
|
454
|
+
├── buttonVariants.ts # CVA variants (if needed)
|
|
455
|
+
└── index.ts # Barrel export
|
|
456
|
+
|
|
457
|
+
src/components/Dialog/
|
|
458
|
+
├── DialogRoot.tsx
|
|
459
|
+
├── DialogTrigger.tsx
|
|
460
|
+
├── DialogContent.tsx
|
|
461
|
+
├── DialogHeader.tsx
|
|
462
|
+
├── DialogFooter.tsx
|
|
463
|
+
├── useDialog.ts # Dialog-specific hook
|
|
464
|
+
├── Dialog.stories.tsx
|
|
465
|
+
├── Dialog.test.tsx
|
|
466
|
+
└── index.ts # Exports all parts
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
### Barrel Export Pattern
|
|
470
|
+
|
|
471
|
+
```typescript
|
|
472
|
+
// index.ts
|
|
473
|
+
|
|
474
|
+
// single component
|
|
475
|
+
export { Button } from "./Button";
|
|
476
|
+
|
|
477
|
+
// Composition components
|
|
478
|
+
export { ButtonRoot } from "./ButtonRoot";
|
|
479
|
+
export type { ButtonRootProps } from "./ButtonRoot";
|
|
480
|
+
|
|
481
|
+
export { ButtonIcon } from "./ButtonIcon";
|
|
482
|
+
export type { ButtonIconProps } from "./ButtonIcon";
|
|
483
|
+
|
|
484
|
+
export { ButtonLabel } from "./ButtonLabel";
|
|
485
|
+
export type { ButtonLabelProps } from "./ButtonLabel";
|
|
486
|
+
|
|
487
|
+
export { buttonVariants } from "./buttonVariants";
|
|
488
|
+
|
|
489
|
+
// Composition object for dot notation usage
|
|
490
|
+
import { ButtonRoot } from "./ButtonRoot";
|
|
491
|
+
import { ButtonIcon } from "./ButtonIcon";
|
|
492
|
+
import { ButtonLabel } from "./ButtonLabel";
|
|
493
|
+
|
|
494
|
+
export const ButtonGroup = {
|
|
495
|
+
Root: ButtonRoot,
|
|
496
|
+
Icon: ButtonIcon,
|
|
497
|
+
Label: ButtonLabel,
|
|
498
|
+
};
|
|
499
|
+
|
|
500
|
+
// Composition without simple exported component
|
|
501
|
+
import { AccordionRoot } from "./AccordionRoot";
|
|
502
|
+
import { AccordionHeader } from "./AccordionHeader";
|
|
503
|
+
import { AccordionTrigger } from "./AccordionTrigger";
|
|
504
|
+
|
|
505
|
+
export const Accordion = {
|
|
506
|
+
Root: AccordionRoot,
|
|
507
|
+
Header: AccordionHeader,
|
|
508
|
+
Trigger: AccordionTrigger,
|
|
509
|
+
};
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
### Tree Shaking Rules
|
|
513
|
+
|
|
514
|
+
**Keep component-specific code colocated:**
|
|
515
|
+
|
|
516
|
+
- ✅ Component-specific helpers → Stay in component folder
|
|
517
|
+
- ✅ Component-specific hooks → Stay in component folder
|
|
518
|
+
- ✅ Component-specific types → Stay in component folder
|
|
519
|
+
|
|
520
|
+
**Move to shared when:**
|
|
521
|
+
|
|
522
|
+
- ❌ Used in more than one component → Move to `src/utils/` or `src/hooks/`
|
|
523
|
+
|
|
524
|
+
---
|
|
525
|
+
|
|
526
|
+
## Documentation Standards
|
|
527
|
+
|
|
528
|
+
### Storybook Stories
|
|
529
|
+
|
|
530
|
+
**Every component must have:**
|
|
531
|
+
|
|
532
|
+
1. **1-2 major variants stories** (immediately visible)
|
|
533
|
+
2. **One example with changeable controls** for other variants
|
|
534
|
+
|
|
535
|
+
```typescript
|
|
536
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
537
|
+
import { Button } from "./button";
|
|
538
|
+
|
|
539
|
+
const meta: Meta<typeof Button> = {
|
|
540
|
+
title: "Components/UI/Button",
|
|
541
|
+
component: Button,
|
|
542
|
+
parameters: {
|
|
543
|
+
layout: "centered",
|
|
544
|
+
},
|
|
545
|
+
tags: ["autodocs"],
|
|
546
|
+
};
|
|
547
|
+
|
|
548
|
+
export default meta;
|
|
549
|
+
type Story = StoryObj<typeof Button>;
|
|
550
|
+
|
|
551
|
+
export const Primary: Story = {
|
|
552
|
+
args: {
|
|
553
|
+
children: "Primary Button",
|
|
554
|
+
variant: "primary",
|
|
555
|
+
},
|
|
556
|
+
};
|
|
557
|
+
|
|
558
|
+
export const Secondary: Story = {
|
|
559
|
+
args: {
|
|
560
|
+
children: "Secondary Button",
|
|
561
|
+
variant: "secondary",
|
|
562
|
+
},
|
|
563
|
+
};
|
|
564
|
+
|
|
565
|
+
export const Secondary: Story = {
|
|
566
|
+
args: {
|
|
567
|
+
children: "Primary Button",
|
|
568
|
+
variant: "primary",
|
|
569
|
+
size: "lg",
|
|
570
|
+
},
|
|
571
|
+
};
|
|
572
|
+
|
|
573
|
+
export const Secondary: Story = {
|
|
574
|
+
args: {
|
|
575
|
+
children: "Primary Button",
|
|
576
|
+
variant: "primary",
|
|
577
|
+
size: "md",
|
|
578
|
+
},
|
|
579
|
+
};
|
|
580
|
+
|
|
581
|
+
// All Other Variants - One example with controls
|
|
582
|
+
export const Playground: Story = {
|
|
583
|
+
args: {
|
|
584
|
+
children: "Playground Button",
|
|
585
|
+
},
|
|
586
|
+
argTypes: {
|
|
587
|
+
variant: {
|
|
588
|
+
control: "select",
|
|
589
|
+
options: ["primary", "secondary", "outline", "ghost", "destructive"],
|
|
590
|
+
},
|
|
591
|
+
size: {
|
|
592
|
+
control: "select",
|
|
593
|
+
options: ["sm", "md", "lg"],
|
|
594
|
+
},
|
|
595
|
+
disabled: {
|
|
596
|
+
control: "boolean",
|
|
597
|
+
},
|
|
598
|
+
},
|
|
599
|
+
};
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
---
|
|
603
|
+
|
|
604
|
+
## Accessibility
|
|
605
|
+
|
|
606
|
+
### Semantic HTML First
|
|
607
|
+
|
|
608
|
+
**Always use semantic HTML elements as the foundation.**
|
|
609
|
+
|
|
610
|
+
```tsx
|
|
611
|
+
// ✅ Correct - Semantic HTML
|
|
612
|
+
<button type="button">Click me</button>
|
|
613
|
+
<nav>Navigation</nav>
|
|
614
|
+
<main>Main content</main>
|
|
615
|
+
<article>Article content</article>
|
|
616
|
+
|
|
617
|
+
// ❌ Incorrect - Non-semantic
|
|
618
|
+
<div onClick={handleClick}>Click me</div>
|
|
619
|
+
<div>Navigation</div>
|
|
620
|
+
<div>Main content</div>
|
|
621
|
+
```
|
|
622
|
+
|
|
623
|
+
### ARIA for Exceptions
|
|
624
|
+
|
|
625
|
+
**Use ARIA attributes only when semantic HTML is insufficient.**
|
|
626
|
+
|
|
627
|
+
```tsx
|
|
628
|
+
// ✅ Correct - ARIA only when needed
|
|
629
|
+
<div
|
|
630
|
+
role="button"
|
|
631
|
+
tabIndex={0}
|
|
632
|
+
aria-label="Close dialog"
|
|
633
|
+
onKeyDown={handleKeyDown}
|
|
634
|
+
>
|
|
635
|
+
<CloseIcon />
|
|
636
|
+
</div>
|
|
637
|
+
|
|
638
|
+
// ✅ Correct - Complex widget states
|
|
639
|
+
<button
|
|
640
|
+
aria-expanded={isOpen}
|
|
641
|
+
aria-controls="menu-content"
|
|
642
|
+
aria-haspopup="true"
|
|
643
|
+
>
|
|
644
|
+
Menu
|
|
645
|
+
</button>
|
|
646
|
+
|
|
647
|
+
// ❌ Incorrect - Unnecessary ARIA
|
|
648
|
+
<button aria-label="Submit">Submit</button> // Text already visible
|
|
649
|
+
```
|
|
650
|
+
|
|
651
|
+
### Accessibility Checklist
|
|
652
|
+
|
|
653
|
+
- ✅ Keyboard navigation support
|
|
654
|
+
- ✅ Focus management
|
|
655
|
+
- ✅ Screen reader announcements
|
|
656
|
+
- ✅ Color contrast (WCAG AA minimum)
|
|
657
|
+
- ✅ Touch target sizes (minimum 44x44px)
|
|
658
|
+
- ✅ Reduced motion support
|
|
659
|
+
|
|
660
|
+
---
|
|
661
|
+
|
|
662
|
+
## API Design
|
|
663
|
+
|
|
664
|
+
### Prop Naming
|
|
665
|
+
|
|
666
|
+
**Ensure prop names don't clash with HTML attributes except where explicitly needed to override.**
|
|
667
|
+
|
|
668
|
+
```tsx
|
|
669
|
+
// ✅ Correct - No clash
|
|
670
|
+
interface ButtonProps {
|
|
671
|
+
variant?: "primary" | "secondary";
|
|
672
|
+
isLoading?: boolean; // Not "loading" (clashes with HTML)
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
// ✅ Correct - Intentional override
|
|
676
|
+
interface InputProps {
|
|
677
|
+
type?: "text" | "email" | "password"; // Override HTML type
|
|
678
|
+
disabled?: boolean; // Override HTML disabled
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
// ❌ Incorrect - Unintentional clash
|
|
682
|
+
interface CustomInputProps {
|
|
683
|
+
value?: string; // Clashes with HTML value
|
|
684
|
+
name?: string; // Clashes with HTML name
|
|
685
|
+
// Should use different names or explicitly document override
|
|
686
|
+
}
|
|
687
|
+
```
|
|
688
|
+
|
|
689
|
+
---
|
|
690
|
+
|
|
691
|
+
## Contributing
|
|
692
|
+
|
|
693
|
+
When contributing new components:
|
|
694
|
+
|
|
695
|
+
1. Follow this guide
|
|
696
|
+
2. Include comprehensive Storybook documentation
|
|
697
|
+
3. Ensure TypeScript types are exported
|
|
698
|
+
4. Test controlled and uncontrolled modes
|
|
699
|
+
5. Verify keyboard navigation
|
|
700
|
+
6. Check responsive behavior
|
|
701
|
+
7. Submit with visual regression tests
|
|
702
|
+
|
|
703
|
+
<!-- v0 Documentation-->
|
|
704
|
+
|
|
20
705
|
# Usage
|
|
21
706
|
|
|
22
707
|
Install the design system
|
|
@@ -28,9 +713,9 @@ Add the Design system provider to your root file
|
|
|
28
713
|
```typescript
|
|
29
714
|
import { MainstackProvider } from "mainstack-design-system";
|
|
30
715
|
|
|
31
|
-
|
|
32
|
-
<App/>
|
|
33
|
-
</MainstackProvider
|
|
716
|
+
<MainstackProvider>
|
|
717
|
+
<App />
|
|
718
|
+
</MainstackProvider>;
|
|
34
719
|
```
|
|
35
720
|
|
|
36
721
|
## Components
|
|
@@ -50,40 +735,40 @@ Icons are imported from the `'mainstack-design-system` directory. For example:
|
|
|
50
735
|
Colors are imported from the `mainstack-design-system` directory. For example:
|
|
51
736
|
|
|
52
737
|
```typescript
|
|
53
|
-
|
|
738
|
+
import { Colors } from "mainstack-design-system";
|
|
54
739
|
|
|
55
|
-
|
|
740
|
+
<Text color={Colors.black300}>Hello World</Text>;
|
|
56
741
|
```
|
|
57
742
|
|
|
58
743
|
## Contributing
|
|
59
744
|
|
|
60
745
|
Installing the application (as a developer) is simple in the following steps:
|
|
61
746
|
|
|
62
|
-
|
|
747
|
+
- Access and Clone this repository
|
|
63
748
|
|
|
64
749
|
```shell
|
|
65
750
|
git clone git clone https://github.com/The-Mainstack/mainstack-design-system.git && cd [repo-name]
|
|
66
751
|
```
|
|
67
752
|
|
|
68
|
-
|
|
753
|
+
- Make your forked repo the remote upstream (at origin)
|
|
69
754
|
|
|
70
755
|
```shell
|
|
71
756
|
git remote add origin https://github.com/The-Mainstack/mainstack-design-system.git
|
|
72
757
|
```
|
|
73
758
|
|
|
74
|
-
|
|
759
|
+
- Navigate into the cloned directory and install dependencies with Yarn
|
|
75
760
|
|
|
76
761
|
```typescript
|
|
77
762
|
yarn add
|
|
78
763
|
```
|
|
79
764
|
|
|
80
|
-
|
|
765
|
+
- Make a duplicate of the **env** file and update its content accordingly. Most times, this is just fine with no update.
|
|
81
766
|
|
|
82
767
|
```shell
|
|
83
768
|
cp .env.sample .env
|
|
84
769
|
```
|
|
85
770
|
|
|
86
|
-
|
|
771
|
+
- Run the app in the development mode. Open [http://localhost:\[port\]](http://localhost:%5Bport%5D) to view it in the browser and start developing.
|
|
87
772
|
|
|
88
773
|
```typescript
|
|
89
774
|
yarn dev
|
|
@@ -102,7 +787,9 @@ To Publish to NPM, run the following command:
|
|
|
102
787
|
```
|
|
103
788
|
|
|
104
789
|
<!-- @joggr:editLink(b428f959-2d9d-45aa-8134-1d4f284d1469):start -->
|
|
790
|
+
|
|
105
791
|
---
|
|
792
|
+
|
|
106
793
|
<a href="https://app.joggr.io/app/documents/b428f959-2d9d-45aa-8134-1d4f284d1469/edit">
|
|
107
794
|
<img src="https://cdn.joggr.io/assets/static/badges/joggr-document-edit.svg?did=b428f959-2d9d-45aa-8134-1d4f284d1469" alt="Edit doc on Joggr" />
|
|
108
795
|
</a>
|