@evolve.ui/core-components 1.0.0 → 1.1.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 (559) hide show
  1. package/Checkbox.d.cts +1 -1
  2. package/Checkbox.d.mts +1 -1
  3. package/{DateInput-B8XQZPTx.d.cts → DateInput-CFxTZu3m.d.mts} +2 -2
  4. package/{DateInput-B8XQZPTx.d.cts.map → DateInput-CFxTZu3m.d.mts.map} +1 -1
  5. package/{DateInput-CfNmywqQ.d.mts → DateInput-DstMICTl.d.cts} +2 -2
  6. package/{DateInput-CfNmywqQ.d.mts.map → DateInput-DstMICTl.d.cts.map} +1 -1
  7. package/{FavoriteButton-CowOPoqo.d.cts → FavoriteButton-BGF-3dze.d.cts} +2 -2
  8. package/{FavoriteButton-BRY8FVpV.d.mts.map → FavoriteButton-BGF-3dze.d.cts.map} +1 -1
  9. package/{FavoriteButton-BRY8FVpV.d.mts → FavoriteButton-BZEGWrRo.d.mts} +2 -2
  10. package/{FavoriteButton-CowOPoqo.d.cts.map → FavoriteButton-BZEGWrRo.d.mts.map} +1 -1
  11. package/Input.d.cts +1 -1
  12. package/Input.d.mts +1 -1
  13. package/Radio.d.cts +1 -1
  14. package/Radio.d.mts +1 -1
  15. package/{TextInput-BhkeQZh4.d.cts → TextInput-B7lqQ1gh.d.cts} +3 -3
  16. package/{TextInput-BhkeQZh4.d.cts.map → TextInput-B7lqQ1gh.d.cts.map} +1 -1
  17. package/{TextInput-CWCeR18b.d.mts → TextInput-CxoT3np_.d.mts} +3 -3
  18. package/{TextInput-CWCeR18b.d.mts.map → TextInput-CxoT3np_.d.mts.map} +1 -1
  19. package/dateInput.d.cts +1 -1
  20. package/dateInput.d.mts +1 -1
  21. package/datePicker.d.cts +1 -1
  22. package/datePicker.d.mts +1 -1
  23. package/evolve-ui.entries.json +556 -0
  24. package/favoriteButton.d.cts +1 -1
  25. package/favoriteButton.d.mts +1 -1
  26. package/featureFlags/hooks.d.cts +1 -1
  27. package/featureFlags/hooks.d.mts +1 -1
  28. package/fileUpload/testUtils/mockFilesAndImages.d.cts +3 -3
  29. package/fileUpload/testUtils/mockFilesAndImages.d.cts.map +1 -1
  30. package/fileUpload/testUtils/mockFilesAndImages.d.mts +3 -3
  31. package/fileUpload/testUtils/mockFilesAndImages.d.mts.map +1 -1
  32. package/fileUpload/testUtils/testUtils.d.cts +1 -1
  33. package/fileUpload/testUtils/testUtils.d.cts.map +1 -1
  34. package/fileUpload/testUtils/testUtils.d.mts +1 -1
  35. package/fileUpload/testUtils/testUtils.d.mts.map +1 -1
  36. package/{index-BVb-FJDo.d.mts → index-BYPklw8m.d.mts} +2 -2
  37. package/{index-BVb-FJDo.d.mts.map → index-BYPklw8m.d.mts.map} +1 -1
  38. package/{index-3V0Y3AU3.d.mts → index-Bvn6svaT.d.cts} +2 -2
  39. package/{index-3V0Y3AU3.d.mts.map → index-Bvn6svaT.d.cts.map} +1 -1
  40. package/{index-Bu7c6X7O.d.mts → index-C2zPeUs9.d.mts} +5 -5
  41. package/{index-Bu7c6X7O.d.mts.map → index-C2zPeUs9.d.mts.map} +1 -1
  42. package/{index-BXz3rMMk.d.cts → index-Cmz2OD6x.d.cts} +2 -2
  43. package/{index-BXz3rMMk.d.cts.map → index-Cmz2OD6x.d.cts.map} +1 -1
  44. package/{index-kchg551L.d.cts → index-DsZAxqnF.d.mts} +2 -2
  45. package/{index-kchg551L.d.cts.map → index-DsZAxqnF.d.mts.map} +1 -1
  46. package/{index-BzN9RaXe.d.cts → index-QtMvgJcp.d.cts} +5 -5
  47. package/{index-BzN9RaXe.d.cts.map → index-QtMvgJcp.d.cts.map} +1 -1
  48. package/{index-dpfLYhgI.d.mts → index-hrztez-b.d.mts} +2 -2
  49. package/{index-DBYqF9Sr.d.cts.map → index-hrztez-b.d.mts.map} +1 -1
  50. package/{index-DBYqF9Sr.d.cts → index-o9dwzLLE.d.cts} +2 -2
  51. package/{index-dpfLYhgI.d.mts.map → index-o9dwzLLE.d.cts.map} +1 -1
  52. package/index.d.cts +7 -7
  53. package/index.d.mts +7 -7
  54. package/package.json +2 -2
  55. package/providers.d.cts +1 -1
  56. package/providers.d.mts +1 -1
  57. package/src/Accordion/Accordion.tsx +233 -0
  58. package/src/AddressDisplay/AddressDisplay.tsx +43 -0
  59. package/src/AddressDisplay/components/addressComponents.tsx +111 -0
  60. package/src/AddressDisplay/components/addressField.tsx +25 -0
  61. package/src/AddressDisplay/components/addressSection.tsx +8 -0
  62. package/src/AddressDisplay/components/getCountryValue.tsx +31 -0
  63. package/src/AddressDisplay/types.ts +26 -0
  64. package/src/AutomatedCarousel/AutomatedCarousel.tsx +163 -0
  65. package/src/AutomatedCarousel/automatedCarousel.types.ts +7 -0
  66. package/src/AutomatedCarousel/components/CarouselProgressBar/CarouselProgressBar.tsx +139 -0
  67. package/src/AutomatedCarousel/components/CarouselProgressBar/components/CarouselProgressBarUnit/CarouselProgressBarUnit.tsx +165 -0
  68. package/src/Badge/Badge.tsx +104 -0
  69. package/src/Badge/Badge.types.ts +58 -0
  70. package/src/Badge/ItemBadge.tsx +97 -0
  71. package/src/Badge/LiveStatusBadge.tsx +93 -0
  72. package/src/BannerNotification/BannerNotification.tsx +157 -0
  73. package/src/BannerNotification/components/BannerNotificationSkeleton.tsx +39 -0
  74. package/src/BannerNotification/components/CalloutIcon/BannerIcon.tsx +48 -0
  75. package/src/BannerNotification/utils/getRandomTooltipId.ts +3 -0
  76. package/src/BottomSheet/BottomSheet.tsx +476 -0
  77. package/src/BottomSheet/components/BottomSheetBackdrop/BottomSheetBackdrop.tsx +47 -0
  78. package/src/BottomSheet/components/BottomSheetContentArea/BottomSheetContentArea.tsx +92 -0
  79. package/src/BottomSheet/components/BottomSheetOverlay/BottomSheetOverlayTranslate3d.tsx +196 -0
  80. package/src/BottomSheet/components/SheetDescription/SheetDescription.tsx +22 -0
  81. package/src/BottomSheet/components/SheetTitle/SheetTitle.tsx +21 -0
  82. package/src/BottomSheet/components/index.tsx +5 -0
  83. package/src/BottomSheet/hooks/index.tsx +13 -0
  84. package/src/BottomSheet/hooks/useAriaHider.tsx +91 -0
  85. package/src/BottomSheet/hooks/useBottomSheetServices.tsx +224 -0
  86. package/src/BottomSheet/hooks/useDragHandler.tsx +282 -0
  87. package/src/BottomSheet/hooks/useFocusTrap.tsx +113 -0
  88. package/src/BottomSheet/hooks/useLayoutEffect.tsx +4 -0
  89. package/src/BottomSheet/hooks/useOptimizedResizeObserver.tsx +94 -0
  90. package/src/BottomSheet/hooks/useOptimizedScrollState.tsx +87 -0
  91. package/src/BottomSheet/hooks/useReady.tsx +34 -0
  92. package/src/BottomSheet/hooks/useReducedMotion.tsx +22 -0
  93. package/src/BottomSheet/hooks/useScrollLock.tsx +143 -0
  94. package/src/BottomSheet/hooks/useSnapPoints.tsx +355 -0
  95. package/src/BottomSheet/hooks/useSpring.tsx +47 -0
  96. package/src/BottomSheet/hooks/useSpringInterpolationsTranslate3d.tsx +101 -0
  97. package/src/BottomSheet/index.tsx +237 -0
  98. package/src/BottomSheet/state/atoms.ts +147 -0
  99. package/src/BottomSheet/state/useBottomSheetStateMachine.ts +246 -0
  100. package/src/BottomSheet/types.ts +172 -0
  101. package/src/BottomSheet/utils.ts +65 -0
  102. package/src/Breadcrumbs/Breadcrumbs.tsx +126 -0
  103. package/src/Button/Button.tsx +164 -0
  104. package/src/Button/Button.types.ts +80 -0
  105. package/src/Button/buttonColorClasses.ts +53 -0
  106. package/src/Callout/Callout.tsx +136 -0
  107. package/src/Callout/Callout.types.ts +29 -0
  108. package/src/Callout/components/CalloutIcon/CalloutIcon.tsx +56 -0
  109. package/src/Card/CardGrid.tsx +263 -0
  110. package/src/Card/SingleCard.tsx +22 -0
  111. package/src/Card/cardFactory.tsx +176 -0
  112. package/src/Card/components/createBadge.tsx +34 -0
  113. package/src/Card/components/createFavoriteButton.tsx +40 -0
  114. package/src/Card/components/createImage.tsx +64 -0
  115. package/src/Card/components/createInfo.tsx +84 -0
  116. package/src/Card/components/createName.tsx +63 -0
  117. package/src/Card/components/createPriceStatus.tsx +100 -0
  118. package/src/Card/components/types.ts +4 -0
  119. package/src/Card/hooks/useCardVisibilityTracking.ts +82 -0
  120. package/src/Card/sharedProps.ts +12 -0
  121. package/src/Card/types.ts +62 -0
  122. package/src/Carousel/Carousel.tsx +513 -0
  123. package/src/Carousel/Carousel.types.ts +43 -0
  124. package/src/Carousel/Carousel.utils.ts +63 -0
  125. package/src/Carousel/components/DotButton/DotButton.tsx +42 -0
  126. package/src/Carousel/components/NavigationButtons/NavigationButtons.tsx +77 -0
  127. package/src/Carousel/components/TitleSection/TitleSection.tsx +61 -0
  128. package/src/Carousel/components/TitleSection/components/SubHeaderLeft/SubHeaderLeft.tsx +53 -0
  129. package/src/Carousel/components/TitleSection/components/Title/Title.tsx +46 -0
  130. package/src/Carousel/index.ts +2 -0
  131. package/src/Carousel/testUtils.ts +10 -0
  132. package/src/Chips/Chip.tsx +153 -0
  133. package/src/Chips/ChipGroup.tsx +173 -0
  134. package/src/Chips/SuggestionChip.tsx +15 -0
  135. package/src/Chips/chipTypes.ts +113 -0
  136. package/src/Chips/index.ts +4 -0
  137. package/src/ChoiceListItem/Checkbox.tsx +69 -0
  138. package/src/ChoiceListItem/Radio.tsx +61 -0
  139. package/src/ChoiceListItem/choiceListItem.tsx +99 -0
  140. package/src/ChoiceListItem/common.tsx +148 -0
  141. package/src/ChoiceListItem/index.ts +3 -0
  142. package/src/Collapsible/Collapsible.tsx +58 -0
  143. package/src/Confetti/Confetti.tsx +270 -0
  144. package/src/Confetti/index.ts +2 -0
  145. package/src/ContentPager/ContentPager.tsx +189 -0
  146. package/src/ContentPager/components/Page.tsx +24 -0
  147. package/src/CookieConsent/components/CookieCategoryRow/CookieCategoryRow.tsx +30 -0
  148. package/src/CookieConsent/components/CookieConsent/CookieConsent.tsx +74 -0
  149. package/src/CookieConsent/components/CookieConsentBanner/CookieConsentBanner.tsx +51 -0
  150. package/src/CookieConsent/components/CookieConsentModal/CookieConsentModal.tsx +64 -0
  151. package/src/CookieConsent/hooks/useCookieConsent.ts +170 -0
  152. package/src/CookieConsent/hooks/useCookieConsentState.ts +142 -0
  153. package/src/CookieConsent/index.ts +16 -0
  154. package/src/CookieConsent/types/cookieConsent.types.ts +79 -0
  155. package/src/CookieConsent/types/index.ts +7 -0
  156. package/src/Countdown/Countdown.tsx +161 -0
  157. package/src/Countdown/Countdown.types.ts +4 -0
  158. package/src/Countdown/hooks/useGetCountdown.ts +103 -0
  159. package/src/DateTimeInput/dateInput/DateInput.tsx +199 -0
  160. package/src/DateTimeInput/datePicker/DatePicker.tsx +138 -0
  161. package/src/DateTimeInput/datePicker/components/calendar/Calendar.tsx +72 -0
  162. package/src/DateTimeInput/datePicker/index.ts +2 -0
  163. package/src/DateTimeInput/timeInput/TimeInput.tsx +128 -0
  164. package/src/DateTimeInput/timePicker/TimePicker.tsx +118 -0
  165. package/src/DateTimeInput/timePicker/components/TimePopover/AmPmSwitch.tsx +103 -0
  166. package/src/DateTimeInput/timePicker/components/TimePopover/TimeFieldInput.tsx +26 -0
  167. package/src/DateTimeInput/timePicker/components/TimePopover/TimePopover.tsx +84 -0
  168. package/src/DateTimeInput/timePicker/components/TimePopover/TimePopover.utils.ts +67 -0
  169. package/src/DateTimeInput/timePicker/components/TimePopover/TimePopoverActions.tsx +26 -0
  170. package/src/DateTimeInput/timePicker/index.ts +2 -0
  171. package/src/DateTimeInput/utils/getDisplayDate.ts +15 -0
  172. package/src/DateTimeInput/utils/getDisplayTime.ts +15 -0
  173. package/src/DateTimeInput/utils/index.ts +2 -0
  174. package/src/DateTimeInput/utils/parseTimeValue.ts +54 -0
  175. package/src/Drawer/Drawer.tsx +446 -0
  176. package/src/Drawer/atoms.ts +4 -0
  177. package/src/Drawer/components/DialogActions/DialogActions.tsx +33 -0
  178. package/src/Drawer/components/DialogContent/DialogContent.tsx +80 -0
  179. package/src/Drawer/components/DialogHeader/DialogHeader.tsx +68 -0
  180. package/src/EducationalPopover/EducationalPopover.tsx +174 -0
  181. package/src/FavoriteButton/FavoriteButton.tsx +64 -0
  182. package/src/FavoriteButton/components/IconOnlyFavoriteButton/IconOnlyFavoriteButton.tsx +80 -0
  183. package/src/FavoriteButton/components/LabeledAnimatedFavoriteButton/LabeledAnimatedFavoriteButton.tsx +179 -0
  184. package/src/FavoriteButton/components/LabeledFavoriteButton/LabeledFavoriteButton.tsx +71 -0
  185. package/src/FavoriteButton/components/SmallHeartStraightIcon/SmallHeartStraightIcon.tsx +14 -0
  186. package/src/FavoriteButton/hooks/useFavoriteButtonState.ts +30 -0
  187. package/src/FavoriteButton/index.ts +2 -0
  188. package/src/FavoriteButton/types/favoriteButton.ts +87 -0
  189. package/src/FeatureFlags/devTools/FeatureFlagDevToolsUI.tsx +226 -0
  190. package/src/FeatureFlags/devTools/getFeatureFlagCookieOverrides.ts +30 -0
  191. package/src/FeatureFlags/devTools/utils/cookies.ts +169 -0
  192. package/src/FeatureFlags/hooks/index.ts +2 -0
  193. package/src/FeatureFlags/hooks/useFeatureFlag.tsx +19 -0
  194. package/src/FeatureFlags/hooks/useFeatureFlags.tsx +15 -0
  195. package/src/FileUpload/components/FileCard/FileCard.tsx +50 -0
  196. package/src/FileUpload/components/FileDropzone/FileDropzone.tsx +221 -0
  197. package/src/FileUpload/components/FileDropzone/components/DropzoneContent/DropzoneContent.tsx +28 -0
  198. package/src/FileUpload/components/FileDropzone/components/DropzoneContent/DropzoneText.tsx +81 -0
  199. package/src/FileUpload/components/FileDropzone/components/FileDropzoneDebugger/FileDropzoneDebugger.tsx +40 -0
  200. package/src/FileUpload/components/FileDropzone/components/FileDropzoneDebugger/FileRejectionsDisplay.tsx +110 -0
  201. package/src/FileUpload/components/FileDropzoneOverlay/FileDropzoneOverlay.tsx +183 -0
  202. package/src/FileUpload/components/FileDropzoneOverlay/components/OverlayDropzoneContent.tsx +146 -0
  203. package/src/FileUpload/components/FileDropzoneOverlay/components/OverlayDropzoneDragText.tsx +42 -0
  204. package/src/FileUpload/components/FileDropzoneOverlay/styles.ts +79 -0
  205. package/src/FileUpload/components/FilePreviewList/FilePreviewList.tsx +251 -0
  206. package/src/FileUpload/components/FilePreviewList/virtualizerComponents/FilePreviewVirtualizedList/FilePreviewVirtualizedList.tsx +88 -0
  207. package/src/FileUpload/components/FileUpload/FileUpload.tsx +63 -0
  208. package/src/FileUpload/components/FileUploadCanvas/FileUploadCanvas.tsx +125 -0
  209. package/src/FileUpload/components/GridFileCard/GridFileCard.tsx +364 -0
  210. package/src/FileUpload/components/GridFileCard/utils/sortable.ts +48 -0
  211. package/src/FileUpload/components/ListFileCard/ListFileCard.tsx +259 -0
  212. package/src/FileUpload/components/types.ts +78 -0
  213. package/src/FileUpload/hooks/filePreview/useImageFilePreviewUrl.ts +62 -0
  214. package/src/FileUpload/hooks/index.ts +11 -0
  215. package/src/FileUpload/hooks/upload/useHandleDragEnter/useHandleDragEnter.ts +154 -0
  216. package/src/FileUpload/hooks/upload/useHandleDrop/createFileRejectionHelpers.ts +273 -0
  217. package/src/FileUpload/hooks/upload/useHandleDrop/useHandleDrop.ts +153 -0
  218. package/src/FileUpload/hooks/upload/useUploadAvailability/useUploadAvailability.ts +44 -0
  219. package/src/FileUpload/hooks/validation/createDropzoneValidator.ts +41 -0
  220. package/src/FileUpload/hooks/validation/useFileValidation.ts +25 -0
  221. package/src/FileUpload/hooks/validation/useFileValidationLogic.ts +107 -0
  222. package/src/FileUpload/hooks/validation/useValidationMessages.ts +92 -0
  223. package/src/FileUpload/hooks/validation/useValidationState.ts +171 -0
  224. package/src/FileUpload/index.ts +57 -0
  225. package/src/FileUpload/providers/FileUploadProvider.tsx +219 -0
  226. package/src/FileUpload/providers/UploadValidationProvider.tsx +159 -0
  227. package/src/FileUpload/testUtils/mockFilesAndImages.ts +64 -0
  228. package/src/FileUpload/testUtils/testUtils.ts +111 -0
  229. package/src/FileUpload/types/commonTypes.ts +267 -0
  230. package/src/FileUpload/types/index.ts +31 -0
  231. package/src/FileUpload/types/sharedTypes.ts +159 -0
  232. package/src/FileUpload/utils/constants.ts +79 -0
  233. package/src/FileUpload/utils/createMessageContext.ts +180 -0
  234. package/src/FileUpload/utils/getFileExtensionsFromAcceptedTypes.ts +73 -0
  235. package/src/FileUpload/utils/getFilePluralizationText.ts +68 -0
  236. package/src/FileUpload/utils/getMimeTypes.ts +26 -0
  237. package/src/FileUpload/utils/messageUtils.ts +41 -0
  238. package/src/FileUpload/utils/styles.ts +68 -0
  239. package/src/FormLabel/FormLabel.tsx +212 -0
  240. package/src/IconButton/IconButton.tsx +154 -0
  241. package/src/Icons/CreditCardIcon/CreditCardIcon.tsx +73 -0
  242. package/src/Icons/CreditCardIcon/cardIcons.tsx +270 -0
  243. package/src/Icons/IconBase.tsx +133 -0
  244. package/src/Icons/anyIcon.ts +3 -0
  245. package/src/Icons/generatedIcons/Archive.tsx +48 -0
  246. package/src/Icons/generatedIcons/ArrowClockwise.tsx +48 -0
  247. package/src/Icons/generatedIcons/ArrowDown.tsx +48 -0
  248. package/src/Icons/generatedIcons/ArrowLeft.tsx +48 -0
  249. package/src/Icons/generatedIcons/ArrowRight.tsx +48 -0
  250. package/src/Icons/generatedIcons/ArrowSquareOut.tsx +51 -0
  251. package/src/Icons/generatedIcons/ArrowSquareRight.tsx +51 -0
  252. package/src/Icons/generatedIcons/ArrowUp.tsx +48 -0
  253. package/src/Icons/generatedIcons/ArrowsCounterClockwise.tsx +48 -0
  254. package/src/Icons/generatedIcons/ArrowsLeftRight.tsx +48 -0
  255. package/src/Icons/generatedIcons/ArrowsOutCardinal.tsx +48 -0
  256. package/src/Icons/generatedIcons/Bank.tsx +48 -0
  257. package/src/Icons/generatedIcons/Bell.tsx +51 -0
  258. package/src/Icons/generatedIcons/BookBookmark.tsx +51 -0
  259. package/src/Icons/generatedIcons/BookmarksSimple.tsx +51 -0
  260. package/src/Icons/generatedIcons/Broadcast.tsx +48 -0
  261. package/src/Icons/generatedIcons/CalendarBlank.tsx +48 -0
  262. package/src/Icons/generatedIcons/CalendarStar.tsx +51 -0
  263. package/src/Icons/generatedIcons/Camera.tsx +51 -0
  264. package/src/Icons/generatedIcons/CaretDown.tsx +48 -0
  265. package/src/Icons/generatedIcons/CaretLeft.tsx +48 -0
  266. package/src/Icons/generatedIcons/CaretRight.tsx +48 -0
  267. package/src/Icons/generatedIcons/CaretUp.tsx +48 -0
  268. package/src/Icons/generatedIcons/Certificate.tsx +51 -0
  269. package/src/Icons/generatedIcons/ChartBar.tsx +48 -0
  270. package/src/Icons/generatedIcons/Check.tsx +51 -0
  271. package/src/Icons/generatedIcons/CheckCircle.tsx +48 -0
  272. package/src/Icons/generatedIcons/CirclesFour.tsx +51 -0
  273. package/src/Icons/generatedIcons/Clock.tsx +48 -0
  274. package/src/Icons/generatedIcons/ClockCountdown.tsx +48 -0
  275. package/src/Icons/generatedIcons/Close.tsx +51 -0
  276. package/src/Icons/generatedIcons/CloudArrowUp.tsx +51 -0
  277. package/src/Icons/generatedIcons/CloudWarning.tsx +51 -0
  278. package/src/Icons/generatedIcons/Code.tsx +48 -0
  279. package/src/Icons/generatedIcons/Compass.tsx +51 -0
  280. package/src/Icons/generatedIcons/Confetti.tsx +51 -0
  281. package/src/Icons/generatedIcons/Copy.tsx +48 -0
  282. package/src/Icons/generatedIcons/CornersOut.tsx +48 -0
  283. package/src/Icons/generatedIcons/CreditCard.tsx +48 -0
  284. package/src/Icons/generatedIcons/Crown.tsx +51 -0
  285. package/src/Icons/generatedIcons/CrownSimple.tsx +51 -0
  286. package/src/Icons/generatedIcons/CurrencyCircleDollar.tsx +48 -0
  287. package/src/Icons/generatedIcons/CurrencyDollarSimple.tsx +51 -0
  288. package/src/Icons/generatedIcons/Desktop.tsx +51 -0
  289. package/src/Icons/generatedIcons/Detective.tsx +51 -0
  290. package/src/Icons/generatedIcons/DotOutline.tsx +46 -0
  291. package/src/Icons/generatedIcons/DotsSixVertical.tsx +51 -0
  292. package/src/Icons/generatedIcons/DotsThreeOutline.tsx +51 -0
  293. package/src/Icons/generatedIcons/DotsThreeOutlineVertical.tsx +51 -0
  294. package/src/Icons/generatedIcons/DownloadSimple.tsx +51 -0
  295. package/src/Icons/generatedIcons/EnvelopeSimple.tsx +48 -0
  296. package/src/Icons/generatedIcons/Eraser.tsx +51 -0
  297. package/src/Icons/generatedIcons/Eye.tsx +51 -0
  298. package/src/Icons/generatedIcons/EyeSlash.tsx +51 -0
  299. package/src/Icons/generatedIcons/FacebookLogo.tsx +48 -0
  300. package/src/Icons/generatedIcons/FileArchive.tsx +48 -0
  301. package/src/Icons/generatedIcons/FileArrowDown.tsx +48 -0
  302. package/src/Icons/generatedIcons/FileCsv.tsx +48 -0
  303. package/src/Icons/generatedIcons/FilePdf.tsx +48 -0
  304. package/src/Icons/generatedIcons/FileText.tsx +48 -0
  305. package/src/Icons/generatedIcons/Files.tsx +51 -0
  306. package/src/Icons/generatedIcons/Fire.tsx +51 -0
  307. package/src/Icons/generatedIcons/Flag.tsx +51 -0
  308. package/src/Icons/generatedIcons/FlagBannerFold.tsx +48 -0
  309. package/src/Icons/generatedIcons/FloppyDisk.tsx +51 -0
  310. package/src/Icons/generatedIcons/Gauge.tsx +51 -0
  311. package/src/Icons/generatedIcons/Gavel.tsx +51 -0
  312. package/src/Icons/generatedIcons/Gear.tsx +51 -0
  313. package/src/Icons/generatedIcons/GlobeHemisphereWest.tsx +51 -0
  314. package/src/Icons/generatedIcons/GoogleLogo.tsx +48 -0
  315. package/src/Icons/generatedIcons/GridNine.tsx +51 -0
  316. package/src/Icons/generatedIcons/HandCoins.tsx +51 -0
  317. package/src/Icons/generatedIcons/HandbagSimple.tsx +51 -0
  318. package/src/Icons/generatedIcons/Headset.tsx +51 -0
  319. package/src/Icons/generatedIcons/HeartStraight.tsx +51 -0
  320. package/src/Icons/generatedIcons/HourglassLow.tsx +48 -0
  321. package/src/Icons/generatedIcons/House.tsx +51 -0
  322. package/src/Icons/generatedIcons/Image.tsx +51 -0
  323. package/src/Icons/generatedIcons/ImageSquare.tsx +51 -0
  324. package/src/Icons/generatedIcons/ImagesSquare.tsx +51 -0
  325. package/src/Icons/generatedIcons/Info.tsx +48 -0
  326. package/src/Icons/generatedIcons/InstagramLogo.tsx +51 -0
  327. package/src/Icons/generatedIcons/Lightning.tsx +48 -0
  328. package/src/Icons/generatedIcons/Link.tsx +51 -0
  329. package/src/Icons/generatedIcons/LinkedinLogo.tsx +51 -0
  330. package/src/Icons/generatedIcons/List.tsx +48 -0
  331. package/src/Icons/generatedIcons/Lock.tsx +51 -0
  332. package/src/Icons/generatedIcons/LockOpen.tsx +51 -0
  333. package/src/Icons/generatedIcons/MagnifyingGlass.tsx +48 -0
  334. package/src/Icons/generatedIcons/MapPin.tsx +51 -0
  335. package/src/Icons/generatedIcons/MapPinSimpleArea.tsx +48 -0
  336. package/src/Icons/generatedIcons/Medal.tsx +48 -0
  337. package/src/Icons/generatedIcons/Megaphone.tsx +48 -0
  338. package/src/Icons/generatedIcons/Minus.tsx +45 -0
  339. package/src/Icons/generatedIcons/Money.tsx +51 -0
  340. package/src/Icons/generatedIcons/Notches.tsx +48 -0
  341. package/src/Icons/generatedIcons/NotePencil.tsx +48 -0
  342. package/src/Icons/generatedIcons/Package.tsx +51 -0
  343. package/src/Icons/generatedIcons/PaintBrush.tsx +51 -0
  344. package/src/Icons/generatedIcons/PaperPlaneTilt.tsx +51 -0
  345. package/src/Icons/generatedIcons/Paperclip.tsx +51 -0
  346. package/src/Icons/generatedIcons/Pause.tsx +51 -0
  347. package/src/Icons/generatedIcons/PencilLine.tsx +51 -0
  348. package/src/Icons/generatedIcons/PencilRuler.tsx +51 -0
  349. package/src/Icons/generatedIcons/PencilSimple.tsx +51 -0
  350. package/src/Icons/generatedIcons/Phone.tsx +51 -0
  351. package/src/Icons/generatedIcons/PinterestLogo.tsx +51 -0
  352. package/src/Icons/generatedIcons/Play.tsx +51 -0
  353. package/src/Icons/generatedIcons/Plus.tsx +51 -0
  354. package/src/Icons/generatedIcons/PlusCircle.tsx +48 -0
  355. package/src/Icons/generatedIcons/Printer.tsx +51 -0
  356. package/src/Icons/generatedIcons/Question.tsx +48 -0
  357. package/src/Icons/generatedIcons/Receipt.tsx +51 -0
  358. package/src/Icons/generatedIcons/Rows.tsx +51 -0
  359. package/src/Icons/generatedIcons/SealCheck.tsx +51 -0
  360. package/src/Icons/generatedIcons/SelectionSlash.tsx +48 -0
  361. package/src/Icons/generatedIcons/ShareNetwork.tsx +51 -0
  362. package/src/Icons/generatedIcons/ShieldCheck.tsx +51 -0
  363. package/src/Icons/generatedIcons/ShieldStar.tsx +51 -0
  364. package/src/Icons/generatedIcons/ShoppingCart.tsx +48 -0
  365. package/src/Icons/generatedIcons/ShuffleAngular.tsx +48 -0
  366. package/src/Icons/generatedIcons/SidebarSimple.tsx +48 -0
  367. package/src/Icons/generatedIcons/SlidersHorizontal.tsx +51 -0
  368. package/src/Icons/generatedIcons/Smiley.tsx +48 -0
  369. package/src/Icons/generatedIcons/Sparkle.tsx +51 -0
  370. package/src/Icons/generatedIcons/SpinnerGap.tsx +48 -0
  371. package/src/Icons/generatedIcons/StackPlus.tsx +48 -0
  372. package/src/Icons/generatedIcons/Star.tsx +51 -0
  373. package/src/Icons/generatedIcons/Storefront.tsx +51 -0
  374. package/src/Icons/generatedIcons/Swap.tsx +51 -0
  375. package/src/Icons/generatedIcons/Tag.tsx +51 -0
  376. package/src/Icons/generatedIcons/ThumbsDown.tsx +48 -0
  377. package/src/Icons/generatedIcons/ThumbsUp.tsx +48 -0
  378. package/src/Icons/generatedIcons/Toolbox.tsx +48 -0
  379. package/src/Icons/generatedIcons/Trash.tsx +48 -0
  380. package/src/Icons/generatedIcons/TrendUp.tsx +48 -0
  381. package/src/Icons/generatedIcons/Trophy.tsx +51 -0
  382. package/src/Icons/generatedIcons/Truck.tsx +51 -0
  383. package/src/Icons/generatedIcons/UploadSimple.tsx +51 -0
  384. package/src/Icons/generatedIcons/User.tsx +48 -0
  385. package/src/Icons/generatedIcons/Users.tsx +48 -0
  386. package/src/Icons/generatedIcons/UsersThree.tsx +51 -0
  387. package/src/Icons/generatedIcons/VideoCamera.tsx +51 -0
  388. package/src/Icons/generatedIcons/Warning.tsx +51 -0
  389. package/src/Icons/generatedIcons/WarningCircle.tsx +48 -0
  390. package/src/Icons/generatedIcons/WifiHigh.tsx +51 -0
  391. package/src/Icons/generatedIcons/XCircle.tsx +48 -0
  392. package/src/Icons/generatedIcons/XLogo.tsx +48 -0
  393. package/src/Icons/generatedIcons/YoutubeLogo.tsx +51 -0
  394. package/src/Icons/importedIcons.ts +152 -0
  395. package/src/Icons/index.ts +149 -0
  396. package/src/Icons/socialIcons/appleSocialIcon.tsx +50 -0
  397. package/src/Icons/socialIcons/facebookSocialIcon.tsx +41 -0
  398. package/src/Icons/socialIcons/googleSocialIcon.tsx +134 -0
  399. package/src/ImageCluster/ImageCluster.tsx +125 -0
  400. package/src/ImageSlider/ImageSlider.tsx +582 -0
  401. package/src/ImageSlider/ImageSlider.types.ts +90 -0
  402. package/src/ImageSlider/components/IndexIndicator/IndexIndicator.tsx +21 -0
  403. package/src/ImageSlider/components/NavigationButtons/NavigationButtons.tsx +113 -0
  404. package/src/ImageSlider/components/ResponsiveImage/ResponsiveImage.tsx +114 -0
  405. package/src/ImageSlider/components/ResponsiveImage/index.ts +1 -0
  406. package/src/ImageSlider/components/Thumbnails/Thumbnails.tsx +184 -0
  407. package/src/ImageSlider/constants.ts +59 -0
  408. package/src/ImageSlider/hooks/index.ts +3 -0
  409. package/src/ImageSlider/hooks/useImageSlider.ts +57 -0
  410. package/src/ImageSlider/hooks/useImageSliderNavigation.ts +133 -0
  411. package/src/ImageSlider/hooks/useImageSliderScrollHandler.ts +171 -0
  412. package/src/ImageSlider/index.ts +3 -0
  413. package/src/ImageSlider/utils/imageOptimization.ts +97 -0
  414. package/src/ImageSlider/utils/index.ts +1 -0
  415. package/src/InlineNotification/InlineNotification.tsx +95 -0
  416. package/src/JumpMenu/JumpMenu.tsx +395 -0
  417. package/src/JumpMenu/components/JumpMenuItem/JumpMenuItem.tsx +62 -0
  418. package/src/JumpMenu/hooks/useContainerTracking.ts +171 -0
  419. package/src/JumpMenu/hooks/useIntersectionObserver.ts +77 -0
  420. package/src/JumpMenu/hooks/useKeyboardNavigation.ts +102 -0
  421. package/src/JumpMenu/hooks/useResizeObserver.ts +53 -0
  422. package/src/JumpMenu/hooks/useSectionObserver.ts +102 -0
  423. package/src/JumpMenu/index.ts +2 -0
  424. package/src/JumpMenu/types/index.ts +19 -0
  425. package/src/Loading/Loading.tsx +39 -0
  426. package/src/Loading/components/LoadingDot/LoadingDot.tsx +16 -0
  427. package/src/LoadingSpinner/LoadingSpinner.tsx +20 -0
  428. package/src/Menu/Menu.tsx +372 -0
  429. package/src/Menu/components/MenuDivider/MenuDivider.tsx +5 -0
  430. package/src/Menu/components/MenuItem/MenuItem.tsx +298 -0
  431. package/src/Menu/context/menuContext.tsx +20 -0
  432. package/src/Menu/hooks/useMenu.tsx +18 -0
  433. package/src/Menu/index.ts +3 -0
  434. package/src/Modal/ComposableModal.tsx +313 -0
  435. package/src/Modal/Modal.tsx +231 -0
  436. package/src/Modal/components/BackButton/BackButton.tsx +43 -0
  437. package/src/Modal/components/Backdrop/Backdrop.tsx +62 -0
  438. package/src/Modal/components/CloseButton/CloseButton.tsx +55 -0
  439. package/src/Modal/components/ModalActions/ModalActions.tsx +135 -0
  440. package/src/Modal/components/ModalContent/ModalContent.tsx +163 -0
  441. package/src/Modal/components/ModalHeader/ModalHeader.tsx +84 -0
  442. package/src/Modal/components/ModalHeader/hooks/useHeaderAnimation.tsx +49 -0
  443. package/src/Modal/components/ModalProgressSteps/ModalProgressSteps.tsx +26 -0
  444. package/src/Modal/components/ModalSubTitle/ModalSubTitle.tsx +29 -0
  445. package/src/Modal/components/ModalTitle/ModalTitle.tsx +22 -0
  446. package/src/Modal/components/PreventModalScroll/PreventModalScroll.tsx +106 -0
  447. package/src/Modal/components/index.ts +12 -0
  448. package/src/Modal/context.ts +33 -0
  449. package/src/Modal/hooks/useCloseModal.ts +133 -0
  450. package/src/NotificationBadge/NotificationBadge.tsx +34 -0
  451. package/src/Pagination/AdvancedPagination.tsx +48 -0
  452. package/src/Pagination/Pagination.tsx +216 -0
  453. package/src/Pagination/components/AdvancedPaginator/AdvancedPaginator.tsx +52 -0
  454. package/src/Pagination/components/AdvancedPaginator/components/PageSelect/PageSelect.tsx +43 -0
  455. package/src/Pagination/components/ItemCountDisplay/ItemCountDisplay.tsx +32 -0
  456. package/src/Pagination/components/ItemCountSelect/ItemCountSelect.tsx +33 -0
  457. package/src/Pagination/index.tsx +3 -0
  458. package/src/Pagination/paginationProvider.tsx +234 -0
  459. package/src/Pagination/utils.tsx +36 -0
  460. package/src/PhoneInput/PhoneInput.tsx +509 -0
  461. package/src/PhoneInput/useDropdownLogic.tsx +163 -0
  462. package/src/ProgressCircle/ProgressCircle.tsx +246 -0
  463. package/src/ProgressCircle/hooks/useProgressStatusTransitions.ts +49 -0
  464. package/src/ProgressCircle/utils/progressCircle.constants.ts +27 -0
  465. package/src/ProgressSteps/ProgressSteps.tsx +160 -0
  466. package/src/SaveConfetti/SaveConfetti.tsx +277 -0
  467. package/src/SaveConfetti/index.ts +2 -0
  468. package/src/SearchInput/SearchInput.tsx +236 -0
  469. package/src/SegmentedControl/SegmentedControl.tsx +111 -0
  470. package/src/SegmentedControl/SegmentedControlGroup.tsx +94 -0
  471. package/src/SegmentedControl/index.ts +4 -0
  472. package/src/Select/Select.tsx +154 -0
  473. package/src/Select/SelectAsync.tsx +13 -0
  474. package/src/Select/SelectAsyncCreatable.tsx +14 -0
  475. package/src/Select/SelectCreatable.tsx +12 -0
  476. package/src/Select/reexportedComponents.tsx +5 -0
  477. package/src/Select/selectComponents.tsx +306 -0
  478. package/src/Skeleton/Skeleton.tsx +13 -0
  479. package/src/SplitButton/SplitButton.tsx +298 -0
  480. package/src/SplitButton/SplitButtonTrigger.tsx +55 -0
  481. package/src/StarRating/StarRating.tsx +165 -0
  482. package/src/StarRating/components/StarComponent/StarComponent.tsx +44 -0
  483. package/src/Table/Table.tsx +474 -0
  484. package/src/Table/components/TableHeader/TableHeader.tsx +166 -0
  485. package/src/Table/components/TablePagination/TablePagination.tsx +18 -0
  486. package/src/Table/components/TablePagination/components/ItemCountDisplay/ItemCountDisplay.tsx +17 -0
  487. package/src/Table/components/TablePagination/components/ItemCountSelect/ItemCountSelect.tsx +31 -0
  488. package/src/Table/components/TablePagination/components/TablePaginator/TablePaginator.tsx +37 -0
  489. package/src/Table/components/TablePagination/components/TablePaginator/components/PageSelect/PageSelect.tsx +32 -0
  490. package/src/Table/components/TableRow/TableRows.tsx +147 -0
  491. package/src/Table/components/TableRow/components/TableRowCell/TableRowCell.tsx +49 -0
  492. package/src/Table/components/TableShadow/TableShadow.tsx +46 -0
  493. package/src/Table/index.ts +2 -0
  494. package/src/Table/sharedState.ts +30 -0
  495. package/src/Table/sharedStyles.ts +1 -0
  496. package/src/Table/types.ts +55 -0
  497. package/src/Tabs/Tabs.tsx +358 -0
  498. package/src/TextArea/TextArea.tsx +157 -0
  499. package/src/TextInput/TextInput.tsx +173 -0
  500. package/src/Toast/Toast.tsx +64 -0
  501. package/src/Toast/components/ToastContainer/ToastContainer.tsx +48 -0
  502. package/src/Toast/index.ts +2 -0
  503. package/src/Toast/types/role.ts +1 -0
  504. package/src/Toast/utils/getIcon.tsx +41 -0
  505. package/src/ToggleSwitch/ToggleSwitch.tsx +188 -0
  506. package/src/Tooltip/InfoIconTooltip.tsx +47 -0
  507. package/src/Tooltip/Tooltip.tsx +41 -0
  508. package/src/Typography/InlineButton/InlineButton.tsx +166 -0
  509. package/src/Typography/Links/Links.tsx +113 -0
  510. package/src/Typography/Text/Text.tsx +239 -0
  511. package/src/ViewMore/ViewMore.tsx +226 -0
  512. package/src/WebRTCPlayer/WebRTCPlayer.tsx +325 -0
  513. package/src/WebRTCPlayer/adaptor/NativeWebRTCAdaptor.ts +588 -0
  514. package/src/WebRTCPlayer/hooks/useWebRTCStream.ts +571 -0
  515. package/src/WebRTCPlayer/index.ts +22 -0
  516. package/src/WebRTCPlayer/types.ts +95 -0
  517. package/src/breakpoints/index.tsx +1 -0
  518. package/src/breakpoints/utils.tsx +50 -0
  519. package/src/declarations.d.ts +7 -0
  520. package/src/grid/gridHighlighter.tsx +83 -0
  521. package/src/grid/index.ts +3 -0
  522. package/src/grid/pageGrid.tsx +37 -0
  523. package/src/grid/useSubGridCSS.tsx +214 -0
  524. package/src/hooks/useHorizontalScrollFade.ts +44 -0
  525. package/src/hooks/usePrevious.ts +14 -0
  526. package/src/index.ts +351 -0
  527. package/src/intl/index.ts +4 -0
  528. package/src/intl/utils.ts +67 -0
  529. package/src/mixins/horizontalScrollFadeMixin.ts +56 -0
  530. package/src/mixins/index.ts +18 -0
  531. package/src/mixins/propMixins.ts +389 -0
  532. package/src/providers/createContextProvider.ts +22 -0
  533. package/src/providers/designSystemProvider.tsx +218 -0
  534. package/src/providers/errorBoundaryProvider.tsx +179 -0
  535. package/src/providers/featureFlagProvider.tsx +18 -0
  536. package/src/providers/gridSizeProvider.tsx +23 -0
  537. package/src/providers/index.ts +12 -0
  538. package/src/providers/linkProvider.tsx +32 -0
  539. package/src/providers/normalize.tsx +93 -0
  540. package/src/providers/targets/DatePickerTarget.tsx +10 -0
  541. package/src/providers/targets/ModalTarget.tsx +14 -0
  542. package/src/providers/targets/TimePickerTarget.tsx +10 -0
  543. package/src/providers/themeContext.tsx +24 -0
  544. package/src/providers/windowSizeProvider.tsx +125 -0
  545. package/src/spacing/index.ts +1 -0
  546. package/src/spacing/spacing.ts +11 -0
  547. package/src/utils/countriesWithISOCodes.ts +1419 -0
  548. package/src/utils/dateTimeFormat.ts +257 -0
  549. package/src/utils/effectEventListener.ts +11 -0
  550. package/src/utils/formatFileSize.ts +18 -0
  551. package/src/utils/isClientSide.ts +1 -0
  552. package/src/utils/keepTransition.ts +15 -0
  553. package/src/utils/nodeEnv.ts +9 -0
  554. package/src/utils/smoothScrollTo.ts +47 -0
  555. package/src/utils/utilityTypes.ts +13 -0
  556. package/textInput.d.cts +1 -1
  557. package/textInput.d.mts +1 -1
  558. package/timePicker.d.cts +1 -1
  559. package/timePicker.d.mts +1 -1
