@greatapps/common 1.1.790 → 1.1.792

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 (791) hide show
  1. package/dist/components/account/AccountHubLinkHandler.mjs +36 -0
  2. package/dist/components/account/AccountHubLinkHandler.mjs.map +1 -0
  3. package/dist/components/account/AccountModalLayout.mjs +137 -0
  4. package/dist/components/account/AccountModalLayout.mjs.map +1 -0
  5. package/dist/components/account/AccountModals.mjs +10 -3
  6. package/dist/components/account/AccountModals.mjs.map +1 -1
  7. package/dist/components/account/AccountUnsavedChangesDialog.mjs +34 -0
  8. package/dist/components/account/AccountUnsavedChangesDialog.mjs.map +1 -0
  9. package/dist/components/account/DeleteAccountModal.mjs +1 -1
  10. package/dist/components/account/DeleteAccountModal.mjs.map +1 -1
  11. package/dist/components/account/IsntPossibleDeleteAccountModal.mjs +8 -1
  12. package/dist/components/account/IsntPossibleDeleteAccountModal.mjs.map +1 -1
  13. package/dist/components/account/MyAccountModal.mjs +173 -0
  14. package/dist/components/account/MyAccountModal.mjs.map +1 -0
  15. package/dist/components/account/TwoFactorAuthModal.mjs +1 -1
  16. package/dist/components/account/TwoFactorAuthModal.mjs.map +1 -1
  17. package/dist/components/account/hooks/useAccountHubActions.mjs +85 -0
  18. package/dist/components/account/hooks/useAccountHubActions.mjs.map +1 -0
  19. package/dist/components/account/hooks/useAddCardWithPaymentSwitch.mjs +44 -0
  20. package/dist/components/account/hooks/useAddCardWithPaymentSwitch.mjs.map +1 -0
  21. package/dist/components/account/hooks/useAffiliatesActions.mjs +69 -0
  22. package/dist/components/account/hooks/useAffiliatesActions.mjs.map +1 -0
  23. package/dist/components/account/hooks/useMyAccountModal.mjs +27 -0
  24. package/dist/components/account/hooks/useMyAccountModal.mjs.map +1 -0
  25. package/dist/components/account/hooks/useProjectsActions.mjs +40 -0
  26. package/dist/components/account/hooks/useProjectsActions.mjs.map +1 -0
  27. package/dist/components/account/hooks/useSubscriptionActions.mjs +87 -0
  28. package/dist/components/account/hooks/useSubscriptionActions.mjs.map +1 -0
  29. package/dist/components/account/hooks/useTeamActions.mjs +31 -0
  30. package/dist/components/account/hooks/useTeamActions.mjs.map +1 -0
  31. package/dist/components/account/sections/AffiliatesSection.mjs +313 -0
  32. package/dist/components/account/sections/AffiliatesSection.mjs.map +1 -0
  33. package/dist/components/account/sections/ChangePasswordSection.mjs +5 -5
  34. package/dist/components/account/sections/ChangePasswordSection.mjs.map +1 -1
  35. package/dist/components/account/sections/MyProfileSection.mjs +212 -164
  36. package/dist/components/account/sections/MyProfileSection.mjs.map +1 -1
  37. package/dist/components/account/sections/PreferencesSection.mjs +74 -68
  38. package/dist/components/account/sections/PreferencesSection.mjs.map +1 -1
  39. package/dist/components/account/sections/ProjectsSection.mjs +77 -0
  40. package/dist/components/account/sections/ProjectsSection.mjs.map +1 -0
  41. package/dist/components/account/sections/SecuritySection.mjs +55 -36
  42. package/dist/components/account/sections/SecuritySection.mjs.map +1 -1
  43. package/dist/components/account/sections/SubscriptionSection.mjs +29 -0
  44. package/dist/components/account/sections/SubscriptionSection.mjs.map +1 -0
  45. package/dist/components/account/sections/TeamSection.mjs +119 -0
  46. package/dist/components/account/sections/TeamSection.mjs.map +1 -0
  47. package/dist/components/account/sections/TokenSection.mjs +41 -43
  48. package/dist/components/account/sections/TokenSection.mjs.map +1 -1
  49. package/dist/components/account/sections/affiliates/AffiliateCommissionCard.mjs +73 -0
  50. package/dist/components/account/sections/affiliates/AffiliateCommissionCard.mjs.map +1 -0
  51. package/dist/components/account/sections/affiliates/AffiliateFlows.mjs +20 -0
  52. package/dist/components/account/sections/affiliates/AffiliateFlows.mjs.map +1 -0
  53. package/dist/components/account/sections/affiliates/AffiliateLeadsSheet.mjs +99 -0
  54. package/dist/components/account/sections/affiliates/AffiliateLeadsSheet.mjs.map +1 -0
  55. package/dist/components/account/sections/affiliates/AffiliateStatsCard.mjs +31 -0
  56. package/dist/components/account/sections/affiliates/AffiliateStatsCard.mjs.map +1 -0
  57. package/dist/components/account/sections/affiliates/AffiliateStepCard.mjs +15 -0
  58. package/dist/components/account/sections/affiliates/AffiliateStepCard.mjs.map +1 -0
  59. package/dist/components/account/sections/affiliates/AffiliateTransactionsList.mjs +108 -0
  60. package/dist/components/account/sections/affiliates/AffiliateTransactionsList.mjs.map +1 -0
  61. package/dist/components/account/sections/affiliates/NoReceivingAccountModal.mjs +49 -0
  62. package/dist/components/account/sections/affiliates/NoReceivingAccountModal.mjs.map +1 -0
  63. package/dist/components/account/sections/affiliates/ReceivingAccountModal.mjs +182 -0
  64. package/dist/components/account/sections/affiliates/ReceivingAccountModal.mjs.map +1 -0
  65. package/dist/components/account/sections/affiliates/RequestWithdrawalSheet.mjs +476 -0
  66. package/dist/components/account/sections/affiliates/RequestWithdrawalSheet.mjs.map +1 -0
  67. package/dist/components/account/sections/affiliates/ViewAttachmentModal.mjs +34 -0
  68. package/dist/components/account/sections/affiliates/ViewAttachmentModal.mjs.map +1 -0
  69. package/dist/components/account/sections/affiliates/reports/AffiliatesIndicatorsChart.mjs +27 -0
  70. package/dist/components/account/sections/affiliates/reports/AffiliatesIndicatorsChart.mjs.map +1 -0
  71. package/dist/components/account/sections/affiliates/reports/AffiliatesReportsTab.mjs +30 -0
  72. package/dist/components/account/sections/affiliates/reports/AffiliatesReportsTab.mjs.map +1 -0
  73. package/dist/components/account/sections/affiliates/reports/useAffiliatesIndicatorsChart.mjs +120 -0
  74. package/dist/components/account/sections/affiliates/reports/useAffiliatesIndicatorsChart.mjs.map +1 -0
  75. package/dist/components/account/sections/projects/DeleteProjectModal.mjs +205 -0
  76. package/dist/components/account/sections/projects/DeleteProjectModal.mjs.map +1 -0
  77. package/dist/components/account/sections/projects/ProjectFlows.mjs +16 -0
  78. package/dist/components/account/sections/projects/ProjectFlows.mjs.map +1 -0
  79. package/dist/components/account/sections/projects/ProjectMembersStack.mjs +53 -0
  80. package/dist/components/account/sections/projects/ProjectMembersStack.mjs.map +1 -0
  81. package/dist/components/account/sections/projects/ProjectRow.mjs +85 -0
  82. package/dist/components/account/sections/projects/ProjectRow.mjs.map +1 -0
  83. package/dist/components/account/sections/projects/ProjectSheet.mjs +499 -0
  84. package/dist/components/account/sections/projects/ProjectSheet.mjs.map +1 -0
  85. package/dist/components/account/sections/projects/ProjectsDisabledModal.mjs +55 -0
  86. package/dist/components/account/sections/projects/ProjectsDisabledModal.mjs.map +1 -0
  87. package/dist/components/account/sections/projects/project-form.schema.mjs +28 -0
  88. package/dist/components/account/sections/projects/project-form.schema.mjs.map +1 -0
  89. package/dist/components/account/sections/shared/ConnectListRow.mjs +45 -0
  90. package/dist/components/account/sections/shared/ConnectListRow.mjs.map +1 -0
  91. package/dist/components/account/sections/shared/DateFilterPopover.mjs +51 -0
  92. package/dist/components/account/sections/shared/DateFilterPopover.mjs.map +1 -0
  93. package/dist/components/account/sections/shared/EntityAvatar.mjs +41 -0
  94. package/dist/components/account/sections/shared/EntityAvatar.mjs.map +1 -0
  95. package/dist/components/account/sections/shared/FilterPopover.mjs +62 -0
  96. package/dist/components/account/sections/shared/FilterPopover.mjs.map +1 -0
  97. package/dist/components/account/sections/shared/FormSection.mjs +14 -0
  98. package/dist/components/account/sections/shared/FormSection.mjs.map +1 -0
  99. package/dist/components/account/sections/shared/IconBox.mjs +18 -0
  100. package/dist/components/account/sections/shared/IconBox.mjs.map +1 -0
  101. package/dist/components/account/sections/shared/InfiniteScrollList.mjs +36 -0
  102. package/dist/components/account/sections/shared/InfiniteScrollList.mjs.map +1 -0
  103. package/dist/components/account/sections/shared/ListPagination.mjs +69 -0
  104. package/dist/components/account/sections/shared/ListPagination.mjs.map +1 -0
  105. package/dist/components/account/sections/shared/RowActionsMenu.mjs +52 -0
  106. package/dist/components/account/sections/shared/RowActionsMenu.mjs.map +1 -0
  107. package/dist/components/account/sections/shared/SectionLoadError.mjs +20 -0
  108. package/dist/components/account/sections/shared/SectionLoadError.mjs.map +1 -0
  109. package/dist/components/account/sections/shared/StatusBadge.mjs +26 -0
  110. package/dist/components/account/sections/shared/StatusBadge.mjs.map +1 -0
  111. package/dist/components/account/sections/shared/WorkspaceSection.mjs +10 -0
  112. package/dist/components/account/sections/shared/WorkspaceSection.mjs.map +1 -0
  113. package/dist/components/account/sections/subscription/AiCreditsUsage.mjs +106 -0
  114. package/dist/components/account/sections/subscription/AiCreditsUsage.mjs.map +1 -0
  115. package/dist/components/account/sections/subscription/BillingAddressSheet.mjs +407 -0
  116. package/dist/components/account/sections/subscription/BillingAddressSheet.mjs.map +1 -0
  117. package/dist/components/account/sections/subscription/BoletoDetailsDialog.mjs +73 -0
  118. package/dist/components/account/sections/subscription/BoletoDetailsDialog.mjs.map +1 -0
  119. package/dist/components/account/sections/subscription/BoletoGeneratedDialog.mjs +22 -0
  120. package/dist/components/account/sections/subscription/BoletoGeneratedDialog.mjs.map +1 -0
  121. package/dist/components/account/sections/subscription/CancelPlanDialog.mjs +161 -0
  122. package/dist/components/account/sections/subscription/CancelPlanDialog.mjs.map +1 -0
  123. package/dist/components/account/sections/subscription/ChargeRow.mjs +127 -0
  124. package/dist/components/account/sections/subscription/ChargeRow.mjs.map +1 -0
  125. package/dist/components/account/sections/subscription/ChargeStatusBadge.mjs +27 -0
  126. package/dist/components/account/sections/subscription/ChargeStatusBadge.mjs.map +1 -0
  127. package/dist/components/account/sections/subscription/ChargesList.mjs +88 -0
  128. package/dist/components/account/sections/subscription/ChargesList.mjs.map +1 -0
  129. package/dist/components/account/sections/subscription/ManageCardsSheet.mjs +49 -0
  130. package/dist/components/account/sections/subscription/ManageCardsSheet.mjs.map +1 -0
  131. package/dist/components/account/sections/subscription/OverdueReceiptOpener.mjs +26 -0
  132. package/dist/components/account/sections/subscription/OverdueReceiptOpener.mjs.map +1 -0
  133. package/dist/components/account/sections/subscription/PayChargeDialog.mjs +222 -0
  134. package/dist/components/account/sections/subscription/PayChargeDialog.mjs.map +1 -0
  135. package/dist/components/account/sections/subscription/PaymentConfirmationDialog.mjs +61 -0
  136. package/dist/components/account/sections/subscription/PaymentConfirmationDialog.mjs.map +1 -0
  137. package/dist/components/account/sections/subscription/PaymentMethodsCard.mjs +72 -0
  138. package/dist/components/account/sections/subscription/PaymentMethodsCard.mjs.map +1 -0
  139. package/dist/components/account/sections/subscription/PendingChangeDialog.mjs +117 -0
  140. package/dist/components/account/sections/subscription/PendingChangeDialog.mjs.map +1 -0
  141. package/dist/components/account/sections/subscription/PixDetailsDialog.mjs +165 -0
  142. package/dist/components/account/sections/subscription/PixDetailsDialog.mjs.map +1 -0
  143. package/dist/components/account/sections/subscription/PixPaymentDialog.mjs +155 -0
  144. package/dist/components/account/sections/subscription/PixPaymentDialog.mjs.map +1 -0
  145. package/dist/components/account/sections/subscription/PlanDetailsSheet.mjs +253 -0
  146. package/dist/components/account/sections/subscription/PlanDetailsSheet.mjs.map +1 -0
  147. package/dist/components/account/sections/subscription/ReceiptDetailsSheet.mjs +237 -0
  148. package/dist/components/account/sections/subscription/ReceiptDetailsSheet.mjs.map +1 -0
  149. package/dist/components/account/sections/subscription/SubscriptionFlows.mjs +40 -0
  150. package/dist/components/account/sections/subscription/SubscriptionFlows.mjs.map +1 -0
  151. package/dist/components/account/sections/subscription/SubscriptionPlanCard.mjs +303 -0
  152. package/dist/components/account/sections/subscription/SubscriptionPlanCard.mjs.map +1 -0
  153. package/dist/components/account/sections/subscription/UsageReportSheet.mjs +163 -0
  154. package/dist/components/account/sections/subscription/UsageReportSheet.mjs.map +1 -0
  155. package/dist/components/account/sections/subscription/change-plan/ChangePlanSheet.mjs +75 -0
  156. package/dist/components/account/sections/subscription/change-plan/ChangePlanSheet.mjs.map +1 -0
  157. package/dist/components/account/sections/subscription/change-plan/components/AbTestDetailsDialog.mjs +55 -0
  158. package/dist/components/account/sections/subscription/change-plan/components/AbTestDetailsDialog.mjs.map +1 -0
  159. package/dist/components/account/sections/subscription/change-plan/components/AddonsBlock.mjs +188 -0
  160. package/dist/components/account/sections/subscription/change-plan/components/AddonsBlock.mjs.map +1 -0
  161. package/dist/components/account/sections/subscription/change-plan/components/AlternativeBucketsSection.mjs +66 -0
  162. package/dist/components/account/sections/subscription/change-plan/components/AlternativeBucketsSection.mjs.map +1 -0
  163. package/dist/components/account/sections/subscription/change-plan/components/CouponBlock.mjs +42 -0
  164. package/dist/components/account/sections/subscription/change-plan/components/CouponBlock.mjs.map +1 -0
  165. package/dist/components/account/sections/subscription/change-plan/components/CouponDialog.mjs +119 -0
  166. package/dist/components/account/sections/subscription/change-plan/components/CouponDialog.mjs.map +1 -0
  167. package/dist/components/account/sections/subscription/change-plan/components/PricePreview.mjs +17 -0
  168. package/dist/components/account/sections/subscription/change-plan/components/PricePreview.mjs.map +1 -0
  169. package/dist/components/account/sections/subscription/change-plan/components/SummaryBlock.mjs +130 -0
  170. package/dist/components/account/sections/subscription/change-plan/components/SummaryBlock.mjs.map +1 -0
  171. package/dist/components/account/sections/subscription/change-plan/plan-comparison.mjs +38 -0
  172. package/dist/components/account/sections/subscription/change-plan/plan-comparison.mjs.map +1 -0
  173. package/dist/components/account/sections/subscription/change-plan/steps/PaymentSummaryStep.mjs +127 -0
  174. package/dist/components/account/sections/subscription/change-plan/steps/PaymentSummaryStep.mjs.map +1 -0
  175. package/dist/components/account/sections/subscription/change-plan/steps/PlanComparisonStep.mjs +111 -0
  176. package/dist/components/account/sections/subscription/change-plan/steps/PlanComparisonStep.mjs.map +1 -0
  177. package/dist/components/account/sections/subscription/change-plan/steps/PlanViewStep.mjs +69 -0
  178. package/dist/components/account/sections/subscription/change-plan/steps/PlanViewStep.mjs.map +1 -0
  179. package/dist/components/account/sections/subscription/change-plan/steps/ReactivationConfigStep.mjs +88 -0
  180. package/dist/components/account/sections/subscription/change-plan/steps/ReactivationConfigStep.mjs.map +1 -0
  181. package/dist/components/account/sections/subscription/change-plan/steps/ReactivationPaymentStep.mjs +115 -0
  182. package/dist/components/account/sections/subscription/change-plan/steps/ReactivationPaymentStep.mjs.map +1 -0
  183. package/dist/components/account/sections/subscription/change-plan/useChangePlanState.mjs +918 -0
  184. package/dist/components/account/sections/subscription/change-plan/useChangePlanState.mjs.map +1 -0
  185. package/dist/components/account/sections/subscription/downgrade/CannotDowngradeDialog.mjs +216 -0
  186. package/dist/components/account/sections/subscription/downgrade/CannotDowngradeDialog.mjs.map +1 -0
  187. package/dist/components/account/sections/subscription/downgrade/DowngradeReasonDialog.mjs +128 -0
  188. package/dist/components/account/sections/subscription/downgrade/DowngradeReasonDialog.mjs.map +1 -0
  189. package/dist/components/account/sections/subscription/plans/PlanCard.mjs +281 -0
  190. package/dist/components/account/sections/subscription/plans/PlanCard.mjs.map +1 -0
  191. package/dist/components/account/sections/subscription/plans/PlanCardSkeleton.mjs +53 -0
  192. package/dist/components/account/sections/subscription/plans/PlanCardSkeleton.mjs.map +1 -0
  193. package/dist/components/account/sections/subscription/plans/PlansCatalogDialog.mjs +119 -0
  194. package/dist/components/account/sections/subscription/plans/PlansCatalogDialog.mjs.map +1 -0
  195. package/dist/components/account/sections/team/DeleteUserModal.mjs +116 -0
  196. package/dist/components/account/sections/team/DeleteUserModal.mjs.map +1 -0
  197. package/dist/components/account/sections/team/TeamFlows.mjs +14 -0
  198. package/dist/components/account/sections/team/TeamFlows.mjs.map +1 -0
  199. package/dist/components/account/sections/team/TeamMemberRow.mjs +99 -0
  200. package/dist/components/account/sections/team/TeamMemberRow.mjs.map +1 -0
  201. package/dist/components/account/sections/team/UserSheet.mjs +570 -0
  202. package/dist/components/account/sections/team/UserSheet.mjs.map +1 -0
  203. package/dist/components/account/sections/team/steps/NotificationsStep.mjs +80 -0
  204. package/dist/components/account/sections/team/steps/NotificationsStep.mjs.map +1 -0
  205. package/dist/components/account/sections/team/steps/ProjectSelectionStep.mjs +180 -0
  206. package/dist/components/account/sections/team/steps/ProjectSelectionStep.mjs.map +1 -0
  207. package/dist/components/account/sections/team/steps/UserInformationStep.mjs +371 -0
  208. package/dist/components/account/sections/team/steps/UserInformationStep.mjs.map +1 -0
  209. package/dist/components/account/sections/team/user-form.schema.mjs +37 -0
  210. package/dist/components/account/sections/team/user-form.schema.mjs.map +1 -0
  211. package/dist/components/account/types/workspace-actions.type.mjs +1 -0
  212. package/dist/components/account/types/workspace-actions.type.mjs.map +1 -0
  213. package/dist/components/layouts/ProfilePopover.mjs +10 -12
  214. package/dist/components/layouts/ProfilePopover.mjs.map +1 -1
  215. package/dist/components/layouts/UsersSelectorPopover.mjs +7 -4
  216. package/dist/components/layouts/UsersSelectorPopover.mjs.map +1 -1
  217. package/dist/components/modals/AccountDeletionWarningModal.mjs +4 -5
  218. package/dist/components/modals/AccountDeletionWarningModal.mjs.map +1 -1
  219. package/dist/components/modals/AccountFrozenModal.mjs +6 -3
  220. package/dist/components/modals/AccountFrozenModal.mjs.map +1 -1
  221. package/dist/components/modals/Modals.mjs +3 -3
  222. package/dist/components/modals/Modals.mjs.map +1 -1
  223. package/dist/components/modals/PaidPlanRequiredModal.mjs +4 -5
  224. package/dist/components/modals/PaidPlanRequiredModal.mjs.map +1 -1
  225. package/dist/components/modals/cards/AddFirstCardWarningModal.mjs +63 -0
  226. package/dist/components/modals/cards/AddFirstCardWarningModal.mjs.map +1 -0
  227. package/dist/components/modals/cards/SwitchPaymentToCardModal.mjs +187 -0
  228. package/dist/components/modals/cards/SwitchPaymentToCardModal.mjs.map +1 -0
  229. package/dist/components/modals/promo/AiCreditsOfferModal/AiCreditsOfferModal.mjs +5 -4
  230. package/dist/components/modals/promo/AiCreditsOfferModal/AiCreditsOfferModal.mjs.map +1 -1
  231. package/dist/components/ui/data-display/CardItem.mjs +9 -1
  232. package/dist/components/ui/data-display/CardItem.mjs.map +1 -1
  233. package/dist/components/ui/data-display/PaymentMethodIcons.mjs +50 -0
  234. package/dist/components/ui/data-display/PaymentMethodIcons.mjs.map +1 -0
  235. package/dist/components/ui/form/BillingPeriodSelector.mjs +108 -0
  236. package/dist/components/ui/form/BillingPeriodSelector.mjs.map +1 -0
  237. package/dist/components/ui/form/PaymentMethodToggle.mjs +82 -0
  238. package/dist/components/ui/form/PaymentMethodToggle.mjs.map +1 -0
  239. package/dist/components/ui/form/RadioOptionFieldIcon.mjs +57 -0
  240. package/dist/components/ui/form/RadioOptionFieldIcon.mjs.map +1 -0
  241. package/dist/components/ui/form/SegmentedControl.mjs +56 -0
  242. package/dist/components/ui/form/SegmentedControl.mjs.map +1 -0
  243. package/dist/components/ui/overlay/Dialog.mjs +21 -4
  244. package/dist/components/ui/overlay/Dialog.mjs.map +1 -1
  245. package/dist/components/ui/overlay/Sheet.mjs +26 -8
  246. package/dist/components/ui/overlay/Sheet.mjs.map +1 -1
  247. package/dist/components/ui/overlay/layers.mjs +52 -5
  248. package/dist/components/ui/overlay/layers.mjs.map +1 -1
  249. package/dist/enums/AccountHubFlow.mjs +13 -0
  250. package/dist/enums/AccountHubFlow.mjs.map +1 -0
  251. package/dist/enums/DateFilterPeriod.mjs +22 -0
  252. package/dist/enums/DateFilterPeriod.mjs.map +1 -0
  253. package/dist/enums/WorkspaceSectionType.mjs +11 -0
  254. package/dist/enums/WorkspaceSectionType.mjs.map +1 -0
  255. package/dist/handlers.mjs +24 -0
  256. package/dist/handlers.mjs.map +1 -1
  257. package/dist/hooks/useDebounce.mjs +5 -3
  258. package/dist/hooks/useDebounce.mjs.map +1 -1
  259. package/dist/hooks/useUploadProgress.mjs +33 -0
  260. package/dist/hooks/useUploadProgress.mjs.map +1 -0
  261. package/dist/i18n/messages/en-us.mjs +868 -3
  262. package/dist/i18n/messages/en-us.mjs.map +1 -1
  263. package/dist/i18n/messages/es-es.mjs +868 -3
  264. package/dist/i18n/messages/es-es.mjs.map +1 -1
  265. package/dist/i18n/messages/pt-br.mjs +868 -3
  266. package/dist/i18n/messages/pt-br.mjs.map +1 -1
  267. package/dist/index.mjs +87 -7
  268. package/dist/index.mjs.map +1 -1
  269. package/dist/infra/http/paged.mjs +20 -0
  270. package/dist/infra/http/paged.mjs.map +1 -0
  271. package/dist/middleware.mjs +2 -0
  272. package/dist/middleware.mjs.map +1 -1
  273. package/dist/middlewares/create-auth-middleware.mjs +2 -4
  274. package/dist/middlewares/create-auth-middleware.mjs.map +1 -1
  275. package/dist/middlewares/create-legacy-account-routes-middleware.mjs +44 -0
  276. package/dist/middlewares/create-legacy-account-routes-middleware.mjs.map +1 -0
  277. package/dist/middlewares/is-route-equals.mjs +7 -0
  278. package/dist/middlewares/is-route-equals.mjs.map +1 -0
  279. package/dist/modules/accounts/actions/account-management.action.mjs +20 -1
  280. package/dist/modules/accounts/actions/account-management.action.mjs.map +1 -1
  281. package/dist/modules/accounts/constants/account-hub-link.constants.mjs +9 -0
  282. package/dist/modules/accounts/constants/account-hub-link.constants.mjs.map +1 -0
  283. package/dist/modules/accounts/constants/legacy-account-routes.constants.mjs +5 -0
  284. package/dist/modules/accounts/constants/legacy-account-routes.constants.mjs.map +1 -0
  285. package/dist/modules/accounts/handlers/list-account-members.handler.mjs +22 -0
  286. package/dist/modules/accounts/handlers/list-account-members.handler.mjs.map +1 -0
  287. package/dist/modules/accounts/hooks/add-user-projects.hook.mjs +51 -0
  288. package/dist/modules/accounts/hooks/add-user-projects.hook.mjs.map +1 -0
  289. package/dist/modules/accounts/hooks/create-account-user.hook.mjs +20 -0
  290. package/dist/modules/accounts/hooks/create-account-user.hook.mjs.map +1 -0
  291. package/dist/modules/accounts/hooks/remove-user-projects.hook.mjs +47 -0
  292. package/dist/modules/accounts/hooks/remove-user-projects.hook.mjs.map +1 -0
  293. package/dist/modules/accounts/hooks/use-account-members.hook.mjs +20 -0
  294. package/dist/modules/accounts/hooks/use-account-members.hook.mjs.map +1 -0
  295. package/dist/modules/accounts/services/account.service.mjs +59 -0
  296. package/dist/modules/accounts/services/account.service.mjs.map +1 -1
  297. package/dist/modules/accounts/types/account-hub-link.type.mjs +1 -0
  298. package/dist/modules/accounts/types/account-hub-link.type.mjs.map +1 -0
  299. package/dist/modules/accounts/utils/build-account-hub-url.mjs +16 -0
  300. package/dist/modules/accounts/utils/build-account-hub-url.mjs.map +1 -0
  301. package/dist/modules/accounts/utils/is-account-hub-flow.mjs +9 -0
  302. package/dist/modules/accounts/utils/is-account-hub-flow.mjs.map +1 -0
  303. package/dist/modules/accounts/utils/is-account-section.mjs +9 -0
  304. package/dist/modules/accounts/utils/is-account-section.mjs.map +1 -0
  305. package/dist/modules/accounts/utils/is-my-account-section.mjs +13 -0
  306. package/dist/modules/accounts/utils/is-my-account-section.mjs.map +1 -0
  307. package/dist/modules/accounts/utils/map-legacy-account-route.mjs +93 -0
  308. package/dist/modules/accounts/utils/map-legacy-account-route.mjs.map +1 -0
  309. package/dist/modules/accounts/utils/parse-account-hub-link.mjs +20 -0
  310. package/dist/modules/accounts/utils/parse-account-hub-link.mjs.map +1 -0
  311. package/dist/modules/affiliates/actions/ensure-affiliate.action.mjs +10 -0
  312. package/dist/modules/affiliates/actions/ensure-affiliate.action.mjs.map +1 -0
  313. package/dist/modules/affiliates/actions/request-deposit.action.mjs +10 -0
  314. package/dist/modules/affiliates/actions/request-deposit.action.mjs.map +1 -0
  315. package/dist/modules/affiliates/actions/update-affiliate.action.mjs +10 -0
  316. package/dist/modules/affiliates/actions/update-affiliate.action.mjs.map +1 -0
  317. package/dist/modules/affiliates/constants/affiliate.constants.mjs +11 -0
  318. package/dist/modules/affiliates/constants/affiliate.constants.mjs.map +1 -0
  319. package/dist/modules/affiliates/constants/query-keys.constants.mjs +15 -0
  320. package/dist/modules/affiliates/constants/query-keys.constants.mjs.map +1 -0
  321. package/dist/modules/affiliates/handlers/affiliate-report-analytics.handler.mjs +16 -0
  322. package/dist/modules/affiliates/handlers/affiliate-report-analytics.handler.mjs.map +1 -0
  323. package/dist/modules/affiliates/handlers/affiliate-withdrawal-limits.handler.mjs +12 -0
  324. package/dist/modules/affiliates/handlers/affiliate-withdrawal-limits.handler.mjs.map +1 -0
  325. package/dist/modules/affiliates/handlers/current-affiliate.handler.mjs +12 -0
  326. package/dist/modules/affiliates/handlers/current-affiliate.handler.mjs.map +1 -0
  327. package/dist/modules/affiliates/handlers/list-affiliate-coupons.handler.mjs +12 -0
  328. package/dist/modules/affiliates/handlers/list-affiliate-coupons.handler.mjs.map +1 -0
  329. package/dist/modules/affiliates/handlers/list-affiliate-leads.handler.mjs +22 -0
  330. package/dist/modules/affiliates/handlers/list-affiliate-leads.handler.mjs.map +1 -0
  331. package/dist/modules/affiliates/handlers/list-affiliate-transactions.handler.mjs +22 -0
  332. package/dist/modules/affiliates/handlers/list-affiliate-transactions.handler.mjs.map +1 -0
  333. package/dist/modules/affiliates/hooks/use-affiliate-coupons.hook.mjs +17 -0
  334. package/dist/modules/affiliates/hooks/use-affiliate-coupons.hook.mjs.map +1 -0
  335. package/dist/modules/affiliates/hooks/use-affiliate-leads.hook.mjs +22 -0
  336. package/dist/modules/affiliates/hooks/use-affiliate-leads.hook.mjs.map +1 -0
  337. package/dist/modules/affiliates/hooks/use-affiliate-report-analytics.hook.mjs +17 -0
  338. package/dist/modules/affiliates/hooks/use-affiliate-report-analytics.hook.mjs.map +1 -0
  339. package/dist/modules/affiliates/hooks/use-affiliate-transactions.hook.mjs +20 -0
  340. package/dist/modules/affiliates/hooks/use-affiliate-transactions.hook.mjs.map +1 -0
  341. package/dist/modules/affiliates/hooks/use-current-affiliate.hook.mjs +17 -0
  342. package/dist/modules/affiliates/hooks/use-current-affiliate.hook.mjs.map +1 -0
  343. package/dist/modules/affiliates/hooks/use-ensure-affiliate.hook.mjs +23 -0
  344. package/dist/modules/affiliates/hooks/use-ensure-affiliate.hook.mjs.map +1 -0
  345. package/dist/modules/affiliates/hooks/use-request-deposit.hook.mjs +28 -0
  346. package/dist/modules/affiliates/hooks/use-request-deposit.hook.mjs.map +1 -0
  347. package/dist/modules/affiliates/hooks/use-update-affiliate.hook.mjs +22 -0
  348. package/dist/modules/affiliates/hooks/use-update-affiliate.hook.mjs.map +1 -0
  349. package/dist/modules/affiliates/hooks/use-withdrawal-limits.hook.mjs +17 -0
  350. package/dist/modules/affiliates/hooks/use-withdrawal-limits.hook.mjs.map +1 -0
  351. package/dist/modules/affiliates/services/affiliates.service.mjs +183 -0
  352. package/dist/modules/affiliates/services/affiliates.service.mjs.map +1 -0
  353. package/dist/modules/affiliates/types/affiliate.type.mjs +100 -0
  354. package/dist/modules/affiliates/types/affiliate.type.mjs.map +1 -0
  355. package/dist/modules/affiliates/utils/get-affiliate-share-link.mjs +9 -0
  356. package/dist/modules/affiliates/utils/get-affiliate-share-link.mjs.map +1 -0
  357. package/dist/modules/charges/actions/get-nota-fiscal.action.mjs +10 -0
  358. package/dist/modules/charges/actions/get-nota-fiscal.action.mjs.map +1 -0
  359. package/dist/modules/charges/actions/refresh-pix.action.mjs +10 -0
  360. package/dist/modules/charges/actions/refresh-pix.action.mjs.map +1 -0
  361. package/dist/modules/charges/hooks/nota-fiscal.hook.mjs +13 -0
  362. package/dist/modules/charges/hooks/nota-fiscal.hook.mjs.map +1 -0
  363. package/dist/modules/charges/hooks/refresh-pix.hook.mjs +13 -0
  364. package/dist/modules/charges/hooks/refresh-pix.hook.mjs.map +1 -0
  365. package/dist/modules/charges/services/charges.service.mjs +67 -0
  366. package/dist/modules/charges/services/charges.service.mjs.map +1 -1
  367. package/dist/modules/charges/types/nota-fiscal.type.mjs +1 -0
  368. package/dist/modules/charges/types/nota-fiscal.type.mjs.map +1 -0
  369. package/dist/modules/charges/types/refresh-pix.type.mjs +1 -0
  370. package/dist/modules/charges/types/refresh-pix.type.mjs.map +1 -0
  371. package/dist/modules/charges/utils/get-charge-download-url.mjs +8 -0
  372. package/dist/modules/charges/utils/get-charge-download-url.mjs.map +1 -0
  373. package/dist/modules/coupons/constants/query-keys.constants.mjs +5 -0
  374. package/dist/modules/coupons/constants/query-keys.constants.mjs.map +1 -0
  375. package/dist/modules/coupons/handlers/find-coupon-by-code.handler.mjs +17 -0
  376. package/dist/modules/coupons/handlers/find-coupon-by-code.handler.mjs.map +1 -0
  377. package/dist/modules/coupons/handlers/find-coupon-by-id.handler.mjs +16 -0
  378. package/dist/modules/coupons/handlers/find-coupon-by-id.handler.mjs.map +1 -0
  379. package/dist/modules/coupons/hooks/use-coupon-by-code.hook.mjs +15 -0
  380. package/dist/modules/coupons/hooks/use-coupon-by-code.hook.mjs.map +1 -0
  381. package/dist/modules/coupons/hooks/use-coupon-by-id.hook.mjs +18 -0
  382. package/dist/modules/coupons/hooks/use-coupon-by-id.hook.mjs.map +1 -0
  383. package/dist/modules/coupons/services/coupons.service.mjs +44 -0
  384. package/dist/modules/coupons/services/coupons.service.mjs.map +1 -0
  385. package/dist/modules/coupons/types/coupon.type.mjs +61 -0
  386. package/dist/modules/coupons/types/coupon.type.mjs.map +1 -0
  387. package/dist/modules/coupons/utils/coupon-restrictions.mjs +60 -0
  388. package/dist/modules/coupons/utils/coupon-restrictions.mjs.map +1 -0
  389. package/dist/modules/domains/handlers/count-domains.handler.mjs +12 -0
  390. package/dist/modules/domains/handlers/count-domains.handler.mjs.map +1 -0
  391. package/dist/modules/domains/hooks/count-domains.hook.mjs +17 -0
  392. package/dist/modules/domains/hooks/count-domains.hook.mjs.map +1 -0
  393. package/dist/modules/domains/services/domains.service.mjs +18 -0
  394. package/dist/modules/domains/services/domains.service.mjs.map +1 -0
  395. package/dist/modules/ia-credits/handlers/list-ia-credit-operations.handler.mjs +15 -0
  396. package/dist/modules/ia-credits/handlers/list-ia-credit-operations.handler.mjs.map +1 -0
  397. package/dist/modules/ia-credits/hooks/ia-credit-operations.hook.mjs +28 -0
  398. package/dist/modules/ia-credits/hooks/ia-credit-operations.hook.mjs.map +1 -0
  399. package/dist/modules/ia-credits/services/ia-credits.service.mjs +23 -2
  400. package/dist/modules/ia-credits/services/ia-credits.service.mjs.map +1 -1
  401. package/dist/modules/pages/handlers/count-pages.handler.mjs +4 -2
  402. package/dist/modules/pages/handlers/count-pages.handler.mjs.map +1 -1
  403. package/dist/modules/pages/hooks/count-published-pages.hook.mjs +26 -0
  404. package/dist/modules/pages/hooks/count-published-pages.hook.mjs.map +1 -0
  405. package/dist/modules/pages/services/pages.service.mjs +3 -2
  406. package/dist/modules/pages/services/pages.service.mjs.map +1 -1
  407. package/dist/modules/plans/constants/plan-tooltips.constants.mjs +14 -0
  408. package/dist/modules/plans/constants/plan-tooltips.constants.mjs.map +1 -0
  409. package/dist/modules/plans/hooks/use-enriched-plans.hook.mjs +28 -0
  410. package/dist/modules/plans/hooks/use-enriched-plans.hook.mjs.map +1 -0
  411. package/dist/modules/plans/hooks/use-ui-plans.hook.mjs +20 -0
  412. package/dist/modules/plans/hooks/use-ui-plans.hook.mjs.map +1 -0
  413. package/dist/modules/projects/hooks/add-project-users.hook.mjs +25 -0
  414. package/dist/modules/projects/hooks/add-project-users.hook.mjs.map +1 -0
  415. package/dist/modules/projects/hooks/list-all-account-users.hook.mjs +3 -6
  416. package/dist/modules/projects/hooks/list-all-account-users.hook.mjs.map +1 -1
  417. package/dist/modules/projects/hooks/list-available-users.hook.mjs +3 -6
  418. package/dist/modules/projects/hooks/list-available-users.hook.mjs.map +1 -1
  419. package/dist/modules/projects/hooks/list-infinite-projects.hook.mjs +3 -6
  420. package/dist/modules/projects/hooks/list-infinite-projects.hook.mjs.map +1 -1
  421. package/dist/modules/projects/hooks/list-project-users.hook.mjs +3 -6
  422. package/dist/modules/projects/hooks/list-project-users.hook.mjs.map +1 -1
  423. package/dist/modules/projects/hooks/remove-project-users.hook.mjs +25 -0
  424. package/dist/modules/projects/hooks/remove-project-users.hook.mjs.map +1 -0
  425. package/dist/modules/projects/services/project-users.service.mjs +5 -0
  426. package/dist/modules/projects/services/project-users.service.mjs.map +1 -1
  427. package/dist/modules/projects/types.mjs +3 -2
  428. package/dist/modules/projects/types.mjs.map +1 -1
  429. package/dist/modules/subscriptions/actions/cancel-subscription.action.mjs +10 -0
  430. package/dist/modules/subscriptions/actions/cancel-subscription.action.mjs.map +1 -0
  431. package/dist/modules/subscriptions/actions/create-subscription.action.mjs +10 -0
  432. package/dist/modules/subscriptions/actions/create-subscription.action.mjs.map +1 -0
  433. package/dist/modules/subscriptions/actions/find-pending-pix-status.action.mjs +10 -0
  434. package/dist/modules/subscriptions/actions/find-pending-pix-status.action.mjs.map +1 -0
  435. package/dist/modules/subscriptions/actions/find-subscription-by-id.action.mjs +10 -0
  436. package/dist/modules/subscriptions/actions/find-subscription-by-id.action.mjs.map +1 -0
  437. package/dist/modules/subscriptions/constants/addons.constants.mjs +35 -0
  438. package/dist/modules/subscriptions/constants/addons.constants.mjs.map +1 -1
  439. package/dist/modules/subscriptions/constants/downgrade.constants.mjs +25 -0
  440. package/dist/modules/subscriptions/constants/downgrade.constants.mjs.map +1 -0
  441. package/dist/modules/subscriptions/constants/subscription.constants.mjs +2 -0
  442. package/dist/modules/subscriptions/constants/subscription.constants.mjs.map +1 -1
  443. package/dist/modules/subscriptions/handlers/pending-pix-status.handler.mjs +15 -0
  444. package/dist/modules/subscriptions/handlers/pending-pix-status.handler.mjs.map +1 -0
  445. package/dist/modules/subscriptions/hooks/cancel-subscription.hook.mjs +25 -0
  446. package/dist/modules/subscriptions/hooks/cancel-subscription.hook.mjs.map +1 -0
  447. package/dist/modules/subscriptions/hooks/create-subscription.hook.mjs +33 -0
  448. package/dist/modules/subscriptions/hooks/create-subscription.hook.mjs.map +1 -0
  449. package/dist/modules/subscriptions/hooks/find-subscription-by-id.hook.mjs +18 -0
  450. package/dist/modules/subscriptions/hooks/find-subscription-by-id.hook.mjs.map +1 -0
  451. package/dist/modules/subscriptions/hooks/pending-pix-status.hook.mjs +25 -0
  452. package/dist/modules/subscriptions/hooks/pending-pix-status.hook.mjs.map +1 -0
  453. package/dist/modules/subscriptions/services/subscriptions.service.mjs +71 -0
  454. package/dist/modules/subscriptions/services/subscriptions.service.mjs.map +1 -1
  455. package/dist/modules/subscriptions/types/cancel-subscription.type.mjs +9 -0
  456. package/dist/modules/subscriptions/types/cancel-subscription.type.mjs.map +1 -0
  457. package/dist/modules/subscriptions/types/create-subscription.type.mjs +62 -0
  458. package/dist/modules/subscriptions/types/create-subscription.type.mjs.map +1 -0
  459. package/dist/modules/subscriptions/types/pending-pix-status.type.mjs +28 -0
  460. package/dist/modules/subscriptions/types/pending-pix-status.type.mjs.map +1 -0
  461. package/dist/modules/subscriptions/types/subscription.type.mjs +9 -1
  462. package/dist/modules/subscriptions/types/subscription.type.mjs.map +1 -1
  463. package/dist/modules/subscriptions/utils/addon-buckets.mjs +69 -0
  464. package/dist/modules/subscriptions/utils/addon-buckets.mjs.map +1 -0
  465. package/dist/modules/subscriptions/utils/confirm-payment-if-required.mjs +8 -2
  466. package/dist/modules/subscriptions/utils/confirm-payment-if-required.mjs.map +1 -1
  467. package/dist/modules/subscriptions/utils/first-period-pricing.mjs +25 -0
  468. package/dist/modules/subscriptions/utils/first-period-pricing.mjs.map +1 -0
  469. package/dist/modules/subscriptions/utils/is-api-subscription.mjs +8 -0
  470. package/dist/modules/subscriptions/utils/is-api-subscription.mjs.map +1 -0
  471. package/dist/modules/subscriptions/utils/is-boleto-payer.mjs +17 -0
  472. package/dist/modules/subscriptions/utils/is-boleto-payer.mjs.map +1 -0
  473. package/dist/modules/subscriptions/utils/is-free-subscription.mjs +8 -0
  474. package/dist/modules/subscriptions/utils/is-free-subscription.mjs.map +1 -0
  475. package/dist/modules/subscriptions/utils/periodicity.mjs +55 -1
  476. package/dist/modules/subscriptions/utils/periodicity.mjs.map +1 -1
  477. package/dist/modules/subscriptions/utils/resolve-subscription-plan-name.mjs +27 -0
  478. package/dist/modules/subscriptions/utils/resolve-subscription-plan-name.mjs.map +1 -0
  479. package/dist/modules/users/hooks/messages.hook.mjs +3 -5
  480. package/dist/modules/users/hooks/messages.hook.mjs.map +1 -1
  481. package/dist/server.mjs +6 -0
  482. package/dist/server.mjs.map +1 -1
  483. package/dist/store/useAccountModals.mjs +9 -2
  484. package/dist/store/useAccountModals.mjs.map +1 -1
  485. package/dist/store/useAccountUnsavedChanges.mjs +31 -0
  486. package/dist/store/useAccountUnsavedChanges.mjs.map +1 -0
  487. package/dist/store/useAffiliateFlows.mjs +23 -0
  488. package/dist/store/useAffiliateFlows.mjs.map +1 -0
  489. package/dist/store/useProjectFlows.mjs +18 -0
  490. package/dist/store/useProjectFlows.mjs.map +1 -0
  491. package/dist/store/useSubscriptionFlows.mjs +58 -0
  492. package/dist/store/useSubscriptionFlows.mjs.map +1 -0
  493. package/dist/store/useTeamFlows.mjs +15 -0
  494. package/dist/store/useTeamFlows.mjs.map +1 -0
  495. package/dist/testing/factories/coupon.factory.mjs +19 -0
  496. package/dist/testing/factories/coupon.factory.mjs.map +1 -0
  497. package/dist/testing/factories/index.mjs +6 -0
  498. package/dist/testing/factories/index.mjs.map +1 -1
  499. package/dist/testing/factories/project-user.factory.mjs +17 -0
  500. package/dist/testing/factories/project-user.factory.mjs.map +1 -0
  501. package/dist/testing/factories/project.factory.mjs +21 -0
  502. package/dist/testing/factories/project.factory.mjs.map +1 -0
  503. package/dist/testing/react/providers.mjs +1 -1
  504. package/dist/testing/react/providers.mjs.map +1 -1
  505. package/dist/utils/browser/chart-custom-tooltip.mjs +69 -0
  506. package/dist/utils/browser/chart-custom-tooltip.mjs.map +1 -0
  507. package/dist/utils/browser/get-css-variable.mjs +9 -0
  508. package/dist/utils/browser/get-css-variable.mjs.map +1 -0
  509. package/dist/utils/constants/scrollbar.mjs +5 -0
  510. package/dist/utils/constants/scrollbar.mjs.map +1 -0
  511. package/dist/utils/date-filter-period.mjs +34 -0
  512. package/dist/utils/date-filter-period.mjs.map +1 -0
  513. package/dist/utils/file/index.mjs +11 -1
  514. package/dist/utils/file/index.mjs.map +1 -1
  515. package/dist/utils/format/initials.mjs +8 -0
  516. package/dist/utils/format/initials.mjs.map +1 -0
  517. package/dist/utils/format/masks.mjs +32 -1
  518. package/dist/utils/format/masks.mjs.map +1 -1
  519. package/dist/utils/qrcode/to-data-url.mjs +12 -0
  520. package/dist/utils/qrcode/to-data-url.mjs.map +1 -0
  521. package/dist/utils/validators/account.mjs +1 -7
  522. package/dist/utils/validators/account.mjs.map +1 -1
  523. package/package.json +15 -2
  524. package/src/components/account/AccountHubLinkHandler.tsx +39 -0
  525. package/src/components/account/AccountModalLayout.tsx +190 -0
  526. package/src/components/account/AccountModals.tsx +12 -2
  527. package/src/components/account/AccountUnsavedChangesDialog.tsx +49 -0
  528. package/src/components/account/DeleteAccountModal.tsx +1 -1
  529. package/src/components/account/IsntPossibleDeleteAccountModal.tsx +9 -1
  530. package/src/components/account/MyAccountModal.tsx +222 -0
  531. package/src/components/account/TwoFactorAuthModal.tsx +1 -1
  532. package/src/components/account/hooks/useAccountHubActions.ts +95 -0
  533. package/src/components/account/hooks/useAddCardWithPaymentSwitch.ts +70 -0
  534. package/src/components/account/hooks/useAffiliatesActions.tsx +78 -0
  535. package/src/components/account/hooks/useMyAccountModal.ts +40 -0
  536. package/src/components/account/hooks/useProjectsActions.ts +44 -0
  537. package/src/components/account/hooks/useSubscriptionActions.ts +99 -0
  538. package/src/components/account/hooks/useTeamActions.ts +35 -0
  539. package/src/components/account/sections/AffiliatesSection.tsx +342 -0
  540. package/src/components/account/sections/ChangePasswordSection.tsx +6 -10
  541. package/src/components/account/sections/MyProfileSection.tsx +215 -147
  542. package/src/components/account/sections/PreferencesSection.tsx +71 -71
  543. package/src/components/account/sections/ProjectsSection.tsx +110 -0
  544. package/src/components/account/sections/SecuritySection.tsx +72 -62
  545. package/src/components/account/sections/SubscriptionSection.tsx +36 -0
  546. package/src/components/account/sections/TeamSection.tsx +161 -0
  547. package/src/components/account/sections/TokenSection.tsx +4 -8
  548. package/src/components/account/sections/affiliates/AffiliateCommissionCard.tsx +83 -0
  549. package/src/components/account/sections/affiliates/AffiliateFlows.tsx +20 -0
  550. package/src/components/account/sections/affiliates/AffiliateLeadsSheet.tsx +143 -0
  551. package/src/components/account/sections/affiliates/AffiliateStatsCard.tsx +56 -0
  552. package/src/components/account/sections/affiliates/AffiliateStepCard.tsx +20 -0
  553. package/src/components/account/sections/affiliates/AffiliateTransactionsList.tsx +194 -0
  554. package/src/components/account/sections/affiliates/NoReceivingAccountModal.tsx +63 -0
  555. package/src/components/account/sections/affiliates/ReceivingAccountModal.tsx +213 -0
  556. package/src/components/account/sections/affiliates/RequestWithdrawalSheet.tsx +586 -0
  557. package/src/components/account/sections/affiliates/ViewAttachmentModal.tsx +47 -0
  558. package/src/components/account/sections/affiliates/reports/AffiliatesIndicatorsChart.tsx +45 -0
  559. package/src/components/account/sections/affiliates/reports/AffiliatesReportsTab.tsx +44 -0
  560. package/src/components/account/sections/affiliates/reports/useAffiliatesIndicatorsChart.ts +148 -0
  561. package/src/components/account/sections/projects/DeleteProjectModal.tsx +246 -0
  562. package/src/components/account/sections/projects/ProjectFlows.tsx +16 -0
  563. package/src/components/account/sections/projects/ProjectMembersStack.tsx +75 -0
  564. package/src/components/account/sections/projects/ProjectRow.tsx +96 -0
  565. package/src/components/account/sections/projects/ProjectSheet.tsx +603 -0
  566. package/src/components/account/sections/projects/ProjectsDisabledModal.tsx +69 -0
  567. package/src/components/account/sections/projects/project-form.schema.ts +30 -0
  568. package/src/components/account/sections/shared/ConnectListRow.tsx +68 -0
  569. package/src/components/account/sections/shared/DateFilterPopover.tsx +58 -0
  570. package/src/components/account/sections/shared/EntityAvatar.tsx +54 -0
  571. package/src/components/account/sections/shared/FilterPopover.tsx +79 -0
  572. package/src/components/account/sections/shared/FormSection.tsx +23 -0
  573. package/src/components/account/sections/shared/IconBox.tsx +21 -0
  574. package/src/components/account/sections/shared/InfiniteScrollList.tsx +57 -0
  575. package/src/components/account/sections/shared/ListPagination.tsx +84 -0
  576. package/src/components/account/sections/shared/RowActionsMenu.tsx +66 -0
  577. package/src/components/account/sections/shared/SectionLoadError.tsx +27 -0
  578. package/src/components/account/sections/shared/StatusBadge.tsx +33 -0
  579. package/src/components/account/sections/shared/WorkspaceSection.tsx +22 -0
  580. package/src/components/account/sections/subscription/AiCreditsUsage.tsx +152 -0
  581. package/src/components/account/sections/subscription/BillingAddressSheet.tsx +460 -0
  582. package/src/components/account/sections/subscription/BoletoDetailsDialog.tsx +104 -0
  583. package/src/components/account/sections/subscription/BoletoGeneratedDialog.tsx +24 -0
  584. package/src/components/account/sections/subscription/CancelPlanDialog.tsx +221 -0
  585. package/src/components/account/sections/subscription/ChargeRow.tsx +161 -0
  586. package/src/components/account/sections/subscription/ChargeStatusBadge.tsx +29 -0
  587. package/src/components/account/sections/subscription/ChargesList.tsx +125 -0
  588. package/src/components/account/sections/subscription/ManageCardsSheet.tsx +93 -0
  589. package/src/components/account/sections/subscription/OverdueReceiptOpener.tsx +29 -0
  590. package/src/components/account/sections/subscription/PayChargeDialog.tsx +306 -0
  591. package/src/components/account/sections/subscription/PaymentConfirmationDialog.tsx +70 -0
  592. package/src/components/account/sections/subscription/PaymentMethodsCard.tsx +117 -0
  593. package/src/components/account/sections/subscription/PendingChangeDialog.tsx +168 -0
  594. package/src/components/account/sections/subscription/PixDetailsDialog.tsx +246 -0
  595. package/src/components/account/sections/subscription/PixPaymentDialog.tsx +242 -0
  596. package/src/components/account/sections/subscription/PlanDetailsSheet.tsx +380 -0
  597. package/src/components/account/sections/subscription/ReceiptDetailsSheet.tsx +318 -0
  598. package/src/components/account/sections/subscription/SubscriptionFlows.tsx +40 -0
  599. package/src/components/account/sections/subscription/SubscriptionPlanCard.tsx +433 -0
  600. package/src/components/account/sections/subscription/UsageReportSheet.tsx +244 -0
  601. package/src/components/account/sections/subscription/change-plan/ChangePlanSheet.tsx +95 -0
  602. package/src/components/account/sections/subscription/change-plan/components/AbTestDetailsDialog.tsx +57 -0
  603. package/src/components/account/sections/subscription/change-plan/components/AddonsBlock.tsx +214 -0
  604. package/src/components/account/sections/subscription/change-plan/components/AlternativeBucketsSection.tsx +92 -0
  605. package/src/components/account/sections/subscription/change-plan/components/CouponBlock.tsx +42 -0
  606. package/src/components/account/sections/subscription/change-plan/components/CouponDialog.tsx +134 -0
  607. package/src/components/account/sections/subscription/change-plan/components/PricePreview.tsx +28 -0
  608. package/src/components/account/sections/subscription/change-plan/components/SummaryBlock.tsx +194 -0
  609. package/src/components/account/sections/subscription/change-plan/plan-comparison.ts +52 -0
  610. package/src/components/account/sections/subscription/change-plan/steps/PaymentSummaryStep.tsx +161 -0
  611. package/src/components/account/sections/subscription/change-plan/steps/PlanComparisonStep.tsx +165 -0
  612. package/src/components/account/sections/subscription/change-plan/steps/PlanViewStep.tsx +89 -0
  613. package/src/components/account/sections/subscription/change-plan/steps/ReactivationConfigStep.tsx +117 -0
  614. package/src/components/account/sections/subscription/change-plan/steps/ReactivationPaymentStep.tsx +139 -0
  615. package/src/components/account/sections/subscription/change-plan/useChangePlanState.tsx +1158 -0
  616. package/src/components/account/sections/subscription/downgrade/CannotDowngradeDialog.tsx +297 -0
  617. package/src/components/account/sections/subscription/downgrade/DowngradeReasonDialog.tsx +154 -0
  618. package/src/components/account/sections/subscription/plans/PlanCard.tsx +417 -0
  619. package/src/components/account/sections/subscription/plans/PlanCardSkeleton.tsx +70 -0
  620. package/src/components/account/sections/subscription/plans/PlansCatalogDialog.tsx +156 -0
  621. package/src/components/account/sections/team/DeleteUserModal.tsx +134 -0
  622. package/src/components/account/sections/team/TeamFlows.tsx +14 -0
  623. package/src/components/account/sections/team/TeamMemberRow.tsx +151 -0
  624. package/src/components/account/sections/team/UserSheet.tsx +688 -0
  625. package/src/components/account/sections/team/steps/NotificationsStep.tsx +109 -0
  626. package/src/components/account/sections/team/steps/ProjectSelectionStep.tsx +219 -0
  627. package/src/components/account/sections/team/steps/UserInformationStep.tsx +423 -0
  628. package/src/components/account/sections/team/user-form.schema.ts +43 -0
  629. package/src/components/account/types/workspace-actions.type.ts +56 -0
  630. package/src/components/layouts/ProfilePopover.tsx +11 -12
  631. package/src/components/layouts/UsersSelectorPopover.tsx +7 -4
  632. package/src/components/modals/AccountDeletionWarningModal.tsx +4 -5
  633. package/src/components/modals/AccountFrozenModal.tsx +6 -3
  634. package/src/components/modals/Modals.tsx +6 -3
  635. package/src/components/modals/PaidPlanRequiredModal.tsx +4 -5
  636. package/src/components/modals/cards/AddFirstCardWarningModal.tsx +72 -0
  637. package/src/components/modals/cards/SwitchPaymentToCardModal.tsx +232 -0
  638. package/src/components/modals/promo/AiCreditsOfferModal/AiCreditsOfferModal.tsx +5 -4
  639. package/src/components/ui/data-display/CardItem.tsx +9 -5
  640. package/src/components/ui/data-display/PaymentMethodIcons.tsx +43 -0
  641. package/src/components/ui/form/BillingPeriodSelector.tsx +173 -0
  642. package/src/components/ui/form/PaymentMethodToggle.tsx +119 -0
  643. package/src/components/ui/form/RadioOptionFieldIcon.tsx +64 -0
  644. package/src/components/ui/form/SegmentedControl.tsx +77 -0
  645. package/src/components/ui/overlay/Dialog.tsx +21 -2
  646. package/src/components/ui/overlay/Sheet.tsx +26 -5
  647. package/src/components/ui/overlay/layers.tsx +88 -4
  648. package/src/enums/AccountHubFlow.ts +8 -0
  649. package/src/enums/DateFilterPeriod.ts +17 -0
  650. package/src/enums/WorkspaceSectionType.ts +6 -0
  651. package/src/handlers.ts +14 -0
  652. package/src/hooks/useDebounce.ts +5 -3
  653. package/src/hooks/useUploadProgress.ts +42 -0
  654. package/src/i18n/messages/en-us.ts +909 -2
  655. package/src/i18n/messages/es-es.ts +913 -2
  656. package/src/i18n/messages/pt-br.ts +913 -2
  657. package/src/index.ts +56 -1
  658. package/src/infra/http/paged.ts +24 -0
  659. package/src/middleware.ts +1 -0
  660. package/src/middlewares/create-auth-middleware.ts +2 -5
  661. package/src/middlewares/create-legacy-account-routes-middleware.ts +54 -0
  662. package/src/middlewares/is-route-equals.ts +3 -0
  663. package/src/modules/accounts/actions/account-management.action.ts +22 -1
  664. package/src/modules/accounts/constants/account-hub-link.constants.ts +3 -0
  665. package/src/modules/accounts/constants/legacy-account-routes.constants.ts +1 -0
  666. package/src/modules/accounts/handlers/list-account-members.handler.ts +23 -0
  667. package/src/modules/accounts/hooks/add-user-projects.hook.ts +72 -0
  668. package/src/modules/accounts/hooks/create-account-user.hook.ts +21 -0
  669. package/src/modules/accounts/hooks/remove-user-projects.hook.ts +68 -0
  670. package/src/modules/accounts/hooks/use-account-members.hook.ts +31 -0
  671. package/src/modules/accounts/services/account.service.ts +71 -0
  672. package/src/modules/accounts/types/account-hub-link.type.ts +13 -0
  673. package/src/modules/accounts/types.ts +9 -0
  674. package/src/modules/accounts/utils/build-account-hub-url.ts +14 -0
  675. package/src/modules/accounts/utils/is-account-hub-flow.ts +7 -0
  676. package/src/modules/accounts/utils/is-account-section.ts +7 -0
  677. package/src/modules/accounts/utils/is-my-account-section.ts +12 -0
  678. package/src/modules/accounts/utils/map-legacy-account-route.ts +108 -0
  679. package/src/modules/accounts/utils/parse-account-hub-link.ts +21 -0
  680. package/src/modules/affiliates/actions/ensure-affiliate.action.ts +9 -0
  681. package/src/modules/affiliates/actions/request-deposit.action.ts +9 -0
  682. package/src/modules/affiliates/actions/update-affiliate.action.ts +9 -0
  683. package/src/modules/affiliates/constants/affiliate.constants.ts +11 -0
  684. package/src/modules/affiliates/constants/query-keys.constants.ts +7 -0
  685. package/src/modules/affiliates/handlers/affiliate-report-analytics.handler.ts +16 -0
  686. package/src/modules/affiliates/handlers/affiliate-withdrawal-limits.handler.ts +10 -0
  687. package/src/modules/affiliates/handlers/current-affiliate.handler.ts +10 -0
  688. package/src/modules/affiliates/handlers/list-affiliate-coupons.handler.ts +10 -0
  689. package/src/modules/affiliates/handlers/list-affiliate-leads.handler.ts +23 -0
  690. package/src/modules/affiliates/handlers/list-affiliate-transactions.handler.ts +23 -0
  691. package/src/modules/affiliates/hooks/use-affiliate-coupons.hook.ts +19 -0
  692. package/src/modules/affiliates/hooks/use-affiliate-leads.hook.ts +27 -0
  693. package/src/modules/affiliates/hooks/use-affiliate-report-analytics.hook.ts +19 -0
  694. package/src/modules/affiliates/hooks/use-affiliate-transactions.hook.ts +25 -0
  695. package/src/modules/affiliates/hooks/use-current-affiliate.hook.ts +19 -0
  696. package/src/modules/affiliates/hooks/use-ensure-affiliate.hook.ts +24 -0
  697. package/src/modules/affiliates/hooks/use-request-deposit.hook.ts +29 -0
  698. package/src/modules/affiliates/hooks/use-update-affiliate.hook.ts +24 -0
  699. package/src/modules/affiliates/hooks/use-withdrawal-limits.hook.ts +20 -0
  700. package/src/modules/affiliates/services/affiliates.service.ts +240 -0
  701. package/src/modules/affiliates/types/affiliate.type.ts +180 -0
  702. package/src/modules/affiliates/utils/get-affiliate-share-link.ts +8 -0
  703. package/src/modules/charges/actions/get-nota-fiscal.action.ts +8 -0
  704. package/src/modules/charges/actions/refresh-pix.action.ts +8 -0
  705. package/src/modules/charges/hooks/nota-fiscal.hook.ts +13 -0
  706. package/src/modules/charges/hooks/refresh-pix.hook.ts +13 -0
  707. package/src/modules/charges/services/charges.service.ts +121 -0
  708. package/src/modules/charges/types/nota-fiscal.type.ts +20 -0
  709. package/src/modules/charges/types/refresh-pix.type.ts +14 -0
  710. package/src/modules/charges/utils/get-charge-download-url.ts +10 -0
  711. package/src/modules/coupons/constants/query-keys.constants.ts +1 -0
  712. package/src/modules/coupons/handlers/find-coupon-by-code.handler.ts +16 -0
  713. package/src/modules/coupons/handlers/find-coupon-by-id.handler.ts +15 -0
  714. package/src/modules/coupons/hooks/use-coupon-by-code.hook.ts +16 -0
  715. package/src/modules/coupons/hooks/use-coupon-by-id.hook.ts +20 -0
  716. package/src/modules/coupons/services/coupons.service.ts +54 -0
  717. package/src/modules/coupons/types/coupon.type.ts +70 -0
  718. package/src/modules/coupons/utils/coupon-restrictions.ts +112 -0
  719. package/src/modules/domains/handlers/count-domains.handler.ts +10 -0
  720. package/src/modules/domains/hooks/count-domains.hook.ts +17 -0
  721. package/src/modules/domains/services/domains.service.ts +18 -0
  722. package/src/modules/ia-credits/handlers/list-ia-credit-operations.handler.ts +14 -0
  723. package/src/modules/ia-credits/hooks/ia-credit-operations.hook.ts +33 -0
  724. package/src/modules/ia-credits/services/ia-credits.service.ts +32 -1
  725. package/src/modules/pages/handlers/count-pages.handler.ts +5 -2
  726. package/src/modules/pages/hooks/count-published-pages.hook.ts +26 -0
  727. package/src/modules/pages/services/pages.service.ts +3 -2
  728. package/src/modules/plans/constants/plan-tooltips.constants.ts +16 -0
  729. package/src/modules/plans/hooks/use-enriched-plans.hook.ts +31 -0
  730. package/src/modules/plans/hooks/use-ui-plans.hook.ts +22 -0
  731. package/src/modules/projects/hooks/add-project-users.hook.ts +29 -0
  732. package/src/modules/projects/hooks/list-all-account-users.hook.ts +3 -6
  733. package/src/modules/projects/hooks/list-available-users.hook.ts +3 -6
  734. package/src/modules/projects/hooks/list-infinite-projects.hook.ts +3 -6
  735. package/src/modules/projects/hooks/list-project-users.hook.ts +3 -6
  736. package/src/modules/projects/hooks/remove-project-users.hook.ts +29 -0
  737. package/src/modules/projects/services/project-users.service.ts +135 -130
  738. package/src/modules/projects/types.ts +89 -88
  739. package/src/modules/subscriptions/actions/cancel-subscription.action.ts +12 -0
  740. package/src/modules/subscriptions/actions/create-subscription.action.ts +9 -0
  741. package/src/modules/subscriptions/actions/find-pending-pix-status.action.ts +8 -0
  742. package/src/modules/subscriptions/actions/find-subscription-by-id.action.ts +8 -0
  743. package/src/modules/subscriptions/constants/addons.constants.ts +50 -0
  744. package/src/modules/subscriptions/constants/downgrade.constants.ts +30 -0
  745. package/src/modules/subscriptions/constants/subscription.constants.ts +3 -0
  746. package/src/modules/subscriptions/handlers/pending-pix-status.handler.ts +17 -0
  747. package/src/modules/subscriptions/hooks/cancel-subscription.hook.ts +28 -0
  748. package/src/modules/subscriptions/hooks/create-subscription.hook.ts +34 -0
  749. package/src/modules/subscriptions/hooks/find-subscription-by-id.hook.ts +17 -0
  750. package/src/modules/subscriptions/hooks/pending-pix-status.hook.ts +30 -0
  751. package/src/modules/subscriptions/services/subscriptions.service.ts +401 -301
  752. package/src/modules/subscriptions/types/cancel-subscription.type.ts +8 -0
  753. package/src/modules/subscriptions/types/create-subscription.type.ts +79 -0
  754. package/src/modules/subscriptions/types/pending-pix-status.type.ts +33 -0
  755. package/src/modules/subscriptions/types/subscription.type.ts +157 -147
  756. package/src/modules/subscriptions/utils/addon-buckets.ts +129 -0
  757. package/src/modules/subscriptions/utils/confirm-payment-if-required.ts +9 -2
  758. package/src/modules/subscriptions/utils/first-period-pricing.ts +63 -0
  759. package/src/modules/subscriptions/utils/is-api-subscription.ts +6 -0
  760. package/src/modules/subscriptions/utils/is-boleto-payer.ts +21 -0
  761. package/src/modules/subscriptions/utils/is-free-subscription.ts +6 -0
  762. package/src/modules/subscriptions/utils/periodicity.ts +101 -0
  763. package/src/modules/subscriptions/utils/resolve-subscription-plan-name.ts +44 -0
  764. package/src/modules/users/hooks/messages.hook.ts +3 -5
  765. package/src/server.ts +102 -99
  766. package/src/store/useAccountModals.ts +22 -5
  767. package/src/store/useAccountUnsavedChanges.ts +52 -0
  768. package/src/store/useAffiliateFlows.ts +46 -0
  769. package/src/store/useProjectFlows.ts +42 -0
  770. package/src/store/useSubscriptionFlows.ts +176 -0
  771. package/src/store/useTeamFlows.ts +34 -0
  772. package/src/testing/factories/coupon.factory.ts +17 -0
  773. package/src/testing/factories/index.ts +3 -0
  774. package/src/testing/factories/project-user.factory.ts +15 -0
  775. package/src/testing/factories/project.factory.ts +19 -0
  776. package/src/testing/react/providers.tsx +2 -1
  777. package/src/utils/browser/chart-custom-tooltip.ts +85 -0
  778. package/src/utils/browser/get-css-variable.ts +6 -0
  779. package/src/utils/constants/scrollbar.ts +10 -0
  780. package/src/utils/date-filter-period.ts +34 -0
  781. package/src/utils/file/index.ts +13 -0
  782. package/src/utils/format/initials.ts +10 -0
  783. package/src/utils/format/masks.ts +41 -0
  784. package/src/utils/qrcode/to-data-url.ts +23 -0
  785. package/src/utils/validators/account.ts +0 -8
  786. package/dist/components/account/ConfigurationsMyAccountModal.mjs +0 -143
  787. package/dist/components/account/ConfigurationsMyAccountModal.mjs.map +0 -1
  788. package/dist/components/account/hooks/useConfigurationsModal.mjs +0 -34
  789. package/dist/components/account/hooks/useConfigurationsModal.mjs.map +0 -1
  790. package/src/components/account/ConfigurationsMyAccountModal.tsx +0 -179
  791. package/src/components/account/hooks/useConfigurationsModal.ts +0 -45
