@drivy/cobalt 0.21.0 → 0.23.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 (382) hide show
  1. package/components/Alerter/Alert.js.map +1 -1
  2. package/components/Alerter/index.js.map +1 -1
  3. package/components/BulletList/index.js.map +1 -1
  4. package/components/Buttons/ButtonComponent.js +1 -2
  5. package/components/Buttons/ButtonComponent.js.map +1 -1
  6. package/components/Buttons/ButtonsGroup.js +1 -5
  7. package/components/Buttons/ButtonsGroup.js.map +1 -1
  8. package/components/Buttons/helpers.js.map +1 -1
  9. package/components/Card/index.js.map +1 -1
  10. package/components/Cell/index.js.map +1 -1
  11. package/components/EmptyState/index.js +5 -4
  12. package/components/EmptyState/index.js.map +1 -1
  13. package/components/Form/CheckablePill.js.map +1 -1
  14. package/components/Form/Checkmark.js.map +1 -1
  15. package/components/Form/Stepper.js +3 -3
  16. package/components/Form/Stepper.js.map +1 -1
  17. package/components/Helper/index.js.map +1 -1
  18. package/components/HorizontalList/index.js.map +1 -1
  19. package/components/Modal/ModalBody.js +1 -1
  20. package/components/Modal/ModalBody.js.map +1 -1
  21. package/components/Modal/ModalFooter.js.map +1 -1
  22. package/components/Popover/index.js.map +1 -1
  23. package/components/Rating/RatingCompact.js +4 -2
  24. package/components/Rating/RatingCompact.js.map +1 -1
  25. package/components/Rating/RatingLabel.js.map +1 -1
  26. package/components/Rating/index.js +1 -4
  27. package/components/Rating/index.js.map +1 -1
  28. package/components/Tabs/index.js +1 -1
  29. package/components/Tabs/index.js.map +1 -1
  30. package/index.js +3 -3
  31. package/package.json +23 -25
  32. package/styles/components.scss +1 -1
  33. package/types/__tests__/AsyncComponent.d.ts +5 -4
  34. package/types/components/Accordion/ToggleIcon.d.ts +1 -1
  35. package/types/components/Accordion/index.d.ts +6 -6
  36. package/types/components/Alerter/Alert.d.ts +5 -4
  37. package/types/components/Alerter/index.d.ts +4 -4
  38. package/types/components/BulletList/index.d.ts +1 -1
  39. package/types/components/Buttons/ButtonComponent.d.ts +2 -2
  40. package/types/components/Buttons/DefaultButton/index.d.ts +5 -27
  41. package/types/components/Buttons/GhostButton/index.d.ts +5 -27
  42. package/types/components/Buttons/InversedButton/index.d.ts +3 -3
  43. package/types/components/Buttons/helpers.d.ts +5 -4
  44. package/types/components/Buttons/index.d.ts +1 -1
  45. package/types/components/Calendar/CalendarRangePicker/CalendarRangePicker.d.ts +1 -1
  46. package/types/components/Calendar/CalendarRangePicker/CalendarRangePickerDay.d.ts +1 -1
  47. package/types/components/Calendar/CalendarRangePicker/CalendarRangePickerMonth.d.ts +1 -1
  48. package/types/components/Calendar/CalendarView/CalendarViewMonth.d.ts +1 -1
  49. package/types/components/Calendar/CalendarView/index.d.ts +1 -1
  50. package/types/components/Calendar/CalendarView/types.d.ts +7 -7
  51. package/types/components/Card/index.d.ts +6 -5
  52. package/types/components/Cell/index.d.ts +9 -7
  53. package/types/components/EmptyState/index.d.ts +3 -3
  54. package/types/components/Flash/index.d.ts +1 -1
  55. package/types/components/Form/Autocomplete/index.d.ts +20 -18
  56. package/types/components/Form/CheckablePill.d.ts +2 -2
  57. package/types/components/Form/Checkmark.d.ts +3 -3
  58. package/types/components/Form/ComposedField.d.ts +5 -4
  59. package/types/components/Form/Fieldset.d.ts +1 -1
  60. package/types/components/Form/RadioWithDetails.d.ts +1 -1
  61. package/types/components/Form/Select.d.ts +5 -4
  62. package/types/components/Form/Slider.d.ts +4 -41
  63. package/types/components/Form/Stepper.d.ts +2 -2
  64. package/types/components/Form/TextArea.d.ts +1 -1
  65. package/types/components/Form/TextInput.d.ts +7 -6
  66. package/types/components/Form/ToggleSwitch.d.ts +2 -2
  67. package/types/components/Form/field.d.ts +1 -1
  68. package/types/components/Form/form.d.ts +1 -1
  69. package/types/components/Helper/index.d.ts +4 -3
  70. package/types/components/HorizontalList/index.d.ts +5 -4
  71. package/types/components/Icon/__generated__/AccountDetailsIcon.d.ts +1 -1
  72. package/types/components/Icon/__generated__/AddPictureIcon.d.ts +1 -1
  73. package/types/components/Icon/__generated__/AirConditioningIcon.d.ts +1 -1
  74. package/types/components/Icon/__generated__/AirportIcon.d.ts +1 -1
  75. package/types/components/Icon/__generated__/AndroidIcon.d.ts +1 -1
  76. package/types/components/Icon/__generated__/AntiqueIcon.d.ts +1 -1
  77. package/types/components/Icon/__generated__/ArrowLeftCircleFilledIcon.d.ts +1 -1
  78. package/types/components/Icon/__generated__/ArrowLeftIcon.d.ts +1 -1
  79. package/types/components/Icon/__generated__/ArrowRightCircleFilledIcon.d.ts +1 -1
  80. package/types/components/Icon/__generated__/ArrowRightCircleIcon.d.ts +1 -1
  81. package/types/components/Icon/__generated__/ArrowRightIcon.d.ts +1 -1
  82. package/types/components/Icon/__generated__/AudioInputIcon.d.ts +1 -1
  83. package/types/components/Icon/__generated__/BabySeatIcon.d.ts +1 -1
  84. package/types/components/Icon/__generated__/BatteryIcon.d.ts +1 -1
  85. package/types/components/Icon/__generated__/BellIcon.d.ts +1 -1
  86. package/types/components/Icon/__generated__/BikeRackIcon.d.ts +1 -1
  87. package/types/components/Icon/__generated__/BinIcon.d.ts +1 -1
  88. package/types/components/Icon/__generated__/BluetoothIcon.d.ts +1 -1
  89. package/types/components/Icon/__generated__/BriefcaseIcon.d.ts +1 -1
  90. package/types/components/Icon/__generated__/BulbIcon.d.ts +1 -1
  91. package/types/components/Icon/__generated__/CableIcon.d.ts +1 -1
  92. package/types/components/Icon/__generated__/CabrioletIcon.d.ts +1 -1
  93. package/types/components/Icon/__generated__/CalendarCheckIcon.d.ts +1 -1
  94. package/types/components/Icon/__generated__/CalendarClockIcon.d.ts +1 -1
  95. package/types/components/Icon/__generated__/CalendarEndIcon.d.ts +1 -1
  96. package/types/components/Icon/__generated__/CalendarIcon.d.ts +1 -1
  97. package/types/components/Icon/__generated__/CalendarStartIcon.d.ts +1 -1
  98. package/types/components/Icon/__generated__/CameraAddIcon.d.ts +1 -1
  99. package/types/components/Icon/__generated__/CameraIcon.d.ts +1 -1
  100. package/types/components/Icon/__generated__/CampervanIcon.d.ts +1 -1
  101. package/types/components/Icon/__generated__/CarAddIcon.d.ts +1 -1
  102. package/types/components/Icon/__generated__/CarCheckIcon.d.ts +1 -1
  103. package/types/components/Icon/__generated__/CarDamagesIcon.d.ts +1 -1
  104. package/types/components/Icon/__generated__/CarDrivyOpenIcon.d.ts +1 -1
  105. package/types/components/Icon/__generated__/CarGroupIcon.d.ts +1 -1
  106. package/types/components/Icon/__generated__/CarIcon.d.ts +1 -1
  107. package/types/components/Icon/__generated__/CarLockIcon.d.ts +1 -1
  108. package/types/components/Icon/__generated__/CarPlayIcon.d.ts +1 -1
  109. package/types/components/Icon/__generated__/CarReturnIcon.d.ts +1 -1
  110. package/types/components/Icon/__generated__/CarSearchIcon.d.ts +1 -1
  111. package/types/components/Icon/__generated__/CarTypeAntiqueIcon.d.ts +1 -1
  112. package/types/components/Icon/__generated__/CarTypeCabrioletIcon.d.ts +1 -1
  113. package/types/components/Icon/__generated__/CarTypeCampervanIcon.d.ts +1 -1
  114. package/types/components/Icon/__generated__/CarTypeCityIcon.d.ts +1 -1
  115. package/types/components/Icon/__generated__/CarTypeConvertibleIcon.d.ts +1 -1
  116. package/types/components/Icon/__generated__/CarTypeCoupeIcon.d.ts +1 -1
  117. package/types/components/Icon/__generated__/CarTypeFamilyIcon.d.ts +1 -1
  118. package/types/components/Icon/__generated__/CarTypeFourFourIcon.d.ts +1 -1
  119. package/types/components/Icon/__generated__/CarTypeMinibusIcon.d.ts +1 -1
  120. package/types/components/Icon/__generated__/CarTypeSedanIcon.d.ts +1 -1
  121. package/types/components/Icon/__generated__/CarTypeUtilityIcon.d.ts +1 -1
  122. package/types/components/Icon/__generated__/CardIcon.d.ts +1 -1
  123. package/types/components/Icon/__generated__/CdPlayerIcon.d.ts +1 -1
  124. package/types/components/Icon/__generated__/CertificateIcon.d.ts +1 -1
  125. package/types/components/Icon/__generated__/ChainsIcon.d.ts +1 -1
  126. package/types/components/Icon/__generated__/CheckCircleFilledIcon.d.ts +1 -1
  127. package/types/components/Icon/__generated__/CheckCircleIcon.d.ts +1 -1
  128. package/types/components/Icon/__generated__/CheckIcon.d.ts +1 -1
  129. package/types/components/Icon/__generated__/ChecklistIcon.d.ts +1 -1
  130. package/types/components/Icon/__generated__/ChevronDownIcon.d.ts +1 -1
  131. package/types/components/Icon/__generated__/ChevronLeftIcon.d.ts +1 -1
  132. package/types/components/Icon/__generated__/ChevronRightIcon.d.ts +1 -1
  133. package/types/components/Icon/__generated__/ChevronUpIcon.d.ts +1 -1
  134. package/types/components/Icon/__generated__/CircledArrowRightIcon.d.ts +1 -1
  135. package/types/components/Icon/__generated__/CityIcon.d.ts +1 -1
  136. package/types/components/Icon/__generated__/CleaningIcon.d.ts +1 -1
  137. package/types/components/Icon/__generated__/ClockAlertIcon.d.ts +1 -1
  138. package/types/components/Icon/__generated__/ClockBackwardsIcon.d.ts +1 -1
  139. package/types/components/Icon/__generated__/ClockForwardsIcon.d.ts +1 -1
  140. package/types/components/Icon/__generated__/ClockIcon.d.ts +1 -1
  141. package/types/components/Icon/__generated__/CloseCircleFilledIcon.d.ts +1 -1
  142. package/types/components/Icon/__generated__/CloseIcon.d.ts +1 -1
  143. package/types/components/Icon/__generated__/ConnectCarIcon.d.ts +1 -1
  144. package/types/components/Icon/__generated__/ContactMailIcon.d.ts +1 -1
  145. package/types/components/Icon/__generated__/ContactPhoneIcon.d.ts +1 -1
  146. package/types/components/Icon/__generated__/ContextualPaperclipIcon.d.ts +1 -1
  147. package/types/components/Icon/__generated__/ContextualQuestionIcon.d.ts +1 -1
  148. package/types/components/Icon/__generated__/ContextualWarningCircleFilledIcon.d.ts +1 -1
  149. package/types/components/Icon/__generated__/ContextualWarningCircleIcon.d.ts +1 -1
  150. package/types/components/Icon/__generated__/ConvertibleIcon.d.ts +1 -1
  151. package/types/components/Icon/__generated__/CopyIcon.d.ts +1 -1
  152. package/types/components/Icon/__generated__/CoupeIcon.d.ts +1 -1
  153. package/types/components/Icon/__generated__/CreditCardAddIcon.d.ts +1 -1
  154. package/types/components/Icon/__generated__/CreditCardErrorIcon.d.ts +1 -1
  155. package/types/components/Icon/__generated__/CreditCardIcon.d.ts +1 -1
  156. package/types/components/Icon/__generated__/CruiseControlIcon.d.ts +1 -1
  157. package/types/components/Icon/__generated__/DashcamIcon.d.ts +1 -1
  158. package/types/components/Icon/__generated__/DirectionsIcon.d.ts +1 -1
  159. package/types/components/Icon/__generated__/DocumentIcon.d.ts +1 -1
  160. package/types/components/Icon/__generated__/DotHorizontalIcon.d.ts +1 -1
  161. package/types/components/Icon/__generated__/DotVerticalIcon.d.ts +1 -1
  162. package/types/components/Icon/__generated__/DotsHorizontalIcon.d.ts +1 -1
  163. package/types/components/Icon/__generated__/DotsVerticalIcon.d.ts +1 -1
  164. package/types/components/Icon/__generated__/DownloadIcon.d.ts +1 -1
  165. package/types/components/Icon/__generated__/EarningIcon.d.ts +1 -1
  166. package/types/components/Icon/__generated__/EarthIcon.d.ts +1 -1
  167. package/types/components/Icon/__generated__/EditIcon.d.ts +1 -1
  168. package/types/components/Icon/__generated__/ElectricIcon.d.ts +1 -1
  169. package/types/components/Icon/__generated__/EvBatteryIcon.d.ts +1 -1
  170. package/types/components/Icon/__generated__/EvCableIcon.d.ts +1 -1
  171. package/types/components/Icon/__generated__/EvChargerIcon.d.ts +1 -1
  172. package/types/components/Icon/__generated__/ExternalLinkIcon.d.ts +1 -1
  173. package/types/components/Icon/__generated__/EyeClosedIcon.d.ts +1 -1
  174. package/types/components/Icon/__generated__/EyeIcon.d.ts +1 -1
  175. package/types/components/Icon/__generated__/EyeOpenedIcon.d.ts +1 -1
  176. package/types/components/Icon/__generated__/FaceRecognitionIcon.d.ts +1 -1
  177. package/types/components/Icon/__generated__/FacebookIcon.d.ts +1 -1
  178. package/types/components/Icon/__generated__/FamilyIcon.d.ts +1 -1
  179. package/types/components/Icon/__generated__/FileFilledIcon.d.ts +1 -1
  180. package/types/components/Icon/__generated__/FilterIcon.d.ts +1 -1
  181. package/types/components/Icon/__generated__/FiltersIcon.d.ts +1 -1
  182. package/types/components/Icon/__generated__/FlagIcon.d.ts +1 -1
  183. package/types/components/Icon/__generated__/FourByFourIcon.d.ts +1 -1
  184. package/types/components/Icon/__generated__/FuelTankIcon.d.ts +1 -1
  185. package/types/components/Icon/__generated__/GeolocationIcon.d.ts +1 -1
  186. package/types/components/Icon/__generated__/GiftIcon.d.ts +1 -1
  187. package/types/components/Icon/__generated__/GpsIcon.d.ts +1 -1
  188. package/types/components/Icon/__generated__/GraphUpIcon.d.ts +1 -1
  189. package/types/components/Icon/__generated__/HealingIcon.d.ts +1 -1
  190. package/types/components/Icon/__generated__/HeartIcon.d.ts +1 -1
  191. package/types/components/Icon/__generated__/HitchIcon.d.ts +1 -1
  192. package/types/components/Icon/__generated__/HomeIcon.d.ts +1 -1
  193. package/types/components/Icon/__generated__/IdCardIcon.d.ts +1 -1
  194. package/types/components/Icon/__generated__/IncidentIcon.d.ts +1 -1
  195. package/types/components/Icon/__generated__/InfoCircleFilledIcon.d.ts +1 -1
  196. package/types/components/Icon/__generated__/InfoCircleIcon.d.ts +1 -1
  197. package/types/components/Icon/__generated__/InfoFilledIcon.d.ts +1 -1
  198. package/types/components/Icon/__generated__/InfoIcon.d.ts +1 -1
  199. package/types/components/Icon/__generated__/InstantIcon.d.ts +1 -1
  200. package/types/components/Icon/__generated__/InvoiceIcon.d.ts +1 -1
  201. package/types/components/Icon/__generated__/KeyConnectIcon.d.ts +1 -1
  202. package/types/components/Icon/__generated__/KeyIcon.d.ts +1 -1
  203. package/types/components/Icon/__generated__/LicenceCheckIcon.d.ts +1 -1
  204. package/types/components/Icon/__generated__/LicenceIcon.d.ts +1 -1
  205. package/types/components/Icon/__generated__/LicencePaperIcon.d.ts +1 -1
  206. package/types/components/Icon/__generated__/LifeBuoyIcon.d.ts +1 -1
  207. package/types/components/Icon/__generated__/LinkedinIcon.d.ts +1 -1
  208. package/types/components/Icon/__generated__/LoadingIcon.d.ts +1 -1
  209. package/types/components/Icon/__generated__/LocalityIcon.d.ts +1 -1
  210. package/types/components/Icon/__generated__/LocationIcon.d.ts +1 -1
  211. package/types/components/Icon/__generated__/LocationMapIcon.d.ts +1 -1
  212. package/types/components/Icon/__generated__/LocationParkingIcon.d.ts +1 -1
  213. package/types/components/Icon/__generated__/LocationPinIcon.d.ts +1 -1
  214. package/types/components/Icon/__generated__/LockCheckIcon.d.ts +1 -1
  215. package/types/components/Icon/__generated__/LockedIcon.d.ts +1 -1
  216. package/types/components/Icon/__generated__/LoginIcon.d.ts +1 -1
  217. package/types/components/Icon/__generated__/LogoutIcon.d.ts +1 -1
  218. package/types/components/Icon/__generated__/MailCheckIcon.d.ts +1 -1
  219. package/types/components/Icon/__generated__/MailIcon.d.ts +1 -1
  220. package/types/components/Icon/__generated__/MapAltIcon.d.ts +1 -1
  221. package/types/components/Icon/__generated__/MapIcon.d.ts +1 -1
  222. package/types/components/Icon/__generated__/MeetDriverIcon.d.ts +1 -1
  223. package/types/components/Icon/__generated__/MeetOwnerIcon.d.ts +1 -1
  224. package/types/components/Icon/__generated__/MenuListIcon.d.ts +1 -1
  225. package/types/components/Icon/__generated__/MessagesIcon.d.ts +1 -1
  226. package/types/components/Icon/__generated__/MileageIcon.d.ts +1 -1
  227. package/types/components/Icon/__generated__/MinibusIcon.d.ts +1 -1
  228. package/types/components/Icon/__generated__/MinusCircleFilledIcon.d.ts +1 -1
  229. package/types/components/Icon/__generated__/MinusIcon.d.ts +1 -1
  230. package/types/components/Icon/__generated__/MiscGiftIcon.d.ts +1 -1
  231. package/types/components/Icon/__generated__/NearbyDeviceIcon.d.ts +1 -1
  232. package/types/components/Icon/__generated__/NotificationIcon.d.ts +1 -1
  233. package/types/components/Icon/__generated__/Number1CircleIcon.d.ts +1 -1
  234. package/types/components/Icon/__generated__/Number2CircleIcon.d.ts +1 -1
  235. package/types/components/Icon/__generated__/Number3CircleIcon.d.ts +1 -1
  236. package/types/components/Icon/__generated__/Number4CircleIcon.d.ts +1 -1
  237. package/types/components/Icon/__generated__/Number5CircleIcon.d.ts +1 -1
  238. package/types/components/Icon/__generated__/OkHandIcon.d.ts +1 -1
  239. package/types/components/Icon/__generated__/OptionAirConditioningIcon.d.ts +1 -1
  240. package/types/components/Icon/__generated__/OptionAndroidAutoIcon.d.ts +1 -1
  241. package/types/components/Icon/__generated__/OptionAppleCarplayIcon.d.ts +1 -1
  242. package/types/components/Icon/__generated__/OptionAudioInputIcon.d.ts +1 -1
  243. package/types/components/Icon/__generated__/OptionBabySeatIcon.d.ts +1 -1
  244. package/types/components/Icon/__generated__/OptionBikeRackIcon.d.ts +1 -1
  245. package/types/components/Icon/__generated__/OptionBluetoothAudioIcon.d.ts +1 -1
  246. package/types/components/Icon/__generated__/OptionCdPlayerIcon.d.ts +1 -1
  247. package/types/components/Icon/__generated__/OptionChainsIcon.d.ts +1 -1
  248. package/types/components/Icon/__generated__/OptionCruiseControlIcon.d.ts +1 -1
  249. package/types/components/Icon/__generated__/OptionDashcamIcon.d.ts +1 -1
  250. package/types/components/Icon/__generated__/OptionGpsIcon.d.ts +1 -1
  251. package/types/components/Icon/__generated__/OptionHasTrailerIcon.d.ts +1 -1
  252. package/types/components/Icon/__generated__/OptionHitchIcon.d.ts +1 -1
  253. package/types/components/Icon/__generated__/OptionRoofBoxIcon.d.ts +1 -1
  254. package/types/components/Icon/__generated__/OptionSkiRackIcon.d.ts +1 -1
  255. package/types/components/Icon/__generated__/OptionSnowTireIcon.d.ts +1 -1
  256. package/types/components/Icon/__generated__/OptionWheelchairAccessibleIcon.d.ts +1 -1
  257. package/types/components/Icon/__generated__/PaperclipIcon.d.ts +1 -1
  258. package/types/components/Icon/__generated__/ParkingIcon.d.ts +1 -1
  259. package/types/components/Icon/__generated__/PassportIcon.d.ts +1 -1
  260. package/types/components/Icon/__generated__/PaymentsIcon.d.ts +1 -1
  261. package/types/components/Icon/__generated__/PencilIcon.d.ts +1 -1
  262. package/types/components/Icon/__generated__/PeopleUserIcon.d.ts +1 -1
  263. package/types/components/Icon/__generated__/PerformanceIcon.d.ts +1 -1
  264. package/types/components/Icon/__generated__/PhoneIcon.d.ts +1 -1
  265. package/types/components/Icon/__generated__/PhoneLinkIcon.d.ts +1 -1
  266. package/types/components/Icon/__generated__/PhotosIcon.d.ts +1 -1
  267. package/types/components/Icon/__generated__/PigIcon.d.ts +1 -1
  268. package/types/components/Icon/__generated__/PinIcon.d.ts +1 -1
  269. package/types/components/Icon/__generated__/PlugIcon.d.ts +1 -1
  270. package/types/components/Icon/__generated__/PlusCircleFilledIcon.d.ts +1 -1
  271. package/types/components/Icon/__generated__/PlusIcon.d.ts +1 -1
  272. package/types/components/Icon/__generated__/PositionIcon.d.ts +1 -1
  273. package/types/components/Icon/__generated__/PricingFlatIcon.d.ts +1 -1
  274. package/types/components/Icon/__generated__/PricingVariableIcon.d.ts +1 -1
  275. package/types/components/Icon/__generated__/ProfilePictureIcon.d.ts +1 -1
  276. package/types/components/Icon/__generated__/QuestionCircleFilledIcon.d.ts +1 -1
  277. package/types/components/Icon/__generated__/QuestionCircleIcon.d.ts +1 -1
  278. package/types/components/Icon/__generated__/QuestionIcon.d.ts +1 -1
  279. package/types/components/Icon/__generated__/RaceFlagIcon.d.ts +1 -1
  280. package/types/components/Icon/__generated__/RefreshIcon.d.ts +1 -1
  281. package/types/components/Icon/__generated__/ReorderIcon.d.ts +1 -1
  282. package/types/components/Icon/__generated__/ReplacementCarIcon.d.ts +1 -1
  283. package/types/components/Icon/__generated__/ReplyIcon.d.ts +1 -1
  284. package/types/components/Icon/__generated__/ResetIcon.d.ts +1 -1
  285. package/types/components/Icon/__generated__/RideIcon.d.ts +1 -1
  286. package/types/components/Icon/__generated__/RoofBoxIcon.d.ts +1 -1
  287. package/types/components/Icon/__generated__/SealCheckIcon.d.ts +1 -1
  288. package/types/components/Icon/__generated__/SearchCarIcon.d.ts +1 -1
  289. package/types/components/Icon/__generated__/SearchIcon.d.ts +1 -1
  290. package/types/components/Icon/__generated__/SearchPeopleIcon.d.ts +1 -1
  291. package/types/components/Icon/__generated__/SedanIcon.d.ts +1 -1
  292. package/types/components/Icon/__generated__/ServiceBatteryIcon.d.ts +1 -1
  293. package/types/components/Icon/__generated__/ServiceCleaningIcon.d.ts +1 -1
  294. package/types/components/Icon/__generated__/ServiceFuelIcon.d.ts +1 -1
  295. package/types/components/Icon/__generated__/ServiceHealingIcon.d.ts +1 -1
  296. package/types/components/Icon/__generated__/ServiceLockedIcon.d.ts +1 -1
  297. package/types/components/Icon/__generated__/ServiceTollsIcon.d.ts +1 -1
  298. package/types/components/Icon/__generated__/ServiceUnlockedIcon.d.ts +1 -1
  299. package/types/components/Icon/__generated__/SettingsIcon.d.ts +1 -1
  300. package/types/components/Icon/__generated__/ShareAndroidIcon.d.ts +1 -1
  301. package/types/components/Icon/__generated__/ShareIcon.d.ts +1 -1
  302. package/types/components/Icon/__generated__/ShareIosIcon.d.ts +1 -1
  303. package/types/components/Icon/__generated__/ShieldCheckIcon.d.ts +1 -1
  304. package/types/components/Icon/__generated__/ShieldIcon.d.ts +1 -1
  305. package/types/components/Icon/__generated__/ShopIcon.d.ts +1 -1
  306. package/types/components/Icon/__generated__/SkiRackIcon.d.ts +1 -1
  307. package/types/components/Icon/__generated__/SliderIcon.d.ts +1 -1
  308. package/types/components/Icon/__generated__/SmartphoneIcon.d.ts +1 -1
  309. package/types/components/Icon/__generated__/SnowTireIcon.d.ts +1 -1
  310. package/types/components/Icon/__generated__/SocialFacebookIcon.d.ts +1 -1
  311. package/types/components/Icon/__generated__/SocialLinkedinIcon.d.ts +1 -1
  312. package/types/components/Icon/__generated__/SocialTwitterIcon.d.ts +1 -1
  313. package/types/components/Icon/__generated__/SocialWhatsappIcon.d.ts +1 -1
  314. package/types/components/Icon/__generated__/StarHalfIcon.d.ts +1 -1
  315. package/types/components/Icon/__generated__/StarIcon.d.ts +1 -1
  316. package/types/components/Icon/__generated__/StarsIcon.d.ts +1 -1
  317. package/types/components/Icon/__generated__/SubwayIcon.d.ts +1 -1
  318. package/types/components/Icon/__generated__/SuitcaseIcon.d.ts +1 -1
  319. package/types/components/Icon/__generated__/SupportIcon.d.ts +1 -1
  320. package/types/components/Icon/__generated__/SuvIcon.d.ts +1 -1
  321. package/types/components/Icon/__generated__/SynchIcon.d.ts +1 -1
  322. package/types/components/Icon/__generated__/TagIcon.d.ts +1 -1
  323. package/types/components/Icon/__generated__/TimeAlertIcon.d.ts +1 -1
  324. package/types/components/Icon/__generated__/TimeBackwardsIcon.d.ts +1 -1
  325. package/types/components/Icon/__generated__/TimeCalendarIcon.d.ts +1 -1
  326. package/types/components/Icon/__generated__/TimeForwardIcon.d.ts +1 -1
  327. package/types/components/Icon/__generated__/TollsIcon.d.ts +1 -1
  328. package/types/components/Icon/__generated__/TrailerIcon.d.ts +1 -1
  329. package/types/components/Icon/__generated__/TrainIcon.d.ts +1 -1
  330. package/types/components/Icon/__generated__/TriangleDownIcon.d.ts +1 -1
  331. package/types/components/Icon/__generated__/TriangleRightIcon.d.ts +1 -1
  332. package/types/components/Icon/__generated__/TriangleUpIcon.d.ts +1 -1
  333. package/types/components/Icon/__generated__/TwitterIcon.d.ts +1 -1
  334. package/types/components/Icon/__generated__/TwoPeopleIcon.d.ts +1 -1
  335. package/types/components/Icon/__generated__/UnfoldIcon.d.ts +1 -1
  336. package/types/components/Icon/__generated__/UnlockedIcon.d.ts +1 -1
  337. package/types/components/Icon/__generated__/UserCheckIcon.d.ts +1 -1
  338. package/types/components/Icon/__generated__/UserIcon.d.ts +1 -1
  339. package/types/components/Icon/__generated__/UserQuestionIcon.d.ts +1 -1
  340. package/types/components/Icon/__generated__/UserShieldIcon.d.ts +1 -1
  341. package/types/components/Icon/__generated__/UserSwitchIcon.d.ts +1 -1
  342. package/types/components/Icon/__generated__/UtilityVanLargeIcon.d.ts +1 -1
  343. package/types/components/Icon/__generated__/UtilityVanMediumIcon.d.ts +1 -1
  344. package/types/components/Icon/__generated__/UtilityVanSmallIcon.d.ts +1 -1
  345. package/types/components/Icon/__generated__/VerifiedSealIcon.d.ts +1 -1
  346. package/types/components/Icon/__generated__/WalkIcon.d.ts +1 -1
  347. package/types/components/Icon/__generated__/WalletIcon.d.ts +1 -1
  348. package/types/components/Icon/__generated__/WarningCircleFilledIcon.d.ts +1 -1
  349. package/types/components/Icon/__generated__/WarningCircleIcon.d.ts +1 -1
  350. package/types/components/Icon/__generated__/WhatsappIcon.d.ts +1 -1
  351. package/types/components/Icon/__generated__/WheelIcon.d.ts +1 -1
  352. package/types/components/Icon/__generated__/WheelchairIcon.d.ts +1 -1
  353. package/types/components/Icon/__generated__/WrenchIcon.d.ts +1 -1
  354. package/types/components/Icon/__generated__/YingyangIcon.d.ts +1 -1
  355. package/types/components/Icon/index.d.ts +2 -2
  356. package/types/components/Modal/ModalBody.d.ts +5 -4
  357. package/types/components/Modal/ModalFooter.d.ts +4 -3
  358. package/types/components/Modal/index.d.ts +1 -1
  359. package/types/components/PhotoDropzone/index.d.ts +1 -1
  360. package/types/components/Popover/index.d.ts +4 -3
  361. package/types/components/Rating/RatingCompact.d.ts +2 -1
  362. package/types/components/Rating/RatingIcons.d.ts +2 -2
  363. package/types/components/Rating/RatingInput.d.ts +1 -1
  364. package/types/components/Rating/RatingLabel.d.ts +3 -1
  365. package/types/components/Rating/index.d.ts +3 -3
  366. package/types/components/Tabs/index.d.ts +16 -6
  367. package/types/components/utils/index.d.ts +0 -1
  368. package/types/hooks/useBreakpoint.d.ts +1 -1
  369. package/types/index.d.ts +1 -1
  370. package/components/Button/Button.js +0 -33
  371. package/components/Button/Button.js.map +0 -1
  372. package/components/Button/Link.js +0 -33
  373. package/components/Button/Link.js.map +0 -1
  374. package/components/Button/index.js +0 -9
  375. package/components/Button/index.js.map +0 -1
  376. package/styles/components/Button/index.scss +0 -2
  377. package/styles/components/Button/legacy.scss +0 -348
  378. package/types/components/Button/Button.d.ts +0 -28
  379. package/types/components/Button/Link.d.ts +0 -28
  380. package/types/components/Button/index.d.ts +0 -141
  381. package/types/components/utils/isExpectedReactComponent.d.ts +0 -3
  382. package/types/components/utils/isExpectedReactComponent.spec.d.ts +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.js","sources":["../../../src/components/Alerter/Alert.tsx"],"sourcesContent":["import React, { FunctionComponent, useEffect, useMemo } from \"react\"\nimport ReachAlert from \"@reach/alert\"\nimport cx from \"classnames\"\n\nimport { Icon, IconColorsType, IconSources } from \"../Icon\"\nimport { Timer } from \"../utils\"\n\nexport type AlertStatus = \"info\" | \"success\" | \"error\"\n\nexport type AlertType = FunctionComponent<{\n status?: AlertStatus\n dismiss: () => void\n}>\n\nconst ALERT_TIMEOUT = 3000\n\nconst STATUS_ICONS_MAP: { [k in AlertStatus]: IconSources } = {\n info: \"infoFilled\",\n success: \"checkCircle\",\n error: \"contextualWarningCircleFilled\",\n}\n\nconst STATUS_ICON_COLOR_MAP: { [k in AlertStatus]: IconColorsType } = {\n info: \"infoAlt\",\n success: \"success\",\n error: \"error\",\n}\n\nconst STATUS_ICON_CLASS_MAP: { [k in AlertStatus]: string } = {\n info: \"cobalt-alert--info\",\n success: \"cobalt-alert--success\",\n error: \"cobalt-alert--error\",\n}\n\nconst Alert: AlertType = ({ children, status = \"info\", dismiss }) => {\n const icon = STATUS_ICONS_MAP[status]\n ? STATUS_ICONS_MAP[status]\n : \"infoFilled\"\n\n const iconColor: IconColorsType = STATUS_ICON_COLOR_MAP[status]\n ? STATUS_ICON_COLOR_MAP[status]\n : \"infoAlt\"\n\n const className = STATUS_ICON_CLASS_MAP[status]\n ? STATUS_ICON_CLASS_MAP[status]\n : \"cobalt-alert--info\"\n\n const alertTimer = useMemo(() => new Timer(dismiss, ALERT_TIMEOUT), [])\n\n useEffect(() => {\n alertTimer.run()\n }, [])\n\n const onMouseEnter = () => alertTimer.pause()\n const onMouseLeave = () => alertTimer.run()\n\n return (\n <ReachAlert\n className={cx(\"cobalt-alert\", className)}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n >\n <div className=\"cobalt-alert__wrapper\">\n <Icon\n source={icon}\n size={20}\n color={iconColor}\n className=\"cobalt-alert__icon\"\n />\n <span className=\"cobalt-alert__content\">{children}</span>\n </div>\n </ReachAlert>\n )\n}\n\nexport default Alert\n"],"names":[],"mappings":";;;;;;;AAcA,MAAM,aAAa,GAAG,IAAI,CAAA;AAE1B,MAAM,gBAAgB,GAAwC;AAC5D,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,KAAK,EAAE,+BAA+B;CACvC,CAAA;AAED,MAAM,qBAAqB,GAA2C;AACpE,IAAA,IAAI,EAAE,SAAS;AACf,IAAA,OAAO,EAAE,SAAS;AAClB,IAAA,KAAK,EAAE,OAAO;CACf,CAAA;AAED,MAAM,qBAAqB,GAAmC;AAC5D,IAAA,IAAI,EAAE,oBAAoB;AAC1B,IAAA,OAAO,EAAE,uBAAuB;AAChC,IAAA,KAAK,EAAE,qBAAqB;CAC7B,CAAA;AAED,MAAM,KAAK,GAAc,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,OAAO,EAAE,KAAI;AAClE,IAAA,MAAM,IAAI,GAAG,gBAAgB,CAAC,MAAM,CAAC;AACnC,UAAE,gBAAgB,CAAC,MAAM,CAAC;UACxB,YAAY,CAAA;AAEhB,IAAA,MAAM,SAAS,GAAmB,qBAAqB,CAAC,MAAM,CAAC;AAC7D,UAAE,qBAAqB,CAAC,MAAM,CAAC;UAC7B,SAAS,CAAA;AAEb,IAAA,MAAM,SAAS,GAAG,qBAAqB,CAAC,MAAM,CAAC;AAC7C,UAAE,qBAAqB,CAAC,MAAM,CAAC;UAC7B,oBAAoB,CAAA;AAExB,IAAA,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,IAAI,KAAK,CAAC,OAAO,EAAE,aAAa,CAAC,EAAE,EAAE,CAAC,CAAA;IAEvE,SAAS,CAAC,MAAK;QACb,UAAU,CAAC,GAAG,EAAE,CAAA;KACjB,EAAE,EAAE,CAAC,CAAA;IAEN,MAAM,YAAY,GAAG,MAAM,UAAU,CAAC,KAAK,EAAE,CAAA;IAC7C,MAAM,YAAY,GAAG,MAAM,UAAU,CAAC,GAAG,EAAE,CAAA;AAE3C,IAAA,QACE,KAAC,CAAA,aAAA,CAAA,UAAU,IACT,SAAS,EAAE,EAAE,CAAC,cAAc,EAAE,SAAS,CAAC,EACxC,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAAA;QAE1B,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAC,uBAAuB,EAAA;AACpC,YAAA,KAAA,CAAA,aAAA,CAAC,IAAI,EACH,EAAA,MAAM,EAAE,IAAI,EACZ,IAAI,EAAE,EAAE,EACR,KAAK,EAAE,SAAS,EAChB,SAAS,EAAC,oBAAoB,EAC9B,CAAA;YACF,KAAM,CAAA,aAAA,CAAA,MAAA,EAAA,EAAA,SAAS,EAAC,uBAAuB,EAAA,EAAE,QAAQ,CAAQ,CACrD,CACK,EACd;AACH;;;;"}
