mainstack-design-system 0.7.44 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (595) hide show
  1. package/README.md +702 -15
  2. package/dist/FormCountryOptionsList-BTIDLbxV.cjs +8 -0
  3. package/dist/FormCountryOptionsList-BWbi-SZ_.js +1790 -0
  4. package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
  5. package/dist/_commonjsHelpers-DwGv2jUC.cjs +1 -0
  6. package/dist/clsx-C11secjj.cjs +1 -0
  7. package/dist/clsx-OuTLNxxd.js +16 -0
  8. package/dist/components/Accordion/AccordionContent.js +1 -0
  9. package/dist/components/Accordion/AccordionHeader.js +1 -0
  10. package/dist/components/Accordion/AccordionItem.js +1 -0
  11. package/dist/components/Accordion/AccordionRoot.js +1 -0
  12. package/dist/components/Accordion/AccordionSubtitle.js +1 -0
  13. package/dist/components/Accordion/AccordionTitle.js +1 -0
  14. package/dist/components/Accordion/AccordionTrigger.js +1 -0
  15. package/dist/components/Accordion/index.js +1 -0
  16. package/dist/components/Avatar/Avatar.js +2 -0
  17. package/dist/components/Avatar/avatarVariants.js +1 -0
  18. package/dist/components/Avatar/getAvatarSize.js +1 -0
  19. package/dist/components/Avatar/index.js +1 -0
  20. package/dist/components/Banner/BannerAction.js +1 -0
  21. package/dist/components/Banner/BannerContent.js +1 -0
  22. package/dist/components/Banner/BannerHeader.js +1 -0
  23. package/dist/components/Banner/BannerIcon.js +1 -0
  24. package/dist/components/Banner/BannerRoot.js +1 -0
  25. package/dist/components/Banner/BannerText.js +1 -0
  26. package/dist/components/Banner/bannerVariants.js +1 -0
  27. package/dist/components/Banner/index.js +1 -0
  28. package/dist/components/Button/Button.js +1 -0
  29. package/dist/components/Button/ButtonIcon.js +1 -0
  30. package/dist/components/Button/ButtonLabel.js +1 -0
  31. package/dist/components/Button/ButtonRoot.js +1 -0
  32. package/dist/components/Button/buttonVariants.js +87 -0
  33. package/dist/components/Button/index.js +1 -0
  34. package/dist/components/Checkbox/CheckboxIndicator.js +2 -0
  35. package/dist/components/Checkbox/CheckboxLabel.js +1 -0
  36. package/dist/components/Checkbox/CheckboxRoot.js +1 -0
  37. package/dist/components/Checkbox/CheckboxSubtext.js +1 -0
  38. package/dist/components/Checkbox/CheckboxTitle.js +1 -0
  39. package/dist/components/Checkbox/index.js +1 -0
  40. package/dist/components/Chip/Chip.js +1 -0
  41. package/dist/components/Chip/ChipLabel.js +1 -0
  42. package/dist/components/Chip/ChipRoot.js +1 -0
  43. package/dist/components/Chip/ChipSlot.js +1 -0
  44. package/dist/components/Chip/chipVariants.js +1 -0
  45. package/dist/components/Chip/index.js +1 -0
  46. package/dist/components/Form/FormCharacterCounter.js +1 -0
  47. package/dist/components/Form/FormCountrySelect/FormCountryOptions.js +1 -0
  48. package/dist/components/Form/FormCountrySelect/FormCountryOptionsList.js +1 -0
  49. package/dist/components/Form/FormCountrySelect/FormCountryOptionsSearchField.js +1 -0
  50. package/dist/components/Form/FormCountrySelect/FormCountrySelect.js +1 -0
  51. package/dist/components/Form/FormCountrySelect/constant.js +1 -0
  52. package/dist/components/Form/FormCountrySelect/getCountryFlagComp.js +1 -0
  53. package/dist/components/Form/FormItem.js +1 -0
  54. package/dist/components/Form/FormLabel.js +1 -0
  55. package/dist/components/Form/FormStatus/FormErrorStatus.js +1 -0
  56. package/dist/components/Form/FormStatus/FormHintStatus.js +1 -0
  57. package/dist/components/Form/FormStatus/FormStatusRoot.js +1 -0
  58. package/dist/components/Form/FormStatus/FormStatusText.js +1 -0
  59. package/dist/components/Form/FormStatus/FormSuccessStatus.js +1 -0
  60. package/dist/components/Form/index.js +1 -0
  61. package/dist/components/Icons/AccountBalanceIcon.js +1 -0
  62. package/dist/components/Icons/AccountBalanceWalletIcon.js +1 -0
  63. package/dist/components/Icons/AccountCircleIcon.js +1 -0
  64. package/dist/components/Icons/AdGroupIcon.js +1 -0
  65. package/dist/components/Icons/AdaptiveAudioMicIcon.js +1 -0
  66. package/dist/components/Icons/AddAPhotoIcon.js +1 -0
  67. package/dist/components/Icons/AddBusinessIcon.js +1 -0
  68. package/dist/components/Icons/AddCircleIcon.js +1 -0
  69. package/dist/components/Icons/AddIcon.js +1 -0
  70. package/dist/components/Icons/AddLinkIcon.js +1 -0
  71. package/dist/components/Icons/AddPhotoAlternateIcon.js +1 -0
  72. package/dist/components/Icons/AddShoppingCartIcon.js +1 -0
  73. package/dist/components/Icons/AdminPanelSettingsIcon.js +1 -0
  74. package/dist/components/Icons/AdsClickIcon.js +1 -0
  75. package/dist/components/Icons/AlarmIcon.js +1 -0
  76. package/dist/components/Icons/AllInboxIcon.js +1 -0
  77. package/dist/components/Icons/AnimationIcon.js +1 -0
  78. package/dist/components/Icons/ApartmentIcon.js +1 -0
  79. package/dist/components/Icons/AppsIcon.js +1 -0
  80. package/dist/components/Icons/ArchiveIcon.js +1 -0
  81. package/dist/components/Icons/ArrowBackIcon.js +1 -0
  82. package/dist/components/Icons/ArrowCircleDownIcon.js +1 -0
  83. package/dist/components/Icons/ArrowCircleUpIcon.js +1 -0
  84. package/dist/components/Icons/ArrowDownwardIcon.js +1 -0
  85. package/dist/components/Icons/ArrowDropDownIcon.js +1 -0
  86. package/dist/components/Icons/ArrowDropUpIcon.js +1 -0
  87. package/dist/components/Icons/ArrowForwardIcon.js +1 -0
  88. package/dist/components/Icons/ArrowUpwardIcon.js +1 -0
  89. package/dist/components/Icons/ArtTrackIcon.js +1 -0
  90. package/dist/components/Icons/ArticleIcon.js +1 -0
  91. package/dist/components/Icons/AttachMoneyIcon.js +1 -0
  92. package/dist/components/Icons/AttachmentIcon.js +1 -0
  93. package/dist/components/Icons/AudioFileIcon.js +1 -0
  94. package/dist/components/Icons/AutoAwesomeMosaic.js +1 -0
  95. package/dist/components/Icons/AvatarIcon.js +1 -0
  96. package/dist/components/Icons/AwardStarIcon.js +1 -0
  97. package/dist/components/Icons/BarChartIcon.js +1 -0
  98. package/dist/components/Icons/BarcodeScannerIcon.js +1 -0
  99. package/dist/components/Icons/BlockIcon.js +1 -0
  100. package/dist/components/Icons/BoltIcon.js +1 -0
  101. package/dist/components/Icons/Book5Icon.js +1 -0
  102. package/dist/components/Icons/BookOnlineIcon.js +1 -0
  103. package/dist/components/Icons/BugReportIcon.js +1 -0
  104. package/dist/components/Icons/BusinessCenterIcon.js +1 -0
  105. package/dist/components/Icons/CalendarAddOnIcon.js +1 -0
  106. package/dist/components/Icons/CalendarClockIcon.js +1 -0
  107. package/dist/components/Icons/CalendarMonthIcon.js +1 -0
  108. package/dist/components/Icons/CalendarTodayIcon.js +1 -0
  109. package/dist/components/Icons/CallIcon.js +1 -0
  110. package/dist/components/Icons/CallMadeIcon.js +1 -0
  111. package/dist/components/Icons/CallMissedIcon.js +1 -0
  112. package/dist/components/Icons/CallMissedOutgoingIcon.js +1 -0
  113. package/dist/components/Icons/CallReceivedIcon.js +1 -0
  114. package/dist/components/Icons/CampaignIcon.js +1 -0
  115. package/dist/components/Icons/CancelIcon.js +1 -0
  116. package/dist/components/Icons/CancelScheduleSendIcon.js +1 -0
  117. package/dist/components/Icons/CaptivePortalIcon.js +1 -0
  118. package/dist/components/Icons/CardLayoutIcon.js +1 -0
  119. package/dist/components/Icons/CasesIcon.js +1 -0
  120. package/dist/components/Icons/CategoryIcon.js +1 -0
  121. package/dist/components/Icons/ChairIcon.js +1 -0
  122. package/dist/components/Icons/ChangeCircleIcon.js +1 -0
  123. package/dist/components/Icons/ChatBubbleIcon.js +1 -0
  124. package/dist/components/Icons/ChatIcon.js +1 -0
  125. package/dist/components/Icons/CheckBoxIcon.js +1 -0
  126. package/dist/components/Icons/CheckBoxOutlineBlankIcon.js +1 -0
  127. package/dist/components/Icons/CheckCircleIcon.js +1 -0
  128. package/dist/components/Icons/CheckIcon.js +1 -0
  129. package/dist/components/Icons/ChevronLeftIcon.js +1 -0
  130. package/dist/components/Icons/ChevronRightIcon.js +1 -0
  131. package/dist/components/Icons/ClinicalNoteIcon.js +1 -0
  132. package/dist/components/Icons/CloseIcon.js +1 -0
  133. package/dist/components/Icons/CloudUploadIcon.js +1 -0
  134. package/dist/components/Icons/CodeIcon.js +1 -0
  135. package/dist/components/Icons/CoffeeIcon.js +1 -0
  136. package/dist/components/Icons/CollectionsBookmarkIcon.js +1 -0
  137. package/dist/components/Icons/ColorPickerIcon.js +1 -0
  138. package/dist/components/Icons/CompareArrowsIcon.js +1 -0
  139. package/dist/components/Icons/ConfirmationNumberIcon.js +1 -0
  140. package/dist/components/Icons/ContactMailIcon.js +1 -0
  141. package/dist/components/Icons/ContactPageIcon.js +1 -0
  142. package/dist/components/Icons/ContactPhoneIcon.js +1 -0
  143. package/dist/components/Icons/ContactSupportIcon.js +1 -0
  144. package/dist/components/Icons/ContactsIcon.js +1 -0
  145. package/dist/components/Icons/ContentCopyIcon.js +1 -0
  146. package/dist/components/Icons/CreditCardGearIcon.js +1 -0
  147. package/dist/components/Icons/CreditCardIcon.js +1 -0
  148. package/dist/components/Icons/CsvIcon.js +1 -0
  149. package/dist/components/Icons/CurrencyExchangeIcon.js +1 -0
  150. package/dist/components/Icons/DNSIcon.js +1 -0
  151. package/dist/components/Icons/DangerousIcon.js +1 -0
  152. package/dist/components/Icons/DarkModeIcon.js +1 -0
  153. package/dist/components/Icons/DashboardIcon.js +1 -0
  154. package/dist/components/Icons/DataCheckIcon.js +1 -0
  155. package/dist/components/Icons/DataObjectIcon.js +1 -0
  156. package/dist/components/Icons/DatabaseIcon.js +1 -0
  157. package/dist/components/Icons/DehazeIcon.js +1 -0
  158. package/dist/components/Icons/DeployedCodeAccountIcon.js +1 -0
  159. package/dist/components/Icons/DescriptionIcon.js +1 -0
  160. package/dist/components/Icons/DesktopMacIcon.js +1 -0
  161. package/dist/components/Icons/DevicesIcon.js +1 -0
  162. package/dist/components/Icons/DiamondIcon.js +1 -0
  163. package/dist/components/Icons/DirectionsWalkIcon.js +1 -0
  164. package/dist/components/Icons/Diversity1Icon.js +1 -0
  165. package/dist/components/Icons/Diversity2Icon.js +1 -0
  166. package/dist/components/Icons/Diversity3Icon.js +1 -0
  167. package/dist/components/Icons/DoNotDisturbOnIcon.js +1 -0
  168. package/dist/components/Icons/DomainAddIcon.js +1 -0
  169. package/dist/components/Icons/DomainIcon.js +1 -0
  170. package/dist/components/Icons/DomainVerificationIcon.js +1 -0
  171. package/dist/components/Icons/DownloadIcon.js +1 -0
  172. package/dist/components/Icons/DraftsIcon.js +1 -0
  173. package/dist/components/Icons/DragHandleIcon.js +1 -0
  174. package/dist/components/Icons/DragIndicatorIcon.js +1 -0
  175. package/dist/components/Icons/DuoIcon.js +1 -0
  176. package/dist/components/Icons/EarlyOnIcon.js +1 -0
  177. package/dist/components/Icons/EditIcon.js +1 -0
  178. package/dist/components/Icons/EmojiFoodBeverageIcon.js +1 -0
  179. package/dist/components/Icons/EmojiIcon.js +1 -0
  180. package/dist/components/Icons/EncryptedIcon.js +1 -0
  181. package/dist/components/Icons/EnterpriseIcon.js +1 -0
  182. package/dist/components/Icons/EqualIcon.js +1 -0
  183. package/dist/components/Icons/ErrorIcon.js +1 -0
  184. package/dist/components/Icons/EventBusyIcon.js +1 -0
  185. package/dist/components/Icons/EventIcon.js +1 -0
  186. package/dist/components/Icons/ExpandAllIcon.js +1 -0
  187. package/dist/components/Icons/FastForwardIcon.js +1 -0
  188. package/dist/components/Icons/FastRewindIcon.js +1 -0
  189. package/dist/components/Icons/FavoriteIcon.js +1 -0
  190. package/dist/components/Icons/FeaturedSeasonalAndGiftsIcon.js +1 -0
  191. package/dist/components/Icons/FeedIcon.js +1 -0
  192. package/dist/components/Icons/FilePresentIcon.js +1 -0
  193. package/dist/components/Icons/FilterListIcon.js +1 -0
  194. package/dist/components/Icons/FingerPrintIcon.js +1 -0
  195. package/dist/components/Icons/FlagIcon.js +1 -0
  196. package/dist/components/Icons/FolderCopyIcon.js +1 -0
  197. package/dist/components/Icons/FolderIcon.js +1 -0
  198. package/dist/components/Icons/FolderZipIcon.js +1 -0
  199. package/dist/components/Icons/FootPrintIcon.js +1 -0
  200. package/dist/components/Icons/FormatAlignCenterIcon.js +1 -0
  201. package/dist/components/Icons/FormatAlignJustifyIcon.js +1 -0
  202. package/dist/components/Icons/FormatAlignLeftIcon.js +1 -0
  203. package/dist/components/Icons/FormatAlignRightIcon.js +1 -0
  204. package/dist/components/Icons/FormatBoldIcon.js +1 -0
  205. package/dist/components/Icons/FormatItalicIcon.js +1 -0
  206. package/dist/components/Icons/FormatListBulletedIcon.js +1 -0
  207. package/dist/components/Icons/FormatListNumberedIcon.js +1 -0
  208. package/dist/components/Icons/FormatSizeIcon.js +1 -0
  209. package/dist/components/Icons/FormatUnderlinedIcon.js +1 -0
  210. package/dist/components/Icons/ForumIcon.js +1 -0
  211. package/dist/components/Icons/ForwardToInboxIcon.js +1 -0
  212. package/dist/components/Icons/FullScreenIcon.js +1 -0
  213. package/dist/components/Icons/GalleryThumbnailIcon.js +1 -0
  214. package/dist/components/Icons/GppBadIcon.js +1 -0
  215. package/dist/components/Icons/GppMaybeIcon.js +1 -0
  216. package/dist/components/Icons/GridViewIcon.js +1 -0
  217. package/dist/components/Icons/GroupIcon.js +1 -0
  218. package/dist/components/Icons/GroupsTwoIcon.js +1 -0
  219. package/dist/components/Icons/HandShakeIcon.js +1 -0
  220. package/dist/components/Icons/HeadphonesIcon.js +1 -0
  221. package/dist/components/Icons/HelpIcon.js +1 -0
  222. package/dist/components/Icons/HomeIcon.js +1 -0
  223. package/dist/components/Icons/HomePinIcon.js +1 -0
  224. package/dist/components/Icons/HomeRepairServiceIcon.js +1 -0
  225. package/dist/components/Icons/HourGlassTopIcon.js +1 -0
  226. package/dist/components/Icons/HourglassEmptyIcon.js +1 -0
  227. package/dist/components/Icons/HubIcon.js +1 -0
  228. package/dist/components/Icons/IFrameIcon.js +1 -0
  229. package/dist/components/Icons/IconWrapper.js +1 -0
  230. package/dist/components/Icons/IdCardIcon.js +1 -0
  231. package/dist/components/Icons/IndeterminateCheckBoxIcon.js +1 -0
  232. package/dist/components/Icons/InfoIcon.js +1 -0
  233. package/dist/components/Icons/InsertChartIcon.js +1 -0
  234. package/dist/components/Icons/IntegrationInstructionsIcon.js +1 -0
  235. package/dist/components/Icons/Inventory2Icon.js +1 -0
  236. package/dist/components/Icons/IosShareIcon.js +1 -0
  237. package/dist/components/Icons/KeepIcon.js +1 -0
  238. package/dist/components/Icons/KeyIcon.js +1 -0
  239. package/dist/components/Icons/KeyOffIcon.js +1 -0
  240. package/dist/components/Icons/KeyboardArrowDownIcon.js +1 -0
  241. package/dist/components/Icons/KeyboardArrowUpIcon.js +1 -0
  242. package/dist/components/Icons/KeyboardBackSpaceIcon.js +1 -0
  243. package/dist/components/Icons/KeyboardDoubleArrowDownIcon.js +1 -0
  244. package/dist/components/Icons/LabProfileIcon.js +1 -0
  245. package/dist/components/Icons/LabelIcon.js +1 -0
  246. package/dist/components/Icons/LabelOffIcon.js +1 -0
  247. package/dist/components/Icons/LanguageIcon.js +1 -0
  248. package/dist/components/Icons/LeftPanelCloseIcon.js +1 -0
  249. package/dist/components/Icons/LeftPanelOpenIcon.js +1 -0
  250. package/dist/components/Icons/LibraryMusicIcon.js +1 -0
  251. package/dist/components/Icons/LinkIcon.js +1 -0
  252. package/dist/components/Icons/LinkOffIcon.js +1 -0
  253. package/dist/components/Icons/LocalActivityIcon.js +1 -0
  254. package/dist/components/Icons/LocalFloristIcon.js +1 -0
  255. package/dist/components/Icons/LocalLibraryIcon.js +1 -0
  256. package/dist/components/Icons/LocationOnIcon.js +1 -0
  257. package/dist/components/Icons/LockIcon.js +1 -0
  258. package/dist/components/Icons/LockOpenIcon.js +1 -0
  259. package/dist/components/Icons/LoginIcon.js +1 -0
  260. package/dist/components/Icons/LogoutIcon.js +1 -0
  261. package/dist/components/Icons/MailIcon.js +1 -0
  262. package/dist/components/Icons/ManageAccountsIcon.js +1 -0
  263. package/dist/components/Icons/MarkUnreadChatAltIcon.js +1 -0
  264. package/dist/components/Icons/MediaLinkIcon.js +1 -0
  265. package/dist/components/Icons/MenuOpenIcon.js +1 -0
  266. package/dist/components/Icons/MetabolismIcon.js +1 -0
  267. package/dist/components/Icons/MilitaryTechIcon.js +1 -0
  268. package/dist/components/Icons/MoneyBagIcon.js +1 -0
  269. package/dist/components/Icons/MonitorIcon.js +1 -0
  270. package/dist/components/Icons/MonitoringIcon.js +1 -0
  271. package/dist/components/Icons/MoreHorizIcon.js +1 -0
  272. package/dist/components/Icons/MoreVertIcon.js +1 -0
  273. package/dist/components/Icons/MotionPhotosPausedIcon.js +1 -0
  274. package/dist/components/Icons/NotificationsIcon.js +1 -0
  275. package/dist/components/Icons/OpenInNewIcon.js +1 -0
  276. package/dist/components/Icons/Package2Icon.js +1 -0
  277. package/dist/components/Icons/PageviewIcon.js +1 -0
  278. package/dist/components/Icons/PaidIcon.js +1 -0
  279. package/dist/components/Icons/PaletteIcon.js +1 -0
  280. package/dist/components/Icons/PatientListIcon.js +1 -0
  281. package/dist/components/Icons/PauseIcon.js +1 -0
  282. package/dist/components/Icons/PaymentsIcon.js +1 -0
  283. package/dist/components/Icons/PendingActionsIcon.js +1 -0
  284. package/dist/components/Icons/PercentIcon.js +1 -0
  285. package/dist/components/Icons/PermMediaIcon.js +1 -0
  286. package/dist/components/Icons/PersonAddIcon.js +1 -0
  287. package/dist/components/Icons/PersonBookIcon.js +1 -0
  288. package/dist/components/Icons/PersonIcon.js +1 -0
  289. package/dist/components/Icons/PhotoCameraIcon.js +1 -0
  290. package/dist/components/Icons/PhotoIcon.js +1 -0
  291. package/dist/components/Icons/PhotoLibraryIcon.js +1 -0
  292. package/dist/components/Icons/PictureAsPdfIcon.js +1 -0
  293. package/dist/components/Icons/PlayArrowIcon.js +1 -0
  294. package/dist/components/Icons/PlayCircleIcon.js +1 -0
  295. package/dist/components/Icons/PolicyIcon.js +1 -0
  296. package/dist/components/Icons/PowerSettingsCircleIcon.js +1 -0
  297. package/dist/components/Icons/PowerSettingsNewIcon.js +1 -0
  298. package/dist/components/Icons/PreviewIcon.js +1 -0
  299. package/dist/components/Icons/PriorityHighIcon.js +1 -0
  300. package/dist/components/Icons/PsychologyAltIcon.js +1 -0
  301. package/dist/components/Icons/PublicIcon.js +1 -0
  302. package/dist/components/Icons/PublishIcon.js +1 -0
  303. package/dist/components/Icons/QRCode2Icon.js +1 -0
  304. package/dist/components/Icons/QuestionMarkIcon.js +1 -0
  305. package/dist/components/Icons/QuizIcon.js +1 -0
  306. package/dist/components/Icons/RadioButtonCheckedIcon.js +1 -0
  307. package/dist/components/Icons/RadioButtonUncheckedIcon.js +1 -0
  308. package/dist/components/Icons/RateReviewIcon.js +1 -0
  309. package/dist/components/Icons/ReceiptLongIcon.js +1 -0
  310. package/dist/components/Icons/RecordVoiceOverIcon.js +1 -0
  311. package/dist/components/Icons/RedeemIcon.js +1 -0
  312. package/dist/components/Icons/RedoIcon.js +1 -0
  313. package/dist/components/Icons/RemoveIcon.js +1 -0
  314. package/dist/components/Icons/RemoveRoadIcon.js +1 -0
  315. package/dist/components/Icons/RequestQuoteIcon.js +1 -0
  316. package/dist/components/Icons/ReviewIcon.js +1 -0
  317. package/dist/components/Icons/SavingsIcon.js +1 -0
  318. package/dist/components/Icons/ScheduleIcon.js +1 -0
  319. package/dist/components/Icons/ScheduleSendIcon.js +1 -0
  320. package/dist/components/Icons/SearchIcon.js +1 -0
  321. package/dist/components/Icons/SellIcon.js +1 -0
  322. package/dist/components/Icons/SendIcon.js +1 -0
  323. package/dist/components/Icons/SettingsIcon.js +1 -0
  324. package/dist/components/Icons/ShareIcon.js +1 -0
  325. package/dist/components/Icons/ShoppingCartIcon.js +1 -0
  326. package/dist/components/Icons/ShoppingModeIcon.js +1 -0
  327. package/dist/components/Icons/ShuffleIcon.js +1 -0
  328. package/dist/components/Icons/SocialLeaderBoardIcon.js +1 -0
  329. package/dist/components/Icons/Speed15xIcon.js +1 -0
  330. package/dist/components/Icons/Speed1xIcon.js +1 -0
  331. package/dist/components/Icons/Speed2xIcon.js +1 -0
  332. package/dist/components/Icons/StarHalfIcon.js +1 -0
  333. package/dist/components/Icons/StarIcon.js +1 -0
  334. package/dist/components/Icons/StorefrontIcon.js +1 -0
  335. package/dist/components/Icons/StrikethroughSIcon.js +1 -0
  336. package/dist/components/Icons/SubscriptionsIcon.js +1 -0
  337. package/dist/components/Icons/SupervisorAccountIcon.js +1 -0
  338. package/dist/components/Icons/SwitchAccountIcon.js +1 -0
  339. package/dist/components/Icons/SwitchesIcon.js +1 -0
  340. package/dist/components/Icons/SyncSavedLocallyIcon.js +1 -0
  341. package/dist/components/Icons/TabletIcon.js +1 -0
  342. package/dist/components/Icons/ThumbDownIcon.js +1 -0
  343. package/dist/components/Icons/ThumbUpIcon.js +1 -0
  344. package/dist/components/Icons/TocIcon.js +1 -0
  345. package/dist/components/Icons/TrashDeleteBinIcon.js +1 -0
  346. package/dist/components/Icons/TrendingUpIcon.js +1 -0
  347. package/dist/components/Icons/TrophyIcon.js +1 -0
  348. package/dist/components/Icons/UndoIcon.js +1 -0
  349. package/dist/components/Icons/UnfoldMoreIcon.js +1 -0
  350. package/dist/components/Icons/UnsubscribeIcon.js +1 -0
  351. package/dist/components/Icons/UploadIcon.js +1 -0
  352. package/dist/components/Icons/VerifiedIcon.js +1 -0
  353. package/dist/components/Icons/VideoCamIcon.js +1 -0
  354. package/dist/components/Icons/VideoFileIcon.js +1 -0
  355. package/dist/components/Icons/ViewAgendaIcon.js +1 -0
  356. package/dist/components/Icons/ViewArrayIcon.js +1 -0
  357. package/dist/components/Icons/ViewCarouselIcon.js +1 -0
  358. package/dist/components/Icons/ViewCozyIcon.js +1 -0
  359. package/dist/components/Icons/ViewModuleIcon.js +1 -0
  360. package/dist/components/Icons/VisibilityIcon.js +1 -0
  361. package/dist/components/Icons/VisibilityOffIcon.js +1 -0
  362. package/dist/components/Icons/VolumeUpIcon.js +1 -0
  363. package/dist/components/Icons/VolunteerActivismIcon.js +1 -0
  364. package/dist/components/Icons/WandStarsGradientIcon.js +1 -0
  365. package/dist/components/Icons/WandStarsIcon.js +1 -0
  366. package/dist/components/Icons/WarningIcon.js +1 -0
  367. package/dist/components/Icons/WbSunnyIcon.js +1 -0
  368. package/dist/components/Icons/WebAssetIcon.js +1 -0
  369. package/dist/components/Icons/WebTrafficIcon.js +1 -0
  370. package/dist/components/Icons/WebhookIcon.js +1 -0
  371. package/dist/components/Icons/WidgetsIcon.js +1 -0
  372. package/dist/components/Icons/WorkHistoryIcon.js +1 -0
  373. package/dist/components/Icons/WorkIcon.js +1 -0
  374. package/dist/components/Icons/enums.js +1 -0
  375. package/dist/components/Icons/icons.js +1 -0
  376. package/dist/components/Icons/index.js +1 -0
  377. package/dist/components/Icons/types.js +1 -0
  378. package/dist/components/Input/Input.js +1 -0
  379. package/dist/components/Input/InputField.js +1 -0
  380. package/dist/components/Input/InputRoot.js +1 -0
  381. package/dist/components/Input/index.js +1 -0
  382. package/dist/components/PasswordField/PasswordField.js +2 -0
  383. package/dist/components/PasswordField/index.js +1 -0
  384. package/dist/components/PhoneNumber/PhoneNumberDigitField.js +3 -0
  385. package/dist/components/PhoneNumber/PhoneNumberFields.js +2 -0
  386. package/dist/components/PhoneNumber/PhoneNumberFlagField.js +2 -0
  387. package/dist/components/PhoneNumber/PhoneNumberInput.js +2 -0
  388. package/dist/components/PhoneNumber/PhoneNumberOptions.js +2 -0
  389. package/dist/components/PhoneNumber/PhoneNumberOptionsList.js +2 -0
  390. package/dist/components/PhoneNumber/PhoneNumberOptionsSearchField.js +2 -0
  391. package/dist/components/PhoneNumber/PhoneNumberPortal.js +2 -0
  392. package/dist/components/PhoneNumber/PhoneNumberRoot.js +2 -0
  393. package/dist/components/PhoneNumber/index.js +1 -0
  394. package/dist/components/PhoneNumber/phoneNumberContext.js +1 -0
  395. package/dist/components/PriceField/PriceFieldDigitField.js +2 -0
  396. package/dist/components/PriceField/PriceFieldFields.js +2 -0
  397. package/dist/components/PriceField/PriceFieldFlagField.js +2 -0
  398. package/dist/components/PriceField/PriceFieldInput.js +2 -0
  399. package/dist/components/PriceField/PriceFieldOptions.js +2 -0
  400. package/dist/components/PriceField/PriceFieldOptionsList.js +2 -0
  401. package/dist/components/PriceField/PriceFieldOptionsSearchField.js +2 -0
  402. package/dist/components/PriceField/PriceFieldPortal.js +2 -0
  403. package/dist/components/PriceField/PriceFieldRoot.js +2 -0
  404. package/dist/components/PriceField/index.js +1 -0
  405. package/dist/components/PriceField/priceFieldContext.js +1 -0
  406. package/dist/components/Provider/MainstackDesignSystemProvider.js +1 -0
  407. package/dist/components/Provider/index.js +1 -0
  408. package/dist/components/Provider/providerContext.js +1 -0
  409. package/dist/components/Provider/useMainstackDesignSystemTheme.js +1 -0
  410. package/dist/components/Radio/RadioItem.js +1 -0
  411. package/dist/components/Radio/RadioItemIndicator.js +1 -0
  412. package/dist/components/Radio/RadioItemLabel.js +1 -0
  413. package/dist/components/Radio/RadioItemSubtext.js +1 -0
  414. package/dist/components/Radio/RadioItemTitle.js +1 -0
  415. package/dist/components/Radio/RadioRoot.js +1 -0
  416. package/dist/components/Radio/index.js +1 -0
  417. package/dist/components/SearchField/SearchField.js +2 -0
  418. package/dist/components/SearchField/index.js +1 -0
  419. package/dist/components/Select/MultiSelect.js +2 -0
  420. package/dist/components/Select/Select.js +2 -0
  421. package/dist/components/Select/SelectInputField.js +2 -0
  422. package/dist/components/Select/SelectOptionInputPreview.js +2 -0
  423. package/dist/components/Select/SelectOptionItem.js +2 -0
  424. package/dist/components/Select/SelectOptionItemWithCheckbox.js +2 -0
  425. package/dist/components/Select/SelectOptions.js +2 -0
  426. package/dist/components/Select/SelectPortal.js +2 -0
  427. package/dist/components/Select/SelectRoot.js +2 -0
  428. package/dist/components/Select/index.js +1 -0
  429. package/dist/components/Select/selectContext.js +1 -0
  430. package/dist/components/Select/utils.js +1 -0
  431. package/dist/components/Tab/TabsContent.js +1 -0
  432. package/dist/components/Tab/TabsContext.js +1 -0
  433. package/dist/components/Tab/TabsList.js +1 -0
  434. package/dist/components/Tab/TabsRoot.js +1 -0
  435. package/dist/components/Tab/TabsTrigger.js +1 -0
  436. package/dist/components/Tab/index.js +1 -0
  437. package/dist/components/Tab/tabsVariants.js +1 -0
  438. package/dist/components/Tag/Tag.js +1 -0
  439. package/dist/components/Tag/TagIcon.js +1 -0
  440. package/dist/components/Tag/TagLabel.js +1 -0
  441. package/dist/components/Tag/TagRoot.js +1 -0
  442. package/dist/components/Tag/index.js +1 -0
  443. package/dist/components/Tag/tagVariants.js +1 -0
  444. package/dist/components/TextEditor/TextEditorField.js +4 -0
  445. package/dist/components/TextEditor/TextEditorInput.js +2 -0
  446. package/dist/components/TextEditor/TextEditorMenuBar/BoldMenu.js +2 -0
  447. package/dist/components/TextEditor/TextEditorMenuBar/CodeMenu.js +2 -0
  448. package/dist/components/TextEditor/TextEditorMenuBar/ColorPickerMenu.js +2 -0
  449. package/dist/components/TextEditor/TextEditorMenuBar/GenerateWithAiMenu.js +2 -0
  450. package/dist/components/TextEditor/TextEditorMenuBar/ImageUploadMenu.js +2 -0
  451. package/dist/components/TextEditor/TextEditorMenuBar/ItalicMenu.js +2 -0
  452. package/dist/components/TextEditor/TextEditorMenuBar/LinkMenu.js +6 -0
  453. package/dist/components/TextEditor/TextEditorMenuBar/OrderedListMenu.js +2 -0
  454. package/dist/components/TextEditor/TextEditorMenuBar/StrikethroughMenu.js +2 -0
  455. package/dist/components/TextEditor/TextEditorMenuBar/TextAlignMenu.js +2 -0
  456. package/dist/components/TextEditor/TextEditorMenuBar/TextEditorMenuAction.js +2 -0
  457. package/dist/components/TextEditor/TextEditorMenuBar/TextEditorMenuBar.js +2 -0
  458. package/dist/components/TextEditor/TextEditorMenuBar/TextSizesMenu.js +2 -0
  459. package/dist/components/TextEditor/TextEditorMenuBar/UnderlineMenu.js +2 -0
  460. package/dist/components/TextEditor/TextEditorMenuBar/UnorderedListMenu.js +2 -0
  461. package/dist/components/TextEditor/TextEditorRoot.js +42 -0
  462. package/dist/components/TextEditor/index.js +1 -0
  463. package/dist/components/TextEditor/textEditorContext.js +1 -0
  464. package/dist/components/Textarea/Textarea.js +1 -0
  465. package/dist/components/Textarea/TextareaField.js +1 -0
  466. package/dist/components/Textarea/TextareaRoot.js +1 -0
  467. package/dist/components/Textarea/index.js +1 -0
  468. package/dist/components/Tile/TileCheckbox.js +1 -0
  469. package/dist/components/Tile/TileContent.js +1 -0
  470. package/dist/components/Tile/TileDescription.js +1 -0
  471. package/dist/components/Tile/TileHeader.js +1 -0
  472. package/dist/components/Tile/TileMedia.js +3 -0
  473. package/dist/components/Tile/TileRoot.js +2 -0
  474. package/dist/components/Tile/TileTitle.js +1 -0
  475. package/dist/components/Tile/index.js +1 -0
  476. package/dist/components/Tile/tileVariants.js +1 -0
  477. package/dist/components/Toggle/Toggle.js +1 -0
  478. package/dist/components/Toggle/ToggleLabel.js +1 -0
  479. package/dist/components/Toggle/ToggleRoot.js +1 -0
  480. package/dist/components/Toggle/ToggleSubtext.js +1 -0
  481. package/dist/components/Toggle/ToggleSwitch.js +2 -0
  482. package/dist/components/Toggle/ToggleTitle.js +1 -0
  483. package/dist/components/Toggle/index.js +1 -0
  484. package/dist/components/Toggle/toggleVariants.js +1 -0
  485. package/dist/components/Tooltip/TooltipArrow.js +1 -0
  486. package/dist/components/Tooltip/TooltipBody.js +1 -0
  487. package/dist/components/Tooltip/TooltipContent.js +1 -0
  488. package/dist/components/Tooltip/TooltipContext.js +1 -0
  489. package/dist/components/Tooltip/TooltipFooter.js +1 -0
  490. package/dist/components/Tooltip/TooltipHeader.js +1 -0
  491. package/dist/components/Tooltip/TooltipRoot.js +2 -0
  492. package/dist/components/Tooltip/TooltipTitle.js +1 -0
  493. package/dist/components/Tooltip/TooltipTrigger.js +1 -0
  494. package/dist/components/Tooltip/index.js +1 -0
  495. package/dist/components/Tooltip/useTooltipContext.js +1 -0
  496. package/dist/components/Typography/BodyText/BodyText.js +1 -0
  497. package/dist/components/Typography/BodyText/bodyTextVariants.js +1 -0
  498. package/dist/components/Typography/BodyText/index.js +1 -0
  499. package/dist/components/Typography/DisplayText/DisplayText.js +1 -0
  500. package/dist/components/Typography/DisplayText/displayTextVariants.js +1 -0
  501. package/dist/components/Typography/DisplayText/index.js +1 -0
  502. package/dist/components/Typography/HeadlineText/HeadlineText.js +1 -0
  503. package/dist/components/Typography/HeadlineText/headlineTextVariants.js +1 -0
  504. package/dist/components/Typography/HeadlineText/index.js +1 -0
  505. package/dist/en.json-BPy-6DYI.cjs +1 -0
  506. package/dist/en.json-VbJG9vrN.js +263 -0
  507. package/dist/floating-ui.dom-C224prEy.cjs +1 -0
  508. package/dist/floating-ui.dom-CauyjNxS.js +1131 -0
  509. package/dist/fonts/degular/Degular-Black.woff2 +0 -0
  510. package/dist/fonts/degular/Degular-Black_Italic.woff2 +0 -0
  511. package/dist/fonts/degular/Degular-Bold.woff2 +0 -0
  512. package/dist/fonts/degular/Degular-Bold_Italic.woff2 +0 -0
  513. package/dist/fonts/degular/Degular-Italic.woff2 +0 -0
  514. package/dist/fonts/degular/Degular-Light.woff2 +0 -0
  515. package/dist/fonts/degular/Degular-Light_Italic.woff2 +0 -0
  516. package/dist/fonts/degular/Degular-Medium.woff2 +0 -0
  517. package/dist/fonts/degular/Degular-Medium_Italic.woff2 +0 -0
  518. package/dist/fonts/degular/Degular-Regular.woff2 +0 -0
  519. package/dist/fonts/degular/Degular-Semibold.woff2 +0 -0
  520. package/dist/fonts/degular/Degular-Semibold_Italic.woff2 +0 -0
  521. package/dist/fonts/degular/Degular-Thin.woff2 +0 -0
  522. package/dist/fonts/degular/Degular-Thin_Italic.woff2 +0 -0
  523. package/dist/fonts/suisseIntl/SuisseIntl-Black.woff2 +0 -0
  524. package/dist/fonts/suisseIntl/SuisseIntl-BlackIt.woff2 +0 -0
  525. package/dist/fonts/suisseIntl/SuisseIntl-Bold.woff2 +0 -0
  526. package/dist/fonts/suisseIntl/SuisseIntl-BoldIt.woff2 +0 -0
  527. package/dist/fonts/suisseIntl/SuisseIntl-Book.woff2 +0 -0
  528. package/dist/fonts/suisseIntl/SuisseIntl-BookIt.woff2 +0 -0
  529. package/dist/fonts/suisseIntl/SuisseIntl-Medium.woff2 +0 -0
  530. package/dist/fonts/suisseIntl/SuisseIntl-MediumIt.woff2 +0 -0
  531. package/dist/fonts/suisseIntl/SuisseIntl-Regular.woff2 +0 -0
  532. package/dist/fonts/suisseIntl/SuisseIntl-RegularIt.woff2 +0 -0
  533. package/dist/fonts/suisseIntl/SuisseIntl-Semibold.woff2 +0 -0
  534. package/dist/fonts/suisseIntl/SuisseIntl-SemiboldIt.woff2 +0 -0
  535. package/dist/getInternationalPhoneNumberPrefix-C4Qc97tE.cjs +34 -0
  536. package/dist/getInternationalPhoneNumberPrefix-C8O8VTpp.js +4368 -0
  537. package/dist/index-0ioNhtNM.js +10 -0
  538. package/dist/index-437EL2iq.js +52 -0
  539. package/dist/index-5Bhkapwi.js +82 -0
  540. package/dist/index-B0dI0L76.cjs +2 -0
  541. package/dist/index-BGQepRFJ.js +27 -0
  542. package/dist/index-BGfrl8IX.js +71 -0
  543. package/dist/index-BI11g55_.cjs +42 -0
  544. package/dist/index-BRRTyZ1e.js +75 -0
  545. package/dist/index-BZCybroW.cjs +2 -0
  546. package/dist/index-BZPx6jYI.js +8 -0
  547. package/dist/index-B_Bwy8wX.cjs +1 -0
  548. package/dist/index-BbQbyYHN.cjs +2 -0
  549. package/dist/index-BfKbXbc8.cjs +1 -0
  550. package/dist/index-BvWMjxZ5.js +675 -0
  551. package/dist/index-Bx2vBAJ5.cjs +2 -0
  552. package/dist/index-ByaXH_ih.js +10 -0
  553. package/dist/index-C2mPf2xD.cjs +1 -0
  554. package/dist/index-C8aODXfJ.cjs +1 -0
  555. package/dist/index-CAgJYdlN.cjs +1 -0
  556. package/dist/index-CCKe-Mpx.js +6 -0
  557. package/dist/index-CRDKsB5y.cjs +2 -0
  558. package/dist/index-CRdNenpR.js +422 -0
  559. package/dist/index-CajSSBH7.cjs +1 -0
  560. package/dist/index-Cje7xxa1.cjs +1 -0
  561. package/dist/index-CpDnqHCm.js +36 -0
  562. package/dist/index-CsK1LjrZ.cjs +2 -0
  563. package/dist/index-CvknVH0W.js +754 -0
  564. package/dist/index-CwR-dC8j.cjs +2 -0
  565. package/dist/index-CyFz8fal.cjs +131 -0
  566. package/dist/index-CzY-WZXL.cjs +1 -0
  567. package/dist/index-D-KHlZ2P.js +20 -0
  568. package/dist/index-D29mdTf5.js +34 -0
  569. package/dist/index-D9S-9HH_.js +332 -0
  570. package/dist/index-DCXkdCW2.js +227 -0
  571. package/dist/index-DLcgu_3m.js +159 -0
  572. package/dist/index-DVuTCIJE.cjs +2 -0
  573. package/dist/index-DWQmix6e.js +234 -0
  574. package/dist/index-DYxWvftI.cjs +1 -0
  575. package/dist/index-DgIcguCG.cjs +2 -0
  576. package/dist/index-DmeJCEwx.js +181 -0
  577. package/dist/index-Dt3HnaYe.js +48 -0
  578. package/dist/index-Dz5LHXX9.js +145 -0
  579. package/dist/index-MQ0c3ZX_.cjs +1 -0
  580. package/dist/index-ZhUVW4CS.cjs +2 -0
  581. package/dist/index-bSPhqlcX.cjs +1 -0
  582. package/dist/index-fw7dUmQl.js +352 -0
  583. package/dist/index-ojFnBVkh.cjs +2 -0
  584. package/dist/index-q-4o5Ie4.cjs +2 -0
  585. package/dist/index-twi8FX77.js +13814 -0
  586. package/dist/index-xqkGMOJ8.js +13 -0
  587. package/dist/index.d.ts +68 -0
  588. package/dist/index.js +1 -0
  589. package/dist/lib/useElementWidth.js +1 -0
  590. package/dist/lib/utils.js +1 -0
  591. package/dist/types/index.js +1 -0
  592. package/package.json +89 -66
  593. package/build/index.css +0 -6
  594. package/build/index.d.ts +0 -1419
  595. 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
- <MainstackProvider>
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
- import {Colors} from "mainstack-design-system";
738
+ import { Colors } from "mainstack-design-system";
54
739
 
55
- <Text color={Colors.black300}>Hello World</Text>
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
- * Access and Clone this repository
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
- * Make your forked repo the remote upstream (at origin)
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
- * Navigate into the cloned directory and install dependencies with Yarn
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
- * Make a duplicate of the **env** file and update its content accordingly. Most times, this is just fine with no update.
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
- * Run the app in the development mode. Open [http://localhost:\[port\]](http://localhost:%5Bport%5D) to view it in the browser and start developing.
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>