@@ -0,0 +1,56 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { cn } from "../../../infra/utils/clsx";
4
+ function SegmentedControl({
5
+ value,
6
+ onChange,
7
+ options,
8
+ className,
9
+ optionClassName,
10
+ selectedClassName,
11
+ unselectedClassName
12
+ }) {
13
+ const handleKeyDown = (event) => {
14
+ if (event.key !== "ArrowLeft" && event.key !== "ArrowRight") return;
15
+ event.preventDefault();
16
+ const currentIndex = options.findIndex((option) => option.value === value);
17
+ if (currentIndex === -1) return;
18
+ const direction = event.key === "ArrowRight" ? 1 : -1;
19
+ const nextIndex = (currentIndex + direction + options.length) % options.length;
20
+ onChange(options[nextIndex].value);
21
+ };
22
+ const baseSelected = selectedClassName ?? "bg-white text-zinc-950 shadow-[0px_2px_10px_0px_rgba(26,26,26,0.05)]";
23
+ const baseUnselected = unselectedClassName ?? "text-zinc-950";
24
+ return /* @__PURE__ */ jsx(
25
+ "div",
26
+ {
27
+ className: cn("inline-flex items-stretch rounded-[12px] bg-zinc-100 p-1.5 gap-1", className),
28
+ role: "radiogroup",
29
+ onKeyDown: handleKeyDown,
30
+ children: options.map((option) => {
31
+ const isActive = option.value === value;
32
+ return /* @__PURE__ */ jsx(
33
+ "button",
34
+ {
35
+ type: "button",
36
+ role: "radio",
37
+ "aria-checked": isActive,
38
+ className: cn(
39
+ "px-3 py-1.5 rounded-lg paragraph-small-semibold transition-colors cursor-pointer",
40
+ isActive ? baseSelected : baseUnselected,
41
+ optionClassName,
42
+ option.className
43
+ ),
44
+ onClick: () => onChange(option.value),
45
+ children: option.label
46
+ },
47
+ String(option.value)
48
+ );
49
+ })
50
+ }
51
+ );
52
+ }
53
+ export {
54
+ SegmentedControl
55
+ };
56
+ //# sourceMappingURL=SegmentedControl.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/ui/form/SegmentedControl.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../../infra/utils/clsx';\n\ntype SegmentedControlOption<Value extends string | number> = {\n value: Value;\n label: React.ReactNode;\n className?: string;\n};\n\ninterface SegmentedControlProps<Value extends string | number> {\n value: Value;\n onChange: (value: Value) => void;\n options: SegmentedControlOption<Value>[];\n className?: string;\n optionClassName?: string;\n selectedClassName?: string;\n unselectedClassName?: string;\n}\n\n/** Alternador de opções curtas (periodicidade da vitrine, por exemplo). */\nexport function SegmentedControl<Value extends string | number = string>({\n value,\n onChange,\n options,\n className,\n optionClassName,\n selectedClassName,\n unselectedClassName,\n}: SegmentedControlProps<Value>) {\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return;\n\n event.preventDefault();\n const currentIndex = options.findIndex((option) => option.value === value);\n if (currentIndex === -1) return;\n\n const direction = event.key === 'ArrowRight' ? 1 : -1;\n const nextIndex = (currentIndex + direction + options.length) % options.length;\n onChange(options[nextIndex].value);\n };\n\n const baseSelected =\n selectedClassName ?? 'bg-white text-zinc-950 shadow-[0px_2px_10px_0px_rgba(26,26,26,0.05)]';\n const baseUnselected = unselectedClassName ?? 'text-zinc-950';\n\n return (\n <div\n className={cn('inline-flex items-stretch rounded-[12px] bg-zinc-100 p-1.5 gap-1', className)}\n role=\"radiogroup\"\n onKeyDown={handleKeyDown}\n >\n {options.map((option) => {\n const isActive = option.value === value;\n\n return (\n <button\n key={String(option.value)}\n type=\"button\"\n role=\"radio\"\n aria-checked={isActive}\n className={cn(\n 'px-3 py-1.5 rounded-lg paragraph-small-semibold transition-colors cursor-pointer',\n isActive ? baseSelected : baseUnselected,\n optionClassName,\n option.className\n )}\n onClick={() => onChange(option.value)}\n >\n {option.label}\n </button>\n );\n })}\n </div>\n );\n}\n"],"mappings":";AAyDU;AAtDV,SAAS,UAAU;AAmBZ,SAAS,iBAAyD;AAAA,EACvE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAiC;AAC/B,QAAM,gBAAgB,CAAC,UAA+C;AACpE,QAAI,MAAM,QAAQ,eAAe,MAAM,QAAQ,aAAc;AAE7D,UAAM,eAAe;AACrB,UAAM,eAAe,QAAQ,UAAU,CAAC,WAAW,OAAO,UAAU,KAAK;AACzE,QAAI,iBAAiB,GAAI;AAEzB,UAAM,YAAY,MAAM,QAAQ,eAAe,IAAI;AACnD,UAAM,aAAa,eAAe,YAAY,QAAQ,UAAU,QAAQ;AACxE,aAAS,QAAQ,SAAS,EAAE,KAAK;AAAA,EACnC;AAEA,QAAM,eACJ,qBAAqB;AACvB,QAAM,iBAAiB,uBAAuB;AAE9C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,oEAAoE,SAAS;AAAA,MAC3F,MAAK;AAAA,MACL,WAAW;AAAA,MAEV,kBAAQ,IAAI,CAAC,WAAW;AACvB,cAAM,WAAW,OAAO,UAAU;AAElC,eACE;AAAA,UAAC;AAAA;AAAA,YAEC,MAAK;AAAA,YACL,MAAK;AAAA,YACL,gBAAc;AAAA,YACd,WAAW;AAAA,cACT;AAAA,cACA,WAAW,eAAe;AAAA,cAC1B;AAAA,cACA,OAAO;AAAA,YACT;AAAA,YACA,SAAS,MAAM,SAAS,OAAO,KAAK;AAAA,YAEnC,iBAAO;AAAA;AAAA,UAZH,OAAO,OAAO,KAAK;AAAA,QAa1B;AAAA,MAEJ,CAAC;AAAA;AAAA,EACH;AAEJ;","names":[]}
@@ -4,29 +4,38 @@ import * as React from "react";
4
4
  import * as DialogPrimitive from "@radix-ui/react-dialog";