1
+ {"version":3,"file":"Alert.js","sources":["../../../src/components/Alerter/Alert.tsx"],"sourcesContent":["import React, { useEffect, useMemo } from \"react\"\nimport ReachAlert from \"@reach/alert\"\nimport cx from \"classnames\"\n\nimport { Icon, IconColorsType, IconSources } from \"../Icon\"\nimport { Timer } from \"../utils\"\n\nexport type AlertStatus = \"info\" | \"success\" | \"error\"\n\nexport type AlertType = (props: {\n children?: React.ReactNode\n status?: AlertStatus\n dismiss: () => void\n}) => React.ReactElement\n\nconst ALERT_TIMEOUT = 3000\n\nconst STATUS_ICONS_MAP: { [k in AlertStatus]: IconSources } = {\n info: \"infoFilled\",\n success: \"checkCircle\",\n error: \"contextualWarningCircleFilled\",\n}\n\nconst STATUS_ICON_COLOR_MAP: { [k in AlertStatus]: IconColorsType } = {\n info: \"infoAlt\",\n success: \"success\",\n error: \"error\",\n}\n\nconst STATUS_ICON_CLASS_MAP: { [k in AlertStatus]: string } = {\n info: \"cobalt-alert--info\",\n success: \"cobalt-alert--success\",\n error: \"cobalt-alert--error\",\n}\n\nconst Alert: AlertType = ({ children, status = \"info\", dismiss }) => {\n const icon = STATUS_ICONS_MAP[status]\n ? STATUS_ICONS_MAP[status]\n : \"infoFilled\"\n\n const iconColor: IconColorsType = STATUS_ICON_COLOR_MAP[status]\n ? STATUS_ICON_COLOR_MAP[status]\n : \"infoAlt\"\n\n const className = STATUS_ICON_CLASS_MAP[status]\n ? STATUS_ICON_CLASS_MAP[status]\n : \"cobalt-alert--info\"\n\n const alertTimer = useMemo(() => new Timer(dismiss, ALERT_TIMEOUT), [])\n\n useEffect(() => {\n alertTimer.run()\n }, [])\n\n const onMouseEnter = () => alertTimer.pause()\n const onMouseLeave = () => alertTimer.run()\n\n return (\n <ReachAlert\n className={cx(\"cobalt-alert\", className)}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n >\n <div className=\"cobalt-alert__wrapper\">\n <Icon\n source={icon}\n size={20}\n color={iconColor}\n className=\"cobalt-alert__icon\"\n />\n <span className=\"cobalt-alert__content\">{children}</span>\n </div>\n </ReachAlert>\n )\n}\n\nexport default Alert\n"],"names":[],"mappings":";;;;;;;AAeA,MAAM,aAAa,GAAG,IAAI,CAAA;AAE1B,MAAM,gBAAgB,GAAwC;AAC5D,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,KAAK,EAAE,+BAA+B;CACvC,CAAA;AAED,MAAM,qBAAqB,GAA2C;AACpE,IAAA,IAAI,EAAE,SAAS;AACf,IAAA,OAAO,EAAE,SAAS;AAClB,IAAA,KAAK,EAAE,OAAO;CACf,CAAA;AAED,MAAM,qBAAqB,GAAmC;AAC5D,IAAA,IAAI,EAAE,oBAAoB;AAC1B,IAAA,OAAO,EAAE,uBAAuB;AAChC,IAAA,KAAK,EAAE,qBAAqB;CAC7B,CAAA;AAED,MAAM,KAAK,GAAc,CAAC,EAAE,QAAQ,EAAE,MAA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+1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/Alerter/index.tsx"],"sourcesContent":["import React, { useContext, useReducer, FunctionComponent } from \"react\"\nimport { nanoid } from \"nanoid\"\nimport Portal from \"@reach/portal\"\nimport cx from \"classnames\"\nimport { useTransition, animated, config } from \"@react-spring/web\"\n\nimport Alert, { AlertType } from \"./Alert\"\nimport useBreakpoint from \"../../hooks/useBreakpoint\"\nimport { remToPx } from \"../utils\"\n\ntype AlertPropsType = Parameters<AlertType>[0]\n\nenum AlertActionType {\n send = \"send\",\n dismiss = \"dismiss\",\n}\n\nexport type AlertReducerActionData = {\n id: string\n status: AlertPropsType[\"status\"]\n message: AlertPropsType[\"children\"]\n // mandatory only for sent alerts\n dismiss?: AlertPropsType[\"dismiss\"]\n}\n\n// We omit props type private to the Alerter\ntype SendAlertParameters = Omit<AlertReducerActionData, \"dismiss\" | \"id\">\ntype DismissAlertParameters = Omit<AlertReducerActionData, \"dismiss\">\n// We omit types only use in the reducer\ntype AlertsQueue = (Omit<AlertReducerActionData, \"dismiss\"> & {\n dismiss: NonNullable<AlertReducerActionData[\"dismiss\"]>\n})[]\n\nconst hasDismiss = (\n alertData: AlertReducerActionData\n): alertData is AlertsQueue[0] => \"dismiss\" in alertData\n\nconst initialQueue: AlertsQueue = []\n\nfunction alertsReducer(\n queue: AlertsQueue,\n action: AlertReducerActionData & { type: AlertActionType }\n): AlertsQueue {\n const { type, ...alertData } = action\n if (type === AlertActionType.dismiss) {\n return queue.filter((a) => a.id !== alertData.id)\n }\n // We can't send alerts in the queue without providing a way to dismiss it\n if (type === AlertActionType.send && hasDismiss(alertData))\n return [alertData].concat(queue)\n return queue\n}\n\nconst defaultSendAlert: React.Dispatch<SendAlertParameters> = () => initialQueue // we never actually use this\nconst AlertsContext = React.createContext({\n queue: initialQueue,\n sendAlert: defaultSendAlert, // just to mock out the dispatch type and make it not optional\n})\n\nconst AlertsProvider: FunctionComponent = (props) => {\n const [queue, dispatch] = useReducer(alertsReducer, initialQueue)\n const dismissAlert: React.Dispatch<DismissAlertParameters> = (args) => {\n dispatch({\n type: AlertActionType.dismiss,\n ...args,\n })\n }\n const sendAlert: React.Dispatch<SendAlertParameters> = (args) => {\n const alertData = { ...args, id: nanoid() }\n dispatch({\n type: AlertActionType.send,\n ...alertData,\n dismiss: () => dismissAlert(alertData),\n })\n }\n return <AlertsContext.Provider value={{ queue, sendAlert }} {...props} />\n}\n\n// Alerter hook\nexport const useAlerts = () => {\n return useContext(AlertsContext)\n}\n\nconst InnerAlerter = ({ children }: { children: React.ReactNode }) => {\n const { queue } = useAlerts()\n const { isMobile } = useBreakpoint()\n\n const transformSpring = {\n from: remToPx(2),\n enter: 0,\n leave: isMobile ? remToPx(2) : remToPx(5),\n }\n\n const transition = useTransition(queue, {\n keys: queue.map((a) => a.id),\n from: { opacity: 0, transform: transformSpring.from },\n enter: { opacity: 1, transform: transformSpring.enter },\n leave: { opacity: 0, transform: transformSpring.leave },\n config: config.stiff,\n })\n\n return (\n <>\n <Portal>\n <div\n className={cx(\"cobalt-alerts\", {\n \"cobalt-alerts--mobile\": isMobile,\n })}\n >\n {transition((style, alertData) => (\n <animated.div\n key={alertData.id}\n style={{\n opacity: style.opacity,\n ...(isMobile\n ? { translateY: style.transform }\n : { translateX: style.transform }),\n }}\n >\n <Alert status={alertData.status} dismiss={alertData.dismiss}>\n {alertData.message}\n </Alert>\n </animated.div>\n ))}\n </div>\n </Portal>\n {children}\n </>\n )\n}\n\nconst Alerter = (props: { children: React.ReactNode }) => {\n return (\n <AlertsProvider>\n <InnerAlerter {...props} />\n </AlertsProvider>\n )\n}\n\nexport default Alerter\n"],"names":[],"mappings":";;;;;;;;;;AAYA,IAAK,eAGJ,CAAA;AAHD,CAAA,UAAK,eAAe,EAAA;AAClB,IAAA,eAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,eAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACrB,CAAC,EAHI,eAAe,KAAf,e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AE;QACvD,MAAM,EAAE,MAAM,CAAC,KAAK;AACrB,KAAA,CAAC,CAAA;AAEF,IAAA,QACE,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA;AACE,QAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,IAAA;AACL,YAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE;AAC7B,oBAAA,uBAAuB,EAAE,QAAQ;iBAClC,CAAC,EAAA,EAED,UAAU,CAAC,CAAC,KAAK,EAAE,SAAS,MAC3B,oBAAC,QAAQ,CAAC,GAAG,EAAA,EACX,GAAG,EAAE,SAAS,CAAC,EAAE,EACjB,KAAK,EAAE;oBACL,OAAO,EAAE,KAAK,CAAC,OAAO;AACtB,oBAAA,IAAI,QAAQ;AACV,0BAAE,EAAE,UAAU,EAAE,KAAK,CAAC,SAAS,EAAE;0BAC/B,EAAE,UAAU,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;AACrC,iBAAA,EAAA;gBAED,KAAC,CAAA,aAAA,CAAA,KAAK,IAAC,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,OAAO,EAAA,EACxD,SAAS,CAAC,OAAO,CACZ,CACK,CAChB,CAAC,CACE,CACC;QACR,QAAQ,CACR,EACJ;AACH,CAAC,CAAA;AAED,MAAM,OAAO,GAAG,CAAC,KAAoC,KAAI;IACvD,QACE,oBAAC,cAAc,EAAA,IAAA;AACb,QAAA,KAAA,CAAA,aAAA,CAAC,YAAY,EAAK,EAAA,GAAA,KAAK,EAAI,CAAA,CACZ,EAClB;AACH;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Alerter/index.tsx"],"sourcesContent":["import React, { useContext, useReducer } from \"react\"\nimport { nanoid } from \"nanoid\"\nimport Portal from \"@reach/portal\"\nimport cx from \"classnames\"\nimport { useTransition, animated, config } from \"@react-spring/web\"\n\nimport Alert, { AlertType } from \"./Alert\"\nimport useBreakpoint from \"../../hooks/useBreakpoint\"\nimport { remToPx } from \"../utils\"\n\ntype AlertPropsType = Parameters<AlertType>[0]\n\nenum AlertActionType {\n send = \"send\",\n dismiss = \"dismiss\",\n}\n\nexport type AlertReducerActionData = {\n id: string\n status: AlertPropsType[\"status\"]\n message: AlertPropsType[\"children\"]\n // mandatory only for sent alerts\n dismiss?: AlertPropsType[\"dismiss\"]\n}\n\n// We omit props type private to the Alerter\ntype SendAlertParameters = Omit<AlertReducerActionData, \"dismiss\" | \"id\">\ntype DismissAlertParameters = Omit<AlertReducerActionData, \"dismiss\">\n// We omit types only use in the reducer\ntype AlertsQueue = (Omit<AlertReducerActionData, \"dismiss\"> & {\n dismiss: NonNullable<AlertReducerActionData[\"dismiss\"]>\n})[]\n\nconst hasDismiss = (\n alertData: AlertReducerActionData\n): alertData is AlertsQueue[0] => \"dismiss\" in alertData\n\nconst initialQueue: AlertsQueue = []\n\nfunction alertsReducer(\n queue: AlertsQueue,\n action: AlertReducerActionData & { type: AlertActionType }\n): AlertsQueue {\n const { type, ...alertData } = action\n if (type === AlertActionType.dismiss) {\n return queue.filter((a) => a.id !== alertData.id)\n }\n // We can't send alerts in the queue without providing a way to dismiss it\n if (type === AlertActionType.send && hasDismiss(alertData))\n return [alertData].concat(queue)\n return queue\n}\n\nconst defaultSendAlert: React.Dispatch<SendAlertParameters> = () => initialQueue // we never actually use this\nconst AlertsContext = React.createContext({\n queue: initialQueue,\n sendAlert: defaultSendAlert, // just to mock out the dispatch type and make it not optional\n})\n\nconst AlertsProvider = (props: { children?: React.ReactNode }) => {\n const [queue, dispatch] = useReducer(alertsReducer, initialQueue)\n const dismissAlert: React.Dispatch<DismissAlertParameters> = (args) => {\n dispatch({\n type: AlertActionType.dismiss,\n ...args,\n })\n }\n const sendAlert: React.Dispatch<SendAlertParameters> = (args) => {\n const alertData = { ...args, id: nanoid() }\n dispatch({\n type: AlertActionType.send,\n ...alertData,\n dismiss: () => dismissAlert(alertData),\n })\n }\n return <AlertsContext.Provider value={{ queue, sendAlert }} {...props} />\n}\n\n// Alerter hook\nexport const useAlerts = () => {\n return useContext(AlertsContext)\n}\n\nconst InnerAlerter = ({ children }: { children: React.ReactNode }) => {\n const { queue } = useAlerts()\n const { isMobile } = useBreakpoint()\n\n const transformSpring = {\n from: remToPx(2),\n enter: 0,\n leave: isMobile ? remToPx(2) : remToPx(5),\n }\n\n const transition = useTransition(queue, {\n keys: queue.map((a) => a.id),\n from: { opacity: 0, transform: transformSpring.from },\n enter: { opacity: 1, transform: transformSpring.enter },\n leave: { opacity: 0, transform: transformSpring.leave },\n config: config.stiff,\n })\n\n return (\n <>\n <Portal>\n <div\n className={cx(\"cobalt-alerts\", {\n \"cobalt-alerts--mobile\": isMobile,\n })}\n >\n {transition((style, alertData) => (\n <animated.div\n key={alertData.id}\n style={{\n opacity: style.opacity,\n ...(isMobile\n ? { translateY: style.transform }\n : { translateX: style.transform }),\n }}\n >\n <Alert status={alertData.status} dismiss={alertData.dismiss}>\n {alertData.message}\n </Alert>\n </animated.div>\n ))}\n </div>\n </Portal>\n {children}\n </>\n )\n}\n\nconst Alerter = (props: { children: React.ReactNode }) => {\n return (\n <AlertsProvider>\n <InnerAlerter {...props} />\n </AlertsProvider>\n )\n}\n\nexport default Alerter\n"],"names":[],"mappings":";;;;;;;;;;AAYA,IAAK,eAGJ,CAAA;AAHD,CAAA,UAAK,eAAe,EAAA;AAClB,IAAA,eAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,eAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACrB,CAAC,EAHI,eAAe,KAAf,eAAe,GAGnB,EAAA,CAAA,CAAA,CAAA;AAkBD,MAAM,UAAU,GAAG,CACjB,SAAiC,KACD,SAAS,IAAI,SAAS,CAAA;AAExD,MAAM,YAAY,GAAgB,EAAE,CAAA;AAEpC,SAAS,aAAa,CACpB,KAAkB,EAClB,MAA0D,EAAA;IA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AAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE;AAC7B,oBAAA,uBAAuB,EAAE,QAAQ;iBAClC,CAAC,EAAA,EAED,UAAU,CAAC,CAAC,KAAK,EAAE,SAAS,MAC3B,oBAAC,QAAQ,CAAC,GAAG,EAAA,EACX,GAAG,EAAE,SAAS,CAAC,EAAE,EACjB,KAAK,EAAE;oBACL,OAAO,EAAE,KAAK,CAAC,OAAO;AACtB,oBAAA,IAAI,QAAQ;AACV,0BAAE,EAAE,UAAU,EAAE,KAAK,CAAC,SAAS,EAAE;0BAC/B,EAAE,UAAU,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;AACrC,iBAAA,EAAA;gBAED,KAAC,CAAA,aAAA,CAAA,KAAK,IAAC,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,OAAO,EAAA,EACxD,SAAS,CAAC,OAAO,CACZ,CACK,CAChB,CAAC,CACE,CACC;QACR,QAAQ,CACR,EACJ;AACH,CAAC,CAAA;AAED,MAAM,OAAO,GAAG,CAAC,KAAoC,KAAI;IACvD,QACE,oBAAC,cAAc,EAAA,IAAA;AACb,QAAA,KAAA,CAAA,aAAA,CAAC,YAAY,EAAK,EAAA,GAAA,KAAK,EAAI,CAAA,CACZ,EAClB;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/BulletList/index.tsx"],"sourcesContent":["import React from \"react\"\nimport classNames from \"classnames\"\nimport { Icon } from \"../Icon\"\n\ninterface BulletListProps {\n children: React.ReactNode\n iconPosition?: \"top\" | \"centered\"\n}\n\nexport const BulletList = ({\n children,\n iconPosition = \"centered\",\n}: BulletListProps) => (\n <ul\n className={classNames(\"cobalt-BulletList\", {\n \"cobalt-BulletList--iconPositionTop\": iconPosition === \"top\",\n })}\n >\n {children}\n </ul>\n)\n\ninterface BulletListItemProps {\n children: React.ReactNode\n icon: typeof Icon\n}\n\nexport const BulletListItem = ({ children, icon }: BulletListItemProps) => (\n <li className=\"cobalt-BulletListItem\">\n <span className=\"cobalt-BulletListItem__Icon\">{icon}</span>\n <p className=\"cobalt-BulletListItem__Content\">{children}</p>\n </li>\n)\n"],"names":["classNames"],"mappings":";;;MASa,UAAU,GAAG,CAAC,EACzB,QAAQ,EACR,YAAY,GAAG,UAAU,GACT,MAChB,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EACE,SAAS,EAAEA,EAAU,CAAC,mBAAmB,EAAE;QACzC,oCAAoC,EAAE,YAAY,KAAK,KAAK;AAC7D,KAAA,CAAC,EAED,EAAA,QAAQ,CACN,EACN;AAOY,MAAA,cAAc,GAAG,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAuB,MACpE,KAAI,CAAA,aAAA,CAAA,IAAA,EAAA,EAAA,SAAS,EAAC,uBAAuB,EAAA;AACnC,IAAA,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,6BAA6B,EAAA,EAAE,IAAI,CAAQ;IAC3D,KAAG,CAAA,aAAA,CAAA,GAAA,EAAA,EAAA,SAAS,EAAC,gCAAgC,EAAA,EAAE,QAAQ,CAAK,CACzD;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/BulletList/index.tsx"],"sourcesContent":["import React from \"react\"\nimport classNames from \"classnames\"\nimport { Icon } from \"../Icon\"\n\ninterface BulletListProps {\n children: React.ReactNode\n iconPosition?: \"top\" | \"centered\"\n}\n\nexport const BulletList = ({\n children,\n iconPosition = \"centered\",\n}: BulletListProps) => (\n <ul\n className={classNames(\"cobalt-BulletList\", {\n \"cobalt-BulletList--iconPositionTop\": iconPosition === \"top\",\n })}\n >\n {children}\n </ul>\n)\n\ninterface BulletListItemProps {\n children: React.ReactNode\n icon: ReturnType<typeof Icon>\n}\n\nexport const BulletListItem = ({ children, icon }: BulletListItemProps) => (\n <li className=\"cobalt-BulletListItem\">\n <span className=\"cobalt-BulletListItem__Icon\">{icon}</span>\n <p className=\"cobalt-BulletListItem__Content\">{children}</p>\n </li>\n)\n"],"names":["classNames"],"mappings":";;;MASa,UAAU,GAAG,CAAC,EACzB,QAAQ,EACR,YAAY,GAAG,UAAU,GACT,MAChB,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EACE,SAAS,EAAEA,EAAU,CAAC,mBAAmB,EAAE;QACzC,oCAAoC,EAAE,YAAY,KAAK,KAAK;AAC7D,KAAA,CAAC,EAED,EAAA,QAAQ,CACN,EACN;AAOY,MAAA,cAAc,GAAG,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAuB,MACpE,KAAI,CAAA,aAAA,CAAA,IAAA,EAAA,EAAA,SAAS,EAAC,uBAAuB,EAAA;AACnC,IAAA,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,6BAA6B,EAAA,EAAE,IAAI,CAAQ;IAC3D,KAAG,CAAA,aAAA,CAAA,GAAA,EAAA,EAAA,SAAS,EAAC,gCAAgC,EAAA,EAAE,QAAQ,CAAK,CACzD;;;;"}
@@ -2,7 +2,6 @@ import '../Icon/index.js';
2
2
  import React, { forwardRef } from 'react';
