@greatapps/common 1.1.789 → 1.1.791
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.
- package/dist/components/account/AccountHubLinkHandler.mjs +36 -0
- package/dist/components/account/AccountHubLinkHandler.mjs.map +1 -0
- package/dist/components/account/AccountModalLayout.mjs +137 -0
- package/dist/components/account/AccountModalLayout.mjs.map +1 -0
- package/dist/components/account/AccountModals.mjs +10 -3
- package/dist/components/account/AccountModals.mjs.map +1 -1
- package/dist/components/account/DeleteAccountModal.mjs +1 -1
- package/dist/components/account/DeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs +8 -1
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/MyAccountModal.mjs +167 -0
- package/dist/components/account/MyAccountModal.mjs.map +1 -0
- package/dist/components/account/TwoFactorAuthModal.mjs +1 -1
- package/dist/components/account/TwoFactorAuthModal.mjs.map +1 -1
- package/dist/components/account/hooks/useAccountHubActions.mjs +85 -0
- package/dist/components/account/hooks/useAccountHubActions.mjs.map +1 -0
- package/dist/components/account/hooks/useAddCardWithPaymentSwitch.mjs +44 -0
- package/dist/components/account/hooks/useAddCardWithPaymentSwitch.mjs.map +1 -0
- package/dist/components/account/hooks/useAffiliatesActions.mjs +69 -0
- package/dist/components/account/hooks/useAffiliatesActions.mjs.map +1 -0
- package/dist/components/account/hooks/useMyAccountModal.mjs +27 -0
- package/dist/components/account/hooks/useMyAccountModal.mjs.map +1 -0
- package/dist/components/account/hooks/useProjectsActions.mjs +40 -0
- package/dist/components/account/hooks/useProjectsActions.mjs.map +1 -0
- package/dist/components/account/hooks/useSubscriptionActions.mjs +87 -0
- package/dist/components/account/hooks/useSubscriptionActions.mjs.map +1 -0
- package/dist/components/account/hooks/useTeamActions.mjs +31 -0
- package/dist/components/account/hooks/useTeamActions.mjs.map +1 -0
- package/dist/components/account/sections/AffiliatesSection.mjs +313 -0
- package/dist/components/account/sections/AffiliatesSection.mjs.map +1 -0
- package/dist/components/account/sections/ChangePasswordSection.mjs +5 -5
- package/dist/components/account/sections/ChangePasswordSection.mjs.map +1 -1
- package/dist/components/account/sections/MyProfileSection.mjs +194 -144
- package/dist/components/account/sections/MyProfileSection.mjs.map +1 -1
- package/dist/components/account/sections/PreferencesSection.mjs +60 -49
- package/dist/components/account/sections/PreferencesSection.mjs.map +1 -1
- package/dist/components/account/sections/ProjectsSection.mjs +77 -0
- package/dist/components/account/sections/ProjectsSection.mjs.map +1 -0
- package/dist/components/account/sections/SecuritySection.mjs +55 -36
- package/dist/components/account/sections/SecuritySection.mjs.map +1 -1
- package/dist/components/account/sections/SubscriptionSection.mjs +29 -0
- package/dist/components/account/sections/SubscriptionSection.mjs.map +1 -0
- package/dist/components/account/sections/TeamSection.mjs +119 -0
- package/dist/components/account/sections/TeamSection.mjs.map +1 -0
- package/dist/components/account/sections/TokenSection.mjs +41 -43
- package/dist/components/account/sections/TokenSection.mjs.map +1 -1
- package/dist/components/account/sections/affiliates/AffiliateCommissionCard.mjs +73 -0
- package/dist/components/account/sections/affiliates/AffiliateCommissionCard.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/AffiliateFlows.mjs +20 -0
- package/dist/components/account/sections/affiliates/AffiliateFlows.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/AffiliateLeadsSheet.mjs +99 -0
- package/dist/components/account/sections/affiliates/AffiliateLeadsSheet.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/AffiliateStatsCard.mjs +31 -0
- package/dist/components/account/sections/affiliates/AffiliateStatsCard.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/AffiliateStepCard.mjs +15 -0
- package/dist/components/account/sections/affiliates/AffiliateStepCard.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/AffiliateTransactionsList.mjs +108 -0
- package/dist/components/account/sections/affiliates/AffiliateTransactionsList.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/NoReceivingAccountModal.mjs +49 -0
- package/dist/components/account/sections/affiliates/NoReceivingAccountModal.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/ReceivingAccountModal.mjs +182 -0
- package/dist/components/account/sections/affiliates/ReceivingAccountModal.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/RequestWithdrawalSheet.mjs +476 -0
- package/dist/components/account/sections/affiliates/RequestWithdrawalSheet.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/ViewAttachmentModal.mjs +34 -0
- package/dist/components/account/sections/affiliates/ViewAttachmentModal.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/reports/AffiliatesIndicatorsChart.mjs +27 -0
- package/dist/components/account/sections/affiliates/reports/AffiliatesIndicatorsChart.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/reports/AffiliatesReportsTab.mjs +30 -0
- package/dist/components/account/sections/affiliates/reports/AffiliatesReportsTab.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/reports/useAffiliatesIndicatorsChart.mjs +120 -0
- package/dist/components/account/sections/affiliates/reports/useAffiliatesIndicatorsChart.mjs.map +1 -0
- package/dist/components/account/sections/projects/DeleteProjectModal.mjs +205 -0
- package/dist/components/account/sections/projects/DeleteProjectModal.mjs.map +1 -0
- package/dist/components/account/sections/projects/ProjectFlows.mjs +16 -0
- package/dist/components/account/sections/projects/ProjectFlows.mjs.map +1 -0
- package/dist/components/account/sections/projects/ProjectMembersStack.mjs +53 -0
- package/dist/components/account/sections/projects/ProjectMembersStack.mjs.map +1 -0
- package/dist/components/account/sections/projects/ProjectRow.mjs +85 -0
- package/dist/components/account/sections/projects/ProjectRow.mjs.map +1 -0
- package/dist/components/account/sections/projects/ProjectSheet.mjs +499 -0
- package/dist/components/account/sections/projects/ProjectSheet.mjs.map +1 -0
- package/dist/components/account/sections/projects/ProjectsDisabledModal.mjs +55 -0
- package/dist/components/account/sections/projects/ProjectsDisabledModal.mjs.map +1 -0
- package/dist/components/account/sections/projects/project-form.schema.mjs +28 -0
- package/dist/components/account/sections/projects/project-form.schema.mjs.map +1 -0
- package/dist/components/account/sections/shared/ConnectListRow.mjs +45 -0
- package/dist/components/account/sections/shared/ConnectListRow.mjs.map +1 -0
- package/dist/components/account/sections/shared/DateFilterPopover.mjs +51 -0
- package/dist/components/account/sections/shared/DateFilterPopover.mjs.map +1 -0
- package/dist/components/account/sections/shared/EntityAvatar.mjs +41 -0
- package/dist/components/account/sections/shared/EntityAvatar.mjs.map +1 -0
- package/dist/components/account/sections/shared/FilterPopover.mjs +62 -0
- package/dist/components/account/sections/shared/FilterPopover.mjs.map +1 -0
- package/dist/components/account/sections/shared/FormSection.mjs +14 -0
- package/dist/components/account/sections/shared/FormSection.mjs.map +1 -0
- package/dist/components/account/sections/shared/IconBox.mjs +18 -0
- package/dist/components/account/sections/shared/IconBox.mjs.map +1 -0
- package/dist/components/account/sections/shared/InfiniteScrollList.mjs +36 -0
- package/dist/components/account/sections/shared/InfiniteScrollList.mjs.map +1 -0
- package/dist/components/account/sections/shared/ListPagination.mjs +69 -0
- package/dist/components/account/sections/shared/ListPagination.mjs.map +1 -0
- package/dist/components/account/sections/shared/RowActionsMenu.mjs +52 -0
- package/dist/components/account/sections/shared/RowActionsMenu.mjs.map +1 -0
- package/dist/components/account/sections/shared/SectionLoadError.mjs +20 -0
- package/dist/components/account/sections/shared/SectionLoadError.mjs.map +1 -0
- package/dist/components/account/sections/shared/StatusBadge.mjs +26 -0
- package/dist/components/account/sections/shared/StatusBadge.mjs.map +1 -0
- package/dist/components/account/sections/shared/WorkspaceSection.mjs +10 -0
- package/dist/components/account/sections/shared/WorkspaceSection.mjs.map +1 -0
- package/dist/components/account/sections/subscription/AiCreditsUsage.mjs +106 -0
- package/dist/components/account/sections/subscription/AiCreditsUsage.mjs.map +1 -0
- package/dist/components/account/sections/subscription/BillingAddressSheet.mjs +407 -0
- package/dist/components/account/sections/subscription/BillingAddressSheet.mjs.map +1 -0
- package/dist/components/account/sections/subscription/BoletoDetailsDialog.mjs +73 -0
- package/dist/components/account/sections/subscription/BoletoDetailsDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/BoletoGeneratedDialog.mjs +22 -0
- package/dist/components/account/sections/subscription/BoletoGeneratedDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/CancelPlanDialog.mjs +161 -0
- package/dist/components/account/sections/subscription/CancelPlanDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/ChargeRow.mjs +127 -0
- package/dist/components/account/sections/subscription/ChargeRow.mjs.map +1 -0
- package/dist/components/account/sections/subscription/ChargeStatusBadge.mjs +27 -0
- package/dist/components/account/sections/subscription/ChargeStatusBadge.mjs.map +1 -0
- package/dist/components/account/sections/subscription/ChargesList.mjs +88 -0
- package/dist/components/account/sections/subscription/ChargesList.mjs.map +1 -0
- package/dist/components/account/sections/subscription/ManageCardsSheet.mjs +49 -0
- package/dist/components/account/sections/subscription/ManageCardsSheet.mjs.map +1 -0
- package/dist/components/account/sections/subscription/OverdueReceiptOpener.mjs +26 -0
- package/dist/components/account/sections/subscription/OverdueReceiptOpener.mjs.map +1 -0
- package/dist/components/account/sections/subscription/PayChargeDialog.mjs +222 -0
- package/dist/components/account/sections/subscription/PayChargeDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/PaymentConfirmationDialog.mjs +61 -0
- package/dist/components/account/sections/subscription/PaymentConfirmationDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/PaymentMethodsCard.mjs +72 -0
- package/dist/components/account/sections/subscription/PaymentMethodsCard.mjs.map +1 -0
- package/dist/components/account/sections/subscription/PendingChangeDialog.mjs +117 -0
- package/dist/components/account/sections/subscription/PendingChangeDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/PixDetailsDialog.mjs +165 -0
- package/dist/components/account/sections/subscription/PixDetailsDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/PixPaymentDialog.mjs +155 -0
- package/dist/components/account/sections/subscription/PixPaymentDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/PlanDetailsSheet.mjs +253 -0
- package/dist/components/account/sections/subscription/PlanDetailsSheet.mjs.map +1 -0
- package/dist/components/account/sections/subscription/ReceiptDetailsSheet.mjs +237 -0
- package/dist/components/account/sections/subscription/ReceiptDetailsSheet.mjs.map +1 -0
- package/dist/components/account/sections/subscription/SubscriptionFlows.mjs +40 -0
- package/dist/components/account/sections/subscription/SubscriptionFlows.mjs.map +1 -0
- package/dist/components/account/sections/subscription/SubscriptionPlanCard.mjs +303 -0
- package/dist/components/account/sections/subscription/SubscriptionPlanCard.mjs.map +1 -0
- package/dist/components/account/sections/subscription/UsageReportSheet.mjs +163 -0
- package/dist/components/account/sections/subscription/UsageReportSheet.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/ChangePlanSheet.mjs +75 -0
- package/dist/components/account/sections/subscription/change-plan/ChangePlanSheet.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/components/AbTestDetailsDialog.mjs +55 -0
- package/dist/components/account/sections/subscription/change-plan/components/AbTestDetailsDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/components/AddonsBlock.mjs +188 -0
- package/dist/components/account/sections/subscription/change-plan/components/AddonsBlock.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/components/AlternativeBucketsSection.mjs +66 -0
- package/dist/components/account/sections/subscription/change-plan/components/AlternativeBucketsSection.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/components/CouponBlock.mjs +42 -0
- package/dist/components/account/sections/subscription/change-plan/components/CouponBlock.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/components/CouponDialog.mjs +119 -0
- package/dist/components/account/sections/subscription/change-plan/components/CouponDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/components/PricePreview.mjs +17 -0
- package/dist/components/account/sections/subscription/change-plan/components/PricePreview.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/components/SummaryBlock.mjs +130 -0
- package/dist/components/account/sections/subscription/change-plan/components/SummaryBlock.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/plan-comparison.mjs +38 -0
- package/dist/components/account/sections/subscription/change-plan/plan-comparison.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/steps/PaymentSummaryStep.mjs +127 -0
- package/dist/components/account/sections/subscription/change-plan/steps/PaymentSummaryStep.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/steps/PlanComparisonStep.mjs +111 -0
- package/dist/components/account/sections/subscription/change-plan/steps/PlanComparisonStep.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/steps/PlanViewStep.mjs +69 -0
- package/dist/components/account/sections/subscription/change-plan/steps/PlanViewStep.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/steps/ReactivationConfigStep.mjs +88 -0
- package/dist/components/account/sections/subscription/change-plan/steps/ReactivationConfigStep.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/steps/ReactivationPaymentStep.mjs +115 -0
- package/dist/components/account/sections/subscription/change-plan/steps/ReactivationPaymentStep.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/useChangePlanState.mjs +918 -0
- package/dist/components/account/sections/subscription/change-plan/useChangePlanState.mjs.map +1 -0
- package/dist/components/account/sections/subscription/downgrade/CannotDowngradeDialog.mjs +216 -0
- package/dist/components/account/sections/subscription/downgrade/CannotDowngradeDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/downgrade/DowngradeReasonDialog.mjs +128 -0
- package/dist/components/account/sections/subscription/downgrade/DowngradeReasonDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/plans/PlanCard.mjs +281 -0
- package/dist/components/account/sections/subscription/plans/PlanCard.mjs.map +1 -0
- package/dist/components/account/sections/subscription/plans/PlanCardSkeleton.mjs +53 -0
- package/dist/components/account/sections/subscription/plans/PlanCardSkeleton.mjs.map +1 -0
- package/dist/components/account/sections/subscription/plans/PlansCatalogDialog.mjs +119 -0
- package/dist/components/account/sections/subscription/plans/PlansCatalogDialog.mjs.map +1 -0
- package/dist/components/account/sections/team/DeleteUserModal.mjs +116 -0
- package/dist/components/account/sections/team/DeleteUserModal.mjs.map +1 -0
- package/dist/components/account/sections/team/TeamFlows.mjs +14 -0
- package/dist/components/account/sections/team/TeamFlows.mjs.map +1 -0
- package/dist/components/account/sections/team/TeamMemberRow.mjs +99 -0
- package/dist/components/account/sections/team/TeamMemberRow.mjs.map +1 -0
- package/dist/components/account/sections/team/UserSheet.mjs +570 -0
- package/dist/components/account/sections/team/UserSheet.mjs.map +1 -0
- package/dist/components/account/sections/team/steps/NotificationsStep.mjs +80 -0
- package/dist/components/account/sections/team/steps/NotificationsStep.mjs.map +1 -0
- package/dist/components/account/sections/team/steps/ProjectSelectionStep.mjs +180 -0
- package/dist/components/account/sections/team/steps/ProjectSelectionStep.mjs.map +1 -0
- package/dist/components/account/sections/team/steps/UserInformationStep.mjs +371 -0
- package/dist/components/account/sections/team/steps/UserInformationStep.mjs.map +1 -0
- package/dist/components/account/sections/team/user-form.schema.mjs +37 -0
- package/dist/components/account/sections/team/user-form.schema.mjs.map +1 -0
- package/dist/components/account/types/workspace-actions.type.mjs +1 -0
- package/dist/components/account/types/workspace-actions.type.mjs.map +1 -0
- package/dist/components/layouts/ProfilePopover.mjs +10 -12
- package/dist/components/layouts/ProfilePopover.mjs.map +1 -1
- package/dist/components/layouts/UsersSelectorPopover.mjs +7 -4
- package/dist/components/layouts/UsersSelectorPopover.mjs.map +1 -1
- package/dist/components/modals/AccountDeletionWarningModal.mjs +4 -5
- package/dist/components/modals/AccountDeletionWarningModal.mjs.map +1 -1
- package/dist/components/modals/AccountFrozenModal.mjs +6 -3
- package/dist/components/modals/AccountFrozenModal.mjs.map +1 -1
- package/dist/components/modals/Modals.mjs +3 -3
- package/dist/components/modals/Modals.mjs.map +1 -1
- package/dist/components/modals/PaidPlanRequiredModal.mjs +4 -5
- package/dist/components/modals/PaidPlanRequiredModal.mjs.map +1 -1
- package/dist/components/modals/cards/AddFirstCardWarningModal.mjs +63 -0
- package/dist/components/modals/cards/AddFirstCardWarningModal.mjs.map +1 -0
- package/dist/components/modals/cards/SwitchPaymentToCardModal.mjs +187 -0
- package/dist/components/modals/cards/SwitchPaymentToCardModal.mjs.map +1 -0
- package/dist/components/modals/promo/AiCreditsOfferModal/AiCreditsOfferModal.mjs +5 -4
- package/dist/components/modals/promo/AiCreditsOfferModal/AiCreditsOfferModal.mjs.map +1 -1
- package/dist/components/ui/data-display/CardItem.mjs +9 -1
- package/dist/components/ui/data-display/CardItem.mjs.map +1 -1
- package/dist/components/ui/data-display/PaymentMethodIcons.mjs +50 -0
- package/dist/components/ui/data-display/PaymentMethodIcons.mjs.map +1 -0
- package/dist/components/ui/form/BillingPeriodSelector.mjs +108 -0
- package/dist/components/ui/form/BillingPeriodSelector.mjs.map +1 -0
- package/dist/components/ui/form/PaymentMethodToggle.mjs +82 -0
- package/dist/components/ui/form/PaymentMethodToggle.mjs.map +1 -0
- package/dist/components/ui/form/RadioOptionFieldIcon.mjs +57 -0
- package/dist/components/ui/form/RadioOptionFieldIcon.mjs.map +1 -0
- package/dist/components/ui/form/SegmentedControl.mjs +56 -0
- package/dist/components/ui/form/SegmentedControl.mjs.map +1 -0
- package/dist/components/ui/overlay/Dialog.mjs +41 -6
- package/dist/components/ui/overlay/Dialog.mjs.map +1 -1
- package/dist/components/ui/overlay/Sheet.mjs +43 -13
- package/dist/components/ui/overlay/Sheet.mjs.map +1 -1
- package/dist/components/ui/overlay/layers.mjs +72 -26
- package/dist/components/ui/overlay/layers.mjs.map +1 -1
- package/dist/enums/AccountHubFlow.mjs +13 -0
- package/dist/enums/AccountHubFlow.mjs.map +1 -0
- package/dist/enums/DateFilterPeriod.mjs +22 -0
- package/dist/enums/DateFilterPeriod.mjs.map +1 -0
- package/dist/enums/WorkspaceSectionType.mjs +11 -0
- package/dist/enums/WorkspaceSectionType.mjs.map +1 -0
- package/dist/handlers.mjs +24 -0
- package/dist/handlers.mjs.map +1 -1
- package/dist/hooks/useDebounce.mjs +5 -3
- package/dist/hooks/useDebounce.mjs.map +1 -1
- package/dist/hooks/useUploadProgress.mjs +33 -0
- package/dist/hooks/useUploadProgress.mjs.map +1 -0
- package/dist/i18n/messages/en-us.mjs +863 -3
- package/dist/i18n/messages/en-us.mjs.map +1 -1
- package/dist/i18n/messages/es-es.mjs +863 -3
- package/dist/i18n/messages/es-es.mjs.map +1 -1
- package/dist/i18n/messages/pt-br.mjs +863 -3
- package/dist/i18n/messages/pt-br.mjs.map +1 -1
- package/dist/index.mjs +87 -7
- package/dist/index.mjs.map +1 -1
- package/dist/infra/http/paged.mjs +20 -0
- package/dist/infra/http/paged.mjs.map +1 -0
- package/dist/middleware.mjs +2 -0
- package/dist/middleware.mjs.map +1 -1
- package/dist/middlewares/create-auth-middleware.mjs +1 -3
- package/dist/middlewares/create-auth-middleware.mjs.map +1 -1
- package/dist/middlewares/create-legacy-account-routes-middleware.mjs +44 -0
- package/dist/middlewares/create-legacy-account-routes-middleware.mjs.map +1 -0
- package/dist/middlewares/is-route-equals.mjs +7 -0
- package/dist/middlewares/is-route-equals.mjs.map +1 -0
- package/dist/modules/accounts/actions/account-management.action.mjs +20 -1
- package/dist/modules/accounts/actions/account-management.action.mjs.map +1 -1
- package/dist/modules/accounts/constants/account-hub-link.constants.mjs +9 -0
- package/dist/modules/accounts/constants/account-hub-link.constants.mjs.map +1 -0
- package/dist/modules/accounts/constants/legacy-account-routes.constants.mjs +5 -0
- package/dist/modules/accounts/constants/legacy-account-routes.constants.mjs.map +1 -0
- package/dist/modules/accounts/handlers/list-account-members.handler.mjs +22 -0
- package/dist/modules/accounts/handlers/list-account-members.handler.mjs.map +1 -0
- package/dist/modules/accounts/hooks/add-user-projects.hook.mjs +51 -0
- package/dist/modules/accounts/hooks/add-user-projects.hook.mjs.map +1 -0
- package/dist/modules/accounts/hooks/create-account-user.hook.mjs +20 -0
- package/dist/modules/accounts/hooks/create-account-user.hook.mjs.map +1 -0
- package/dist/modules/accounts/hooks/remove-user-projects.hook.mjs +47 -0
- package/dist/modules/accounts/hooks/remove-user-projects.hook.mjs.map +1 -0
- package/dist/modules/accounts/hooks/use-account-members.hook.mjs +20 -0
- package/dist/modules/accounts/hooks/use-account-members.hook.mjs.map +1 -0
- package/dist/modules/accounts/services/account.service.mjs +59 -0
- package/dist/modules/accounts/services/account.service.mjs.map +1 -1
- package/dist/modules/accounts/types/account-hub-link.type.mjs +1 -0
- package/dist/modules/accounts/types/account-hub-link.type.mjs.map +1 -0
- package/dist/modules/accounts/utils/build-account-hub-url.mjs +16 -0
- package/dist/modules/accounts/utils/build-account-hub-url.mjs.map +1 -0
- package/dist/modules/accounts/utils/is-account-hub-flow.mjs +9 -0
- package/dist/modules/accounts/utils/is-account-hub-flow.mjs.map +1 -0
- package/dist/modules/accounts/utils/is-account-section.mjs +9 -0
- package/dist/modules/accounts/utils/is-account-section.mjs.map +1 -0
- package/dist/modules/accounts/utils/is-my-account-section.mjs +13 -0
- package/dist/modules/accounts/utils/is-my-account-section.mjs.map +1 -0
- package/dist/modules/accounts/utils/map-legacy-account-route.mjs +93 -0
- package/dist/modules/accounts/utils/map-legacy-account-route.mjs.map +1 -0
- package/dist/modules/accounts/utils/parse-account-hub-link.mjs +20 -0
- package/dist/modules/accounts/utils/parse-account-hub-link.mjs.map +1 -0
- package/dist/modules/affiliates/actions/ensure-affiliate.action.mjs +10 -0
- package/dist/modules/affiliates/actions/ensure-affiliate.action.mjs.map +1 -0
- package/dist/modules/affiliates/actions/request-deposit.action.mjs +10 -0
- package/dist/modules/affiliates/actions/request-deposit.action.mjs.map +1 -0
- package/dist/modules/affiliates/actions/update-affiliate.action.mjs +10 -0
- package/dist/modules/affiliates/actions/update-affiliate.action.mjs.map +1 -0
- package/dist/modules/affiliates/constants/affiliate.constants.mjs +11 -0
- package/dist/modules/affiliates/constants/affiliate.constants.mjs.map +1 -0
- package/dist/modules/affiliates/constants/query-keys.constants.mjs +15 -0
- package/dist/modules/affiliates/constants/query-keys.constants.mjs.map +1 -0
- package/dist/modules/affiliates/handlers/affiliate-report-analytics.handler.mjs +16 -0
- package/dist/modules/affiliates/handlers/affiliate-report-analytics.handler.mjs.map +1 -0
- package/dist/modules/affiliates/handlers/affiliate-withdrawal-limits.handler.mjs +12 -0
- package/dist/modules/affiliates/handlers/affiliate-withdrawal-limits.handler.mjs.map +1 -0
- package/dist/modules/affiliates/handlers/current-affiliate.handler.mjs +12 -0
- package/dist/modules/affiliates/handlers/current-affiliate.handler.mjs.map +1 -0
- package/dist/modules/affiliates/handlers/list-affiliate-coupons.handler.mjs +12 -0
- package/dist/modules/affiliates/handlers/list-affiliate-coupons.handler.mjs.map +1 -0
- package/dist/modules/affiliates/handlers/list-affiliate-leads.handler.mjs +22 -0
- package/dist/modules/affiliates/handlers/list-affiliate-leads.handler.mjs.map +1 -0
- package/dist/modules/affiliates/handlers/list-affiliate-transactions.handler.mjs +22 -0
- package/dist/modules/affiliates/handlers/list-affiliate-transactions.handler.mjs.map +1 -0
- package/dist/modules/affiliates/hooks/use-affiliate-coupons.hook.mjs +17 -0
- package/dist/modules/affiliates/hooks/use-affiliate-coupons.hook.mjs.map +1 -0
- package/dist/modules/affiliates/hooks/use-affiliate-leads.hook.mjs +22 -0
- package/dist/modules/affiliates/hooks/use-affiliate-leads.hook.mjs.map +1 -0
- package/dist/modules/affiliates/hooks/use-affiliate-report-analytics.hook.mjs +17 -0
- package/dist/modules/affiliates/hooks/use-affiliate-report-analytics.hook.mjs.map +1 -0
- package/dist/modules/affiliates/hooks/use-affiliate-transactions.hook.mjs +20 -0
- package/dist/modules/affiliates/hooks/use-affiliate-transactions.hook.mjs.map +1 -0
- package/dist/modules/affiliates/hooks/use-current-affiliate.hook.mjs +17 -0
- package/dist/modules/affiliates/hooks/use-current-affiliate.hook.mjs.map +1 -0
- package/dist/modules/affiliates/hooks/use-ensure-affiliate.hook.mjs +23 -0
- package/dist/modules/affiliates/hooks/use-ensure-affiliate.hook.mjs.map +1 -0
- package/dist/modules/affiliates/hooks/use-request-deposit.hook.mjs +28 -0
- package/dist/modules/affiliates/hooks/use-request-deposit.hook.mjs.map +1 -0
- package/dist/modules/affiliates/hooks/use-update-affiliate.hook.mjs +22 -0
- package/dist/modules/affiliates/hooks/use-update-affiliate.hook.mjs.map +1 -0
- package/dist/modules/affiliates/hooks/use-withdrawal-limits.hook.mjs +17 -0
- package/dist/modules/affiliates/hooks/use-withdrawal-limits.hook.mjs.map +1 -0
- package/dist/modules/affiliates/services/affiliates.service.mjs +183 -0
- package/dist/modules/affiliates/services/affiliates.service.mjs.map +1 -0
- package/dist/modules/affiliates/types/affiliate.type.mjs +100 -0
- package/dist/modules/affiliates/types/affiliate.type.mjs.map +1 -0
- package/dist/modules/affiliates/utils/get-affiliate-share-link.mjs +9 -0
- package/dist/modules/affiliates/utils/get-affiliate-share-link.mjs.map +1 -0
- package/dist/modules/charges/actions/get-nota-fiscal.action.mjs +10 -0
- package/dist/modules/charges/actions/get-nota-fiscal.action.mjs.map +1 -0
- package/dist/modules/charges/actions/refresh-pix.action.mjs +10 -0
- package/dist/modules/charges/actions/refresh-pix.action.mjs.map +1 -0
- package/dist/modules/charges/hooks/nota-fiscal.hook.mjs +13 -0
- package/dist/modules/charges/hooks/nota-fiscal.hook.mjs.map +1 -0
- package/dist/modules/charges/hooks/refresh-pix.hook.mjs +13 -0
- package/dist/modules/charges/hooks/refresh-pix.hook.mjs.map +1 -0
- package/dist/modules/charges/services/charges.service.mjs +67 -0
- package/dist/modules/charges/services/charges.service.mjs.map +1 -1
- package/dist/modules/charges/types/nota-fiscal.type.mjs +1 -0
- package/dist/modules/charges/types/nota-fiscal.type.mjs.map +1 -0
- package/dist/modules/charges/types/refresh-pix.type.mjs +1 -0
- package/dist/modules/charges/types/refresh-pix.type.mjs.map +1 -0
- package/dist/modules/charges/utils/get-charge-download-url.mjs +8 -0
- package/dist/modules/charges/utils/get-charge-download-url.mjs.map +1 -0
- package/dist/modules/coupons/constants/query-keys.constants.mjs +5 -0
- package/dist/modules/coupons/constants/query-keys.constants.mjs.map +1 -0
- package/dist/modules/coupons/handlers/find-coupon-by-code.handler.mjs +17 -0
- package/dist/modules/coupons/handlers/find-coupon-by-code.handler.mjs.map +1 -0
- package/dist/modules/coupons/handlers/find-coupon-by-id.handler.mjs +16 -0
- package/dist/modules/coupons/handlers/find-coupon-by-id.handler.mjs.map +1 -0
- package/dist/modules/coupons/hooks/use-coupon-by-code.hook.mjs +15 -0
- package/dist/modules/coupons/hooks/use-coupon-by-code.hook.mjs.map +1 -0
- package/dist/modules/coupons/hooks/use-coupon-by-id.hook.mjs +18 -0
- package/dist/modules/coupons/hooks/use-coupon-by-id.hook.mjs.map +1 -0
- package/dist/modules/coupons/services/coupons.service.mjs +44 -0
- package/dist/modules/coupons/services/coupons.service.mjs.map +1 -0
- package/dist/modules/coupons/types/coupon.type.mjs +61 -0
- package/dist/modules/coupons/types/coupon.type.mjs.map +1 -0
- package/dist/modules/coupons/utils/coupon-restrictions.mjs +60 -0
- package/dist/modules/coupons/utils/coupon-restrictions.mjs.map +1 -0
- package/dist/modules/domains/handlers/count-domains.handler.mjs +12 -0
- package/dist/modules/domains/handlers/count-domains.handler.mjs.map +1 -0
- package/dist/modules/domains/hooks/count-domains.hook.mjs +17 -0
- package/dist/modules/domains/hooks/count-domains.hook.mjs.map +1 -0
- package/dist/modules/domains/services/domains.service.mjs +18 -0
- package/dist/modules/domains/services/domains.service.mjs.map +1 -0
- package/dist/modules/ia-credits/handlers/list-ia-credit-operations.handler.mjs +15 -0
- package/dist/modules/ia-credits/handlers/list-ia-credit-operations.handler.mjs.map +1 -0
- package/dist/modules/ia-credits/hooks/ia-credit-operations.hook.mjs +28 -0
- package/dist/modules/ia-credits/hooks/ia-credit-operations.hook.mjs.map +1 -0
- package/dist/modules/ia-credits/services/ia-credits.service.mjs +23 -2
- package/dist/modules/ia-credits/services/ia-credits.service.mjs.map +1 -1
- package/dist/modules/pages/handlers/count-pages.handler.mjs +4 -2
- package/dist/modules/pages/handlers/count-pages.handler.mjs.map +1 -1
- package/dist/modules/pages/hooks/count-published-pages.hook.mjs +26 -0
- package/dist/modules/pages/hooks/count-published-pages.hook.mjs.map +1 -0
- package/dist/modules/pages/services/pages.service.mjs +3 -2
- package/dist/modules/pages/services/pages.service.mjs.map +1 -1
- package/dist/modules/plans/constants/plan-tooltips.constants.mjs +14 -0
- package/dist/modules/plans/constants/plan-tooltips.constants.mjs.map +1 -0
- package/dist/modules/plans/hooks/use-enriched-plans.hook.mjs +28 -0
- package/dist/modules/plans/hooks/use-enriched-plans.hook.mjs.map +1 -0
- package/dist/modules/plans/hooks/use-ui-plans.hook.mjs +20 -0
- package/dist/modules/plans/hooks/use-ui-plans.hook.mjs.map +1 -0
- package/dist/modules/projects/hooks/add-project-users.hook.mjs +25 -0
- package/dist/modules/projects/hooks/add-project-users.hook.mjs.map +1 -0
- package/dist/modules/projects/hooks/list-all-account-users.hook.mjs +3 -6
- package/dist/modules/projects/hooks/list-all-account-users.hook.mjs.map +1 -1
- package/dist/modules/projects/hooks/list-available-users.hook.mjs +3 -6
- package/dist/modules/projects/hooks/list-available-users.hook.mjs.map +1 -1
- package/dist/modules/projects/hooks/list-infinite-projects.hook.mjs +3 -6
- package/dist/modules/projects/hooks/list-infinite-projects.hook.mjs.map +1 -1
- package/dist/modules/projects/hooks/list-project-users.hook.mjs +3 -6
- package/dist/modules/projects/hooks/list-project-users.hook.mjs.map +1 -1
- package/dist/modules/projects/hooks/remove-project-users.hook.mjs +25 -0
- package/dist/modules/projects/hooks/remove-project-users.hook.mjs.map +1 -0
- package/dist/modules/projects/services/project-users.service.mjs +5 -0
- package/dist/modules/projects/services/project-users.service.mjs.map +1 -1
- package/dist/modules/projects/types.mjs +3 -2
- package/dist/modules/projects/types.mjs.map +1 -1
- package/dist/modules/subscriptions/actions/cancel-subscription.action.mjs +10 -0
- package/dist/modules/subscriptions/actions/cancel-subscription.action.mjs.map +1 -0
- package/dist/modules/subscriptions/actions/create-subscription.action.mjs +10 -0
- package/dist/modules/subscriptions/actions/create-subscription.action.mjs.map +1 -0
- package/dist/modules/subscriptions/actions/find-pending-pix-status.action.mjs +10 -0
- package/dist/modules/subscriptions/actions/find-pending-pix-status.action.mjs.map +1 -0
- package/dist/modules/subscriptions/actions/find-subscription-by-id.action.mjs +10 -0
- package/dist/modules/subscriptions/actions/find-subscription-by-id.action.mjs.map +1 -0
- package/dist/modules/subscriptions/constants/addons.constants.mjs +35 -0
- package/dist/modules/subscriptions/constants/addons.constants.mjs.map +1 -1
- package/dist/modules/subscriptions/constants/downgrade.constants.mjs +25 -0
- package/dist/modules/subscriptions/constants/downgrade.constants.mjs.map +1 -0
- package/dist/modules/subscriptions/constants/subscription.constants.mjs +2 -0
- package/dist/modules/subscriptions/constants/subscription.constants.mjs.map +1 -1
- package/dist/modules/subscriptions/handlers/pending-pix-status.handler.mjs +15 -0
- package/dist/modules/subscriptions/handlers/pending-pix-status.handler.mjs.map +1 -0
- package/dist/modules/subscriptions/hooks/cancel-subscription.hook.mjs +25 -0
- package/dist/modules/subscriptions/hooks/cancel-subscription.hook.mjs.map +1 -0
- package/dist/modules/subscriptions/hooks/create-subscription.hook.mjs +33 -0
- package/dist/modules/subscriptions/hooks/create-subscription.hook.mjs.map +1 -0
- package/dist/modules/subscriptions/hooks/find-subscription-by-id.hook.mjs +18 -0
- package/dist/modules/subscriptions/hooks/find-subscription-by-id.hook.mjs.map +1 -0
- package/dist/modules/subscriptions/hooks/pending-pix-status.hook.mjs +25 -0
- package/dist/modules/subscriptions/hooks/pending-pix-status.hook.mjs.map +1 -0
- package/dist/modules/subscriptions/services/subscriptions.service.mjs +71 -0
- package/dist/modules/subscriptions/services/subscriptions.service.mjs.map +1 -1
- package/dist/modules/subscriptions/types/cancel-subscription.type.mjs +9 -0
- package/dist/modules/subscriptions/types/cancel-subscription.type.mjs.map +1 -0
- package/dist/modules/subscriptions/types/create-subscription.type.mjs +62 -0
- package/dist/modules/subscriptions/types/create-subscription.type.mjs.map +1 -0
- package/dist/modules/subscriptions/types/pending-pix-status.type.mjs +28 -0
- package/dist/modules/subscriptions/types/pending-pix-status.type.mjs.map +1 -0
- package/dist/modules/subscriptions/types/subscription.type.mjs +9 -1
- package/dist/modules/subscriptions/types/subscription.type.mjs.map +1 -1
- package/dist/modules/subscriptions/utils/addon-buckets.mjs +69 -0
- package/dist/modules/subscriptions/utils/addon-buckets.mjs.map +1 -0
- package/dist/modules/subscriptions/utils/confirm-payment-if-required.mjs +8 -2
- package/dist/modules/subscriptions/utils/confirm-payment-if-required.mjs.map +1 -1
- package/dist/modules/subscriptions/utils/first-period-pricing.mjs +25 -0
- package/dist/modules/subscriptions/utils/first-period-pricing.mjs.map +1 -0
- package/dist/modules/subscriptions/utils/is-api-subscription.mjs +8 -0
- package/dist/modules/subscriptions/utils/is-api-subscription.mjs.map +1 -0
- package/dist/modules/subscriptions/utils/is-boleto-payer.mjs +17 -0
- package/dist/modules/subscriptions/utils/is-boleto-payer.mjs.map +1 -0
- package/dist/modules/subscriptions/utils/is-free-subscription.mjs +8 -0
- package/dist/modules/subscriptions/utils/is-free-subscription.mjs.map +1 -0
- package/dist/modules/subscriptions/utils/periodicity.mjs +55 -1
- package/dist/modules/subscriptions/utils/periodicity.mjs.map +1 -1
- package/dist/modules/subscriptions/utils/resolve-subscription-plan-name.mjs +27 -0
- package/dist/modules/subscriptions/utils/resolve-subscription-plan-name.mjs.map +1 -0
- package/dist/modules/users/hooks/messages.hook.mjs +3 -5
- package/dist/modules/users/hooks/messages.hook.mjs.map +1 -1
- package/dist/server.mjs +6 -0
- package/dist/server.mjs.map +1 -1
- package/dist/store/useAccountModals.mjs +9 -2
- package/dist/store/useAccountModals.mjs.map +1 -1
- package/dist/store/useAffiliateFlows.mjs +23 -0
- package/dist/store/useAffiliateFlows.mjs.map +1 -0
- package/dist/store/useProjectFlows.mjs +18 -0
- package/dist/store/useProjectFlows.mjs.map +1 -0
- package/dist/store/useSubscriptionFlows.mjs +58 -0
- package/dist/store/useSubscriptionFlows.mjs.map +1 -0
- package/dist/store/useTeamFlows.mjs +15 -0
- package/dist/store/useTeamFlows.mjs.map +1 -0
- package/dist/testing/factories/coupon.factory.mjs +19 -0
- package/dist/testing/factories/coupon.factory.mjs.map +1 -0
- package/dist/testing/factories/index.mjs +6 -0
- package/dist/testing/factories/index.mjs.map +1 -1
- package/dist/testing/factories/project-user.factory.mjs +17 -0
- package/dist/testing/factories/project-user.factory.mjs.map +1 -0
- package/dist/testing/factories/project.factory.mjs +21 -0
- package/dist/testing/factories/project.factory.mjs.map +1 -0
- package/dist/testing/react/providers.mjs +1 -1
- package/dist/testing/react/providers.mjs.map +1 -1
- package/dist/utils/browser/chart-custom-tooltip.mjs +69 -0
- package/dist/utils/browser/chart-custom-tooltip.mjs.map +1 -0
- package/dist/utils/browser/get-css-variable.mjs +9 -0
- package/dist/utils/browser/get-css-variable.mjs.map +1 -0
- package/dist/utils/constants/scrollbar.mjs +5 -0
- package/dist/utils/constants/scrollbar.mjs.map +1 -0
- package/dist/utils/date-filter-period.mjs +34 -0
- package/dist/utils/date-filter-period.mjs.map +1 -0
- package/dist/utils/file/index.mjs +11 -1
- package/dist/utils/file/index.mjs.map +1 -1
- package/dist/utils/format/initials.mjs +8 -0
- package/dist/utils/format/initials.mjs.map +1 -0
- package/dist/utils/format/masks.mjs +32 -1
- package/dist/utils/format/masks.mjs.map +1 -1
- package/dist/utils/qrcode/to-data-url.mjs +12 -0
- package/dist/utils/qrcode/to-data-url.mjs.map +1 -0
- package/dist/utils/validators/account.mjs +1 -7
- package/dist/utils/validators/account.mjs.map +1 -1
- package/package.json +20 -8
- package/src/components/account/AccountHubLinkHandler.tsx +39 -0
- package/src/components/account/AccountModalLayout.tsx +190 -0
- package/src/components/account/AccountModals.tsx +12 -2
- package/src/components/account/DeleteAccountModal.tsx +1 -1
- package/src/components/account/IsntPossibleDeleteAccountModal.tsx +9 -1
- package/src/components/account/MyAccountModal.tsx +215 -0
- package/src/components/account/TwoFactorAuthModal.tsx +1 -1
- package/src/components/account/hooks/useAccountHubActions.ts +95 -0
- package/src/components/account/hooks/useAddCardWithPaymentSwitch.ts +70 -0
- package/src/components/account/hooks/useAffiliatesActions.tsx +78 -0
- package/src/components/account/hooks/useMyAccountModal.ts +40 -0
- package/src/components/account/hooks/useProjectsActions.ts +44 -0
- package/src/components/account/hooks/useSubscriptionActions.ts +99 -0
- package/src/components/account/hooks/useTeamActions.ts +35 -0
- package/src/components/account/sections/AffiliatesSection.tsx +342 -0
- package/src/components/account/sections/ChangePasswordSection.tsx +6 -10
- package/src/components/account/sections/MyProfileSection.tsx +207 -143
- package/src/components/account/sections/PreferencesSection.tsx +55 -51
- package/src/components/account/sections/ProjectsSection.tsx +110 -0
- package/src/components/account/sections/SecuritySection.tsx +72 -62
- package/src/components/account/sections/SubscriptionSection.tsx +36 -0
- package/src/components/account/sections/TeamSection.tsx +161 -0
- package/src/components/account/sections/TokenSection.tsx +4 -8
- package/src/components/account/sections/affiliates/AffiliateCommissionCard.tsx +83 -0
- package/src/components/account/sections/affiliates/AffiliateFlows.tsx +20 -0
- package/src/components/account/sections/affiliates/AffiliateLeadsSheet.tsx +143 -0
- package/src/components/account/sections/affiliates/AffiliateStatsCard.tsx +56 -0
- package/src/components/account/sections/affiliates/AffiliateStepCard.tsx +20 -0
- package/src/components/account/sections/affiliates/AffiliateTransactionsList.tsx +194 -0
- package/src/components/account/sections/affiliates/NoReceivingAccountModal.tsx +63 -0
- package/src/components/account/sections/affiliates/ReceivingAccountModal.tsx +213 -0
- package/src/components/account/sections/affiliates/RequestWithdrawalSheet.tsx +586 -0
- package/src/components/account/sections/affiliates/ViewAttachmentModal.tsx +47 -0
- package/src/components/account/sections/affiliates/reports/AffiliatesIndicatorsChart.tsx +45 -0
- package/src/components/account/sections/affiliates/reports/AffiliatesReportsTab.tsx +44 -0
- package/src/components/account/sections/affiliates/reports/useAffiliatesIndicatorsChart.ts +148 -0
- package/src/components/account/sections/projects/DeleteProjectModal.tsx +246 -0
- package/src/components/account/sections/projects/ProjectFlows.tsx +16 -0
- package/src/components/account/sections/projects/ProjectMembersStack.tsx +75 -0
- package/src/components/account/sections/projects/ProjectRow.tsx +96 -0
- package/src/components/account/sections/projects/ProjectSheet.tsx +603 -0
- package/src/components/account/sections/projects/ProjectsDisabledModal.tsx +69 -0
- package/src/components/account/sections/projects/project-form.schema.ts +30 -0
- package/src/components/account/sections/shared/ConnectListRow.tsx +68 -0
- package/src/components/account/sections/shared/DateFilterPopover.tsx +58 -0
- package/src/components/account/sections/shared/EntityAvatar.tsx +54 -0
- package/src/components/account/sections/shared/FilterPopover.tsx +79 -0
- package/src/components/account/sections/shared/FormSection.tsx +23 -0
- package/src/components/account/sections/shared/IconBox.tsx +21 -0
- package/src/components/account/sections/shared/InfiniteScrollList.tsx +57 -0
- package/src/components/account/sections/shared/ListPagination.tsx +84 -0
- package/src/components/account/sections/shared/RowActionsMenu.tsx +66 -0
- package/src/components/account/sections/shared/SectionLoadError.tsx +27 -0
- package/src/components/account/sections/shared/StatusBadge.tsx +33 -0
- package/src/components/account/sections/shared/WorkspaceSection.tsx +22 -0
- package/src/components/account/sections/subscription/AiCreditsUsage.tsx +152 -0
- package/src/components/account/sections/subscription/BillingAddressSheet.tsx +460 -0
- package/src/components/account/sections/subscription/BoletoDetailsDialog.tsx +104 -0
- package/src/components/account/sections/subscription/BoletoGeneratedDialog.tsx +24 -0
- package/src/components/account/sections/subscription/CancelPlanDialog.tsx +221 -0
- package/src/components/account/sections/subscription/ChargeRow.tsx +161 -0
- package/src/components/account/sections/subscription/ChargeStatusBadge.tsx +29 -0
- package/src/components/account/sections/subscription/ChargesList.tsx +125 -0
- package/src/components/account/sections/subscription/ManageCardsSheet.tsx +93 -0
- package/src/components/account/sections/subscription/OverdueReceiptOpener.tsx +29 -0
- package/src/components/account/sections/subscription/PayChargeDialog.tsx +306 -0
- package/src/components/account/sections/subscription/PaymentConfirmationDialog.tsx +70 -0
- package/src/components/account/sections/subscription/PaymentMethodsCard.tsx +117 -0
- package/src/components/account/sections/subscription/PendingChangeDialog.tsx +168 -0
- package/src/components/account/sections/subscription/PixDetailsDialog.tsx +246 -0
- package/src/components/account/sections/subscription/PixPaymentDialog.tsx +242 -0
- package/src/components/account/sections/subscription/PlanDetailsSheet.tsx +380 -0
- package/src/components/account/sections/subscription/ReceiptDetailsSheet.tsx +318 -0
- package/src/components/account/sections/subscription/SubscriptionFlows.tsx +40 -0
- package/src/components/account/sections/subscription/SubscriptionPlanCard.tsx +433 -0
- package/src/components/account/sections/subscription/UsageReportSheet.tsx +244 -0
- package/src/components/account/sections/subscription/change-plan/ChangePlanSheet.tsx +95 -0
- package/src/components/account/sections/subscription/change-plan/components/AbTestDetailsDialog.tsx +57 -0
- package/src/components/account/sections/subscription/change-plan/components/AddonsBlock.tsx +214 -0
- package/src/components/account/sections/subscription/change-plan/components/AlternativeBucketsSection.tsx +92 -0
- package/src/components/account/sections/subscription/change-plan/components/CouponBlock.tsx +42 -0
- package/src/components/account/sections/subscription/change-plan/components/CouponDialog.tsx +134 -0
- package/src/components/account/sections/subscription/change-plan/components/PricePreview.tsx +28 -0
- package/src/components/account/sections/subscription/change-plan/components/SummaryBlock.tsx +194 -0
- package/src/components/account/sections/subscription/change-plan/plan-comparison.ts +52 -0
- package/src/components/account/sections/subscription/change-plan/steps/PaymentSummaryStep.tsx +161 -0
- package/src/components/account/sections/subscription/change-plan/steps/PlanComparisonStep.tsx +165 -0
- package/src/components/account/sections/subscription/change-plan/steps/PlanViewStep.tsx +89 -0
- package/src/components/account/sections/subscription/change-plan/steps/ReactivationConfigStep.tsx +117 -0
- package/src/components/account/sections/subscription/change-plan/steps/ReactivationPaymentStep.tsx +139 -0
- package/src/components/account/sections/subscription/change-plan/useChangePlanState.tsx +1158 -0
- package/src/components/account/sections/subscription/downgrade/CannotDowngradeDialog.tsx +297 -0
- package/src/components/account/sections/subscription/downgrade/DowngradeReasonDialog.tsx +154 -0
- package/src/components/account/sections/subscription/plans/PlanCard.tsx +417 -0
- package/src/components/account/sections/subscription/plans/PlanCardSkeleton.tsx +70 -0
- package/src/components/account/sections/subscription/plans/PlansCatalogDialog.tsx +156 -0
- package/src/components/account/sections/team/DeleteUserModal.tsx +134 -0
- package/src/components/account/sections/team/TeamFlows.tsx +14 -0
- package/src/components/account/sections/team/TeamMemberRow.tsx +151 -0
- package/src/components/account/sections/team/UserSheet.tsx +688 -0
- package/src/components/account/sections/team/steps/NotificationsStep.tsx +109 -0
- package/src/components/account/sections/team/steps/ProjectSelectionStep.tsx +219 -0
- package/src/components/account/sections/team/steps/UserInformationStep.tsx +423 -0
- package/src/components/account/sections/team/user-form.schema.ts +43 -0
- package/src/components/account/types/workspace-actions.type.ts +56 -0
- package/src/components/layouts/ProfilePopover.tsx +11 -12
- package/src/components/layouts/UsersSelectorPopover.tsx +7 -4
- package/src/components/modals/AccountDeletionWarningModal.tsx +4 -5
- package/src/components/modals/AccountFrozenModal.tsx +6 -3
- package/src/components/modals/Modals.tsx +6 -3
- package/src/components/modals/PaidPlanRequiredModal.tsx +4 -5
- package/src/components/modals/cards/AddFirstCardWarningModal.tsx +72 -0
- package/src/components/modals/cards/SwitchPaymentToCardModal.tsx +232 -0
- package/src/components/modals/promo/AiCreditsOfferModal/AiCreditsOfferModal.tsx +5 -4
- package/src/components/ui/data-display/CardItem.tsx +9 -5
- package/src/components/ui/data-display/PaymentMethodIcons.tsx +43 -0
- package/src/components/ui/form/BillingPeriodSelector.tsx +173 -0
- package/src/components/ui/form/PaymentMethodToggle.tsx +119 -0
- package/src/components/ui/form/RadioOptionFieldIcon.tsx +64 -0
- package/src/components/ui/form/SegmentedControl.tsx +77 -0
- package/src/components/ui/overlay/Dialog.tsx +70 -33
- package/src/components/ui/overlay/Sheet.tsx +89 -56
- package/src/components/ui/overlay/layers.tsx +114 -27
- package/src/enums/AccountHubFlow.ts +8 -0
- package/src/enums/DateFilterPeriod.ts +17 -0
- package/src/enums/WorkspaceSectionType.ts +6 -0
- package/src/handlers.ts +14 -0
- package/src/hooks/useDebounce.ts +5 -3
- package/src/hooks/useUploadProgress.ts +42 -0
- package/src/i18n/messages/en-us.ts +904 -2
- package/src/i18n/messages/es-es.ts +908 -2
- package/src/i18n/messages/pt-br.ts +908 -2
- package/src/index.ts +56 -1
- package/src/infra/http/paged.ts +24 -0
- package/src/middleware.ts +1 -0
- package/src/middlewares/create-auth-middleware.ts +1 -4
- package/src/middlewares/create-legacy-account-routes-middleware.ts +54 -0
- package/src/middlewares/is-route-equals.ts +3 -0
- package/src/modules/accounts/actions/account-management.action.ts +22 -1
- package/src/modules/accounts/constants/account-hub-link.constants.ts +3 -0
- package/src/modules/accounts/constants/legacy-account-routes.constants.ts +1 -0
- package/src/modules/accounts/handlers/list-account-members.handler.ts +23 -0
- package/src/modules/accounts/hooks/add-user-projects.hook.ts +72 -0
- package/src/modules/accounts/hooks/create-account-user.hook.ts +21 -0
- package/src/modules/accounts/hooks/remove-user-projects.hook.ts +68 -0
- package/src/modules/accounts/hooks/use-account-members.hook.ts +31 -0
- package/src/modules/accounts/services/account.service.ts +71 -0
- package/src/modules/accounts/types/account-hub-link.type.ts +13 -0
- package/src/modules/accounts/types.ts +9 -0
- package/src/modules/accounts/utils/build-account-hub-url.ts +14 -0
- package/src/modules/accounts/utils/is-account-hub-flow.ts +7 -0
- package/src/modules/accounts/utils/is-account-section.ts +7 -0
- package/src/modules/accounts/utils/is-my-account-section.ts +12 -0
- package/src/modules/accounts/utils/map-legacy-account-route.ts +108 -0
- package/src/modules/accounts/utils/parse-account-hub-link.ts +21 -0
- package/src/modules/affiliates/actions/ensure-affiliate.action.ts +9 -0
- package/src/modules/affiliates/actions/request-deposit.action.ts +9 -0
- package/src/modules/affiliates/actions/update-affiliate.action.ts +9 -0
- package/src/modules/affiliates/constants/affiliate.constants.ts +11 -0
- package/src/modules/affiliates/constants/query-keys.constants.ts +7 -0
- package/src/modules/affiliates/handlers/affiliate-report-analytics.handler.ts +16 -0
- package/src/modules/affiliates/handlers/affiliate-withdrawal-limits.handler.ts +10 -0
- package/src/modules/affiliates/handlers/current-affiliate.handler.ts +10 -0
- package/src/modules/affiliates/handlers/list-affiliate-coupons.handler.ts +10 -0
- package/src/modules/affiliates/handlers/list-affiliate-leads.handler.ts +23 -0
- package/src/modules/affiliates/handlers/list-affiliate-transactions.handler.ts +23 -0
- package/src/modules/affiliates/hooks/use-affiliate-coupons.hook.ts +19 -0
- package/src/modules/affiliates/hooks/use-affiliate-leads.hook.ts +27 -0
- package/src/modules/affiliates/hooks/use-affiliate-report-analytics.hook.ts +19 -0
- package/src/modules/affiliates/hooks/use-affiliate-transactions.hook.ts +25 -0
- package/src/modules/affiliates/hooks/use-current-affiliate.hook.ts +19 -0
- package/src/modules/affiliates/hooks/use-ensure-affiliate.hook.ts +24 -0
- package/src/modules/affiliates/hooks/use-request-deposit.hook.ts +29 -0
- package/src/modules/affiliates/hooks/use-update-affiliate.hook.ts +24 -0
- package/src/modules/affiliates/hooks/use-withdrawal-limits.hook.ts +20 -0
- package/src/modules/affiliates/services/affiliates.service.ts +240 -0
- package/src/modules/affiliates/types/affiliate.type.ts +180 -0
- package/src/modules/affiliates/utils/get-affiliate-share-link.ts +8 -0
- package/src/modules/charges/actions/get-nota-fiscal.action.ts +8 -0
- package/src/modules/charges/actions/refresh-pix.action.ts +8 -0
- package/src/modules/charges/hooks/nota-fiscal.hook.ts +13 -0
- package/src/modules/charges/hooks/refresh-pix.hook.ts +13 -0
- package/src/modules/charges/services/charges.service.ts +121 -0
- package/src/modules/charges/types/nota-fiscal.type.ts +20 -0
- package/src/modules/charges/types/refresh-pix.type.ts +14 -0
- package/src/modules/charges/utils/get-charge-download-url.ts +10 -0
- package/src/modules/coupons/constants/query-keys.constants.ts +1 -0
- package/src/modules/coupons/handlers/find-coupon-by-code.handler.ts +16 -0
- package/src/modules/coupons/handlers/find-coupon-by-id.handler.ts +15 -0
- package/src/modules/coupons/hooks/use-coupon-by-code.hook.ts +16 -0
- package/src/modules/coupons/hooks/use-coupon-by-id.hook.ts +20 -0
- package/src/modules/coupons/services/coupons.service.ts +54 -0
- package/src/modules/coupons/types/coupon.type.ts +70 -0
- package/src/modules/coupons/utils/coupon-restrictions.ts +112 -0
- package/src/modules/domains/handlers/count-domains.handler.ts +10 -0
- package/src/modules/domains/hooks/count-domains.hook.ts +17 -0
- package/src/modules/domains/services/domains.service.ts +18 -0
- package/src/modules/ia-credits/handlers/list-ia-credit-operations.handler.ts +14 -0
- package/src/modules/ia-credits/hooks/ia-credit-operations.hook.ts +33 -0
- package/src/modules/ia-credits/services/ia-credits.service.ts +32 -1
- package/src/modules/pages/handlers/count-pages.handler.ts +5 -2
- package/src/modules/pages/hooks/count-published-pages.hook.ts +26 -0
- package/src/modules/pages/services/pages.service.ts +3 -2
- package/src/modules/plans/constants/plan-tooltips.constants.ts +16 -0
- package/src/modules/plans/hooks/use-enriched-plans.hook.ts +31 -0
- package/src/modules/plans/hooks/use-ui-plans.hook.ts +22 -0
- package/src/modules/projects/hooks/add-project-users.hook.ts +29 -0
- package/src/modules/projects/hooks/list-all-account-users.hook.ts +3 -6
- package/src/modules/projects/hooks/list-available-users.hook.ts +3 -6
- package/src/modules/projects/hooks/list-infinite-projects.hook.ts +3 -6
- package/src/modules/projects/hooks/list-project-users.hook.ts +3 -6
- package/src/modules/projects/hooks/remove-project-users.hook.ts +29 -0
- package/src/modules/projects/services/project-users.service.ts +135 -130
- package/src/modules/projects/types.ts +89 -88
- package/src/modules/subscriptions/actions/cancel-subscription.action.ts +12 -0
- package/src/modules/subscriptions/actions/create-subscription.action.ts +9 -0
- package/src/modules/subscriptions/actions/find-pending-pix-status.action.ts +8 -0
- package/src/modules/subscriptions/actions/find-subscription-by-id.action.ts +8 -0
- package/src/modules/subscriptions/constants/addons.constants.ts +50 -0
- package/src/modules/subscriptions/constants/downgrade.constants.ts +30 -0
- package/src/modules/subscriptions/constants/subscription.constants.ts +3 -0
- package/src/modules/subscriptions/handlers/pending-pix-status.handler.ts +17 -0
- package/src/modules/subscriptions/hooks/cancel-subscription.hook.ts +28 -0
- package/src/modules/subscriptions/hooks/create-subscription.hook.ts +34 -0
- package/src/modules/subscriptions/hooks/find-subscription-by-id.hook.ts +17 -0
- package/src/modules/subscriptions/hooks/pending-pix-status.hook.ts +30 -0
- package/src/modules/subscriptions/services/subscriptions.service.ts +401 -301
- package/src/modules/subscriptions/types/cancel-subscription.type.ts +8 -0
- package/src/modules/subscriptions/types/create-subscription.type.ts +79 -0
- package/src/modules/subscriptions/types/pending-pix-status.type.ts +33 -0
- package/src/modules/subscriptions/types/subscription.type.ts +157 -147
- package/src/modules/subscriptions/utils/addon-buckets.ts +129 -0
- package/src/modules/subscriptions/utils/confirm-payment-if-required.ts +9 -2
- package/src/modules/subscriptions/utils/first-period-pricing.ts +63 -0
- package/src/modules/subscriptions/utils/is-api-subscription.ts +6 -0
- package/src/modules/subscriptions/utils/is-boleto-payer.ts +21 -0
- package/src/modules/subscriptions/utils/is-free-subscription.ts +6 -0
- package/src/modules/subscriptions/utils/periodicity.ts +101 -0
- package/src/modules/subscriptions/utils/resolve-subscription-plan-name.ts +44 -0
- package/src/modules/users/hooks/messages.hook.ts +3 -5
- package/src/server.ts +102 -99
- package/src/store/useAccountModals.ts +22 -5
- package/src/store/useAffiliateFlows.ts +46 -0
- package/src/store/useProjectFlows.ts +42 -0
- package/src/store/useSubscriptionFlows.ts +176 -0
- package/src/store/useTeamFlows.ts +34 -0
- package/src/testing/factories/coupon.factory.ts +17 -0
- package/src/testing/factories/index.ts +3 -0
- package/src/testing/factories/project-user.factory.ts +15 -0
- package/src/testing/factories/project.factory.ts +19 -0
- package/src/testing/react/providers.tsx +2 -1
- package/src/utils/browser/chart-custom-tooltip.ts +85 -0
- package/src/utils/browser/get-css-variable.ts +6 -0
- package/src/utils/constants/scrollbar.ts +10 -0
- package/src/utils/date-filter-period.ts +34 -0
- package/src/utils/file/index.ts +13 -0
- package/src/utils/format/initials.ts +10 -0
- package/src/utils/format/masks.ts +41 -0
- package/src/utils/qrcode/to-data-url.ts +23 -0
- package/src/utils/validators/account.ts +0 -8
- package/dist/components/account/ConfigurationsMyAccountModal.mjs +0 -143
- package/dist/components/account/ConfigurationsMyAccountModal.mjs.map +0 -1
- package/dist/components/account/hooks/useConfigurationsModal.mjs +0 -34
- package/dist/components/account/hooks/useConfigurationsModal.mjs.map +0 -1
- package/src/components/account/ConfigurationsMyAccountModal.tsx +0 -179
- package/src/components/account/hooks/useConfigurationsModal.ts +0 -45
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { IconPlus, IconSearch } from "@tabler/icons-react";
|
|
5
|
+
import { useTranslations } from "next-intl";
|
|
6
|
+
import { Button } from "../../ui/buttons/Button";
|
|
7
|
+
import { Skeleton } from "../../ui/feedback/Skeleton";
|
|
8
|
+
import { FormField } from "../../ui/form/FormField";
|
|
9
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "../../ui/overlay/Tooltip";
|
|
10
|
+
import { useDebounce } from "../../../hooks/useDebounce";
|
|
11
|
+
import { useAuth } from "../../../providers/auth.provider";
|
|
12
|
+
import { useWhitelabel } from "../../../providers/whitelabel.provider";
|
|
13
|
+
import { useManagementPermissions } from "../../../modules/auth/hooks/useManagementPermissions";
|
|
14
|
+
import { useAccountMembers } from "../../../modules/accounts/hooks/use-account-members.hook";
|
|
15
|
+
import { UserProfile } from "../../../modules/users/schema";
|
|
16
|
+
import useTeamActions from "../hooks/useTeamActions";
|
|
17
|
+
import { FilterPopover } from "./shared/FilterPopover";
|
|
18
|
+
import { ListPagination } from "./shared/ListPagination";
|
|
19
|
+
import { SectionLoadError } from "./shared/SectionLoadError";
|
|
20
|
+
import { TeamFlows } from "./team/TeamFlows";
|
|
21
|
+
import { TeamMemberCard, TeamMemberRow } from "./team/TeamMemberRow";
|
|
22
|
+
import { WorkspaceSection } from "./shared/WorkspaceSection";
|
|
23
|
+
const TEAM_PAGE_SIZE = 10;
|
|
24
|
+
const WHITELABEL_WITHOUT_ADD_USER = 367568;
|
|
25
|
+
const PROFILE_FILTERS = [
|
|
26
|
+
UserProfile.admin,
|
|
27
|
+
UserProfile.collaborator,
|
|
28
|
+
UserProfile.viewer,
|
|
29
|
+
UserProfile.owner
|
|
30
|
+
];
|
|
31
|
+
function TeamSkeleton() {
|
|
32
|
+
return /* @__PURE__ */ jsx("div", { className: "border border-zinc-200 rounded-lg bg-white divide-y divide-zinc-200 overflow-hidden", children: Array.from({ length: TEAM_PAGE_SIZE }).map((_, index) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 px-5 py-4", children: [
|
|
33
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "size-8 rounded-full" }),
|
|
34
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-40" }),
|
|
35
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "hidden lg:block h-4 w-48 ml-auto" }),
|
|
36
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "hidden lg:block h-6 w-24 rounded-lg" })
|
|
37
|
+
] }, index)) });
|
|
38
|
+
}
|
|
39
|
+
function TeamSection() {
|
|
40
|
+
const translate = useTranslations();
|
|
41
|
+
const translateProfile = useTranslations("common.account.workspace.team.profiles");
|
|
42
|
+
const { user } = useAuth();
|
|
43
|
+
const { whitelabel } = useWhitelabel();
|
|
44
|
+
const { profile, isOwnerOrAdmin: canManage } = useManagementPermissions();
|
|
45
|
+
const actions = useTeamActions();
|
|
46
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
47
|
+
const [currentPage, setCurrentPage] = useState(1);
|
|
48
|
+
const [profileFilters, setProfileFilters] = useState([]);
|
|
49
|
+
const debouncedSearch = useDebounce(searchQuery, 400, () => setCurrentPage(1));
|
|
50
|
+
const hasFilters = profileFilters.length > 0 || !!debouncedSearch;
|
|
51
|
+
const { data, isPending, isFetching, isPlaceholderData, isError, refetch } = useAccountMembers(
|
|
52
|
+
{
|
|
53
|
+
page: currentPage,
|
|
54
|
+
limit: TEAM_PAGE_SIZE,
|
|
55
|
+
name: debouncedSearch || void 0,
|
|
56
|
+
profiles: profileFilters.length > 0 ? profileFilters : void 0,
|
|
57
|
+
...hasFilters ? {} : { firstId: user?.id }
|
|
58
|
+
},
|
|
59
|
+
{ enabled: !!profile }
|
|
60
|
+
);
|
|
61
|
+
const members = data?.users ?? [];
|
|
62
|
+
const total = data?.total ?? 0;
|
|
63
|
+
const totalPages = Math.ceil(total / TEAM_PAGE_SIZE);
|
|
64
|
+
const showSkeleton = isPending && !data || isPlaceholderData && isFetching;
|
|
65
|
+
const showAddUserButton = !!whitelabel && whitelabel.id !== WHITELABEL_WITHOUT_ADD_USER;
|
|
66
|
+
const handleToggleProfile = (value, checked) => {
|
|
67
|
+
setProfileFilters(
|
|
68
|
+
(previous) => checked ? [...previous, value] : previous.filter((item) => item !== value)
|
|
69
|
+
);
|
|
70
|
+
setCurrentPage(1);
|
|
71
|
+
};
|
|
72
|
+
const addUserButton = /* @__PURE__ */ jsxs(Button, { className: "h-10! shrink-0", disabled: !canManage, onClick: actions.addUser, children: [
|
|
73
|
+
/* @__PURE__ */ jsx(IconPlus, { className: "size-5!" }),
|
|
74
|
+
translate("common.account.workspace.team.addUser")
|
|
75
|
+
] });
|
|
76
|
+
return /* @__PURE__ */ jsxs(WorkspaceSection, { count: data ? total : void 0, children: [
|
|
77
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3", children: [
|
|
78
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-1 min-w-0", children: [
|
|
79
|
+
/* @__PURE__ */ jsx(
|
|
80
|
+
FormField,
|
|
81
|
+
{
|
|
82
|
+
leftIcon: IconSearch,
|
|
83
|
+
placeholder: translate("common.account.workspace.team.searchPlaceholder"),
|
|
84
|
+
value: searchQuery,
|
|
85
|
+
onChange: (event) => setSearchQuery(event.target.value),
|
|
86
|
+
classnameContainer: "w-full lg:w-75"
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
/* @__PURE__ */ jsx(
|
|
90
|
+
FilterPopover,
|
|
91
|
+
{
|
|
92
|
+
label: translate("common.account.workspace.team.filter"),
|
|
93
|
+
width: 180,
|
|
94
|
+
options: PROFILE_FILTERS.map((profile2) => ({ value: profile2, label: translateProfile(profile2) })),
|
|
95
|
+
selected: profileFilters,
|
|
96
|
+
onToggle: handleToggleProfile
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
] }),
|
|
100
|
+
showAddUserButton && (canManage ? addUserButton : /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
101
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "shrink-0", children: addUserButton }) }),
|
|
102
|
+
/* @__PURE__ */ jsx(TooltipContent, { children: translate("common.account.workspace.team.noPermissionToAdd") })
|
|
103
|
+
] }))
|
|
104
|
+
] }),
|
|
105
|
+
showSkeleton && /* @__PURE__ */ jsx(TeamSkeleton, {}),
|
|
106
|
+
!showSkeleton && isError && /* @__PURE__ */ jsx(SectionLoadError, { message: translate("common.account.workspace.loadFailed"), onRetry: () => refetch() }),
|
|
107
|
+
!showSkeleton && !isError && members.length === 0 && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-12 border border-zinc-200 rounded-lg bg-white", children: /* @__PURE__ */ jsx("p", { className: "paragraph-small-medium text-zinc-500", children: translate("common.account.workspace.team.empty") }) }),
|
|
108
|
+
!showSkeleton && !isError && members.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
109
|
+
/* @__PURE__ */ jsx("div", { className: "hidden lg:block border border-zinc-200 rounded-lg bg-white divide-y divide-zinc-200 overflow-hidden", children: members.map((member) => /* @__PURE__ */ jsx(TeamMemberRow, { member, onEdit: actions.editUser, onDelete: actions.deleteUser }, member.id)) }),
|
|
110
|
+
/* @__PURE__ */ jsx("div", { className: "lg:hidden flex flex-col gap-3", children: members.map((member) => /* @__PURE__ */ jsx(TeamMemberCard, { member, onEdit: actions.editUser, onDelete: actions.deleteUser }, member.id)) })
|
|
111
|
+
] }),
|
|
112
|
+
/* @__PURE__ */ jsx(ListPagination, { currentPage, totalPages, onPageChange: setCurrentPage }),
|
|
113
|
+
/* @__PURE__ */ jsx(TeamFlows, {})
|
|
114
|
+
] });
|
|
115
|
+
}
|
|
116
|
+
export {
|
|
117
|
+
TeamSection
|
|
118
|
+
};
|
|
119
|
+
//# sourceMappingURL=TeamSection.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/account/sections/TeamSection.tsx"],"sourcesContent":["'use client';\n\nimport { useState } from 'react';\nimport { IconPlus, IconSearch } from '@tabler/icons-react';\nimport { useTranslations } from 'next-intl';\nimport { Button } from '../../ui/buttons/Button';\nimport { Skeleton } from '../../ui/feedback/Skeleton';\nimport { FormField } from '../../ui/form/FormField';\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../../ui/overlay/Tooltip';\nimport { useDebounce } from '../../../hooks/useDebounce';\nimport { useAuth } from '../../../providers/auth.provider';\nimport { useWhitelabel } from '../../../providers/whitelabel.provider';\nimport { useManagementPermissions } from '../../../modules/auth/hooks/useManagementPermissions';\nimport { useAccountMembers } from '../../../modules/accounts/hooks/use-account-members.hook';\nimport { UserProfile } from '../../../modules/users/schema';\nimport useTeamActions from '../hooks/useTeamActions';\nimport { FilterPopover } from './shared/FilterPopover';\nimport { ListPagination } from './shared/ListPagination';\nimport { SectionLoadError } from './shared/SectionLoadError';\nimport { TeamFlows } from './team/TeamFlows';\nimport { TeamMemberCard, TeamMemberRow } from './team/TeamMemberRow';\nimport { WorkspaceSection } from './shared/WorkspaceSection';\n\nconst TEAM_PAGE_SIZE = 10;\n\n/** Whitelabel que não cadastra usuários pela tela de equipe (regra herdada do gapps). */\nconst WHITELABEL_WITHOUT_ADD_USER = 367568;\n\nconst PROFILE_FILTERS: UserProfile[] = [\n UserProfile.admin,\n UserProfile.collaborator,\n UserProfile.viewer,\n UserProfile.owner,\n];\n\nfunction TeamSkeleton() {\n return (\n <div className=\"border border-zinc-200 rounded-lg bg-white divide-y divide-zinc-200 overflow-hidden\">\n {Array.from({ length: TEAM_PAGE_SIZE }).map((_, index) => (\n <div key={index} className=\"flex items-center gap-4 px-5 py-4\">\n <Skeleton className=\"size-8 rounded-full\" />\n <Skeleton className=\"h-4 w-40\" />\n <Skeleton className=\"hidden lg:block h-4 w-48 ml-auto\" />\n <Skeleton className=\"hidden lg:block h-6 w-24 rounded-lg\" />\n </div>\n ))}\n </div>\n );\n}\n\nexport function TeamSection() {\n const translate = useTranslations();\n const translateProfile = useTranslations('common.account.workspace.team.profiles');\n const { user } = useAuth();\n const { whitelabel } = useWhitelabel();\n const { profile, isOwnerOrAdmin: canManage } = useManagementPermissions();\n const actions = useTeamActions();\n\n const [searchQuery, setSearchQuery] = useState('');\n const [currentPage, setCurrentPage] = useState(1);\n const [profileFilters, setProfileFilters] = useState<UserProfile[]>([]);\n const debouncedSearch = useDebounce(searchQuery, 400, () => setCurrentPage(1));\n\n const hasFilters = profileFilters.length > 0 || !!debouncedSearch;\n\n const { data, isPending, isFetching, isPlaceholderData, isError, refetch } = useAccountMembers(\n {\n page: currentPage,\n limit: TEAM_PAGE_SIZE,\n name: debouncedSearch || undefined,\n profiles: profileFilters.length > 0 ? profileFilters : undefined,\n ...(hasFilters ? {} : { firstId: user?.id }),\n },\n { enabled: !!profile }\n );\n\n const members = data?.users ?? [];\n const total = data?.total ?? 0;\n const totalPages = Math.ceil(total / TEAM_PAGE_SIZE);\n const showSkeleton = (isPending && !data) || (isPlaceholderData && isFetching);\n const showAddUserButton = !!whitelabel && whitelabel.id !== WHITELABEL_WITHOUT_ADD_USER;\n\n const handleToggleProfile = (value: UserProfile, checked: boolean) => {\n setProfileFilters((previous) =>\n checked ? [...previous, value] : previous.filter((item) => item !== value)\n );\n setCurrentPage(1);\n };\n\n const addUserButton = (\n <Button className=\"h-10! shrink-0\" disabled={!canManage} onClick={actions.addUser}>\n <IconPlus className=\"size-5!\" />\n {translate('common.account.workspace.team.addUser')}\n </Button>\n );\n\n return (\n <WorkspaceSection count={data ? total : undefined}>\n <div className=\"flex items-center justify-between gap-3\">\n <div className=\"flex items-center gap-2 flex-1 min-w-0\">\n <FormField\n leftIcon={IconSearch}\n placeholder={translate('common.account.workspace.team.searchPlaceholder')}\n value={searchQuery}\n onChange={(event) => setSearchQuery(event.target.value)}\n classnameContainer=\"w-full lg:w-75\"\n />\n <FilterPopover\n label={translate('common.account.workspace.team.filter')}\n width={180}\n options={PROFILE_FILTERS.map((profile) => ({ value: profile, label: translateProfile(profile) }))}\n selected={profileFilters}\n onToggle={handleToggleProfile}\n />\n </div>\n {showAddUserButton &&\n (canManage ? (\n addUserButton\n ) : (\n <Tooltip>\n <TooltipTrigger asChild>\n <span className=\"shrink-0\">{addUserButton}</span>\n </TooltipTrigger>\n <TooltipContent>{translate('common.account.workspace.team.noPermissionToAdd')}</TooltipContent>\n </Tooltip>\n ))}\n </div>\n\n {showSkeleton && <TeamSkeleton />}\n\n {!showSkeleton && isError && (\n <SectionLoadError message={translate('common.account.workspace.loadFailed')} onRetry={() => refetch()} />\n )}\n\n {!showSkeleton && !isError && members.length === 0 && (\n <div className=\"flex items-center justify-center py-12 border border-zinc-200 rounded-lg bg-white\">\n <p className=\"paragraph-small-medium text-zinc-500\">{translate('common.account.workspace.team.empty')}</p>\n </div>\n )}\n\n {!showSkeleton && !isError && members.length > 0 && (\n <>\n <div className=\"hidden lg:block border border-zinc-200 rounded-lg bg-white divide-y divide-zinc-200 overflow-hidden\">\n {members.map((member) => (\n <TeamMemberRow key={member.id} member={member} onEdit={actions.editUser} onDelete={actions.deleteUser} />\n ))}\n </div>\n <div className=\"lg:hidden flex flex-col gap-3\">\n {members.map((member) => (\n <TeamMemberCard key={member.id} member={member} onEdit={actions.editUser} onDelete={actions.deleteUser} />\n ))}\n </div>\n </>\n )}\n\n <ListPagination currentPage={currentPage} totalPages={totalPages} onPageChange={setCurrentPage} />\n\n <TeamFlows />\n </WorkspaceSection>\n );\n}\n"],"mappings":"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","names":["profile"]}
|
|
@@ -9,6 +9,7 @@ import { FormField } from "../../ui/form/FormField";
|
|
|
9
9
|
import useCopyToClipboard from "../../../hooks/copy-to-clipboard.hook";
|
|
10
10
|
import { useAccountToken } from "../../../modules/accounts/hooks/use-account-token.hook";
|
|
11
11
|
import { useIsDefaultWhitelabel, useWhitelabel } from "../../../providers/whitelabel.provider";
|
|
12
|
+
import { WorkspaceSection } from "./shared/WorkspaceSection";
|
|
12
13
|
function TokenSection() {
|
|
13
14
|
const translate = useTranslations();
|
|
14
15
|
const { data: token = "", isLoading } = useAccountToken();
|
|
@@ -36,52 +37,49 @@ function TokenSection() {
|
|
|
36
37
|
));
|
|
37
38
|
}
|
|
38
39
|
});
|
|
39
|
-
return /* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/* @__PURE__ */ jsx(
|
|
44
|
-
FormField,
|
|
45
|
-
{
|
|
46
|
-
label: translate("common.account.token.label"),
|
|
47
|
-
value: isLoading ? translate("common.actions.loading") : token,
|
|
48
|
-
disabled: true,
|
|
49
|
-
readOnly: true,
|
|
50
|
-
classnameContainer: "bg-gray-50 cursor-default opacity-100!",
|
|
51
|
-
className: "text-gray-950/50"
|
|
52
|
-
}
|
|
53
|
-
),
|
|
54
|
-
/* @__PURE__ */ jsxs(
|
|
55
|
-
Button,
|
|
56
|
-
{
|
|
57
|
-
type: "button",
|
|
58
|
-
variant: "secondary",
|
|
59
|
-
className: "h-10! shrink-0 gap-2",
|
|
60
|
-
onClick: () => copy(token),
|
|
61
|
-
disabled: isLoading || !token,
|
|
62
|
-
children: [
|
|
63
|
-
isCopied ? /* @__PURE__ */ jsx(IconCheck, { size: 16 }) : /* @__PURE__ */ jsx(IconCopy, { size: 16 }),
|
|
64
|
-
isCopied ? translate("common.actions.copied") : translate("common.actions.copy")
|
|
65
|
-
]
|
|
66
|
-
}
|
|
67
|
-
)
|
|
68
|
-
] }),
|
|
69
|
-
/* @__PURE__ */ jsxs("div", { className: `flex items-center gap-3 p-4 rounded-lg ${isDefaultWl ? "bg-cyan-50" : "bg-zinc-50"}`, children: [
|
|
70
|
-
/* @__PURE__ */ jsx(IconInfoCircle, { className: "size-4 text-zinc-950 shrink-0" }),
|
|
71
|
-
/* @__PURE__ */ jsx("span", { className: "paragraph-small-regular text-zinc-950 max-w-[420px]", children: translate("common.account.token.info") })
|
|
72
|
-
] }),
|
|
73
|
-
whitelabel?.id === 1 && /* @__PURE__ */ jsx(
|
|
74
|
-
"a",
|
|
40
|
+
return /* @__PURE__ */ jsx(WorkspaceSection, { children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
41
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-end gap-3", children: [
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
FormField,
|
|
75
44
|
{
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
45
|
+
label: translate("common.account.token.label"),
|
|
46
|
+
value: isLoading ? translate("common.actions.loading") : token,
|
|
47
|
+
disabled: true,
|
|
48
|
+
readOnly: true,
|
|
49
|
+
classnameContainer: "bg-gray-50 cursor-default opacity-100!",
|
|
50
|
+
className: "text-gray-950/50"
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ jsxs(
|
|
54
|
+
Button,
|
|
55
|
+
{
|
|
56
|
+
type: "button",
|
|
57
|
+
variant: "secondary",
|
|
58
|
+
className: "h-10! shrink-0 gap-2",
|
|
59
|
+
onClick: () => copy(token),
|
|
60
|
+
disabled: isLoading || !token,
|
|
61
|
+
children: [
|
|
62
|
+
isCopied ? /* @__PURE__ */ jsx(IconCheck, { size: 16 }) : /* @__PURE__ */ jsx(IconCopy, { size: 16 }),
|
|
63
|
+
isCopied ? translate("common.actions.copied") : translate("common.actions.copy")
|
|
64
|
+
]
|
|
81
65
|
}
|
|
82
66
|
)
|
|
83
|
-
] })
|
|
84
|
-
|
|
67
|
+
] }),
|
|
68
|
+
/* @__PURE__ */ jsxs("div", { className: `flex items-center gap-3 p-4 rounded-lg ${isDefaultWl ? "bg-cyan-50" : "bg-zinc-50"}`, children: [
|
|
69
|
+
/* @__PURE__ */ jsx(IconInfoCircle, { className: "size-4 text-zinc-950 shrink-0" }),
|
|
70
|
+
/* @__PURE__ */ jsx("span", { className: "paragraph-small-regular text-zinc-950 max-w-[420px]", children: translate("common.account.token.info") })
|
|
71
|
+
] }),
|
|
72
|
+
whitelabel?.id === 1 && /* @__PURE__ */ jsx(
|
|
73
|
+
"a",
|
|
74
|
+
{
|
|
75
|
+
href: "https://documenter.getpostman.com/view/4861938/T1Djiz8H",
|
|
76
|
+
target: "_blank",
|
|
77
|
+
rel: "noopener noreferrer",
|
|
78
|
+
className: "paragraph-small-medium text-gray-500 underline hover:text-gray-700 transition-colors w-fit",
|
|
79
|
+
children: translate("common.account.token.docsLink")
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
] }) });
|
|
85
83
|
}
|
|
86
84
|
export {
|
|
87
85
|
TokenSection
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/account/sections/TokenSection.tsx"],"sourcesContent":["'use client';\n\nimport { IconCheck, IconCopy, IconInfoCircle } from '@tabler/icons-react';\nimport { useTranslations } from 'next-intl';\nimport { toast } from 'sonner';\nimport { Toast } from '../../ui/feedback/Toast';\nimport { Button } from '../../ui/buttons/Button';\nimport { FormField } from '../../ui/form/FormField';\nimport useCopyToClipboard from '../../../hooks/copy-to-clipboard.hook';\nimport { useAccountToken } from '../../../modules/accounts/hooks/use-account-token.hook';\nimport { useIsDefaultWhitelabel, useWhitelabel } from '../../../providers/whitelabel.provider';\n\nexport function TokenSection() {\n const translate = useTranslations();\n const { data: token = '', isLoading } = useAccountToken();\n const isDefaultWl = useIsDefaultWhitelabel();\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/account/sections/TokenSection.tsx"],"sourcesContent":["'use client';\n\nimport { IconCheck, IconCopy, IconInfoCircle } from '@tabler/icons-react';\nimport { useTranslations } from 'next-intl';\nimport { toast } from 'sonner';\nimport { Toast } from '../../ui/feedback/Toast';\nimport { Button } from '../../ui/buttons/Button';\nimport { FormField } from '../../ui/form/FormField';\nimport useCopyToClipboard from '../../../hooks/copy-to-clipboard.hook';\nimport { useAccountToken } from '../../../modules/accounts/hooks/use-account-token.hook';\nimport { useIsDefaultWhitelabel, useWhitelabel } from '../../../providers/whitelabel.provider';\nimport { WorkspaceSection } from './shared/WorkspaceSection';\n\nexport function TokenSection() {\n const translate = useTranslations();\n const { data: token = '', isLoading } = useAccountToken();\n const isDefaultWl = useIsDefaultWhitelabel();\n const { whitelabel } = useWhitelabel();\n\n const { isCopied, copy } = useCopyToClipboard({\n onSuccess: () => {\n toast.custom((toastId) => (\n <Toast\n variant=\"success\"\n message={translate('common.account.token.copySuccess')}\n toastId={toastId}\n />\n ));\n },\n onError: () => {\n toast.custom((toastId) => (\n <Toast\n variant=\"error\"\n message={translate('common.account.token.copyError')}\n toastId={toastId}\n />\n ));\n },\n });\n\n return (\n <WorkspaceSection>\n <div className=\"flex flex-col gap-3\">\n <div className=\"flex items-end gap-3\">\n <FormField\n label={translate('common.account.token.label')}\n value={isLoading ? translate('common.actions.loading') : token}\n disabled\n readOnly\n classnameContainer=\"bg-gray-50 cursor-default opacity-100!\"\n className=\"text-gray-950/50\"\n />\n <Button\n type=\"button\"\n variant=\"secondary\"\n className=\"h-10! shrink-0 gap-2\"\n onClick={() => copy(token)}\n disabled={isLoading || !token}\n >\n {isCopied ? <IconCheck size={16} /> : <IconCopy size={16} />}\n {isCopied ? translate('common.actions.copied') : translate('common.actions.copy')}\n </Button>\n </div>\n\n <div className={`flex items-center gap-3 p-4 rounded-lg ${isDefaultWl ? 'bg-cyan-50' : 'bg-zinc-50'}`}>\n <IconInfoCircle className=\"size-4 text-zinc-950 shrink-0\" />\n <span className=\"paragraph-small-regular text-zinc-950 max-w-[420px]\">\n {translate('common.account.token.info')}\n </span>\n </div>\n\n {whitelabel?.id === 1 && (\n <a\n href=\"https://documenter.getpostman.com/view/4861938/T1Djiz8H\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"paragraph-small-medium text-gray-500 underline hover:text-gray-700 transition-colors w-fit\"\n >\n {translate('common.account.token.docsLink')}\n </a>\n )}\n </div>\n </WorkspaceSection>\n );\n}\n"],"mappings":";AAsBQ,cA8BE,YA9BF;AApBR,SAAS,WAAW,UAAU,sBAAsB;AACpD,SAAS,uBAAuB;AAChC,SAAS,aAAa;AACtB,SAAS,aAAa;AACtB,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAC1B,OAAO,wBAAwB;AAC/B,SAAS,uBAAuB;AAChC,SAAS,wBAAwB,qBAAqB;AACtD,SAAS,wBAAwB;AAE1B,SAAS,eAAe;AAC7B,QAAM,YAAY,gBAAgB;AAClC,QAAM,EAAE,MAAM,QAAQ,IAAI,UAAU,IAAI,gBAAgB;AACxD,QAAM,cAAc,uBAAuB;AAC3C,QAAM,EAAE,WAAW,IAAI,cAAc;AAErC,QAAM,EAAE,UAAU,KAAK,IAAI,mBAAmB;AAAA,IAC5C,WAAW,MAAM;AACf,YAAM,OAAO,CAAC,YACZ;AAAA,QAAC;AAAA;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,UAAU,kCAAkC;AAAA,UACrD;AAAA;AAAA,MACF,CACD;AAAA,IACH;AAAA,IACA,SAAS,MAAM;AACb,YAAM,OAAO,CAAC,YACZ;AAAA,QAAC;AAAA;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,UAAU,gCAAgC;AAAA,UACnD;AAAA;AAAA,MACF,CACD;AAAA,IACH;AAAA,EACF,CAAC;AAED,SACE,oBAAC,oBACC,+BAAC,SAAI,WAAU,uBACb;AAAA,yBAAC,SAAI,WAAU,wBACb;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,OAAO,UAAU,4BAA4B;AAAA,UAC7C,OAAO,YAAY,UAAU,wBAAwB,IAAI;AAAA,UACzD,UAAQ;AAAA,UACR,UAAQ;AAAA,UACR,oBAAmB;AAAA,UACnB,WAAU;AAAA;AAAA,MACZ;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,SAAQ;AAAA,UACR,WAAU;AAAA,UACV,SAAS,MAAM,KAAK,KAAK;AAAA,UACzB,UAAU,aAAa,CAAC;AAAA,UAEvB;AAAA,uBAAW,oBAAC,aAAU,MAAM,IAAI,IAAK,oBAAC,YAAS,MAAM,IAAI;AAAA,YACzD,WAAW,UAAU,uBAAuB,IAAI,UAAU,qBAAqB;AAAA;AAAA;AAAA,MAClF;AAAA,OACF;AAAA,IAEA,qBAAC,SAAI,WAAW,0CAA0C,cAAc,eAAe,YAAY,IACjG;AAAA,0BAAC,kBAAe,WAAU,iCAAgC;AAAA,MAC1D,oBAAC,UAAK,WAAU,uDACb,oBAAU,2BAA2B,GACxC;AAAA,OACF;AAAA,IAEC,YAAY,OAAO,KAClB;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,QAAO;AAAA,QACP,KAAI;AAAA,QACJ,WAAU;AAAA,QAET,oBAAU,+BAA+B;AAAA;AAAA,IAC5C;AAAA,KAEJ,GACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { IconCopy } from "@tabler/icons-react";
|
|
4
|
+
import { useTranslations } from "next-intl";
|
|
5
|
+
import { toast } from "sonner";
|
|
6
|
+
import { Button } from "../../../ui/buttons/Button";
|
|
7
|
+
import { FormField } from "../../../ui/form/FormField";
|
|
8
|
+
import { Toast } from "../../../ui/feedback/Toast";
|
|
9
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "../../../ui/overlay/Tooltip";
|
|
10
|
+
import { copyToClipboard } from "../../../../utils/browser/clipboard";
|
|
11
|
+
function AffiliateCommissionCard({
|
|
12
|
+
commissionPercent,
|
|
13
|
+
discountPercent,
|
|
14
|
+
affiliateCode,
|
|
15
|
+
shareLink
|
|
16
|
+
}) {
|
|
17
|
+
const translate = useTranslations();
|
|
18
|
+
const handleCopy = async () => {
|
|
19
|
+
const copied = await copyToClipboard(shareLink);
|
|
20
|
+
if (!copied) return;
|
|
21
|
+
toast.custom((toastId) => /* @__PURE__ */ jsx(
|
|
22
|
+
Toast,
|
|
23
|
+
{
|
|
24
|
+
variant: "success",
|
|
25
|
+
message: translate("common.account.workspace.affiliates.commissionCard.linkCopied"),
|
|
26
|
+
toastId
|
|
27
|
+
}
|
|
28
|
+
));
|
|
29
|
+
};
|
|
30
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6 bg-white border border-zinc-200 p-5 lg:p-6 rounded-lg", children: [
|
|
31
|
+
/* @__PURE__ */ jsx("span", { className: "paragraph-medium-semibold text-zinc-950", children: translate("common.account.workspace.affiliates.commissionCard.title", { percent: String(commissionPercent) }) }),
|
|
32
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col lg:flex-row lg:items-end justify-between gap-4", children: [
|
|
33
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col lg:flex-row lg:items-end gap-3 min-w-0", children: [
|
|
34
|
+
/* @__PURE__ */ jsx(
|
|
35
|
+
FormField,
|
|
36
|
+
{
|
|
37
|
+
label: translate("common.account.workspace.affiliates.commissionCard.affiliateCode"),
|
|
38
|
+
classnameContainer: "w-full lg:w-[300px]",
|
|
39
|
+
value: affiliateCode,
|
|
40
|
+
readOnly: true
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-end gap-3", children: [
|
|
44
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
45
|
+
/* @__PURE__ */ jsx("span", { className: "paragraph-xsmall-semibold text-zinc-600", children: translate("common.account.workspace.affiliates.commissionCard.commission") }),
|
|
46
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-10 w-18 rounded-lg bg-zinc-50", children: /* @__PURE__ */ jsxs("span", { className: "text-zinc-950 paragraph-small-semibold", children: [
|
|
47
|
+
commissionPercent,
|
|
48
|
+
"%"
|
|
49
|
+
] }) })
|
|
50
|
+
] }),
|
|
51
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
52
|
+
/* @__PURE__ */ jsx("span", { className: "paragraph-xsmall-semibold text-zinc-600", children: translate("common.account.workspace.affiliates.commissionCard.discount") }),
|
|
53
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-10 w-18 rounded-lg bg-zinc-50", children: /* @__PURE__ */ jsxs("span", { className: "text-zinc-950 paragraph-small-semibold", children: [
|
|
54
|
+
discountPercent,
|
|
55
|
+
"%"
|
|
56
|
+
] }) })
|
|
57
|
+
] })
|
|
58
|
+
] })
|
|
59
|
+
] }),
|
|
60
|
+
/* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
61
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "secondary", className: "h-10! shrink-0", onClick: handleCopy, children: [
|
|
62
|
+
translate("common.account.workspace.affiliates.commissionCard.shareLink"),
|
|
63
|
+
/* @__PURE__ */ jsx(IconCopy, { size: 20 })
|
|
64
|
+
] }) }),
|
|
65
|
+
/* @__PURE__ */ jsx(TooltipContent, { children: translate("common.account.workspace.affiliates.commissionCard.copyTooltip") })
|
|
66
|
+
] })
|
|
67
|
+
] })
|
|
68
|
+
] });
|
|
69
|
+
}
|
|
70
|
+
export {
|
|
71
|
+
AffiliateCommissionCard
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=AffiliateCommissionCard.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/account/sections/affiliates/AffiliateCommissionCard.tsx"],"sourcesContent":["'use client';\n\nimport { IconCopy } from '@tabler/icons-react';\nimport { useTranslations } from 'next-intl';\nimport { toast } from 'sonner';\nimport { Button } from '../../../ui/buttons/Button';\nimport { FormField } from '../../../ui/form/FormField';\nimport { Toast } from '../../../ui/feedback/Toast';\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../../../ui/overlay/Tooltip';\nimport { copyToClipboard } from '../../../../utils/browser/clipboard';\n\ntype AffiliateCommissionCardProps = {\n commissionPercent: number;\n discountPercent: number;\n affiliateCode: string;\n shareLink: string;\n};\n\nexport function AffiliateCommissionCard({\n commissionPercent,\n discountPercent,\n affiliateCode,\n shareLink,\n}: AffiliateCommissionCardProps) {\n const translate = useTranslations();\n\n const handleCopy = async () => {\n const copied = await copyToClipboard(shareLink);\n if (!copied) return;\n toast.custom((toastId) => (\n <Toast\n variant=\"success\"\n message={translate('common.account.workspace.affiliates.commissionCard.linkCopied')}\n toastId={toastId}\n />\n ));\n };\n\n return (\n <div className=\"flex flex-col gap-6 bg-white border border-zinc-200 p-5 lg:p-6 rounded-lg\">\n <span className=\"paragraph-medium-semibold text-zinc-950\">\n {translate('common.account.workspace.affiliates.commissionCard.title', { percent: String(commissionPercent) })}\n </span>\n <div className=\"flex flex-col lg:flex-row lg:items-end justify-between gap-4\">\n <div className=\"flex flex-col lg:flex-row lg:items-end gap-3 min-w-0\">\n <FormField\n label={translate('common.account.workspace.affiliates.commissionCard.affiliateCode')}\n classnameContainer=\"w-full lg:w-[300px]\"\n value={affiliateCode}\n readOnly\n />\n <div className=\"flex items-end gap-3\">\n <div className=\"flex flex-col gap-1.5\">\n <span className=\"paragraph-xsmall-semibold text-zinc-600\">\n {translate('common.account.workspace.affiliates.commissionCard.commission')}\n </span>\n <div className=\"flex items-center justify-center h-10 w-18 rounded-lg bg-zinc-50\">\n <span className=\"text-zinc-950 paragraph-small-semibold\">{commissionPercent}%</span>\n </div>\n </div>\n <div className=\"flex flex-col gap-1.5\">\n <span className=\"paragraph-xsmall-semibold text-zinc-600\">\n {translate('common.account.workspace.affiliates.commissionCard.discount')}\n </span>\n <div className=\"flex items-center justify-center h-10 w-18 rounded-lg bg-zinc-50\">\n <span className=\"text-zinc-950 paragraph-small-semibold\">{discountPercent}%</span>\n </div>\n </div>\n </div>\n </div>\n <Tooltip>\n <TooltipTrigger asChild>\n <Button variant=\"secondary\" className=\"h-10! shrink-0\" onClick={handleCopy}>\n {translate('common.account.workspace.affiliates.commissionCard.shareLink')}\n <IconCopy size={20} />\n </Button>\n </TooltipTrigger>\n <TooltipContent>{translate('common.account.workspace.affiliates.commissionCard.copyTooltip')}</TooltipContent>\n </Tooltip>\n </div>\n </div>\n );\n}\n"],"mappings":";AA8BM,cA2BU,YA3BV;AA5BN,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,SAAS,aAAa;AACtB,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAC1B,SAAS,aAAa;AACtB,SAAS,SAAS,gBAAgB,sBAAsB;AACxD,SAAS,uBAAuB;AASzB,SAAS,wBAAwB;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAiC;AAC/B,QAAM,YAAY,gBAAgB;AAElC,QAAM,aAAa,YAAY;AAC7B,UAAM,SAAS,MAAM,gBAAgB,SAAS;AAC9C,QAAI,CAAC,OAAQ;AACb,UAAM,OAAO,CAAC,YACZ;AAAA,MAAC;AAAA;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,UAAU,+DAA+D;AAAA,QAClF;AAAA;AAAA,IACF,CACD;AAAA,EACH;AAEA,SACE,qBAAC,SAAI,WAAU,6EACb;AAAA,wBAAC,UAAK,WAAU,2CACb,oBAAU,4DAA4D,EAAE,SAAS,OAAO,iBAAiB,EAAE,CAAC,GAC/G;AAAA,IACA,qBAAC,SAAI,WAAU,gEACb;AAAA,2BAAC,SAAI,WAAU,wDACb;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,OAAO,UAAU,kEAAkE;AAAA,YACnF,oBAAmB;AAAA,YACnB,OAAO;AAAA,YACP,UAAQ;AAAA;AAAA,QACV;AAAA,QACA,qBAAC,SAAI,WAAU,wBACb;AAAA,+BAAC,SAAI,WAAU,yBACb;AAAA,gCAAC,UAAK,WAAU,2CACb,oBAAU,+DAA+D,GAC5E;AAAA,YACA,oBAAC,SAAI,WAAU,oEACb,+BAAC,UAAK,WAAU,0CAA0C;AAAA;AAAA,cAAkB;AAAA,eAAC,GAC/E;AAAA,aACF;AAAA,UACA,qBAAC,SAAI,WAAU,yBACb;AAAA,gCAAC,UAAK,WAAU,2CACb,oBAAU,6DAA6D,GAC1E;AAAA,YACA,oBAAC,SAAI,WAAU,oEACb,+BAAC,UAAK,WAAU,0CAA0C;AAAA;AAAA,cAAgB;AAAA,eAAC,GAC7E;AAAA,aACF;AAAA,WACF;AAAA,SACF;AAAA,MACA,qBAAC,WACC;AAAA,4BAAC,kBAAe,SAAO,MACrB,+BAAC,UAAO,SAAQ,aAAY,WAAU,kBAAiB,SAAS,YAC7D;AAAA,oBAAU,8DAA8D;AAAA,UACzE,oBAAC,YAAS,MAAM,IAAI;AAAA,WACtB,GACF;AAAA,QACA,oBAAC,kBAAgB,oBAAU,gEAAgE,GAAE;AAAA,SAC/F;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { AffiliateLeadsSheet } from "./AffiliateLeadsSheet";
|
|
4
|
+
import { NoReceivingAccountModal } from "./NoReceivingAccountModal";
|
|
5
|
+
import { ReceivingAccountModal } from "./ReceivingAccountModal";
|
|
6
|
+
import { RequestWithdrawalSheet } from "./RequestWithdrawalSheet";
|
|
7
|
+
import { ViewAttachmentModal } from "./ViewAttachmentModal";
|
|
8
|
+
function AffiliateFlows() {
|
|
9
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10
|
+
/* @__PURE__ */ jsx(RequestWithdrawalSheet, {}),
|
|
11
|
+
/* @__PURE__ */ jsx(ReceivingAccountModal, {}),
|
|
12
|
+
/* @__PURE__ */ jsx(NoReceivingAccountModal, {}),
|
|
13
|
+
/* @__PURE__ */ jsx(AffiliateLeadsSheet, {}),
|
|
14
|
+
/* @__PURE__ */ jsx(ViewAttachmentModal, {})
|
|
15
|
+
] });
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
AffiliateFlows
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=AffiliateFlows.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/account/sections/affiliates/AffiliateFlows.tsx"],"sourcesContent":["'use client';\n\nimport { AffiliateLeadsSheet } from './AffiliateLeadsSheet';\nimport { NoReceivingAccountModal } from './NoReceivingAccountModal';\nimport { ReceivingAccountModal } from './ReceivingAccountModal';\nimport { RequestWithdrawalSheet } from './RequestWithdrawalSheet';\nimport { ViewAttachmentModal } from './ViewAttachmentModal';\n\n/** Fluxos da aba Afiliados, abertos por cima do modal Minha conta. */\nexport function AffiliateFlows() {\n return (\n <>\n <RequestWithdrawalSheet />\n <ReceivingAccountModal />\n <NoReceivingAccountModal />\n <AffiliateLeadsSheet />\n <ViewAttachmentModal />\n </>\n );\n}\n"],"mappings":";AAWI,mBACE,KADF;AATJ,SAAS,2BAA2B;AACpC,SAAS,+BAA+B;AACxC,SAAS,6BAA6B;AACtC,SAAS,8BAA8B;AACvC,SAAS,2BAA2B;AAG7B,SAAS,iBAAiB;AAC/B,SACE,iCACE;AAAA,wBAAC,0BAAuB;AAAA,IACxB,oBAAC,yBAAsB;AAAA,IACvB,oBAAC,2BAAwB;AAAA,IACzB,oBAAC,uBAAoB;AAAA,IACrB,oBAAC,uBAAoB;AAAA,KACvB;AAEJ;","names":[]}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { IconLoader2 } from "@tabler/icons-react";
|
|
5
|
+
import { useTranslations } from "next-intl";
|
|
6
|
+
import { Separator } from "../../../ui/data-display/Separator";
|
|
7
|
+
import { Sheet, SheetContent, SheetHeader, SheetTitle } from "../../../ui/overlay/Sheet";
|
|
8
|
+
import { useAffiliateLeads } from "../../../../modules/affiliates/hooks/use-affiliate-leads.hook";
|
|
9
|
+
import useIsMobile from "../../../../hooks/useIsMobile";
|
|
10
|
+
import { cn } from "../../../../infra/utils/clsx";
|
|
11
|
+
import { useAffiliateFlows } from "../../../../store/useAffiliateFlows";
|
|
12
|
+
function getFirstName(name) {
|
|
13
|
+
if (!name) return "\u2014";
|
|
14
|
+
return name.trim().split(/\s+/)[0];
|
|
15
|
+
}
|
|
16
|
+
function formatLeadDate(datetime) {
|
|
17
|
+
if (!datetime) return "\u2014";
|
|
18
|
+
const date = new Date(datetime);
|
|
19
|
+
if (Number.isNaN(date.getTime())) return "\u2014";
|
|
20
|
+
const day = String(date.getDate()).padStart(2, "0");
|
|
21
|
+
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
22
|
+
const hours = String(date.getHours()).padStart(2, "0");
|
|
23
|
+
const minutes = String(date.getMinutes()).padStart(2, "0");
|
|
24
|
+
return `${day}/${month}/${date.getFullYear()} ${hours}:${minutes}`;
|
|
25
|
+
}
|
|
26
|
+
function getMonthYearKey(datetime, noDate, months) {
|
|
27
|
+
if (!datetime) return noDate;
|
|
28
|
+
const date = new Date(datetime);
|
|
29
|
+
if (Number.isNaN(date.getTime())) return noDate;
|
|
30
|
+
return `${months[date.getMonth()]} ${date.getFullYear()}`;
|
|
31
|
+
}
|
|
32
|
+
function groupLeadsByMonth(leads, noDate, months) {
|
|
33
|
+
const groups = /* @__PURE__ */ new Map();
|
|
34
|
+
for (const lead of leads) {
|
|
35
|
+
const key = getMonthYearKey(lead.datetime_add, noDate, months);
|
|
36
|
+
const existing = groups.get(key);
|
|
37
|
+
if (existing) existing.push(lead);
|
|
38
|
+
else groups.set(key, [lead]);
|
|
39
|
+
}
|
|
40
|
+
return Array.from(groups.entries()).map(([label, items]) => ({ label, leads: items }));
|
|
41
|
+
}
|
|
42
|
+
function AffiliateLeadsSheet() {
|
|
43
|
+
const translate = useTranslations();
|
|
44
|
+
const translateSheet = useTranslations("common.account.workspace.affiliates.leadsSheet");
|
|
45
|
+
const isMobile = useIsMobile();
|
|
46
|
+
const isOpen = useAffiliateFlows((state) => state.isLeadsOpen);
|
|
47
|
+
const close = useAffiliateFlows((state) => state.closeLeads);
|
|
48
|
+
const { data: leadsData, isLoading } = useAffiliateLeads({}, { enabled: isOpen });
|
|
49
|
+
const leads = leadsData?.data ?? [];
|
|
50
|
+
const monthNames = useMemo(
|
|
51
|
+
() => [
|
|
52
|
+
translate("common.account.workspace.affiliates.leadsSheet.months.january"),
|
|
53
|
+
translate("common.account.workspace.affiliates.leadsSheet.months.february"),
|
|
54
|
+
translate("common.account.workspace.affiliates.leadsSheet.months.march"),
|
|
55
|
+
translate("common.account.workspace.affiliates.leadsSheet.months.april"),
|
|
56
|
+
translate("common.account.workspace.affiliates.leadsSheet.months.may"),
|
|
57
|
+
translate("common.account.workspace.affiliates.leadsSheet.months.june"),
|
|
58
|
+
translate("common.account.workspace.affiliates.leadsSheet.months.july"),
|
|
59
|
+
translate("common.account.workspace.affiliates.leadsSheet.months.august"),
|
|
60
|
+
translate("common.account.workspace.affiliates.leadsSheet.months.september"),
|
|
61
|
+
translate("common.account.workspace.affiliates.leadsSheet.months.october"),
|
|
62
|
+
translate("common.account.workspace.affiliates.leadsSheet.months.november"),
|
|
63
|
+
translate("common.account.workspace.affiliates.leadsSheet.months.december")
|
|
64
|
+
],
|
|
65
|
+
[translate]
|
|
66
|
+
);
|
|
67
|
+
const noDateLabel = translateSheet("noDate");
|
|
68
|
+
const groupedLeads = useMemo(
|
|
69
|
+
() => groupLeadsByMonth(leads, noDateLabel, monthNames),
|
|
70
|
+
[leads, noDateLabel, monthNames]
|
|
71
|
+
);
|
|
72
|
+
return /* @__PURE__ */ jsx(Sheet, { open: isOpen, onOpenChange: (nextOpen) => !nextOpen && close(), children: /* @__PURE__ */ jsxs(
|
|
73
|
+
SheetContent,
|
|
74
|
+
{
|
|
75
|
+
side: isMobile ? "bottom" : "right",
|
|
76
|
+
className: cn(
|
|
77
|
+
isMobile ? "h-dvh w-full max-w-full rounded-none pt-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)]" : "h-screen max-w-[480px]! w-[480px]!",
|
|
78
|
+
"data-[state=open]:max-h-none data-[state=open]:h-dvh"
|
|
79
|
+
),
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ jsx(SheetHeader, { className: "border-b border-zinc-200", children: /* @__PURE__ */ jsx(SheetTitle, { className: "text-zinc-950 paragraph-medium-semibold", children: translateSheet("title") }) }),
|
|
82
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-col gap-6 px-5 py-5 overflow-y-auto [scrollbar-width:auto] [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-zinc-300 flex-1", children: isLoading ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-10", children: /* @__PURE__ */ jsx(IconLoader2, { size: 24, className: "animate-spin text-zinc-400" }) }) : leads.length === 0 ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-10", children: /* @__PURE__ */ jsx("span", { className: "paragraph-small-regular text-zinc-500", children: translateSheet("emptyState") }) }) : groupedLeads.map((group) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
83
|
+
/* @__PURE__ */ jsx("span", { className: "paragraph-small-medium text-zinc-950", children: group.label }),
|
|
84
|
+
/* @__PURE__ */ jsx("div", { className: "rounded-lg bg-zinc-50", children: group.leads.map((lead, index) => /* @__PURE__ */ jsxs("div", { children: [
|
|
85
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 px-4 py-4", children: [
|
|
86
|
+
/* @__PURE__ */ jsx("span", { className: "paragraph-xsmall-medium text-zinc-500 shrink-0 w-[130px]", children: formatLeadDate(lead.datetime_add) }),
|
|
87
|
+
/* @__PURE__ */ jsx("span", { className: "paragraph-small-semibold text-zinc-950 truncate min-w-0", children: getFirstName(lead.name) })
|
|
88
|
+
] }),
|
|
89
|
+
index < group.leads.length - 1 && /* @__PURE__ */ jsx("div", { className: "px-4", children: /* @__PURE__ */ jsx(Separator, {}) })
|
|
90
|
+
] }, lead.id)) })
|
|
91
|
+
] }, group.label)) })
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
) });
|
|
95
|
+
}
|
|
96
|
+
export {
|
|
97
|
+
AffiliateLeadsSheet
|
|
98
|
+
};
|
|
99
|
+
//# sourceMappingURL=AffiliateLeadsSheet.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/account/sections/affiliates/AffiliateLeadsSheet.tsx"],"sourcesContent":["'use client';\n\nimport { useMemo } from 'react';\nimport { IconLoader2 } from '@tabler/icons-react';\nimport { useTranslations } from 'next-intl';\nimport { Separator } from '../../../ui/data-display/Separator';\nimport { Sheet, SheetContent, SheetHeader, SheetTitle } from '../../../ui/overlay/Sheet';\nimport { useAffiliateLeads } from '../../../../modules/affiliates/hooks/use-affiliate-leads.hook';\nimport type { AffiliateLead } from '../../../../modules/affiliates/types/affiliate.type';\nimport useIsMobile from '../../../../hooks/useIsMobile';\nimport { cn } from '../../../../infra/utils/clsx';\nimport { useAffiliateFlows } from '../../../../store/useAffiliateFlows';\n\nfunction getFirstName(name: string | null | undefined): string {\n if (!name) return '—';\n return name.trim().split(/\\s+/)[0];\n}\n\nfunction formatLeadDate(datetime: string | null | undefined): string {\n if (!datetime) return '—';\n const date = new Date(datetime);\n if (Number.isNaN(date.getTime())) return '—';\n\n const day = String(date.getDate()).padStart(2, '0');\n const month = String(date.getMonth() + 1).padStart(2, '0');\n const hours = String(date.getHours()).padStart(2, '0');\n const minutes = String(date.getMinutes()).padStart(2, '0');\n\n return `${day}/${month}/${date.getFullYear()} ${hours}:${minutes}`;\n}\n\nfunction getMonthYearKey(datetime: string | null | undefined, noDate: string, months: string[]): string {\n if (!datetime) return noDate;\n const date = new Date(datetime);\n if (Number.isNaN(date.getTime())) return noDate;\n return `${months[date.getMonth()]} ${date.getFullYear()}`;\n}\n\nfunction groupLeadsByMonth(leads: AffiliateLead[], noDate: string, months: string[]) {\n const groups = new Map<string, AffiliateLead[]>();\n\n for (const lead of leads) {\n const key = getMonthYearKey(lead.datetime_add, noDate, months);\n const existing = groups.get(key);\n if (existing) existing.push(lead);\n else groups.set(key, [lead]);\n }\n\n return Array.from(groups.entries()).map(([label, items]) => ({ label, leads: items }));\n}\n\n/** Leads indicados pelo afiliado, agrupados por mês. */\nexport function AffiliateLeadsSheet() {\n const translate = useTranslations();\n const translateSheet = useTranslations('common.account.workspace.affiliates.leadsSheet');\n const isMobile = useIsMobile();\n const isOpen = useAffiliateFlows((state) => state.isLeadsOpen);\n const close = useAffiliateFlows((state) => state.closeLeads);\n\n const { data: leadsData, isLoading } = useAffiliateLeads({}, { enabled: isOpen });\n const leads = leadsData?.data ?? [];\n\n const monthNames = useMemo(\n () => [\n translate('common.account.workspace.affiliates.leadsSheet.months.january'),\n translate('common.account.workspace.affiliates.leadsSheet.months.february'),\n translate('common.account.workspace.affiliates.leadsSheet.months.march'),\n translate('common.account.workspace.affiliates.leadsSheet.months.april'),\n translate('common.account.workspace.affiliates.leadsSheet.months.may'),\n translate('common.account.workspace.affiliates.leadsSheet.months.june'),\n translate('common.account.workspace.affiliates.leadsSheet.months.july'),\n translate('common.account.workspace.affiliates.leadsSheet.months.august'),\n translate('common.account.workspace.affiliates.leadsSheet.months.september'),\n translate('common.account.workspace.affiliates.leadsSheet.months.october'),\n translate('common.account.workspace.affiliates.leadsSheet.months.november'),\n translate('common.account.workspace.affiliates.leadsSheet.months.december'),\n ],\n [translate]\n );\n\n const noDateLabel = translateSheet('noDate');\n const groupedLeads = useMemo(\n () => groupLeadsByMonth(leads, noDateLabel, monthNames),\n [leads, noDateLabel, monthNames]\n );\n\n return (\n <Sheet open={isOpen} onOpenChange={(nextOpen) => !nextOpen && close()}>\n <SheetContent\n side={isMobile ? 'bottom' : 'right'}\n className={cn(\n isMobile\n ? 'h-dvh w-full max-w-full rounded-none pt-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)]'\n : 'h-screen max-w-[480px]! w-[480px]!',\n 'data-[state=open]:max-h-none data-[state=open]:h-dvh'\n )}\n >\n <SheetHeader className=\"border-b border-zinc-200\">\n <SheetTitle className=\"text-zinc-950 paragraph-medium-semibold\">\n {translateSheet('title')}\n </SheetTitle>\n </SheetHeader>\n\n <div className=\"flex flex-col gap-6 px-5 py-5 overflow-y-auto [scrollbar-width:auto] [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-zinc-300 flex-1\">\n {isLoading ? (\n <div className=\"flex items-center justify-center py-10\">\n <IconLoader2 size={24} className=\"animate-spin text-zinc-400\" />\n </div>\n ) : leads.length === 0 ? (\n <div className=\"flex items-center justify-center py-10\">\n <span className=\"paragraph-small-regular text-zinc-500\">{translateSheet('emptyState')}</span>\n </div>\n ) : (\n groupedLeads.map((group) => (\n <div key={group.label} className=\"flex flex-col gap-3\">\n <span className=\"paragraph-small-medium text-zinc-950\">{group.label}</span>\n <div className=\"rounded-lg bg-zinc-50\">\n {group.leads.map((lead, index) => (\n <div key={lead.id}>\n <div className=\"flex items-center gap-4 px-4 py-4\">\n <span className=\"paragraph-xsmall-medium text-zinc-500 shrink-0 w-[130px]\">\n {formatLeadDate(lead.datetime_add)}\n </span>\n <span className=\"paragraph-small-semibold text-zinc-950 truncate min-w-0\">\n {getFirstName(lead.name)}\n </span>\n </div>\n {index < group.leads.length - 1 && (\n <div className=\"px-4\">\n <Separator />\n </div>\n )}\n </div>\n ))}\n </div>\n </div>\n ))\n )}\n </div>\n </SheetContent>\n </Sheet>\n );\n}\n"],"mappings":"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","names":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment } from "react";
|
|
3
|
+
import { Skeleton } from "../../../ui/feedback/Skeleton";
|
|
4
|
+
function AffiliateStatsCard({
|
|
5
|
+
icon: Icon,
|
|
6
|
+
stats,
|
|
7
|
+
footerText,
|
|
8
|
+
footerIcon: FooterIcon,
|
|
9
|
+
isLoading = false
|
|
10
|
+
}) {
|
|
11
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6 p-5 bg-white border border-zinc-200 rounded-lg min-w-0", children: [
|
|
12
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-center size-10 bg-zinc-50 rounded-lg", children: /* @__PURE__ */ jsx(Icon, { size: 20, className: "text-zinc-500" }) }),
|
|
13
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
14
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-stretch gap-6", children: stats.map((stat, index) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
15
|
+
index > 0 && /* @__PURE__ */ jsx("div", { className: "w-px bg-zinc-200 shrink-0" }),
|
|
16
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 min-w-0", children: [
|
|
17
|
+
/* @__PURE__ */ jsx("span", { className: "paragraph-small-regular text-zinc-600", children: stat.label }),
|
|
18
|
+
isLoading ? /* @__PURE__ */ jsx(Skeleton, { className: "h-7 w-16 rounded" }) : /* @__PURE__ */ jsx("span", { className: "paragraph-xlarge-semibold text-zinc-950 truncate", children: stat.value })
|
|
19
|
+
] })
|
|
20
|
+
] }, stat.label)) }),
|
|
21
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
22
|
+
FooterIcon && /* @__PURE__ */ jsx(FooterIcon, { size: 16, className: "text-zinc-500 shrink-0" }),
|
|
23
|
+
/* @__PURE__ */ jsx("span", { className: "paragraph-xsmall-medium text-zinc-600", children: footerText })
|
|
24
|
+
] })
|
|
25
|
+
] })
|
|
26
|
+
] });
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
AffiliateStatsCard
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=AffiliateStatsCard.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/account/sections/affiliates/AffiliateStatsCard.tsx"],"sourcesContent":["import { Fragment } from 'react';\nimport type { TablerIcon } from '@tabler/icons-react';\nimport { Skeleton } from '../../../ui/feedback/Skeleton';\n\ntype AffiliateStat = {\n label: string;\n value: string;\n};\n\ntype AffiliateStatsCardProps = {\n icon: TablerIcon;\n stats: AffiliateStat[];\n footerText: string;\n footerIcon?: TablerIcon;\n isLoading?: boolean;\n};\n\n/** Card de número da aba Afiliados: ícone, um ou mais valores (separados por divisória) e rodapé. */\nexport function AffiliateStatsCard({\n icon: Icon,\n stats,\n footerText,\n footerIcon: FooterIcon,\n isLoading = false,\n}: AffiliateStatsCardProps) {\n return (\n <div className=\"flex flex-col gap-6 p-5 bg-white border border-zinc-200 rounded-lg min-w-0\">\n <div className=\"flex items-center justify-center size-10 bg-zinc-50 rounded-lg\">\n <Icon size={20} className=\"text-zinc-500\" />\n </div>\n\n <div className=\"flex flex-col gap-3\">\n <div className=\"flex items-stretch gap-6\">\n {stats.map((stat, index) => (\n <Fragment key={stat.label}>\n {index > 0 && <div className=\"w-px bg-zinc-200 shrink-0\" />}\n <div className=\"flex flex-col gap-2 min-w-0\">\n <span className=\"paragraph-small-regular text-zinc-600\">{stat.label}</span>\n {isLoading ? (\n <Skeleton className=\"h-7 w-16 rounded\" />\n ) : (\n <span className=\"paragraph-xlarge-semibold text-zinc-950 truncate\">{stat.value}</span>\n )}\n </div>\n </Fragment>\n ))}\n </div>\n\n <div className=\"flex items-center gap-1.5\">\n {FooterIcon && <FooterIcon size={16} className=\"text-zinc-500 shrink-0\" />}\n <span className=\"paragraph-xsmall-medium text-zinc-600\">{footerText}</span>\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":"AA4BQ,cAQM,YARN;AA5BR,SAAS,gBAAgB;AAEzB,SAAS,gBAAgB;AAgBlB,SAAS,mBAAmB;AAAA,EACjC,MAAM;AAAA,EACN;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ,YAAY;AACd,GAA4B;AAC1B,SACE,qBAAC,SAAI,WAAU,8EACb;AAAA,wBAAC,SAAI,WAAU,kEACb,8BAAC,QAAK,MAAM,IAAI,WAAU,iBAAgB,GAC5C;AAAA,IAEA,qBAAC,SAAI,WAAU,uBACb;AAAA,0BAAC,SAAI,WAAU,4BACZ,gBAAM,IAAI,CAAC,MAAM,UAChB,qBAAC,YACE;AAAA,gBAAQ,KAAK,oBAAC,SAAI,WAAU,6BAA4B;AAAA,QACzD,qBAAC,SAAI,WAAU,+BACb;AAAA,8BAAC,UAAK,WAAU,yCAAyC,eAAK,OAAM;AAAA,UACnE,YACC,oBAAC,YAAS,WAAU,oBAAmB,IAEvC,oBAAC,UAAK,WAAU,oDAAoD,eAAK,OAAM;AAAA,WAEnF;AAAA,WATa,KAAK,KAUpB,CACD,GACH;AAAA,MAEA,qBAAC,SAAI,WAAU,6BACZ;AAAA,sBAAc,oBAAC,cAAW,MAAM,IAAI,WAAU,0BAAyB;AAAA,QACxE,oBAAC,UAAK,WAAU,yCAAyC,sBAAW;AAAA,SACtE;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { IconBox } from "../shared/IconBox";
|
|
3
|
+
function AffiliateStepCard({ icon, title, description }) {
|
|
4
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col lg:flex-row items-start gap-3 lg:gap-4 p-4 lg:p-5 bg-zinc-50 rounded-lg min-w-0", children: [
|
|
5
|
+
/* @__PURE__ */ jsx(IconBox, { icon, iconClassName: "text-zinc-500" }),
|
|
6
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
7
|
+
/* @__PURE__ */ jsx("span", { className: "text-zinc-950 paragraph-small-semibold", children: title }),
|
|
8
|
+
/* @__PURE__ */ jsx("span", { className: "text-zinc-600 paragraph-small-medium", children: description })
|
|
9
|
+
] })
|
|
10
|
+
] });
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
AffiliateStepCard
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=AffiliateStepCard.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/account/sections/affiliates/AffiliateStepCard.tsx"],"sourcesContent":["import type { TablerIcon } from '@tabler/icons-react';\nimport { IconBox } from '../shared/IconBox';\n\ntype AffiliateStepCardProps = {\n icon: TablerIcon;\n title: string;\n description: string;\n};\n\nexport function AffiliateStepCard({ icon, title, description }: AffiliateStepCardProps) {\n return (\n <div className=\"flex flex-col lg:flex-row items-start gap-3 lg:gap-4 p-4 lg:p-5 bg-zinc-50 rounded-lg min-w-0\">\n <IconBox icon={icon} iconClassName=\"text-zinc-500\" />\n <div className=\"flex flex-col gap-1\">\n <span className=\"text-zinc-950 paragraph-small-semibold\">{title}</span>\n <span className=\"text-zinc-600 paragraph-small-medium\">{description}</span>\n </div>\n </div>\n );\n}\n"],"mappings":"AAYM,cACA,YADA;AAXN,SAAS,eAAe;AAQjB,SAAS,kBAAkB,EAAE,MAAM,OAAO,YAAY,GAA2B;AACtF,SACE,qBAAC,SAAI,WAAU,iGACb;AAAA,wBAAC,WAAQ,MAAY,eAAc,iBAAgB;AAAA,IACnD,qBAAC,SAAI,WAAU,uBACb;AAAA,0BAAC,UAAK,WAAU,0CAA0C,iBAAM;AAAA,MAChE,oBAAC,UAAK,WAAU,wCAAwC,uBAAY;AAAA,OACtE;AAAA,KACF;AAEJ;","names":[]}
|