@selfcommunity/react-ui 0.11.0-mui7.29 → 0.11.0-react-17.0.1.2

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 (472) hide show
  1. package/lib/cjs/components/AcceptRequestUserEventButton/AcceptRequestUserEventButton.js +2 -1
  2. package/lib/cjs/components/AcceptRequestUserGroupButton/AcceptRequestUserGroupButton.js +2 -1
  3. package/lib/cjs/components/AccountDataPortability/AccountDataPortability.js +11 -6
  4. package/lib/cjs/components/AccountDelete/AccountDelete.js +12 -5
  5. package/lib/cjs/components/AccountRecover/AccountRecover.js +4 -2
  6. package/lib/cjs/components/BroadcastMessages/Message.js +1 -1
  7. package/lib/cjs/components/BuyButton/BuyButton.js +5 -8
  8. package/lib/cjs/components/Categories/Categories.js +1 -1
  9. package/lib/cjs/components/Categories/Skeleton.js +1 -1
  10. package/lib/cjs/components/Categories/prefetchedCategories.js +115 -115
  11. package/lib/cjs/components/CategoryAutocomplete/CategoryAutocomplete.js +1 -3
  12. package/lib/cjs/components/CategoryFollowButton/CategoryFollowButton.js +4 -3
  13. package/lib/cjs/components/ChangeCover/ChangeCover.js +6 -2
  14. package/lib/cjs/components/ChangeGroupCover/ChangeGroupCover.js +2 -1
  15. package/lib/cjs/components/ChangeGroupPicture/ChangeGroupPicture.js +2 -1
  16. package/lib/cjs/components/ChangePicture/ChangePictureDialog/ChangePictureDialog.js +8 -4
  17. package/lib/cjs/components/Checkout/Skeleton.js +3 -1
  18. package/lib/cjs/components/CheckoutReturnDialog/CheckoutReturnDialog.js +10 -10
  19. package/lib/cjs/components/CommentObjectReply/CommentObjectReply.js +3 -2
  20. package/lib/cjs/components/CommentsFeedObject/CommentsFeedObject.js +2 -2
  21. package/lib/cjs/components/CommunityPaywalls/CommunityPaywalls.js +4 -3
  22. package/lib/cjs/components/CommunityPaywalls/Skeleton.d.ts +3 -3
  23. package/lib/cjs/components/CommunityPaywalls/Skeleton.js +3 -2
  24. package/lib/cjs/components/Composer/Composer.js +4 -3
  25. package/lib/cjs/components/Composer/Content/ContentDiscussion/ContentDiscussion.js +3 -5
  26. package/lib/cjs/components/Composer/Content/ContentLesson/ContentLesson.js +2 -2
  27. package/lib/cjs/components/Composer/Content/ContentPoll/ContentPoll.js +9 -13
  28. package/lib/cjs/components/Composer/Content/ContentPost/ContentPost.js +2 -2
  29. package/lib/cjs/components/Composer/Layer/AudienceLayer/AudienceLayer.js +2 -4
  30. package/lib/cjs/components/Composer/Layer/ScheduledLayer/ScheduledLayer.js +6 -6
  31. package/lib/cjs/components/ConsentSolution/ConsentSolution.js +5 -12
  32. package/lib/cjs/components/ConsentSolution/Skeleton.js +1 -1
  33. package/lib/cjs/components/CourseCompletedDialog/CourseCompletedDialog.js +1 -1
  34. package/lib/cjs/components/CourseDashboard/Student/ActionButton.d.ts +2 -1
  35. package/lib/cjs/components/CourseDashboard/Student/ActionButton.js +2 -1
  36. package/lib/cjs/components/CourseDashboard/Teacher/Comments.js +2 -1
  37. package/lib/cjs/components/CourseForm/CourseForm.js +6 -9
  38. package/lib/cjs/components/CourseForm/Edit.js +2 -6
  39. package/lib/cjs/components/CourseForm/UploadCourseCover.js +2 -1
  40. package/lib/cjs/components/CourseJoinButton/CourseJoinButton.js +4 -3
  41. package/lib/cjs/components/Courses/Courses.d.ts +4 -0
  42. package/lib/cjs/components/Courses/Courses.js +10 -9
  43. package/lib/cjs/components/Courses/Skeleton.js +1 -1
  44. package/lib/cjs/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +1 -7
  45. package/lib/cjs/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +8 -5
  46. package/lib/cjs/components/CreatePaymentProductForm/CreatePaymentProductForm.js +5 -6
  47. package/lib/cjs/components/CustomAdv/Skeleton.js +1 -1
  48. package/lib/cjs/components/EditCourse/Lessons/ChangeLessonStatus.js +3 -2
  49. package/lib/cjs/components/EditCourse/Lessons/FieldName.js +2 -1
  50. package/lib/cjs/components/EditCourse/Options.js +2 -1
  51. package/lib/cjs/components/EditCourse/Status.js +1 -1
  52. package/lib/cjs/components/Editor/Editor.js +3 -3
  53. package/lib/cjs/components/Editor/plugins/EmojiPlugin.js +2 -4
  54. package/lib/cjs/components/Editor/plugins/FloatingLinkPlugin.js +4 -6
  55. package/lib/cjs/components/EventAutocomplete/EventAutocomplete.js +3 -5
  56. package/lib/cjs/components/EventForm/EventAddress.js +5 -9
  57. package/lib/cjs/components/EventForm/EventForm.js +51 -89
  58. package/lib/cjs/components/EventForm/UploadEventCover.js +2 -1
  59. package/lib/cjs/components/EventInfoWidget/index.d.ts +1 -1
  60. package/lib/cjs/components/EventInviteButton/EventInviteButton.js +2 -3
  61. package/lib/cjs/components/EventLocationWidget/EventLocationWidget.js +16 -5
  62. package/lib/cjs/components/EventLocationWidget/Skeleton.js +1 -1
  63. package/lib/cjs/components/EventMediaWidget/EventMediaWidget.js +2 -1
  64. package/lib/cjs/components/EventMediaWidget/TriggerButton.d.ts +2 -2
  65. package/lib/cjs/components/EventMediaWidget/TriggerButton.js +2 -1
  66. package/lib/cjs/components/EventMediaWidget/index.d.ts +1 -2
  67. package/lib/cjs/components/EventMembersWidget/index.d.ts +1 -1
  68. package/lib/cjs/components/EventSubscribeButton/EventSubscribeButton.js +4 -11
  69. package/lib/cjs/components/Events/Events.d.ts +4 -0
  70. package/lib/cjs/components/Events/Events.js +9 -14
  71. package/lib/cjs/components/Events/LocationEventsFilter.js +1 -5
  72. package/lib/cjs/components/Events/OngoingEventsFilter.js +2 -6
  73. package/lib/cjs/components/Events/PastEventsFilter.js +2 -6
  74. package/lib/cjs/components/Events/Skeleton.js +1 -1
  75. package/lib/cjs/components/Feed/Feed.js +10 -9
  76. package/lib/cjs/components/Feed/Skeleton.js +1 -1
  77. package/lib/cjs/components/FeedObject/Actions/Actions.js +3 -2
  78. package/lib/cjs/components/FeedObject/Actions/Comment/Comment.js +2 -2
  79. package/lib/cjs/components/FeedObject/Actions/Follow/Follow.js +3 -2
  80. package/lib/cjs/components/FeedObject/Actions/Share/Share.js +2 -1
  81. package/lib/cjs/components/FeedObject/Activities/ActivitiesMenu/ActivitiesMenu.js +18 -20
  82. package/lib/cjs/components/FeedObject/Activities/RelevantActivities/CommentActivity/CommentActivity.js +1 -1
  83. package/lib/cjs/components/FeedObject/Activities/RelevantActivities/RelevantActivities.js +1 -1
  84. package/lib/cjs/components/FeedObject/Contributors/Contributors.js +1 -1
  85. package/lib/cjs/components/FeedObject/Contributors/Skeleton.js +1 -1
  86. package/lib/cjs/components/FeedObject/Poll/Choice/Choice.js +2 -1
  87. package/lib/cjs/components/FeedObjectMediaPreview/FeedObjectMediaPreview.js +1 -1
  88. package/lib/cjs/components/FollowUserButton/FollowUserButton.js +2 -1
  89. package/lib/cjs/components/FriendshipUserButton/FriendshipUserButton.js +3 -2
  90. package/lib/cjs/components/GroupActionsMenu/index.js +1 -9
  91. package/lib/cjs/components/GroupAutocomplete/GroupAutocomplete.js +3 -5
  92. package/lib/cjs/components/GroupForm/GroupForm.js +27 -16
  93. package/lib/cjs/components/GroupInfoWidget/GroupInfoWidget.js +15 -5
  94. package/lib/cjs/components/GroupInviteButton/GroupInviteButton.js +7 -8
  95. package/lib/cjs/components/GroupSettingsIconButton/GroupSettingsIconButton.js +4 -10
  96. package/lib/cjs/components/GroupSubscribeButton/GroupSubscribeButton.js +4 -3
  97. package/lib/cjs/components/Groups/Groups.js +9 -9
  98. package/lib/cjs/components/Groups/Skeleton.js +2 -1
  99. package/lib/cjs/components/Incubator/Incubator.js +4 -4
  100. package/lib/cjs/components/Incubator/Skeleton.js +1 -1
  101. package/lib/cjs/components/IncubatorDetail/IncubatorDetail.js +2 -2
  102. package/lib/cjs/components/IncubatorListWidget/CreateIncubatorDialog/CreateIncubatorDialog.js +4 -3
  103. package/lib/cjs/components/IncubatorListWidget/IncubatorListWidget.js +5 -5
  104. package/lib/cjs/components/IncubatorSubscribeButton/IncubatorSubscribeButton.js +4 -3
  105. package/lib/cjs/components/IncubatorSuggestionWidget/IncubatorSuggestionWidget.js +1 -1
  106. package/lib/cjs/components/InviteUserEventButton/InviteUserEventButton.js +2 -1
  107. package/lib/cjs/components/LessonAppbar/LessonAppbar.js +4 -3
  108. package/lib/cjs/components/LessonCommentObjects/LessonCommentObjects.js +1 -1
  109. package/lib/cjs/components/LessonEditForm/LessonEditForm.js +2 -1
  110. package/lib/cjs/components/LessonReleaseMenu/LessonReleaseMenu.js +16 -24
  111. package/lib/cjs/components/LiveStreamForm/LiveStreamForm.js +12 -15
  112. package/lib/cjs/components/LiveStreamRoom/LiveStreamRoom.js +8 -10
  113. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/DisconnectButton.js +1 -5
  114. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.js +3 -7
  115. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.js +3 -3
  116. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.js +3 -1
  117. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileActions.js +1 -1
  118. package/lib/cjs/components/LocationAutocomplete/LocationAutocomplete.js +16 -17
  119. package/lib/cjs/components/LoyaltyProgramWidget/LoyaltyProgramWidget.js +1 -1
  120. package/lib/cjs/components/LoyaltyProgramWidget/Skeleton.js +1 -1
  121. package/lib/cjs/components/MyEventsWidget/index.d.ts +1 -1
  122. package/lib/cjs/components/NavigationSettingsIconButton/NavigationSettingsIconButton.js +1 -9
  123. package/lib/cjs/components/NavigationToolbar/NotificationMenu.js +5 -2
  124. package/lib/cjs/components/Notification/CollapsedFor/CollapsedFor.js +1 -3
  125. package/lib/cjs/components/Notification/Comment/Comment.js +3 -3
  126. package/lib/cjs/components/Notification/Contribution/Contribution.js +1 -1
  127. package/lib/cjs/components/Notification/ContributionFollow/ContributionFollow.js +2 -2
  128. package/lib/cjs/components/Notification/Course/Course.js +10 -5
  129. package/lib/cjs/components/Notification/DeletedFor/DeletedFor.js +2 -4
  130. package/lib/cjs/components/Notification/Event/Event.js +12 -7
  131. package/lib/cjs/components/Notification/Group/Group.js +4 -3
  132. package/lib/cjs/components/Notification/IncubatorApproved/IncubatorApproved.js +3 -3
  133. package/lib/cjs/components/Notification/KindlyNoticeFlag/KindlyNoticeFlag.js +1 -3
  134. package/lib/cjs/components/Notification/KindlyNoticeFor/KindlyNoticeFor.js +3 -5
  135. package/lib/cjs/components/Notification/LiveStream/LiveStream.js +9 -4
  136. package/lib/cjs/components/Notification/Mention/Mention.js +2 -2
  137. package/lib/cjs/components/Notification/Notification.js +9 -17
  138. package/lib/cjs/components/Notification/PrivateMessage/PrivateMessage.js +5 -4
  139. package/lib/cjs/components/Notification/UndeletedFor/UndeletedFor.js +1 -1
  140. package/lib/cjs/components/Notification/UserBlocked/UserBlocked.js +2 -6
  141. package/lib/cjs/components/Notification/UserConnection/UserConnection.js +2 -6
  142. package/lib/cjs/components/Notification/UserFollow/UserFollow.js +2 -2
  143. package/lib/cjs/components/Notification/VoteUp/VoteUp.js +2 -2
  144. package/lib/cjs/components/OnBoardingWidget/ActionsButton.js +4 -12
  145. package/lib/cjs/components/OnBoardingWidget/OnBoardingWidget.js +27 -19
  146. package/lib/cjs/components/OnBoardingWidget/Skeleton.js +1 -1
  147. package/lib/cjs/components/OnBoardingWidget/Steps/App/App.js +25 -9
  148. package/lib/cjs/components/OnBoardingWidget/Steps/Appearance/Appearance.js +14 -17
  149. package/lib/cjs/components/OnBoardingWidget/Steps/Category/Category.js +9 -3
  150. package/lib/cjs/components/PaymentDetailDialog/PaymentDetailDialog.js +5 -7
  151. package/lib/cjs/components/PaymentOrder/PaymentOrder.js +1 -1
  152. package/lib/cjs/components/PaymentOrders/PaymentOrders.js +26 -39
  153. package/lib/cjs/components/PaymentProduct/Skeleton.js +1 -1
  154. package/lib/cjs/components/PaymentProducts/Skeleton.js +1 -1
  155. package/lib/cjs/components/Paywalls/Skeleton.js +1 -1
  156. package/lib/cjs/components/PaywallsConfigurator/PaywallsConfigurator.js +5 -5
  157. package/lib/cjs/components/PaywallsConfigurator/Skeleton.js +1 -1
  158. package/lib/cjs/components/PaywallsDialog/PaywallsDialog.js +6 -8
  159. package/lib/cjs/components/PdfPreviewDialog/PdfPreviewDialog.js +1 -3
  160. package/lib/cjs/components/PlatformWidget/PlatformWidget.js +6 -6
  161. package/lib/cjs/components/PlatformWidget/Skeleton.js +1 -1
  162. package/lib/cjs/components/PrivateMessageComponent/PrivateMessageComponent.js +3 -3
  163. package/lib/cjs/components/PrivateMessageComponent/Skeleton.js +1 -1
  164. package/lib/cjs/components/PrivateMessageEditor/MessageMediaUploader/index.js +2 -2
  165. package/lib/cjs/components/PrivateMessageEditor/PrivateMessageEditor.js +4 -6
  166. package/lib/cjs/components/PrivateMessageSettingsIconButton/PrivateMessageSettingsIconButton.js +1 -9
  167. package/lib/cjs/components/PrivateMessageSnippets/PrivateMessageSnippets.js +8 -10
  168. package/lib/cjs/components/PrivateMessageSnippets/Skeleton.js +1 -1
  169. package/lib/cjs/components/PrivateMessageThread/PrivateMessageThread.d.ts +1 -1
  170. package/lib/cjs/components/PrivateMessageThread/PrivateMessageThread.js +7 -7
  171. package/lib/cjs/components/PrivateMessageThread/Skeleton.js +1 -1
  172. package/lib/cjs/components/RelatedEventsWidget/index.d.ts +1 -1
  173. package/lib/cjs/components/SearchAutocomplete/SearchAutocomplete.js +7 -9
  174. package/lib/cjs/components/SnippetNotifications/SnippetNotifications.js +5 -5
  175. package/lib/cjs/components/SuggestedEventsWidget/index.d.ts +1 -1
  176. package/lib/cjs/components/TagAutocomplete/TagAutocomplete.js +1 -3
  177. package/lib/cjs/components/UserActionIconButton/UserActionIconButton.js +8 -9
  178. package/lib/cjs/components/UserAddPaymentMethodForm/UserAddPaymentMethodForm.js +6 -4
  179. package/lib/cjs/components/UserAutocomplete/UserAutocomplete.js +4 -4
  180. package/lib/cjs/components/UserBillingInfo/Skeleton.js +1 -1
  181. package/lib/cjs/components/UserBillingInfo/UserBillingInfo.js +22 -30
  182. package/lib/cjs/components/UserChangeAddressDialog/UserChangeAddressDialog.js +2 -1
  183. package/lib/cjs/components/UserCounters/UserCounters.js +13 -5
  184. package/lib/cjs/components/UserInfo/UserInfo.js +1 -1
  185. package/lib/cjs/components/UserLiveStreamWidget/index.d.ts +1 -1
  186. package/lib/cjs/components/UserPaymentMethods/Skeleton.d.ts +3 -24
  187. package/lib/cjs/components/UserPaymentMethods/Skeleton.js +4 -2
  188. package/lib/cjs/components/UserPaymentMethods/UserPaymentMethods.d.ts +3 -25
  189. package/lib/cjs/components/UserPaymentMethods/UserPaymentMethods.js +9 -8
  190. package/lib/cjs/components/UserProfileBlocked/UserProfileBlocked.js +2 -1
  191. package/lib/cjs/components/UserProfileEdit/Section/AccountCredentials.js +7 -10
  192. package/lib/cjs/components/UserProfileEdit/Section/PublicInfo.js +20 -9
  193. package/lib/cjs/components/UserProfileEdit/Skeleton.js +1 -1
  194. package/lib/cjs/components/VoteAudienceButton/VoteAudienceButton.d.ts +2 -2
  195. package/lib/cjs/components/VoteAudienceButton/VoteAudienceButton.js +5 -4
  196. package/lib/cjs/components/VoteButton/VoteButton.d.ts +2 -2
  197. package/lib/cjs/components/VoteButton/VoteButton.js +3 -2
  198. package/lib/cjs/shared/AddUsersButton/AddUsersButton.js +2 -3
  199. package/lib/cjs/shared/ConfirmDialog/ConfirmDialog.js +2 -1
  200. package/lib/cjs/shared/ContributionActionsMenu/index.js +9 -3
  201. package/lib/cjs/shared/CopyTextArea/index.js +6 -13
  202. package/lib/cjs/shared/CourseUsersTable/ChangeUsersStatus.js +2 -1
  203. package/lib/cjs/shared/CourseUsersTable/CourseUsersTable.js +5 -6
  204. package/lib/cjs/shared/CourseUsersTable/RemoveButton.js +2 -1
  205. package/lib/cjs/shared/CourseUsersTable/RequestButton.js +2 -1
  206. package/lib/cjs/shared/CustomSnackMessage/index.js +2 -2
  207. package/lib/cjs/shared/DateTimeAgo/index.js +2 -2
  208. package/lib/cjs/shared/EmojiPicker/EmojiPicker.d.ts +2 -1
  209. package/lib/cjs/shared/EventActionsMenu/index.js +1 -9
  210. package/lib/cjs/shared/HiddenPurchasableContent/HiddenPurchasableContent.js +4 -3
  211. package/lib/cjs/shared/InfiniteScroll/stories/ScrolleableTop.js +1 -1
  212. package/lib/cjs/shared/LessonCommentActionsMenu/index.js +8 -2
  213. package/lib/cjs/shared/Lightbox/BaseLightbox.js +1 -1
  214. package/lib/cjs/shared/Media/File/DisplayComponent.js +6 -4
  215. package/lib/cjs/shared/Media/File/DocComponent.d.ts +0 -2
  216. package/lib/cjs/shared/Media/File/DocComponent.js +2 -3
  217. package/lib/cjs/shared/Media/File/PreviewComponent.js +3 -4
  218. package/lib/cjs/shared/Media/File/TriggerButton.js +1 -9
  219. package/lib/cjs/shared/Media/File/asUploadButton.d.ts +1 -1
  220. package/lib/cjs/shared/Media/File/asUploadButton.js +1 -1
  221. package/lib/cjs/shared/Media/Link/DisplayComponent.js +12 -4
  222. package/lib/cjs/shared/Media/Link/UrlTextField/index.js +1 -3
  223. package/lib/cjs/shared/MessageChunkUploader/index.js +1 -1
  224. package/lib/cjs/shared/PasswordTextField/index.js +5 -7
  225. package/lib/cjs/shared/ScrollContainer/index.js +2 -2
  226. package/lib/cjs/shared/TagChip/index.d.ts +48 -2
  227. package/lib/cjs/shared/TagChip/index.js +2 -2
  228. package/lib/cjs/shared/Tags/index.js +1 -1
  229. package/lib/cjs/shared/UpScalingTierBadge/UpScalingTierBadge.d.ts +5 -0
  230. package/lib/cjs/shared/UpScalingTierBadge/UpScalingTierBadge.js +14 -0
  231. package/lib/cjs/shared/VirtualizedScroller/VirtualizedScroller.d.ts +1 -1
  232. package/lib/esm/components/AcceptRequestUserEventButton/AcceptRequestUserEventButton.js +3 -2
  233. package/lib/esm/components/AcceptRequestUserGroupButton/AcceptRequestUserGroupButton.js +3 -2
  234. package/lib/esm/components/AccountDataPortability/AccountDataPortability.js +12 -7
  235. package/lib/esm/components/AccountDelete/AccountDelete.js +13 -6
  236. package/lib/esm/components/AccountRecover/AccountRecover.js +4 -2
  237. package/lib/esm/components/BroadcastMessages/Message.js +1 -1
  238. package/lib/esm/components/BuyButton/BuyButton.js +6 -9
  239. package/lib/esm/components/Categories/Categories.js +1 -1
  240. package/lib/esm/components/Categories/Skeleton.js +1 -1
  241. package/lib/esm/components/Categories/prefetchedCategories.js +115 -115
  242. package/lib/esm/components/CategoryAutocomplete/CategoryAutocomplete.js +2 -4
  243. package/lib/esm/components/CategoryFollowButton/CategoryFollowButton.js +5 -4
  244. package/lib/esm/components/ChangeCover/ChangeCover.js +6 -2
  245. package/lib/esm/components/ChangeGroupCover/ChangeGroupCover.js +3 -2
  246. package/lib/esm/components/ChangeGroupPicture/ChangeGroupPicture.js +3 -2
  247. package/lib/esm/components/ChangePicture/ChangePictureDialog/ChangePictureDialog.js +8 -4
  248. package/lib/esm/components/Checkout/Skeleton.js +4 -2
  249. package/lib/esm/components/CheckoutReturnDialog/CheckoutReturnDialog.js +11 -11
  250. package/lib/esm/components/CommentObjectReply/CommentObjectReply.js +4 -3
  251. package/lib/esm/components/CommentsFeedObject/CommentsFeedObject.js +2 -2
  252. package/lib/esm/components/CommunityPaywalls/CommunityPaywalls.js +4 -3
  253. package/lib/esm/components/CommunityPaywalls/Skeleton.d.ts +3 -3
  254. package/lib/esm/components/CommunityPaywalls/Skeleton.js +3 -2
  255. package/lib/esm/components/Composer/Composer.js +5 -4
  256. package/lib/esm/components/Composer/Content/ContentDiscussion/ContentDiscussion.js +3 -5
  257. package/lib/esm/components/Composer/Content/ContentLesson/ContentLesson.js +2 -2
  258. package/lib/esm/components/Composer/Content/ContentPoll/ContentPoll.js +9 -13
  259. package/lib/esm/components/Composer/Content/ContentPost/ContentPost.js +2 -2
  260. package/lib/esm/components/Composer/Layer/AudienceLayer/AudienceLayer.js +3 -5
  261. package/lib/esm/components/Composer/Layer/ScheduledLayer/ScheduledLayer.js +7 -7
  262. package/lib/esm/components/ConsentSolution/ConsentSolution.js +5 -12
  263. package/lib/esm/components/ConsentSolution/Skeleton.js +1 -1
  264. package/lib/esm/components/CourseCompletedDialog/CourseCompletedDialog.js +1 -1
  265. package/lib/esm/components/CourseDashboard/Student/ActionButton.d.ts +2 -1
  266. package/lib/esm/components/CourseDashboard/Student/ActionButton.js +2 -1
  267. package/lib/esm/components/CourseDashboard/Teacher/Comments.js +2 -1
  268. package/lib/esm/components/CourseForm/CourseForm.js +7 -10
  269. package/lib/esm/components/CourseForm/Edit.js +2 -6
  270. package/lib/esm/components/CourseForm/UploadCourseCover.js +3 -2
  271. package/lib/esm/components/CourseJoinButton/CourseJoinButton.js +5 -4
  272. package/lib/esm/components/Courses/Courses.d.ts +4 -0
  273. package/lib/esm/components/Courses/Courses.js +9 -9
  274. package/lib/esm/components/Courses/Skeleton.js +1 -1
  275. package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +1 -7
  276. package/lib/esm/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +9 -6
  277. package/lib/esm/components/CreatePaymentProductForm/CreatePaymentProductForm.js +5 -6
  278. package/lib/esm/components/CustomAdv/Skeleton.js +1 -1
  279. package/lib/esm/components/EditCourse/Lessons/ChangeLessonStatus.js +4 -3
  280. package/lib/esm/components/EditCourse/Lessons/FieldName.js +3 -2
  281. package/lib/esm/components/EditCourse/Options.js +3 -2
  282. package/lib/esm/components/EditCourse/Status.js +1 -1
  283. package/lib/esm/components/Editor/Editor.js +3 -3
  284. package/lib/esm/components/Editor/plugins/EmojiPlugin.js +2 -4
  285. package/lib/esm/components/Editor/plugins/FloatingLinkPlugin.js +4 -6
  286. package/lib/esm/components/EventAutocomplete/EventAutocomplete.js +4 -6
  287. package/lib/esm/components/EventForm/EventAddress.js +5 -9
  288. package/lib/esm/components/EventForm/EventForm.js +53 -91
  289. package/lib/esm/components/EventForm/UploadEventCover.js +3 -2
  290. package/lib/esm/components/EventInfoWidget/index.d.ts +1 -1
  291. package/lib/esm/components/EventInviteButton/EventInviteButton.js +2 -3
  292. package/lib/esm/components/EventLocationWidget/EventLocationWidget.js +16 -5
  293. package/lib/esm/components/EventLocationWidget/Skeleton.js +1 -1
  294. package/lib/esm/components/EventMediaWidget/EventMediaWidget.js +2 -1
  295. package/lib/esm/components/EventMediaWidget/TriggerButton.d.ts +2 -2
  296. package/lib/esm/components/EventMediaWidget/TriggerButton.js +3 -2
  297. package/lib/esm/components/EventMediaWidget/index.d.ts +1 -2
  298. package/lib/esm/components/EventMembersWidget/index.d.ts +1 -1
  299. package/lib/esm/components/EventSubscribeButton/EventSubscribeButton.js +4 -11
  300. package/lib/esm/components/Events/Events.d.ts +4 -0
  301. package/lib/esm/components/Events/Events.js +8 -14
  302. package/lib/esm/components/Events/LocationEventsFilter.js +1 -5
  303. package/lib/esm/components/Events/OngoingEventsFilter.js +2 -6
  304. package/lib/esm/components/Events/PastEventsFilter.js +2 -6
  305. package/lib/esm/components/Events/Skeleton.js +1 -1
  306. package/lib/esm/components/Feed/Feed.js +11 -10
  307. package/lib/esm/components/Feed/Skeleton.js +2 -2
  308. package/lib/esm/components/FeedObject/Actions/Actions.js +3 -2
  309. package/lib/esm/components/FeedObject/Actions/Comment/Comment.js +2 -2
  310. package/lib/esm/components/FeedObject/Actions/Follow/Follow.js +4 -3
  311. package/lib/esm/components/FeedObject/Actions/Share/Share.js +2 -1
  312. package/lib/esm/components/FeedObject/Activities/ActivitiesMenu/ActivitiesMenu.js +18 -20
  313. package/lib/esm/components/FeedObject/Activities/RelevantActivities/CommentActivity/CommentActivity.js +1 -1
  314. package/lib/esm/components/FeedObject/Activities/RelevantActivities/RelevantActivities.js +1 -1
  315. package/lib/esm/components/FeedObject/Contributors/Contributors.js +1 -1
  316. package/lib/esm/components/FeedObject/Contributors/Skeleton.js +1 -1
  317. package/lib/esm/components/FeedObject/Poll/Choice/Choice.js +3 -2
  318. package/lib/esm/components/FeedObjectMediaPreview/FeedObjectMediaPreview.js +1 -1
  319. package/lib/esm/components/FollowUserButton/FollowUserButton.js +3 -2
  320. package/lib/esm/components/FriendshipUserButton/FriendshipUserButton.js +4 -3
  321. package/lib/esm/components/GroupActionsMenu/index.js +1 -9
  322. package/lib/esm/components/GroupAutocomplete/GroupAutocomplete.js +4 -6
  323. package/lib/esm/components/GroupForm/GroupForm.js +28 -17
  324. package/lib/esm/components/GroupInfoWidget/GroupInfoWidget.js +15 -5
  325. package/lib/esm/components/GroupInviteButton/GroupInviteButton.js +7 -8
  326. package/lib/esm/components/GroupSettingsIconButton/GroupSettingsIconButton.js +4 -10
  327. package/lib/esm/components/GroupSubscribeButton/GroupSubscribeButton.js +5 -4
  328. package/lib/esm/components/Groups/Groups.js +9 -9
  329. package/lib/esm/components/Groups/Skeleton.js +2 -1
  330. package/lib/esm/components/Incubator/Incubator.js +4 -4
  331. package/lib/esm/components/Incubator/Skeleton.js +1 -1
  332. package/lib/esm/components/IncubatorDetail/IncubatorDetail.js +2 -2
  333. package/lib/esm/components/IncubatorListWidget/CreateIncubatorDialog/CreateIncubatorDialog.js +5 -4
  334. package/lib/esm/components/IncubatorListWidget/IncubatorListWidget.js +5 -5
  335. package/lib/esm/components/IncubatorSubscribeButton/IncubatorSubscribeButton.js +5 -4
  336. package/lib/esm/components/IncubatorSuggestionWidget/IncubatorSuggestionWidget.js +1 -1
  337. package/lib/esm/components/InviteUserEventButton/InviteUserEventButton.js +3 -2
  338. package/lib/esm/components/LessonAppbar/LessonAppbar.js +5 -4
  339. package/lib/esm/components/LessonCommentObjects/LessonCommentObjects.js +1 -1
  340. package/lib/esm/components/LessonEditForm/LessonEditForm.js +3 -2
  341. package/lib/esm/components/LessonReleaseMenu/LessonReleaseMenu.js +16 -24
  342. package/lib/esm/components/LiveStreamForm/LiveStreamForm.js +13 -16
  343. package/lib/esm/components/LiveStreamRoom/LiveStreamRoom.js +8 -10
  344. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/DisconnectButton.js +1 -5
  345. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.js +3 -7
  346. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.js +3 -3
  347. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.js +3 -1
  348. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileActions.js +1 -1
  349. package/lib/esm/components/LocationAutocomplete/LocationAutocomplete.js +10 -11
  350. package/lib/esm/components/LoyaltyProgramWidget/LoyaltyProgramWidget.js +1 -1
  351. package/lib/esm/components/LoyaltyProgramWidget/Skeleton.js +1 -1
  352. package/lib/esm/components/MyEventsWidget/index.d.ts +1 -1
  353. package/lib/esm/components/NavigationSettingsIconButton/NavigationSettingsIconButton.js +1 -9
  354. package/lib/esm/components/NavigationToolbar/NotificationMenu.js +5 -2
  355. package/lib/esm/components/Notification/CollapsedFor/CollapsedFor.js +1 -3
  356. package/lib/esm/components/Notification/Comment/Comment.js +3 -3
  357. package/lib/esm/components/Notification/Contribution/Contribution.js +1 -1
  358. package/lib/esm/components/Notification/ContributionFollow/ContributionFollow.js +2 -2
  359. package/lib/esm/components/Notification/Course/Course.js +11 -6
  360. package/lib/esm/components/Notification/DeletedFor/DeletedFor.js +2 -4
  361. package/lib/esm/components/Notification/Event/Event.js +13 -8
  362. package/lib/esm/components/Notification/Group/Group.js +5 -4
  363. package/lib/esm/components/Notification/IncubatorApproved/IncubatorApproved.js +3 -3
  364. package/lib/esm/components/Notification/KindlyNoticeFlag/KindlyNoticeFlag.js +1 -3
  365. package/lib/esm/components/Notification/KindlyNoticeFor/KindlyNoticeFor.js +3 -5
  366. package/lib/esm/components/Notification/LiveStream/LiveStream.js +10 -5
  367. package/lib/esm/components/Notification/Mention/Mention.js +2 -2
  368. package/lib/esm/components/Notification/Notification.js +10 -18
  369. package/lib/esm/components/Notification/PrivateMessage/PrivateMessage.js +6 -5
  370. package/lib/esm/components/Notification/UndeletedFor/UndeletedFor.js +1 -1
  371. package/lib/esm/components/Notification/UserBlocked/UserBlocked.js +2 -6
  372. package/lib/esm/components/Notification/UserConnection/UserConnection.js +2 -6
  373. package/lib/esm/components/Notification/UserFollow/UserFollow.js +2 -2
  374. package/lib/esm/components/Notification/VoteUp/VoteUp.js +2 -2
  375. package/lib/esm/components/OnBoardingWidget/ActionsButton.js +4 -12
  376. package/lib/esm/components/OnBoardingWidget/OnBoardingWidget.js +28 -20
  377. package/lib/esm/components/OnBoardingWidget/Skeleton.js +1 -1
  378. package/lib/esm/components/OnBoardingWidget/Steps/App/App.js +25 -9
  379. package/lib/esm/components/OnBoardingWidget/Steps/Appearance/Appearance.js +14 -17
  380. package/lib/esm/components/OnBoardingWidget/Steps/Category/Category.js +9 -3
  381. package/lib/esm/components/PaymentDetailDialog/PaymentDetailDialog.js +6 -8
  382. package/lib/esm/components/PaymentOrder/PaymentOrder.js +1 -1
  383. package/lib/esm/components/PaymentOrders/PaymentOrders.js +26 -39
  384. package/lib/esm/components/PaymentProduct/Skeleton.js +1 -1
  385. package/lib/esm/components/PaymentProducts/Skeleton.js +1 -1
  386. package/lib/esm/components/Paywalls/Skeleton.js +1 -1
  387. package/lib/esm/components/PaywallsConfigurator/PaywallsConfigurator.js +4 -4
  388. package/lib/esm/components/PaywallsConfigurator/Skeleton.js +1 -1
  389. package/lib/esm/components/PaywallsDialog/PaywallsDialog.js +7 -9
  390. package/lib/esm/components/PdfPreviewDialog/PdfPreviewDialog.js +1 -3
  391. package/lib/esm/components/PlatformWidget/PlatformWidget.js +6 -6
  392. package/lib/esm/components/PlatformWidget/Skeleton.js +1 -1
  393. package/lib/esm/components/PrivateMessageComponent/PrivateMessageComponent.js +3 -3
  394. package/lib/esm/components/PrivateMessageComponent/Skeleton.js +1 -1
  395. package/lib/esm/components/PrivateMessageEditor/MessageMediaUploader/index.js +2 -2
  396. package/lib/esm/components/PrivateMessageEditor/PrivateMessageEditor.js +4 -6
  397. package/lib/esm/components/PrivateMessageSettingsIconButton/PrivateMessageSettingsIconButton.js +1 -9
  398. package/lib/esm/components/PrivateMessageSnippets/PrivateMessageSnippets.js +8 -10
  399. package/lib/esm/components/PrivateMessageSnippets/Skeleton.js +1 -1
  400. package/lib/esm/components/PrivateMessageThread/PrivateMessageThread.d.ts +1 -1
  401. package/lib/esm/components/PrivateMessageThread/PrivateMessageThread.js +7 -7
  402. package/lib/esm/components/PrivateMessageThread/Skeleton.js +1 -1
  403. package/lib/esm/components/RelatedEventsWidget/index.d.ts +1 -1
  404. package/lib/esm/components/SearchAutocomplete/SearchAutocomplete.js +7 -9
  405. package/lib/esm/components/SnippetNotifications/SnippetNotifications.js +5 -5
  406. package/lib/esm/components/SuggestedEventsWidget/index.d.ts +1 -1
  407. package/lib/esm/components/TagAutocomplete/TagAutocomplete.js +3 -5
  408. package/lib/esm/components/UserActionIconButton/UserActionIconButton.js +9 -10
  409. package/lib/esm/components/UserAddPaymentMethodForm/UserAddPaymentMethodForm.js +7 -5
  410. package/lib/esm/components/UserAutocomplete/UserAutocomplete.js +6 -6
  411. package/lib/esm/components/UserBillingInfo/Skeleton.js +1 -1
  412. package/lib/esm/components/UserBillingInfo/UserBillingInfo.js +22 -30
  413. package/lib/esm/components/UserChangeAddressDialog/UserChangeAddressDialog.js +2 -1
  414. package/lib/esm/components/UserCounters/UserCounters.js +13 -5
  415. package/lib/esm/components/UserInfo/UserInfo.js +1 -1
  416. package/lib/esm/components/UserLiveStreamWidget/index.d.ts +1 -1
  417. package/lib/esm/components/UserPaymentMethods/Skeleton.d.ts +3 -24
  418. package/lib/esm/components/UserPaymentMethods/Skeleton.js +4 -2
  419. package/lib/esm/components/UserPaymentMethods/UserPaymentMethods.d.ts +3 -25
  420. package/lib/esm/components/UserPaymentMethods/UserPaymentMethods.js +12 -11
  421. package/lib/esm/components/UserProfileBlocked/UserProfileBlocked.js +3 -2
  422. package/lib/esm/components/UserProfileEdit/Section/AccountCredentials.js +7 -10
  423. package/lib/esm/components/UserProfileEdit/Section/PublicInfo.js +23 -12
  424. package/lib/esm/components/UserProfileEdit/Skeleton.js +1 -1
  425. package/lib/esm/components/VoteAudienceButton/VoteAudienceButton.d.ts +2 -2
  426. package/lib/esm/components/VoteAudienceButton/VoteAudienceButton.js +6 -5
  427. package/lib/esm/components/VoteButton/VoteButton.d.ts +2 -2
  428. package/lib/esm/components/VoteButton/VoteButton.js +4 -3
  429. package/lib/esm/shared/AddUsersButton/AddUsersButton.js +2 -3
  430. package/lib/esm/shared/ConfirmDialog/ConfirmDialog.js +2 -1
  431. package/lib/esm/shared/ContributionActionsMenu/index.js +9 -3
  432. package/lib/esm/shared/CopyTextArea/index.js +6 -13
  433. package/lib/esm/shared/CourseUsersTable/ChangeUsersStatus.js +3 -2
  434. package/lib/esm/shared/CourseUsersTable/CourseUsersTable.js +6 -7
  435. package/lib/esm/shared/CourseUsersTable/RemoveButton.js +3 -2
  436. package/lib/esm/shared/CourseUsersTable/RequestButton.js +3 -2
  437. package/lib/esm/shared/CustomSnackMessage/index.js +2 -2
  438. package/lib/esm/shared/DateTimeAgo/index.js +2 -2
  439. package/lib/esm/shared/EmojiPicker/EmojiPicker.d.ts +2 -1
  440. package/lib/esm/shared/EventActionsMenu/index.js +1 -9
  441. package/lib/esm/shared/HiddenPurchasableContent/HiddenPurchasableContent.js +4 -3
  442. package/lib/esm/shared/InfiniteScroll/stories/ScrolleableTop.js +1 -1
  443. package/lib/esm/shared/LessonCommentActionsMenu/index.js +8 -2
  444. package/lib/esm/shared/Lightbox/BaseLightbox.js +1 -1
  445. package/lib/esm/shared/Media/File/DisplayComponent.js +6 -4
  446. package/lib/esm/shared/Media/File/DocComponent.d.ts +0 -2
  447. package/lib/esm/shared/Media/File/DocComponent.js +2 -3
  448. package/lib/esm/shared/Media/File/PreviewComponent.js +3 -4
  449. package/lib/esm/shared/Media/File/TriggerButton.js +1 -9
  450. package/lib/esm/shared/Media/File/asUploadButton.d.ts +1 -1
  451. package/lib/esm/shared/Media/File/asUploadButton.js +3 -3
  452. package/lib/esm/shared/Media/Link/DisplayComponent.js +13 -5
  453. package/lib/esm/shared/Media/Link/UrlTextField/index.js +1 -3
  454. package/lib/esm/shared/MessageChunkUploader/index.js +1 -1
  455. package/lib/esm/shared/PasswordTextField/index.js +5 -7
  456. package/lib/esm/shared/ScrollContainer/index.js +1 -1
  457. package/lib/esm/shared/TagChip/index.d.ts +48 -2
  458. package/lib/esm/shared/TagChip/index.js +2 -2
  459. package/lib/esm/shared/Tags/index.js +1 -1
  460. package/lib/esm/shared/UpScalingTierBadge/UpScalingTierBadge.d.ts +5 -0
  461. package/lib/esm/shared/UpScalingTierBadge/UpScalingTierBadge.js +10 -0
  462. package/lib/esm/shared/VirtualizedScroller/VirtualizedScroller.d.ts +1 -1
  463. package/lib/umd/155.js +2 -0
  464. package/lib/umd/155.js.LICENSE.txt +24 -0
  465. package/lib/umd/react-ui.js +1 -1
  466. package/package.json +206 -207
  467. package/lib/cjs/components/EventLocationWidget/EventMap.d.ts +0 -8
  468. package/lib/cjs/components/EventLocationWidget/EventMap.js +0 -28
  469. package/lib/esm/components/EventLocationWidget/EventMap.d.ts +0 -8
  470. package/lib/esm/components/EventLocationWidget/EventMap.js +0 -25
  471. package/lib/umd/484.js +0 -2
  472. package/lib/umd/484.js.LICENSE.txt +0 -9