3
3
  import LoadingIcon from '../Icon/__generated__/LoadingIcon.js';
4
4
 
5
- const isLinkProps = (props) => "href" in props && !!props.href;
6
5
  const _Button = forwardRef((props, ref) => {
7
6
  const { disabled, loading, children, ...restProps } = props;
8
7
  return (React.createElement("button", { ref: ref, "aria-disabled": disabled, "aria-busy": loading, disabled: disabled, ...restProps },
@@ -19,5 +18,5 @@ const Link = forwardRef((props, ref) => {
19
18
  Link.displayName = "link";
20
19
  const Button = Object.assign(_Button, { Link });
21
20
 
22
- export { Button as default, isLinkProps };
21
+ export { Button as default };
23
22
  //# sourceMappingURL=ButtonComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonComponent.js","sources":["../../../src/components/Buttons/ButtonComponent.tsx"],"sourcesContent":["import { LoadingIcon } from \"../Icon\"\nimport React, { forwardRef } from \"react\"\n\n// Button props\nexport type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {\n loading?: boolean\n href?: undefined\n}\n\n// Link props\nexport type LinkProps = React.AnchorHTMLAttributes<HTMLAnchorElement> & {\n loading?: boolean\n disabled?: boolean\n href?: string\n}\n\nexport const isLinkProps = (\n props: ButtonProps | LinkProps\n): props is LinkProps => \"href\" in props && !!props.href\n\nconst _Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (props: ButtonProps, ref) => {\n const { disabled, loading, children, ...restProps } = props\n return (\n <button\n ref={ref}\n aria-disabled={disabled}\n aria-busy={loading}\n disabled={disabled}\n {...restProps}\n >\n {loading && <LoadingIcon className=\"cob-Button__loading-icon\" />}\n {children}\n </button>\n )\n }\n)\n_Button.displayName = \"button\"\n\nconst Link = forwardRef<HTMLAnchorElement, LinkProps>(\n (props: LinkProps, ref) => {\n const { disabled, target, rel, loading, children, ...restProps } = props\n return (\n <a\n aria-disabled={disabled}\n data-disabled={disabled}\n aria-busy={loading}\n target={target}\n rel={target && !rel ? \"noopener noreferrer\" : rel}\n ref={ref}\n {...restProps}\n >\n {loading && <LoadingIcon className=\"cob-Button__loading-icon\" />}\n {children}\n </a>\n )\n }\n)\nLink.displayName = \"link\"\n\nconst Button = Object.assign(_Button, { Link })\n\nexport default Button\n"],"names":[],"mappings":";;;;AAgBa,MAAA,WAAW,GAAG,CACzB,KAA8B,KACP,MAAM,IAAI,KAAK,IAAI,CAAC,CAAC,KAAK,CAAC,KAAI;AAExD,MAAM,OAAO,GAAG,UAAU,CACxB,CAAC,KAAkB,EAAE,GAAG,KAAI;AAC1B,IAAA,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAA;AAC3D,IAAA,QACE,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EACE,GAAG,EAAE,GAAG,EACO,eAAA,EAAA,QAAQ,EACZ,WAAA,EAAA,OAAO,EAClB,QAAQ,EAAE,QAAQ,KACd,SAAS,EAAA;AAEZ,QAAA,OAAO,IAAI,KAAC,CAAA,aAAA,CAAA,WAAW,IAAC,SAAS,EAAC,0BAA0B,EAAG,CAAA;QAC/D,QAAQ,CACF,EACV;AACH,CAAC,CACF,CAAA;AACD,OAAO,CAAC,WAAW,GAAG,QAAQ,CAAA;AAE9B,MAAM,IAAI,GAAG,UAAU,CACrB,CAAC,KAAgB,EAAE,GAAG,KAAI;AACxB,IAAA,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAA;AACxE,IAAA,QACE,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAA,eAAA,EACiB,QAAQ,EAAA,eAAA,EACR,QAAQ,EAAA,WAAA,EACZ,OAAO,EAClB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,IAAI,CAAC,GAAG,GAAG,qBAAqB,GAAG,GAAG,EACjD,GAAG,EAAE,GAAG,KACJ,SAAS,EAAA;AAEZ,QAAA,OAAO,IAAI,KAAC,CAAA,aAAA,CAAA,WAAW,IAAC,SAAS,EAAC,0BAA0B,EAAG,CAAA;QAC/D,QAAQ,CACP,EACL;AACH,CAAC,CACF,CAAA;AACD,IAAI,CAAC,WAAW,GAAG,MAAM,CAAA;AAEzB,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE;;;;"}
1
+ {"version":3,"file":"ButtonComponent.js","sources":["../../../src/components/Buttons/ButtonComponent.tsx"],"sourcesContent":["import { LoadingIcon } from \"../Icon\"\nimport React, { forwardRef } from \"react\"\n\n// Button props\nexport type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {\n loading?: boolean\n href?: undefined\n}\n\n// Link props\nexport type LinkProps = React.AnchorHTMLAttributes<HTMLAnchorElement> & {\n loading?: boolean\n disabled?: boolean\n href?: string\n}\n\nexport const isLinkProps = (\n props: ButtonProps | LinkProps\n): props is LinkProps => \"href\" in props && !!props.href\n\nconst _Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (props: ButtonProps, ref) => {\n const { disabled, loading, children, ...restProps } = props\n return (\n <button\n ref={ref}\n aria-disabled={disabled}\n aria-busy={loading}\n disabled={disabled}\n {...restProps}\n >\n {loading && <LoadingIcon className=\"cob-Button__loading-icon\" />}\n {children}\n </button>\n )\n }\n)\n_Button.displayName = \"button\"\n\nconst Link = forwardRef<HTMLAnchorElement, LinkProps>(\n (props: LinkProps, ref) => {\n const { disabled, target, rel, loading, children, ...restProps } = props\n return (\n <a\n aria-disabled={disabled}\n data-disabled={disabled}\n aria-busy={loading}\n target={target}\n rel={target && !rel ? \"noopener noreferrer\" : rel}\n ref={ref}\n {...restProps}\n >\n {loading && <LoadingIcon className=\"cob-Button__loading-icon\" />}\n {children}\n </a>\n )\n }\n)\nLink.displayName = \"link\"\n\nconst Button = Object.assign(_Button, { Link })\n\nexport default Button\n"],"names":[],"mappings":";;;;AAoBA,MAAM,OAAO,GAAG,UAAU,CACxB,CAAC,KAAkB,EAAE,GAAG,KAAI;AAC1B,IAAA,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAA;AAC3D,IAAA,QACE,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EACE,GAAG,EAAE,GAAG,EACO,eAAA,EAAA,QAAQ,EACZ,WAAA,EAAA,OAAO,EAClB,QAAQ,EAAE,QAAQ,KACd,SAAS,EAAA;AAEZ,QAAA,OAAO,IAAI,KAAC,CAAA,aAAA,CAAA,WAAW,IAAC,SAAS,EAAC,0BAA0B,EAAG,CAAA;QAC/D,QAAQ,CACF,EACV;AACH,CAAC,CACF,CAAA;AACD,OAAO,CAAC,WAAW,GAAG,QAAQ,CAAA;AAE9B,MAAM,IAAI,GAAG,UAAU,CACrB,CAAC,KAAgB,EAAE,GAAG,KAAI;AACxB,IAAA,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAA;AACxE,IAAA,QACE,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAA,eAAA,EACiB,QAAQ,EAAA,eAAA,EACR,QAAQ,EAAA,WAAA,EACZ,OAAO,EAClB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,IAAI,CAAC,GAAG,GAAG,qBAAqB,GAAG,GAAG,EACjD,GAAG,EAAE,GAAG,KACJ,SAAS,EAAA;AAEZ,QAAA,OAAO,IAAI,KAAC,CAAA,aAAA,CAAA,WAAW,IAAC,SAAS,EAAC,0BAA0B,EAAG,CAAA;QAC/D,QAAQ,CACP,EACL;AACH,CAAC,CACF,CAAA;AACD,IAAI,CAAC,WAAW,GAAG,MAAM,CAAA;AAEzB,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE;;;;"}
@@ -3,13 +3,9 @@ import cx from 'classnames';
3
3
  import GhostButton from './GhostButton/index.js';
4
4
  import InversedButton from './InversedButton/index.js';
5
5
  import DefaultButton from './DefaultButton/index.js';
6
- import Button from '../Button/Button.js';
7
- import Link from '../Button/Link.js';
8
6
 
9
7
  const isButton = (component) => React.isValidElement(component) &&
10
- (component.type === Button ||
11
- component.type === Link ||
12
- component.type === GhostButton ||
8
+ (component.type === GhostButton ||
13
9
  component.type === GhostButton.Link ||
14
10
  component.type === InversedButton ||
15
11
  component.type === InversedButton.Link ||
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonsGroup.js","sources":["../../../src/components/Buttons/ButtonsGroup.tsx"],"sourcesContent":["import React, { Children } from \"react\"\nimport cx from \"classnames\"\n\nimport GhostButton from \"./GhostButton\"\nimport InversedButton from \"./InversedButton\"\nimport DefaultButton from \"./DefaultButton\"\nimport LegacyButton from \"../Button/Button\"\nimport LegacyLink from \"../Button/Link\"\nimport { AllButtonsPropsType } from \"./\"\n\nexport interface ButtonsGroupProps {\n className?: string\n children: React.ReactNode\n align?: \"fullWidth\" | \"right\" | \"center\"\n}\n\nconst isButton = (\n component: React.ReactNode\n): component is React.ReactElement<AllButtonsPropsType> =>\n React.isValidElement(component) &&\n (component.type === LegacyButton ||\n component.type === LegacyLink ||\n component.type === GhostButton ||\n component.type === GhostButton.Link ||\n component.type === InversedButton ||\n component.type === InversedButton.Link ||\n component.type === DefaultButton ||\n component.type === DefaultButton.Link)\n\nconst ButtonsGroup = ({ className, children, align }: ButtonsGroupProps) => (\n <div\n className={cx(className, \"cobalt-buttons-group\", {\n \"cobalt-buttons-group--right\": align === \"right\",\n \"cobalt-buttons-group--center\": align === \"center\",\n })}\n >\n {Children.toArray(children).map((child, index) =>\n isButton(child)\n ? React.cloneElement(child, {\n key: index,\n className: cx(\"cobalt-buttons-group__item\", {\n \"cobalt-buttons-group__item--fullWidth\": align === \"fullWidth\",\n }),\n fullWidth: align === \"fullWidth\",\n })\n : child\n )}\n </div>\n)\n\nexport default ButtonsGroup\n"],"names":["LegacyButton","LegacyLink"],"mappings":";;;;;;;;AAgBA,MAAM,QAAQ,GAAG,CACf,SAA0B,KAE1B,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC;AAC/B,KAAC,SAAS,CAAC,IAAI,KAAKA,MAAY;QAC9B,SAAS,CAAC,IAAI,KAAKC,IAAU;QAC7B,SAAS,CAAC,IAAI,KAAK,WAAW;AAC9B,QAAA,SAAS,CAAC,IAAI,KAAK,WAAW,CAAC,IAAI;QACnC,SAAS,CAAC,IAAI,KAAK,cAAc;AACjC,QAAA,SAAS,CAAC,IAAI,KAAK,cAAc,CAAC,IAAI;QACtC,SAAS,CAAC,IAAI,KAAK,aAAa;AAChC,QAAA,SAAS,CAAC,IAAI,KAAK,aAAa,CAAC,IAAI,CAAC,CAAA;AAEpC,MAAA,YAAY,GAAG,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAqB,MACrE,6BACE,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,sBAAsB,EAAE;QAC/C,6BAA6B,EAAE,KAAK,KAAK,OAAO;QAChD,8BAA8B,EAAE,KAAK,KAAK,QAAQ;KACnD,CAAC,EAAA,EAED,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,KAC3C,QAAQ,CAAC,KAAK,CAAC;AACb,MAAE,KAAK,CAAC,YAAY,CAAC,KAAK,EAAE;AACxB,QAAA,GAAG,EAAE,KAAK;AACV,QAAA,SAAS,EAAE,EAAE,CAAC,4BAA4B,EAAE;YAC1C,uCAAuC,EAAE,KAAK,KAAK,WAAW;SAC/D,CAAC;QACF,SAAS,EAAE,KAAK,KAAK,WAAW;KACjC,CAAC;AACJ,MAAE,KAAK,CACV,CACG;;;;"}
1
+ {"version":3,"file":"ButtonsGroup.js","sources":["../../../src/components/Buttons/ButtonsGroup.tsx"],"sourcesContent":["import React, { Children } from \"react\"\nimport cx from \"classnames\"\n\nimport GhostButton from \"./GhostButton\"\nimport InversedButton from \"./InversedButton\"\nimport DefaultButton from \"./DefaultButton\"\nimport { AllButtonsPropsType } from \"./\"\n\nexport interface ButtonsGroupProps {\n className?: string\n children: React.ReactNode\n align?: \"fullWidth\" | \"right\" | \"center\"\n}\n\nconst isButton = (\n component: React.ReactNode\n): component is React.ReactElement<AllButtonsPropsType> =>\n React.isValidElement(component) &&\n (component.type === GhostButton ||\n component.type === GhostButton.Link ||\n component.type === InversedButton ||\n component.type === InversedButton.Link ||\n component.type === DefaultButton ||\n component.type === DefaultButton.Link)\n\nconst ButtonsGroup = ({ className, children, align }: ButtonsGroupProps) => (\n <div\n className={cx(className, \"cobalt-buttons-group\", {\n \"cobalt-buttons-group--right\": align === \"right\",\n \"cobalt-buttons-group--center\": align === \"center\",\n })}\n >\n {Children.toArray(children).map((child, index) =>\n isButton(child)\n ? React.cloneElement(child, {\n key: index,\n className: cx(\"cobalt-buttons-group__item\", {\n \"cobalt-buttons-group__item--fullWidth\": align === \"fullWidth\",\n }),\n fullWidth: align === \"fullWidth\",\n })\n : child\n )}\n </div>\n)\n\nexport default ButtonsGroup\n"],"names":[],"mappings":";;;;;;AAcA,MAAM,QAAQ,GAAG,CACf,SAA0B,KAE1B,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC;AAC/B,KAAC,SAAS,CAAC,IAAI,KAAK,WAAW;AAC7B,QAAA,SAAS,CAAC,IAAI,KAAK,WAAW,CAAC,IAAI;QACnC,SAAS,CAAC,IAAI,KAAK,cAAc;AACjC,QAAA,SAAS,CAAC,IAAI,KAAK,cAAc,CAAC,IAAI;QACtC,SAAS,CAAC,IAAI,KAAK,aAAa;AAChC,QAAA,SAAS,CAAC,IAAI,KAAK,aAAa,CAAC,IAAI,CAAC,CAAA;AAEpC,MAAA,YAAY,GAAG,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAqB,MACrE,6BACE,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,sBAAsB,EAAE;QAC/C,6BAA6B,EAAE,KAAK,KAAK,OAAO;QAChD,8BAA8B,EAAE,KAAK,KAAK,QAAQ;KACnD,CAAC,EAAA,EAED,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,KAC3C,QAAQ,CAAC,KAAK,CAAC;AACb,MAAE,KAAK,CAAC,YAAY,CAAC,KAAK,EAAE;AACxB,QAAA,GAAG,EAAE,KAAK;AACV,QAAA,SAAS,EAAE,EAAE,CAAC,4BAA4B,EAAE;YAC1C,uCAAuC,EAAE,KAAK,KAAK,WAAW;SAC/D,CAAC;QACF,SAAS,EAAE,KAAK,KAAK,WAAW;KACjC,CAAC;AACJ,MAAE,KAAK,CACV,CACG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sources":["../../../src/components/Buttons/helpers.tsx"],"sourcesContent":["import React, { PropsWithChildren } from \"react\"\nimport cx from \"classnames\"\n\nimport { Icon, IconSources } from \"../Icon\"\n\nexport type ButtonCommonPropsType = PropsWithChildren<{\n className?: string\n disabled?: boolean\n fullWidth?: boolean\n loading?: boolean\n rounded?: boolean\n size?: \"large\"\n iconPosition?: \"left\" | \"right\"\n icon?: IconSources\n}>\n\nexport type ButtonTemplatePropsType<SpecificButtonProps> = SpecificButtonProps &\n ButtonCommonPropsType\n\nexport const getButtonContent = ({\n children,\n icon,\n iconPosition = icon ? \"left\" : undefined,\n}: Pick<ButtonCommonPropsType, \"children\" | \"icon\" | \"iconPosition\">) => {\n if (!children && !icon) {\n throw new Error(\"Either an icon or children are required\")\n }\n\n const iconMarkup = icon ? (\n <span\n key={iconPosition}\n className={cx(\"cob-Button__Icon\", {\n \"cob-Button__Icon--left\": !!children && iconPosition === \"left\",\n \"cob-Button__Icon--right\": !!children && iconPosition === \"right\",\n })}\n >\n <Icon source={icon} />\n </span>\n ) : null\n\n const leftIcon = iconPosition === \"left\" ? iconMarkup : null\n const rightIcon = iconPosition === \"right\" ? iconMarkup : null\n const childContent = children ? (\n <span key=\"children\" className=\"cob-Button__content\">\n {children}\n </span>\n ) : null\n return (\n <>\n {leftIcon}\n {childContent}\n {rightIcon}\n </>\n )\n}\n\nexport const getButtonCommonClassNames = ({\n rounded,\n size,\n fullWidth,\n className,\n disabled,\n}: Pick<\n ButtonCommonPropsType,\n \"rounded\" | \"size\" | \"fullWidth\" | \"className\" | \"disabled\"\n>) =>\n cx(className, \"cob-Button\", {\n \"cob-Button--rounded\": rounded,\n \"cob-Button--fullWidth\": fullWidth,\n \"cob-Button--large\": size === \"large\",\n \"cob-Button--disabled\": disabled,\n })\n"],"names":[],"mappings":";;;;MAmBa,gBAAgB,GAAG,CAAC,EAC/B,QAAQ,EACR,IAAI,EACJ,YAAY,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,GAC0B,KAAI;AACtE,IAAA,IAAI,CAAC,QAAQ,IAAI,CAAC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A;;;;"}
1
+ {"version":3,"file":"helpers.js","sources":["../../../src/components/Buttons/helpers.tsx"],"sourcesContent":["import React from \"react\"\nimport cx from \"classnames\"\n\nimport { Icon, IconSources } from \"../Icon\"\n\nexport type ButtonCommonPropsType = {\n children?: React.ReactNode\n className?: string\n disabled?: boolean\n fullWidth?: boolean\n loading?: boolean\n rounded?: boolean\n size?: \"large\"\n iconPosition?: \"left\" | \"right\"\n icon?: IconSources\n}\n\nexport type ButtonTemplatePropsType<SpecificButtonProps> = SpecificButtonProps &\n ButtonCommonPropsType\n\nexport const getButtonContent = ({\n children,\n icon,\n iconPosition = icon ? \"left\" : undefined,\n}: Pick<ButtonCommonPropsType, \"children\" | \"icon\" | \"iconPosition\">) => {\n if (!children && !icon) {\n throw new Error(\"Either an icon or children are required\")\n }\n\n const iconMarkup = icon ? (\n <span\n key={iconPosition}\n className={cx(\"cob-Button__Icon\", {\n \"cob-Button__Icon--left\": !!children && iconPosition === \"left\",\n \"cob-Button__Icon--right\": !!children && iconPosition === \"right\",\n })}\n >\n <Icon source={icon} />\n </span>\n ) : null\n\n const leftIcon = iconPosition === \"left\" ? iconMarkup : null\n const rightIcon = iconPosition === \"right\" ? iconMarkup : null\n const childContent = children ? (\n <span key=\"children\" className=\"cob-Button__content\">\n {children}\n </span>\n ) : null\n return (\n <>\n {leftIcon}\n {childContent}\n {rightIcon}\n </>\n )\n}\n\nexport const getButtonCommonClassNames = ({\n rounded,\n size,\n fullWidth,\n className,\n disabled,\n}: Pick<\n ButtonCommonPropsType,\n \"rounded\" | \"size\" | \"fullWidth\" | \"className\" | \"disabled\"\n>) =>\n cx(className, \"cob-Button\", {\n \"cob-Button--rounded\": rounded,\n \"cob-Button--fullWidth\": fullWidth,\n \"cob-Button--large\": size === \"large\",\n \"cob-Button--disabled\": disabled,\n })\n"],"names":[],"mappings":";;;;MAoBa,gBAAgB,GAAG,CAAC,EAC/B,QAAQ,EACR,IAAI,EACJ,YAAY,GAAG,IAAI,GAAG,MAAM,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EAAE,IAAI,KAAK,OAAO;AACrC,IAAA,sBAAsB,EAAE,QAAQ;AACjC,CAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/Card/index.tsx"],"sourcesContent":["import React, { PureComponent, PropsWithChildren } from \"react\"\nimport cx from \"classnames\"\n\nexport type CardProps = PropsWithChildren<{\n className?: string\n flattened?: boolean\n}>\n\nexport const Card = ({ children, className, flattened }: CardProps) => (\n <div\n className={cx(\"cobalt-Card\", className, {\n \"cobalt-Card--flattened\": flattened,\n })}\n >\n {children}\n </div>\n)\n\nexport type CardSectionProps = {\n children: React.ReactNode\n className?: string\n tabBar?: boolean\n tight?: boolean\n subdued?: boolean\n /**\n * true or \"soft\"\n * @default false\n */\n divided?: boolean | string\n}\n\nexport type CardSectionLinkProps = CardSectionProps & {\n href: React.AnchorHTMLAttributes<HTMLAnchorElement>[\"href\"]\n target?: React.AnchorHTMLAttributes<HTMLAnchorElement>[\"target\"]\n rel?: React.AnchorHTMLAttributes<HTMLAnchorElement>[\"rel\"]\n}\n\nconst getClasses = ({\n className = \"\",\n tabBar,\n tight,\n subdued,\n divided,\n}: CardSectionProps) => {\n return cx(className, \"cobalt-Card__Section\", {\n \"cobalt-Card__Section--tabBar\": tabBar === true,\n \"cobalt-Card__Section--tight\": tight === true,\n \"cobalt-Card__Section--subdued\": subdued === true,\n \"cobalt-Card__Section--divided\": divided === true,\n \"cobalt-Card__Section--dividedSoft\": divided === \"soft\",\n })\n}\n\nconst CardSectionLink = ({\n href,\n target,\n rel,\n ...baseProps\n}: CardSectionLinkProps) => {\n return (\n <a\n className={getClasses(baseProps)}\n href={href}\n target={target}\n rel={target && !rel ? \"noopener noreferrer\" : rel}\n >\n {baseProps.children}\n </a>\n )\n}\nCardSectionLink.displayName = \"CardSection.Link\"\n\nexport class CardSection extends PureComponent<CardSectionProps, never> {\n static Link = CardSectionLink\n render() {\n return <div className={getClasses(this.props)}>{this.props.children}</div>\n }\n}\n\nCard.Section =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,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAO,CAAA;KAC3E;;AAHM,WAAI,CAAA,IAAA,GAAG,eAAe,CAAA;AAM/B,IAAI,CAAC,OAAO,GAAG,WAAW;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Card/index.tsx"],"sourcesContent":["import React, { PureComponent } from \"react\"\nimport cx from \"classnames\"\n\nexport type CardProps = {\n children?: React.ReactNode\n className?: string\n flattened?: boolean\n}\n\nexport const Card = ({ children, className, flattened }: CardProps) => (\n <div\n className={cx(\"cobalt-Card\", className, {\n \"cobalt-Card--flattened\": flattened,\n })}\n >\n {children}\n </div>\n)\n\nexport type CardSectionProps = {\n children: React.ReactNode\n className?: string\n tabBar?: boolean\n tight?: boolean\n subdued?: boolean\n /**\n * true or \"soft\"\n * @default false\n */\n divided?: boolean | string\n}\n\nexport type CardSectionLinkProps = CardSectionProps & {\n href: React.AnchorHTMLAttributes<HTMLAnchorElement>[\"href\"]\n target?: React.AnchorHTMLAttributes<HTMLAnchorElement>[\"target\"]\n rel?: React.AnchorHTMLAttributes<HTMLAnchorElement>[\"rel\"]\n}\n\nconst getClasses = ({\n className = \"\",\n tabBar,\n tight,\n subdued,\n divided,\n}: CardSectionProps) => {\n return cx(className, \"cobalt-Card__Section\", {\n \"cobalt-Card__Section--tabBar\": tabBar === true,\n \"cobalt-Card__Section--tight\": tight === true,\n \"cobalt-Card__Section--subdued\": subdued === true,\n \"cobalt-Card__Section--divided\": divided === true,\n \"cobalt-Card__Section--dividedSoft\": divided === \"soft\",\n })\n}\n\nconst CardSectionLink = ({\n href,\n target,\n rel,\n ...baseProps\n}: CardSectionLinkProps) => {\n return (\n <a\n className={getClasses(baseProps)}\n href={href}\n target={target}\n rel={target && !rel ? \"noopener noreferrer\" : rel}\n >\n {baseProps.children}\n </a>\n )\n}\nCardSectionLink.displayName = \"CardSection.Link\"\n\nexport class CardSection extends PureComponent<CardSectionProps, never> {\n static Link = CardSectionLink\n render() {\n return <div className={getClas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AAC,IAAI,CAAC,KAAK,CAAC,EAAA,EAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAO,CAAA;KAC3E;;AAHM,WAAI,CAAA,IAAA,GAAG,eAAe,CAAA;AAM/B,IAAI,CAAC,OAAO,GAAG,WAAW;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/Cell/index.tsx"],"sourcesContent":["import React, { PropsWithChildren } from \"react\"\nimport cx from \"classnames\"\n\nexport type CellPropsType = PropsWithChildren<{\n divided?: boolean\n className?: string\n}>\nexport type CellSoftPropsType = PropsWithChildren<{\n softDivided?: boolean\n className?: string\n}>\n\nexport type CellsPropsType = {\n content: CellPropsType[\"children\"][]\n} & Omit<CellPropsType, \"children\">\nexport type CellsSoftPropsType = {\n content: CellSoftPropsType[\"children\"][]\n} & Omit<CellSoftPropsType, \"children\">\n\nfunction Cell(props: CellPropsType): JSX.Element\nfunction Cell(props: CellSoftPropsType): JSX.Element\nfunction Cell({\n children,\n divided,\n softDivided,\n className,\n}: CellPropsType & CellSoftPropsType): JSX.Element {\n return (\n <div\n className={cx(\"cobalt-cell\", className, {\n \"cobalt-cell--divided\": divided,\n \"cobalt-cell--softDivided\": softDivided,\n })}\n >\n {children}\n </div>\n )\n}\n\nexport function Cells(props: CellsPropsType): JSX.Element\nexport function Cells(props: CellsSoftPropsType): JSX.Element\nexport function Cells({\n content,\n ...cellProps\n}: CellsPropsType & CellsSoftPropsType): JSX.Element {\n return (\n <>\n {content.map((c, i) => (\n <Cell key={i} {...cellProps}>\n {c}\n </Cell>\n ))}\n </>\n )\n}\n\nexport default Cell\n"],"names":[],"mappings":";;;AAqBA,SAAS,IAAI,CAAC,EACZ,QAAQ,EACR,OAAO,EACP,WAAW,EACX,SAAS,GACyB,EAAA;IAClC,QACE,6BACE,SAAS,EAAE,EAAE,CAAC,aAAa,EAAE,SAAS,EAAE;AACtC,YAAA,sBAAsB,EAAE,OAAO;AAC/B,YAAA,0BAA0B,EAAE,WAAW;AACxC,SAAA,CAAC,EAED,EAAA,QAAQ,CACL,EACP;AACH,CAAC;AAIK,SAAU,KAAK,CAAC,EACpB,OAAO,EACP,GAAG,SAAS,EACwB,EAAA;AACpC,IAAA,QACE,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EACG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,MAChB,KAAC,CAAA,aAAA,CAAA,IAAI,EAAC,EAAA,GAAG,EAAE,CAAC,EAAM,GAAA,SAAS,EACxB,EAAA,CAAC,CACG,CACR,CAAC,CACD,EACJ;AACH;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Cell/index.tsx"],"sourcesContent":["import React from \"react\"\nimport cx from \"classnames\"\n\nexport type CellPropsType = {\n children?: React.ReactNode\n divided?: boolean\n className?: string\n}\nexport type CellSoftPropsType = {\n children?: React.ReactNode\n softDivided?: boolean\n className?: string\n}\n\nexport type CellsPropsType = {\n content: CellPropsType[\"children\"][]\n} & Omit<CellPropsType, \"children\">\nexport type CellsSoftPropsType = {\n content: CellSoftPropsType[\"children\"][]\n} & Omit<CellSoftPropsType, \"children\">\n\nfunction Cell(props: CellPropsType): JSX.Element\nfunction Cell(props: CellSoftPropsType): JSX.Element\nfunction Cell({\n children,\n divided,\n softDivided,\n className,\n}: CellPropsType & CellSoftPropsType): JSX.Element {\n return (\n <div\n className={cx(\"cobalt-cell\", className, {\n \"cobalt-cell--divided\": divided,\n \"cobalt-cell--softDivided\": softDivided,\n })}\n >\n {children}\n </div>\n )\n}\n\nexport function Cells(props: CellsPropsType): JSX.Element\nexport function Cells(props: CellsSoftPropsType): JSX.Element\nexport function Cells({\n content,\n ...cellProps\n}: CellsPropsType & CellsSoftPropsType): JSX.Element {\n return (\n <>\n {content.map((c, i) => (\n <Cell key={i} {...cellProps}>\n {c}\n </Cell>\n ))}\n </>\n )\n}\n\nexport default Cell\n"],"names":[],"mappings":";;;AAuBA,SAAS,IAAI,CAAC,EACZ,QAAQ,EACR,OAAO,EACP,WAAW,EACX,SAAS,GACyB,EAAA;IAClC,QACE,6BACE,SAAS,EAAE,EAAE,CAAC,aAAa,EAAE,SAAS,EAAE;AACtC,YAAA,sBAAsB,EAAE,OAAO;AAC/B,YAAA,0BAA0B,EAAE,WAAW;AACxC,SAAA,CAAC,EAED,EAAA,QAAQ,CACL,EACP;AACH,CAAC;AAIK,SAAU,KAAK,CAAC,EACpB,OAAO,EACP,GAAG,SAAS,EACwB,EAAA;AACpC,IAAA,QACE,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EACG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,MAChB,KAAC,CAAA,aAAA,CAAA,IAAI,EAAC,EAAA,GAAG,EAAE,CAAC,EAAM,GAAA,SAAS,EACxB,EAAA,CAAC,CACG,CACR,CAAC,CACD,EACJ;AACH;;;;"}
@@ -1,14 +1,15 @@
1
1
  import React from 'react';
2
- import { ButtonGroup } from '../Button/index.js';
2
+ import ButtonsGroup from '../Buttons/ButtonsGroup.js';
3
3
 
4
4
  const EmptyState = ({ title, children, action, secondaryAction, image, }) => {
5
5
  return (React.createElement("div", { className: "cobalt-EmptyState" },
6
6
  React.createElement("img", { className: "cobalt-EmptyState__Image", role: "presentation", alt: "", src: image, height: 188, width: 188 }),
7
7
  React.createElement("h2", { className: "cobalt-EmptyState__Title" }, title),
8
8
  children && React.createElement("div", { className: "cobalt-EmptyState__Body" }, children),
9
- action && (React.createElement(ButtonGroup, { align: "center" },
10
- action,
11
- secondaryAction))));
9
+ action && (React.createElement(ButtonsGroup, { align: "center" },
10
+ React.createElement(React.Fragment, null,
11
+ action,
12
+ secondaryAction)))));
12
13
  };
13
14
 
14
15
  export { EmptyState };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/EmptyState/index.tsx"],"sourcesContent":["import React from \"react\"\n\nimport { ButtonGroup, Button } from \"../Button\"\n\nexport interface EmptyStateProps {\n children?: React.ReactNode\n title: string\n action?: typeof Button\n secondaryAction?: typeof Button\n image: string\n}\n\nexport const EmptyState = ({\n title,\n children,\n action,\n secondaryAction,\n image,\n}: EmptyStateProps) => {\n return (\n <div className=\"cobalt-EmptyState\">\n <img\n className=\"cobalt-EmptyState__Image\"\n role=\"presentation\"\n alt=\"\"\n src={image}\n height={188}\n width={188}\n />\n <h2 className=\"cobalt-EmptyState__Title\">{title}</h2>\n {children && <div className=\"cobalt-EmptyState__Body\">{children}</div>}\n {action && (\n <ButtonGroup align=\"center\">\n {action}\n {secondaryAction}\n </ButtonGroup>\n )}\n </div>\n )\n}\n"],"names":[],"mappings":";;;AAYa,MAAA,UAAU,GAAG,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,MAAM,EACN,eAAe,EACf,KAAK,GACW,KAAI;AACpB,IAAA,QACE,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,mBAAmB,EAAA;QAChC,KACE,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAC,0BAA0B,EACpC,IAAI,EAAC,cAAc,EACnB,GAAG,EAAC,EAAE,EACN,GAAG,EAAE,KAAK,EACV,MAAM,EAAE,GAAG,EACX,KAAK,EAAE,GAAG,EACV,CAAA;AACF,QAAA,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,0BAA0B,EAAA,EAAE,KAAK,CAAM;AACpD,QAAA,QAAQ,IAAI,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAC,yBAAyB,EAAA,EAAE,QAAQ,CAAO;AACrE,QAAA,MAAM,KACL,KAAA,CAAA,aAAA,CAAC,WAAW,EAAC,EAAA,KAAK,EAAC,QAAQ,EAAA;YACxB,MAAM;AACN,YAAA,eAAe,CACJ,CACf,CACG,EACP;AACH;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/EmptyState/index.tsx"],"sourcesContent":["import React from \"react\"\n\nimport DefaultButton from \"../Buttons/DefaultButton\"\nimport ButtonsGroup from \"../Buttons/ButtonsGroup\"\n\nexport interface EmptyStateProps {\n children?: React.ReactNode\n title: string\n action?: typeof DefaultButton\n secondaryAction?: typeof DefaultButton\n image: string\n}\n\nexport const EmptyState = ({\n title,\n children,\n action,\n secondaryAction,\n image,\n}: EmptyStateProps) => {\n return (\n <div className=\"cobalt-EmptyState\">\n <img\n className=\"cobalt-EmptyState__Image\"\n role=\"presentation\"\n alt=\"\"\n src={image}\n height={188}\n width={188}\n />\n <h2 className=\"cobalt-EmptyState__Title\">{title}</h2>\n {children && <div className=\"cobalt-EmptyState__Body\">{children}</div>}\n {action && (\n <ButtonsGroup align=\"center\">\n <>\n {action}\n {secondaryAction}\n </>\n </ButtonsGroup>\n )}\n </div>\n )\n}\n"],"names":[],"mappings":";;;AAaa,MAAA,UAAU,GAAG,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,MAAM,EACN,eAAe,EACf,KAAK,GACW,KAAI;AACpB,IAAA,QACE,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,mBAAmB,EAAA;QAChC,KACE,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAC,0BAA0B,EACpC,IAAI,EAAC,cAAc,EACnB,GAAG,EAAC,EAAE,EACN,GAAG,EAAE,KAAK,EACV,MAAM,EAAE,GAAG,EACX,KAAK,EAAE,GAAG,EACV,CAAA;AACF,QAAA,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,0BAA0B,EAAA,EAAE,KAAK,CAAM;AACpD,QAAA,QAAQ,IAAI,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAC,yBAAyB,EAAA,EAAE,QAAQ,CAAO;AACrE,QAAA,MAAM,KACL,KAAA,CAAA,aAAA,CAAC,YAAY,EAAC,EAAA,KAAK,EAAC,QAAQ,EAAA;AAC1B,YAAA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA;gBACG,MAAM;AACN,gBAAA,eAAe,CACf,CACU,CAChB,CACG,EACP;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CheckablePill.js","sources":["../../../src/components/Form/CheckablePill.tsx"],"sourcesContent":["import React from \"react\"\nimport classNames from \"classnames\"\nimport { Icon, IconSources } from \"../Icon\"\nimport { FormElement } from \"./form\"\nimport { withFieldLabelAndHint } from \"./field\"\n\ntype Props = {\n type?: \"checkbox\" | \"radio\"\n icon?: IconSources\n value: string\n children: React.ReactNode\n defaultChecked?: boolean\n name: string\n} & FormElement &\n React.InputHTMLAttributes<HTMLInputElement>\n\nconst CheckablePill = ({\n type,\n icon,\n value,\n children,\n defaultChecked,\n status,\n ...InputProps\n}: Props) => {\n return (\n <span\n className={classNames(\"cobalt-CheckablePillField\", {\n \"cobalt-CheckablePillField--error\": status === \"error\",\n \"cobalt-CheckablePillField--with-icon\": icon,\n })}\n >\n <label className=\"cobalt-CheckablePillField__LabelWrapper\">\n <input\n {...InputProps}\n type={type}\n className=\"cobalt-CheckablePillField__Input\"\n value={value}\n defaultChecked={defaultChecked}\n />\n <span className=\"cobalt-CheckablePillField__Label\">\n {icon && <Icon source={icon} />}\n {children}\n </span>\n </label>\n </span>\n )\n}\n\nexport const CheckboxPill = ({ ...props }: Props) => {\n return <CheckablePill {...props} type=\"checkbox\" />\n}\nCheckboxPill.displayName = \"CheckboxPill\"\n\nexport const RadioPill = ({ ...props }: Props) => {\n return <CheckablePill {...props} type=\"radio\" />\n}\nRadioPill.displayName = \"RadioPill\"\n\ninterface CheckablePillsGroupProps {\n children: React.ReactNode\n}\n\nconst _CheckablePillsGroup = ({ children }: CheckablePillsGroupProps) => {\n return (\n <div className=\"cobalt-CheckablePillsGroup\">\n {typeof children === \"function\" ? children() : children}\n </div>\n )\n}\n\nexport const CheckablePillsGroup = withFieldLabelAndHint(_CheckablePillsGroup)\nCheckablePillsGroup.displayName = \"CheckablePill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D,SAAS,CAAC,WAAW,GAAG,WAAW,CAAA;AAMnC,MAAM,oBAAoB,GAAG,CAAC,EAAE,QAAQ,EAA4B,KAAI;IACtE,QACE,6BAAK,SAAS,EAAC,4BAA4B,EACxC,EAAA,OAAO,QAAQ,KAAK,UAAU,GAAG,QAAQ,EAAE,GAAG,QAAQ,CACnD,EACP;AACH,CAAC,CAAA;MAEY,mBAAmB,GAAG,qBAAqB,CAAC,oBAAoB,EAAC;AAC9E,mBAAmB,CAAC,WAAW,GAAG,qBAAqB;;;;"}