5
5
  import { IconX } from "@tabler/icons-react";
6
6
  import { cn } from "../../../infra/utils/clsx";
7
- import { OverlayLayerContext, useDialogLayer, useOverlayLayer } from "./layers";
7
+ import {
8
+ OverlayLayerContext,
9
+ OverlayTopContext,
10
+ useDialogLayer,
11
+ useIsTopOverlay,
12
+ useOverlayPosition,
13
+ useTopLayerScrollIsolation
14
+ } from "./layers";
8
15
  function Dialog({
9
16
  open,
10
17
  defaultOpen,
11
18
  onOpenChange,
19
+ modal,
12
20
  ...props
13
21
  }) {
14
22
  const [openState, setOpenState] = React.useState(defaultOpen ?? false);
15
- const layer = useOverlayLayer(open ?? openState);
23
+ const { layer, isTop } = useOverlayPosition(open ?? openState);
16
24
  const handleOpenChange = (next) => {
17
25
  setOpenState(next);
18
26
  onOpenChange?.(next);
19
27
  };
20
- return /* @__PURE__ */ jsx(OverlayLayerContext.Provider, { value: layer, children: /* @__PURE__ */ jsx(
28
+ return /* @__PURE__ */ jsx(OverlayLayerContext.Provider, { value: layer, children: /* @__PURE__ */ jsx(OverlayTopContext.Provider, { value: isTop, children: /* @__PURE__ */ jsx(
21
29
  DialogPrimitive.Root,
22
30
  {
23
31
  "data-slot": "dialog",
24
32
  open,
25
33
  defaultOpen,
26
34
  onOpenChange: handleOpenChange,
35
+ modal,
27
36
  ...props
28
37
  }
29
- ) });
38
+ ) }) });
30
39
  }