@@ -0,0 +1,136 @@
1
+ 'use client';
2
+
3
+ import { cn } from '@evolve.ui/theme-system';
4
+
5
+ import type { CalloutProps, CalloutStatus } from './Callout.types';
6
+
7
+ import { Button } from '../Button/Button';
8
+ import { IconButton } from '../IconButton/IconButton';
9
+ import { Close } from '../Icons';
10
+ import { BodySecondary, H5 } from '../Typography/Text/Text';
11
+ import { CalloutIcon } from './components/CalloutIcon/CalloutIcon';
12
+
13
+ const statusClasses = {
14
+ critical: 'border-border-critical bg-background-critical-light',
15
+ info: 'border-border-info bg-background-info-light',
16
+ success: 'border-border-success bg-background-success-light',
17
+ warning: 'border-border-warning bg-background-warning-light',
18
+ } satisfies Record<CalloutStatus, string>;
19
+
20
+ export const Callout = ({
21
+ badge = undefined,
22
+ className,
23
+ message,
24
+ onClose,
25
+ primaryButton,
26
+ secondaryButton,
27
+ status = 'info',
28
+ title,
29
+ useNonSemanticHTML = false,
30
+ }: CalloutProps) => {
31
+ const hasActions = Boolean(primaryButton) || Boolean(secondaryButton);
32
+ const hasCloseButton = Boolean(onClose) && status !== 'critical';
33
+
34
+ return (
35
+ <div
36
+ className={cn(
37
+ 'grid gap-x-sm rounded-input border p-md',
38
+ 'grid-cols-[min-content_1fr_min-content]',
39
+ hasCloseButton && 'grid-cols-[min-content_1fr_min-content_min-content]',
40
+ 'smMax:grid-cols-[min-content_1fr_min-content]',
41
+ statusClasses[status],
42
+ className
43
+ )}
44
+ data-hui-id="Callout"
45
+ role={status === 'critical' ? 'alert' : undefined}
46
+ >
47
+ {badge ?? <CalloutIcon status={status} />}
48
+
49
+ <div className="flex flex-col justify-center">
50
+ {title &&
51
+ (useNonSemanticHTML ? (
52
+ <span
53
+ className="hui-text-h5 col-start-2 mb-2xs text-text-primary"
54
+ data-testid="callout-title"
55
+ >
56
+ {title}
57
+ </span>
58
+ ) : (
59
+ <H5
60
+ className="col-start-2 mb-2xs"
61
+ data-testid="callout-title"
62
+ >
63
+ {title}
64
+ </H5>
65
+ ))}
66
+
67
+ <BodySecondary className="col-start-2 min-w-0 break-words">{message}</BodySecondary>
68
+
69
+ {hasActions && (
70
+ <div className="col-start-2 mt-sm hidden items-center smMax:flex">
71
+ {primaryButton && (
72
+ <Button
73
+ className="mr-sm"
74
+ onClick={primaryButton.onClick}
75
+ size="sm"
76
+ style={primaryButton.style ?? 'primary'}
77
+ variant={primaryButton.variant ?? 'outlined'}
78
+ >
79
+ {primaryButton.text}
80
+ </Button>
81
+ )}
82
+ {secondaryButton && (
83
+ <Button
84
+ className="mr-sm"
85
+ onClick={secondaryButton.onClick}
86
+ size="sm"
87
+ style={secondaryButton.style ?? 'primary'}
88
+ variant={secondaryButton.variant ?? 'transparent'}
89
+ >
90
+ {secondaryButton.text}
91
+ </Button>
92
+ )}
93
+ </div>
94
+ )}
95
+ </div>
96
+
97
+ {hasActions && (
98
+ <div className="flex h-full items-start gap-sm smMax:hidden">
99
+ {primaryButton && (
100
+ <Button
101
+ data-testid="primary-button"
102
+ onClick={primaryButton.onClick}
103
+ size="sm"
104
+ style={primaryButton.style ?? 'primary'}
105
+ variant={primaryButton.variant ?? 'outlined'}
106
+ >
107
+ {primaryButton.text}
108
+ </Button>
109
+ )}
110
+ {secondaryButton && (
111
+ <Button
112
+ data-testid="secondary-button"
113
+ onClick={secondaryButton.onClick}
114
+ size="sm"
115
+ style={secondaryButton.style ?? 'primary'}
116
+ variant={secondaryButton.variant ?? 'transparent'}
117
+ >
118
+ {secondaryButton.text}
119
+ </Button>
120
+ )}
121
+ </div>
122
+ )}
123
+
124
+ {hasCloseButton && (
125
+ <IconButton
126
+ aria-label="Close"
127
+ icon={Close}
128
+ onClick={onClose}
129
+ size="sm"
130
+ />
131
+ )}
132
+ </div>
133
+ );
134
+ };
135
+
136
+ Callout.displayName = 'Callout';
@@ -0,0 +1,29 @@
1
+ import type { ComponentProps, ReactElement, ReactNode } from 'react';
2
+
3
+ import type { Badge } from '../Badge/Badge';
4
+ import type { ButtonStyle, ButtonVariant } from '../Button/Button.types';
5
+
6
+ export type CalloutStatus = 'info' | 'warning' | 'success' | 'critical';
7
+
8
+ export type CalloutButtonConfig = {
9
+ onClick: () => void;
10
+ style?: ButtonStyle;
11
+ text: string;
12
+ variant?: ButtonVariant;
13
+ };
14
+
15
+ export type CalloutProps = {
16
+ /** Optional Badge component displayed in place of the default status icon. */
17
+ badge?: ReactElement<ComponentProps<typeof Badge>>;
18
+ className?: string;
19
+ message?: string | ReactNode;
20
+ onClose?: () => void;
21
+ primaryButton?: CalloutButtonConfig;
22
+ secondaryButton?: CalloutButtonConfig;
23
+ status: CalloutStatus;
24
+ title?: string;
25
+ /**
26
+ * Renders the title as a span with H5 styling instead of a semantic heading.
27
+ */
28
+ useNonSemanticHTML?: boolean;
29
+ };
@@ -0,0 +1,56 @@
1
+ import type { CalloutStatus } from '../../Callout.types';
2
+
3
+ import { CheckCircle, Info, Warning } from '../../../Icons';
4
+
5
+ type CalloutIconProps = {
6
+ status: CalloutStatus;
7
+ };
8
+
9
+ export const CalloutIcon = ({ status }: CalloutIconProps) => {
10
+ if (status === 'critical') {
11
+ return (
12
+ <div className="col-start-1 row-start-1">
13
+ <Warning
14
+ color="critical"
15
+ size="md"
16
+ style="fill"
17
+ />
18
+ </div>
19
+ );
20
+ }
21
+
22
+ if (status === 'success') {
23
+ return (
24
+ <div className="col-start-1 row-start-1">
25
+ <CheckCircle
26
+ color="success"
27
+ style="fill"
28
+ />
29
+ </div>
30
+ );
31
+ }
32
+
33
+ if (status === 'warning') {
34
+ return (
35
+ <div className="col-start-1 row-start-1">
36
+ <Warning
37
+ color="warning"
38
+ size="md"
39
+ style="fill"
40
+ />
41
+ </div>
42
+ );
43
+ }
44
+
45
+ return (
46
+ <div className="col-start-1 row-start-1">
47
+ <Info
48
+ color="info"
49
+ size="md"
50
+ style="fill"
51
+ />
52
+ </div>
53
+ );
54
+ };
55
+
56
+ CalloutIcon.displayName = 'CalloutIcon';
@@ -0,0 +1,263 @@
1
+ import { cn } from '@evolve.ui/theme-system';
2
+ import { useCallback, useMemo } from 'react';
3
+
4
+ import { nodeEnv } from '../utils/nodeEnv';
5
+ import { useCardVisibilityTracking } from './hooks/useCardVisibilityTracking';
6
+ import { SharedProps } from './sharedProps';
7
+
8
+ type SpacingToken = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
9
+
10
+ type Props<CardData, KeyType extends string | number> = {
11
+ /**
12
+ * The data to pass to the card components.
13
+ */
14
+ cardData: Record<KeyType, CardData>;
15
+ /**
16
+ * Which cards to render. These should all be keys in `cardData`.
17
+ *
18
+ * If this is empty, then `skeletonCardCount` skeleton cards will be rendered (if set).
19
+ */
20
+ cards: KeyType[];
21
+ className?: string;
22
+ /**
23
+ * The number of columns to display at each breakpoint.
24
+ *
25
+ * @default { xs: 2, sm: 3, md: 4, lg: 4, xl: 4 }
26
+ */
27
+ colsByBreakpoint: { xs: number } & { [key in 'sm' | 'md' | 'lg' | 'xl']?: number };
28
+ /**
29
+ * The gap between cards at each breakpoint.
30
+ * gapsByBreakpoint: { xs: 'xs' } means that the gap at xsMax breakpoint is 8px.
31
+ *
32
+ * @default { xs: 'sm', sm: 'sm', md: 'md', lg: 'md', xl: 'md' }
33
+ */
34
+ gapsByBreakpoint: {
35
+ // lgMax: { max: '1644px' },
36
+ lg?: SpacingToken;
37
+ // mdMax: { max: '1248px' },
38
+ md?: SpacingToken;
39
+ // smMax: { max: '1023px' },
40
+ sm?: SpacingToken;
41
+ // lgMin: { min: '1249px' },
42
+ xl?: SpacingToken;
43
+ // xsMax: { max: '768px' },
44
+ xs?: SpacingToken;
45
+ };
46
+ /**
47
+ * Optional callback function to call when a card is clicked.
48
+ * The card data is passed to the function.
49
+ * Note: This should be handled by specific clickable elements within the card (links, buttons)
50
+ * rather than the card wrapper itself.
51
+ */
52
+ onCardClick?: (cardData: CardData) => void;
53
+ /**
54
+ * The function to call when a card becomes visible in the viewport.
55
+ * This callback fires only once per card when it first becomes visible.
56
+ * The card data is passed to the function.
57
+ */
58
+ onCardVisible?: (cardData: CardData) => void;
59
+ /**
60
+ * The number of skeleton cards to render.
61
+ *
62
+ * This is ignored if `cards` is nonempty.
63
+ */
64
+ skeletonCardCount?: number;
65
+ } & SharedProps<CardData>;
66
+
67
+ export const CardGrid = <CardData, KeyType extends string | number>({
68
+ card: Card,
69
+ cardData,
70
+ cards,
71
+ className,
72
+ // Default values that work well for 4 column grid
73
+ colsByBreakpoint = {
74
+ lg: 4,
75
+ md: 4,
76
+ sm: 3,
77
+ xl: 4,
78
+ xs: 2,
79
+ },
80
+ forceSkeleton = false,
81
+ // Default values that work well for 4 column grid
82
+ gapsByBreakpoint = {
83
+ lg: 'md',
84
+ md: 'md',
85
+ sm: 'sm',
86
+ xl: 'md',
87
+ xs: 'sm',
88
+ },
89
+ onCardClick,
90
+ onCardVisible,
91
+ skeletonCardCount = 0,
92
+ }: Props<CardData, KeyType>) => {
93
+ const doesGridHaveLoadedData = cards.length > 0 && Object.keys(cardData).length > 0 && !forceSkeleton;
94
+
95
+ const gridClasses = useMemo(
96
+ () =>
97
+ cn(
98
+ 'grid',
99
+ `grid-cols-${colsByBreakpoint.xs}`,
100
+ `gap-${gapsByBreakpoint.xs}`,
101
+ {
102
+ 'lgMax:gap-lg': gapsByBreakpoint.lg === 'lg',
103
+ 'lgMax:gap-md': gapsByBreakpoint.lg === 'md',
104
+ 'lgMax:gap-sm': gapsByBreakpoint.lg === 'sm',
105
+ 'lgMax:gap-xl': gapsByBreakpoint.lg === 'xl',
106
+ 'lgMax:gap-xs': gapsByBreakpoint.lg === 'xs',
107
+
108
+ 'lgMax:grid-cols-1': colsByBreakpoint.lg === 1,
109
+ 'lgMax:grid-cols-2': colsByBreakpoint.lg === 2,
110
+ 'lgMax:grid-cols-3': colsByBreakpoint.lg === 3,
111
+ 'lgMax:grid-cols-4': colsByBreakpoint.lg === 4,
112
+ 'lgMax:grid-cols-5': colsByBreakpoint.lg === 5,
113
+ 'lgMax:grid-cols-6': colsByBreakpoint.lg === 6,
114
+
115
+ 'lgMin:gap-lg': gapsByBreakpoint.lg === 'lg',
116
+ 'lgMin:gap-md': gapsByBreakpoint.lg === 'md',
117
+ 'lgMin:gap-sm': gapsByBreakpoint.lg === 'sm',
118
+ 'lgMin:gap-xl': gapsByBreakpoint.lg === 'xl',
119
+ 'lgMin:gap-xs': gapsByBreakpoint.lg === 'xs',
120
+
121
+ // Min-width breakpoints for largest size (lgMin)
122
+ 'lgMin:grid-cols-1': colsByBreakpoint.lg === 1,
123
+ 'lgMin:grid-cols-2': colsByBreakpoint.lg === 2,
124
+ 'lgMin:grid-cols-3': colsByBreakpoint.lg === 3,
125
+ 'lgMin:grid-cols-4': colsByBreakpoint.lg === 4,
126
+ 'lgMin:grid-cols-5': colsByBreakpoint.lg === 5,
127
+ 'lgMin:grid-cols-6': colsByBreakpoint.lg === 6,
128
+ 'mdMax:gap-lg': gapsByBreakpoint.md === 'lg',
129
+ 'mdMax:gap-md': gapsByBreakpoint.md === 'md',
130
+ 'mdMax:gap-sm': gapsByBreakpoint.md === 'sm',
131
+ 'mdMax:gap-xl': gapsByBreakpoint.md === 'xl',
132
+ 'mdMax:gap-xs': gapsByBreakpoint.md === 'xs',
133
+
134
+ 'mdMax:grid-cols-1': colsByBreakpoint.md === 1,
135
+ 'mdMax:grid-cols-2': colsByBreakpoint.md === 2,
136
+ 'mdMax:grid-cols-3': colsByBreakpoint.md === 3,
137
+ 'mdMax:grid-cols-4': colsByBreakpoint.md === 4,
138
+ 'mdMax:grid-cols-5': colsByBreakpoint.md === 5,
139
+ 'mdMax:grid-cols-6': colsByBreakpoint.md === 6,
140
+
141
+ 'smMax:gap-lg': gapsByBreakpoint.sm === 'lg',
142
+ 'smMax:gap-md': gapsByBreakpoint.sm === 'md',
143
+ 'smMax:gap-sm': gapsByBreakpoint.sm === 'sm',
144
+ 'smMax:gap-xl': gapsByBreakpoint.sm === 'xl',
145
+ 'smMax:gap-xs': gapsByBreakpoint.sm === 'xs',
146
+
147
+ 'smMax:grid-cols-1': colsByBreakpoint.sm === 1,
148
+ 'smMax:grid-cols-2': colsByBreakpoint.sm === 2,
149
+ 'smMax:grid-cols-3': colsByBreakpoint.sm === 3,
150
+ 'smMax:grid-cols-4': colsByBreakpoint.sm === 4,
151
+ 'smMax:grid-cols-5': colsByBreakpoint.sm === 5,
152
+ 'smMax:grid-cols-6': colsByBreakpoint.sm === 6,
153
+ 'xsMax:gap-lg': gapsByBreakpoint.xs === 'lg',
154
+ 'xsMax:gap-md': gapsByBreakpoint.xs === 'md',
155
+ 'xsMax:gap-sm': gapsByBreakpoint.xs === 'sm',
156
+ 'xsMax:gap-xl': gapsByBreakpoint.xs === 'xl',
157
+
158
+ // Max-width breakpoints for gaps
159
+ 'xsMax:gap-xs': gapsByBreakpoint.xs === 'xs',
160
+ // Max-width breakpoints for columns
161
+
162
+ 'xsMax:grid-cols-1': colsByBreakpoint.xs === 1,
163
+ 'xsMax:grid-cols-2': colsByBreakpoint.xs === 2,
164
+ 'xsMax:grid-cols-3': colsByBreakpoint.xs === 3,
165
+ 'xsMax:grid-cols-4': colsByBreakpoint.xs === 4,
166
+ 'xsMax:grid-cols-5': colsByBreakpoint.xs === 5,
167
+ 'xsMax:grid-cols-6': colsByBreakpoint.xs === 6,
168
+ },
169
+ className
170
+ ),
171
+ [
172
+ className,
173
+ colsByBreakpoint.lg,
174
+ colsByBreakpoint.md,
175
+ colsByBreakpoint.sm,
176
+ colsByBreakpoint.xs,
177
+ gapsByBreakpoint.lg,
178
+ gapsByBreakpoint.md,
179
+ gapsByBreakpoint.sm,
180
+ gapsByBreakpoint.xs,
181
+ ]
182
+ );
183
+
184
+ // Memoize the card click handler
185
+ const handleCardClick = useCallback(
186
+ (cardData: CardData) => {
187
+ onCardClick?.(cardData);
188
+ },
189
+ [onCardClick]
190
+ );
191
+
192
+ return (
193
+ <div className={gridClasses}>
194
+ {doesGridHaveLoadedData ? (
195
+ <LoadedCardGrid
196
+ card={Card}
197
+ cardData={cardData}
198
+ cards={cards}
199
+ onCardClick={handleCardClick}
200
+ onCardVisible={onCardVisible}
201
+ />
202
+ ) : (
203
+ new Array(skeletonCardCount).fill(0).map((_, i) => <Card.Skeleton key={i} />)
204
+ )}
205
+ </div>
206
+ );
207
+ };
208
+
209
+ /**
210
+ * This grid is the one that does the checks / we are sure that the card data is loaded.
211
+ */
212
+ const LoadedCardGrid = <CardData, KeyType extends string | number>({
213
+ card: Card,
214
+ cardData,
215
+ cards,
216
+ onCardClick,
217
+ onCardVisible,
218
+ }: Pick<Props<CardData, KeyType>, 'card' | 'cardData' | 'cards' | 'onCardClick' | 'onCardVisible' | 'className'>) => {
219
+ // Development only checks.
220
+ if (nodeEnv !== 'production') {
221
+ for (const card of cards) {
222
+ if (!cardData[card]) {
223
+ // eslint-disable-next-line no-console
224
+ console.error(`Card data does not have card with id '${card}'`);
225
+ }
226
+ }
227
+ }
228
+
229
+ // Wrap the onCardVisible callback to map card keys back to card data
230
+ const handleCardVisible = useCallback(
231
+ (cardKey: KeyType) => {
232
+ if (onCardVisible && cardData[cardKey]) {
233
+ onCardVisible(cardData[cardKey]);
234
+ }
235
+ },
236
+ [onCardVisible, cardData]
237
+ );
238
+
239
+ // Set up visibility tracking - only create if callback is provided
240
+ const getVisibilityRef = useCardVisibilityTracking<KeyType>(handleCardVisible, { threshold: 0.5 });
241
+
242
+ return useMemo(
243
+ () =>
244
+ cards
245
+ .filter((card) => {
246
+ if (!cardData[card]) {
247
+ // eslint-disable-next-line no-console
248
+ console.error(`Card data does not have card with id '${card}'`);
249
+ return false;
250
+ }
251
+ return true;
252
+ })
253
+ .map((card) => (
254
+ <Card.Normal
255
+ cardData={cardData[card]}
256
+ key={card}
257
+ onCardClick={onCardClick}
258
+ visibilityRef={onCardVisible ? getVisibilityRef(card) : undefined}
259
+ />
260
+ )),
261
+ [cards, cardData, Card, onCardClick, onCardVisible, getVisibilityRef]
262
+ );
263
+ };
@@ -0,0 +1,22 @@
1
+ import { SharedProps } from './sharedProps';
2
+
3
+ type Props<CardData> = {
4
+ className?: string;
5
+ /**
6
+ * The data to pass to the card component.
7
+ */
8
+ data: CardData;
9
+ } & SharedProps<CardData>;
10
+
11
+ export const SingleCard = <CardData,>({ card: Card, className, data, forceSkeleton }: Props<CardData>) => {
12
+ if (forceSkeleton) {
13
+ return <Card.Skeleton className={className} />;
14
+ }
15
+
16
+ return (
17
+ <Card.Normal
18
+ cardData={data}
19
+ className={className}
20
+ />
21
+ );
22
+ };
@@ -0,0 +1,176 @@
1
+ import { cn } from '@evolve.ui/theme-system';
2
+ import { ReactNode, useMemo } from 'react';
3
+
4
+ import { Skeleton } from '../Skeleton/Skeleton';
5
+ import { CardComponent, CardSpec, isSpacer } from './types';
6
+
7
+ export { type CardComponent, type CardSpec };
8
+
9
+ export type CreatedCard<CardData> = ReturnType<typeof cardFactory<CardData>>;
10
+
11
+ /**
12
+ * This function takes a `CardSpec` and returns a React component.
13
+ *
14
+ * This function should be called _once_ for each card spec.
15
+ * You can export the result of this function and use it in your app later.
16
+ */
17
+ export const cardFactory = <CardData,>(cardSpec: CardSpec<CardData>) => {
18
+ const { components: oldComponents, name } = cardSpec;
19
+
20
+ if (!oldComponents.length) {
21
+ throw new Error('Card must have at least one component');
22
+ }
23
+
24
+ let componentCount: number = 0;
25
+ const components: CardComponent<CardData>[] = [];
26
+ const spacing: number[] = new Array(oldComponents.length).fill(0);
27
+
28
+ let currentSkeletonOffset = 0;
29
+ const skeletonComponents: ReactNode[] = [];
30
+
31
+ for (const componentOrSpace of oldComponents) {
32
+ if (isSpacer(componentOrSpace)) {
33
+ if (componentCount === 0) {
34
+ throw new Error('Card cannot start with a spacer');
35
+ }
36
+
37
+ currentSkeletonOffset += componentOrSpace.spacerPx;
38
+ spacing[componentCount] += componentOrSpace.spacerPx;
39
+
40
+ continue;
41
+ }
42
+
43
+ const component = componentOrSpace;
44
+ components.push(component);
45
+
46
+ if (component.skeletonConfig) {
47
+ const skeletonConfig = component.skeletonConfig;
48
+ if (skeletonConfig.type === 'inline' && skeletonConfig.width && skeletonConfig.height) {
49
+ skeletonComponents.push(
50
+ <rect
51
+ height={skeletonConfig.height}
52
+ key={componentCount}
53
+ rx={skeletonConfig.rx ?? 4}
54
+ ry={skeletonConfig.ry ?? 4}
55
+ width={skeletonConfig.width}
56
+ x="0"
57
+ y={currentSkeletonOffset}
58
+ />
59
+ );
60
+
61
+ currentSkeletonOffset += skeletonConfig.height;
62
+ } else if (skeletonConfig.type === 'absolute') {
63
+ skeletonComponents.push(skeletonConfig.node);
64
+ }
65
+ }
66
+
67
+ componentCount++;
68
+ }
69
+
70
+ const Normal = ({
71
+ cardData,
72
+ className,
73
+ onCardClick,
74
+ visibilityRef,
75
+ }: {
76
+ cardData: CardData;
77
+ className?: string;
78
+ /** Optional click handler for the card */
79
+ onCardClick?: (cardData: CardData) => void;
80
+ /** Ref callback for visibility tracking */
81
+ visibilityRef?: (element: Element | null) => void;
82
+ }) => {
83
+ return (
84
+ <CardContainer
85
+ className={cn('group', cardSpec.className, className)}
86
+ // @ts-expect-error id is not part of the card data, but can be added by the caller
87
+ id={cardData?.id ?? undefined}
88
+ onClick={onCardClick ? () => onCardClick(cardData) : undefined}
89
+ spacing={spacing}
90
+ visibilityRef={visibilityRef}
91
+ >
92
+ {/* The components will never change, so using index here is ok. */}
93
+ {components.map((component, index) => (
94
+ <component.Component
95
+ {...cardData}
96
+ key={index}
97
+ />
98
+ ))}
99
+ </CardContainer>
100
+ );
101
+ };
102
+ Normal.displayName = name;
103
+ const CardSkeleton = ({ className }: { className?: string }) => {
104
+ return (
105
+ <CardContainer
106
+ className={cn(cardSpec.className, className)}
107
+ isSkeleton
108
+ spacing={spacing}
109
+ >
110
+ <Skeleton viewBox={`0 0 282 ${cardSpec.overrideSkeletonHeightPx ?? currentSkeletonOffset}`}>
111
+ {skeletonComponents}
112
+ </Skeleton>
113
+ </CardContainer>
114
+ );
115
+ };
116
+ CardSkeleton.displayName = name + 'Skeleton';
117
+
118
+ const Card = {
119
+ Normal,
120
+ Skeleton: CardSkeleton,
121
+ };
122
+
123
+ return Card;
124
+ };
125
+
126
+ type CardContainerProps = {
127
+ children: ReactNode;
128
+ className?: string;
129
+ isSkeleton?: boolean;
130
+ onClick?: () => void;
131
+ spacing: number[];
132
+ visibilityRef?: (element: Element | null) => void;
133
+ };
134
+
135
+ const CardContainer = ({
136
+ children,
137
+ className,
138
+ isSkeleton,
139
+ onClick,
140
+ spacing,
141
+ visibilityRef,
142
+ ...props
143
+ }: CardContainerProps) => {
144
+ const { styles } = useMemo(() => {
145
+ const styles = {} as { [key: string]: string };
146
+
147
+ spacing.forEach((space, i) => {
148
+ if (space !== 0) {
149
+ const key = `--card-spacing-${i}`;
150
+ styles[key] = `${space}px`;
151
+ }
152
+ });
153
+
154
+ return {
155
+ styles: styles as React.CSSProperties,
156
+ };
157
+ }, [spacing]);
158
+
159
+ const Container = isSkeleton ? 'div' : 'article';
160
+
161
+ return (
162
+ <Container
163
+ className={cn(
164
+ // Base spacing classes
165
+ 'hui-item-card relative flex w-full flex-col',
166
+ className
167
+ )}
168
+ onClick={onClick}
169
+ ref={visibilityRef}
170
+ style={styles}
171
+ {...props}
172
+ >
173
+ {children}
174
+ </Container>
175
+ );
176
+ };