1
+ {"version":3,"file":"CheckablePill.js","sources":["../../../src/components/Form/CheckablePill.tsx"],"sourcesContent":["import React from \"react\"\nimport classNames from \"classnames\"\nimport { Icon, IconSources } from \"../Icon\"\nimport { FormElement } from \"./form\"\nimport { withFieldLabelAndHint } from \"./field\"\n\ntype Props = {\n type?: \"checkbox\" | \"radio\"\n icon?: IconSources\n value: string\n children: React.ReactNode\n defaultChecked?: boolean\n name: string\n} & FormElement &\n React.InputHTMLAttributes<HTMLInputElement>\n\nconst CheckablePill = ({\n type,\n icon,\n value,\n children,\n defaultChecked,\n status,\n ...InputProps\n}: Props) => {\n return (\n <span\n className={classNames(\"cobalt-CheckablePillField\", {\n \"cobalt-CheckablePillField--error\": status === \"error\",\n \"cobalt-CheckablePillField--with-icon\": icon,\n })}\n >\n <label className=\"cobalt-CheckablePillField__LabelWrapper\">\n <input\n {...InputProps}\n type={type}\n className=\"cobalt-CheckablePillField__Input\"\n value={value}\n defaultChecked={defaultChecked}\n />\n <span className=\"cobalt-CheckablePillField__Label\">\n {icon && <Icon source={icon} />}\n {children}\n </span>\n </label>\n </span>\n )\n}\n\nexport const CheckboxPill = ({ ...props }: Props) => {\n return <CheckablePill {...props} type=\"checkbox\" />\n}\nCheckboxPill.displayName = \"CheckboxPill\"\n\nexport const RadioPill = ({ ...props }: Props) => {\n return <CheckablePill {...props} type=\"radio\" />\n}\nRadioPill.displayName = \"RadioPill\"\n\ninterface CheckablePillsGroupProps {\n children: React.ReactNode | (() => React.ReactNode)\n}\n\nconst _CheckablePillsGroup = ({ children }: CheckablePillsGroupProps) => {\n return (\n <div className=\"cobalt-CheckablePillsGroup\">\n {typeof children === \"function\" ? children() : children}\n </div>\n )\n}\n\nexport const CheckablePillsGroup = withFieldLabelAndHint(_CheckablePillsGroup)\nCheckablePillsGroup.displayName = \"CheckablePillsGroup\"\n"],"names":["classNames"],"mappings":";;;;;AAgBA,MAAM,aAAa,GAAG,CAAC,EACrB,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,cAAc,EACd,MAAM,EACN,GAAG,UAAU,EACP,KAAI;AACV,IAAA,QACE,KACE,CAAA,aAAA,CAAA,MAAA,EAAA,EAAA,SAAS,EAAEA,EAAU,CAAC,2BAA2B,EAAE;YACjD,kCAAkC,EAAE,MAAM,KAAK,OAAO;AACtD,YAAA,sCAAsC,EAAE,IAAI;SAC7C,CAAC,EAAA;QAEF,KAAO,CAAA,aAAA,CAAA,OAAA,EAAA,EAAA,SAAS,EAAC,yCAAyC,EAAA;AACxD,YAAA,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAA,GACM,UAAU,EACd,IAAI,EAAE,IAAI,EACV,SAAS,EAAC,kCAAkC,EAC5C,KAAK,EAAE,KAAK,EACZ,cAAc,EAAE,cAAc,EAC9B,CAAA;YACF,KAAM,CAAA,aAAA,CAAA,MAAA,EAAA,EAAA,SAAS,EAAC,kCAAkC,EAAA;AAC/C,gBAAA,IAAI,IAAI,KAAC,CAAA,aAAA,CAAA,IAAI,IAAC,MAAM,EAAE,IAAI,EAAI,CAAA;AAC9B,gBAAA,QAAQ,CACJ,CACD,CACH,EACR;AACH,CAAC,CAAA;AAEY,MAAA,YAAY,GAAG,CAAC,EAAE,GAAG,KAAK,EAAS,KAAI;IAClD,OAAO,KAAA,CAAA,aAAA,CAAC,aAAa,EAAK,EAAA,GAAA,KAAK,EAAE,IAAI,EAAC,UAAU,EAAA,CAAG,CAAA;AACrD,EAAC;AACD,YAAY,CAAC,WAAW,GAAG,cAAc,CAAA;AAE5B,MAAA,SAAS,GAAG,CAAC,EAAE,GAAG,KAAK,EAAS,KAAI;IAC/C,OAAO,KAAA,CAAA,aAAA,CAAC,aAAa,EAAK,EAAA,GAAA,KAAK,EAAE,IAAI,EAAC,OAAO,EAAA,CAAG,CAAA;AAClD,EAAC;AACD,SAAS,CAAC,WAAW,GAAG,WAAW,CAAA;AAMnC,MAAM,oBAAoB,GAAG,CAAC,EAAE,QAAQ,EAA4B,KAAI;IACtE,QACE,6BAAK,SAAS,EAAC,4BAA4B,EACxC,EAAA,OAAO,QAAQ,KAAK,UAAU,GAAG,QAAQ,EAAE,GAAG,QAAQ,CACnD,EACP;AACH,CAAC,CAAA;MAEY,mBAAmB,GAAG,qBAAqB,CAAC,oBAAoB,EAAC;AAC9E,mBAAmB,CAAC,WAAW,GAAG,qBAAqB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Checkmark.js","sources":["../../../src/components/Form/Checkmark.tsx"],"sourcesContent":["import React from \"react\"\nimport classNames from \"classnames\"\nimport { Hint } from \"./Hint\"\nimport { FormElement } from \"./form\"\nimport { withFieldLabelAndHint } from \"./field\"\n\ntype Props = {\n label: string | JSX.Element\n type?: \"checkbox\" | \"radio\"\n hint?: string\n} & FormElement &\n React.InputHTMLAttributes<HTMLInputElement>\n\nconst Checkmark = ({ label, status, hint, ...inputProps }: Props) => {\n return (\n <div\n className={classNames(\"cobalt-CheckmarkField\", {\n \"cobalt-CheckmarkField--success\": status === \"success\",\n \"cobalt-CheckmarkField--error\": status === \"error\",\n })}\n >\n <label className=\"cobalt-CheckmarkField__LabelWrapper\">\n <input {...inputProps} className=\"cobalt-CheckmarkField__Input\" />\n <span className=\"cobalt-CheckmarkField__Checkmark\" />\n <span className=\"cobalt-CheckmarkField__Label\">{label}</span>\n </label>\n {hint && (\n <Hint status={status}>\n <span dangerouslySetInnerHTML={{ __html: hint }} />\n </Hint>\n )}\n </div>\n )\n}\n\nexport const Checkbox = ({ label, ...props }: Props) => {\n return <Checkmark {...props} label={label} type=\"checkbox\" />\n}\nCheckbox.displayName = \"CobaltCheckbox\"\n\nexport const Radio = ({ label, ...props }: Props) => {\n return <Checkmark {...props} label={label} type=\"radio\" />\n}\nRadio.displayName = \"CobaltRadio\"\n\ntype ChoiceListProps = {\n children: React.ReactNode\n}\n\nconst ChoiceList = ({ children }: ChoiceListProps) => {\n return (\n <div className=\"cobalt-ChoiceList\">\n {typeof children === \"function\" ? children() : children}\n </div>\n )\n}\n\nconst wrappedChoiceList = withFieldLabelAndHint(ChoiceList)\nwrappedChoiceList.displayName = \"ChoiceList\"\n\nexport { wrappedChoiceList as ChoiceList }\n"],"names":["classNames"],"mappings":";;;;;AAaA,MAAM,SAAS,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU,EAAS,KAAI;AAClE,IAAA,QACE,KACE,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAEA,EAAU,CAAC,uBAAuB,EAAE;YAC7C,gCAAgC,EAAE,MAAM,KAAK,SAAS;YACtD,8BAA8B,EAAE,MAAM,KAAK,OAAO;SACnD,CAAC,EAAA;QAEF,KAAO,CAAA,aAAA,CAAA,OAAA,EAAA,EAAA,SAAS,EAAC,qCAAqC,EAAA;AACpD,YAAA,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAA,GAAW,UAAU,EAAE,SAAS,EAAC,8BAA8B,EAAG,CAAA;YAClE,KAAM,CAAA,aAAA,CAAA,MAAA,EAAA,EAAA,SAAS,EAAC,kCAAkC,EAAG,CAAA;AACrD,YAAA,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,8BAA8B,EAAE,EAAA,KAAK,CAAQ,CACvD;AACP,QAAA,IAAI,KACH,KAAA,CAAA,aAAA,CAAC,IAAI,EAAC,EAAA,MAAM,EAAE,MAAM,EAAA;AAClB,YAAA,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAM,uBAAuB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAA,CAAI,CAC9C,CACR,CACG,EACP;AACH,CAAC,CAAA;AAEM,MAAM,QAAQ,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAS,KAAI;AACrD,IAAA,OAAO,KAAC,CAAA,aAAA,CAAA,SAAS,EAAK,EAAA,GAAA,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAC,UAAU,GAAG,CAAA;AAC/D,EAAC;AACD,QAAQ,CAAC,WAAW,GAAG,gBAAgB,CAAA;AAEhC,MAAM,KAAK,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAS,KAAI;AAClD,IAAA,OAAO,KAAC,CAAA,aAAA,CAAA,SAAS,EAAK,EAAA,GAAA,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAC,OAAO,GAAG,CAAA;AAC5D,EAAC;AACD,KAAK,CAAC,WAAW,GAAG,aAAa,CAAA;AAMjC,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAmB,KAAI;IACnD,QACE,6BAAK,SAAS,EAAC,mBAAmB,EAC/B,EAAA,OAAO,QAAQ,KAAK,UAAU,GAAG,QAAQ,EAAE,GAAG,QAAQ,CACnD,EACP;AACH,CAAC,CAAA;AAED,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,UAAU,EAAC;AAC3D,iBAAiB,CAAC,WAAW,GAAG,YAAY;;;;"}
1
+ {"version":3,"file":"Checkmark.js","sources":["../../../src/components/Form/Checkmark.tsx"],"sourcesContent":["import React from \"react\"\nimport classNames from \"classnames\"\nimport { Hint } from \"./Hint\"\nimport { FormElement } from \"./form\"\nimport { withFieldLabelAndHint } from \"./field\"\n\ntype Props = {\n label: string | JSX.Element\n type?: \"checkbox\" | \"radio\"\n hint?: string\n} & FormElement &\n React.InputHTMLAttributes<HTMLInputElement>\n\nconst Checkmark = ({ label, status, hint, ...inputProps }: Props) => {\n return (\n <div\n className={classNames(\"cobalt-CheckmarkField\", {\n \"cobalt-CheckmarkField--success\": status === \"success\",\n \"cobalt-CheckmarkField--error\": status === \"error\",\n })}\n >\n <label className=\"cobalt-CheckmarkField__LabelWrapper\">\n <input {...inputProps} className=\"cobalt-CheckmarkField__Input\" />\n <span className=\"cobalt-CheckmarkField__Checkmark\" />\n <span className=\"cobalt-CheckmarkField__Label\">{label}</span>\n </label>\n {hint && (\n <Hint status={status}>\n <span dangerouslySetInnerHTML={{ __html: hint }} />\n </Hint>\n )}\n </div>\n )\n}\n\nexport const Checkbox = ({ label, ...props }: Props) => {\n return <Checkmark {...props} label={label} type=\"checkbox\" />\n}\nCheckbox.displayName = \"CobaltCheckbox\"\n\nexport const Radio = ({ label, ...props }: Props) => {\n return <Checkmark {...props} label={label} type=\"radio\" />\n}\nRadio.displayName = \"CobaltRadio\"\n\ntype ChoiceListProps = {\n children: React.ReactNode | (() => React.ReactNode)\n}\n\nconst ChoiceList = ({ children }: ChoiceListProps) => {\n return (\n <div className=\"cobalt-ChoiceList\">\n {typeof children === \"function\" ? children() : children}\n </div>\n )\n}\n\nconst wrappedChoiceList = withFieldLabelAndHint(ChoiceList)\nwrappedChoiceList.displayName = \"ChoiceList\"\n\nexport { wrappedChoiceList as ChoiceList }\n"],"names":["classNames"],"mappings":";;;;;AAaA,MAAM,SAAS,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU,EAAS,KAAI;AAClE,IAAA,QACE,KACE,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAEA,EAAU,CAAC,uBAAuB,EAAE;YAC7C,gCAAgC,EAAE,MAAM,KAAK,SAAS;YACtD,8BAA8B,EAAE,MAAM,KAAK,OAAO;SACnD,CAAC,EAAA;QAEF,KAAO,CAAA,aAAA,CAAA,OAAA,EAAA,EAAA,SAAS,EAAC,qCAAqC,EAAA;AACpD,YAAA,KAAA,CAAA,aAA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AAiB,GAAG,qBAAqB,CAAC,UAAU,EAAC;AAC3D,iBAAiB,CAAC,WAAW,GAAG,YAAY;;;;"}
@@ -1,7 +1,7 @@
1
1
  import React, { PureComponent } from 'react';