31
40
  function DialogTrigger({
32
41
  ...props
@@ -67,15 +76,23 @@ function DialogContent({
67
76
  showCloseButton = true,
68
77
  overlayClassName,
69
78
  hideOverlay = false,
79
+ ref,
70
80
  ...props
71
81
  }) {
72
82
  const layer = useDialogLayer();
83
+ const contentRef = React.useRef(null);
84
+ useTopLayerScrollIsolation(contentRef, useIsTopOverlay());
73
85
  return /* @__PURE__ */ jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [
74
86
  !hideOverlay && /* @__PURE__ */ jsx(DialogOverlay, { className: overlayClassName }),
75
87
  /* @__PURE__ */ jsxs(
76
88
  DialogPrimitive.Content,
77
89
  {
78
90
  "data-slot": "dialog-content",
91
+ ref: (node) => {
92
+ contentRef.current = node;
93
+ if (typeof ref === "function") ref(node);
94
+ else if (ref) ref.current = node;
95
+ },
79
96
  className: cn(
80
97
  "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
81
98
  layer.content,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/ui/overlay/Dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { IconX } from '@tabler/icons-react';\nimport { cn } from \"../../../infra/utils/clsx\";\nimport { OverlayLayerContext, useDialogLayer, useOverlayLayer } from \"./layers\";\n\nfunction Dialog({\n open,\n defaultOpen,\n onOpenChange,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n const [openState, setOpenState] = React.useState(defaultOpen ?? false);\n const layer = useOverlayLayer(open ?? openState);\n\n const handleOpenChange = (next: boolean) => {\n setOpenState(next);\n onOpenChange?.(next);\n };\n\n return (\n <OverlayLayerContext.Provider value={layer}>\n <DialogPrimitive.Root\n data-slot=\"dialog\"\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={handleOpenChange}\n {...props}\n />\n </OverlayLayerContext.Provider>\n );\n}\n\nfunction DialogTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n const layer = useDialogLayer();\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 bg-black/50\",\n layer.overlay,\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n overlayClassName,\n hideOverlay = false,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean;\n overlayClassName?: string;\n hideOverlay?: boolean;\n}) {\n const layer = useDialogLayer();\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n {!hideOverlay && <DialogOverlay className={overlayClassName} />}\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n \"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg\",\n layer.content,\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <div className=\"absolute top-0.5 right-0\">\n <div className=\"p-4\">\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"hover:cursor-pointer flex size-8 items-center justify-center rounded-lg p-2 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-950 focus:outline-none\"\n >\n <IconX className=\"size-[18px]\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </div>\n </div>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\n \"p-5 flex flex-col gap-2 text-center sm:text-left\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\"text-lg leading-none font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"],"mappings":";AAwBM,cA4EQ,YA5ER;AAtBN,YAAY,WAAW;AACvB,YAAY,qBAAqB;AACjC,SAAS,aAAa;AACtB,SAAS,UAAU;AACnB,SAAS,qBAAqB,gBAAgB,uBAAuB;AAErE,SAAS,OAAO;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAsD;AACpD,QAAM,CAAC,WAAW,YAAY,IAAI,MAAM,SAAS,eAAe,KAAK;AACrE,QAAM,QAAQ,gBAAgB,QAAQ,SAAS;AAE/C,QAAM,mBAAmB,CAAC,SAAkB;AAC1C,iBAAa,IAAI;AACjB,mBAAe,IAAI;AAAA,EACrB;AAEA,SACE,oBAAC,oBAAoB,UAApB,EAA6B,OAAO,OACnC;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA,cAAc;AAAA,MACb,GAAG;AAAA;AAAA,EACN,GACF;AAEJ;AAEA,SAAS,cAAc;AAAA,EACrB,GAAG;AACL,GAAyD;AACvD,SAAO,oBAAC,gBAAgB,SAAhB,EAAwB,aAAU,kBAAkB,GAAG,OAAO;AACxE;AAEA,SAAS,aAAa;AAAA,EACpB,GAAG;AACL,GAAwD;AACtD,SAAO,oBAAC,gBAAgB,QAAhB,EAAuB,aAAU,iBAAiB,GAAG,OAAO;AACtE;AAEA,SAAS,Y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ACN;AAEJ;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,MAAM,GAAgC;AAC1E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,YAAY;AAAA,EACnB;AAAA,EACA,GAAG;AACL,GAAuD;AACrD,SACE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,sCAAsC,SAAS;AAAA,MAC5D,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,kBAAkB;AAAA,EACzB;AAAA,EACA,GAAG;AACL,GAA6D;AAC3D,SACE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,iCAAiC,SAAS;AAAA,MACvD,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../../../src/components/ui/overlay/Dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { IconX } from '@tabler/icons-react';\nimport { cn } from \"../../../infra/utils/clsx\";\nimport {\n OverlayLayerContext,\n OverlayTopContext,\n useDialogLayer,\n useIsTopOverlay,\n useOverlayPosition,\n useTopLayerScrollIsolation,\n} from \"./layers\";\n\nfunction Dialog({\n open,\n defaultOpen,\n onOpenChange,\n modal,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n const [openState, setOpenState] = React.useState(defaultOpen ?? false);\n const { layer, isTop } = useOverlayPosition(open ?? openState);\n\n const handleOpenChange = (next: boolean) => {\n setOpenState(next);\n onOpenChange?.(next);\n };\n\n return (\n <OverlayLayerContext.Provider value={layer}>\n <OverlayTopContext.Provider value={isTop}>\n <DialogPrimitive.Root\n data-slot=\"dialog\"\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={handleOpenChange}\n modal={modal}\n {...props}\n />\n </OverlayTopContext.Provider>\n </OverlayLayerContext.Provider>\n );\n}\n\nfunction DialogTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n const layer = useDialogLayer();\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 bg-black/50\",\n layer.overlay,\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n overlayClassName,\n hideOverlay = false,\n ref,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean;\n overlayClassName?: string;\n hideOverlay?: boolean;\n}) {\n const layer = useDialogLayer();\n const contentRef = React.useRef<HTMLDivElement>(null);\n useTopLayerScrollIsolation(contentRef, useIsTopOverlay());\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n {!hideOverlay && <DialogOverlay className={overlayClassName} />}\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n ref={(node) => {\n contentRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n className={cn(\n \"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg\",\n layer.content,\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <div className=\"absolute top-0.5 right-0\">\n <div className=\"p-4\">\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"hover:cursor-pointer flex size-8 items-center justify-center rounded-lg p-2 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-950 focus:outline-none\"\n >\n <IconX className=\"size-[18px]\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </div>\n </div>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\n \"p-5 flex flex-col gap-2 text-center sm:text-left\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\"text-lg leading-none font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"],"mappings":";AAiCM,cAsFQ,YAtFR;AA/BN,YAA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ACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,YAAY;AAAA,EACnB;AAAA,EACA,GAAG;AACL,GAAuD;AACrD,SACE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,sCAAsC,SAAS;AAAA,MAC5D,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,kBAAkB;AAAA,EACzB;AAAA,EACA,GAAG;AACL,GAA6D;AAC3D,SACE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,iCAAiC,SAAS;AAAA,MACvD,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
@@ -5,17 +5,24 @@ import * as SheetPrimitive from "@radix-ui/react-dialog";
5
5
  import { IconX } from "@tabler/icons-react";
6
6
  import { cn } from "../../../infra/utils/clsx";
7
7
  import { hideCrisp, showCrisp } from "../../embeds/CrispEmbed";
8
- import { OverlayLayerContext, useDialogLayer, useOverlayLayer } from "./layers";
9
- function Sheet({ open, defaultOpen, onOpenChange, modal = false, ...props }) {
8
+ import {
9
+ OverlayLayerContext,
10
+ OverlayTopContext,
11
+ useDialogLayer,
12
+ useIsTopOverlay,
13
+ useOverlayPosition,
14
+ useTopLayerScrollIsolation
15
+ } from "./layers";
16
+ function Sheet({ open, defaultOpen, onOpenChange, modal = true, ...props }) {
10
17
  const [openState, setOpenState] = React.useState(defaultOpen ?? false);
11
- const layer = useOverlayLayer(open ?? openState);
18
+ const { layer, isTop } = useOverlayPosition(open ?? openState);
12
19
  const handleOpenChange = React.useCallback((next) => {
13
20
  if (next) hideCrisp();
14
21
  else showCrisp();
15
22
  setOpenState(next);
16
23
  onOpenChange?.(next);
17
24
  }, [onOpenChange]);
18
- return /* @__PURE__ */ jsx(OverlayLayerContext.Provider, { value: layer, children: /* @__PURE__ */ jsx(
25
+ return /* @__PURE__ */ jsx(OverlayLayerContext.Provider, { value: layer, children: /* @__PURE__ */ jsx(OverlayTopContext.Provider, { value: isTop, children: /* @__PURE__ */ jsx(
19
26
  SheetPrimitive.Root,
20
27
  {
21
28
  "data-slot": "sheet",
@@ -25,7 +32,7 @@ function Sheet({ open, defaultOpen, onOpenChange, modal = false, ...props }) {
25
32
  onOpenChange: handleOpenChange,
26
33
  ...props
27
34
  }
28
- ) });
35
+ ) }) });
29
36
  }
30
37
  function SheetTrigger({
31
38
  ...props
@@ -51,12 +58,15 @@ function SheetOverlay({
51
58
  "div",
52
59
  {
53
60
  "data-slot": "sheet-overlay",
61
+ ...props,
54
62
  className: cn(
55
- "animate-in fade-in-0 fixed inset-0 bg-black/50 cursor-default",
63
+ // `pointer-events-auto` explícito: este overlay é um div nosso, e quando o sheet abre
64
+ // por cima de um dialog o Radix trava `pointer-events: none` no body — sem isto ele
65
+ // herdaria o bloqueio, viraria só cor e os cliques atravessariam para o que está atrás.
66
+ "animate-in fade-in-0 fixed inset-0 bg-black/50 cursor-default pointer-events-auto",
56
67
  layer.overlay,
57
68
  className
58
- ),
59
- ...props
69
+ )
60
70
  }
61
71
  ) });
62
72
  }
@@ -66,15 +76,23 @@ function SheetContent({
66
76
  side = "right",
67
77
  showCloseButton = true,
68
78
  noAnimation = false,
79
+ ref,
69
80
  ...props
70
81
  }) {
71
82
  const layer = useDialogLayer();
83
+ const contentRef = React.useRef(null);
84
+ useTopLayerScrollIsolation(contentRef, useIsTopOverlay());
72
85
  return /* @__PURE__ */ jsxs(SheetPortal, { children: [
73
86
  /* @__PURE__ */ jsx(SheetOverlay, { className: noAnimation ? "!animate-none" : void 0 }),
74
87
  /* @__PURE__ */ jsxs(
75
88
  SheetPrimitive.Content,
76
89
  {
77
90
  "data-slot": "sheet-content",
91
+ ref: (node) => {
92
+ contentRef.current = node;
93
+ if (typeof ref === "function") ref(node);
94
+ else if (ref) ref.current = node;
95
+ },
78
96
  onInteractOutside: (e) => e.preventDefault(),
79
97
  onPointerDownOutside: (e) => e.preventDefault(),
80
98
  className: cn(
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/ui/overlay/Sheet.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as SheetPrimitive from \"@radix-ui/react-dialog\";\nimport { IconX } from '@tabler/icons-react';\nimport { cn } from \"../../../infra/utils/clsx\";\nimport { hideCrisp, showCrisp } from \"../../embeds/CrispEmbed\";\nimport { OverlayLayerContext, useDialogLayer, useOverlayLayer } from \"./layers\";\n\nfunction Sheet({ open, defaultOpen, onOpenChange, modal = false, ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {\n const [openState, setOpenState] = React.useState(defaultOpen ?? false);\n const layer = useOverlayLayer(open ?? openState);\n\n const handleOpenChange = React.useCallback((next: boolean) => {\n if (next) hideCrisp();\n else showCrisp();\n setOpenState(next);\n onOpenChange?.(next);\n }, [onOpenChange]);\n\n return (\n <OverlayLayerContext.Provider value={layer}>\n <SheetPrimitive.Root\n data-slot=\"sheet\"\n modal={modal}\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={handleOpenChange}\n {...props}\n />\n </OverlayLayerContext.Provider>\n );\n}\n\nfunction SheetTrigger({\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Trigger>) {\n return <SheetPrimitive.Trigger data-slot=\"sheet-trigger\" {...props} />;\n}\n\nfunction SheetClose({\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Close>) {\n return <SheetPrimitive.Close data-slot=\"sheet-close\" {...props} />;\n}\n\nfunction SheetPortal({\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Portal>) {\n return <SheetPrimitive.Portal data-slot=\"sheet-portal\" {...props} />;\n}\n\nfunction SheetOverlay({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n const layer = useDialogLayer();\n return (\n <SheetPrimitive.Close tabIndex={-1} asChild>\n <div\n data-slot=\"sheet-overlay\"\n className={cn(\n \"animate-in fade-in-0 fixed inset-0 bg-black/50 cursor-default\",\n layer.overlay,\n className,\n )}\n {...props}\n />\n </SheetPrimitive.Close>\n );\n}\n\nfunction SheetContent({\n className,\n children,\n side = \"right\",\n showCloseButton = true,\n noAnimation = false,\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Content> & {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n showCloseButton?: boolean;\n noAnimation?: boolean;\n}) {\n const layer = useDialogLayer();\n return (\n <SheetPortal>\n <SheetOverlay className={noAnimation ? \"!animate-none\" : undefined} />\n <SheetPrimitive.Content\n data-slot=\"sheet-content\"\n onInteractOutside={(e) => e.preventDefault()}\n onPointerDownOutside={(e) => e.preventDefault()}\n className={cn(\n \"bg-background fixed flex flex-col gap-4 shadow-lg\",\n layer.content,\n !noAnimation &&\n \"data-[state=open]:animate-in data-[state=closed]:animate-out transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500\",\n !noAnimation &&\n side === \"right\" &&\n \"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right\",\n !noAnimation &&\n side === \"left\" &&\n \"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left\",\n !noAnimation &&\n side === \"top\" &&\n \"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top\",\n !noAnimation &&\n side === \"bottom\" &&\n \"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom\",\n side === \"right\" &&\n \"inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm\",\n side === \"left\" &&\n \"inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm\",\n side === \"top\" && \"inset-x-0 top-0 h-auto border-b\",\n side === \"bottom\" && \"inset-x-0 bottom-0 h-auto border-t\",\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <SheetPrimitive.Close\n data-slot=\"sheet-close\"\n className=\"absolute top-3 right-3 hover:cursor-pointer flex size-8 items-center justify-center rounded-lg p-2 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-950 focus:outline-none\"\n >\n <IconX className=\"size-[18px]\" />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n )}\n </SheetPrimitive.Content>\n </SheetPortal>\n );\n}\n\nfunction SheetHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sheet-header\"\n className={cn(\"flex flex-col gap-1.5 p-4\", className)}\n {...props}\n />\n );\n}\n\nfunction SheetFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sheet-footer\"\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n );\n}\n\nfunction SheetTitle({\n className,\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Title>) {\n return (\n <SheetPrimitive.Title\n data-slot=\"sheet-title\"\n className={cn(\"text-foreground font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction SheetDescription({\n className,\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Description>) {\n return (\n <SheetPrimitive.Description\n data-slot=\"sheet-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Sheet,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n};\n"],"mappings":";AAsBM,cAmGI,YAnGJ;AApBN,YAAY,WAAW;AACvB,YAAY,oBAAoB;AAChC,SAAS,aAAa;AACtB,SAAS,UAAU;AACnB,SAAS,WAAW,iBAAiB;AACrC,SAAS,qBAAqB,gBAAgB,uBAAuB;AAErE,SAAS,MAAM,EAAE,MAAM,aAAa,cAAc,QAAQ,OAAO,GAAG,MAAM,GAAqD;AAC7H,QAAM,CAAC,WAAW,YAAY,IAAI,MAAM,SAAS,eAAe,KAAK;AACrE,QAAM,QAAQ,gBAAgB,QAAQ,SAAS;AAE/C,QAAM,mBAAmB,MAAM,YAAY,CAAC,SAAkB;AAC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iBAAiB;AAAA,EACxB;AAAA,EACA,GAAG;AACL,GAA4D;AAC1D,SACE;AAAA,IAAC,eAAe;AAAA,IAAf;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,iCAAiC,SAAS;AAAA,MACvD,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../../../src/components/ui/overlay/Sheet.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as SheetPrimitive from \"@radix-ui/react-dialog\";\nimport { IconX } from '@tabler/icons-react';\nimport { cn } from \"../../../infra/utils/clsx\";\nimport { hideCrisp, showCrisp } from \"../../embeds/CrispEmbed\";\nimport {\n OverlayLayerContext,\n OverlayTopContext,\n useDialogLayer,\n useIsTopOverlay,\n useOverlayPosition,\n useTopLayerScrollIsolation,\n} from \"./layers\";\n\n/** `modal` ligado por padrão: drawer segura o foco e o fundo enquanto está aberto. */\nfunction Sheet({ open, defaultOpen, onOpenChange, modal = true, ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {\n const [openState, setOpenState] = React.useState(defaultOpen ?? false);\n const { layer, isTop } = useOverlayPosition(open ?? openState);\n\n const handleOpenChange = React.useCallback((next: boolean) => {\n if (next) hideCrisp();\n else showCrisp();\n setOpenState(next);\n onOpenChange?.(next);\n }, [onOpenChange]);\n\n return (\n <OverlayLayerContext.Provider value={layer}>\n <OverlayTopContext.Provider value={isTop}>\n <SheetPrimitive.Root\n data-slot=\"sheet\"\n modal={modal}\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={handleOpenChange}\n {...props}\n />\n </OverlayTopContext.Provider>\n </OverlayLayerContext.Provider>\n );\n}\n\nfunction SheetTrigger({\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Trigger>) {\n return <SheetPrimitive.Trigger data-slot=\"sheet-trigger\" {...props} />;\n}\n\nfunction SheetClose({\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Close>) {\n return <SheetPrimitive.Close data-slot=\"sheet-close\" {...props} />;\n}\n\nfunction SheetPortal({\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Portal>) {\n return <SheetPrimitive.Portal data-slot=\"sheet-portal\" {...props} />;\n}\n\nfunction SheetOverlay({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n const layer = useDialogLayer();\n return (\n <SheetPrimitive.Close tabIndex={-1} asChild>\n <div\n data-slot=\"sheet-overlay\"\n {...props}\n className={cn(\n // `pointer-events-auto` explícito: este overlay é um div nosso, e quando o sheet abre\n // por cima de um dialog o Radix trava `pointer-events: none` no body — sem isto ele\n // herdaria o bloqueio, viraria só cor e os cliques atravessariam para o que está atrás.\n \"animate-in fade-in-0 fixed inset-0 bg-black/50 cursor-default pointer-events-auto\",\n layer.overlay,\n className,\n )}\n />\n </SheetPrimitive.Close>\n );\n}\n\nfunction SheetContent({\n className,\n children,\n side = \"right\",\n showCloseButton = true,\n noAnimation = false,\n ref,\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Content> & {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n showCloseButton?: boolean;\n noAnimation?: boolean;\n}) {\n const layer = useDialogLayer();\n const contentRef = React.useRef<HTMLDivElement>(null);\n useTopLayerScrollIsolation(contentRef, useIsTopOverlay());\n return (\n <SheetPortal>\n <SheetOverlay className={noAnimation ? \"!animate-none\" : undefined} />\n <SheetPrimitive.Content\n data-slot=\"sheet-content\"\n ref={(node) => {\n contentRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n onInteractOutside={(e) => e.preventDefault()}\n onPointerDownOutside={(e) => e.preventDefault()}\n className={cn(\n \"bg-background fixed flex flex-col gap-4 shadow-lg\",\n layer.content,\n !noAnimation &&\n \"data-[state=open]:animate-in data-[state=closed]:animate-out transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500\",\n !noAnimation &&\n side === \"right\" &&\n \"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right\",\n !noAnimation &&\n side === \"left\" &&\n \"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left\",\n !noAnimation &&\n side === \"top\" &&\n \"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top\",\n !noAnimation &&\n side === \"bottom\" &&\n \"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom\",\n side === \"right\" &&\n \"inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm\",\n side === \"left\" &&\n \"inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm\",\n side === \"top\" && \"inset-x-0 top-0 h-auto border-b\",\n side === \"bottom\" && \"inset-x-0 bottom-0 h-auto border-t\",\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <SheetPrimitive.Close\n data-slot=\"sheet-close\"\n className=\"absolute top-3 right-3 hover:cursor-pointer flex size-8 items-center justify-center rounded-lg p-2 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-950 focus:outline-none\"\n >\n <IconX className=\"size-[18px]\" />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n )}\n </SheetPrimitive.Content>\n </SheetPortal>\n );\n}\n\nfunction SheetHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sheet-header\"\n className={cn(\"flex flex-col gap-1.5 p-4\", className)}\n {...props}\n />\n );\n}\n\nfunction SheetFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sheet-footer\"\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n );\n}\n\nfunction SheetTitle({\n className,\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Title>) {\n return (\n <SheetPrimitive.Title\n data-slot=\"sheet-title\"\n className={cn(\"text-foreground font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction SheetDescription({\n className,\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Description>) {\n return (\n <SheetPrimitive.Description\n data-slot=\"sheet-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Sheet,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n};\n"],"mappings":";AA+BM,cA+GI,YA/GJ;AA7BN,YAAY,WAAW;AACvB,YAAY,oBAAoB;AAChC,SAAS,aAAa;AACtB,SAAS,UAAU;AACnB,SAAS,WAAW,iBAAiB;AACrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,MAAM,EAAE,MAAM,aAAa,cAAc,QAAQ,MAAM,GAAG,MAAM,GAAqD;AAC5H,QAAM,CAAC,WAAW,YAAY,IAAI,MAAM,SAAS,eAAe,KAAK;AACrE,QAAM,EAAE,OAAO,MAAM,IAAI,mBAAmB,QAAQ,SAAS;AAE7D,QAAM,mBAAmB,MAAM,YAAY,CAAC,SAAkB;AAC5D,QAAI,KAAM,WAAU;AAAA,QACf,WAAU;AACf,iBAAa,IAAI;AACjB,mBAAe,IAAI;AAAA,EACrB,GAAG,CAAC,YAAY,CAAC;AAEjB,SACE,oBAAC,oBAAoB,UAApB,EAA6B,OAAO,OACnC,8BAAC,kBAAkB,UAAlB,EAA2B,OAAO,OACnC;AAAA,IAAC,eAAe;AAAA,IAAf;AAAA,MACC,aAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA,cAAc;AAAA,MACb,GAAG;AAAA;AAAA,EACN,GACA,GACF;AAEJ;AAEA,SAAS,aAAa;AAAA,EACpB,GAAG;AACL,GAAwD;AACtD,SAAO,oBAAC,eAAe,SAAf,EAAuB,aAAU,iBAAiB,GAAG,OAAO;AACtE;AAEA,SAAS,WAAW;AAAA,EAClB,GAAG;AACL,GAAsD;AACpD,SAAO,oBAAC,eAAe,OAAf,EAAqB,aAAU,eAAe,GAAG,OAAO;AAClE;AAEA,SAAS,YAAY;AAAA,EACnB,GAAG;AACL,GAAu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SAAS;AAAA,UAClB,SAAS,YAAY;AAAA,UACrB;AAAA,QACF;AAAA,QACC,GAAG;AAAA,QAEH;AAAA;AAAA,UACA,mBACC;AAAA,YAAC,eAAe;AAAA,YAAf;AAAA,cACC,aAAU;AAAA,cACV,WAAU;AAAA,cAEV;AAAA,oCAAC,SAAM,WAAU,eAAc;AAAA,gBAC/B,oBAAC,UAAK,WAAU,WAAU,mBAAK;AAAA;AAAA;AAAA,UACjC;AAAA;AAAA;AAAA,IAEJ;AAAA,KACF;AAEJ;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,MAAM,GAAgC;AACzE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,6BAA6B,SAAS;AAAA,MACnD,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,MAAM,GAAgC;AACzE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,mCAAmC,SAAS;AAAA,MACzD,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,WAAW;AAAA,EAClB;AAAA,EACA,GAAG;AACL,GAAsD;AACpD,SACE;AAAA,IAAC,eAAe;AAAA,IAAf;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,iCAAiC,SAAS;AAAA,MACvD,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,iBAAiB;AAAA,EACxB;AAAA,EACA,GAAG;AACL,GAA4D;AAC1D,SACE;AAAA,IAAC,eAAe;AAAA,IAAf;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,iCAAiC,SAAS;AAAA,MACvD,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
@@ -25,12 +25,21 @@ function warnOnSaturation() {
25
25
  );
26
26
  }
27
27
  const OverlayLayerContext = React.createContext(ROOT_LAYER);
28
- function useOverlayLayer(open) {
29
- const [rank, setRank] = React.useState(0);
28
+ const OverlayTopContext = React.createContext(true);
29
+ function useIsTopOverlay() {
30
+ return React.useContext(OverlayTopContext);
31
+ }
32
+ function readPosition(token) {
33
+ const tokens = Array.from(openOverlays);
34
+ const index = tokens.indexOf(token);
35
+ return { rank: Math.max(index, 0), isTop: index === tokens.length - 1 };
36
+ }
37
+ function useOverlayPosition(open) {
38
+ const [position, setPosition] = React.useState({ rank: 0, isTop: true });
30
39
  React.useLayoutEffect(() => {
31
40
  if (!open) return;
32
41
  const token = {};
33
- const sync = () => setRank(Math.max(Array.from(openOverlays).indexOf(token), 0));
42
+ const sync = () => setPosition(readPosition(token));
34
43
  overlayListeners.add(sync);
35
44
  openOverlays.add(token);
36
45
  notifyOverlays();
@@ -41,7 +50,13 @@ function useOverlayLayer(open) {
41
50
  notifyOverlays();
42
51
  };
43
52
  }, [open]);
44
- return OVERLAY_LAYERS[Math.min(rank, OVERLAY_LAYERS.length - 1)];
53
+ return {
54
+ layer: OVERLAY_LAYERS[Math.min(position.rank, OVERLAY_LAYERS.length - 1)],
55
+ isTop: position.isTop
56
+ };
57
+ }
58
+ function useOverlayLayer(open) {
59
+ return useOverlayPosition(open).layer;
45
60
  }
46
61
  function useDialogLayer() {
47
62
  return React.useContext(OverlayLayerContext);
@@ -49,12 +64,44 @@ function useDialogLayer() {
49
64
  function DialogLayer({ children }) {
50
65
  return children;
51
66
  }
67
+ const FLOATING_CONTENT_SELECTOR = [
68
+ "[data-radix-popper-content-wrapper]",
69
+ "[data-radix-menu-content]",
70
+ '[data-slot="select-content"]',
71
+ '[data-slot="popover-content"]',
72
+ '[data-slot="dropdown-menu-content"]',
73
+ '[data-slot="command-list"]',
74
+ '[role="listbox"]',
75
+ '[role="menu"]'
76
+ ].join(",");
77
+ function useTopLayerScrollIsolation(ref, enabled) {
78
+ React.useEffect(() => {
79
+ if (!enabled) return;
80
+ const stopForThisLayer = (event) => {
81
+ const target = event.target;
82
+ if (!target) return;
83
+ const isFloatingContent = target instanceof Element && target.closest(FLOATING_CONTENT_SELECTOR) !== null;
84
+ if (isFloatingContent || ref.current?.contains(target)) event.stopPropagation();
85
+ };
86
+ const options = { capture: true };
87
+ document.addEventListener("wheel", stopForThisLayer, options);
88
+ document.addEventListener("touchmove", stopForThisLayer, options);
89
+ return () => {
90
+ document.removeEventListener("wheel", stopForThisLayer, options);
91
+ document.removeEventListener("touchmove", stopForThisLayer, options);
92
+ };
93
+ }, [ref, enabled]);
94
+ }
52
95
  export {
53
96
  DialogLayer,
54
97
  OVERLAY_LAYERS,
55
98
  OverlayLayerContext,
99
+ OverlayTopContext,
56
100
  ROOT_LAYER,
57
101
  useDialogLayer,
58
- useOverlayLayer
102
+ useIsTopOverlay,
103
+ useOverlayLayer,
104
+ useOverlayPosition,
105
+ useTopLayerScrollIsolation
59
106
  };
60
107
  //# sourceMappingURL=layers.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/ui/overlay/layers.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nexport const OVERLAY_LAYERS = [\n { overlay: \"z-[1000]\", content: \"z-[1001]\", popover: \"z-[1002]\", tooltip: \"z-[1003]\" },\n { overlay: \"z-[1010]\", content: \"z-[1011]\", popover: \"z-[1012]\", tooltip: \"z-[1013]\" },\n { overlay: \"z-[1020]\", content: \"z-[1021]\", popover: \"z-[1022]\", tooltip: \"z-[1023]\" },\n { overlay: \"z-[1030]\", content: \"z-[1031]\", popover: \"z-[1032]\", tooltip: \"z-[1033]\" },\n { overlay: \"z-[1040]\", content: \"z-[1041]\", popover: \"z-[1042]\", tooltip: \"z-[1043]\" },\n { overlay: \"z-[1050]\", content: \"z-[1051]\", popover: \"z-[1052]\", tooltip: \"z-[1053]\" },\n { overlay: \"z-[1060]\", content: \"z-[1061]\", popover: \"z-[1062]\", tooltip: \"z-[1063]\" },\n { overlay: \"z-[1070]\", content: \"z-[1071]\", popover: \"z-[1072]\", tooltip: \"z-[1073]\" },\n] as const;\n\nexport const ROOT_LAYER = { overlay: \"z-[1000]\", content: \"z-[1001]\", popover: \"z-[1002]\", tooltip: \"z-50\" } as const;\n\nexport type DialogLayerClasses = (typeof OVERLAY_LAYERS)[number] | typeof ROOT_LAYER;\n\nconst openOverlays = new Set<object>();\nconst overlayListeners = new Set<() => void>();\nlet saturationWarned = false;\n\nfunction notifyOverlays() {\n overlayListeners.forEach((listener) => listener());\n}\n\nfunction warnOnSaturation() {\n if (process.env.NODE_ENV === \"production\" || saturationWarned || openOverlays.size <= OVERLAY_LAYERS.length) return;\n saturationWarned = true;\n console.warn(\n `[great-lib-common] ${openOverlays.size} overlays visiveis, mas a escala de z so tem ${OVERLAY_LAYERS.length} faixas. ` +\n `Deste nivel em diante todos dividem a ultima faixa e o overlay de cima cai sob o conteudo de baixo. ` +\n `Se o empilhamento for legitimo, adicione uma faixa em ui/overlay/layers.tsx.`,\n );\n}\n\nexport const OverlayLayerContext = React.createContext<DialogLayerClasses>(ROOT_LAYER);\n\nexport function useOverlayLayer(open: boolean): DialogLayerClasses {\n const [rank, setRank] = React.useState(0);\n\n React.useLayoutEffect(() => {\n if (!open) return;\n\n const token = {};\n const sync = () => setRank(Math.max(Array.from(openOverlays).indexOf(token), 0));\n\n overlayListeners.add(sync);\n openOverlays.add(token);\n notifyOverlays();\n warnOnSaturation();\n\n return () => {\n overlayListeners.delete(sync);\n openOverlays.delete(token);\n notifyOverlays();\n };\n }, [open]);\n\n return OVERLAY_LAYERS[Math.min(rank, OVERLAY_LAYERS.length - 1)];\n}\n\nexport function useDialogLayer(): DialogLayerClasses {\n return React.useContext(OverlayLayerContext);\n}\n\nexport function DialogLayer({ children }: { children: React.ReactNode }) {\n return children;\n}\n"],"mappings":";AAEA,YAAY,WAAW;AAEhB,MAAM,iBAAiB;AAAA,EAC5B,EAAE,SAAS,YAAY,SAAS,YAAY,SAAS,YAAY,SAAS,WAAW;AAAA,EACrF,EAAE,SAAS,YAAY,SAAS,YAAY,SAAS,YAAY,SAAS,WAAW;AAAA,EACrF,EAAE,SAAS,YAAY,SAAS,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OAAO,KAAK;AACzB,qBAAe;AAAA,IACjB;AAAA,EACF,GAAG,CAAC,IAAI,CAAC;AAET,SAAO,eAAe,KAAK,IAAI,MAAM,eAAe,SAAS,CAAC,CAAC;AACjE;AAEO,SAAS,iBAAqC;AACnD,SAAO,MAAM,WAAW,mBAAmB;AAC7C;AAEO,SAAS,YAAY,EAAE,SAAS,GAAkC;AACvE,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../../src/components/ui/overlay/layers.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nexport const OVERLAY_LAYERS = [\n { overlay: \"z-[1000]\", content: \"z-[1001]\", popover: \"z-[1002]\", tooltip: \"z-[1003]\" },\n { overlay: \"z-[1010]\", content: \"z-[1011]\", popover: \"z-[1012]\", tooltip: \"z-[1013]\" },\n { overlay: \"z-[1020]\", content: \"z-[1021]\", popover: \"z-[1022]\", tooltip: \"z-[1023]\" },\n { overlay: \"z-[1030]\", content: \"z-[1031]\", popover: \"z-[1032]\", tooltip: \"z-[1033]\" },\n { overlay: \"z-[1040]\", content: \"z-[1041]\", popover: \"z-[1042]\", tooltip: \"z-[1043]\" },\n { overlay: \"z-[1050]\", content: \"z-[1051]\", popover: \"z-[1052]\", tooltip: \"z-[1053]\" },\n { overlay: \"z-[1060]\", content: \"z-[1061]\", popover: \"z-[1062]\", tooltip: \"z-[1063]\" },\n { overlay: \"z-[1070]\", content: \"z-[1071]\", popover: \"z-[1072]\", tooltip: \"z-[1073]\" },\n] as const;\n\nexport const ROOT_LAYER = { overlay: \"z-[1000]\", content: \"z-[1001]\", popover: \"z-[1002]\", tooltip: \"z-50\" } as const;\n\nexport type DialogLayerClasses = (typeof OVERLAY_LAYERS)[number] | typeof ROOT_LAYER;\n\nconst openOverlays = new Set<object>();\nconst overlayListeners = new Set<() => void>();\nlet saturationWarned = false;\n\nfunction notifyOverlays() {\n overlayListeners.forEach((listener) => listener());\n}\n\nfunction warnOnSaturation() {\n if (process.env.NODE_ENV === \"production\" || saturationWarned || openOverlays.size <= OVERLAY_LAYERS.length) return;\n saturationWarned = true;\n console.warn(\n `[great-lib-common] ${openOverlays.size} overlays visiveis, mas a escala de z so tem ${OVERLAY_LAYERS.length} faixas. ` +\n `Deste nivel em diante todos dividem a ultima faixa e o overlay de cima cai sob o conteudo de baixo. ` +\n `Se o empilhamento for legitimo, adicione uma faixa em ui/overlay/layers.tsx.`,\n );\n}\n\nexport const OverlayLayerContext = React.createContext<DialogLayerClasses>(ROOT_LAYER);\n\n/** Se a camada em volta é a do topo da pilha (ver `useTopLayerScrollIsolation`). */\nexport const OverlayTopContext = React.createContext<boolean>(true);\n\nexport function useIsTopOverlay(): boolean {\n return React.useContext(OverlayTopContext);\n}\n\ntype OverlayPosition = { layer: DialogLayerClasses; isTop: boolean };\n\nfunction readPosition(token: object): { rank: number; isTop: boolean } {\n const tokens = Array.from(openOverlays);\n const index = tokens.indexOf(token);\n return { rank: Math.max(index, 0), isTop: index === tokens.length - 1 };\n}\n\n/**\n * Faixa de z do overlay e se ele é o de cima da pilha.\n *\n * O `isTop` existe por causa do bloqueio de scroll: o Radix cancela wheel e touchmove de tudo\n * que não seja filho do conteúdo dele, e cada overlay vive no próprio portal. Com dois modais\n * ativos, o de baixo cancelaria a rolagem do de cima — então quem não está no topo deixa de ser\n * modal enquanto houver alguém acima.\n */\nexport function useOverlayPosition(open: boolean): OverlayPosition {\n const [position, setPosition] = React.useState({ rank: 0, isTop: true });\n\n React.useLayoutEffect(() => {\n if (!open) return;\n\n const token = {};\n const sync = () => setPosition(readPosition(token));\n\n overlayListeners.add(sync);\n openOverlays.add(token);\n notifyOverlays();\n warnOnSaturation();\n\n return () => {\n overlayListeners.delete(sync);\n openOverlays.delete(token);\n notifyOverlays();\n };\n }, [open]);\n\n return {\n layer: OVERLAY_LAYERS[Math.min(position.rank, OVERLAY_LAYERS.length - 1)],\n isTop: position.isTop,\n };\n}\n\nexport function useOverlayLayer(open: boolean): DialogLayerClasses {\n return useOverlayPosition(open).layer;\n}\n\nexport function useDialogLayer(): DialogLayerClasses {\n return React.useContext(OverlayLayerContext);\n}\n\nexport function DialogLayer({ children }: { children: React.ReactNode }) {\n return children;\n}\n\n/**\n * Isola a rolagem desta camada do bloqueio de scroll das camadas de baixo.\n *\n * O bloqueio do Radix escuta wheel e touchmove no document e cancela tudo que não seja filho do\n * conteúdo dele. Cada overlay vive no próprio portal, então o modal de baixo cancelava a rolagem\n * do drawer de cima — e de um jeito traiçoeiro: evento avulso passava, rajada de trackpad era\n * cancelada inteira. Parar a propagação na captura impede que aquele ouvinte chegue a ver o\n * evento, e o navegador rola normalmente.\n *\n * O custo é que `onWheel`/`onTouchMove` de React dentro desta camada deixam de receber esses dois\n * eventos — nada na lib depende disso (listas paginam por `scroll` e por sentinela).\n */\n/** Portais de conteúdo flutuante do Radix que acompanham a camada aberta. */\nconst FLOATING_CONTENT_SELECTOR = [\n \"[data-radix-popper-content-wrapper]\",\n \"[data-radix-menu-content]\",\n '[data-slot=\"select-content\"]',\n '[data-slot=\"popover-content\"]',\n '[data-slot=\"dropdown-menu-content\"]',\n '[data-slot=\"command-list\"]',\n '[role=\"listbox\"]',\n '[role=\"menu\"]',\n].join(\",\");\n\nexport function useTopLayerScrollIsolation(\n ref: React.RefObject<HTMLElement | null>,\n enabled: boolean,\n) {\n React.useEffect(() => {\n if (!enabled) return;\n\n const stopForThisLayer = (event: Event) => {\n const target = event.target as Node | null;\n if (!target) return;\n\n // Conteúdo flutuante (select, popover, menu) abre em portal próprio, fora do conteúdo da\n // camada, mas pertence a ela — sem isto, lista longa de select dentro do modal não rolava.\n const isFloatingContent =\n target instanceof Element && target.closest(FLOATING_CONTENT_SELECTOR) !== null;\n\n if (isFloatingContent || ref.current?.contains(target)) event.stopPropagation();\n };\n\n const options = { capture: true } as const;\n document.addEventListener(\"wheel\", stopForThisLayer, options);\n document.addEventListener(\"touchmove\", stopForThisLayer, options);\n\n return () => {\n document.removeEventListener(\"wheel\", stopForThisLayer, options);\n document.remov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AkB,WAAW,OAAO,QAAQ,yBAAyB,MAAM;AAE7E,UAAI,qBAAqB,IAAI,SAAS,SAAS,MAAM,EAAG,OAAM,gBAAgB;AAAA,IAChF;AAEA,UAAM,UAAU,EAAE,SAAS,KAAK;AAChC,aAAS,iBAAiB,SAAS,kBAAkB,OAAO;AAC5D,aAAS,iBAAiB,aAAa,kBAAkB,OAAO;AAEhE,WAAO,MAAM;AACX,eAAS,oBAAoB,SAAS,kBAAkB,OAAO;AAC/D,eAAS,oBAAoB,aAAa,kBAAkB,OAAO;AAAA,IACrE;AAAA,EACF,GAAG,CAAC,KAAK,OAAO,CAAC;AACnB;","names":[]}
@@ -0,0 +1,13 @@
1
+ var AccountHubFlow = /* @__PURE__ */ ((AccountHubFlow2) => {
2
+ AccountHubFlow2["PLANS"] = "plans";
3
+ AccountHubFlow2["ADDONS"] = "addons";
4
+ AccountHubFlow2["REACTIVATE"] = "reactivate";
5
+ AccountHubFlow2["RECEIPT"] = "receipt";
6
+ AccountHubFlow2["CREATE_PROJECT"] = "create-project";
7
+ AccountHubFlow2["ADD_USER"] = "add-user";
8
+ return AccountHubFlow2;
9
+ })(AccountHubFlow || {});
10
+ export {
11
+ AccountHubFlow
12
+ };
13
+ //# sourceMappingURL=AccountHubFlow.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/enums/AccountHubFlow.ts"],"sourcesContent":["export enum AccountHubFlow {\n PLANS = 'plans',\n ADDONS = 'addons',\n REACTIVATE = 'reactivate',\n RECEIPT = 'receipt',\n CREATE_PROJECT = 'create-project',\n ADD_USER = 'add-user',\n}\n"],"mappings":"AAAO,IAAK,iBAAL,kBAAKA,oBAAL;AACL,EAAAA,gBAAA,WAAQ;AACR,EAAAA,gBAAA,YAAS;AACT,EAAAA,gBAAA,gBAAa;AACb,EAAAA,gBAAA,aAAU;AACV,EAAAA,gBAAA,oBAAiB;AACjB,EAAAA,gBAAA,cAAW;AAND,SAAAA;AAAA,GAAA;","names":["AccountHubFlow"]}
@@ -0,0 +1,22 @@
1
+ var DateFilterPeriod = /* @__PURE__ */ ((DateFilterPeriod2) => {
2
+ DateFilterPeriod2["TODAY"] = "TODAY";
3
+ DateFilterPeriod2["YESTERDAY"] = "YESTERDAY";
4
+ DateFilterPeriod2["LAST_7_DAYS"] = "LAST_7_DAYS";
5
+ DateFilterPeriod2["LAST_30_DAYS"] = "LAST_30_DAYS";
6
+ DateFilterPeriod2["LAST_MONTH"] = "LAST_MONTH";
7
+ DateFilterPeriod2["ALL_TIME"] = "ALL_TIME";
8
+ return DateFilterPeriod2;
9
+ })(DateFilterPeriod || {});
10
+ const DATE_FILTER_PERIODS = [
11
+ "TODAY" /* TODAY */,
12
+ "YESTERDAY" /* YESTERDAY */,
13
+ "LAST_7_DAYS" /* LAST_7_DAYS */,
14
+ "LAST_30_DAYS" /* LAST_30_DAYS */,
15
+ "LAST_MONTH" /* LAST_MONTH */,
16
+ "ALL_TIME" /* ALL_TIME */
17
+ ];
18
+ export {
19
+ DATE_FILTER_PERIODS,
20
+ DateFilterPeriod
21
+ };
22
+ //# sourceMappingURL=DateFilterPeriod.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/enums/DateFilterPeriod.ts"],"sourcesContent":["export enum DateFilterPeriod {\n TODAY = 'TODAY',\n YESTERDAY = 'YESTERDAY',\n LAST_7_DAYS = 'LAST_7_DAYS',\n LAST_30_DAYS = 'LAST_30_DAYS',\n LAST_MONTH = 'LAST_MONTH',\n ALL_TIME = 'ALL_TIME',\n}\n\nexport const DATE_FILTER_PERIODS = [\n DateFilterPeriod.TODAY,\n DateFilterPeriod.YESTERDAY,\n DateFilterPeriod.LAST_7_DAYS,\n DateFilterPeriod.LAST_30_DAYS,\n DateFilterPeriod.LAST_MONTH,\n DateFilterPeriod.ALL_TIME,\n] as const;\n"],"mappings":"AAAO,IAAK,mBAAL,kBAAKA,sBAAL;AACL,EAAAA,kBAAA,WAAQ;AACR,EAAAA,kBAAA,eAAY;AACZ,EAAAA,kBAAA,iBAAc;AACd,EAAAA,kBAAA,kBAAe;AACf,EAAAA,kBAAA,gBAAa;AACb,EAAAA,kBAAA,cAAW;AAND,SAAAA;AAAA,GAAA;AASL,MAAM,sBAAsB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":["DateFilterPeriod"]}
@@ -0,0 +1,11 @@
1
+ var WorkspaceSectionType = /* @__PURE__ */ ((WorkspaceSectionType2) => {
2
+ WorkspaceSectionType2["SUBSCRIPTION"] = "subscription";
3
+ WorkspaceSectionType2["PROJECTS"] = "projects";
4
+ WorkspaceSectionType2["TEAM"] = "team";
5
+ WorkspaceSectionType2["AFFILIATES"] = "affiliates";
6
+ return WorkspaceSectionType2;
7
+ })(WorkspaceSectionType || {});
8
+ export {
9
+ WorkspaceSectionType
10
+ };
11
+ //# sourceMappingURL=WorkspaceSectionType.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/enums/WorkspaceSectionType.ts"],"sourcesContent":["export enum WorkspaceSectionType {\n SUBSCRIPTION = 'subscription',\n PROJECTS = 'projects',\n TEAM = 'team',\n AFFILIATES = 'affiliates',\n}\n"],"mappings":"AAAO,IAAK,uBAAL,kBAAKA,0BAAL;AACL,EAAAA,sBAAA,kBAAe;AACf,EAAAA,sBAAA,cAAW;AACX,EAAAA,sBAAA,UAAO;AACP,EAAAA,sBAAA,gBAAa;AAJH,SAAAA;AAAA,GAAA;","names":["WorkspaceSectionType"]}
package/dist/handlers.mjs CHANGED
@@ -13,29 +13,53 @@ import { createFindProjectHandler } from "./modules/projects/handlers/find-proje
13
13
  import { createListProjectUsersHandler } from "./modules/projects/handlers/list-project-users.handler";
14
14
  import { createListAvailableUsersHandler } from "./modules/projects/handlers/list-available-users.handler";
15
15
  import { createListAllAccountUsersHandler } from "./modules/projects/handlers/list-all-account-users.handler";
16
+ import { createListAccountMembersHandler } from "./modules/accounts/handlers/list-account-members.handler";
16
17
  import { createListSubscriptionsHandler } from "./modules/subscriptions/handlers/list-subscriptions.handler";
17
18
  import { createCurrentSubscriptionHandler } from "./modules/subscriptions/handlers/current-subscription.handler";
18
19
  import { createFreezeNoticeHandler } from "./modules/subscriptions/handlers/freeze-notice.handler";
19
20
  import { createListMessagesHandler } from "./modules/users/handlers/list-messages.handler";
21
+ import { createCurrentAffiliateHandler } from "./modules/affiliates/handlers/current-affiliate.handler";
22
+ import { createAffiliateReportAnalyticsHandler } from "./modules/affiliates/handlers/affiliate-report-analytics.handler";
23
+ import { createListAffiliateTransactionsHandler } from "./modules/affiliates/handlers/list-affiliate-transactions.handler";
24
+ import { createListAffiliateCouponsHandler } from "./modules/affiliates/handlers/list-affiliate-coupons.handler";
25
+ import { createListAffiliateLeadsHandler } from "./modules/affiliates/handlers/list-affiliate-leads.handler";
26
+ import { createAffiliateWithdrawalLimitsHandler } from "./modules/affiliates/handlers/affiliate-withdrawal-limits.handler";
27
+ import { createPendingPixStatusHandler } from "./modules/subscriptions/handlers/pending-pix-status.handler";
28
+ import { createListIaCreditOperationsHandler } from "./modules/ia-credits/handlers/list-ia-credit-operations.handler";
29
+ import { createFindCouponByIdHandler } from "./modules/coupons/handlers/find-coupon-by-id.handler";
30
+ import { createFindCouponByCodeHandler } from "./modules/coupons/handlers/find-coupon-by-code.handler";
31
+ import { createCountDomainsHandler } from "./modules/domains/handlers/count-domains.handler";
20
32
  export {
33
+ createAffiliateReportAnalyticsHandler,
34
+ createAffiliateWithdrawalLimitsHandler,
35
+ createCountDomainsHandler,
21
36
  createCountPagesHandler,
37
+ createCurrentAffiliateHandler,
22
38
  createCurrentSubscriptionHandler,
23
39
  createFindCardByIdHandler,
24
40
  createFindChargeByIdHandler,
41
+ createFindCouponByCodeHandler,
42
+ createFindCouponByIdHandler,
25
43
  createFindPlanByIdHandler,
26
44
  createFindProjectHandler,
27
45
  createFreezeNoticeHandler,
28
46
  createGetAiCreditsOfferEligibilityHandler,
47
+ createListAccountMembersHandler,
48
+ createListAffiliateCouponsHandler,
49
+ createListAffiliateLeadsHandler,
50
+ createListAffiliateTransactionsHandler,
29
51
  createListAllAccountUsersHandler,
30
52
  createListAvailableUsersHandler,
31
53
  createListCardsHandler,
32
54
  createListChargesHandler,
55
+ createListIaCreditOperationsHandler,
33
56
  createListIaCreditsHandler,
34
57
  createListMessagesHandler,
35
58
  createListPlansHandler,
36
59
  createListProjectUsersHandler,
37
60
  createListProjectsHandler,
38
61
  createListSubscriptionsHandler,
62
+ createPendingPixStatusHandler,
39
63
  createPurchaseIaCreditsHandler
40
64
  };
41
65
  //# sourceMappingURL=handlers.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/handlers.ts"],"sourcesContent":["export { createListCardsHandler } from './modules/cards/handlers/list-cards.handler';\nexport { createFindCardByIdHandler } from './modules/cards/handlers/find-card-by-id.handler';\n\nexport { createListChargesHandler } from './modules/charges/handlers/list-charges.handler';\nexport { createFindChargeByIdHandler } from './modules/charges/handlers/find-charge-by-id.handler';\n\nexport { createListIaCreditsHandler } from './modules/ia-credits/handlers/list-ia-credits.handler';\nexport { createPurchaseIaCreditsHandler } from './modules/ia-credits/handlers/purchase-ia-credits.handler';\nexport { createGetAiCreditsOfferEligibilityHandler } from './modules/ia-credits/handlers/get-offer-eligibility.handler';\n\nexport { createCountPagesHandler } from './modules/pages/handlers/count-pages.handler';\n\nexport { createListPlansHandler } from './modules/plans/handlers/list-plans.handler';\nexport { createFindPlanByIdHandler } from './modules/plans/handlers/find-plan-by-id.handler';\n\nexport { createListProjectsHandler } from './modules/projects/handlers/list-projects.handler';\nexport { createFindProjectHandler } from './modules/projects/handlers/find-project.handler';\nexport { createListProjectUsersHandler } from './modules/projects/handlers/list-project-users.handler';\nexport { createListAvailableUsersHandler } from './modules/projects/handlers/list-available-users.handler';\nexport { createListAllAccountUsersHandler } from './modules/projects/handlers/list-all-account-users.handler';\n\nexport { createListSubscriptionsHandler } from './modules/subscriptions/handlers/list-subscriptions.handler';\nexport { createCurrentSubscriptionHandler } from './modules/subscriptions/handlers/current-subscription.handler';\nexport { createFreezeNoticeHandler } from './modules/subscriptions/handlers/freeze-notice.handler';\n\nexport { createListMessagesHandler } from './modules/users/handlers/list-messages.handler';\n"],"mappings":"AAAA,SAAS,8BAA8B;AACvC,SAAS,iCAAiC;AAE1C,SAAS,gCAAgC;AACzC,SAAS,mCAAmC;AAE5C,SAAS,kCAAkC;AAC3C,SAAS,sCAAsC;AAC/C,SAAS,iDAAiD;AAE1D,SAAS,+BAA+B;AAExC,SAAS,8BAA8B;AACvC,SAAS,iCAAiC;AAE1C,SAAS,iCAAiC;AAC1C,SAAS,gCAAgC;AACzC,SAAS,qCAAqC;AAC9C,SAAS,uCAAuC;AAChD,SAAS,wCAAwC;AAEjD,SAAS,sCAAsC;AAC/C,SAAS,wCAAwC;AACjD,SAAS,iCAAiC;AAE1C,SAAS,iCAAiC;","names":[]}
1
+ {"version":3,"sources":["../src/handlers.ts"],"sourcesContent":["export { createListCardsHandler } from './modules/cards/handlers/list-cards.handler';\nexport { createFindCardByIdHandler } from './modules/cards/handlers/find-card-by-id.handler';\n\nexport { createListChargesHandler } from './modules/charges/handlers/list-charges.handler';\nexport { createFindChargeByIdHandler } from './modules/charges/handlers/find-charge-by-id.handler';\n\nexport { createListIaCreditsHandler } from './modules/ia-credits/handlers/list-ia-credits.handler';\nexport { createPurchaseIaCreditsHandler } from './modules/ia-credits/handlers/purchase-ia-credits.handler';\nexport { createGetAiCreditsOfferEligibilityHandler } from './modules/ia-credits/handlers/get-offer-eligibility.handler';\n\nexport { createCountPagesHandler } from './modules/pages/handlers/count-pages.handler';\n\nexport { createListPlansHandler } from './modules/plans/handlers/list-plans.handler';\nexport { createFindPlanByIdHandler } from './modules/plans/handlers/find-plan-by-id.handler';\n\nexport { createListProjectsHandler } from './modules/projects/handlers/list-projects.handler';\nexport { createFindProjectHandler } from './modules/projects/handlers/find-project.handler';\nexport { createListProjectUsersHandler } from './modules/projects/handlers/list-project-users.handler';\nexport { createListAvailableUsersHandler } from './modules/projects/handlers/list-available-users.handler';\nexport { createListAllAccountUsersHandler } from './modules/projects/handlers/list-all-account-users.handler';\n\nexport { createListAccountMembersHandler } from './modules/accounts/handlers/list-account-members.handler';\n\nexport { createListSubscriptionsHandler } from './modules/subscriptions/handlers/list-subscriptions.handler';\nexport { createCurrentSubscriptionHandler } from './modules/subscriptions/handlers/current-subscription.handler';\nexport { createFreezeNoticeHandler } from './modules/subscriptions/handlers/freeze-notice.handler';\n\nexport { createListMessagesHandler } from './modules/users/handlers/list-messages.handler';\n\nexport { createCurrentAffiliateHandler } from './modules/affiliates/handlers/current-affiliate.handler';\nexport { createAffiliateReportAnalyticsHandler } from './modules/affiliates/handlers/affiliate-report-analytics.handler';\nexport { createListAffiliateTransactionsHandler } from './modules/affiliates/handlers/list-affiliate-transactions.handler';\nexport { createListAffiliateCouponsHandler } from './modules/affiliates/handlers/list-affiliate-coupons.handler';\nexport { createListAffiliateLeadsHandler } from './modules/affiliates/handlers/list-affiliate-leads.handler';\nexport { createAffiliateWithdrawalLimitsHandler } from './modules/affiliates/handlers/affiliate-withdrawal-limits.handler';\nexport { createPendingPixStatusHandler } from './modules/subscriptions/handlers/pending-pix-status.handler';\nexport { createListIaCreditOperationsHandler } from './modules/ia-credits/handlers/list-ia-credit-operations.handler';\nexport { createFindCouponByIdHandler } from './modules/coupons/handlers/find-coupon-by-id.handler';\nexport { createFindCouponByCodeHandler } from './modules/coupons/handlers/find-coupon-by-code.handler';\nexport { createCountDomainsHandler } from './modules/domains/handlers/count-domains.handler';\n"],"mappings":"AAAA,SAAS,8BAA8B;AACvC,SAAS,iCAAiC;AAE1C,SAAS,gCAAgC;AACzC,SAAS,mCAAmC;AAE5C,SAAS,kCAAkC;AAC3C,SAAS,sCAAsC;AAC/C,SAAS,iDAAiD;AAE1D,SAAS,+BAA+B;AAExC,SAAS,8BAA8B;AACvC,SAAS,iCAAiC;AAE1C,SAAS,iCAAiC;AAC1C,SAAS,gCAAgC;AACzC,SAAS,qCAAqC;AAC9C,SAAS,uCAAuC;AAChD,SAAS,wCAAwC;AAEjD,SAAS,uCAAuC;AAEhD,SAAS,sCAAsC;AAC/C,SAAS,wCAAwC;AACjD,SAAS,iCAAiC;AAE1C,SAAS,iCAAiC;AAE1C,SAAS,qCAAqC;AAC9C,SAAS,6CAA6C;AACtD,SAAS,8CAA8C;AACvD,SAAS,yCAAyC;AAClD,SAAS,uCAAuC;AAChD,SAAS,8CAA8C;AACvD,SAAS,qCAAqC;AAC9C,SAAS,2CAA2C;AACpD,SAAS,mCAAmC;AAC5C,SAAS,qCAAqC;AAC9C,SAAS,iCAAiC;","names":[]}
@@ -1,16 +1,18 @@
1
1
  "use client";
2
- import { useEffect, useState } from "react";
2
+ import { useEffect, useRef, useState } from "react";
3
3
  function useDebounce(value, delay = 400, onDebounce) {
4
4
  const [debouncedValue, setDebouncedValue] = useState(value);
5
+ const onDebounceRef = useRef(onDebounce);
6
+ onDebounceRef.current = onDebounce;
5
7
  useEffect(() => {
6
8
  const handler = setTimeout(() => {
7
9
  setDebouncedValue(value);
8
- onDebounce?.();
10
+ onDebounceRef.current?.();
9
11
  }, delay);
10
12
  return () => {
11
13
  clearTimeout(handler);
12
14
  };
13
- }, [value, delay, onDebounce]);
15
+ }, [value, delay]);
14
16
  return debouncedValue;
15
17
  }
16
18
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/hooks/useDebounce.ts"],"sourcesContent":["'use client';\n\nimport { useEffect, useState } from 'react';\n\n/**\n * Hook para aplicar debounce em valores\n * @param value - Valor a ser debounced\n * @param delay - Delay em milissegundos (padrão: 400ms)\n * @returns Valor debounced\n */\nexport function useDebounce<T>(value: T, delay: number = 400, onDebounce?: () => void): T {\n const [debouncedValue, setDebouncedValue] = useState<T>(value);\n\n useEffect(() => {\n const handler = setTimeout(() => {\n setDebouncedValue(value);\n onDebounce?.();\n }, delay);\n\n return () => {\n clearTimeout(handler);\n };\n }, [value, delay, onDebounce]);\n\n return debouncedValue;\n}\n"],"mappings":";AAEA,SAAS,WAAW,gBAAgB;AAQ7B,SAAS,YAAe,OAAU,QAAgB,KAAK,YAA4B;AACxF,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAAY,KAAK;AAE7D,YAAU,MAAM;AACd,UAAM,UAAU,WAAW,MAAM;AAC/B,wBAAkB,KAAK;AACvB,mBAAa;AAAA,IACf,GAAG,KAAK;AAER,WAAO,MAAM;AACX,mBAAa,OAAO;AAAA,IACtB;AAAA,EACF,GAAG,CAAC,OAAO,OAAO,UAAU,CAAC;AAE7B,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/hooks/useDebounce.ts"],"sourcesContent":["'use client';\n\nimport { useEffect, useRef, useState } from 'react';\n\n/**\n * Hook para aplicar debounce em valores\n * @param value - Valor a ser debounced\n * @param delay - Delay em milissegundos (padrão: 400ms)\n * @returns Valor debounced\n */\nexport function useDebounce<T>(value: T, delay: number = 400, onDebounce?: () => void): T {\n const [debouncedValue, setDebouncedValue] = useState<T>(value);\n const onDebounceRef = useRef(onDebounce);\n onDebounceRef.current = onDebounce;\n\n useEffect(() => {\n const handler = setTimeout(() => {\n setDebouncedValue(value);\n onDebounceRef.current?.();\n }, delay);\n\n return () => {\n clearTimeout(handler);\n };\n }, [value, delay]);\n\n return debouncedValue;\n}\n"],"mappings":";AAEA,SAAS,WAAW,QAAQ,gBAAgB;AAQrC,SAAS,YAAe,OAAU,QAAgB,KAAK,YAA4B;AACxF,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAAY,KAAK;AAC7D,QAAM,gBAAgB,OAAO,UAAU;AACvC,gBAAc,UAAU;AAExB,YAAU,MAAM;AACd,UAAM,UAAU,WAAW,MAAM;AAC/B,wBAAkB,KAAK;AACvB,oBAAc,UAAU;AAAA,IAC1B,GAAG,KAAK;AAER,WAAO,MAAM;AACX,mBAAa,OAAO;AAAA,IACtB;AAAA,EACF,GAAG,CAAC,OAAO,KAAK,CAAC;AAEjB,SAAO;AACT;","names":[]}