@@ -1,15 +1,17 @@
1
- import { __awaiter } from "tslib";
1
+ import { __awaiter, __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import React, { useState } from 'react';
4
+ import { styled } from '@mui/material/styles';
4
5
  import { useSCPaymentsEnabled, useSCUser } from '@selfcommunity/react-core';
5
6
  import { useThemeProps } from '@mui/system';
6
7
  import { PREFIX } from './constants';
7
8
  import BaseDialog from '../../shared/BaseDialog';
8
9
  import { FormattedMessage, useIntl } from 'react-intl';
9
10
  import { loadStripe } from '@stripe/stripe-js';
10
- import { Button, Paper, Stack, styled, Typography } from '@mui/material';
11
+ import { Button, Paper, Stack, Typography } from '@mui/material';
11
12
  import { AddressElement, PaymentElement, useElements } from '@stripe/react-stripe-js';
12
13
  import { getDefaultLocale } from '../../utils/payment';
14
+ import { LoadingButton } from '@mui/lab';
13
15
  import { useSnackbar } from 'notistack';
14
16
  const classes = {
15
17
  root: `${PREFIX}-root`,
@@ -53,7 +55,7 @@ export default function UserAddPaymentMethodForm(inProps) {
53
55
  props: inProps,
54
56
  name: PREFIX
55
57
  });
56
- const { className = null, customer, collectBillingAddress = false, handleSuccess, handleClose } = props;
58
+ const { className = null, customer, collectBillingAddress = false, handleSuccess, handleClose } = props, rest = __rest(props, ["className", "customer", "collectBillingAddress", "handleSuccess", "handleClose"]);
57
59
  // CONTEXT
58
60
  const scUserContext = useSCUser();
59
61
  // STATE
@@ -129,10 +131,10 @@ export default function UserAddPaymentMethodForm(inProps) {
129
131
  if (!isPaymentsEnabled || !scUserContext.user) {
130
132
  return null;
131
133
  }
132
- return (_jsx(Root, Object.assign({ className: classes.root }, { children: _jsxs("form", Object.assign({ onSubmit: handleSubmit }, { children: [_jsx(PaymentElement, { id: "payment-element", options: paymentElementOptions, onReady: () => setReady(true) }), collectBillingAddress && (_jsx(Paper, Object.assign({ variant: "outlined", className: classes.address }, { children: Object.keys(addressState).length && !isEditingBillingAddress ? (_jsxs(_Fragment, { children: [_jsx(Typography, Object.assign({ variant: "body1" }, { children: addressState.name })), _jsxs(Typography, Object.assign({ variant: "body1" }, { children: [addressState.address.line1, _jsx("br", {}), addressState.address.line2] })), _jsxs(Typography, Object.assign({ variant: "body1" }, { children: [addressState.address.postal_code, " - ", addressState.address.city, " - ", addressState.address.country] })), _jsx(Button, Object.assign({ sx: { mt: 1 }, variant: "contained", disabled: !elements, onClick: () => setIsEditingBillingAddress(!isEditingBillingAddress) }, { children: "Change" }))] })) : (_jsxs(_Fragment, { children: [_jsx(AddressElement, { onChange: (event) => {
134
+ return (_jsx(Root, Object.assign({ className: classes.root }, { children: _jsxs("form", Object.assign({ onSubmit: handleSubmit }, { children: [_jsx(PaymentElement, { id: "payment-element", options: paymentElementOptions, onReady: () => setReady(true) }), collectBillingAddress && (_jsx(Paper, Object.assign({ variant: "outlined", className: classes.address }, { children: Object.keys(addressState).length && !isEditingBillingAddress ? (_jsxs(_Fragment, { children: [_jsx(Typography, Object.assign({ variant: 'body1' }, { children: addressState.name })), _jsxs(Typography, Object.assign({ variant: 'body1' }, { children: [addressState.address.line1, _jsx("br", {}), addressState.address.line2] })), _jsxs(Typography, Object.assign({ variant: 'body1' }, { children: [addressState.address.postal_code, " - ", addressState.address.city, " - ", addressState.address.country] })), _jsx(Button, Object.assign({ sx: { mt: 1 }, variant: 'contained', disabled: !elements, onClick: () => setIsEditingBillingAddress(!isEditingBillingAddress) }, { children: "Change" }))] })) : (_jsxs(_Fragment, { children: [_jsx(AddressElement, { onChange: (event) => {
133
135
  setAddressState(event.value);
134
136
  }, options: {
135
137
  mode: 'billing',
136
138
  defaultValues: addressState
137
- } }), _jsx(Button, Object.assign({ sx: { mt: 1 }, variant: "contained", disabled: !elements || loading || !ready, onClick: () => setIsEditingBillingAddress(!isEditingBillingAddress) }, { children: _jsx(FormattedMessage, { id: "ui.userAddPaymentMethodForm.useDefaultMethod", defaultMessage: "ui.userAddPaymentMethodForm.useDefaultMethod" }) }))] })) }))), _jsxs(Stack, Object.assign({ direction: "row", justifyContent: "flex-end", alignItems: "center", spacing: 2, mt: 3 }, { children: [_jsx(Button, Object.assign({ onClick: onHandleClose, variant: "outlined" }, { children: _jsx(FormattedMessage, { id: "ui.userAddPaymentMethodForm.cancelButton", defaultMessage: "ui.userAddPaymentMethodForm.cancelButton" }) })), _jsx(Button, Object.assign({ disabled: !ready, loading: loading, type: "submit", variant: "contained" }, { children: _jsx(FormattedMessage, { id: "ui.userAddPaymentMethodForm.addButton", defaultMessage: "ui.userAddPaymentMethodForm.addButton" }) }))] })), errorMessage && _jsx("div", { children: errorMessage })] })) })));
139
+ } }), _jsx(Button, Object.assign({ sx: { mt: 1 }, variant: 'contained', disabled: !elements || loading || !ready, onClick: () => setIsEditingBillingAddress(!isEditingBillingAddress) }, { children: _jsx(FormattedMessage, { id: 'ui.userAddPaymentMethodForm.useDefaultMethod', defaultMessage: 'ui.userAddPaymentMethodForm.useDefaultMethod' }) }))] })) }))), _jsxs(Stack, Object.assign({ direction: "row", justifyContent: "flex-end", alignItems: "center", spacing: 2, mt: 3 }, { children: [_jsx(Button, Object.assign({ onClick: onHandleClose, variant: "outlined" }, { children: _jsx(FormattedMessage, { id: "ui.userAddPaymentMethodForm.cancelButton", defaultMessage: "ui.userAddPaymentMethodForm.cancelButton" }) })), _jsx(LoadingButton, Object.assign({ disabled: !ready, loading: loading, type: "submit", variant: "contained" }, { children: _jsx(FormattedMessage, { id: "ui.userAddPaymentMethodForm.addButton", defaultMessage: "ui.userAddPaymentMethodForm.addButton" }) }))] })), errorMessage && _jsx("div", { children: errorMessage })] })) })));
138
140
  }
@@ -1,6 +1,6 @@
1
1
  import { __awaiter, __rest } from "tslib";
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import React, { useCallback, useEffect, useMemo, useState } from 'react';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import React, { Fragment, useCallback, useEffect, useMemo, useState } from 'react';
4
4
  import { FormattedMessage } from 'react-intl';
5
5
  import parse from 'autosuggest-highlight/parse';
6
6
  import match from 'autosuggest-highlight/match';
@@ -106,10 +106,10 @@ const UserAutocomplete = (inProps) => {
106
106
  const matches = match(option.username, inputValue);
107
107
  const parts = parse(option.username, matches);
108
108
  return (_jsxs(Box, Object.assign({ component: "li" }, props, { children: [_jsx(Avatar, { alt: option.username, src: option.avatar, sx: { marginRight: 1 } }), _jsx(React.Fragment, { children: parts.map((part, index) => (_jsx(Typography, { children: part.text }, index))) })] })));
109
- }, renderInput: (params) => (_jsx(TextField, Object.assign({}, params, TextFieldProps, { margin: "dense", slotProps: {
110
- input: Object.assign(Object.assign({}, params.InputProps), { autoComplete: 'off', endAdornment: filteredUsers.length > 0 ? (_jsxs(_Fragment, { children: [isLoading && _jsx(CircularProgress, { color: "inherit", size: 20 }), params.InputProps.endAdornment] })) : null })
111
- } }))) }, rest)), _jsx(Typography, Object.assign({ variant: "body2", color: "primary", className: classes.info }, { children: _jsx(FormattedMessage, { id: "ui.userAutocomplete.textarea.info", defaultMessage: "ui.userAutocomplete.textarea.info", values: {
112
- icon: (chunks) => _jsx(Icon, { children: chunks }, "ui.userAutocomplete.textarea.info.icon")
109
+ }, renderInput: (params) => (_jsx(TextField, Object.assign({}, params, TextFieldProps, { margin: "dense", InputProps: Object.assign(Object.assign({}, params.InputProps), { autoComplete: 'off', endAdornment: filteredUsers.length > 0 ? (_jsxs(Fragment, { children: [isLoading && _jsx(CircularProgress, { color: "inherit", size: 20 }), params.InputProps.endAdornment] })) : null }) }))) }, rest)), _jsx(Typography, Object.assign({ variant: "body2", color: "primary", className: classes.info }, { children: _jsx(FormattedMessage, { id: "ui.userAutocomplete.textarea.info", defaultMessage: "ui.userAutocomplete.textarea.info", values: {
110
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
111
+ // @ts-ignore
112
+ icon: (...chunks) => _jsx(Icon, { children: chunks })
113
113
  } }) })), _jsx(TextField, { label: _jsx(FormattedMessage, { id: "ui.userAutocomplete.textarea.label", defaultMessage: "ui.userAutocomplete.textarea.label" }), multiline: true, minRows: 4, fullWidth: true, margin: "normal", value: textAreaValue, onChange: handleTextAreaChange })] })));