2
2
  import cx from 'classnames';
3
3
  import { withFieldLabelAndHint } from './field.js';
4
- import { Button } from '../Button/index.js';
4
+ import DefaultButton from '../Buttons/DefaultButton/index.js';
5
5
 
6
6
  const enforceInRange = (value, min, max) => {
7
7
  let enforcedValue = value;
@@ -56,11 +56,11 @@ class Stepper extends PureComponent {
56
56
  "cobalt-Stepper--error": status === "error",
57
57
  }) },
58
58
  React.createElement("div", { className: "cobalt-Stepper__Wrapper" },
59
- React.createElement(Button, { className: "cobalt-Stepper__ActionButton", disabled: disabled || this.state.value === min, onClick: this.onDecrement, type: "button" }, "-"),
59
+ React.createElement(DefaultButton, { className: "cobalt-Stepper__ActionButton", disabled: disabled || this.state.value === min, onClick: this.onDecrement, type: "button" }, "-"),
60
60
  React.createElement("div", { className: "cobalt-Stepper__ContentWrapper" },
61
61
  children ? children(this.state.value) : this.state.value,
62
62
  React.createElement("input", { type: "hidden", name: name, value: this.state.value })),
63
- React.createElement(Button, { className: "cobalt-Stepper__ActionButton", disabled: disabled || this.state.value === max, onClick: this.onIncrement, type: "button" }, "+"))));
63
+ React.createElement(DefaultButton, { className: "cobalt-Stepper__ActionButton", disabled: disabled || this.state.value === max, onClick: this.onIncrement, type: "button" }, "+"))));
64
64
  }