114
114
  };
115
115
  export default UserAutocomplete;
@@ -5,5 +5,5 @@ export default function UserBillingInfoSkeleton(props) {
5
5
  if (props.mode === UserBillingInfoMode.READ) {
6
6
  return (_jsxs(Box, { children: [_jsx(Skeleton, { variant: "rectangular", height: 15, width: 200, sx: { mb: 2 } }), _jsx(Skeleton, { variant: "rectangular", height: 15, width: 250, sx: { mb: 2 } }), _jsx(Skeleton, { variant: "rectangular", height: 15, width: 220, sx: { mb: 2 } }), _jsx(Skeleton, { variant: "rectangular", height: 15, width: 190, sx: { mb: 2 } })] }));
7
7
  }
8
- return (_jsxs(Grid, Object.assign({ container: true, width: "100%", spacing: 3 }, { children: [_jsx(Grid, Object.assign({ size: { xs: 12, sm: 6 } }, { children: _jsx(Skeleton, { variant: "rectangular", height: 50 }) })), _jsx(Grid, Object.assign({ size: { xs: 12, sm: 6 } }, { children: _jsx(Skeleton, { variant: "rectangular", height: 50 }) })), _jsx(Grid, Object.assign({ size: { xs: 12, sm: 6 } }, { children: _jsx(Skeleton, { variant: "rectangular", height: 50 }) })), _jsx(Grid, Object.assign({ size: { xs: 12, sm: 6 } }, { children: _jsx(Skeleton, { variant: "rectangular", height: 50 }) })), _jsx(Grid, Object.assign({ size: { xs: 12, sm: 6 } }, { children: _jsx(Skeleton, { variant: "rectangular", height: 50 }) })), _jsx(Grid, Object.assign({ size: { xs: 12, sm: 6 } }, { children: _jsx(Skeleton, { variant: "rectangular", height: 50 }) })), _jsx(Grid, Object.assign({ size: { xs: 12, sm: 6 }, justifyContent: "center" }, { children: _jsx(Skeleton, { variant: "rounded", height: 30, width: 100 }) }))] })));
8
+ return (_jsxs(Grid, Object.assign({ container: true, spacing: 3 }, { children: [_jsx(Grid, Object.assign({ item: true, xs: 12, sm: 6 }, { children: _jsx(Skeleton, { variant: "rectangular", height: 50 }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: 6 }, { children: _jsx(Skeleton, { variant: "rectangular", height: 50 }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: 6 }, { children: _jsx(Skeleton, { variant: "rectangular", height: 50 }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: 6 }, { children: _jsx(Skeleton, { variant: "rectangular", height: 50 }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: 6 }, { children: _jsx(Skeleton, { variant: "rectangular", height: 50 }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: 6 }, { children: _jsx(Skeleton, { variant: "rectangular", height: 50 }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: 6, justifyContent: 'center' }, { children: _jsx(Skeleton, { variant: "rounded", height: 30, width: 100 }) }))] })));
9
9
  }
@@ -12,6 +12,7 @@ import { reducer, getInitialState, actionTypes } from './reducer';
12
12
  import { countries, COUNTRY_CODES } from '../../constants/Country';
13
13
  import UserBillingInfoSkeleton from './Skeleton';
14
14
  import Grow from '@mui/material/Grow';
15
+ import { LoadingButton } from '@mui/lab';
15
16
  import { useSnackbar } from 'notistack';
16
17
  // import {getCountryOption} from '../../utils/address';
17
18
  import { useSCPaymentsEnabled, useSCUser } from '@selfcommunity/react-core';
@@ -68,7 +69,7 @@ const UserBillingInfo = (inProps, ref) => {
68
69
  const scUserContext = useSCUser();
69
70
  // STATE
70
71
  const [state, dispatch] = useReducer(reducer, getInitialState({ mode }));
71
- const [customer] = useState();
72
+ const [customer, setCustomer] = useState();
72
73
  // HOOKS
73
74
  const { isPaymentsEnabled } = useSCPaymentsEnabled();
74
75
  const { enqueueSnackbar } = useSnackbar();
@@ -443,56 +444,47 @@ const UserBillingInfo = (inProps, ref) => {
443
444
  if (!isPaymentsEnabled || !scUserContext.user) {
444
445
  return null;
445
446
  }
446
- return (_jsx(Root, Object.assign({ className: classNames(classes.root, className), id: id }, rest, { ref: componentRef }, { children: _jsx(Fragment, { children: state.isLoading ? (_jsx(UserBillingInfoSkeleton, { mode: mode })) : (_jsx(Fragment, { children: state.mode === UserBillingInfoMode.READ ? (_jsxs(_Fragment, { children: [state.name ? (_jsxs(_Fragment, { children: [_jsx(Typography, Object.assign({ variant: "body1" }, { children: state.name })), _jsxs(Typography, Object.assign({ variant: "body1" }, { children: [state.address_line1, _jsx("br", {}), state.address_line2] })), _jsxs(Typography, Object.assign({ variant: "body1" }, { children: [state.address_postal_code, " - ", state.address_city, " - ", state.address_country && state.address_country.label] })), Boolean(state.tax_code && !state.isBusiness) && _jsx(Typography, Object.assign({ variant: "body1" }, { children: state.tax_code })), state.isBusiness && (_jsxs(_Fragment, { children: [state.tax_id_data && _jsxs(Typography, Object.assign({ variant: "body1" }, { children: ["VAT: ", state.tax_id_data.value] })), state.sdi && _jsxs(Typography, Object.assign({ variant: "body1" }, { children: ["SDI: ", state.sdi] })), state.pec && _jsxs(Typography, Object.assign({ variant: "body1" }, { children: ["PEC: ", state.pec] }))] }))] })) : (_jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.userBillingInfo.noInfo", defaultMessage: "ui.userBillingInfo.noInfo" }) }))), state.initialDataCompleted && (_jsx(Button, Object.assign({ sx: { mt: 1 }, variant: "contained", size: "small", disabled: Boolean(disableButtons), onClick: handleChangeViewMode }, { children: _jsx(FormattedMessage, { id: "component.CheckoutForm.billingInfoChangeButton", defaultMessage: "component.CheckoutForm.billingInfoChangeButton" }) })))] })) : (_jsx(Box, { children: _jsxs(Grid, Object.assign({ container: true, width: "100%", spacing: 3 }, { children: [_jsx(Grid, Object.assign({ size: { xs: 12, sm: inlineDisplay ? 12 : 6 } }, { children: _jsx(TextField, { variant: "outlined", id: "name", name: "name", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.name", defaultMessage: "ui.userBillingInfo.name" }), onChange: handleChange('name'), value: state.name, error: Boolean(state.nameError), helperText: state.nameError, fullWidth: true }) })), _jsx(Grid, Object.assign({ size: { xs: 12, sm: inlineDisplay ? 12 : 6 } }, { children: _jsx(TextField, { variant: "outlined", id: "address_line1", name: "address_line1", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.address1", defaultMessage: "ui.userBillingInfo.address1" }), onChange: handleChange('address_line1'), value: state.address_line1, error: Boolean(state.addressLine1Error), helperText: state.addressLine1Error, fullWidth: true }) })), _jsx(Grid, Object.assign({ size: { xs: 12, sm: inlineDisplay ? 12 : 6 } }, { children: _jsx(TextField, { variant: "outlined", id: "address_line2", name: "address_line2", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.address2", defaultMessage: "ui.userBillingInfo.address2" }), onChange: handleChange('address_line2'), value: state.address_line2, error: Boolean(state.addressLine2Error), helperText: state.addressLine2Error, fullWidth: true }) })), _jsx(Grid, Object.assign({ size: { xs: 12, sm: inlineDisplay ? 12 : 6 } }, { children: _jsx(Autocomplete, { id: "country-select-demo", options: countries, value: state.address_country, fullWidth: true, onChange: handleChange('address_country'), getOptionLabel: (option) => option.label, renderOption: (props, option) => {
447
+ return (_jsx(Root, Object.assign({ className: classNames(classes.root, className), id: id }, rest, { ref: componentRef }, { children: _jsx(Fragment, { children: state.isLoading ? (_jsx(UserBillingInfoSkeleton, { mode: mode })) : (_jsx(Fragment, { children: state.mode === UserBillingInfoMode.READ ? (_jsxs(_Fragment, { children: [state.name ? (_jsxs(_Fragment, { children: [_jsx(Typography, Object.assign({ variant: 'body1' }, { children: state.name })), _jsxs(Typography, Object.assign({ variant: 'body1' }, { children: [state.address_line1, _jsx("br", {}), state.address_line2] })), _jsxs(Typography, Object.assign({ variant: 'body1' }, { children: [state.address_postal_code, " - ", state.address_city, " - ", state.address_country && state.address_country.label] })), Boolean(state.tax_code && !state.isBusiness) && _jsx(Typography, Object.assign({ variant: 'body1' }, { children: state.tax_code })), state.isBusiness && (_jsxs(_Fragment, { children: [state.tax_id_data && _jsxs(Typography, Object.assign({ variant: 'body1' }, { children: ["VAT: ", state.tax_id_data.value] })), state.sdi && _jsxs(Typography, Object.assign({ variant: 'body1' }, { children: ["SDI: ", state.sdi] })), state.pec && _jsxs(Typography, Object.assign({ variant: 'body1' }, { children: ["PEC: ", state.pec] }))] }))] })) : (_jsx(Typography, Object.assign({ variant: 'body1' }, { children: _jsx(FormattedMessage, { id: "ui.userBillingInfo.noInfo", defaultMessage: "ui.userBillingInfo.noInfo" }) }))), state.initialDataCompleted && (_jsx(Button, Object.assign({ sx: { mt: 1 }, variant: 'contained', size: 'small', disabled: Boolean(disableButtons), onClick: handleChangeViewMode }, { children: _jsx(FormattedMessage, { id: "component.CheckoutForm.billingInfoChangeButton", defaultMessage: "component.CheckoutForm.billingInfoChangeButton" }) })))] })) : (_jsx(Box, { children: _jsxs(Grid, Object.assign({ container: true, spacing: 3 }, { children: [_jsx(Grid, Object.assign({ item: true, xs: 12, sm: inlineDisplay ? 12 : 6 }, { children: _jsx(TextField, { variant: "outlined", id: "name", name: "name", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.name", defaultMessage: "ui.userBillingInfo.name" }), onChange: handleChange('name'), value: state.name, error: Boolean(state.nameError), helperText: state.nameError, fullWidth: true }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: inlineDisplay ? 12 : 6 }, { children: _jsx(TextField, { variant: "outlined", id: "address_line1", name: "address_line1", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.address1", defaultMessage: "ui.userBillingInfo.address1" }), onChange: handleChange('address_line1'), value: state.address_line1, error: Boolean(state.addressLine1Error), helperText: state.addressLine1Error, fullWidth: true }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: inlineDisplay ? 12 : 6 }, { children: _jsx(TextField, { variant: "outlined", id: "address_line2", name: "address_line2", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.address2", defaultMessage: "ui.userBillingInfo.address2" }), onChange: handleChange('address_line2'), value: state.address_line2, error: Boolean(state.addressLine2Error), helperText: state.addressLine2Error, fullWidth: true }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: inlineDisplay ? 12 : 6 }, { children: _jsx(Autocomplete, { id: "country-select-demo", options: countries, value: state.address_country, fullWidth: true, onChange: handleChange('address_country'), getOptionLabel: (option) => option.label, renderOption: (props, option) => {
448
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
449
+ // @ts-ignore
447
450
  const { key } = props, rest = __rest(props, ["key"]);
448
451
  return (_jsxs(Box, Object.assign({ component: "li", sx: { '& > img': { mr: 2, flexShrink: 0 } } }, rest, { children: [_jsx("img", { loading: "lazy", width: "20", srcSet: `https://flagcdn.com/w40/${option.code.toLowerCase()}.png 2x`, src: `https://flagcdn.com/w20/${option.code.toLowerCase()}.png`, alt: "" }), option.label, " (", option.code, ")"] }), key));
449
- }, renderInput: (params) => (_jsx(TextField, Object.assign({}, params, { label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.country", defaultMessage: "ui.userBillingInfo.country" }), fullWidth: true, id: "address_country", name: "address_country", error: Boolean(state.addressCountryError), slotProps: {
450
- input: Object.assign(Object.assign({}, params.InputProps), (state.address_country && {
451
- startAdornment: (_jsx(InputAdornment, Object.assign({ position: "start" }, { children: _jsx("img", { loading: "lazy", width: "20", srcSet: `https://flagcdn.com/w40/${state.address_country.code.toLowerCase()}.png 2x`, src: `https://flagcdn.com/w20/${state.address_country.code.toLowerCase()}.png`, alt: "" }) })))
452
- })),
453
- htmlInput: Object.assign(Object.assign({}, params.inputProps), { autoComplete: 'new-password' // disable autocomplete and autofill
454
- })
455
- } }))) }) })), _jsx(Grid, Object.assign({ size: { xs: 12, sm: inlineDisplay ? 12 : 6 } }, { children: _jsx(TextField, { variant: "outlined", id: "address_state", name: "address_state", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.state", defaultMessage: "ui.userBillingInfo.state" }), onChange: handleChange('address_state'), value: state.address_state, error: Boolean(state.addressStateError), helperText: state.addressStateError, fullWidth: true }) })), _jsx(Grid, Object.assign({ size: { xs: 12, sm: inlineDisplay ? 12 : 6 } }, { children: _jsx(TextField, { variant: "outlined", id: "address_postal_code", name: "address_postal_code", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.postalCode", defaultMessage: "ui.userBillingInfo.postalCode" }), onChange: handleChange('address_postal_code'), value: state.address_postal_code, error: Boolean(state.addressPostalCodeError), helperText: state.addressPostalCodeError, fullWidth: true }) })), _jsx(Grid, Object.assign({ size: { xs: 12, sm: inlineDisplay ? 12 : 6 } }, { children: _jsx(TextField, { variant: "outlined", id: "address_city", name: "address_city", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.city", defaultMessage: "ui.userBillingInfo.city" }), onChange: handleChange('address_city'), value: state.address_city, error: Boolean(state.addressCityError), helperText: state.addressCityError, slotProps: {
456
- input: {
457
- startAdornment: (_jsx(InputAdornment, Object.assign({ position: "start" }, { children: _jsx(Icon, { children: "public" }) })))
458
- }
459
- }, fullWidth: true }) })), _jsx(Grid, Object.assign({ size: { xs: 12, sm: inlineDisplay ? 12 : 6 } }, { children: _jsx(TextField, { variant: "outlined", id: "phone", name: "phone", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.phone", defaultMessage: "ui.userBillingInfo.phone" }), onChange: handleChange('phone'), value: state.phone, error: Boolean(state.phoneError), helperText: state.phoneError, slotProps: {
460
- input: {
461
- startAdornment: (_jsx(InputAdornment, Object.assign({ position: "start" }, { children: _jsx(Icon, { children: "person" }) })))
462
- }
463
- }, fullWidth: true }) })), _jsx(Grid, Object.assign({ size: { xs: 12, sm: inlineDisplay ? 12 : 6 } }, { children: _jsx(TextField, { variant: "outlined", id: "tax_code", name: "tax_code", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.taxCode", defaultMessage: "ui.userBillingInfo.taxCode" }), onChange: handleChange('tax_code'), value: state.tax_code, error: Boolean(state.taxCodeError), helperText: state.taxCodeError, fullWidth: true }) })), _jsx(Grid, Object.assign({ size: "grow" }, { children: _jsx(FormGroup, { children: _jsx(FormControlLabel, { disabled: Boolean(disableButtons), control: _jsx(Checkbox, Object.assign({ checked: state.isBusiness }, ((state.taxIdDataError || state.sdiError || state.pecError) && { color: 'secondary' }), { className: classNames({
452
+ }, renderInput: (params) => (_jsx(TextField, Object.assign({}, params, { label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.country", defaultMessage: "ui.userBillingInfo.country" }), fullWidth: true, id: "address_country", name: "address_country", error: Boolean(state.addressCountryError), InputProps: Object.assign(Object.assign({}, params.InputProps), (state.address_country && {
453
+ startAdornment: (_jsx(InputAdornment, Object.assign({ position: "start" }, { children: _jsx("img", { loading: "lazy", width: "20", srcSet: `https://flagcdn.com/w40/${state.address_country.code.toLowerCase()}.png 2x`, src: `https://flagcdn.com/w20/${state.address_country.code.toLowerCase()}.png`, alt: "" }) })))
454
+ })), inputProps: Object.assign(Object.assign({}, params.inputProps), { autoComplete: 'new-password' // disable autocomplete and autofill
455
+ }) }))) }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: inlineDisplay ? 12 : 6 }, { children: _jsx(TextField, { variant: "outlined", id: "address_state", name: "address_state", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.state", defaultMessage: "ui.userBillingInfo.state" }), onChange: handleChange('address_state'), value: state.address_state, error: Boolean(state.addressStateError), helperText: state.addressStateError, fullWidth: true }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: inlineDisplay ? 12 : 6 }, { children: _jsx(TextField, { variant: "outlined", id: "address_postal_code", name: "address_postal_code", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.postalCode", defaultMessage: "ui.userBillingInfo.postalCode" }), onChange: handleChange('address_postal_code'), value: state.address_postal_code, error: Boolean(state.addressPostalCodeError), helperText: state.addressPostalCodeError, fullWidth: true }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: inlineDisplay ? 12 : 6 }, { children: _jsx(TextField, { variant: "outlined", id: "address_city", name: "address_city", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.city", defaultMessage: "ui.userBillingInfo.city" }), onChange: handleChange('address_city'), value: state.address_city, error: Boolean(state.addressCityError), helperText: state.addressCityError, InputProps: {
456
+ startAdornment: (_jsx(InputAdornment, Object.assign({ position: "start" }, { children: _jsx(Icon, { children: "public" }) })))
457
+ }, fullWidth: true }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: inlineDisplay ? 12 : 6 }, { children: _jsx(TextField, { variant: "outlined", id: "phone", name: "phone", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.phone", defaultMessage: "ui.userBillingInfo.phone" }), onChange: handleChange('phone'), value: state.phone, error: Boolean(state.phoneError), helperText: state.phoneError, InputProps: {
458
+ startAdornment: (_jsx(InputAdornment, Object.assign({ position: "start" }, { children: _jsx(Icon, { children: "person" }) })))
459
+ }, fullWidth: true }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: inlineDisplay ? 12 : 6 }, { children: _jsx(TextField, { variant: "outlined", id: "tax_code", name: "tax_code", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.taxCode", defaultMessage: "ui.userBillingInfo.taxCode" }), onChange: handleChange('tax_code'), value: state.tax_code, error: Boolean(state.taxCodeError), helperText: state.taxCodeError, fullWidth: true }) })), _jsx(Grid, Object.assign({ item: true, xs: 12 }, { children: _jsx(FormGroup, { children: _jsx(FormControlLabel, { disabled: Boolean(disableButtons), control: _jsx(Checkbox, Object.assign({ checked: state.isBusiness }, ((state.taxIdDataError || state.sdiError || state.pecError) && { color: 'secondary' }), { className: classNames({
464
460
  [classes.error]: state.taxIdDataError || state.sdiError || state.pecError
465
461
  }), onChange: handleSetBusiness })), label: _jsx("span", Object.assign({ className: classNames({
466
462
  [classes.error]: state.taxIdDataError || state.sdiError || state.pecError
467
463
  }) }, { children: intl.formatMessage({
468
464
  id: 'component.billingInfo.accountBusiness',
469
465
  defaultMessage: 'component.billingInfo.accountBusiness'
470
- }) })) }) }) })), state.isBusiness && (_jsx(Grow, Object.assign({ in: state.isBusiness }, { children: _jsx(Grid, Object.assign({ size: "grow" }, { children: _jsxs(Grid, Object.assign({ container: true, width: "100%", spacing: 3 }, { children: [_jsx(Grid, Object.assign({ size: { xs: 12, sm: inlineDisplay ? 12 : 6 } }, { children: _jsx(TextField, { variant: "outlined", id: "tax_id_data", name: "tax_id_data", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.taxId", defaultMessage: "ui.userBillingInfo.taxId" }), onChange: handleChange('tax_id_data'), value: state.tax_id_data ? state.tax_id_data.value : null, error: Boolean(state.taxIdDataError), helperText: `${state.taxIdDataError ? state.taxIdDataError : ''} ${state.address_country && state.address_country.code && VAT_EXAMPLE[state.address_country.code]
466
+ }) })) }) }) })), state.isBusiness && (_jsx(Grow, Object.assign({ in: state.isBusiness }, { children: _jsx(Grid, Object.assign({ item: true, xs: 12 }, { children: _jsxs(Grid, Object.assign({ container: true, spacing: 3 }, { children: [_jsx(Grid, Object.assign({ item: true, xs: 12, sm: inlineDisplay ? 12 : 6 }, { children: _jsx(TextField, { variant: "outlined", id: "tax_id_data", name: "tax_id_data", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.taxId", defaultMessage: "ui.userBillingInfo.taxId" }), onChange: handleChange('tax_id_data'), value: state.tax_id_data ? state.tax_id_data.value : null, error: Boolean(state.taxIdDataError), helperText: `${state.taxIdDataError ? state.taxIdDataError : ''} ${state.address_country && state.address_country.code && VAT_EXAMPLE[state.address_country.code]
471
467
  ? intl.formatMessage({
472
468
  id: 'component.billingInfo.requiredFormat',
473
469
  defaultMessage: 'component.billingInfo.requiredFormat'
474
470
  }) + VAT_EXAMPLE[state.address_country.code]
475
471
  : ''}`, placeholder: state.address_country && state.address_country.code && VAT_EXAMPLE[state.address_country.code]
476
472
  ? VAT_EXAMPLE[state.address_country.code]
477
- : '', slotProps: {
478
- input: {
479
- endAdornment: state.taxIdVerificationStatus !== null && (_jsx(InputAdornment, Object.assign({ position: "end" }, { children: state.taxIdVerificationStatus === 'verified' ? (_jsx(Icon, Object.assign({ color: "primary" }, { children: "done" }))) : state.taxIdVerificationStatus === 'pending' ? (_jsx(Tooltip, Object.assign({ id: "tooltip-warning", title: _jsx(FormattedMessage, { id: "ui.userBillingInfo.taxCheckPending", defaultMessage: "ui.userBillingInfo.taxCheckPending" }), enterDelay: 300, leaveDelay: 300, placement: "top" }, { children: _jsx(Icon, Object.assign({ color: "warning" }, { children: "help" })) }))) : (_jsx(Tooltip, Object.assign({ id: "tooltip-warning", title: _jsx(FormattedMessage, { id: "ui.userBillingInfo.taxCheckWarning", defaultMessage: "ui.userBillingInfo.taxCheckWarning" }), enterDelay: 300, leaveDelay: 300, placement: "top" }, { children: _jsx(Icon, Object.assign({ color: "warning" }, { children: "help" })) }))) })))
480
- }
481
- }, fullWidth: true }) })), _jsx(Grid, Object.assign({ size: { xs: 12, sm: inlineDisplay ? 12 : 6 } }, { children: _jsx(TextField, { variant: "outlined", id: "sdi", name: "sdi", label: `${intl.formatMessage({ id: 'component.billingInfo.sdi', defaultMessage: 'component.billingInfo.sdi' })} ${((_a = state.address_country) === null || _a === void 0 ? void 0 : _a.code) === COUNTRY_CODES.IT
473
+ : '', InputProps: {
474
+ endAdornment: state.taxIdVerificationStatus !== null && (_jsx(InputAdornment, Object.assign({ position: "end" }, { children: state.taxIdVerificationStatus === 'verified' ? (_jsx(Icon, Object.assign({ color: "primary" }, { children: "done" }))) : state.taxIdVerificationStatus === 'pending' ? (_jsx(Tooltip, Object.assign({ id: "tooltip-warning", title: _jsx(FormattedMessage, { id: "ui.userBillingInfo.taxCheckPending", defaultMessage: "ui.userBillingInfo.taxCheckPending" }), enterDelay: 300, leaveDelay: 300, placement: "top" }, { children: _jsx(Icon, Object.assign({ color: "warning" }, { children: "help" })) }))) : (_jsx(Tooltip, Object.assign({ id: "tooltip-warning", title: _jsx(FormattedMessage, { id: "ui.userBillingInfo.taxCheckWarning", defaultMessage: "ui.userBillingInfo.taxCheckWarning" }), enterDelay: 300, leaveDelay: 300, placement: "top" }, { children: _jsx(Icon, Object.assign({ color: "warning" }, { children: "help" })) }))) })))
475
+ }, fullWidth: true }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: inlineDisplay ? 12 : 6 }, { children: _jsx(TextField, { variant: "outlined", id: "sdi", name: "sdi", label: `${intl.formatMessage({ id: 'component.billingInfo.sdi', defaultMessage: 'component.billingInfo.sdi' })} ${((_a = state.address_country) === null || _a === void 0 ? void 0 : _a.code) === COUNTRY_CODES.IT
482
476
  ? intl.formatMessage({
483
477
  id: 'component.billingInfo.field.optional',
484
478
  defaultMessage: 'component.billingInfo.field.optional'
485
479
  })
486
- : ''}`, onChange: handleChange('sdi'), value: state.sdi, error: Boolean(state.sdiError), helperText: state.sdiError, fullWidth: true }) })), _jsx(Grid, Object.assign({ size: { xs: 12, sm: inlineDisplay ? 12 : 6 } }, { children: _jsx(TextField, { variant: "outlined", id: "pec", name: "pec", label: `${intl.formatMessage({ id: 'component.billingInfo.pec', defaultMessage: 'component.billingInfo.pec' })} ${((_b = state.address_country) === null || _b === void 0 ? void 0 : _b.code) === COUNTRY_CODES.IT
480
+ : ''}`, onChange: handleChange('sdi'), value: state.sdi, error: Boolean(state.sdiError), helperText: state.sdiError, fullWidth: true }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: inlineDisplay ? 12 : 6 }, { children: _jsx(TextField, { variant: "outlined", id: "pec", name: "pec", label: `${intl.formatMessage({ id: 'component.billingInfo.pec', defaultMessage: 'component.billingInfo.pec' })} ${((_b = state.address_country) === null || _b === void 0 ? void 0 : _b.code) === COUNTRY_CODES.IT
487
481
  ? intl.formatMessage({
488
482
  id: 'component.billingInfo.field.optional',
489
483
  defaultMessage: 'component.billingInfo.field.optional'
490
484
  })
491
- : ''}`, onChange: handleChange('pec'), value: state.pec, error: Boolean(state.pecError), helperText: state.pecError, slotProps: {
492
- input: {
493
- type: 'email',
494
- startAdornment: (_jsx(InputAdornment, Object.assign({ position: "start" }, { children: _jsx(Icon, { children: "email" }) })))
495
- }
496
- }, fullWidth: true }) }))] })) })) }))), state.error && (_jsx(Grid, Object.assign({ size: "grow" }, { children: _jsx(Typography, Object.assign({ align: "left", color: "secondary" }, { children: state.error })) }))), _jsx(Grid, Object.assign({ size: "grow" }, { children: _jsxs(Typography, Object.assign({ align: "left" }, { children: [_jsx(Button, Object.assign({ variant: "contained", size: "small", color: "primary", disabled: state.isProcessing || Boolean(disableButtons), loading: state.isProcessing, onClick: handleSubmit }, { children: buttonLabel })), onBack && state.initialDataCompleted && (_jsx(Button, Object.assign({ variant: "text", size: "small", onClick: handleBack, disabled: Boolean(disableButtons) }, { children: _jsx(FormattedMessage, { id: "ui.userBillingInfo.back", defaultMessage: "ui.userBillingInfo.back" }) })))] })) }))] })) })) })) }) })));
485
+ : ''}`, onChange: handleChange('pec'), value: state.pec, error: Boolean(state.pecError), helperText: state.pecError, InputProps: {
486
+ type: 'email',
487
+ startAdornment: (_jsx(InputAdornment, Object.assign({ position: "start" }, { children: _jsx(Icon, { children: "email" }) })))
488
+ }, fullWidth: true }) }))] })) })) }))), state.error && (_jsx(Grid, Object.assign({ item: true, xs: 12 }, { children: _jsx(Typography, Object.assign({ align: "left", color: "secondary" }, { children: state.error })) }))), _jsx(Grid, Object.assign({ item: true, xs: 12 }, { children: _jsxs(Typography, Object.assign({ align: "left" }, { children: [_jsx(LoadingButton, Object.assign({ variant: "contained", size: "small", color: "primary", disabled: state.isProcessing || Boolean(disableButtons), loading: state.isProcessing, onClick: handleSubmit }, { children: buttonLabel })), onBack && state.initialDataCompleted && (_jsx(Button, Object.assign({ variant: "text", size: "small", onClick: handleBack, disabled: Boolean(disableButtons) }, { children: _jsx(FormattedMessage, { id: "ui.userBillingInfo.back", defaultMessage: "ui.userBillingInfo.back" }) })))] })) }))] })) })) })) }) })));
497
489
  };
498
490
  export default forwardRef(UserBillingInfo);
@@ -9,6 +9,7 @@ import { useThemeProps } from '@mui/system';
9
9
  import { PREFIX } from './constants';
10
10
  import BaseDialog from '../../shared/BaseDialog';
11
11
  import { FormattedMessage, useIntl } from 'react-intl';
12
+ import { LoadingButton } from '@mui/lab';
12
13
  import { AddressElement, Elements } from '@stripe/react-stripe-js';
13
14
  import { loadStripe } from '@stripe/stripe-js';
14
15
  import { getDefaultAppearanceStyle, getDefaultLocale } from '../../utils/payment';
@@ -74,7 +75,7 @@ export default function UserChangeAddressDialog(inProps) {
74
75
  if (!isPaymentsEnabled || !scUserContext.user) {
75
76
  return null;
76
77
  }
77
- return (_jsx(Root, Object.assign({ className: classNames(classes.root, className), title: _jsx(FormattedMessage, { defaultMessage: "ui.userChangeAddressDialog.title", id: "component.userChangeAddressDialog.title" }), open: open, actions: _jsxs(_Fragment, { children: [_jsx(Button, Object.assign({ variant: "outlined", onClick: handleClose }, { children: _jsx(FormattedMessage, { defaultMessage: "ui.userChangeAddressDialog.btnClose", id: "component.userChangeAddressDialog.btnClose" }) })), _jsx(Button, Object.assign({ loading: loading, disabled: loading, variant: "contained", onClick: handleSave }, { children: _jsx(FormattedMessage, { defaultMessage: "ui.userChangeAddressDialog.btnSave", id: "component.userChangeAddressDialog.btnSave" }) }))] }) }, rest, { children: _jsx(Elements, Object.assign({ stripe: stripePromise, options: elementsOptions }, { children: _jsx(AddressElement, { onChange: handleChangeAddress, options: {
78
+ return (_jsx(Root, Object.assign({ className: classNames(classes.root, className), title: _jsx(FormattedMessage, { defaultMessage: "ui.userChangeAddressDialog.title", id: "component.userChangeAddressDialog.title" }), open: open, actions: _jsxs(_Fragment, { children: [_jsx(Button, Object.assign({ variant: 'outlined', onClick: handleClose }, { children: _jsx(FormattedMessage, { defaultMessage: "ui.userChangeAddressDialog.btnClose", id: "component.userChangeAddressDialog.btnClose" }) })), _jsx(LoadingButton, Object.assign({ loading: loading, disabled: loading, variant: 'contained', onClick: handleSave }, { children: _jsx(FormattedMessage, { defaultMessage: "ui.userChangeAddressDialog.btnSave", id: "component.userChangeAddressDialog.btnSave" }) }))] }) }, rest, { children: _jsx(Elements, Object.assign({ stripe: stripePromise, options: elementsOptions }, { children: _jsx(AddressElement, { onChange: handleChangeAddress, options: {
78
79
  mode: 'billing',
79
80
  defaultValues: addressState
80
81
  } }) })) })));
@@ -16,7 +16,7 @@ const classes = {
16
16
  const Root = styled(Box, {
17
17
  name: PREFIX,
18
18
  slot: 'Root',
19
- overridesResolver: (_props, styles) => styles.root
19
+ overridesResolver: (props, styles) => styles.root
20
20
  })(() => ({}));
21
21
  /**
22
22
  * > API documentation for the Community-JS User Counters component. Learn about the available props and the CSS API.
@@ -91,15 +91,23 @@ export default function UserCounters(inProps) {
91
91
  return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: [_jsx(_Fragment, { children: (followEnabled || connectionEnabled) &&
92
92
  (followEnabled ? (_jsxs(_Fragment, { children: [_jsx(Button, Object.assign({ className: classes.button, variant: "text", component: Link, to: scRoutingContext.url(SCRoutes.USER_PROFILE_FOLLOWINGS_ROUTE_NAME, scUser) }, { children: _jsx(FormattedMessage, { id: "ui.userCounters.followings", defaultMessage: "ui.userCounters.followings", values: {
93
93
  count: scUser === null || scUser === void 0 ? void 0 : scUser.followings_counter,
94
- b: (chunks) => _jsx("strong", { children: chunks }, Math.random())
94
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
95
+ // @ts-ignore
96
+ b: (chunks) => _jsx("strong", { children: chunks })
95
97
  } }) })), _jsx(Bullet, {}), _jsx(Button, Object.assign({ className: classes.button, variant: "text", component: Link, to: scRoutingContext.url(SCRoutes.USER_PROFILE_FOLLOWERS_ROUTE_NAME, scUser) }, { children: _jsx(FormattedMessage, { id: "ui.userCounters.followers", defaultMessage: "ui.userCounters.followers", values: {
96
98
  count: scUser === null || scUser === void 0 ? void 0 : scUser.followers_counter,
97
- b: (chunks) => _jsx("strong", { children: chunks }, Math.random())
99
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
100
+ // @ts-ignore
101
+ b: (chunks) => _jsx("strong", { children: chunks })
98
102
  } }) }))] })) : (_jsxs(_Fragment, { children: [_jsx(Button, Object.assign({ className: classes.button, variant: "text", component: Link, to: scRoutingContext.url(SCRoutes.USER_PROFILE_CONNECTIONS_ROUTE_NAME, scUser) }, { children: _jsx(FormattedMessage, { id: "ui.userCounters.connections", defaultMessage: "ui.userCounters.connections", values: {
99
103
  count: scUser === null || scUser === void 0 ? void 0 : scUser.connections_counter,
100
- b: (chunks) => _jsx("strong", { children: chunks }, Math.random())
104
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
105
+ // @ts-ignore
106
+ b: (chunks) => _jsx("strong", { children: chunks })
101
107
  } }) })), _jsx(Bullet, {})] }))) }), categoryFollowEnabled && (_jsx(Button, Object.assign({ className: classes.button, variant: "text", component: Link, to: scRoutingContext.url(SCRoutes.USER_PROFILE_CATEGORIES_ROUTE_NAME, scUser) }, { children: _jsx(FormattedMessage, { id: "ui.userCounters.categories", defaultMessage: "ui.userCounters.categories", values: {
102
108
  count: scUser === null || scUser === void 0 ? void 0 : scUser.categories_counter,
103
- b: (chunks) => _jsx("strong", { children: chunks }, Math.random())
109
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
110
+ // @ts-ignore
111
+ b: (chunks) => _jsx("strong", { children: chunks })
104
112
  } }) })))] })));
105
113
  }
@@ -120,7 +120,7 @@ export default function UserInfo(inProps) {
120
120
  case SCUserProfileFields.DATE_OF_BIRTH:
121
121
  return `${intl.formatDate(user[field], { year: 'numeric', month: 'numeric', day: 'numeric' })}`;
122
122
  case SCUserProfileFields.TAGS:
123
- return (_jsx(Tags, { tags: user.tags.filter((t) => t.visible), type: TagsComponentType.LIST, direction: "row", TagChipProps: { clickable: false, disposable: false } }));
123
+ return (_jsx(Tags, { tags: user.tags.filter((t) => t.visible), type: TagsComponentType.LIST, direction: 'row', TagChipProps: { clickable: false, disposable: false } }));
124
124
  case SCUserProfileFields.WEBSITE:
125
125
  return (_jsx("a", Object.assign({ href: user[field], target: '_blank' }, { children: user[field] })));
126
126
  default:
@@ -1,4 +1,4 @@
1
1
  import UserLiveStreamWidget, { UserLiveStreamWidgetProps } from './UserLiveStreamWidget';
2
2
  import UserLiveStreamWidgetSkeleton from './Skeleton';
3
3
  export default UserLiveStreamWidget;
4
- export { UserLiveStreamWidgetSkeleton, UserLiveStreamWidgetProps };
4
+ export { UserLiveStreamWidgetSkeleton, type UserLiveStreamWidgetProps };
@@ -1,4 +1,4 @@
1
- import { ForwardRefRenderFunction } from 'react';
1
+ import React from 'react';
2
2
  export interface UserPaymentMethodsSkeletonProps {
3
3
  /**
4
4
  * Overrides or extends the styles applied to the component.
@@ -11,26 +11,5 @@ export interface UserPaymentMethodsSkeletonProps {
11
11
  showBillingAddress?: boolean;
12
12
  }
13
13
  export type UserPaymentMethodsSkeletonRef = {};
14
- /**
15
- * > API documentation for the Community-JS User Payment Methods Skeleton component. Learn about the available props and the CSS API.
16
-
17
- #### Import
18
-
19
- ```jsx
20
- import {UserPaymentMethodsSkeleton} from '@selfcommunity/react-ui';
21
- ```
22
-
23
- #### Component Name
24
-
25
- The name `SCUserPaymentMethodsSkeleton-skeleton-root` can be used when providing style overrides in the theme.
26
-
27
- #### CSS
28
-
29
- |Rule Name|Global class|Description|
30
- |---|---|---|
31
- |root|.SCUserPaymentMethodsSkeleton-skeleton-root|Styles applied to the root element.|
32
- *
33
- * @param inProps
34
- */
35
- declare const UserPaymentMethodsSkeleton: ForwardRefRenderFunction<UserPaymentMethodsSkeletonRef, UserPaymentMethodsSkeletonProps>;
36
- export default UserPaymentMethodsSkeleton;
14
+ declare const _default: React.ForwardRefExoticComponent<UserPaymentMethodsSkeletonProps & React.RefAttributes<UserPaymentMethodsSkeletonRef>>;
15
+ export default _default;
@@ -1,5 +1,6 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { forwardRef } from 'react';
3
4
  import { Box, TableCell, TableRow, Skeleton, styled } from '@mui/material';
4
5
  import { PREFIX } from './constants';
5
6
  import { useThemeProps } from '@mui/system';
@@ -32,8 +33,9 @@ const Root = styled(Box, {
32
33
  |root|.SCUserPaymentMethodsSkeleton-skeleton-root|Styles applied to the root element.|
33
34
  *
34
35
  * @param inProps
36
+ * @param ref
35
37
  */
36
- const UserPaymentMethodsSkeleton = (inProps) => {
38
+ const UserPaymentMethodsSkeleton = (inProps, ref) => {
37
39
  // PROPS
38
40
  const props = useThemeProps({
39
41
  props: inProps,
@@ -42,4 +44,4 @@ const UserPaymentMethodsSkeleton = (inProps) => {
42
44
  const { className = null, showBillingAddress = false } = props, rest = __rest(props, ["className", "showBillingAddress"]);
43
45
  return (_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: _jsxs(TableRow, { children: [_jsx(TableCell, Object.assign({ component: "th", scope: "row" }, { children: _jsx(Skeleton, { variant: "text", height: 40 }) })), _jsx(TableCell, Object.assign({ component: "th", scope: "row" }, { children: _jsx(Skeleton, { variant: "text", height: 40, width: 200 }) })), _jsx(TableCell, Object.assign({ component: "th", scope: "row" }, { children: _jsx(Skeleton, { variant: "text", height: 40, width: 50 }) })), showBillingAddress && (_jsx(TableCell, Object.assign({ component: "th", scope: "row" }, { children: _jsx(Skeleton, { variant: "text", height: 40, width: 150 }) }))), _jsx(TableCell, Object.assign({ component: "th", scope: "row" }, { children: _jsx(Skeleton, { variant: "rectangular", width: 25, height: 25 }) })), _jsx(TableCell, Object.assign({ component: "th", scope: "row" }, { children: _jsx(Skeleton, { variant: "rounded", width: 105, height: 35 }) }))] }) })));
44
46
  };
45
- export default UserPaymentMethodsSkeleton;
47
+ export default forwardRef(UserPaymentMethodsSkeleton);
@@ -1,4 +1,4 @@
1
- import { ForwardRefRenderFunction } from 'react';
1
+ import React from 'react';
2
2
  export interface UserPaymentMethodsProps {
3
3
  /**
4
4
  * Overrides or extends the styles applied to the component.
@@ -15,27 +15,5 @@ export interface UserPaymentMethodsProps {
15
15
  [p: string]: any;
16
16
  }
17
17
  export type UserPaymentMethodsRef = {};
18
- /**
19
- * > API documentation for the Community-JS User Payment Methods. Learn about the available props and the CSS API.
20
-
21
- #### Import
22
-
23
- ```jsx
24
- import {UserPaymentMethods} from '@selfcommunity/react-ui';
25
- ```
26
-
27
- #### Component Name
28
-
29
- The name `SCUserPaymentMethods` can be used when providing style overrides in the theme.
30
-
31
-
32
- #### CSS
33
-
34
- |Rule Name|Global class|Description|
35
- |---|---|---|
36
- |root|.SCUserPaymentMethods-root|Styles applied to the root element.|
37
-
38
- * @param inProps
39
- */
40
- declare const UserPaymentMethods: ForwardRefRenderFunction<UserPaymentMethodsRef, UserPaymentMethodsProps>;
41
- export default UserPaymentMethods;
18
+ declare const _default: React.ForwardRefExoticComponent<Omit<UserPaymentMethodsProps, "ref"> & React.RefAttributes<UserPaymentMethodsRef>>;
19
+ export default _default;
@@ -1,13 +1,13 @@
1
- import { __awaiter } from "tslib";
1
+ import { __awaiter, __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { useCallback, useEffect, useMemo, useState } from 'react';
3
+ import { forwardRef, useCallback, useEffect, useMemo, useState } from 'react';
4
4
  import { Box, Button, Checkbox, CircularProgress, Icon, IconButton, Paper, Stack, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Typography, styled } from '@mui/material';
5
5
  import { PaymentIcon } from 'react-svg-credit-card-payment-icons';
6
6
  import { useSCPaymentsEnabled, useSCUser } from '@selfcommunity/react-core';
7
7
  import { useThemeProps } from '@mui/system';
8
8
  import { PREFIX } from './constants';
9
9
  import UserPaymentMethodsSkeleton from './Skeleton';
10
- import { FormattedMessage } from 'react-intl';
10
+ import { FormattedMessage, useIntl } from 'react-intl';
11
11
  import { useInView } from 'react-intersection-observer';
12
12
  import { useSnackbar } from 'notistack';
13
13
  import ConfirmDialog from '../../shared/ConfirmDialog/ConfirmDialog';
@@ -45,13 +45,13 @@ const Root = styled(Box, {
45
45
 
46
46
  * @param inProps
47
47
  */
48
- const UserPaymentMethods = (inProps) => {
48
+ const UserPaymentMethods = (inProps, ref) => {
49
49
  // PROPS
50
50
  const props = useThemeProps({
51
51
  props: inProps,
52
52
  name: PREFIX
53
53
  });
54
- const { className = null, showBillingAddress = false } = props;
54
+ const { className = null, showBillingAddress = false } = props, rest = __rest(props, ["className", "showBillingAddress"]);
55
55
  // CONTEXT
56
56
  const scUserContext = useSCUser();
57
57
  // STATE
@@ -70,6 +70,7 @@ const UserPaymentMethods = (inProps) => {
70
70
  const [addPaymentMethodDialogOpen, setAddPaymentMethodDialogOpen] = useState(false);
71
71
  // HOOKS
72
72
  const { isPaymentsEnabled } = useSCPaymentsEnabled();
73
+ const intl = useIntl();
73
74
  const { inView } = useInView({ triggerOnce: false });
74
75
  const { enqueueSnackbar } = useSnackbar();
75
76
  /**
@@ -78,8 +79,8 @@ const UserPaymentMethods = (inProps) => {
78
79
  const loadMore = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
79
80
  // eslint-disable-next-line @typescript-eslint/require-await
80
81
  const loadItems = () => __awaiter(void 0, void 0, void 0, function* () {
81
- /* const startingAfterId = paymentMethods.length ? paymentMethods[paymentMethods.length - 1].id : null;
82
- getAccountCustomerPaymentMethod(startingAfterId).then((res) => {
82
+ const startingAfterId = paymentMethods.length ? paymentMethods[paymentMethods.length - 1].id : null;
83
+ /* getAccountCustomerPaymentMethod(startingAfterId).then((res) => {
83
84
  setHasMore(res.paymentMethods.has_more);
84
85
  setPaymentMethods(paymentMethods.concat(res.paymentMethods.data));
85
86
  setIsLoadingPage(false);
@@ -327,9 +328,9 @@ const UserPaymentMethods = (inProps) => {
327
328
  if (!isPaymentsEnabled || !scUserContext.user) {
328
329
  return null;
329
330
  }
330
- return (_jsx(Root, Object.assign({ className: classes.root }, { children: isLoading ? (_jsx(UserPaymentMethodsSkeleton, {})) : (_jsxs(_Fragment, { children: [_jsxs(Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "baseline" }, { children: [_jsx(Typography, Object.assign({ variant: "h3", className: classes.headline }, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.myPaymentMethods", defaultMessage: "ui.userPaymentMethods.myPaymentMethods" }) })), paymentMethods.length > 0 && (_jsx(Button, Object.assign({ size: "small", variant: "outlined", onClick: handleOpenAddPaymentMethodDialog }, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.btnAdd", defaultMessage: "ui.userPaymentMethods.btnAdd" }) })))] })), paymentMethods.length > 0 ? (_jsx(TableContainer, Object.assign({ style: { margin: 'auto', borderRadius: 0 }, component: Paper }, { children: _jsxs(Table, Object.assign({ sx: { minWidth: 650 }, "aria-label": "simple table", stickyHeader: true }, { children: [_jsx(TableHead, { children: _jsxs(TableRow, { children: [_jsx(TableCell, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.typeMethod", defaultMessage: "ui.userPaymentMethods.typeMethod" }) }), _jsx(TableCell, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.brand", defaultMessage: "ui.userPaymentMethods.brand" }) }), _jsx(TableCell, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.expiration", defaultMessage: "ui.userPaymentMethods.expiration" }) }), showBillingAddress && (_jsx(TableCell, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.billingDetails", defaultMessage: "ui.userPaymentMethods.billingDetails" }) })), _jsx(TableCell, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.default", defaultMessage: "ui.userPaymentMethods.default" }) }), _jsx(TableCell, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.actions", defaultMessage: "ui.userPaymentMethods.actions" }) })] }) }), _jsxs(TableBody, { children: [paymentMethods.map((method, index) => {
331
+ return (_jsx(Root, Object.assign({ className: classes.root }, { children: isLoading ? (_jsx(UserPaymentMethodsSkeleton, {})) : (_jsxs(_Fragment, { children: [_jsxs(Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "baseline" }, { children: [_jsx(Typography, Object.assign({ variant: "h3", className: classes.headline }, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.myPaymentMethods", defaultMessage: "ui.userPaymentMethods.myPaymentMethods" }) })), paymentMethods.length > 0 && (_jsx(Button, Object.assign({ size: "small", variant: 'outlined', onClick: handleOpenAddPaymentMethodDialog }, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.btnAdd", defaultMessage: "ui.userPaymentMethods.btnAdd" }) })))] })), paymentMethods.length > 0 ? (_jsx(TableContainer, Object.assign({ style: { margin: 'auto', borderRadius: 0 }, component: Paper }, { children: _jsxs(Table, Object.assign({ sx: { minWidth: 650 }, "aria-label": "simple table", stickyHeader: true }, { children: [_jsx(TableHead, { children: _jsxs(TableRow, { children: [_jsx(TableCell, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.typeMethod", defaultMessage: "ui.userPaymentMethods.typeMethod" }) }), _jsx(TableCell, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.brand", defaultMessage: "ui.userPaymentMethods.brand" }) }), _jsx(TableCell, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.expiration", defaultMessage: "ui.userPaymentMethods.expiration" }) }), showBillingAddress && (_jsx(TableCell, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.billingDetails", defaultMessage: "ui.userPaymentMethods.billingDetails" }) })), _jsx(TableCell, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.default", defaultMessage: "ui.userPaymentMethods.default" }) }), _jsx(TableCell, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.actions", defaultMessage: "ui.userPaymentMethods.actions" }) })] }) }), _jsxs(TableBody, { children: [paymentMethods.map((method, index) => {
331
332
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
332
- return (_jsxs(TableRow, { children: [_jsx(TableCell, Object.assign({ scope: "row" }, { children: method.type.toUpperCase() })), _jsx(TableCell, Object.assign({ scope: "row" }, { children: method.type === 'card' && (_jsxs(_Fragment, { children: [_jsx(PaymentIcon, { type: ((_a = method.card) === null || _a === void 0 ? void 0 : _a.brand) || 'Generic', format: "flatRounded", width: 50 }), _jsxs(Typography, Object.assign({ className: classes.paymentNumber }, { children: ["**** **** **** ", (_b = method.card) === null || _b === void 0 ? void 0 : _b.last4] }))] })) })), _jsxs(TableCell, Object.assign({ scope: "row" }, { children: [(_c = method.card) === null || _c === void 0 ? void 0 : _c.exp_month, "/", (_d = method.card) === null || _d === void 0 ? void 0 : _d.exp_year] })), showBillingAddress && (_jsx(TableCell, Object.assign({ scope: "row" }, { children: _jsxs(Stack, Object.assign({ direction: "row", justifyContent: "left", alignItems: "center", spacing: 2 }, { children: [_jsxs(Box, { children: [_jsx(Typography, Object.assign({ variant: "body1" }, { children: method.billing_details.name })), _jsxs(Typography, Object.assign({ variant: "body1" }, { children: [(_f = (_e = method.billing_details) === null || _e === void 0 ? void 0 : _e.address) === null || _f === void 0 ? void 0 : _f.line1, _jsx("br", {}), (_h = (_g = method.billing_details) === null || _g === void 0 ? void 0 : _g.address) === null || _h === void 0 ? void 0 : _h.line2] })), _jsxs(Typography, Object.assign({ variant: "body1" }, { children: [(_k = (_j = method.billing_details) === null || _j === void 0 ? void 0 : _j.address) === null || _k === void 0 ? void 0 : _k.postal_code, " - ", (_m = (_l = method.billing_details) === null || _l === void 0 ? void 0 : _l.address) === null || _m === void 0 ? void 0 : _m.city, " -", ' ', (_p = (_o = method.billing_details) === null || _o === void 0 ? void 0 : _o.address) === null || _p === void 0 ? void 0 : _p.country] }))] }), _jsx(IconButton, Object.assign({ "aria-label": "edit", color: "primary", onClick: () => handleOpenEditAddressDialog(method) }, { children: _jsx(Icon, { children: "edit" }) }))] })) }))), _jsx(TableCell, Object.assign({ scope: "row" }, { children: defaultPaymentMethodLoading === method.id ? (_jsx(CircularProgress, { size: 20 })) : (_jsxs(_Fragment, { children: [method.id === defaultPaymentMethodId, _jsx(Checkbox, { checked: method.id === defaultPaymentMethodId, onClick: () => handleSetDefaultPaymentMethodId(method.id) })] })) })), _jsx(TableCell, Object.assign({ scope: "row" }, { children: _jsx(Button, Object.assign({ variant: "contained", onClick: () => handleDelete(method.id) }, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.btnRemove", defaultMessage: "ui.userPaymentMethods.btnRemove" }) })) }))] }, index));
333
- }), hasMore && _jsx(UserPaymentMethodsSkeleton, {})] })] })) }))) : (_jsxs(_Fragment, { children: [_jsx(Typography, Object.assign({ variant: "body2", mb: 2 }, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.noPaymentMethods", defaultMessage: "ui.userPaymentMethods.noPaymentMethods" }) })), _jsx(Button, Object.assign({ size: "small", variant: "contained", onClick: handleOpenAddPaymentMethodDialog }, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.btnAdd", defaultMessage: "ui.userPaymentMethods.btnAdd" }) }))] })), openDeleteDialog && (_jsx(ConfirmDialog, { open: openDeleteDialog, title: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.dialog.confirmDeleteTitle", defaultMessage: "ui.userPaymentMethods.dialog.confirmDeleteTitle" }), btnConfirm: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.dialog.confirmDeleteDescription", defaultMessage: "ui.userPaymentMethods.dialog.confirmDeleteDescription" }), onConfirm: handleConfirmDelete, onClose: handleConfirmClose, isUpdating: isDeletingPaymentMethod })), editPaymentMethodDialogOpen && editPaymentMethod !== null && (_jsx(UserChangeAddressDialog, { open: true, defaultAddress: editPaymentMethod, handleAddress: handleAddress })), addPaymentMethodDialogOpen && _jsx(UserAddPaymentMethodDialog, { open: true, handlePaymentMethod: handlePaymentMethodSuccess })] })) })));
333
+ return (_jsxs(TableRow, { children: [_jsx(TableCell, Object.assign({ scope: "row" }, { children: method.type.toUpperCase() })), _jsx(TableCell, Object.assign({ scope: "row" }, { children: method.type === 'card' && (_jsxs(_Fragment, { children: [_jsx(PaymentIcon, { type: ((_a = method.card) === null || _a === void 0 ? void 0 : _a.brand) || 'Generic', format: "flatRounded", width: 50 }), _jsxs(Typography, Object.assign({ className: classes.paymentNumber }, { children: ["**** **** **** ", (_b = method.card) === null || _b === void 0 ? void 0 : _b.last4] }))] })) })), _jsxs(TableCell, Object.assign({ scope: "row" }, { children: [(_c = method.card) === null || _c === void 0 ? void 0 : _c.exp_month, "/", (_d = method.card) === null || _d === void 0 ? void 0 : _d.exp_year] })), showBillingAddress && (_jsx(TableCell, Object.assign({ scope: "row" }, { children: _jsxs(Stack, Object.assign({ direction: "row", justifyContent: "left", alignItems: "center", spacing: 2 }, { children: [_jsxs(Box, { children: [_jsx(Typography, Object.assign({ variant: 'body1' }, { children: method.billing_details.name })), _jsxs(Typography, Object.assign({ variant: 'body1' }, { children: [(_f = (_e = method.billing_details) === null || _e === void 0 ? void 0 : _e.address) === null || _f === void 0 ? void 0 : _f.line1, _jsx("br", {}), (_h = (_g = method.billing_details) === null || _g === void 0 ? void 0 : _g.address) === null || _h === void 0 ? void 0 : _h.line2] })), _jsxs(Typography, Object.assign({ variant: 'body1' }, { children: [(_k = (_j = method.billing_details) === null || _j === void 0 ? void 0 : _j.address) === null || _k === void 0 ? void 0 : _k.postal_code, " - ", (_m = (_l = method.billing_details) === null || _l === void 0 ? void 0 : _l.address) === null || _m === void 0 ? void 0 : _m.city, " -", ' ', (_p = (_o = method.billing_details) === null || _o === void 0 ? void 0 : _o.address) === null || _p === void 0 ? void 0 : _p.country] }))] }), _jsx(IconButton, Object.assign({ "aria-label": "edit", color: "primary", onClick: () => handleOpenEditAddressDialog(method) }, { children: _jsx(Icon, { children: "edit" }) }))] })) }))), _jsx(TableCell, Object.assign({ scope: "row" }, { children: defaultPaymentMethodLoading === method.id ? (_jsx(CircularProgress, { size: 20 })) : (_jsxs(_Fragment, { children: [method.id === defaultPaymentMethodId, _jsx(Checkbox, { checked: method.id === defaultPaymentMethodId, onClick: () => handleSetDefaultPaymentMethodId(method.id) })] })) })), _jsx(TableCell, Object.assign({ scope: "row" }, { children: _jsx(Button, Object.assign({ variant: 'contained', onClick: () => handleDelete(method.id) }, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.btnRemove", defaultMessage: "ui.userPaymentMethods.btnRemove" }) })) }))] }, index));
334
+ }), hasMore && _jsx(UserPaymentMethodsSkeleton, {})] })] })) }))) : (_jsxs(_Fragment, { children: [_jsx(Typography, Object.assign({ variant: "body2", mb: 2 }, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.noPaymentMethods", defaultMessage: "ui.userPaymentMethods.noPaymentMethods" }) })), _jsx(Button, Object.assign({ size: "small", variant: 'contained', onClick: handleOpenAddPaymentMethodDialog }, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.btnAdd", defaultMessage: "ui.userPaymentMethods.btnAdd" }) }))] })), openDeleteDialog && (_jsx(ConfirmDialog, { open: openDeleteDialog, title: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.dialog.confirmDeleteTitle", defaultMessage: "ui.userPaymentMethods.dialog.confirmDeleteTitle" }), btnConfirm: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.dialog.confirmDeleteDescription", defaultMessage: "ui.userPaymentMethods.dialog.confirmDeleteDescription" }), onConfirm: handleConfirmDelete, onClose: handleConfirmClose, isUpdating: isDeletingPaymentMethod })), editPaymentMethodDialogOpen && editPaymentMethod !== null && (_jsx(UserChangeAddressDialog, { open: true, defaultAddress: editPaymentMethod, handleAddress: handleAddress })), addPaymentMethodDialogOpen && _jsx(UserAddPaymentMethodDialog, { open: true, handlePaymentMethod: handlePaymentMethodSuccess })] })) })));
334
335
  };
335
- export default UserPaymentMethods;
336
+ export default forwardRef(UserPaymentMethods);
@@ -1,11 +1,12 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useMemo } from 'react';
4
- import { Box, Button, Divider, Typography, styled } from '@mui/material';
4
+ import { Box, Divider, Typography, styled } from '@mui/material';
5
5
  import { FormattedMessage } from 'react-intl';
6
6
  import { useSCFetchUser, useSCFetchUserBlockedBy, useSCUser } from '@selfcommunity/react-core';
7
7
  import classNames from 'classnames';
8
8
  import { useThemeProps } from '@mui/system';
9
+ import { LoadingButton } from '@mui/lab';
9
10
  import { useSnackbar } from 'notistack';
10
11
  import { SCOPE_SC_UI } from '../../constants/Errors';
11
12
  import { Logger } from '@selfcommunity/utils';
@@ -76,5 +77,5 @@ export default function UserProfileBlocked(inProps) {
76
77
  if (!scUser || !scUserContext.user || loadingBlockedBy) {
77
78
  return null;
78
79
  }
79
- return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: [_jsx(Divider, {}), !isMe && blockedBy && (_jsx(Typography, Object.assign({ variant: "body1", className: classes.info }, { children: _jsx(FormattedMessage, { id: "ui.userProfileBlocked.blockedUserBy", defaultMessage: "ui.userProfileBlocked.blockedUserBy" }) }))), !isMe && scUserContext.managers.blockedUsers.isBlocked(scUser) && (_jsxs(_Fragment, { children: [_jsx(Typography, Object.assign({ variant: "body1", className: classes.info }, { children: _jsx(FormattedMessage, { id: "ui.userProfileBlocked.blockedUser", defaultMessage: "ui.userProfileBlocked.blockedUser" }) })), _jsx(Button, Object.assign({ variant: "contained", className: classes.button, loading: scUserContext.managers.blockedUsers.loading, disabled: scUserContext.managers.blockedUsers.loading, onClick: handleBlock }, { children: _jsx(FormattedMessage, { id: "ui.userProfileBlocked.unBlockUser", defaultMessage: "ui.userProfileBlocked.unBlockUser" }) }))] }))] })));
80
+ return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: [_jsx(Divider, {}), !isMe && blockedBy && (_jsx(Typography, Object.assign({ variant: "body1", className: classes.info }, { children: _jsx(FormattedMessage, { id: "ui.userProfileBlocked.blockedUserBy", defaultMessage: "ui.userProfileBlocked.blockedUserBy" }) }))), !isMe && scUserContext.managers.blockedUsers.isBlocked(scUser) && (_jsxs(_Fragment, { children: [_jsx(Typography, Object.assign({ variant: "body1", className: classes.info }, { children: _jsx(FormattedMessage, { id: "ui.userProfileBlocked.blockedUser", defaultMessage: "ui.userProfileBlocked.blockedUser" }) })), _jsx(LoadingButton, Object.assign({ variant: "contained", className: classes.button, loading: scUserContext.managers.blockedUsers.loading, disabled: scUserContext.managers.blockedUsers.loading, onClick: handleBlock }, { children: _jsx(FormattedMessage, { id: "ui.userProfileBlocked.unBlockUser", defaultMessage: "ui.userProfileBlocked.unBlockUser" }) }))] }))] })));
80
81
  }