65
65
  }
66
66
  const wrappedComponent = withFieldLabelAndHint(Stepper);
@@ -1 +1 @@
1
- {"version":3,"file":"Stepper.js","sources":["../../../src/components/Form/Stepper.tsx"],"sourcesContent":["import React, { PureComponent } from \"react\"\nimport classNames from \"classnames\"\nimport { FormElement } from \"./form\"\nimport { withFieldLabelAndHint } from \"./field\"\nimport { Button } from \"../Button\"\n\nconst enforceInRange = (\n value: number,\n min: number | undefined,\n max: number | undefined\n) => {\n let enforcedValue = value\n if (typeof max !== \"undefined\") {\n enforcedValue = Math.min(enforcedValue, max)\n }\n if (typeof min !== \"undefined\") {\n enforcedValue = Math.max(enforcedValue, min)\n }\n return enforcedValue\n}\n\ntype Props = {\n value: number\n name?: string\n disabled?: boolean\n min?: number\n max?: number\n step: number\n onChange?: (value: number) => void\n children?: (value: number) => React.ReactNode\n} & FormElement\n\ntype State = {\n value: number\n}\n\nclass Stepper extends PureComponent<Props, State> {\n constructor(props: Props) {\n super(props)\n\n if (props.step < 0)\n throw new Error(\"Incorrect step value. Can't be below zero\")\n\n this.onDecrement = this.onDecrement.bind(this)\n this.onIncrement = this.onIncrement.bind(this)\n this.changeValue = this.changeValue.bind(this)\n\n this.state = {\n value: enforceInRange(props.value, props.min, props.max),\n }\n }\n\n componentDidUpdate(_prevProps: Props, prevState: State) {\n if (prevState.value !== this.state.value) {\n this.changeValue(this.state.value)\n } else if (this.props.value !== this.state.value) {\n this.changeValue(this.props.value)\n }\n }\n\n onDecrement = () => {\n ;(this.props.min !== null || this.state.value > this.props.min) &&\n this.changeValue(\n parseFloat((this.state.value - this.props.step).toFixed(10))\n )\n }\n\n onIncrement = () => {\n ;(this.props.max !== null || this.state.value < this.props.max) &&\n this.changeValue(\n parseFloat((this.state.value + this.props.step).toFixed(10))\n )\n }\n\n changeValue = (value: number) => {\n this.setState(\n {\n value: enforceInRange(value, this.props.min, this.props.max),\n },\n () => {\n this.props.onChange && this.props.onChange(this.state.value)\n }\n )\n }\n\n render() {\n const { name, status, disabled, min, max, children } = this.props\n\n return (\n <div\n className={classNames(\"cobalt-Stepper\", {\n \"cobalt-Stepper--disabled\": disabled,\n \"cobalt-Stepper--success\": status === \"success\",\n \"cobalt-Stepper--error\": status === \"error\",\n })}\n >\n <div className=\"cobalt-Stepper__Wrapper\">\n <Button\n className=\"cobalt-Stepper__ActionButton\"\n disabled={disabled || this.state.value === min}\n onClick={this.onDecrement}\n type={\"button\"}\n >\n -\n </Button>\n <div className=\"cobalt-Stepper__ContentWrapper\">\n {children ? children(this.state.value) : this.state.value}\n <input type=\"hidden\" name={name} value={this.state.value} />\n </div>\n <Button\n className=\"cobalt-Stepper__ActionButton\"\n disabled={disabled || this.state.value === max}\n onClick={this.onIncrement}\n type={\"button\"}\n >\n +\n </Button>\n </div>\n </div>\n )\n }\n}\n\nconst wrappedComponent = withFieldLabelAndHint(Stepper)\nwrappedComponent.displayName = \"Stepper\"\n\nexport { wrappedComponent as Stepper }\n\ntype StepperMetaProps = {\n children: React.ReactNode\n}\nconst StepperMeta = ({ children }: StepperMetaProps) => {\n return <div className=\"cobalt-Stepper__Meta\">{children}</div>\n}\n\nexport { StepperMeta }\n"],"names":["classNames"],"mappings":";;;;;AAMA,MAAM,cAAc,GAAG,CACrB,KAAa,EACb,GAAuB,EACvB,GAAuB,KACrB;IACF,IAAI,aAAa,GAAG,KAAK,CAAA;AACzB,IAAA,IAAI,OAAO,GAAG,KAAK,WAAW,EAAE;QAC9B,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,GAAG,CAAC,CAAA;AAC7C,KAAA;AACD,IAAA,IAAI,OAAO,GAAG,KAAK,WAAW,EAAE;QAC9B,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,GAAG,CAAC,CAAA;AAC7C,KAAA;AACD,IAAA,OAAO,aAAa,CAAA;AACtB,CAAC,CAAA;AAiBD,MAAM,OAAQ,SAAQ,aAA2B,CAAA;AAC/C,IAAA,WAAA,CAAY,KAAY,EAAA;QACtB,KAAK,CAAC,KAAK,CAAC,CAAA;QAsBd,IAAW,CAAA,WAAA,GAAG,MAAK;AAChB,YAAA,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG;gBAC5D,IAAI,CAAC,WAAW,CACd,UAAU,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,EAA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,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK;AACzD,oBAAA,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAO,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAI,CACxD;AACN,gBAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EACL,SAAS,EAAC,8BAA8B,EACxC,QAAQ,EAAE,QAAQ,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,GAAG,EAC9C,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,IAAI,EAAE,QAAQ,EAAA,EAAA,GAAA,CAGP,CACL,CACF,EACP;KACF;AACF,CAAA;AAED,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,OAAO,EAAC;AACvD,gBAAgB,CAAC,WAAW,GAAG,SAAS,CAAA;AAOxC,MAAM,WAAW,GAAG,CAAC,EAAE,QAAQ,EAAoB,KAAI;AACrD,IAAA,OAAO,6BAAK,SAAS,EAAC,sBAAsB,EAAE,EAAA,QAAQ,CAAO,CAAA;AAC/D;;;;"}
1
+ {"version":3,"file":"Stepper.js","sources":["../../../src/components/Form/Stepper.tsx"],"sourcesContent":["import React, { PureComponent } from \"react\"\nimport classNames from \"classnames\"\nimport { FormElement } from \"./form\"\nimport { withFieldLabelAndHint } from \"./field\"\nimport DefaultButton from \"../Buttons/DefaultButton\"\n\nconst enforceInRange = (\n value: number,\n min: number | undefined,\n max: number | undefined\n) => {\n let enforcedValue = value\n if (typeof max !== \"undefined\") {\n enforcedValue = Math.min(enforcedValue, max)\n }\n if (typeof min !== \"undefined\") {\n enforcedValue = Math.max(enforcedValue, min)\n }\n return enforcedValue\n}\n\ntype Props = {\n value: number\n name?: string\n disabled?: boolean\n min?: number\n max?: number\n step: number\n onChange?: (value: number) => void\n children?: (value: number) => React.ReactNode\n} & FormElement\n\ntype State = {\n value: number\n}\n\nclass Stepper extends PureComponent<Props, State> {\n constructor(props: Props) {\n super(props)\n\n if (props.step < 0)\n throw new Error(\"Incorrect step value. Can't be below zero\")\n\n this.onDecrement = this.onDecrement.bind(this)\n this.onIncrement = this.onIncrement.bind(this)\n this.changeValue = this.changeValue.bind(this)\n\n this.state = {\n value: enforceInRange(props.value, props.min, props.max),\n }\n }\n\n componentDidUpdate(_prevProps: Props, prevState: State) {\n if (prevState.value !== this.state.value) {\n this.changeValue(this.state.value)\n } else if (this.props.value !== this.state.value) {\n this.changeValue(this.props.value)\n }\n }\n\n onDecrement = () => {\n ;(this.props.min !== null || this.state.value > this.props.min) &&\n this.changeValue(\n parseFloat((this.state.value - this.props.step).toFixed(10))\n )\n }\n\n onIncrement = () => {\n ;(this.props.max !== null || this.state.value < this.props.max) &&\n this.changeValue(\n parseFloat((this.state.value + this.props.step).toFixed(10))\n )\n }\n\n changeValue = (value: number) => {\n this.setState(\n {\n value: enforceInRange(value, this.props.min, this.props.max),\n },\n () => {\n this.props.onChange && this.props.onChange(this.state.value)\n }\n )\n }\n\n render() {\n const { name, status, disabled, min, max, children } = this.props\n\n return (\n <div\n className={classNames(\"cobalt-Stepper\", {\n \"cobalt-Stepper--disabled\": disabled,\n \"cobalt-Stepper--success\": status === \"success\",\n \"cobalt-Stepper--error\": status === \"error\",\n })}\n >\n <div className=\"cobalt-Stepper__Wrapper\">\n <DefaultButton\n className=\"cobalt-Stepper__ActionButton\"\n disabled={disabled || this.state.value === min}\n onClick={this.onDecrement}\n type={\"button\"}\n >\n -\n </DefaultButton>\n <div className=\"cobalt-Stepper__ContentWrapper\">\n {children ? children(this.state.value) : this.state.value}\n <input type=\"hidden\" name={name} value={this.state.value} />\n </div>\n <DefaultButton\n className=\"cobalt-Stepper__ActionButton\"\n disabled={disabled || this.state.value === max}\n onClick={this.onIncrement}\n type={\"button\"}\n >\n +\n </DefaultButton>\n </div>\n </div>\n )\n }\n}\n\nconst wrappedComponent = withFieldLabelAndHint(Stepper)\nwrappedComponent.displayName = \"Stepper\"\n\nexport { wrappedComponent as Stepper }\n\ntype StepperMetaProps = {\n children: React.ReactNode\n}\nconst StepperMeta = ({ children }: StepperMetaProps) => {\n return <div className=\"cobalt-Stepper__Meta\">{children}</div>\n}\n\nexport { StepperMeta }\n"],"names":["classNames"],"mappings":";;;;;AAMA,MAAM,cAAc,GAAG,CACrB,KAAa,EACb,GAAuB,EACvB,GAAuB,KACrB;IACF,IAAI,aAAa,GAAG,KAAK,CAAA;AACzB,IAAA,IAAI,OAAO,GAAG,KAAK,WAAW,EAAE;QAC9B,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,GAAG,CAAC,CAAA;AAC7C,KAAA;AACD,IAAA,IAAI,OAAO,GAAG,KAAK,WAAW,EAAE;QAC9B,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,GAAG,CAAC,CAAA;AAC7C,KAAA;AACD,IAAA,OAAO,aAAa,CAAA;AACtB,CAAC,CAAA;AAiBD,MAAM,OAAQ,SAAQ,aAA2B,CAAA;AAC/C,IAAA,WAAA,CAAY,KAAY,EAAA;QACtB,KAAK,CAAC,KAAK,CAAC,CAAA;QAsBd,IAAW,CAAA,WAAA,GAAG,MAAK;AAChB,YAAA,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG;gBAC5D,IAAI,CAAC,WAAW,CACd,UAAU,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,CAC7D,CAAA;AACL,SAAC,CAAA;QAED,IAAW,CAAA,WAAA,GAAG,MAAK;AAChB,YAAA,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK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,QAAQ,EAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAI,CACxD;AACN,gBAAA,KAAA,CAAA,aAAA,CAAC,aAAa,EAAA,EACZ,SAAS,EAAC,8BAA8B,EACxC,QAAQ,EAAE,QAAQ,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,GAAG,EAC9C,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,IAAI,EAAE,QAAQ,EAAA,EAAA,GAAA,CAGA,CACZ,CACF,EACP;KACF;AACF,CAAA;AAED,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,OAAO,EAAC;AACvD,gBAAgB,CAAC,WAAW,GAAG,SAAS,CAAA;AAOxC,MAAM,WAAW,GAAG,CAAC,EAAE,QAAQ,EAAoB,KAAI;AACrD,IAAA,OAAO,6BAAK,SAAS,EAAC,sBAAsB,EAAE,EAAA,QAAQ,CAAO,CAAA;AAC/D;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/Helper/index.tsx"],"sourcesContent":["import React, { PropsWithChildren } from \"react\"\nimport cx from \"classnames\"\n\nimport DefaultButton from \"../Buttons/DefaultButton\"\n\ntype HelperPropsType = PropsWithChildren<{\n className?: string\n title: string\n titleClassName?: string\n contentClassName?: string\n cta?: ReturnType<typeof DefaultButton | typeof DefaultButton.Link>\n}>\n\nconst Helper = ({\n className,\n titleClassName,\n contentClassName,\n title,\n children,\n cta,\n}: HelperPropsType) => (\n <div className={cx(\"cobalt-helper\", className)}>\n <strong className={cx(\"cobalt-helper__title\", titleClassName)}>\n {title}\n </strong>\n <div className={cx(\"cobalt-helper__content\", contentClassName)}>\n {children}\n </div>\n {cta}\n </div>\n)\n\nexport default Helper\n"],"names":[],"mappings":";;;AAaA,MAAM,MAAM,GAAG,CAAC,EACd,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,KAAK,EACL,QAAQ,EACR,GAAG,GACa,MAChB,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,SAAS,CAAC,EAAA;IAC5C,KAAQ,CAAA,aAAA,CAAA,QAAA,EAAA,EAAA,SAAS,EAAE,EAAE,CAAC,sBAAsB,EAAE,cAAc,CAAC,EAC1D,EAAA,KAAK,CACC;IACT,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,EAAE,CAAC,wBAAwB,EAAE,gBAAgB,CAAC,EAC3D,EAAA,QAAQ,CACL;IACL,GAAG,CACA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Helper/index.tsx"],"sourcesContent":["import React from \"react\"\nimport cx from \"classnames\"\n\nimport DefaultButton from \"../Buttons/DefaultButton\"\n\ntype HelperPropsType = {\n children?: React.ReactNode\n className?: string\n title: string\n titleClassName?: string\n contentClassName?: string\n cta?: ReturnType<typeof DefaultButton | typeof DefaultButton.Link>\n}\n\nconst Helper = ({\n className,\n titleClassName,\n contentClassName,\n title,\n children,\n cta,\n}: HelperPropsType) => (\n <div className={cx(\"cobalt-helper\", className)}>\n <strong className={cx(\"cobalt-helper__title\", titleClassName)}>\n {title}\n </strong>\n <div className={cx(\"cobalt-helper__content\", contentClassName)}>\n {children}\n </div>\n {cta}\n </div>\n)\n\nexport default Helper\n"],"names":[],"mappings":";;;AAcA,MAAM,MAAM,GAAG,CAAC,EACd,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,KAAK,EACL,QAAQ,EACR,GAAG,GACa,MAChB,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,SAAS,CAAC,EAAA;IAC5C,KAAQ,CAAA,aAAA,CAAA,QAAA,EAAA,EAAA,SAAS,EAAE,EAAE,CAAC,sBAAsB,EAAE,cAAc,CAAC,EAC1D,EAAA,KAAK,CACC;IACT,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,EAAE,CAAC,wBAAwB,EAAE,gBAAgB,CAAC,EAC3D,EAAA,QAAQ,CACL;IACL,GAAG,CACA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/HorizontalList/index.tsx"],"sourcesContent":["import React, { PropsWithChildren } from \"react\"\nimport cx from \"classnames\"\nimport { CobaltBreakpointType } from \"../../hooks/useBreakpoint\"\n\nexport type HorizontalListPropsType = PropsWithChildren<{\n className?: string\n fitFrom?: Exclude<CobaltBreakpointType, \"over\">\n}>\n\nexport default function HorizontalList({\n className,\n fitFrom,\n children,\n}: HorizontalListPropsType) {\n return (\n <div\n className={cx(`cobalt-horizontal-list`, className, {\n \"xs:cobalt-horizontal-list--fit\": fitFrom === \"xs\",\n \"sm:cobalt-horizontal-list--fit\": fitFrom === \"sm\",\n \"md:cobalt-horizontal-list--fit\": fitFrom === \"md\",\n \"lg:cobalt-horizontal-list--fit\": fitFrom === \"lg\",\n })}\n >\n {children}\n </div>\n )\n}\n\ntype HorizontalScrollerPaddingBlockProps = {\n className?: string\n}\n\nexport function HorizontalListPaddingBlock({\n className,\n}: HorizontalScrollerPaddingBlockProps) {\n return (\n <div\n className={cx(`cobalt-horizontal-list__padding-block`, className)}\n ></div>\n )\n}\n"],"names":[],"mappings":";;;AASc,SAAU,cAAc,CAAC,EACrC,SAAS,EACT,OAAO,EACP,QAAQ,GACgB,EAAA;IACxB,QACE,6BACE,SAAS,EAAE,EAAE,CAAC,CAAA,sBAAA,CAAwB,EAAE,SAAS,EAAE;YACjD,gCAAgC,EAAE,OAAO,KAAK,IAAI;YAClD,gCAAgC,EAAE,OAAO,KAAK,IAAI;YAClD,gCAAgC,EAAE,OAAO,KAAK,IAAI;YAClD,gCAAgC,EAAE,OAAO,KAAK,IAAI;AACnD,SAAA,CAAC,EAED,EAAA,QAAQ,CACL,EACP;AACH,CAAC;AAMe,SAAA,0BAA0B,CAAC,EACzC,SAAS,GAC2B,EAAA;AACpC,IAAA,QACE,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAE,EAAE,CAAC,CAAuC,qCAAA,CAAA,EAAE,SAAS,CAAC,EAC5D,CAAA,EACR;AACH;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/HorizontalList/index.tsx"],"sourcesContent":["import React from \"react\"\nimport cx from \"classnames\"\nimport { CobaltBreakpointType } from \"../../hooks/useBreakpoint\"\n\nexport type HorizontalListPropsType = {\n children?: React.ReactNode\n className?: string\n fitFrom?: Exclude<CobaltBreakpointType, \"over\">\n}\n\nexport default function HorizontalList({\n className,\n fitFrom,\n children,\n}: HorizontalListPropsType) {\n return (\n <div\n className={cx(`cobalt-horizontal-list`, className, {\n \"xs:cobalt-horizontal-list--fit\": fitFrom === \"xs\",\n \"sm:cobalt-horizontal-list--fit\": fitFrom === \"sm\",\n \"md:cobalt-horizontal-list--fit\": fitFrom === \"md\",\n \"lg:cobalt-horizontal-list--fit\": fitFrom === \"lg\",\n })}\n >\n {children}\n </div>\n )\n}\n\ntype HorizontalScrollerPaddingBlockProps = {\n className?: string\n}\n\nexport function HorizontalListPaddingBlock({\n className,\n}: HorizontalScrollerPaddingBlockProps) {\n return (\n <div\n className={cx(`cobalt-horizontal-list__padding-block`, className)}\n ></div>\n )\n}\n"],"names":[],"mappings":";;;AAUc,SAAU,cAAc,CAAC,EACrC,SAAS,EACT,OAAO,EACP,QAAQ,GACgB,EAAA;IACxB,QACE,6BACE,SAAS,EAAE,EAAE,CAAC,CAAA,sBAAA,CAAwB,EAAE,SAAS,EAAE;YACjD,gCAAgC,EAAE,OAAO,KAAK,IAAI;YAClD,gCAAgC,EAAE,OAAO,KAAK,IAAI;YAClD,gCAAgC,EAAE,OAAO,KAAK,IAAI;YAClD,gCAAgC,EAAE,OAAO,KAAK,IAAI;AACnD,SAAA,CAAC,EAED,EAAA,QAAQ,CACL,EACP;AACH,CAAC;AAMe,SAAA,0BAA0B,CAAC,EACzC,SAAS,GAC2B,EAAA;AACpC,IAAA,QACE,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAE,EAAE,CAAC,CAAuC,qCAAA,CAAA,EAAE,SAAS,CAAC,EAC5D,CAAA,EACR;AACH;;;;"}
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import cx from 'classnames';
3
3
 
4
- const ModalBody = ({ children, bodySpacing = true, hasHeader, hasFooter }) => (React.createElement("div", { className: cx("cobalt-modal-body", {
4
+ const ModalBody = ({ children, bodySpacing = true, hasHeader, hasFooter, }) => (React.createElement("div", { className: cx("cobalt-modal-body", {
5
5
  "cobalt-modal-body--bodySpacing": bodySpacing,
6
6
  "cobalt-modal-body--hasHeader": hasHeader,
7
7
  "cobalt-modal-body--hasFooter": hasFooter,
@@ -1 +1 @@
1
- {"version":3,"file":"ModalBody.js","sources":["../../../src/components/Modal/ModalBody.tsx"],"sourcesContent":["import React, { FunctionComponent } from \"react\"\nimport cx from \"classnames\"\n\nconst ModalBody: FunctionComponent<{\n bodySpacing?: boolean\n hasHeader: boolean\n hasFooter: boolean\n}> = ({ children, bodySpacing = true, hasHeader, hasFooter }) => (\n <div\n className={cx(\"cobalt-modal-body\", {\n \"cobalt-modal-body--bodySpacing\": bodySpacing,\n \"cobalt-modal-body--hasHeader\": hasHeader,\n \"cobalt-modal-body--hasFooter\": hasFooter,\n })}\n >\n {children}\n </div>\n)\n\nexport default ModalBody\n"],"names":[],"mappings":";;;AAGM,MAAA,SAAS,GAIV,CAAC,EAAE,QAAQ,EAAE,WAAW,GAAG,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,MAC1D,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAE,EAAE,CAAC,mBAAmB,EAAE;AACjC,QAAA,gCAAgC,EAAE,WAAW;AAC7C,QAAA,8BAA8B,EAAE,SAAS;AACzC,QAAA,8BAA8B,EAAE,SAAS;AAC1C,KAAA,CAAC,EAED,EAAA,QAAQ,CACL;;;;"}
1
+ {"version":3,"file":"ModalBody.js","sources":["../../../src/components/Modal/ModalBody.tsx"],"sourcesContent":["import React from \"react\"\nimport cx from \"classnames\"\n\nconst ModalBody = ({\n children,\n bodySpacing = true,\n hasHeader,\n hasFooter,\n}: {\n children?: React.ReactNode\n bodySpacing?: boolean\n hasHeader: boolean\n hasFooter: boolean\n}) => (\n <div\n className={cx(\"cobalt-modal-body\", {\n \"cobalt-modal-body--bodySpacing\": bodySpacing,\n \"cobalt-modal-body--hasHeader\": hasHeader,\n \"cobalt-modal-body--hasFooter\": hasFooter,\n })}\n >\n {children}\n </div>\n)\n\nexport default ModalBody\n"],"names":[],"mappings":";;;AAGM,MAAA,SAAS,GAAG,CAAC,EACjB,QAAQ,EACR,WAAW,GAAG,IAAI,EAClB,SAAS,EACT,SAAS,GAMV,MACC,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAE,EAAE,CAAC,mBAAmB,EAAE;AACjC,QAAA,gCAAgC,EAAE,WAAW;AAC7C,QAAA,8BAA8B,EAAE,SAAS;AACzC,QAAA,8BAA8B,EAAE,SAAS;AAC1C,KAAA,CAAC,EAED,EAAA,QAAQ,CACL;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ModalFooter.js","sources":["../../../src/components/Modal/ModalFooter.tsx"],"sourcesContent":["import React, { PropsWithChildren } from \"react\"\nimport cx from \"classnames\"\n\nexport type ModalFooterPropsType = PropsWithChildren<{ className?: string }>\n\nconst ModalFooter = ({ children, className }: ModalFooterPropsType) => {\n return <div className={cx(\"cobalt-modal-footer\", className)}>{children}</div>\n}\n\nexport default ModalFooter\n"],"names":[],"mappings":";;;AAKM,MAAA,WAAW,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAwB,KAAI;AACpE,IAAA,OAAO,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,EAAA,EAAG,QAAQ,CAAO,CAAA;AAC/E;;;;"}
1
+ {"version":3,"file":"ModalFooter.js","sources":["../../../src/components/Modal/ModalFooter.tsx"],"sourcesContent":["import React from \"react\"\nimport cx from \"classnames\"\n\nexport type ModalFooterPropsType = {\n children?: React.ReactNode\n className?: string\n}\n\nconst ModalFooter = ({ children, className }: ModalFooterPropsType) => {\n return <div className={cx(\"cobalt-modal-footer\", className)}>{children}</div>\n}\n\nexport default ModalFooter\n"],"names":[],"mappings":";;;AAQM,MAAA,WAAW,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAwB,KAAI;AACpE,IAAA,OAAO,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,EAAA,EAAG,QAAQ,CAAO,CAAA;AAC/E;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/Popover/index.tsx"],"sourcesContent":["import React, { useEffect, useCallback, PropsWithChildren } from \"react\"\nimport Tippy, { TippyProps } from \"@tippyjs/react\"\nimport { sticky } from \"tippy.js\"\n\nimport useBreakpoint from \"../../hooks/useBreakpoint\"\nimport Modal, { ModalPropsType } from \"../Modal\"\nimport LazyTippy from \"./LazyTippy\"\nimport { zIndexes } from \"../../tokens\"\n\nexport type PopoverPropsType = PropsWithChildren<{\n isOpen: boolean\n close: () => void\n \"aria-label\"?: string\n bodySpacing?: boolean\n onShow?: () => void\n onHidden?: () => void\n // Desktop props\n targetRef: TippyProps[\"reference\"]\n arrow?: boolean\n placement?: TippyProps[\"placement\"]\n theme?: string\n distance?: number\n zIndex?: number\n /**\n * __Only for desktop popover__\n *\n * Allow to render the content only when the popover is mounted in the DOM\n * Useful to render async content in the popover\n */\n lazy?: boolean\n}>\n\nconst ESC_KEY_CODE = 27\n\nconst defaultTippyProps: Omit<TippyProps, \"content\" | \"children\" | \"visible\"> =\n {\n animation: \"shift-away-subtle\",\n interactive: true,\n interactiveBorder: 10,\n delay: [0, 0],\n duration: [200, 150],\n maxWidth: 500,\n sticky: true,\n plugins: [sticky],\n theme: \"light cobalt-popover\",\n inertia: true,\n }\n\nconst MobilePopover = ({\n isOpen,\n children,\n ariaLabel = \"Popover mobile modal\",\n onDismiss,\n bodySpacing,\n onShow,\n onHidden,\n}: PropsWithChildren<{\n ariaLabel?: ModalPropsType[\"aria-label\"]\n isOpen: ModalPropsType[\"isOpen\"]\n onDismiss?: () => void\n bodySpacing: ModalPropsType[\"bodySpacing\"]\n onShow: ModalPropsType[\"onShow\"]\n onHidden: ModalPropsType[\"onHidden\"]\n}>) => {\n return (\n <Modal\n aria-label={ariaLabel}\n isOpen={isOpen}\n onDismissAttempt={onDismiss}\n bodySpacing={bodySpacing}\n onShow={onShow}\n onHidden={onHidden}\n >\n {children}\n </Modal>\n )\n}\n\nconst Popover = ({\n isOpen,\n targetRef,\n close,\n \"aria-label\": ariaLabel,\n children,\n bodySpacing = true,\n onShow,\n onHidden,\n // Desktop props\n arrow = false,\n placement = \"bottom-start\",\n theme = \"\",\n distance = 8,\n zIndex = zIndexes.dropdown,\n lazy,\n}: PopoverPropsType) => {\n const { breakpoint } = useBreakpoint()\n const isMobile = breakpoint === \"sm\" || breakpoint === \"xs\"\n\n const escListener = useCallback(\n (event: KeyboardEvent) => {\n if (event.keyCode === ESC_KEY_CODE && isOpen) close()\n },\n [isOpen, close]\n )\n\n useEffect(() => {\n window.addEventListener(\"keydown\", escListener)\n\n return () => window.removeEventListener(\"keydown\", escListener)\n }, [escListener])\n\n const onTippyClose = () => {\n if (onHidden) onHidden()\n }\n\n const onTippyOpen = () => {\n if (onShow) onShow()\n }\n\n const TippyComp = lazy ? LazyTippy : Tippy\n\n return isMobile ? (\n <MobilePopover\n isOpen={isOpen}\n onDismiss={close}\n bodySpacing={bodySpacing}\n ariaLabel={ariaLabel}\n onShow={onShow}\n onHidden={onHidden}\n >\n {children}\n </MobilePopover>\n ) : (\n <TippyComp\n content={\n bodySpacing ? (\n <div className=\"cobalt-popover--bodySpacing\">{children}</div>\n ) : (\n children\n )\n }\n {...defaultTippyProps}\n visible={isOpen}\n reference={targetRef}\n theme={`${defaultTippyProps.theme} ${theme}`}\n offset={[0, distance]}\n {...{ arrow, placement, zIndex }}\n onHidden={onTippyClose}\n onShow={onTippyOpen}\n onClickOutside={close}\n />\n )\n}\n\nexport default Popover\n"],"names":[],"mappings":";;;;;;;;AAgCA,MAAM,YAAY,GAAG,EAAE,CAAA;AAEvB,MAAM,iBAAiB,GACrB;AACE,IAAA,SAAS,EAAE,mBAAmB;AAC9B,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,iBAAiB,EAAE,EAAE;AACrB,IAAA,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;AACb,IAAA,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;AACpB,IAAA,QAAQ,EAAE,GAAG;AACb,IAAA,MAAM,EAAE,IAAI;IACZ,OAAO,EAAE,CAAC,MAAM,CAAC;AACjB,IAAA,KAAK,EAAE,sBAAsB;AAC7B,IAAA,OAAO,EAAE,IAAI;CACd,CAAA;AAEH,MAAM,aAAa,GAAG,CAAC,EACrB,MAAM,EACN,QAAQ,EACR,SAAS,GAAG,sBAAsB,EAClC,SAAS,EACT,WAAW,EACX,MAAM,EACN,QAAQ,GAQR,KAAI;AACJ,IAAA,QACE,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,EAAA,YAAA,EACQ,SAAS,EACrB,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,SAAS,EAC3B,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAAA,EAEjB,QAAQ,CACH,EACT;AACH,CAAC,CAAA;AAEK,MAAA,OAAO,GAAG,CAAC,EACf,MAAM,EACN,SAAS,EACT,KAAK,EACL,YAAY,EAAE,SAAS,EACvB,QAAQ,EACR,WAAW,GAAG,IAAI,EAClB,MAAM,EACN,QAAQ;AACR;AACA,KAAK,GAAG,KAAK,EACb,SAAS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AAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,6BAA6B,EAAA,EAAE,QAAQ,CAAO,KAE7D,QAAQ,CACT,KAEC,iBAAiB,EACrB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,CAAA,EAAG,iBAAiB,CAAC,KAAK,CAAA,CAAA,EAAI,KAAK,CAAA,CAAE,EAC5C,MAAM,EAAE,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAA,GACjB,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,EAChC,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,WAAW,EACnB,cAAc,EAAE,KAAK,EACrB,CAAA,CACH,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Popover/index.tsx"],"sourcesContent":["import React, { useEffect, useCallback } from \"react\"\nimport Tippy, { TippyProps } from \"@tippyjs/react\"\nimport { sticky } from \"tippy.js\"\n\nimport useBreakpoint from \"../../hooks/useBreakpoint\"\nimport Modal, { ModalPropsType } from \"../Modal\"\nimport LazyTippy from \"./LazyTippy\"\nimport { zIndexes } from \"../../tokens\"\n\nexport type PopoverPropsType = {\n children?: React.ReactNode\n isOpen: boolean\n close: () => void\n \"aria-label\"?: string\n bodySpacing?: boolean\n onShow?: () => void\n onHidden?: () => void\n // Desktop props\n targetRef: TippyProps[\"reference\"]\n arrow?: boolean\n placement?: TippyProps[\"placement\"]\n theme?: string\n distance?: number\n zIndex?: number\n /**\n * __Only for desktop popover__\n *\n * Allow to render the content only when the popover is mounted in the DOM\n * Useful to render async content in the popover\n */\n lazy?: boolean\n}\n\nconst ESC_KEY_CODE = 27\n\nconst defaultTippyProps: Omit<TippyProps, \"content\" | \"children\" | \"visible\"> =\n {\n animation: \"shift-away-subtle\",\n interactive: true,\n interactiveBorder: 10,\n delay: [0, 0],\n duration: [200, 150],\n maxWidth: 500,\n sticky: true,\n plugins: [sticky],\n theme: \"light cobalt-popover\",\n inertia: true,\n }\n\nconst MobilePopover = ({\n isOpen,\n children,\n ariaLabel = \"Popover mobile modal\",\n onDismiss,\n bodySpacing,\n onShow,\n onHidden,\n}: {\n children?: React.ReactNode\n ariaLabel?: ModalPropsType[\"aria-label\"]\n isOpen: ModalPropsType[\"isOpen\"]\n onDismiss?: () => void\n bodySpacing: ModalPropsType[\"bodySpacing\"]\n onShow: ModalPropsType[\"onShow\"]\n onHidden: ModalPropsType[\"onHidden\"]\n}) => {\n return (\n <Modal\n aria-label={ariaLabel}\n isOpen={isOpen}\n onDismissAttempt={onDismiss}\n bodySpacing={bodySpacing}\n onShow={onShow}\n onHidden={onHidden}\n >\n {children}\n </Modal>\n )\n}\n\nconst Popover = ({\n isOpen,\n targetRef,\n close,\n \"aria-label\": ariaLabel,\n children,\n bodySpacing = true,\n onShow,\n onHidden,\n // Desktop props\n arrow = false,\n placement = \"bottom-start\",\n theme = \"\",\n distance = 8,\n zIndex = zIndexes.dropdown,\n lazy,\n}: PopoverPropsType) => {\n const { breakpoint } = useBreakpoint()\n const isMobile = breakpoint === \"sm\" || breakpoint === \"xs\"\n\n const escListener = useCallback(\n (event: KeyboardEvent) => {\n if (event.keyCode === ESC_KEY_CODE && isOpen) close()\n },\n [isOpen, close]\n )\n\n useEffect(() => {\n window.addEventListener(\"keydown\", escListener)\n\n return () => window.removeEventListener(\"keydown\", escListener)\n }, [escListener])\n\n const onTippyClose = () => {\n if (onHidden) onHidden()\n }\n\n const onTippyOpen = () => {\n if (onShow) onShow()\n }\n\n const TippyComp = lazy ? LazyTippy : Tippy\n\n return isMobile ? (\n <MobilePopover\n isOpen={isOpen}\n onDismiss={close}\n bodySpacing={bodySpacing}\n ariaLabel={ariaLabel}\n onShow={onShow}\n onHidden={onHidden}\n >\n {children}\n </MobilePopover>\n ) : (\n <TippyComp\n content={\n bodySpacing ? (\n <div className=\"cobalt-popover--bodySpacing\">{children}</div>\n ) : (\n children\n )\n }\n {...defaultTippyProps}\n visible={isOpen}\n reference={targetRef}\n theme={`${defaultTippyProps.theme} ${theme}`}\n offset={[0, distance]}\n {...{ arrow, placement, zIndex }}\n onHidden={onTippyClose}\n onShow={onTippyOpen}\n onClickOutside={close}\n />\n )\n}\n\nexport default Popover\n"],"names":[],"mappings":";;;;;;;;AAiCA,MAAM,YAAY,GAAG,EAAE,CAAA;AAEvB,MAAM,iBAAiB,GACrB;AACE,IAAA,SAAS,EAAE,mBAAmB;AAC9B,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,iBAAiB,EAAE,EAAE;AACrB,IAAA,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;AACb,IAAA,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;AACpB,IAAA,QAAQ,EAAE,GAAG;AACb,IAAA,MAAM,EAAE,IAAI;IACZ,OAAO,EAAE,CAAC,MAAM,CAAC;AACjB,IAAA,KAAK,EAAE,sBAAsB;AAC7B,IAAA,OAAO,EAAE,IAAI;CACd,CAAA;AAEH,MAAM,aAAa,GAAG,CAAC,EACrB,MAAM,EACN,QAAQ,EACR,SAAS,GAAG,sBAAsB,EAClC,SAAS,EACT,WAAW,EACX,MAAM,EACN,QAAQ,GAST,KAAI;AACH,IAAA,QACE,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,EAAA,YAAA,EACQ,SAAS,EACrB,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,SAAS,EAC3B,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAAA,EAEjB,QAAQ,CACH,EACT;AACH,CAAC,CAAA;AAEK,MAAA,OAAO,GAAG,CAAC,EACf,MAAM,EACN,SAAS,EACT,KAAK,EACL,YAAY,EAAE,SAAS,EACvB,QAAQ,EACR,WAAW,GAAG,IAAI,EAClB,MAAM,EACN,QAAQ;AACR;AACA,KAAK,GAAG,KAAK,EACb,SAAS,GAAG,cAAc,EAC1B,KAAK,GAAG,EAAE,EACV,QAAQ,G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,6BAA6B,EAAA,EAAE,QAAQ,CAAO,KAE7D,QAAQ,CACT,KAEC,iBAAiB,EACrB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,CAAA,EAAG,iBAAiB,CAAC,KAAK,CAAA,CAAA,EAAI,KAAK,CAAA,CAAE,EAC5C,MAAM,EAAE,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAA,GACjB,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,EAChC,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,WAAW,EACnB,cAAc,EAAE,KAAK,EACrB,CAAA,CACH,CAAA;AACH;;;;"}
@@ -2,8 +2,10 @@ import React from 'react';
2
2
  import cx from 'classnames';
3
3
  import { RatingIcon, defaultRatingIcon } from './RatingIcons.js';
4
4
  import RatingLabel from './RatingLabel.js';
5
- import { formatRatingValue } from './index.js';
6
5
 
6
+ function formatRatingValue(value) {
7
+ return `${value}`.includes(".") ? value : value.toFixed(1);
8
+ }
7
9
  function RatingCompact({ className, value, count, size = 16, icon = defaultRatingIcon, }) {
8
10
  return (React.createElement("div", { className: cx("cobalt-rating", className) },
9
11
  React.createElement(RatingIcon, { icon: icon, size: size, status: "full" }),
@@ -13,5 +15,5 @@ function RatingCompact({ className, value, count, size = 16, icon = defaultRatin
13
15
  count && `(${count})`)));
14
16
  }
15
17
 
16
- export { RatingCompact };
18
+ export { RatingCompact, formatRatingValue };
17
19
  //# sourceMappingURL=RatingCompact.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RatingCompact.js","sources":["../../../src/components/Rating/RatingCompact.tsx"],"sourcesContent":["import React from \"react\"\nimport cx from \"classnames\"\nimport {\n defaultRatingIcon,\n RatingIcon,\n RatingIconsPropsType,\n} from \"./RatingIcons\"\nimport RatingLabel from \"./RatingLabel\"\nimport { formatRatingValue } from \".\"\n\ntype RatingCompactPropsType = Pick<\n RatingIconsPropsType,\n \"className\" | \"value\" | \"size\"\n> & {\n icon?: JSX.Element\n count?: number\n}\n\nexport function RatingCompact({\n className,\n value,\n count,\n size = 16,\n icon = defaultRatingIcon,\n}: RatingCompactPropsType) {\n return (\n <div className={cx(\"cobalt-rating\", className)}>\n <RatingIcon icon={icon} size={size} status={\"full\"} />\n <RatingLabel>\n {formatRatingValue(value)} {count && `(${count})`}\n </RatingLabel>\n </div>\n )\n}\n"],"names":[],"mappings":";;;;;;SAkBgB,aAAa,CAAC,EAC5B,SAAS,EACT,KAAK,EACL,KAAK,EACL,IAAI,GAAG,EAAE,EACT,IAAI,GAAG,iBAAiB,GACD,EAAA;IACvB,QACE,6BAAK,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,SAAS,CAAC,EAAA;AAC5C,QAAA,KAAA,CAAA,aAAA,CAAC,UAAU,EAAA,EAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAI,CAAA;AACtD,QAAA,KAAA,CAAA,aAAA,CAAC,WAAW,EAAA,IAAA;YACT,iBAAiB,CAAC,KAAK,CAAC;;AAAG,YAAA,KAAK,IAAI,CAAI,CAAA,EAAA,KAAK,GAAG,CACrC,CACV,EACP;AACH;;;;"}
1
+ {"version":3,"file":"RatingCompact.js","sources":["../../../src/components/Rating/RatingCompact.tsx"],"sourcesContent":["import React from \"react\"\nimport cx from \"classnames\"\nimport {\n defaultRatingIcon,\n RatingIcon,\n RatingIconsPropsType,\n} from \"./RatingIcons\"\nimport RatingLabel from \"./RatingLabel\"\n\ntype RatingCompactPropsType = Pick<\n RatingIconsPropsType,\n \"className\" | \"value\" | \"size\"\n> & {\n icon?: JSX.Element\n count?: number\n}\n\nexport function formatRatingValue(value: number) {\n return `${value}`.includes(\".\") ? value : value.toFixed(1)\n}\n\nexport function RatingCompact({\n className,\n value,\n count,\n size = 16,\n icon = defaultRatingIcon,\n}: RatingCompactPropsType) {\n return (\n <div className={cx(\"cobalt-rating\", className)}>\n <RatingIcon icon={icon} size={size} status={\"full\"} />\n <RatingLabel>\n {formatRatingValue(value)} {count && `(${count})`}\n </RatingLabel>\n </div>\n )\n}\n"],"names":[],"mappings":";;;;;AAiBM,SAAU,iBAAiB,CAAC,KAAa,EAAA;IAC7C,OAAO,CAAA,EAAG,KAAK,CAAE,CAAA,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AAC5D,CAAC;SAEe,aAAa,CAAC,EAC5B,SAAS,EACT,KAAK,EACL,KAAK,EACL,IAAI,GAAG,EAAE,EACT,IAAI,GAAG,iBAAiB,GACD,EAAA;IACvB,QACE,6BAAK,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,SAAS,CAAC,EAAA;AAC5C,QAAA,KAAA,CAAA,aAAA,CAAC,UAAU,EAAA,EAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAI,CAAA;AACtD,QAAA,KAAA,CAAA,aAAA,CAAC,WAAW,EAAA,IAAA;YACT,iBAAiB,CAAC,KAAK,CAAC;;AAAG,YAAA,KAAK,IAAI,CAAI,CAAA,EAAA,KAAK,GAAG,CACrC,CACV,EACP;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"RatingLabel.js","sources":["../../../src/components/Rating/RatingLabel.tsx"],"sourcesContent":["import React from \"react\"\n\ntype RatingLabelPropsType = React.PropsWithChildren<React.ReactNode>\n\nfunction RatingLabel({ children }: RatingLabelPropsType) {\n return <div className=\"cobalt-rating__label\">{children}</div>\n}\n\nexport default RatingLabel\n"],"names":[],"mappings":";;AAIA,SAAS,WAAW,CAAC,EAAE,QAAQ,EAAwB,EAAA;AACrD,IAAA,OAAO,6BAAK,SAAS,EAAC,sBAAsB,EAAE,EAAA,QAAQ,CAAO,CAAA;AAC/D;;;;"}
1
+ {"version":3,"file":"RatingLabel.js","sources":["../../../src/components/Rating/RatingLabel.tsx"],"sourcesContent":["import React from \"react\"\n\ntype RatingLabelPropsType = {\n children?: React.ReactNode\n}\n\nfunction RatingLabel({ children }: RatingLabelPropsType) {\n return <div className=\"cobalt-rating__label\">{children}</div>\n}\n\nexport default RatingLabel\n"],"names":[],"mappings":";;AAMA,SAAS,WAAW,CAAC,EAAE,QAAQ,EAAwB,EAAA;AACrD,IAAA,OAAO,6BAAK,SAAS,EAAC,sBAAsB,EAAE,EAAA,QAAQ,CAAO,CAAA;AAC/D;;;;"}
@@ -3,14 +3,11 @@ import React from 'react';
3
3
  import { RatingIcons } from './RatingIcons.js';
4
4
  export { RatingIcons } from './RatingIcons.js';
5
5
 
6
- function formatRatingValue(value) {
7
- return `${value}`.includes(".") ? value : value.toFixed(1);
8
- }
9
6
  function Rating({ className, iconsClassName, children, ...iconsProps }) {
10
7
  return (React.createElement("div", { className: cx("cobalt-rating", className) },
11
8
  React.createElement(RatingIcons, { className: iconsClassName, ...iconsProps }),
12
9
  children));
13
10
  }
14
11
 
15
- export { Rating, formatRatingValue };
12
+ export { Rating };
16
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/Rating/index.tsx"],"sourcesContent":["import cx from \"classnames\"\nimport React from \"react\"\nimport { RatingIcons, RatingIconsPropsType } from \"./RatingIcons\"\nimport { RatingInput } from \"./RatingInput\"\nimport { RatingCompact } from \"./RatingCompact\"\nimport RatingLabel from \"./RatingLabel\"\n\ntype RatingPropsType = React.PropsWithChildren<RatingIconsPropsType> & {\n iconsClassName?: RatingIconsPropsType[\"className\"]\n}\n\nfunction formatRatingValue(value: number) {\n return `${value}`.includes(\".\") ? value : value.toFixed(1)\n}\n\nfunction Rating({\n className,\n iconsClassName,\n children,\n ...iconsProps\n}: RatingPropsType) {\n return (\n <div className={cx(\"cobalt-rating\", className)}>\n <RatingIcons className={iconsClassName} {...iconsProps} />\n {children}\n </div>\n )\n}\n\nexport {\n Rating,\n RatingLabel,\n RatingInput,\n RatingCompact,\n RatingIcons,\n formatRatingValue,\n}\n"],"names":[],"mappings":";;;;;AAWA,SAAS,iBAAiB,CAAC,KAAa,EAAA;IACtC,OAAO,CAAA,EAAG,KAAK,CAAE,CAAA,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AAC5D,CAAC;AAED,SAAS,MAAM,CAAC,EACd,SAAS,EACT,cAAc,EACd,QAAQ,EACR,GAAG,UAAU,EACG,EAAA;IAChB,QACE,6BAAK,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,SAAS,CAAC,EAAA;AAC5C,QAAA,KAAA,CAAA,aAAA,CAAC,WAAW,EAAC,EAAA,SAAS,EAAE,cAAc,EAAA,GAAM,UAAU,EAAI,CAAA;QACzD,QAAQ,CACL,EACP;AACH;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Rating/index.tsx"],"sourcesContent":["import cx from \"classnames\"\nimport React from \"react\"\nimport { RatingIcons, RatingIconsPropsType } from \"./RatingIcons\"\nimport { RatingInput } from \"./RatingInput\"\nimport { RatingCompact, formatRatingValue } from \"./RatingCompact\"\nimport RatingLabel from \"./RatingLabel\"\n\ntype RatingPropsType = RatingIconsPropsType & {\n children?: React.ReactNode\n iconsClassName?: RatingIconsPropsType[\"className\"]\n}\n\nfunction Rating({\n className,\n iconsClassName,\n children,\n ...iconsProps\n}: RatingPropsType) {\n return (\n <div className={cx(\"cobalt-rating\", className)}>\n <RatingIcons className={iconsClassName} {...iconsProps} />\n {children}\n </div>\n )\n}\n\nexport {\n Rating,\n RatingLabel,\n RatingInput,\n RatingCompact,\n RatingIcons,\n formatRatingValue,\n}\n"],"names":[],"mappings":";;;;;AAYA,SAAS,MAAM,CAAC,EACd,SAAS,EACT,cAAc,EACd,QAAQ,EACR,GAAG,UAAU,EACG,EAAA;IAChB,QACE,6BAAK,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,SAAS,CAAC,EAAA;AAC5C,QAAA,KAAA,CAAA,aAAA,CAAC,WAAW,EAAC,EAAA,SAAS,EAAE,cAAc,EAAA,GAAM,UAAU,EAAI,CAAA;QACzD,QAAQ,CACL,EACP;AACH;;;;"}
@@ -9,7 +9,7 @@ import ChevronRightIcon from '../Icon/__generated__/ChevronRightIcon.js';
9
9
 
10
10
  const SCROLL_STEP = 150;
11
11
  // Only for the API, render nothing, we use InternalTab component internally
12
- const Tab = () => null;
12
+ const Tab = (_props) => null;
13
13
  Tab.displayName = "Tab";
14
14
  const isTabComponent = (component) => React.isValidElement(component) && component.type === Tab;
15
15
  const InternalTab = (props) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/Tabs/index.tsx"],"sourcesContent":["import React, {\n FC,\n useRef,\n useLayoutEffect,\n useState,\n useCallback,\n} from \"react\"\nimport {\n Tabs as ReachTabs,\n TabList as ReachTabList,\n Tab as ReachTab,\n TabPanels as ReachTabPanels,\n TabPanel as ReachTabPanel,\n} from \"@reach/tabs\"\nimport cx from \"classnames\"\nimport { useSpring } from \"@react-spring/web\"\n\nimport { throttle } from \"../utils\"\nimport { ChevronLeftIcon, ChevronRightIcon } from \"../Icon\"\n\nconst SCROLL_STEP = 150\n\nexport type TabsPropsType = {\n /**\n * Index of the initial actived tab (first tab by default)\n */\n defaultTabIndex?: number\n /**\n * Method to be run on tab change\n */\n onChange?: (index: number) => void\n /**\n * Left aligned tabs with no uppercased labels\n */\n subLevel?: boolean\n}\n\ntype TabPropsType = {\n /**\n * Label/title of the tab\n */\n label: string | React.ReactNode | ((isSelected?: boolean) => React.ReactNode)\n /**\n * Hypertext link. If provided, the tab will be an anchor\n */\n href?: string\n}\n\ntype InternalTabPropsType = {\n isSelected?: boolean // Provided by Reach TabList component\n href?: string\n children: TabPropsType[\"label\"]\n}\n\n// Only for the API, render nothing, we use InternalTab component internally\nexport const Tab: FC<TabPropsType> = () => null\nTab.displayName = \"Tab\"\n\nconst isTabComponent = (\n component: React.ReactNode\n): component is React.ReactElement<React.PropsWithChildren<TabPropsType>> =>\n React.isValidElement(component) && component.type === Tab\n\nconst InternalTab = (props: InternalTabPropsType) => {\n const { href, children, isSelected } = props\n return (\n <ReachTab\n {...props}\n {...(href ? { href, as: \"a\" } : { as: \"button\" })}\n className={cx(\"cobalt-tabs__label\", {\n \"cobalt-tabs__label--selected\": isSelected,\n })}\n >\n {typeof children === \"function\" ? children(isSelected) : children}\n </ReachTab>\n )\n}\nInternalTab.displayName = \"InternalTab\"\n\nexport const Tabs: FC<TabsPropsType> & { Tab: FC<TabPropsType> } = ({\n children,\n defaultTabIndex,\n onChange,\n subLevel,\n}) => {\n const [scrollDistance, setScrollDistance] = useState(0)\n const [scrollButtonsEnabled, setScrollButtonsEnabled] = useState({\n prev: false,\n next: true,\n })\n\n const labelListRef = useRef<HTMLDivElement>(null)\n\n const [, scrollLeftSpringRef] = useSpring(() => ({\n config: { tension: 300, friction: 30, clamp: true },\n springScrollLeft: 0,\n onChange: {\n springScrollLeft: (springScrollLeft) => {\n if (labelListRef?.current) {\n labelListRef.current.scrollLeft =\n springScrollLeft as unknown as number\n }\n },\n },\n }))\n\n const updateScrollDistance = () => {\n const scrollWidth = labelListRef?.current?.scrollWidth || 0\n const clientWidth = labelListRef?.current?.clientWidth || 0\n setScrollDistance(scrollWidth && clientWidth && scrollWidth - clientWidth)\n }\n\n const updateScrollButtonsState = () => {\n if (labelListRef?.current) {\n const newScrollButtonStates = { prev: true, next: true }\n if (labelListRef.current.scrollLeft <= 0) {\n newScrollButtonStates.prev = false\n }\n if (scrollDistance && labelListRef.current.scrollLeft >= scrollDistance) {\n newScrollButtonStates.next = false\n }\n setScrollButtonsEnabled(newScrollButtonStates)\n }\n }\n\n const updateStates = () => {\n updateScrollDistance()\n updateScrollButtonsState()\n }\n\n useLayoutEffect(() => {\n const throttledUpdate = throttle(updateStates, 300)\n window.addEventListener(\"resize\", throttledUpdate)\n return () => window.removeEventListener(\"resize\", throttledUpdate)\n }, [scrollDistance])\n\n // When the bar became scrollable/not scrollable, the scrollWidth will change\n // so we update states according to its change\n useLayoutEffect(() => {\n updateStates()\n }, [labelListRef?.current?.scrollWidth])\n\n const tabsPropsArray: TabPropsType[] = []\n const tabsChildren: typeof children[] = []\n let matchedHrefIndex: number | undefined = undefined\n React.Children.forEach(children, (child, index) => {\n if (isTabComponent(child)) {\n const { children: tabChildren, ...tabProps } = child.props\n tabsPropsArray.push(tabProps)\n // if no children, it will be null, nothing will be rendered\n tabsChildren.push(tabChildren)\n if (tabProps.href === window.location.pathname) {\n matchedHrefIndex = index\n }\n }\n })\n\n const scrollTabs = (scrollAmount: number) => {\n if (labelListRef?.current) {\n const newScrollButtonStates = { prev: true, next: true }\n const computedScrollLeft = labelListRef.current.scrollLeft + scrollAmount\n let newScrollLeft = computedScrollLeft\n\n // not scrolled at all\n if (computedScrollLeft <= 0) {\n newScrollButtonStates.prev = false\n newScrollLeft = 0\n }\n // scrolled at maximum\n if (scrollDistance && computedScrollLeft >= scrollDistance) {\n newScrollButtonStates.next = false\n newScrollLeft = scrollDistance\n }\n\n setScrollButtonsEnabled(newScrollButtonStates)\n scrollLeftSpringRef.start({\n springScrollLeft: newScrollLeft,\n immediate: false,\n })\n }\n }\n const onScrollPrev = useCallback(\n () => scrollTabs(-SCROLL_STEP),\n [scrollButtonsEnabled, labelListRef?.current?.scrollLeft]\n )\n const onScrollNext = useCallback(\n () => scrollTabs(SCROLL_STEP),\n [scrollButtonsEnabled, labelListRef?.current?.scrollLeft]\n )\n\n const isScrollable = !!scrollDistance\n\n const handleWheel = throttle(() => {\n if (labelListRef?.current) {\n updateScrollButtonsState()\n // Don't animate\n scrollLeftSpringRef.set({\n springScrollLeft: labelListRef.current.scrollLeft,\n })\n }\n }, 300)\n\n return (\n <ReachTabs\n className=\"cobalt-tabs\"\n defaultIndex={matchedHrefIndex || defaultTabIndex}\n onChange={onChange}\n >\n <ReachTabList\n className={cx(\"cobalt-tabs__labels\", {\n \"cobalt-tabs__labels--scrollable\": isScrollable,\n \"cobalt-tabs__labels--subLevel\": subLevel,\n })}\n onWheel={handleWheel}\n ref={labelListRef}\n >\n {tabsPropsArray.map((props, index) => (\n <InternalTab key={index} href={props.href}>\n {props.label}\n </InternalTab>\n ))}\n </ReachTabList>\n {isScrollable && (\n <>\n <button\n className=\"cobalt-tabs__nav-prev\"\n onClick={onScrollPrev}\n disabled={!scrollButtonsEnabled.prev}\n >\n <span className=\"cobalt-tabs__nav-icon\">\n <ChevronLeftIcon color=\"accent\" />\n </span>\n </button>\n <button\n className=\"cobalt-tabs__nav-next\"\n onClick={onScrollNext}\n disabled={!scrollButtonsEnabled.next}\n >\n <span className=\"cobalt-tabs__nav-icon\">\n <ChevronRightIcon color=\"accent\" />\n </span>\n </button>\n </>\n )}\n {!!tabsChildren.length && (\n <ReachTabPanels>\n {tabsChildren.map((tabChildren, index) => (\n <ReachTabPanel className=\"cobalt-tabs__panel\" key={index}>\n {tabChildren}\n </ReachTabPanel>\n ))}\n </ReachTabPanels>\n )}\n </ReachTabs>\n )\n}\nTabs.Tab = Tab\nTabs.displayName = \"Tabs\"\n\nexport default Tabs\n"],"names":["ReachTab","ReachTabs","ReachTabList","ReachTabPanels","ReachTabPanel"],"mappings":";;;;;;;;;AAoBA,MAAM,WAAW,GAAG,GAAG,CAAA;AAkCvB;MACa,GAAG,GAAqB,MAAM,KAAI;AAC/C,GAAG,CAAC,WAAW,GAAG,KAAK,CAAA;AAEvB,MAAM,cAAc,GAAG,CACrB,SAA0B,KAE1B,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,IAAI,KAAK,GAAG,CAAA;AAE3D,MAAM,WAAW,GAAG,CAAC,KAA2B,KAAI;IAClD,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,KAAK,CAAA;AAC5C,IAAA,QACE,KAAA,CAAA,aAAA,CAACA,KAAQ,EAAA,EAAA,GACH,KAAK,EACL,IAAC,IAAI,GAAG,EAAE,IAAI,EAAE,EAAE,EAA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S,EAAC,uBAAuB,EACjC,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,CAAC,oBAAoB,CAAC,IAAI,EAAA;gBAEpC,KAAM,CAAA,aAAA,CAAA,MAAA,EAAA,EAAA,SAAS,EAAC,uBAAuB,EAAA;AACrC,oBAAA,KAAA,CAAA,aAAA,CAAC,eAAe,EAAC,EAAA,KAAK,EAAC,QAAQ,EAAA,CAAG,CAC7B,CACA;AACT,YAAA,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EACE,SAAS,EAAC,uBAAuB,EACjC,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,CAAC,oBAAoB,CAAC,IAAI,EAAA;gBAEpC,KAAM,CAAA,aAAA,CAAA,MAAA,EAAA,EAAA,SAAS,EAAC,uBAAuB,EAAA;oBACrC,KAAC,CAAA,aAAA,CAAA,gBAAgB,IAAC,KAAK,EAAC,QAAQ,EAAG,CAAA,CAC9B,CACA,CACR,CACJ;AACA,QAAA,CAAC,CAAC,YAAY,CAAC,MAAM,KACpB,oBAACC,SAAc,EAAA,IAAA,EACZ,YAAY,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,KAAK,MACnC,KAAA,CAAA,aAAA,CAACC,QAAa,EAAC,EAAA,SAAS,EAAC,oBAAoB,EAAC,GAAG,EAAE,KAAK,EACrD,EAAA,WAAW,CACE,CACjB,CAAC,CACa,CAClB,CACS,EACb;AACH,EAAC;AACD,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;AACd,IAAI,CAAC,WAAW,GAAG,MAAM;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Tabs/index.tsx"],"sourcesContent":["import React, { useRef, useLayoutEffect, useState, useCallback } from \"react\"\nimport {\n Tabs as ReachTabs,\n TabList as ReachTabList,\n Tab as ReachTab,\n TabPanels as ReachTabPanels,\n TabPanel as ReachTabPanel,\n} from \"@reach/tabs\"\nimport cx from \"classnames\"\nimport { useSpring } from \"@react-spring/web\"\n\nimport { throttle } from \"../utils\"\nimport { ChevronLeftIcon, ChevronRightIcon } from \"../Icon\"\n\nconst SCROLL_STEP = 150\n\nexport type TabsPropsType = {\n children?: React.ReactNode\n /**\n * Index of the initial actived tab (first tab by default)\n */\n defaultTabIndex?: number\n /**\n * Method to be run on tab change\n */\n onChange?: (index: number) => void\n /**\n * Left aligned tabs with no uppercased labels\n */\n subLevel?: boolean\n}\n\ntype TabPropsType = {\n children?: React.ReactNode\n /**\n * Label/title of the tab\n */\n label: string | React.ReactNode | ((isSelected?: boolean) => React.ReactNode)\n /**\n * Hypertext link. If provided, the tab will be an anchor\n */\n href?: string\n}\n\ntype InternalTabPropsType = {\n isSelected?: boolean // Provided by Reach TabList component\n href?: string\n children: TabPropsType[\"label\"]\n}\n\n// Only for the API, render nothing, we use InternalTab component internally\nexport const Tab = (_props: TabPropsType) => null\nTab.displayName = \"Tab\"\n\nconst isTabComponent = (\n component: React.ReactNode\n): component is React.ReactElement<TabPropsType> =>\n React.isValidElement(component) && component.type === Tab\n\nconst InternalTab = (props: InternalTabPropsType) => {\n const { href, children, isSelected } = props\n return (\n <ReachTab\n {...props}\n {...(href ? { href, as: \"a\" } : { as: \"button\" })}\n className={cx(\"cobalt-tabs__label\", {\n \"cobalt-tabs__label--selected\": isSelected,\n })}\n >\n {typeof children === \"function\" ? children(isSelected) : children}\n </ReachTab>\n )\n}\nInternalTab.displayName = \"InternalTab\"\n\nexport const Tabs = ({\n children,\n defaultTabIndex,\n onChange,\n subLevel,\n}: TabsPropsType) => {\n const [scrollDistance, setScrollDistance] = useState(0)\n const [scrollButtonsEnabled, setScrollButtonsEnabled] = useState({\n prev: false,\n next: true,\n })\n\n const labelListRef = useRef<HTMLDivElement>(null)\n\n const [, scrollLeftSpringRef] = useSpring(() => ({\n config: { tension: 300, friction: 30, clamp: true },\n springScrollLeft: 0,\n onChange: {\n springScrollLeft: (springScrollLeft) => {\n if (labelListRef?.current) {\n labelListRef.current.scrollLeft =\n springScrollLeft as unknown as number\n }\n },\n },\n }))\n\n const updateScrollDistance = () => {\n const scrollWidth = labelListRef?.current?.scrollWidth || 0\n const clientWidth = labelListRef?.current?.clientWidth || 0\n setScrollDistance(scrollWidth && clientWidth && scrollWidth - clientWidth)\n }\n\n const updateScrollButtonsState = () => {\n if (labelListRef?.current) {\n const newScrollButtonStates = { prev: true, next: true }\n if (labelListRef.current.scrollLeft <= 0) {\n newScrollButtonStates.prev = false\n }\n if (scrollDistance && labelListRef.current.scrollLeft >= scrollDistance) {\n newScrollButtonStates.next = false\n }\n setScrollButtonsEnabled(newScrollButtonStates)\n }\n }\n\n const updateStates = () => {\n updateScrollDistance()\n updateScrollButtonsState()\n }\n\n useLayoutEffect(() => {\n const throttledUpdate = throttle(updateStates, 300)\n window.addEventListener(\"resize\", throttledUpdate)\n return () => window.removeEventListener(\"resize\", throttledUpdate)\n }, [scrollDistance])\n\n // When the bar became scrollable/not scrollable, the scrollWidth will change\n // so we update states according to its change\n useLayoutEffect(() => {\n updateStates()\n }, [labelListRef?.current?.scrollWidth])\n\n const tabsPropsArray: TabPropsType[] = []\n const tabsChildren: typeof children[] = []\n let matchedHrefIndex: number | undefined = undefined\n React.Children.forEach(children, (child, index) => {\n if (isTabComponent(child)) {\n const { children: tabChildren, ...tabProps } = child.props\n tabsPropsArray.push(tabProps)\n // if no children, it will be null, nothing will be rendered\n tabsChildren.push(tabChildren)\n if (tabProps.href === window.location.pathname) {\n matchedHrefIndex = index\n }\n }\n })\n\n const scrollTabs = (scrollAmount: number) => {\n if (labelListRef?.current) {\n const newScrollButtonStates = { prev: true, next: true }\n const computedScrollLeft = labelListRef.current.scrollLeft + scrollAmount\n let newScrollLeft = computedScrollLeft\n\n // not scrolled at all\n if (computedScrollLeft <= 0) {\n newScrollButtonStates.prev = false\n newScrollLeft = 0\n }\n // scrolled at maximum\n if (scrollDistance && computedScrollLeft >= scrollDistance) {\n newScrollButtonStates.next = false\n newScrollLeft = scrollDistance\n }\n\n setScrollButtonsEnabled(newScrollButtonStates)\n scrollLeftSpringRef.start({\n springScrollLeft: newScrollLeft,\n immediate: false,\n })\n }\n }\n const onScrollPrev = useCallback(\n () => scrollTabs(-SCROLL_STEP),\n [scrollButtonsEnabled, labelListRef?.current?.scrollLeft]\n )\n const onScrollNext = useCallback(\n () => scrollTabs(SCROLL_STEP),\n [scrollButtonsEnabled, labelListRef?.current?.scrollLeft]\n )\n\n const isScrollable = !!scrollDistance\n\n const handleWheel = throttle(() => {\n if (labelListRef?.current) {\n updateScrollButtonsState()\n // Don't animate\n scrollLeftSpringRef.set({\n springScrollLeft: labelListRef.current.scrollLeft,\n })\n }\n }, 300)\n\n return (\n <ReachTabs\n className=\"cobalt-tabs\"\n defaultIndex={matchedHrefIndex || defaultTabIndex}\n onChange={onChange}\n >\n <ReachTabList\n className={cx(\"cobalt-tabs__labels\", {\n \"cobalt-tabs__labels--scrollable\": isScrollable,\n \"cobalt-tabs__labels--subLevel\": subLevel,\n })}\n onWheel={handleWheel}\n ref={labelListRef}\n >\n {tabsPropsArray.map((props, index) => (\n <InternalTab key={index} href={props.href}>\n {props.label}\n </InternalTab>\n ))}\n </ReachTabList>\n {isScrollable && (\n <>\n <button\n className=\"cobalt-tabs__nav-prev\"\n onClick={onScrollPrev}\n disabled={!scrollButtonsEnabled.prev}\n >\n <span className=\"cobalt-tabs__nav-icon\">\n <ChevronLeftIcon color=\"accent\" />\n </span>\n </button>\n <button\n className=\"cobalt-tabs__nav-next\"\n onClick={onScrollNext}\n disabled={!scrollButtonsEnabled.next}\n >\n <span className=\"cobalt-tabs__nav-icon\">\n <ChevronRightIcon color=\"accent\" />\n </span>\n </button>\n </>\n )}\n {!!tabsChildren.length && (\n <ReachTabPanels>\n {tabsChildren.map((tabChildren, index) => (\n <ReachTabPanel className=\"cobalt-tabs__panel\" key={index}>\n {tabChildren}\n </ReachTabPanel>\n ))}\n </ReachTabPanels>\n )}\n </ReachTabs>\n )\n}\nTabs.Tab = Tab\nTabs.displayName = \"Tabs\"\n\nexport default Tabs\n"],"names":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