@greatapps/common 1.1.700 → 1.1.701
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/ConfigurationsMyAccountModal.mjs +1 -1
- package/dist/components/account/ConfigurationsMyAccountModal.mjs.map +1 -1
- package/dist/components/account/ConfirmDeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/ConfirmGlobalPreferencesModal.mjs.map +1 -1
- package/dist/components/account/DeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/DisableTwoFactorAuthModal.mjs.map +1 -1
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/TwoFactorAuthModal.mjs.map +1 -1
- package/dist/components/account/hooks/useChangePhoneForm.mjs.map +1 -1
- package/dist/components/account/hooks/useTwoFactorAuthForm.mjs.map +1 -1
- package/dist/components/account/sections/ChangeEmailModal.mjs.map +1 -1
- package/dist/components/account/sections/ChangePasswordSection.mjs.map +1 -1
- package/dist/components/account/sections/ChangePhoneModal.mjs.map +1 -1
- package/dist/components/account/sections/MyProfileSection.mjs.map +1 -1
- package/dist/components/account/sections/PreferencesSection.mjs.map +1 -1
- package/dist/components/account/sections/SecuritySection.mjs.map +1 -1
- package/dist/components/account/sections/TokenSection.mjs.map +1 -1
- package/dist/components/embeds/ClarityEmbed.mjs.map +1 -1
- package/dist/components/embeds/CrispEmbed.mjs.map +1 -1
- package/dist/components/embeds/EmbedWidgets.mjs.map +1 -1
- package/dist/components/embeds/FrillEmbed.mjs.map +1 -1
- package/dist/components/layouts/AppMobileNavBar.mjs.map +1 -1
- package/dist/components/layouts/AppNavBar.mjs.map +1 -1
- package/dist/components/layouts/MdSideBarNavigation.mjs.map +1 -1
- package/dist/components/layouts/NavBar.mjs.map +1 -1
- package/dist/components/layouts/NotificationsPopover.mjs.map +1 -1
- package/dist/components/layouts/ProfilePopover.mjs.map +1 -1
- package/dist/components/layouts/SideBarNavigation.mjs.map +1 -1
- package/dist/components/layouts/UsersSelectorPopover.mjs.map +1 -1
- package/dist/components/layouts/WhitelabelCodes.mjs.map +1 -1
- package/dist/components/modals/BuyCreditsModal.mjs.map +1 -1
- package/dist/components/modals/CreditsDisabledModal.mjs.map +1 -1
- package/dist/components/modals/HexaPromoModal.mjs +2 -2
- package/dist/components/modals/HexaPromoModal.mjs.map +1 -1
- package/dist/components/modals/HexaPromoModalGate.mjs.map +1 -1
- package/dist/components/modals/Modals.mjs.map +1 -1
- package/dist/components/modals/PaidPlanRequiredModal.mjs.map +1 -1
- package/dist/components/modals/cards/AddCardModal.mjs.map +1 -1
- package/dist/components/modals/cards/CannotDeleteCardModal.mjs.map +1 -1
- package/dist/components/modals/cards/CardFormFields.mjs.map +1 -1
- package/dist/components/modals/cards/DeleteCardModal.mjs.map +1 -1
- package/dist/components/navigation/CancelledSubscriptionBanner.mjs.map +1 -1
- package/dist/components/navigation/NavItemsContext.mjs.map +1 -1
- package/dist/components/navigation/OverdueInvoiceBanner.mjs.map +1 -1
- package/dist/components/navigation/PendingCancellationBanner.mjs.map +1 -1
- package/dist/components/navigation/ProjectSelectorPopover.mjs.map +1 -1
- package/dist/components/navigation/SubscriptionBanner.mjs.map +1 -1
- package/dist/components/navigation/TrialBanner.mjs.map +1 -1
- package/dist/components/navigation/UpcomingInvoiceBanner.mjs.map +1 -1
- package/dist/components/navigation/shells/TabsMobileShell.mjs.map +1 -1
- package/dist/components/navigation/subcomponents/BottomLinks.mjs.map +1 -1
- package/dist/components/navigation/subcomponents/ProjectSelector.mjs.map +1 -1
- package/dist/components/pages/NotFoundPage.mjs.map +1 -1
- package/dist/components/pages/notifications/Notifications.mjs.map +1 -1
- package/dist/components/ui/buttons/Button.mjs.map +1 -1
- package/dist/components/ui/buttons/CancelButton.mjs.map +1 -1
- package/dist/components/ui/buttons/CopyButton.mjs.map +1 -1
- package/dist/components/ui/data-display/Accordion.mjs.map +1 -1
- package/dist/components/ui/data-display/Badge.mjs.map +1 -1
- package/dist/components/ui/data-display/Card.mjs.map +1 -1
- package/dist/components/ui/data-display/CardBrandIcons.mjs.map +1 -1
- package/dist/components/ui/data-display/CardItem.mjs.map +1 -1
- package/dist/components/ui/data-display/Pagination.mjs.map +1 -1
- package/dist/components/ui/data-display/PaymentInfoCard.mjs.map +1 -1
- package/dist/components/ui/data-display/ScrollArea.mjs.map +1 -1
- package/dist/components/ui/data-display/Separator.mjs.map +1 -1
- package/dist/components/ui/data-display/Table.mjs.map +1 -1
- package/dist/components/ui/data-display/Tabs.mjs.map +1 -1
- package/dist/components/ui/feedback/CircularProgress.mjs.map +1 -1
- package/dist/components/ui/feedback/DefaultCircularProgress.mjs.map +1 -1
- package/dist/components/ui/feedback/LoadingOverlay.mjs.map +1 -1
- package/dist/components/ui/feedback/Progress.mjs.map +1 -1
- package/dist/components/ui/feedback/Skeleton.mjs.map +1 -1
- package/dist/components/ui/feedback/Toast.mjs.map +1 -1
- package/dist/components/ui/form/Calendar.mjs.map +1 -1
- package/dist/components/ui/form/Checkbox.mjs.map +1 -1
- package/dist/components/ui/form/ComboboxField.mjs.map +1 -1
- package/dist/components/ui/form/DatePicker.mjs.map +1 -1
- package/dist/components/ui/form/DateRangePicker.mjs.map +1 -1
- package/dist/components/ui/form/FormField.mjs.map +1 -1
- package/dist/components/ui/form/Input.mjs.map +1 -1
- package/dist/components/ui/form/InputOtp.mjs.map +1 -1
- package/dist/components/ui/form/PhoneInput.mjs.map +1 -1
- package/dist/components/ui/form/RadioGroup.mjs.map +1 -1
- package/dist/components/ui/form/Select.mjs +1 -1
- package/dist/components/ui/form/Select.mjs.map +1 -1
- package/dist/components/ui/form/Switch.mjs.map +1 -1
- package/dist/components/ui/form/Textarea.mjs.map +1 -1
- package/dist/components/ui/overlay/Command.mjs.map +1 -1
- package/dist/components/ui/overlay/Dialog.mjs.map +1 -1
- package/dist/components/ui/overlay/Popover.mjs.map +1 -1
- package/dist/components/ui/overlay/Sheet.mjs.map +1 -1
- package/dist/components/ui/overlay/Tooltip.mjs.map +1 -1
- package/dist/components/widgets/ImageUpload/ImageCropModal.mjs.map +1 -1
- package/dist/components/widgets/ImageUpload/ImageTooSmallModal.mjs.map +1 -1
- package/dist/components/widgets/ImageUpload/ImageUpload.mjs.map +1 -1
- package/dist/components/widgets/ImageUpload/index.mjs.map +1 -1
- package/dist/components/widgets/notifications/NotificationCard.mjs.map +1 -1
- package/dist/handlers.mjs.map +1 -1
- package/dist/hooks/copy-to-clipboard.hook.mjs.map +1 -1
- package/dist/hooks/useAuthQueryKey.mjs.map +1 -1
- package/dist/hooks/useBrandLoadingIcon.mjs.map +1 -1
- package/dist/hooks/useRouter.mjs.map +1 -1
- package/dist/http.mjs.map +1 -1
- package/dist/i18n/config.mjs.map +1 -1
- package/dist/i18n/country-language.mjs.map +1 -1
- package/dist/i18n/messages/en-us.mjs.map +1 -1
- package/dist/i18n/messages/es-es.mjs.map +1 -1
- package/dist/i18n/messages/index.mjs.map +1 -1
- package/dist/i18n/messages/pt-br.mjs.map +1 -1
- package/dist/i18n/normalize.mjs.map +1 -1
- package/dist/i18n/resolve-locale.mjs.map +1 -1
- package/dist/i18n.mjs.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/infra/http/api-fetch.mjs.map +1 -1
- package/dist/infra/route/parse-id.mjs.map +1 -1
- package/dist/infra/route/parse-numeric.mjs.map +1 -1
- package/dist/infra/route/safe-route-handler.mjs.map +1 -1
- package/dist/infra/route/search-params.mjs.map +1 -1
- package/dist/infra/utils/array.mjs.map +1 -1
- package/dist/infra/utils/date.mjs.map +1 -1
- package/dist/middleware.mjs.map +1 -1
- package/dist/modules/accounts/actions/account-management.action.mjs.map +1 -1
- package/dist/modules/accounts/actions/find-current-account.action.mjs.map +1 -1
- package/dist/modules/accounts/actions/get-account-token.action.mjs.map +1 -1
- package/dist/modules/accounts/actions/list-currencies.action.mjs.map +1 -1
- package/dist/modules/accounts/actions/list-timezones.action.mjs.map +1 -1
- package/dist/modules/accounts/hooks/current-account.hook.mjs.map +1 -1
- package/dist/modules/accounts/hooks/use-account-token.hook.mjs.map +1 -1
- package/dist/modules/accounts/hooks/use-currency-formatter.hook.mjs.map +1 -1
- package/dist/modules/accounts/hooks/useAccountManagement.mjs.map +1 -1
- package/dist/modules/accounts/hooks/useCurrencies.mjs.map +1 -1
- package/dist/modules/accounts/hooks/useTimezones.mjs.map +1 -1
- package/dist/modules/accounts/hooks/useViaCep.mjs.map +1 -1
- package/dist/modules/accounts/services/account-token.service.mjs.map +1 -1
- package/dist/modules/accounts/services/account.service.mjs.map +1 -1
- package/dist/modules/auth/actions/social-google-login.action.mjs.map +1 -1
- package/dist/modules/auth/actions/social-google-onboarding.action.mjs.map +1 -1
- package/dist/modules/auth/actions/unlink-google.action.mjs.map +1 -1
- package/dist/modules/auth/actions/validate-session.action.mjs.map +1 -1
- package/dist/modules/auth/actions/verify-two-factor.action.mjs.map +1 -1
- package/dist/modules/auth/hooks/login.hook.mjs.map +1 -1
- package/dist/modules/auth/hooks/logout.hook.mjs.map +1 -1
- package/dist/modules/auth/hooks/register.hook.mjs.map +1 -1
- package/dist/modules/auth/hooks/social-google-login.hook.mjs.map +1 -1
- package/dist/modules/auth/hooks/social-google-onboarding.hook.mjs.map +1 -1
- package/dist/modules/auth/hooks/unlink-google.hook.mjs.map +1 -1
- package/dist/modules/auth/hooks/useManagementPermissions.mjs.map +1 -1
- package/dist/modules/auth/hooks/useUserQuery.mjs.map +1 -1
- package/dist/modules/auth/utils/assert-management-permission.mjs.map +1 -1
- package/dist/modules/auth/utils/assert-management-subscription.mjs.map +1 -1
- package/dist/modules/auth/utils/assert-paid-subscription.mjs.map +1 -1
- package/dist/modules/auth/utils/assert-subscription-addon.mjs.map +1 -1
- package/dist/modules/auth/utils/build-wl-override.mjs.map +1 -1
- package/dist/modules/auth/utils/require-token-not-expired.mjs.map +1 -1
- package/dist/modules/auth/utils/require-valid-session.mjs.map +1 -1
- package/dist/modules/cards/actions/create-card.action.mjs.map +1 -1
- package/dist/modules/cards/actions/create-setup-intent.action.mjs.map +1 -1
- package/dist/modules/cards/actions/delete-card.action.mjs.map +1 -1
- package/dist/modules/cards/actions/set-default-card.action.mjs.map +1 -1
- package/dist/modules/cards/handlers/find-card-by-id.handler.mjs.map +1 -1
- package/dist/modules/cards/handlers/list-cards.handler.mjs.map +1 -1
- package/dist/modules/cards/hooks/card-by-id.hook.mjs.map +1 -1
- package/dist/modules/cards/hooks/cards.hook.mjs.map +1 -1
- package/dist/modules/cards/hooks/create-card.hook.mjs.map +1 -1
- package/dist/modules/cards/hooks/create-setup-intent.hook.mjs.map +1 -1
- package/dist/modules/cards/hooks/delete-card.hook.mjs.map +1 -1
- package/dist/modules/cards/hooks/delete-confirmation.hook.mjs.map +1 -1
- package/dist/modules/cards/hooks/handle-delete-card.hook.mjs.map +1 -1
- package/dist/modules/cards/hooks/set-default-card.hook.mjs.map +1 -1
- package/dist/modules/cards/services/cards.service.mjs.map +1 -1
- package/dist/modules/cards/types.mjs.map +1 -1
- package/dist/modules/charges/actions/charge-action.action.mjs.map +1 -1
- package/dist/modules/charges/handlers/find-charge-by-id.handler.mjs.map +1 -1
- package/dist/modules/charges/handlers/list-charges.handler.mjs.map +1 -1
- package/dist/modules/charges/hooks/charge-action.hook.mjs.map +1 -1
- package/dist/modules/charges/hooks/charge-by-id.hook.mjs.map +1 -1
- package/dist/modules/charges/hooks/charges.hook.mjs.map +1 -1
- package/dist/modules/charges/services/charges.service.mjs.map +1 -1
- package/dist/modules/charges/types/charge.type.mjs.map +1 -1
- package/dist/modules/ia-credits/handlers/list-ia-credits.handler.mjs.map +1 -1
- package/dist/modules/ia-credits/hooks/ia-credits.hook.mjs.map +1 -1
- package/dist/modules/images/actions/process-image.action.mjs.map +1 -1
- package/dist/modules/images/constants/image.constants.mjs.map +1 -1
- package/dist/modules/images/hooks/use-image-upload.hook.mjs.map +1 -1
- package/dist/modules/images/services/image-processing.service.mjs.map +1 -1
- package/dist/modules/images/utils/base64.mjs.map +1 -1
- package/dist/modules/images/utils/compress-image.mjs.map +1 -1
- package/dist/modules/images/utils/crop-image.mjs.map +1 -1
- package/dist/modules/images/utils/validate-image.mjs.map +1 -1
- package/dist/modules/pages/constants/query-keys.constants.mjs.map +1 -1
- package/dist/modules/pages/handlers/count-pages.handler.mjs.map +1 -1
- package/dist/modules/pages/hooks/count-pages.hook.mjs.map +1 -1
- package/dist/modules/pages/services/pages.service.mjs.map +1 -1
- package/dist/modules/plans/handlers/find-plan-by-id.handler.mjs.map +1 -1
- package/dist/modules/plans/handlers/list-plans.handler.mjs.map +1 -1
- package/dist/modules/plans/hooks/list-plans.hook.mjs.map +1 -1
- package/dist/modules/plans/hooks/use-has-plan-addon.hook.mjs.map +1 -1
- package/dist/modules/plans/hooks/use-plan-by-id.hook.mjs.map +1 -1
- package/dist/modules/plans/services/plans.service.mjs.map +1 -1
- package/dist/modules/plans/types/plan.type.mjs.map +1 -1
- package/dist/modules/plans/utils/map-api-plan-to-ui.mjs.map +1 -1
- package/dist/modules/projects/actions/add-project-user.action.mjs.map +1 -1
- package/dist/modules/projects/actions/create-project.action.mjs.map +1 -1
- package/dist/modules/projects/actions/delete-project.action.mjs.map +1 -1
- package/dist/modules/projects/actions/find-project.action.mjs.map +1 -1
- package/dist/modules/projects/actions/list-project-users.action.mjs.map +1 -1
- package/dist/modules/projects/actions/list-projects.action.mjs.map +1 -1
- package/dist/modules/projects/actions/remove-project-user.action.mjs.map +1 -1
- package/dist/modules/projects/actions/update-project.action.mjs.map +1 -1
- package/dist/modules/projects/handlers/find-project.handler.mjs.map +1 -1
- package/dist/modules/projects/handlers/list-all-account-users.handler.mjs.map +1 -1
- package/dist/modules/projects/handlers/list-available-users.handler.mjs.map +1 -1
- package/dist/modules/projects/handlers/list-project-users.handler.mjs.map +1 -1
- package/dist/modules/projects/handlers/list-projects.handler.mjs.map +1 -1
- package/dist/modules/projects/hooks/add-project-user.hook.mjs.map +1 -1
- package/dist/modules/projects/hooks/create-project.hook.mjs.map +1 -1
- package/dist/modules/projects/hooks/delete-project.hook.mjs.map +1 -1
- package/dist/modules/projects/hooks/find-project.hook.mjs.map +1 -1
- package/dist/modules/projects/hooks/list-all-account-users.hook.mjs.map +1 -1
- package/dist/modules/projects/hooks/list-available-users.hook.mjs.map +1 -1
- package/dist/modules/projects/hooks/list-infinite-projects.hook.mjs.map +1 -1
- package/dist/modules/projects/hooks/list-project-users.hook.mjs.map +1 -1
- package/dist/modules/projects/hooks/list-projects.hook.mjs.map +1 -1
- package/dist/modules/projects/hooks/remove-project-user.hook.mjs.map +1 -1
- package/dist/modules/projects/hooks/update-project.hook.mjs.map +1 -1
- package/dist/modules/projects/services/projects.service.mjs.map +1 -1
- package/dist/modules/subscriptions/actions/calculate-subscription.action.mjs.map +1 -1
- package/dist/modules/subscriptions/actions/list-subscriptions.action.mjs.map +1 -1
- package/dist/modules/subscriptions/actions/update-subscription-payment.action.mjs.map +1 -1
- package/dist/modules/subscriptions/actions/update-subscription-plan.action.mjs.map +1 -1
- package/dist/modules/subscriptions/constants/query-keys.constants.mjs.map +1 -1
- package/dist/modules/subscriptions/constants/subscription.constants.mjs.map +1 -1
- package/dist/modules/subscriptions/handlers/list-subscriptions.handler.mjs.map +1 -1
- package/dist/modules/subscriptions/hooks/calculate-subscription.hook.mjs.map +1 -1
- package/dist/modules/subscriptions/hooks/find-active-subscription.hook.mjs.map +1 -1
- package/dist/modules/subscriptions/hooks/list-subscriptions.hook.mjs.map +1 -1
- package/dist/modules/subscriptions/hooks/update-subscription-payment.hook.mjs.map +1 -1
- package/dist/modules/subscriptions/hooks/update-subscription-plan.hook.mjs.map +1 -1
- package/dist/modules/subscriptions/hooks/use-cancelled-subscription-guard.mjs.map +1 -1
- package/dist/modules/subscriptions/types/calculate-subscription.type.mjs.map +1 -1
- package/dist/modules/subscriptions/types/pix-pending.type.mjs.map +1 -1
- package/dist/modules/subscriptions/utils/build-plan-extras.mjs.map +1 -1
- package/dist/modules/subscriptions/utils/get-subscription-cancellation-state.mjs.map +1 -1
- package/dist/modules/subscriptions/utils/get-subscription-expiry-date.mjs.map +1 -1
- package/dist/modules/subscriptions/utils/has-subscription-expired.mjs.map +1 -1
- package/dist/modules/subscriptions/utils/periodicity.mjs.map +1 -1
- package/dist/modules/subscriptions/utils/resolve-plan-extras-prices.mjs.map +1 -1
- package/dist/modules/users/action/find-user-by-id.action.mjs.map +1 -1
- package/dist/modules/users/action/mark-all-messages-as-read.action.mjs.map +1 -1
- package/dist/modules/users/action/mark-message-as-read.action.mjs.map +1 -1
- package/dist/modules/users/handlers/list-messages.handler.mjs.map +1 -1
- package/dist/modules/users/hooks/messages.hook.mjs.map +1 -1
- package/dist/modules/users/services/messages.service.mjs.map +1 -1
- package/dist/modules/whitelabel/actions/find-whitelabel.action.mjs.map +1 -1
- package/dist/modules/whitelabel/actions/revalidate-whitelabel.action.mjs.map +1 -1
- package/dist/modules/whitelabel/utils/normalize-hostname.mjs.map +1 -1
- package/dist/providers/auth.provider.mjs.map +1 -1
- package/dist/providers/navigation.provider.mjs.map +1 -1
- package/dist/providers/whitelabel.provider.mjs.map +1 -1
- package/dist/route.mjs.map +1 -1
- package/dist/store/useAccountModals.mjs.map +1 -1
- package/dist/store/useBuyCreditsModal.mjs.map +1 -1
- package/dist/store/useCreditsDisabledModal.mjs.map +1 -1
- package/dist/store/useDesktopSidebarStore.mjs.map +1 -1
- package/dist/store/useHexaPromoModal.mjs.map +1 -1
- package/dist/store/useMdSidebarStore.mjs.map +1 -1
- package/dist/store/usePaidPlanRequiredModal.mjs.map +1 -1
- package/dist/utils/constants/br-states.mjs.map +1 -1
- package/dist/utils/cookies/hexa-promo.mjs.map +1 -1
- package/dist/utils/countries.mjs.map +1 -1
- package/dist/utils/format/currency.mjs.map +1 -1
- package/dist/utils/intl/cookie-domain.mjs.map +1 -1
- package/dist/utils/intl/locale-cookie.mjs.map +1 -1
- package/dist/utils/next-navigation.mjs.map +1 -1
- package/dist/utils/redirect.mjs.map +1 -1
- package/dist/utils/safeMutationAction.mjs.map +1 -1
- package/dist/utils/safeServerAction.mjs.map +1 -1
- package/dist/utils/withAction.mjs.map +1 -1
- package/package.json +115 -115
- package/src/components/account/ConfigurationsMyAccountModal.tsx +179 -179
- package/src/components/account/ConfirmDeleteAccountModal.tsx +110 -110
- package/src/components/account/ConfirmGlobalPreferencesModal.tsx +68 -68
- package/src/components/account/DeleteAccountModal.tsx +160 -160
- package/src/components/account/DisableTwoFactorAuthModal.tsx +92 -92
- package/src/components/account/IsntPossibleDeleteAccountModal.tsx +51 -51
- package/src/components/account/TwoFactorAuthModal.tsx +220 -220
- package/src/components/account/hooks/useChangePhoneForm.tsx +113 -113
- package/src/components/account/hooks/useTwoFactorAuthForm.tsx +116 -116
- package/src/components/account/sections/ChangeEmailModal.tsx +239 -239
- package/src/components/account/sections/ChangePasswordSection.tsx +68 -68
- package/src/components/account/sections/ChangePhoneModal.tsx +273 -273
- package/src/components/account/sections/MyProfileSection.tsx +276 -276
- package/src/components/account/sections/PreferencesSection.tsx +278 -278
- package/src/components/account/sections/SecuritySection.tsx +102 -102
- package/src/components/account/sections/TokenSection.tsx +85 -85
- package/src/components/embeds/ClarityEmbed.tsx +70 -70
- package/src/components/embeds/CrispEmbed.tsx +195 -195
- package/src/components/embeds/EmbedWidgets.tsx +62 -62
- package/src/components/embeds/FrillEmbed.tsx +146 -146
- package/src/components/layouts/AppMobileNavBar.tsx +214 -214
- package/src/components/layouts/AppNavBar.tsx +40 -40
- package/src/components/layouts/MdSideBarNavigation.tsx +56 -56
- package/src/components/layouts/NavBar.tsx +228 -228
- package/src/components/layouts/NotificationsPopover.tsx +120 -120
- package/src/components/layouts/ProfilePopover.tsx +191 -191
- package/src/components/layouts/SideBarNavigation.tsx +65 -65
- package/src/components/layouts/UsersSelectorPopover.tsx +236 -236
- package/src/components/layouts/WhitelabelCodes.tsx +59 -59
- package/src/components/modals/BuyCreditsModal.tsx +390 -390
- package/src/components/modals/CreditsDisabledModal.tsx +62 -62
- package/src/components/modals/HexaPromoModal.tsx +212 -212
- package/src/components/modals/HexaPromoModalGate.tsx +80 -80
- package/src/components/modals/Modals.tsx +25 -25
- package/src/components/modals/PaidPlanRequiredModal.tsx +60 -60
- package/src/components/modals/cards/AddCardModal.tsx +420 -420
- package/src/components/modals/cards/CannotDeleteCardModal.tsx +124 -124
- package/src/components/modals/cards/CardFormFields.tsx +363 -363
- package/src/components/modals/cards/DeleteCardModal.tsx +136 -136
- package/src/components/navigation/CancelledSubscriptionBanner.tsx +62 -62
- package/src/components/navigation/NavItemsContext.ts +20 -20
- package/src/components/navigation/OverdueInvoiceBanner.tsx +51 -51
- package/src/components/navigation/PendingCancellationBanner.tsx +60 -60
- package/src/components/navigation/ProjectSelectorPopover.tsx +180 -180
- package/src/components/navigation/SubscriptionBanner.tsx +94 -94
- package/src/components/navigation/TrialBanner.tsx +54 -54
- package/src/components/navigation/UpcomingInvoiceBanner.tsx +55 -55
- package/src/components/navigation/shells/TabsMobileShell.tsx +74 -74
- package/src/components/navigation/subcomponents/BottomLinks.tsx +85 -85
- package/src/components/navigation/subcomponents/ProjectSelector.tsx +184 -184
- package/src/components/pages/NotFoundPage.tsx +75 -75
- package/src/components/pages/notifications/Notifications.tsx +190 -190
- package/src/components/ui/buttons/Button.tsx +77 -77
- package/src/components/ui/buttons/CancelButton.tsx +14 -14
- package/src/components/ui/buttons/CopyButton.tsx +59 -59
- package/src/components/ui/data-display/Accordion.tsx +81 -81
- package/src/components/ui/data-display/Badge.tsx +47 -47
- package/src/components/ui/data-display/Card.tsx +93 -93
- package/src/components/ui/data-display/CardBrandIcons.tsx +336 -336
- package/src/components/ui/data-display/CardItem.tsx +135 -135
- package/src/components/ui/data-display/Pagination.tsx +126 -126
- package/src/components/ui/data-display/PaymentInfoCard.tsx +193 -193
- package/src/components/ui/data-display/ScrollArea.tsx +59 -59
- package/src/components/ui/data-display/Separator.tsx +29 -29
- package/src/components/ui/data-display/Table.tsx +117 -117
- package/src/components/ui/data-display/Tabs.tsx +67 -67
- package/src/components/ui/feedback/CircularProgress.tsx +79 -79
- package/src/components/ui/feedback/DefaultCircularProgress.tsx +67 -67
- package/src/components/ui/feedback/LoadingOverlay.tsx +30 -30
- package/src/components/ui/feedback/Progress.tsx +40 -40
- package/src/components/ui/feedback/Skeleton.tsx +5 -5
- package/src/components/ui/feedback/Toast.tsx +104 -104
- package/src/components/ui/form/Calendar.tsx +228 -228
- package/src/components/ui/form/Checkbox.tsx +31 -31
- package/src/components/ui/form/ComboboxField.tsx +159 -159
- package/src/components/ui/form/DatePicker.tsx +100 -100
- package/src/components/ui/form/DateRangePicker.tsx +111 -111
- package/src/components/ui/form/FormField.tsx +133 -133
- package/src/components/ui/form/Input.tsx +20 -20
- package/src/components/ui/form/InputOtp.tsx +80 -80
- package/src/components/ui/form/PhoneInput.tsx +210 -210
- package/src/components/ui/form/RadioGroup.tsx +45 -45
- package/src/components/ui/form/Select.tsx +200 -200
- package/src/components/ui/form/Switch.tsx +32 -32
- package/src/components/ui/form/Textarea.tsx +19 -19
- package/src/components/ui/overlay/Command.tsx +185 -185
- package/src/components/ui/overlay/Dialog.tsx +153 -153
- package/src/components/ui/overlay/Popover.tsx +49 -49
- package/src/components/ui/overlay/Sheet.tsx +170 -170
- package/src/components/ui/overlay/Tooltip.tsx +62 -62
- package/src/components/widgets/ImageUpload/ImageCropModal.tsx +392 -392
- package/src/components/widgets/ImageUpload/ImageTooSmallModal.tsx +62 -62
- package/src/components/widgets/ImageUpload/ImageUpload.tsx +131 -131
- package/src/components/widgets/ImageUpload/index.ts +3 -3
- package/src/components/widgets/notifications/NotificationCard.tsx +73 -73
- package/src/handlers.ts +22 -22
- package/src/hooks/copy-to-clipboard.hook.tsx +67 -67
- package/src/hooks/useAuthQueryKey.ts +32 -32
- package/src/hooks/useBrandLoadingIcon.tsx +18 -18
- package/src/hooks/useRouter.ts +38 -38
- package/src/http.ts +1 -1
- package/src/i18n/config.ts +17 -17
- package/src/i18n/country-language.ts +60 -60
- package/src/i18n/messages/en-us.ts +519 -519
- package/src/i18n/messages/es-es.ts +520 -520
- package/src/i18n/messages/index.ts +24 -24
- package/src/i18n/messages/pt-br.ts +543 -543
- package/src/i18n/normalize.ts +15 -15
- package/src/i18n/resolve-locale.ts +77 -77
- package/src/i18n.ts +10 -10
- package/src/index.ts +587 -587
- package/src/infra/http/api-fetch.ts +39 -39
- package/src/infra/route/parse-id.ts +9 -9
- package/src/infra/route/parse-numeric.ts +16 -16
- package/src/infra/route/safe-route-handler.ts +16 -16
- package/src/infra/route/search-params.ts +9 -9
- package/src/infra/utils/array.ts +167 -167
- package/src/infra/utils/date.ts +59 -59
- package/src/middleware.ts +4 -4
- package/src/modules/accounts/actions/account-management.action.ts +109 -109
- package/src/modules/accounts/actions/find-current-account.action.ts +9 -9
- package/src/modules/accounts/actions/get-account-token.action.ts +8 -8
- package/src/modules/accounts/actions/list-currencies.action.ts +8 -8
- package/src/modules/accounts/actions/list-timezones.action.ts +8 -8
- package/src/modules/accounts/hooks/current-account.hook.tsx +26 -26
- package/src/modules/accounts/hooks/use-account-token.hook.tsx +14 -14
- package/src/modules/accounts/hooks/use-currency-formatter.hook.tsx +32 -32
- package/src/modules/accounts/hooks/useAccountManagement.ts +95 -95
- package/src/modules/accounts/hooks/useCurrencies.ts +18 -18
- package/src/modules/accounts/hooks/useTimezones.ts +18 -18
- package/src/modules/accounts/hooks/useViaCep.ts +25 -25
- package/src/modules/accounts/services/account-token.service.ts +52 -52
- package/src/modules/accounts/services/account.service.ts +243 -243
- package/src/modules/accounts/types.ts +230 -230
- package/src/modules/auth/actions/social-google-login.action.ts +12 -12
- package/src/modules/auth/actions/social-google-onboarding.action.ts +13 -13
- package/src/modules/auth/actions/unlink-google.action.ts +8 -8
- package/src/modules/auth/actions/validate-session.action.ts +70 -70
- package/src/modules/auth/actions/verify-two-factor.action.ts +19 -19
- package/src/modules/auth/hooks/login.hook.tsx +13 -13
- package/src/modules/auth/hooks/logout.hook.tsx +11 -11
- package/src/modules/auth/hooks/register.hook.tsx +11 -11
- package/src/modules/auth/hooks/social-google-login.hook.tsx +13 -13
- package/src/modules/auth/hooks/social-google-onboarding.hook.tsx +13 -13
- package/src/modules/auth/hooks/unlink-google.hook.tsx +13 -13
- package/src/modules/auth/hooks/useManagementPermissions.ts +52 -52
- package/src/modules/auth/hooks/useUserQuery.ts +103 -103
- package/src/modules/auth/types/management-permission.type.ts +14 -14
- package/src/modules/auth/utils/assert-management-permission.ts +56 -56
- package/src/modules/auth/utils/assert-management-subscription.ts +38 -38
- package/src/modules/auth/utils/assert-paid-subscription.ts +47 -47
- package/src/modules/auth/utils/assert-subscription-addon.ts +42 -42
- package/src/modules/auth/utils/build-wl-override.ts +43 -43
- package/src/modules/auth/utils/require-token-not-expired.ts +53 -53
- package/src/modules/auth/utils/require-valid-session.ts +35 -35
- package/src/modules/cards/actions/create-card.action.ts +9 -9
- package/src/modules/cards/actions/create-setup-intent.action.ts +8 -8
- package/src/modules/cards/actions/delete-card.action.ts +8 -8
- package/src/modules/cards/actions/set-default-card.action.ts +8 -8
- package/src/modules/cards/handlers/find-card-by-id.handler.ts +15 -15
- package/src/modules/cards/handlers/list-cards.handler.ts +10 -10
- package/src/modules/cards/hooks/card-by-id.hook.ts +17 -17
- package/src/modules/cards/hooks/cards.hook.ts +22 -22
- package/src/modules/cards/hooks/create-card.hook.ts +30 -30
- package/src/modules/cards/hooks/create-setup-intent.hook.ts +11 -11
- package/src/modules/cards/hooks/delete-card.hook.ts +52 -52
- package/src/modules/cards/hooks/delete-confirmation.hook.ts +40 -40
- package/src/modules/cards/hooks/handle-delete-card.hook.ts +47 -47
- package/src/modules/cards/hooks/set-default-card.hook.ts +55 -55
- package/src/modules/cards/services/cards.service.ts +136 -136
- package/src/modules/cards/types.ts +52 -52
- package/src/modules/charges/actions/charge-action.action.ts +13 -13
- package/src/modules/charges/handlers/find-charge-by-id.handler.ts +14 -14
- package/src/modules/charges/handlers/list-charges.handler.ts +15 -15
- package/src/modules/charges/hooks/charge-action.hook.ts +24 -24
- package/src/modules/charges/hooks/charge-by-id.hook.ts +19 -19
- package/src/modules/charges/hooks/charges.hook.ts +19 -19
- package/src/modules/charges/services/charges.service.ts +63 -63
- package/src/modules/charges/types/charge.type.ts +68 -68
- package/src/modules/ia-credits/handlers/list-ia-credits.handler.ts +14 -14
- package/src/modules/ia-credits/hooks/ia-credits.hook.ts +103 -103
- package/src/modules/images/actions/process-image.action.ts +40 -40
- package/src/modules/images/constants/image.constants.ts +11 -11
- package/src/modules/images/hooks/use-image-upload.hook.ts +153 -153
- package/src/modules/images/services/image-processing.service.ts +75 -75
- package/src/modules/images/types/image.type.ts +54 -54
- package/src/modules/images/utils/base64.ts +26 -26
- package/src/modules/images/utils/compress-image.ts +20 -20
- package/src/modules/images/utils/crop-image.ts +68 -68
- package/src/modules/images/utils/validate-image.ts +86 -86
- package/src/modules/pages/constants/query-keys.constants.ts +1 -1
- package/src/modules/pages/handlers/count-pages.handler.ts +12 -12
- package/src/modules/pages/hooks/count-pages.hook.ts +21 -21
- package/src/modules/pages/services/pages.service.ts +27 -27
- package/src/modules/plans/handlers/find-plan-by-id.handler.ts +14 -14
- package/src/modules/plans/handlers/list-plans.handler.ts +22 -22
- package/src/modules/plans/hooks/list-plans.hook.ts +23 -23
- package/src/modules/plans/hooks/use-has-plan-addon.hook.ts +14 -14
- package/src/modules/plans/hooks/use-plan-by-id.hook.ts +39 -39
- package/src/modules/plans/services/plans.service.ts +136 -136
- package/src/modules/plans/types/plan.type.ts +79 -79
- package/src/modules/plans/utils/map-api-plan-to-ui.ts +167 -167
- package/src/modules/projects/actions/add-project-user.action.ts +9 -9
- package/src/modules/projects/actions/create-project.action.ts +9 -9
- package/src/modules/projects/actions/delete-project.action.ts +8 -8
- package/src/modules/projects/actions/find-project.action.ts +8 -8
- package/src/modules/projects/actions/list-project-users.action.ts +9 -9
- package/src/modules/projects/actions/list-projects.action.ts +16 -16
- package/src/modules/projects/actions/remove-project-user.action.ts +9 -9
- package/src/modules/projects/actions/update-project.action.ts +9 -9
- package/src/modules/projects/handlers/find-project.handler.ts +15 -15
- package/src/modules/projects/handlers/list-all-account-users.handler.ts +23 -23
- package/src/modules/projects/handlers/list-available-users.handler.ts +26 -26
- package/src/modules/projects/handlers/list-project-users.handler.ts +26 -26
- package/src/modules/projects/handlers/list-projects.handler.ts +23 -23
- package/src/modules/projects/hooks/add-project-user.hook.ts +72 -72
- package/src/modules/projects/hooks/create-project.hook.ts +120 -120
- package/src/modules/projects/hooks/delete-project.hook.ts +58 -58
- package/src/modules/projects/hooks/find-project.hook.ts +18 -18
- package/src/modules/projects/hooks/list-all-account-users.hook.ts +40 -40
- package/src/modules/projects/hooks/list-available-users.hook.ts +39 -39
- package/src/modules/projects/hooks/list-infinite-projects.hook.ts +44 -44
- package/src/modules/projects/hooks/list-project-users.hook.ts +39 -39
- package/src/modules/projects/hooks/list-projects.hook.ts +23 -23
- package/src/modules/projects/hooks/remove-project-user.hook.ts +72 -72
- package/src/modules/projects/hooks/update-project.hook.ts +86 -86
- package/src/modules/projects/services/projects.service.ts +156 -156
- package/src/modules/subscriptions/actions/calculate-subscription.action.ts +9 -9
- package/src/modules/subscriptions/actions/list-subscriptions.action.ts +9 -9
- package/src/modules/subscriptions/actions/update-subscription-payment.action.ts +13 -13
- package/src/modules/subscriptions/actions/update-subscription-plan.action.ts +14 -14
- package/src/modules/subscriptions/constants/query-keys.constants.ts +3 -3
- package/src/modules/subscriptions/constants/subscription.constants.ts +1 -1
- package/src/modules/subscriptions/handlers/list-subscriptions.handler.ts +17 -17
- package/src/modules/subscriptions/hooks/calculate-subscription.hook.ts +13 -13
- package/src/modules/subscriptions/hooks/find-active-subscription.hook.ts +22 -22
- package/src/modules/subscriptions/hooks/list-subscriptions.hook.ts +22 -22
- package/src/modules/subscriptions/hooks/update-subscription-payment.hook.ts +25 -25
- package/src/modules/subscriptions/hooks/update-subscription-plan.hook.ts +28 -28
- package/src/modules/subscriptions/hooks/use-cancelled-subscription-guard.ts +44 -44
- package/src/modules/subscriptions/types/billing-period.type.ts +1 -1
- package/src/modules/subscriptions/types/calculate-subscription.type.ts +116 -116
- package/src/modules/subscriptions/types/pix-pending.type.ts +38 -38
- package/src/modules/subscriptions/utils/build-plan-extras.ts +56 -56
- package/src/modules/subscriptions/utils/get-subscription-cancellation-state.ts +37 -37
- package/src/modules/subscriptions/utils/get-subscription-expiry-date.ts +33 -33
- package/src/modules/subscriptions/utils/has-subscription-expired.ts +11 -11
- package/src/modules/subscriptions/utils/periodicity.ts +79 -79
- package/src/modules/subscriptions/utils/resolve-plan-extras-prices.ts +23 -23
- package/src/modules/users/action/find-user-by-id.action.ts +8 -8
- package/src/modules/users/action/mark-all-messages-as-read.action.ts +8 -8
- package/src/modules/users/action/mark-message-as-read.action.ts +8 -8
- package/src/modules/users/handlers/list-messages.handler.ts +39 -39
- package/src/modules/users/hooks/messages.hook.ts +69 -69
- package/src/modules/users/services/messages.service.ts +49 -49
- package/src/modules/whitelabel/actions/find-whitelabel.action.ts +23 -23
- package/src/modules/whitelabel/actions/revalidate-whitelabel.action.ts +19 -19
- package/src/modules/whitelabel/schema.ts +84 -84
- package/src/modules/whitelabel/utils/normalize-hostname.ts +26 -26
- package/src/providers/auth.provider.tsx +267 -267
- package/src/providers/navigation.provider.tsx +99 -99
- package/src/providers/whitelabel.provider.tsx +90 -90
- package/src/route.ts +4 -4
- package/src/store/useAccountModals.ts +85 -85
- package/src/store/useBuyCreditsModal.ts +21 -21
- package/src/store/useCreditsDisabledModal.ts +11 -11
- package/src/store/useDesktopSidebarStore.ts +47 -47
- package/src/store/useHexaPromoModal.ts +13 -13
- package/src/store/useMdSidebarStore.ts +34 -34
- package/src/store/usePaidPlanRequiredModal.ts +19 -19
- package/src/utils/constants/br-states.ts +29 -29
- package/src/utils/cookies/hexa-promo.ts +114 -114
- package/src/utils/countries.ts +224 -224
- package/src/utils/format/currency.ts +70 -70
- package/src/utils/intl/cookie-domain.ts +29 -29
- package/src/utils/intl/locale-cookie.ts +18 -18
- package/src/utils/next-navigation.ts +7 -7
- package/src/utils/redirect.ts +78 -78
- package/src/utils/safeMutationAction.ts +24 -24
- package/src/utils/safeServerAction.ts +21 -21
- package/src/utils/withAction.ts +13 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/data-display/Pagination.tsx"],"sourcesContent":["'use client';\
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/data-display/Pagination.tsx"],"sourcesContent":["'use client';\n\nimport * as React from \"react\"\nimport {\n IconChevronLeft,\n IconChevronRight,\n IconDots,\n} from \"@tabler/icons-react\"\nimport { cn } from \"../../../infra/utils/clsx\"\nimport { Button, buttonVariants } from \"../buttons/Button\"\n\nfunction Pagination({ className, ...props }: React.ComponentProps<\"nav\">) {\n return (\n <nav\n role=\"navigation\"\n aria-label=\"pagination\"\n data-slot=\"pagination\"\n className={cn(\"mx-auto flex w-full justify-center\", className)}\n {...props}\n />\n )\n}\n\nfunction PaginationContent({\n className,\n ...props\n}: React.ComponentProps<\"ul\">) {\n return (\n <ul\n data-slot=\"pagination-content\"\n className={cn(\"flex flex-row items-center gap-1.5\", className)}\n {...props}\n />\n )\n}\n\nfunction PaginationItem({ ...props }: React.ComponentProps<\"li\">) {\n return <li data-slot=\"pagination-item\" {...props} />\n}\n\ntype PaginationLinkProps = {\n isActive?: boolean\n} & Pick<React.ComponentProps<typeof Button>, \"size\"> &\n React.ComponentProps<\"a\">\n\nfunction PaginationLink({\n className,\n isActive,\n size = \"icon-sm\",\n ...props\n}: PaginationLinkProps) {\n return (\n <a\n aria-current={isActive ? \"page\" : undefined}\n data-slot=\"pagination-link\"\n data-active={isActive}\n className={cn(\n buttonVariants({\n variant: isActive ? \"secondary\" : \"ghost\",\n size,\n }),\n className\n )}\n {...props}\n />\n )\n}\n\nfunction PaginationPrevious({\n className,\n ...props\n}: React.ComponentProps<typeof PaginationLink>) {\n return (\n <PaginationLink\n aria-label=\"Go to previous page\"\n size=\"default\"\n className={cn(\"gap-1 size-8 sm:pl-2.5\", className)}\n {...props}\n >\n <IconChevronLeft />\n </PaginationLink>\n )\n}\n\nfunction PaginationNext({\n className,\n ...props\n}: React.ComponentProps<typeof PaginationLink>) {\n return (\n <PaginationLink\n aria-label=\"Go to next page\"\n size=\"default\"\n className={cn(\"gap-1 size-8 sm:pr-2.5\", className)}\n {...props}\n >\n <IconChevronRight />\n </PaginationLink>\n )\n}\n\nfunction PaginationEllipsis({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n aria-hidden\n data-slot=\"pagination-ellipsis\"\n className={cn(\"flex size-9 items-center justify-center\", className)}\n {...props}\n >\n <IconDots className=\"size-4 mt-1.5\" />\n <span className=\"sr-only\">More pages</span>\n </span>\n )\n}\n\nexport {\n Pagination,\n PaginationContent,\n PaginationLink,\n PaginationItem,\n PaginationPrevious,\n PaginationNext,\n PaginationEllipsis,\n}\n"],"mappings":";AAaI,cA4FA,YA5FA;AAVJ;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,UAAU;AACnB,SAAiB,sBAAsB;AAEvC,SAAS,WAAW,EAAE,WAAW,GAAG,MAAM,GAAgC;AACxE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,cAAW;AAAA,MACX,aAAU;AAAA,MACV,WAAW,GAAG,sCAAsC,SAAS;AAAA,MAC5D,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,kBAAkB;AAAA,EACzB;AAAA,EACA,GAAG;AACL,GAA+B;AAC7B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,sCAAsC,SAAS;AAAA,MAC5D,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,eAAe,EAAE,GAAG,MAAM,GAA+B;AAChE,SAAO,oBAAC,QAAG,aAAU,mBAAmB,GAAG,OAAO;AACpD;AAOA,SAAS,eAAe;AAAA,EACtB;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,GAAG;AACL,GAAwB;AACtB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,gBAAc,WAAW,SAAS;AAAA,MAClC,aAAU;AAAA,MACV,eAAa;AAAA,MACb,WAAW;AAAA,QACT,eAAe;AAAA,UACb,SAAS,WAAW,cAAc;AAAA,UAClC;AAAA,QACF,CAAC;AAAA,QACD;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,mBAAmB;AAAA,EAC1B;AAAA,EACA,GAAG;AACL,GAAgD;AAC9C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,cAAW;AAAA,MACX,MAAK;AAAA,MACL,WAAW,GAAG,0BAA0B,SAAS;AAAA,MAChD,GAAG;AAAA,MAEJ,8BAAC,mBAAgB;AAAA;AAAA,EACnB;AAEJ;AAEA,SAAS,eAAe;AAAA,EACtB;AAAA,EACA,GAAG;AACL,GAAgD;AAC9C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,cAAW;AAAA,MACX,MAAK;AAAA,MACL,WAAW,GAAG,0BAA0B,SAAS;AAAA,MAChD,GAAG;AAAA,MAEJ,8BAAC,oBAAiB;AAAA;AAAA,EACpB;AAEJ;AAEA,SAAS,mBAAmB;AAAA,EAC1B;AAAA,EACA,GAAG;AACL,GAAiC;AAC/B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAW;AAAA,MACX,aAAU;AAAA,MACV,WAAW,GAAG,2CAA2C,SAAS;AAAA,MACjE,GAAG;AAAA,MAEJ;AAAA,4BAAC,YAAS,WAAU,iBAAgB;AAAA,QACpC,oBAAC,UAAK,WAAU,WAAU,wBAAU;AAAA;AAAA;AAAA,EACtC;AAEJ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/data-display/PaymentInfoCard.tsx"],"sourcesContent":["'use client';\r\n\r\nimport { useCallback, useState } from 'react';\r\nimport { IconChevronDown, IconPlus } from '@tabler/icons-react';\r\nimport { CardBrandIcon } from './CardBrandIcons';\r\nimport { CardItem } from './CardItem';\r\nimport useIsMobile from '../../../hooks/useIsMobile';\r\nimport { useCards } from '../../../modules/cards/hooks/cards.hook';\r\nimport { useModalManager } from '../../../store/useModalManager';\r\nimport { useIsDefaultWhitelabel } from '../../../providers/whitelabel.provider';\r\nimport type { Card } from '../../../modules/cards/types';\r\nimport { useTranslations } from 'next-intl';\r\n\r\ntype PaymentInfoCardProps = {\r\n email?: string;\r\n selectedCardId: string;\r\n onCardSelect: (cardId: string) => void;\r\n onManageCards?: () => void;\r\n onOpenAddCard?: () => void;\r\n hideDelete?: boolean;\r\n hideSetDefault?: boolean;\r\n};\r\n\r\nexport function PaymentInfoCard({\r\n email,\r\n selectedCardId,\r\n onCardSelect,\r\n onManageCards,\r\n onOpenAddCard,\r\n hideDelete,\r\n hideSetDefault,\r\n}: PaymentInfoCardProps) {\r\n const translate = useTranslations();\r\n const isMobile = useIsMobile();\r\n const { openModal } = useModalManager();\r\n const isDefaultWl = useIsDefaultWhitelabel();\r\n\r\n const [isExpanded, setIsExpanded] = useState(false);\r\n\r\n const { data: cardsData } = useCards();\r\n const cards = cardsData?.data ?? [];\r\n\r\n const selectedCard = cards.find(\r\n (card) => card.id.toString() === selectedCardId.toString(),\r\n );\r\n\r\n const hasCards = cards.length > 0;\r\n\r\n const hasMoreThan3Cards = cards.length > 3;\r\n const shouldShowManageButton = isMobile && hasMoreThan3Cards;\r\n const displayedCards = shouldShowManageButton ? cards.slice(0, 3) : cards;\r\n\r\n const handleOpenAddCardModal = useCallback(() => {\r\n if (onOpenAddCard) {\r\n onOpenAddCard();\r\n return;\r\n }\r\n openModal('addCardModal', {\r\n onCardAdded: (cardId: string) => onCardSelect(cardId),\r\n });\r\n }, [openModal, onOpenAddCard, onCardSelect]);\r\n\r\n const handleSelectCard = useCallback(\r\n (cardId: string) => {\r\n onCardSelect(cardId);\r\n setIsExpanded(false);\r\n },\r\n [onCardSelect],\r\n );\r\n\r\n const handleAfterDelete = useCallback(\r\n (card: Card) => {\r\n if (card.id.toString() === selectedCardId.toString()) {\r\n const remaining = cards.filter((c) => c.id !== card.id);\r\n if (remaining.length > 0) {\r\n onCardSelect(remaining[0].id.toString());\r\n }\r\n }\r\n },\r\n [cards, selectedCardId, onCardSelect],\r\n );\r\n\r\n if (!hasCards) {\r\n return (\r\n <div className=\"border border-zinc-200 rounded-lg overflow-hidden\">\r\n {email && (\r\n <div className=\"flex items-center h-[60px] px-4 border-b border-zinc-200 gap-3\">\r\n <span className=\"paragraph-small-medium text-zinc-500 w-[100px]\">{translate('common.cards.paymentInfo.email')}</span>\r\n <span className=\"paragraph-small-medium text-zinc-950 flex-1\">{email}</span>\r\n </div>\r\n )}\r\n <div className=\"flex items-center h-[60px] px-4 gap-3\">\r\n <span className=\"paragraph-small-medium text-zinc-500 w-[100px]\">{translate('common.cards.paymentInfo.payment')}</span>\r\n <button\r\n type=\"button\"\r\n onClick={handleOpenAddCardModal}\r\n className=\"flex items-center h-8 px-2 paragraph-small-semibold text-zinc-950 border border-zinc-200 rounded-md hover:border-zinc-400 transition-colors cursor-pointer w-fit\"\r\n >\r\n <IconPlus className=\"size-[18px]\" />\r\n <span className=\"px-1.5\">{translate('common.cards.paymentInfo.addCard')}</span>\r\n </button>\r\n </div>\r\n </div>\r\n );\r\n }\r\n\r\n return (\r\n <div className=\"flex flex-col gap-3\">\r\n <div className=\"border border-zinc-200 rounded-lg overflow-hidden\">\r\n {email && (\r\n <div className=\"flex items-center h-[60px] px-4 border-b border-zinc-200 gap-3\">\r\n <span className=\"paragraph-small-medium text-zinc-500 w-[100px]\">{translate('common.cards.paymentInfo.email')}</span>\r\n <span className=\"paragraph-small-medium text-zinc-950 flex-1\">{email}</span>\r\n </div>\r\n )}\r\n\r\n <div\r\n className=\"flex items-center px-4 py-4 cursor-pointer gap-3\"\r\n onClick={() => setIsExpanded((prev) => !prev)}\r\n >\r\n {!isExpanded ? (\r\n <>\r\n <span className=\"paragraph-small-medium text-zinc-500 w-[100px]\">{translate('common.cards.paymentInfo.payment')}</span>\r\n <div className=\"flex flex-col gap-0.5 flex-1 min-w-0\">\r\n <span className=\"paragraph-small-semibold text-zinc-950 truncate\">\r\n {selectedCard?.name}\r\n </span>\r\n <span className=\"paragraph-small-medium text-zinc-950\">\r\n •••• {selectedCard?.number?.replaceAll(/\\D/g, '')?.slice(-4)}\r\n </span>\r\n </div>\r\n {selectedCard && <CardBrandIcon brand={selectedCard.brand} />}\r\n <div className=\"size-8 flex items-center justify-center rounded-lg\">\r\n <IconChevronDown className=\"size-[18px] text-zinc-500\" />\r\n </div>\r\n </>\r\n ) : (\r\n <>\r\n <span className=\"paragraph-small-semibold text-zinc-950 flex-1\">\r\n {translate('common.cards.paymentInfo.selectPaymentMethod')}\r\n </span>\r\n <div className=\"size-8 flex items-center justify-center rounded-lg\">\r\n <IconChevronDown className=\"size-[18px] text-zinc-500 rotate-180\" />\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n\r\n <div\r\n className={`flex flex-col gap-2 px-4 overflow-hidden transition-all duration-300 ease-in-out ${\r\n isExpanded ? 'max-h-[500px] pb-4 opacity-100' : 'max-h-0 pb-0 opacity-0'\r\n }`}\r\n >\r\n {displayedCards.map((card) => (\r\n <CardItem\r\n key={card.id}\r\n card={card}\r\n isSelected={card.id.toString() === selectedCardId.toString()}\r\n onSelect={() => handleSelectCard(card.id.toString())}\r\n hideDelete={hideDelete}\r\n hideSetDefault={hideSetDefault}\r\n onAfterDelete={handleAfterDelete}\r\n />\r\n ))}\r\n {shouldShowManageButton && onManageCards && (\r\n <button\r\n type=\"button\"\r\n onClick={onManageCards}\r\n className={`flex items-center justify-center h-10 px-4 paragraph-small-semibold rounded-lg transition-colors cursor-pointer mt-2 ${\r\n isDefaultWl\r\n ? 'text-cyan-600 border border-cyan-200 hover:bg-cyan-50'\r\n : 'text-zinc-600 border border-zinc-200 hover:bg-zinc-50'\r\n }`}\r\n >\r\n {translate('common.cards.paymentInfo.manageCards')}\r\n </button>\r\n )}\r\n </div>\r\n </div>\r\n\r\n <button\r\n type=\"button\"\r\n onClick={handleOpenAddCardModal}\r\n className=\"flex items-center h-8 px-2 paragraph-small-semibold text-zinc-950 border border-zinc-200 rounded-md hover:border-zinc-400 transition-colors cursor-pointer w-fit\"\r\n >\r\n <IconPlus className=\"size-[18px]\" />\r\n <span className=\"px-1.5\">\r\n {isExpanded ? translate('common.cards.paymentInfo.addCard') : translate('common.cards.paymentInfo.newPaymentMethod')}\r\n </span>\r\n </button>\r\n </div>\r\n );\r\n}\r\n"],"mappings":";AAsFU,SAmCE,UAlCA,KADF;AApFV,SAAS,aAAa,gBAAgB;AACtC,SAAS,iBAAiB,gBAAgB;AAC1C,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB;AACzB,OAAO,iBAAiB;AACxB,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,SAAS,8BAA8B;AAEvC,SAAS,uBAAuB;AAYzB,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAyB;AACvB,QAAM,YAAY,gBAAgB;AAClC,QAAM,WAAW,YAAY;AAC7B,QAAM,EAAE,UAAU,IAAI,gBAAgB;AACtC,QAAM,cAAc,uBAAuB;AAE3C,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,KAAK;AAElD,QAAM,EAAE,MAAM,UAAU,IAAI,SAAS;AACrC,QAAM,QAAQ,WAAW,QAAQ,CAAC;AAElC,QAAM,eAAe,MAAM;AAAA,IACzB,CAAC,SAAS,KAAK,GAAG,SAAS,MAAM,eAAe,SAAS;AAAA,EAC3D;AAEA,QAAM,WAAW,MAAM,SAAS;AAEhC,QAAM,oBAAoB,MAAM,SAAS;AACzC,QAAM,yBAAyB,YAAY;AAC3C,QAAM,iBAAiB,yBAAyB,MAAM,MAAM,GAAG,CAAC,IAAI;AAEpE,QAAM,yBAAyB,YAAY,MAAM;AAC/C,QAAI,eAAe;AACjB,oBAAc;AACd;AAAA,IACF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AAK;AAAA,gBACL,SAAS;AAAA,gBACT,WAAW,wHACT,cACI,0DACA,uDACN;AAAA,gBAEC,oBAAU,sCAAsC;AAAA;AAAA,YACnD;AAAA;AAAA;AAAA,MAEJ;AAAA,OACF;AAAA,IAEA;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,SAAS;AAAA,QACT,WAAU;AAAA,QAEV;AAAA,8BAAC,YAAS,WAAU,eAAc;AAAA,UAClC,oBAAC,UAAK,WAAU,UACb,uBAAa,UAAU,kCAAkC,IAAI,UAAU,2CAA2C,GACrH;AAAA;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/data-display/PaymentInfoCard.tsx"],"sourcesContent":["'use client';\n\nimport { useCallback, useState } from 'react';\nimport { IconChevronDown, IconPlus } from '@tabler/icons-react';\nimport { CardBrandIcon } from './CardBrandIcons';\nimport { CardItem } from './CardItem';\nimport useIsMobile from '../../../hooks/useIsMobile';\nimport { useCards } from '../../../modules/cards/hooks/cards.hook';\nimport { useModalManager } from '../../../store/useModalManager';\nimport { useIsDefaultWhitelabel } from '../../../providers/whitelabel.provider';\nimport type { Card } from '../../../modules/cards/types';\nimport { useTranslations } from 'next-intl';\n\ntype PaymentInfoCardProps = {\n email?: string;\n selectedCardId: string;\n onCardSelect: (cardId: string) => void;\n onManageCards?: () => void;\n onOpenAddCard?: () => void;\n hideDelete?: boolean;\n hideSetDefault?: boolean;\n};\n\nexport function PaymentInfoCard({\n email,\n selectedCardId,\n onCardSelect,\n onManageCards,\n onOpenAddCard,\n hideDelete,\n hideSetDefault,\n}: PaymentInfoCardProps) {\n const translate = useTranslations();\n const isMobile = useIsMobile();\n const { openModal } = useModalManager();\n const isDefaultWl = useIsDefaultWhitelabel();\n\n const [isExpanded, setIsExpanded] = useState(false);\n\n const { data: cardsData } = useCards();\n const cards = cardsData?.data ?? [];\n\n const selectedCard = cards.find(\n (card) => card.id.toString() === selectedCardId.toString(),\n );\n\n const hasCards = cards.length > 0;\n\n const hasMoreThan3Cards = cards.length > 3;\n const shouldShowManageButton = isMobile && hasMoreThan3Cards;\n const displayedCards = shouldShowManageButton ? cards.slice(0, 3) : cards;\n\n const handleOpenAddCardModal = useCallback(() => {\n if (onOpenAddCard) {\n onOpenAddCard();\n return;\n }\n openModal('addCardModal', {\n onCardAdded: (cardId: string) => onCardSelect(cardId),\n });\n }, [openModal, onOpenAddCard, onCardSelect]);\n\n const handleSelectCard = useCallback(\n (cardId: string) => {\n onCardSelect(cardId);\n setIsExpanded(false);\n },\n [onCardSelect],\n );\n\n const handleAfterDelete = useCallback(\n (card: Card) => {\n if (card.id.toString() === selectedCardId.toString()) {\n const remaining = cards.filter((c) => c.id !== card.id);\n if (remaining.length > 0) {\n onCardSelect(remaining[0].id.toString());\n }\n }\n },\n [cards, selectedCardId, onCardSelect],\n );\n\n if (!hasCards) {\n return (\n <div className=\"border border-zinc-200 rounded-lg overflow-hidden\">\n {email && (\n <div className=\"flex items-center h-[60px] px-4 border-b border-zinc-200 gap-3\">\n <span className=\"paragraph-small-medium text-zinc-500 w-[100px]\">{translate('common.cards.paymentInfo.email')}</span>\n <span className=\"paragraph-small-medium text-zinc-950 flex-1\">{email}</span>\n </div>\n )}\n <div className=\"flex items-center h-[60px] px-4 gap-3\">\n <span className=\"paragraph-small-medium text-zinc-500 w-[100px]\">{translate('common.cards.paymentInfo.payment')}</span>\n <button\n type=\"button\"\n onClick={handleOpenAddCardModal}\n className=\"flex items-center h-8 px-2 paragraph-small-semibold text-zinc-950 border border-zinc-200 rounded-md hover:border-zinc-400 transition-colors cursor-pointer w-fit\"\n >\n <IconPlus className=\"size-[18px]\" />\n <span className=\"px-1.5\">{translate('common.cards.paymentInfo.addCard')}</span>\n </button>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"flex flex-col gap-3\">\n <div className=\"border border-zinc-200 rounded-lg overflow-hidden\">\n {email && (\n <div className=\"flex items-center h-[60px] px-4 border-b border-zinc-200 gap-3\">\n <span className=\"paragraph-small-medium text-zinc-500 w-[100px]\">{translate('common.cards.paymentInfo.email')}</span>\n <span className=\"paragraph-small-medium text-zinc-950 flex-1\">{email}</span>\n </div>\n )}\n\n <div\n className=\"flex items-center px-4 py-4 cursor-pointer gap-3\"\n onClick={() => setIsExpanded((prev) => !prev)}\n >\n {!isExpanded ? (\n <>\n <span className=\"paragraph-small-medium text-zinc-500 w-[100px]\">{translate('common.cards.paymentInfo.payment')}</span>\n <div className=\"flex flex-col gap-0.5 flex-1 min-w-0\">\n <span className=\"paragraph-small-semibold text-zinc-950 truncate\">\n {selectedCard?.name}\n </span>\n <span className=\"paragraph-small-medium text-zinc-950\">\n •••• {selectedCard?.number?.replaceAll(/\\D/g, '')?.slice(-4)}\n </span>\n </div>\n {selectedCard && <CardBrandIcon brand={selectedCard.brand} />}\n <div className=\"size-8 flex items-center justify-center rounded-lg\">\n <IconChevronDown className=\"size-[18px] text-zinc-500\" />\n </div>\n </>\n ) : (\n <>\n <span className=\"paragraph-small-semibold text-zinc-950 flex-1\">\n {translate('common.cards.paymentInfo.selectPaymentMethod')}\n </span>\n <div className=\"size-8 flex items-center justify-center rounded-lg\">\n <IconChevronDown className=\"size-[18px] text-zinc-500 rotate-180\" />\n </div>\n </>\n )}\n </div>\n\n <div\n className={`flex flex-col gap-2 px-4 overflow-hidden transition-all duration-300 ease-in-out ${\n isExpanded ? 'max-h-[500px] pb-4 opacity-100' : 'max-h-0 pb-0 opacity-0'\n }`}\n >\n {displayedCards.map((card) => (\n <CardItem\n key={card.id}\n card={card}\n isSelected={card.id.toString() === selectedCardId.toString()}\n onSelect={() => handleSelectCard(card.id.toString())}\n hideDelete={hideDelete}\n hideSetDefault={hideSetDefault}\n onAfterDelete={handleAfterDelete}\n />\n ))}\n {shouldShowManageButton && onManageCards && (\n <button\n type=\"button\"\n onClick={onManageCards}\n className={`flex items-center justify-center h-10 px-4 paragraph-small-semibold rounded-lg transition-colors cursor-pointer mt-2 ${\n isDefaultWl\n ? 'text-cyan-600 border border-cyan-200 hover:bg-cyan-50'\n : 'text-zinc-600 border border-zinc-200 hover:bg-zinc-50'\n }`}\n >\n {translate('common.cards.paymentInfo.manageCards')}\n </button>\n )}\n </div>\n </div>\n\n <button\n type=\"button\"\n onClick={handleOpenAddCardModal}\n className=\"flex items-center h-8 px-2 paragraph-small-semibold text-zinc-950 border border-zinc-200 rounded-md hover:border-zinc-400 transition-colors cursor-pointer w-fit\"\n >\n <IconPlus className=\"size-[18px]\" />\n <span className=\"px-1.5\">\n {isExpanded ? translate('common.cards.paymentInfo.addCard') : translate('common.cards.paymentInfo.newPaymentMethod')}\n </span>\n </button>\n </div>\n );\n}\n"],"mappings":";AAsFU,SAmCE,UAlCA,KADF;AApFV,SAAS,aAAa,gBAAgB;AACtC,SAAS,iBAAiB,gBAAgB;AAC1C,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB;AACzB,OAAO,iBAAiB;AACxB,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,SAAS,8BAA8B;AAEvC,SAAS,uBAAuB;AAYzB,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAyB;AACvB,QAAM,YAAY,gBAAgB;AAClC,QAAM,WAAW,YAAY;AAC7B,QAAM,EAAE,UAAU,IAAI,gBAAgB;AACtC,QAAM,cAAc,uBAAuB;AAE3C,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,KAAK;AAElD,QAAM,EAAE,MAAM,UAAU,IAAI,SAAS;AACrC,QAAM,QAAQ,WAAW,QAAQ,CAAC;AAElC,QAAM,eAAe,MAAM;AAAA,IACzB,CAAC,SAAS,KAAK,GAAG,SAAS,MAAM,eAAe,SAAS;AAAA,EAC3D;AAEA,QAAM,WAAW,MAAM,SAAS;AAEhC,QAAM,oBAAoB,MAAM,SAAS;AACzC,QAAM,yBAAyB,YAAY;AAC3C,QAAM,iB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A,gBACA;AAAA,gBACA,eAAe;AAAA;AAAA,cANV,KAAK;AAAA,YAOZ,CACD;AAAA,YACA,0BAA0B,iBACzB;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,SAAS;AAAA,gBACT,WAAW,wHACT,cACI,0DACA,uDACN;AAAA,gBAEC,oBAAU,sCAAsC;AAAA;AAAA,YACnD;AAAA;AAAA;AAAA,MAEJ;AAAA,OACF;AAAA,IAEA;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,SAAS;AAAA,QACT,WAAU;AAAA,QAEV;AAAA,8BAAC,YAAS,WAAU,eAAc;AAAA,UAClC,oBAAC,UAAK,WAAU,UACb,uBAAa,UAAU,kCAAkC,IAAI,UAAU,2CAA2C,GACrH;AAAA;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/data-display/ScrollArea.tsx"],"sourcesContent":["'use client';\
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/data-display/ScrollArea.tsx"],"sourcesContent":["'use client';\n\n\"use client\"\n\nimport * as React from \"react\"\nimport * as ScrollAreaPrimitive from \"@radix-ui/react-scroll-area\"\nimport { cn } from \"../../../infra/utils/clsx\"\n\nfunction ScrollArea({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {\n return (\n <ScrollAreaPrimitive.Root\n data-slot=\"scroll-area\"\n className={cn(\"relative\", className)}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport\n data-slot=\"scroll-area-viewport\"\n className=\"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1\"\n >\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n )\n}\n\nfunction ScrollBar({\n className,\n orientation = \"vertical\",\n ...props\n}: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {\n return (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n data-slot=\"scroll-area-scrollbar\"\n orientation={orientation}\n className={cn(\n \"flex touch-none p-px transition-colors select-none\",\n orientation === \"vertical\" &&\n \"h-full w-2.5 border-l border-l-transparent\",\n orientation === \"horizontal\" &&\n \"h-2.5 flex-col border-t border-t-transparent\",\n className\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb\n data-slot=\"scroll-area-thumb\"\n className=\"bg-border relative flex-1 rounded-full\"\n />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n )\n}\n\nexport { ScrollArea, ScrollBar }\n"],"mappings":";AAcI,SAKE,KALF;AATJ,YAAY,yBAAyB;AACrC,SAAS,UAAU;AAEnB,SAAS,WAAW;AAAA,EAClB;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAA0D;AACxD,SACE;AAAA,IAAC,oBAAoB;AAAA,IAApB;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,YAAY,SAAS;AAAA,MAClC,GAAG;AAAA,MAEJ;AAAA;AAAA,UAAC,oBAAoB;AAAA,UAApB;AAAA,YACC,aAAU;AAAA,YACV,WAAU;AAAA,YAET;AAAA;AAAA,QACH;AAAA,QACA,oBAAC,aAAU;AAAA,QACX,oBAAC,oBAAoB,QAApB,EAA2B;AAAA;AAAA;AAAA,EAC9B;AAEJ;AAEA,SAAS,UAAU;AAAA,EACjB;AAAA,EACA,cAAc;AAAA,EACd,GAAG;AACL,GAAyE;AACvE,SACE;AAAA,IAAC,oBAAoB;AAAA,IAApB;AAAA,MACC,aAAU;AAAA,MACV;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA,gBAAgB,cACd;AAAA,QACF,gBAAgB,gBACd;AAAA,QACF;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,QAAC,oBAAoB;AAAA,QAApB;AAAA,UACC,aAAU;AAAA,UACV,WAAU;AAAA;AAAA,MACZ;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/data-display/Separator.tsx"],"sourcesContent":["'use client';\
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/data-display/Separator.tsx"],"sourcesContent":["'use client';\n\n\"use client\"\n\nimport * as React from \"react\"\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\"\nimport { cn } from \"../../../infra/utils/clsx\"\n\nfunction Separator({\n className,\n orientation = \"horizontal\",\n decorative = true,\n ...props\n}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {\n return (\n <SeparatorPrimitive.Root\n data-slot=\"separator\"\n decorative={decorative}\n orientation={orientation}\n className={cn(\n \"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Separator }\n"],"mappings":";AAeI;AAVJ,YAAY,wBAAwB;AACpC,SAAS,UAAU;AAEnB,SAAS,UAAU;AAAA,EACjB;AAAA,EACA,cAAc;AAAA,EACd,aAAa;AAAA,EACb,GAAG;AACL,GAAyD;AACvD,SACE;AAAA,IAAC,mBAAmB;AAAA,IAAnB;AAAA,MACC,aAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/data-display/Table.tsx"],"sourcesContent":["'use client';\
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/data-display/Table.tsx"],"sourcesContent":["'use client';\n\n\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"../../../infra/utils/clsx\"\n\nfunction Table({ className, ...props }: React.ComponentProps<\"table\">) {\n return (\n <div\n data-slot=\"table-container\"\n className=\"relative w-full overflow-x-auto\"\n >\n <table\n data-slot=\"table\"\n className={cn(\"w-full caption-bottom text-sm\", className)}\n {...props}\n />\n </div>\n )\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<\"thead\">) {\n return (\n <thead\n data-slot=\"table-header\"\n className={cn(\"[&_tr]:border-b\", className)}\n {...props}\n />\n )\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<\"tbody\">) {\n return (\n <tbody\n data-slot=\"table-body\"\n className={cn(\"[&_tr:last-child]:border-0\", className)}\n {...props}\n />\n )\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<\"tfoot\">) {\n return (\n <tfoot\n data-slot=\"table-footer\"\n className={cn(\n \"bg-muted/50 border-t font-medium [&>tr]:last:border-b-0\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction TableRow({ className, ...props }: React.ComponentProps<\"tr\">) {\n return (\n <tr\n data-slot=\"table-row\"\n className={cn(\n \"hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction TableHead({ className, ...props }: React.ComponentProps<\"th\">) {\n return (\n <th\n data-slot=\"table-head\"\n className={cn(\n \"text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction TableCell({ className, ...props }: React.ComponentProps<\"td\">) {\n return (\n <td\n data-slot=\"table-cell\"\n className={cn(\n \"p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction TableCaption({\n className,\n ...props\n}: React.ComponentProps<\"caption\">) {\n return (\n <caption\n data-slot=\"table-caption\"\n className={cn(\"text-muted-foreground mt-4 text-sm\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter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AEJ;AAEA,SAAS,UAAU,EAAE,WAAW,GAAG,MAAM,GAA+B;AACtE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,aAAa;AAAA,EACpB;AAAA,EACA,GAAG;AACL,GAAoC;AAClC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,sCAAsC,SAAS;AAAA,MAC5D,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/data-display/Tabs.tsx"],"sourcesContent":["'use client';\
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/data-display/Tabs.tsx"],"sourcesContent":["'use client';\n\n\"use client\"\n\nimport * as React from \"react\"\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\"\nimport { cn } from \"../../../infra/utils/clsx\"\n\nfunction Tabs({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Root>) {\n return (\n <TabsPrimitive.Root\n data-slot=\"tabs\"\n className={cn(\"flex flex-col gap-2\", className)}\n {...props}\n />\n )\n}\n\nfunction TabsList({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.List>) {\n return (\n <TabsPrimitive.List\n data-slot=\"tabs-list\"\n className={cn(\n \"inline-flex w-full items-center justify-start border-b border-gray-200\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction TabsTrigger({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Trigger>) {\n return (\n <TabsPrimitive.Trigger\n data-slot=\"tabs-trigger\"\n className={cn(\n \"inline-flex items-center justify-center whitespace-nowrap px-4 py-3 text-sm font-medium text-gray-500 transition-all border-b-2 border-transparent hover:text-gray-900 cursor-pointer data-[state=active]:text-gray-950 data-[state=active]:border-gray-950 disabled:pointer-events-none disabled:opacity-50\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction TabsContent({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Content>) {\n return (\n <TabsPrimitive.Content\n data-slot=\"tabs-content\"\n className={cn(\"flex-1 outline-none\", className)}\n {...props}\n />\n )\n}\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent }\n"],"mappings":";AAaI;AARJ,YAAY,mBAAmB;AAC/B,SAAS,UAAU;AAEnB,SAAS,KAAK;AAAA,EACZ;AAAA,EACA,GAAG;AACL,GAAoD;AAClD,SACE;AAAA,IAAC,cAAc;AAAA,IAAd;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,uBAAuB,SAAS;AAAA,MAC7C,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,SAAS;AAAA,EAChB;AAAA,EACA,GAAG;AACL,GAAoD;AAClD,SACE;AAAA,IAAC,cAAc;AAAA,IAAd;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,YAAY;AAAA,EACnB;AAAA,EACA,GAAG;AACL,GAAuD;AACrD,SACE;AAAA,IAAC,cAAc;AAAA,IAAd;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,YAAY;AAAA,EACnB;AAAA,EACA,GAAG;AACL,GAAuD;AACrD,SACE;AAAA,IAAC,cAAc;AAAA,IAAd;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,uBAAuB,SAAS;AAAA,MAC7C,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/feedback/CircularProgress.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/feedback/CircularProgress.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\nimport {\n calculateRadius,\n calculateCircumference,\n calculatePercentage,\n calculateCircularProgressOffset,\n} from \"../../../infra/utils/percentage\";\n\ninterface CircularProgressProps {\n current: number;\n total: number;\n size?: number;\n strokeWidth?: number;\n children?: ReactNode;\n}\n\nexport default function CircularProgress({\n current,\n total,\n size = 62,\n strokeWidth = 3,\n children,\n}: CircularProgressProps) {\n const radius = calculateRadius(size, strokeWidth);\n const circumference = calculateCircumference(radius);\n const percentage = calculatePercentage(current, total);\n const offset = calculateCircularProgressOffset(percentage, circumference);\n\n return (\n <div\n className=\"relative flex items-center justify-center\"\n style={{ width: size, height: size }}\n role=\"progressbar\"\n aria-valuenow={current}\n aria-valuemin={0}\n aria-valuemax={total}\n // i18n-TODO: aria-label hardcoded — CircularProgress has no 'use client' directive and\n // receives no translate prop, so useTranslations() cannot be called here without\n // converting it to a client component. Key to use: common.forms.circularProgress.ariaLabel ('Progresso').\n // Either add 'use client' + useTranslations(), or accept a translate prop from the caller.\n aria-label=\"Progresso\"\n >\n <svg width={size} height={size} className=\"absolute\">\n <circle\n cx={size / 2}\n cy={size / 2}\n r={radius}\n stroke=\"var(--color-gray-50)\"\n strokeWidth={strokeWidth}\n fill=\"white\"\n />\n\n <circle\n cx={size / 2}\n cy={size / 2}\n r={radius}\n stroke=\"var(--color-gray-950)\"\n strokeWidth={strokeWidth}\n fill=\"none\"\n strokeDasharray={circumference}\n strokeDashoffset={offset}\n strokeLinecap=\"round\"\n transform={`rotate(-90 ${size / 2} ${size / 2})`}\n className=\"transition-all duration-300 ease-in-out\"\n />\n </svg>\n\n <div className=\"relative z-10 flex items-center justify-center w-[50px] h-[50px] rounded-full bg-gray-50 paragraph-small-semibold\">\n {children ?? (\n <>\n <span className=\"text-gray-600\">{current}</span>\n <span className=\"text-gray-500\">/</span>\n <span className=\"text-gray-600\">{total}</span>\n </>\n )}\n </div>\n </div>\n );\n}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;AAAA,WACzC,GAEJ;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/feedback/DefaultCircularProgress.tsx"],"sourcesContent":["'use client';\
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/feedback/DefaultCircularProgress.tsx"],"sourcesContent":["'use client';\n\nimport { useTranslations } from 'next-intl';\nimport {\n calculateRadius,\n calculateCircumference,\n calculatePercentage,\n calculateCircularProgressOffset,\n} from \"../../../infra/utils/percentage\";\nimport { useIsDefaultWhitelabel } from \"../../../providers/whitelabel.provider\";\n\ninterface CircularProgressProps {\n current: number;\n total: number;\n size?: number;\n strokeWidth?: number;\n}\n\nexport default function DefaultCircularProgress({\n current,\n total,\n size = 62,\n strokeWidth = 3,\n}: CircularProgressProps) {\n const translate = useTranslations();\n const isDefaultWl = useIsDefaultWhitelabel();\n const radius = calculateRadius(size, strokeWidth);\n const circumference = calculateCircumference(radius);\n const percentage = calculatePercentage(current, total);\n const offset = calculateCircularProgressOffset(percentage, circumference);\n\n return (\n <div\n className=\"relative flex items-center justify-center\"\n style={{ width: size, height: size }}\n role=\"progressbar\"\n aria-valuenow={current}\n aria-valuemin={0}\n aria-valuemax={total}\n aria-label={translate('common.forms.circularProgress.ariaLabel')}\n >\n <svg width={size} height={size} className=\"absolute\">\n <circle\n cx={size / 2}\n cy={size / 2}\n r={radius}\n stroke=\"var(--color-zinc-200)\"\n strokeWidth={strokeWidth}\n fill=\"none\"\n />\n <circle\n cx={size / 2}\n cy={size / 2}\n r={radius}\n stroke={isDefaultWl ? \"var(--color-cyan-300)\" : \"var(--color-zinc-300)\"}\n strokeWidth={strokeWidth}\n fill=\"none\"\n strokeDasharray={circumference}\n strokeDashoffset={offset}\n strokeLinecap=\"round\"\n transform={`rotate(-90 ${size / 2} ${size / 2})`}\n className=\"transition-all duration-300 ease-in-out\"\n />\n </svg>\n </div>\n );\n}\n"],"mappings":";AAyCM,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lay.tsx"],"sourcesContent":["'use client';\
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/feedback/LoadingOverlay.tsx"],"sourcesContent":["'use client';\n\nimport { ReactNode } from 'react';\n\ninterface LoadingOverlayProps {\n isLoading: boolean;\n message?: string;\n icon?: ReactNode;\n}\n\nexport function LoadingOverlay({ isLoading, message, icon }: LoadingOverlayProps) {\n if (!isLoading) return null;\n\n return (\n <div className=\"fixed inset-0 z-[9999] flex items-center justify-center bg-black/60 backdrop-blur-[2px]\">\n <div className=\"bg-white rounded-2xl shadow-xl px-16 py-12 flex flex-col items-center gap-6 min-w-[380px]\">\n <div className=\"relative flex items-center justify-center w-20 h-20\">\n <div className=\"absolute inset-0 border-[5px] border-gray-100 rounded-full\" />\n <div className=\"absolute inset-0 border-[5px] border-transparent border-t-black rounded-full animate-spin\" />\n {icon && (\n <div className=\"relative z-20 flex items-center justify-center w-14 h-14 bg-gray-100 rounded-full\">\n {icon}\n </div>\n )}\n </div>\n <span className=\"font-bold text-gray-900 text-lg\">{message}</span>\n </div>\n </div>\n );\n}\n"],"mappings":";AAgBQ,SACE,KADF;AAND,SAAS,eAAe,EAAE,WAAW,SAAS,KAAK,GAAwB;AAChF,MAAI,CAAC,UAAW,QAAO;AAEvB,SACE,oBAAC,SAAI,WAAU,2FACb,+BAAC,SAAI,WAAU,6FACb;AAAA,yBAAC,SAAI,WAAU,uDACb;AAAA,0BAAC,SAAI,WAAU,8DAA6D;AAAA,MAC5E,oBAAC,SAAI,WAAU,6FAA4F;AAAA,MAC1G,QACC,oBAAC,SAAI,WAAU,qFACZ,gBACH;AAAA,OAEJ;AAAA,IACA,oBAAC,UAAK,WAAU,mCAAmC,mBAAQ;AAAA,KAC7D,GACF;AAEJ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/feedback/Progress.tsx"],"sourcesContent":["'use client';\
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/feedback/Progress.tsx"],"sourcesContent":["'use client';\n\n\"use client\"\n\nimport * as React from \"react\"\nimport * as ProgressPrimitive from \"@radix-ui/react-progress\"\nimport { cn } from \"../../../infra/utils/clsx\"\n\ninterface ProgressProps extends React.ComponentProps<typeof ProgressPrimitive.Root> {\n indicatorColor?: string\n}\n\nfunction Progress({\n className,\n value,\n indicatorColor,\n ...props\n}: ProgressProps) {\n return (\n <ProgressPrimitive.Root\n data-slot=\"progress\"\n className={cn(\n \"bg-primary/20 relative h-2 w-full overflow-hidden rounded-full\",\n className\n )}\n {...props}\n >\n <ProgressPrimitive.Indicator\n data-slot=\"progress-indicator\"\n className={cn(\n \"bg-primary h-full w-full flex-1 transition-all rounded-full\",\n indicatorColor\n )}\n style={{ transform: `translateX(-${100 - (value || 0)}%)` }}\n />\n </ProgressPrimitive.Root>\n )\n}\n\nexport { Progress }\n"],"mappings":";AA2BM;AAtBN,YAAY,uBAAuB;AACnC,SAAS,UAAU;AAMnB,SAAS,SAAS;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAkB;AAChB,SACE;AAAA,IAAC,kBAAkB;AAAA,IAAlB;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,QAAC,kBAAkB;AAAA,QAAlB;AAAA,UACC,aAAU;AAAA,UACV,WAAW;AAAA,YACT;AAAA,YACA;AAAA,UACF;AAAA,UACA,OAAO,EAAE,WAAW,eAAe,OAAO,SAAS,EAAE,KAAK;AAAA;AAAA,MAC5D;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/feedback/Skeleton.tsx"],"sourcesContent":["import { cn } from '../../../infra/utils/clsx';\
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/feedback/Skeleton.tsx"],"sourcesContent":["import { cn } from '../../../infra/utils/clsx';\n\nexport function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n return <div className={cn('skeleton rounded-md', className)} {...props} />;\n}\n"],"mappings":"AAGS;AAHT,SAAS,UAAU;AAEZ,SAAS,SAAS,EAAE,WAAW,GAAG,MAAM,GAAyC;AACtF,SAAO,oBAAC,SAAI,WAAW,GAAG,uBAAuB,SAAS,GAAI,GAAG,OAAO;AAC1E;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/feedback/Toast.tsx"],"sourcesContent":["'use client';\
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/feedback/Toast.tsx"],"sourcesContent":["'use client';\n\nimport * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { IconCircleCheck, IconCircleX, IconAlertCircle, IconInfoCircle, IconCircle, IconX } from \"@tabler/icons-react\"\nimport { toast } from \"sonner\"\nimport { cn } from \"../../../infra/utils/clsx\"\nimport { useIsDefaultWhitelabel } from \"../../../providers/whitelabel.provider\"\nimport { Button } from \"../buttons/Button\"\n\nconst toastVariants = cva(\n \"w-full bg-white rounded-lg p-4 shadow-lg backdrop-blur-sm transition-all\",\n {\n variants: {\n variant: {\n success: \"\",\n error: \"\",\n warning: \"\",\n info: \"\",\n default: \"\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nconst toastIconContainerVariants = cva(\n \"size-10 rounded-lg flex items-center justify-center shrink-0\",\n {\n variants: {\n variant: {\n success: \"bg-green-50 text-green-500\",\n error: \"bg-red-50 text-red-500\",\n warning: \"bg-yellow-50 text-yellow-400\",\n info: \"\",\n default: \"bg-gray-50 text-gray-950\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nconst TOAST_ICONS = {\n success: IconCircleCheck,\n error: IconCircleX,\n warning: IconAlertCircle,\n info: IconInfoCircle,\n default: IconCircle,\n} as const\n\ninterface ToastProps extends VariantProps<typeof toastIconContainerVariants> {\n message?: React.ReactNode\n icon?: React.ReactNode\n children?: React.ReactNode\n className?: string\n toastId?: string | number\n}\n\nfunction Toast({\n variant = \"default\",\n message,\n icon,\n children,\n className,\n toastId,\n}: ToastProps) {\n const isDefaultWl = useIsDefaultWhitelabel();\n const Icon = variant ? TOAST_ICONS[variant] : null\n\n return (\n <div data-slot=\"toast\" className={cn(toastVariants({ variant }), className, \"md:min-w-[310px] lg:min-w-[310px]\")}>\n {children ? (\n children\n ) : (\n <div className=\"flex items-center gap-3 flex-1 min-w-0\">\n <div className={cn(\n toastIconContainerVariants({ variant }),\n variant === \"info\" && (isDefaultWl ? \"bg-zinc-100 text-pages-500\" : \"bg-zinc-100 text-zinc-500\")\n )}>\n {icon || (Icon && <Icon size={16} />)}\n </div>\n\n <span className=\"w-full text-gray-600 paragraph-small-medium\">\n {message}\n </span>\n <Button\n variant={\"ghost\"}\n className=\"size-8 rounded-full\"\n onClick={() => toastId && toast.dismiss(toastId)}\n >\n <IconX size={18} />\n </Button>\n </div>\n )}\n </div>\n )\n}\n\nexport { Toast, toastVariants, toastIconContainerVariants }\nexport type { ToastProps }\n"],"mappings":";AA8EQ,SAKsB,KALtB;AA3ER,SAAS,WAA8B;AACvC,SAAS,iBAAiB,aAAa,iBAAiB,gBAAgB,YAAY,aAAa;AACjG,SAAS,aAAa;AACtB,SAAS,UAAU;AACnB,SAAS,8BAA8B;AACvC,SAAS,cAAc;AAEvB,MAAM,gBAAgB;AAAA,EACpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,OAAO;AAAA,QACP,SAAS;AAAA,QACT,MAAM;AAAA,QACN,SAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,IACX;AAAA,EACF;AACF;AAEA,MAAM,6BAA6B;AAAA,EACjC;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,OAAO;AAAA,QACP,SAAS;AAAA,QACT,MAAM;AAAA,QACN,SAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,IACX;AAAA,EACF;AACF;AAEA,MAAM,cAAc;AAAA,EAClB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AACX;AAUA,SAAS,MAAM;AAAA,EACb,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAe;AACb,QAAM,cAAc,uBAAuB;AAC3C,QAAM,OAAO,UAAU,YAAY,OAAO,IAAI;AAE9C,SACE,oBAAC,SAAI,aAAU,SAAQ,WAAW,GAAG,cAAc,EAAE,QAAQ,CAAC,GAAG,WAAW,mCAAmC,GAC5G,qBACC,WAEA,qBAAC,SAAI,WAAU,0CACb;AAAA,wBAAC,SAAI,WAAW;AAAA,MACd,2BAA2B,EAAE,QAAQ,CAAC;AAAA,MACtC,YAAY,WAAW,cAAc,+BAA+B;AAAA,IACtE,GACG,kBAAS,QAAQ,oBAAC,QAAK,MAAM,IAAI,GACpC;AAAA,IAEA,oBAAC,UAAK,WAAU,+CACb,mBACH;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,SAAS;AAAA,QACT,WAAU;AAAA,QACV,SAAS,MAAM,WAAW,MAAM,QAAQ,OAAO;AAAA,QAE/C,8BAAC,SAAM,MAAM,IAAI;AAAA;AAAA,IACnB;AAAA,KACF,GAEJ;AAEJ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/form/Calendar.tsx"],"sourcesContent":["'use client';\r\n\r\n\"use client\"\r\n\r\nimport * as React from \"react\"\r\nimport { ptBR } from \"date-fns/locale\"\r\nimport {\r\n IconChevronDown,\r\n IconChevronLeft,\r\n IconChevronRight,\r\n} from \"@tabler/icons-react\"\r\nimport { DayButton, DayPicker, getDefaultClassNames } from \"react-day-picker\"\r\nimport { Button, buttonVariants } from \"../buttons/Button\"\r\nimport { cn } from \"../../../infra/utils/clsx\"\r\n\r\nfunction Calendar({\r\n className,\r\n classNames,\r\n showOutsideDays = true,\r\n captionLayout = \"label\",\r\n buttonVariant = \"ghost\",\r\n formatters,\r\n components,\r\n ...props\r\n}: React.ComponentProps<typeof DayPicker> & {\r\n buttonVariant?: React.ComponentProps<typeof Button>[\"variant\"]\r\n}) {\r\n const defaultClassNames = getDefaultClassNames()\r\n\r\n return (\r\n <DayPicker\r\n locale={ptBR}\r\n showOutsideDays={showOutsideDays}\r\n className={cn(\r\n \"bg-background group/calendar p-3 [--cell-size:--spacing(8)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent\",\r\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\r\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\r\n className\r\n )}\r\n captionLayout={captionLayout}\r\n formatters={{\r\n formatWeekdayName: (date) => {\r\n const weekdays = ['D', 'S', 'T', 'Q', 'Q', 'S', 'S'];\r\n return weekdays[date.getDay()];\r\n },\r\n formatCaption: (date) => {\r\n const month = date.toLocaleDateString('pt-BR', { month: 'long' });\r\n const year = date.getFullYear();\r\n return `${month.charAt(0).toUpperCase() + month.slice(1)} / ${year}`;\r\n },\r\n formatMonthDropdown: (date) =>\r\n date.toLocaleString(\"default\", { month: \"short\" }),\r\n ...formatters,\r\n }}\r\n classNames={{\r\n root: cn(\"w-fit\", defaultClassNames.root),\r\n months: cn(\r\n \"flex gap-4 flex-col md:flex-row relative\",\r\n defaultClassNames.months\r\n ),\r\n month: cn(\"flex flex-col w-full gap-4\", defaultClassNames.month),\r\n nav: cn(\r\n \"flex items-center gap-1 w-auto absolute top-0 right-0\",\r\n defaultClassNames.nav\r\n ),\r\n button_previous: cn(\r\n buttonVariants({ variant: buttonVariant }),\r\n \"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none\",\r\n defaultClassNames.button_previous\r\n ),\r\n button_next: cn(\r\n buttonVariants({ variant: buttonVariant }),\r\n \"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none\",\r\n defaultClassNames.button_next\r\n ),\r\n month_caption: cn(\r\n \"flex items-center justify-start h-(--cell-size) w-full pr-(--cell-size)\",\r\n defaultClassNames.month_caption\r\n ),\r\n dropdowns: cn(\r\n \"w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5\",\r\n defaultClassNames.dropdowns\r\n ),\r\n dropdown_root: cn(\r\n \"relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md\",\r\n defaultClassNames.dropdown_root\r\n ),\r\n dropdown: cn(\r\n \"absolute bg-popover inset-0 opacity-0\",\r\n defaultClassNames.dropdown\r\n ),\r\n caption_label: cn(\r\n \"select-none font-medium\",\r\n captionLayout === \"label\"\r\n ? \"text-sm\"\r\n : \"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5\",\r\n defaultClassNames.caption_label\r\n ),\r\n table: \"w-full border-collapse\",\r\n weekdays: cn(\"flex\", defaultClassNames.weekdays),\r\n weekday: cn(\r\n \"text-gray-500 font-medium text-sm w-10 h-10 flex items-center justify-center uppercase\",\r\n defaultClassNames.weekday\r\n ),\r\n week: cn(\"flex w-full mt-2\", defaultClassNames.week),\r\n week_number_header: cn(\r\n \"select-none w-(--cell-size)\",\r\n defaultClassNames.week_number_header\r\n ),\r\n week_number: cn(\r\n \"text-[0.8rem] select-none text-muted-foreground\",\r\n defaultClassNames.week_number\r\n ),\r\n day: cn(\r\n \"relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none\",\r\n props.showWeekNumber\r\n ? \"[&:nth-child(2)[data-selected=true]_button]:rounded-l-md\"\r\n : \"[&:first-child[data-selected=true]_button]:rounded-l-md\",\r\n defaultClassNames.day\r\n ),\r\n range_start: cn(\r\n \"rounded-l-md bg-accent\",\r\n defaultClassNames.range_start\r\n ),\r\n range_middle: cn(\"rounded-none\", defaultClassNames.range_middle),\r\n range_end: cn(\"rounded-r-md bg-accent\", defaultClassNames.range_end),\r\n today: cn(\r\n \"bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none\",\r\n defaultClassNames.today\r\n ),\r\n outside: cn(\r\n \"text-muted-foreground aria-selected:text-muted-foreground\",\r\n defaultClassNames.outside\r\n ),\r\n disabled: cn(\r\n \"text-muted-foreground opacity-50\",\r\n defaultClassNames.disabled\r\n ),\r\n hidden: cn(\"invisible\", defaultClassNames.hidden),\r\n ...classNames,\r\n }}\r\n components={{\r\n Root: ({ className, rootRef, ...props }) => {\r\n return (\r\n <div\r\n data-slot=\"calendar\"\r\n ref={rootRef}\r\n className={cn(className)}\r\n {...props}\r\n />\r\n )\r\n },\r\n Chevron: ({ className, orientation, ...props }) => {\r\n if (orientation === \"left\") {\r\n return (\r\n <IconChevronLeft className={cn(\"size-4\", className)} {...props} />\r\n )\r\n }\r\n\r\n if (orientation === \"right\") {\r\n return (\r\n <IconChevronRight\r\n className={cn(\"size-4\", className)}\r\n {...props}\r\n />\r\n )\r\n }\r\n\r\n return (\r\n <IconChevronDown className={cn(\"size-4\", className)} {...props} />\r\n )\r\n },\r\n DayButton: CalendarDayButton,\r\n WeekNumber: ({ children, ...props }) => {\r\n return (\r\n <td {...props}>\r\n <div className=\"flex size-(--cell-size) items-center justify-center text-center\">\r\n {children}\r\n </div>\r\n </td>\r\n )\r\n },\r\n ...components,\r\n }}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nfunction CalendarDayButton({\r\n className,\r\n day,\r\n modifiers,\r\n ...props\r\n}: React.ComponentProps<typeof DayButton>) {\r\n const defaultClassNames = getDefaultClassNames()\r\n\r\n const ref = React.useRef<HTMLButtonElement>(null)\r\n React.useEffect(() => {\r\n if (modifiers.focused) ref.current?.focus()\r\n }, [modifiers.focused])\r\n\r\n return (\r\n <Button\r\n ref={ref}\r\n variant=\"ghost\"\r\n size=\"icon\"\r\n data-day={day.date.toLocaleDateString()}\r\n data-selected-single={\r\n modifiers.selected &&\r\n !modifiers.range_start &&\r\n !modifiers.range_end &&\r\n !modifiers.range_middle\r\n }\r\n data-range-start={modifiers.range_start}\r\n data-range-end={modifiers.range_end}\r\n data-range-middle={modifiers.range_middle}\r\n className={cn(\r\n \"data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70\",\r\n defaultClassNames.day,\r\n className\r\n )}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nexport { Calendar, CalendarDayButton }\r\n"],"mappings":";AAgJY;AA5IZ,YAAY,WAAW;AACvB,SAAS,YAAY;AACrB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAoB,WAAW,4BAA4B;AAC3D,SAAS,QAAQ,sBAAsB;AACvC,SAAS,UAAU;AAEnB,SAAS,SAAS;AAAA,EAChB;AAAA,EACA;AAAA,EACA,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAEG;AACD,QAAM,oBAAoB,qBAAqB;AAE/C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,QAAQ;AAAA,MACR;AAAA,MACA,WAAW;AAAA,QACT;AAAA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GAAG,UAAUD,UAAS,GAAI,GAAGC,QAAO;AAAA,UAEpE;AAEA,cAAI,gBAAgB,SAAS;AAC3B,mBACE;AAAA,cAAC;AAAA;AAAA,gBACC,WAAW,GAAG,UAAUD,UAAS;AAAA,gBAChC,GAAGC;AAAA;AAAA,YACN;AAAA,UAEJ;AAEA,iBACE,oBAAC,mBAAgB,WAAW,GAAG,UAAUD,UAAS,GAAI,GAAGC,QAAO;AAAA,QAEpE;AAAA,QACA,WAAW;AAAA,QACX,YAAY,CAAC,EAAE,UAAU,GAAGA,OAAM,MAAM;AACtC,iBACE,oBAAC,QAAI,GAAGA,QACN,8BAAC,SAAI,WAAU,mEACZ,UACH,GACF;AAAA,QAEJ;AAAA,QACA,GAAG;AAAA,MACL;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,kBAAkB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAA2C;AACzC,QAAM,oBAAoB,qBAAqB;AAE/C,QAAM,MAAM,MAAM,OAA0B,IAAI;AAChD,QAAM,UAAU,MAAM;AACpB,QAAI,UAAU,QAAS,KAAI,SAAS,MAAM;AAAA,EAC5C,GAAG,CAAC,UAAU,OAAO,CAAC;AAEtB,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,YAAU,IAAI,KAAK,mBAAmB;AAAA,MACtC,wBACE,UAAU,YACV,CAAC,UAAU,eACX,CAAC,UAAU,aACX,CAAC,UAAU;AAAA,MAEb,oBAAkB,UAAU;AAAA,MAC5B,kBAAgB,UAAU;AAAA,MAC1B,qBAAmB,UAAU;AAAA,MAC7B,WAAW;AAAA,QACT;AAAA,QACA,kBAAkB;AAAA,QAClB;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;","names":["className","props"]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/form/Calendar.tsx"],"sourcesContent":["'use client';\n\n\"use client\"\n\nimport * as React from \"react\"\nimport { ptBR } from \"date-fns/locale\"\nimport {\n IconChevronDown,\n IconChevronLeft,\n IconChevronRight,\n} from \"@tabler/icons-react\"\nimport { DayButton, DayPicker, getDefaultClassNames } from \"react-day-picker\"\nimport { Button, buttonVariants } from \"../buttons/Button\"\nimport { cn } from \"../../../infra/utils/clsx\"\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = \"label\",\n buttonVariant = \"ghost\",\n formatters,\n components,\n ...props\n}: React.ComponentProps<typeof DayPicker> & {\n buttonVariant?: React.ComponentProps<typeof Button>[\"variant\"]\n}) {\n const defaultClassNames = getDefaultClassNames()\n\n return (\n <DayPicker\n locale={ptBR}\n showOutsideDays={showOutsideDays}\n className={cn(\n \"bg-background group/calendar p-3 [--cell-size:--spacing(8)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent\",\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className\n )}\n captionLayout={captionLayout}\n formatters={{\n formatWeekdayName: (date) => {\n const weekdays = ['D', 'S', 'T', 'Q', 'Q', 'S', 'S'];\n return weekdays[date.getDay()];\n },\n formatCaption: (date) => {\n const month = date.toLocaleDateString('pt-BR', { month: 'long' });\n const year = date.getFullYear();\n return `${month.charAt(0).toUpperCase() + month.slice(1)} / ${year}`;\n },\n formatMonthDropdown: (date) =>\n date.toLocaleString(\"default\", { month: \"short\" }),\n ...formatters,\n }}\n classNames={{\n root: cn(\"w-fit\", defaultClassNames.root),\n months: cn(\n \"flex gap-4 flex-col md:flex-row relative\",\n defaultClassNames.months\n ),\n month: cn(\"flex flex-col w-full gap-4\", defaultClassNames.month),\n nav: cn(\n \"flex items-center gap-1 w-auto absolute top-0 right-0\",\n defaultClassNames.nav\n ),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant }),\n \"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none\",\n defaultClassNames.button_previous\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant }),\n \"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none\",\n defaultClassNames.button_next\n ),\n month_caption: cn(\n \"flex items-center justify-start h-(--cell-size) w-full pr-(--cell-size)\",\n defaultClassNames.month_caption\n ),\n dropdowns: cn(\n \"w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5\",\n defaultClassNames.dropdowns\n ),\n dropdown_root: cn(\n \"relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md\",\n defaultClassNames.dropdown_root\n ),\n dropdown: cn(\n \"absolute bg-popover inset-0 opacity-0\",\n defaultClassNames.dropdown\n ),\n caption_label: cn(\n \"select-none font-medium\",\n captionLayout === \"label\"\n ? \"text-sm\"\n : \"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5\",\n defaultClassNames.caption_label\n ),\n table: \"w-full border-collapse\",\n weekdays: cn(\"flex\", defaultClassNames.weekdays),\n weekday: cn(\n \"text-gray-500 font-medium text-sm w-10 h-10 flex items-center justify-center uppercase\",\n defaultClassNames.weekday\n ),\n week: cn(\"flex w-full mt-2\", defaultClassNames.week),\n week_number_header: cn(\n \"select-none w-(--cell-size)\",\n defaultClassNames.week_number_header\n ),\n week_number: cn(\n \"text-[0.8rem] select-none text-muted-foreground\",\n defaultClassNames.week_number\n ),\n day: cn(\n \"relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none\",\n props.showWeekNumber\n ? \"[&:nth-child(2)[data-selected=true]_button]:rounded-l-md\"\n : \"[&:first-child[data-selected=true]_button]:rounded-l-md\",\n defaultClassNames.day\n ),\n range_start: cn(\n \"rounded-l-md bg-accent\",\n defaultClassNames.range_start\n ),\n range_middle: cn(\"rounded-none\", defaultClassNames.range_middle),\n range_end: cn(\"rounded-r-md bg-accent\", defaultClassNames.range_end),\n today: cn(\n \"bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none\",\n defaultClassNames.today\n ),\n outside: cn(\n \"text-muted-foreground aria-selected:text-muted-foreground\",\n defaultClassNames.outside\n ),\n disabled: cn(\n \"text-muted-foreground opacity-50\",\n defaultClassNames.disabled\n ),\n hidden: cn(\"invisible\", defaultClassNames.hidden),\n ...classNames,\n }}\n components={{\n Root: ({ className, rootRef, ...props }) => {\n return (\n <div\n data-slot=\"calendar\"\n ref={rootRef}\n className={cn(className)}\n {...props}\n />\n )\n },\n Chevron: ({ className, orientation, ...props }) => {\n if (orientation === \"left\") {\n return (\n <IconChevronLeft className={cn(\"size-4\", className)} {...props} />\n )\n }\n\n if (orientation === \"right\") {\n return (\n <IconChevronRight\n className={cn(\"size-4\", className)}\n {...props}\n />\n )\n }\n\n return (\n <IconChevronDown className={cn(\"size-4\", className)} {...props} />\n )\n },\n DayButton: CalendarDayButton,\n WeekNumber: ({ children, ...props }) => {\n return (\n <td {...props}>\n <div className=\"flex size-(--cell-size) items-center justify-center text-center\">\n {children}\n </div>\n </td>\n )\n },\n ...components,\n }}\n {...props}\n />\n )\n}\n\nfunction CalendarDayButton({\n className,\n day,\n modifiers,\n ...props\n}: React.ComponentProps<typeof DayButton>) {\n const defaultClassNames = getDefaultClassNames()\n\n const ref = React.useRef<HTMLButtonElement>(null)\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus()\n }, [modifiers.focused])\n\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"icon\"\n data-day={day.date.toLocaleDateString()}\n data-selected-single={\n modifiers.selected &&\n !modifiers.range_start &&\n !modifiers.range_end &&\n !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n className={cn(\n \"data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70\",\n defaultClassNames.day,\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Calendar, CalendarDayButton }\n"],"mappings":";AAgJY;AA5IZ,YAAY,WAAW;AACvB,SAAS,YAAY;AACrB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAoB,WAAW,4BAA4B;AAC3D,SAAS,QAAQ,sBAAsB;AACvC,SAAS,UAAU;AAEnB,SAAS,SAAS;AAAA,EAChB;AAAA,EACA;AAAA,EACA,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAEG;AACD,QAAM,oBAAoB,qBAAqB;AAE/C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,QAAQ;AAAA,MACR;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA,OAAO;AAAA,QACP,OAAO;AAAA,QACP;AAAA,MACF;AAAA,MACA;AAAA,MACA,YAAY;AAAA,QACV,mBAAmB,CAAC,SAAS;AAC3B,gBAAM,WAAW,CAAC,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,GAAG;AACnD,iBAAO,SAAS,KAAK,OAAO,CAAC;AAAA,QAC/B;AAAA,QACA,eAAe,CAAC,SAAS;AACvB,gBAAM,QAAQ,KAAK,mBAAmB,SAAS,EAAE,OAAO,OAAO,CAAC;AAChE,gBAAM,OAAO,KAAK,YAAY;AA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tC,iBACE,oBAAC,QAAI,GAAGA,QACN,8BAAC,SAAI,WAAU,mEACZ,UACH,GACF;AAAA,QAEJ;AAAA,QACA,GAAG;AAAA,MACL;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,kBAAkB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAA2C;AACzC,QAAM,oBAAoB,qBAAqB;AAE/C,QAAM,MAAM,MAAM,OAA0B,IAAI;AAChD,QAAM,UAAU,MAAM;AACpB,QAAI,UAAU,QAAS,KAAI,SAAS,MAAM;AAAA,EAC5C,GAAG,CAAC,UAAU,OAAO,CAAC;AAEtB,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,YAAU,IAAI,KAAK,mBAAmB;AAAA,MACtC,wBACE,UAAU,YACV,CAAC,UAAU,eACX,CAAC,UAAU,aACX,CAAC,UAAU;AAAA,MAEb,oBAAkB,UAAU;AAAA,MAC5B,kBAAgB,UAAU;AAAA,MAC1B,qBAAmB,UAAU;AAAA,MAC7B,WAAW;AAAA,QACT;AAAA,QACA,kBAAkB;AAAA,QAClB;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;","names":["className","props"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/form/Checkbox.tsx"],"sourcesContent":["\"use client\";\
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/form/Checkbox.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { IconCheck } from '@tabler/icons-react';\nimport { cn } from \"../../../infra/utils/clsx\";\n\nfunction Checkbox({\n className,\n ...props\n}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n \"peer border-input dark:bg-input/30 data-[state=checked]:bg-primary-hover data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary-hover data-[state=checked]:border-primary-hover focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4.5 shrink-0 rounded-[4px] border-[1.6px] shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 hover:border-gray-950 cursor-pointer\",\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none\"\n >\n <IconCheck className=\"size-3 text-current\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n"],"mappings":";AAwBQ;AArBR,YAAY,uBAAuB;AACnC,SAAS,iBAAiB;AAC1B,SAAS,UAAU;AAEnB,SAAS,SAAS;AAAA,EAChB;AAAA,EACA,GAAG;AACL,GAAwD;AACtD,SACE;AAAA,IAAC,kBAAkB;AAAA,IAAlB;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,QAAC,kBAAkB;AAAA,QAAlB;AAAA,UACC,aAAU;AAAA,UACV,WAAU;AAAA,UAEV,8BAAC,aAAU,WAAU,uBAAsB;AAAA;AAAA,MAC7C;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/form/ComboboxField.tsx"],"sourcesContent":["'use client';\
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/form/ComboboxField.tsx"],"sourcesContent":["'use client';\n\nimport { useState, useMemo } from 'react';\nimport { useTranslations } from 'next-intl';\nimport { IconCheck, IconChevronDown, IconSearch } from '@tabler/icons-react';\nimport { Popover, PopoverContent, PopoverTrigger } from '../overlay/Popover';\nimport { cn } from '../../../infra/utils/clsx';\n\nexport type ComboboxOption = {\n value: string;\n label: string;\n displayValue?: string;\n};\n\ninterface ComboboxFieldProps {\n options: ComboboxOption[];\n label?: string;\n placeholder?: string;\n searchPlaceholder?: string;\n emptyMessage?: string;\n value?: string;\n onChange?: (value: string) => void;\n disabled?: boolean;\n icon?: React.ReactNode;\n className?: string;\n containerClassName?: string;\n}\n\nexport function ComboboxField({\n options,\n label,\n placeholder,\n searchPlaceholder,\n emptyMessage,\n value,\n onChange,\n disabled = false,\n icon,\n className,\n containerClassName,\n}: ComboboxFieldProps) {\n const translate = useTranslations();\n const resolvedPlaceholder = placeholder ?? translate('common.forms.combobox.placeholder');\n const resolvedSearchPlaceholder = searchPlaceholder ?? translate('common.forms.combobox.searchPlaceholder');\n const resolvedEmptyMessage = emptyMessage ?? translate('common.forms.combobox.emptyMessage');\n const [open, setOpen] = useState(false);\n const [search, setSearch] = useState('');\n\n const selectedOption = useMemo(\n () => options.find((o) => o.value === value),\n [options, value]\n );\n\n const filteredOptions = useMemo(() => {\n const q = search.trim().toLowerCase();\n if (!q) return options;\n return options.filter((o) => o.label.toLowerCase().includes(q));\n }, [options, search]);\n\n const handleSelect = (optionValue: string) => {\n onChange?.(optionValue);\n setOpen(false);\n setSearch('');\n };\n\n return (\n <div className={cn('flex flex-col gap-1.5', containerClassName)}>\n {label && (\n <div className=\"flex items-center gap-1 paragraph-xsmall-semibold\">\n <span className=\"text-gray-600\">{label}</span>\n </div>\n )}\n\n <Popover\n open={open}\n onOpenChange={(v) => {\n if (!disabled) {\n setOpen(v);\n if (!v) setSearch('');\n }\n }}\n >\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n disabled={disabled}\n className={cn(\n 'paragraph-small-medium w-full h-10 text-gray-950 px-4 transition-colors',\n 'flex items-center justify-between gap-2 rounded-md border bg-transparent',\n 'border-gray-200 hover:border-gray-400 focus:border-gray-950 focus:outline-none',\n disabled ? 'cursor-not-allowed opacity-50' : 'cursor-pointer',\n className\n )}\n >\n <span className={cn('truncate text-left', !selectedOption && 'text-gray-400')}>\n {selectedOption\n ? (selectedOption.displayValue ?? selectedOption.label)\n : resolvedPlaceholder}\n </span>\n {icon ?? (\n <IconChevronDown\n className={cn(\n 'size-4 opacity-50 shrink-0 transition-all duration-200',\n open && 'rotate-180 opacity-100 text-gray-950'\n )}\n />\n )}\n </button>\n </PopoverTrigger>\n\n <PopoverContent\n className=\"p-0 overflow-hidden rounded-md border shadow-md\"\n align=\"start\"\n sideOffset={4}\n style={{ width: 'var(--radix-popover-trigger-width)' }}\n onWheel={(e) => e.stopPropagation()}\n >\n <div className=\"flex items-center gap-2 border-b border-gray-100 px-3 h-9\">\n <IconSearch className=\"size-4 shrink-0 opacity-50 text-gray-500\" />\n <input\n autoFocus\n placeholder={resolvedSearchPlaceholder}\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n className=\"flex h-full w-full bg-transparent text-sm outline-none placeholder:text-gray-400 paragraph-small-medium text-gray-950\"\n />\n </div>\n\n <div className=\"overflow-y-auto max-h-[280px] p-1\">\n {filteredOptions.length === 0 ? (\n <p className=\"py-6 text-center paragraph-small-medium text-gray-500\">{resolvedEmptyMessage}</p>\n ) : (\n filteredOptions.map((option) => {\n const isSelected = value === option.value;\n return (\n <div\n key={option.value}\n className={cn(\n 'flex items-center gap-2 rounded-sm px-2 h-9 cursor-pointer select-none',\n 'paragraph-small-medium text-gray-950',\n 'hover:bg-gray-100',\n isSelected && 'bg-gray-50'\n )}\n onClick={() => handleSelect(option.value)}\n >\n <span className=\"flex-1 truncate\">{option.label}</span>\n {isSelected && <IconCheck className=\"size-4 shrink-0 text-pages-600\" />}\n </div>\n );\n })\n )}\n </div>\n </PopoverContent>\n </Popover>\n </div>\n );\n}\n\nexport default ComboboxField;\n"],"mappings":";AAqEU,cAcA,YAdA;AAnEV,SAAS,UAAU,eAAe;AAClC,SAAS,uBAAuB;AAChC,SAAS,WAAW,iBAAiB,kBAAkB;AACvD,SAAS,SAAS,gBAAgB,sBAAsB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AAM;AAAA,wBAC/C,cAAc,oBAAC,aAAU,WAAU,kCAAiC;AAAA;AAAA;AAAA,oBAVhE,OAAO;AAAA,kBAWd;AAAA,gBAEJ,CAAC,GAEL;AAAA;AAAA;AAAA,UACF;AAAA;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAEA,IAAO,wBAAQ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/form/DatePicker.tsx"],"sourcesContent":["\"use client\";\
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/form/DatePicker.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, forwardRef, useEffect } from \"react\";\nimport { useTranslations } from \"next-intl\";\nimport { format } from \"date-fns\";\nimport { Calendar } from \"./Calendar\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../overlay/Popover\";\nimport { cn } from \"../../../infra/utils/clsx\";\n\n// Converte string ISO (yyyy-MM-dd) para Date no fuso horário local\n// Evita bug de timezone onde new Date(\"2025-08-02\") interpreta como UTC\nconst isoParaDataLocal = (iso: string): Date => {\n const [ano, mes, dia] = iso.split(\"-\").map(Number);\n return new Date(ano, mes - 1, dia);\n};\n\ninterface DatePickerProps {\n value?: string;\n onChange?: (date: string | undefined) => void;\n placeholder?: string;\n className?: string;\n disabled?: boolean;\n}\n\nexport const DatePicker = forwardRef<HTMLButtonElement, DatePickerProps>(\n (\n { value, onChange, placeholder, className, disabled },\n ref,\n ) => {\n const translate = useTranslations();\n const resolvedPlaceholder = placeholder ?? translate('common.forms.datePicker.placeholder');\n const [open, setOpen] = useState(false);\n const [date, setDate] = useState<Date | undefined>(() => {\n return value ? isoParaDataLocal(value) : undefined;\n });\n\n // Sincroniza estado interno quando value mudar externamente\n useEffect(() => {\n if (value) {\n setDate(isoParaDataLocal(value));\n } else {\n setDate(undefined);\n }\n }, [value]);\n\n const handleDateSelect = (selectedDate: Date | undefined) => {\n setDate(selectedDate);\n\n if (selectedDate) {\n onChange?.(format(selectedDate, \"yyyy-MM-dd\"));\n setOpen(false); // Fecha o popover após seleção\n } else {\n onChange?.(undefined);\n }\n };\n\n const displayText = date ? format(date, \"dd/MM/yyyy\") : resolvedPlaceholder;\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <button\n ref={ref}\n disabled={disabled}\n className={cn(\n \"flex items-center gap-2 px-4 h-10 border rounded-lg transition-colors w-full justify-start\",\n \"border-gray-200 hover:border-gray-400 focus-within:border-gray-950\",\n \"disabled:opacity-50 disabled:cursor-not-allowed\",\n className,\n )}\n >\n <span\n className={cn(\n \"paragraph-small-medium\",\n date ? \"text-gray-950\" : \"text-gray-500\",\n )}\n >\n {displayText}\n </span>\n </button>\n </PopoverTrigger>\n <PopoverContent\n className=\"w-auto p-0 bg-white rounded-2xl shadow-md border border-gray-200\"\n align=\"start\"\n sideOffset={8}\n >\n <div className=\"p-3\">\n <Calendar\n mode=\"single\"\n selected={date}\n onSelect={handleDateSelect}\n />\n </div>\n </PopoverContent>\n </Popover>\n );\n },\n);\n\nDatePicker.displayName = \"DatePicker\";\n"],"mappings":";AA2DM,SAYM,KAZN;AAzDN,SAAS,UAAU,YAAY,iBAAiB;AAChD,SAAS,uBAAuB;AAChC,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB,SAAS,SAAS,gBAAgB,sBAAsB;AACxD,SAAS,UAAU;AAInB,MAAM,mBAAmB,CAAC,QAAsB;AAC9C,QAAM,CAAC,KAAK,KAAK,GAAG,IAAI,IAAI,MAAM,GAAG,EAAE,IAAI,MAAM;AACjD,SAAO,IAAI,KAAK,KAAK,MAAM,GAAG,GAAG;AACnC;AAUO,MAAM,aAAa;AAAA,EACxB,CACE,EAAE,OAAO,UAAU,aAAa,WAAW,SAAS,GACpD,QACG;AACH,UAAM,YAAY,gBAAgB;AAClC,UAAM,sBAAsB,eAAe,UAAU,qCAAqC;AAC1F,UAAM,CAAC,MAAM,OAAO,IAAI,SAAS,KAAK;AACtC,UAAM,CAAC,MAAM,OAAO,IAAI,SAA2B,MAAM;AACvD,aAAO,QAAQ,iBAAiB,KAAK,IAAI;AAAA,IAC3C,CAAC;AAGD,cAAU,MAAM;AACd,UAAI,OAAO;AACT,gBAAQ,iBAAiB,KAAK,CAAC;AAAA,MACjC,OAAO;AACL,gBAAQ,MAAS;AAAA,MACnB;AAAA,IACF,GAAG,CAAC,KAAK,CAAC;AAEV,UAAM,mBAAmB,CAAC,iBAAmC;AAC3D,cAAQ,YAAY;AAEpB,UAAI,cAAc;AAChB,mBAAW,OAAO,cAAc,YAAY,CAAC;AAC7C,gBAAQ,KAAK;AAAA,MACf,OAAO;AACL,mBAAW,MAAS;AAAA,MACtB;AAAA,IACF;AAEA,UAAM,cAAc,OAAO,OAAO,MAAM,YAAY,IAAI;AAExD,WACE,qBAAC,WAAQ,MAAY,cAAc,SACjC;AAAA,0BAAC,kBAAe,SAAO,MACrB;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA,WAAW;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,UAEA;AAAA,YAAC;AAAA;AAAA,cACC,WAAW;AAAA,gBACT;AAAA,gBACA,OAAO,kBAAkB;AAAA,cAC3B;AAAA,cAEC;AAAA;AAAA,UACH;AAAA;AAAA,MACF,GACF;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,OAAM;AAAA,UACN,YAAY;AAAA,UAEZ,8BAAC,SAAI,WAAU,OACb;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,UAAU;AAAA,cACV,UAAU;AAAA;AAAA,UACZ,GACF;AAAA;AAAA,MACF;AAAA,OACF;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/form/DateRangePicker.tsx"],"sourcesContent":["\"use client\";\
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/form/DateRangePicker.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, forwardRef, useEffect } from \"react\";\nimport { useTranslations } from \"next-intl\";\nimport { format } from \"date-fns\";\nimport { IconCalendar } from '@tabler/icons-react';\nimport { DateRange } from \"react-day-picker\";\nimport { Calendar } from \"./Calendar\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../overlay/Popover\";\nimport { cn } from \"../../../infra/utils/clsx\";\n\n// Converte string ISO (yyyy-MM-dd) para Date no fuso horário local\n// Evita bug de timezone onde new Date(\"2025-08-02\") interpreta como UTC\nconst isoParaDataLocal = (iso: string): Date => {\n const [ano, mes, dia] = iso.split(\"-\").map(Number);\n return new Date(ano, mes - 1, dia);\n};\n\ninterface DateRangePickerProps {\n value?: { from: string; to: string };\n onChange?: (range: { from: string; to: string } | undefined) => void;\n placeholder?: string;\n className?: string;\n disabled?: boolean;\n}\n\nexport const DateRangePicker = forwardRef<HTMLButtonElement, DateRangePickerProps>(\n ({ value, onChange, placeholder, className, disabled }, ref) => {\n const translate = useTranslations();\n const resolvedPlaceholder = placeholder ?? translate('common.forms.dateRangePicker.placeholder');\n const [open, setOpen] = useState(false);\n const [range, setRange] = useState<DateRange | undefined>(() => {\n if (value?.from && value?.to) {\n return {\n from: isoParaDataLocal(value.from),\n to: isoParaDataLocal(value.to)\n };\n }\n return undefined;\n });\n\n useEffect(() => {\n if (value?.from && value?.to) {\n setRange({\n from: isoParaDataLocal(value.from),\n to: isoParaDataLocal(value.to)\n });\n } else {\n setRange(undefined);\n }\n }, [value]);\n\n const handleRangeSelect = (newRange: DateRange | undefined) => {\n setRange(newRange);\n\n if (newRange?.from && newRange?.to) {\n onChange?.({\n from: format(newRange.from, \"yyyy-MM-dd\"),\n to: format(newRange.to, \"yyyy-MM-dd\")\n });\n } else {\n onChange?.(undefined);\n }\n };\n\n const displayText = range?.from && range?.to\n ? `${format(range.from, \"dd/MM/yyyy\")} - ${format(range.to, \"dd/MM/yyyy\")}`\n : resolvedPlaceholder;\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <button\n ref={ref}\n disabled={disabled}\n className={cn(\n \"flex items-center gap-2 px-4 h-10 border rounded-lg transition-colors w-full justify-start\",\n \"border-gray-200 hover:border-gray-400 focus-within:border-gray-950\",\n \"disabled:opacity-50 disabled:cursor-not-allowed\",\n className\n )}\n >\n <IconCalendar size={20} className=\"text-gray-400\" />\n <span className={cn(\n \"paragraph-small-medium\",\n range?.from && range?.to ? \"text-gray-950\" : \"text-gray-500\"\n )}>\n {displayText}\n </span>\n </button>\n </PopoverTrigger>\n <PopoverContent\n className=\"w-auto p-0 bg-white rounded-2xl shadow-md border border-gray-200\"\n align=\"start\"\n sideOffset={8}\n >\n <div className=\"p-3\">\n <Calendar\n mode=\"range\"\n selected={range}\n onSelect={handleRangeSelect}\n numberOfMonths={1}\n />\n </div>\n </PopoverContent>\n </Popover>\n );\n }\n);\n\nDateRangePicker.displayName = \"DateRangePicker\";\n"],"mappings":";AAwEU,SAUE,KAVF;AAtEV,SAAS,UAAU,YAAY,iBAAiB;AAChD,SAAS,uBAAuB;AAChC,SAAS,cAAc;AACvB,SAAS,oBAAoB;AAE7B,SAAS,gBAAgB;AACzB,SAAS,SAAS,gBAAgB,sBAAsB;AACxD,SAAS,UAAU;AAInB,MAAM,mBAAmB,CAAC,QAAsB;AAC9C,QAAM,CAAC,KAAK,KAAK,GAAG,IAAI,IAAI,MAAM,GAAG,EAAE,IAAI,MAAM;AACjD,SAAO,IAAI,KAAK,KAAK,MAAM,GAAG,GAAG;AACnC;AAUO,MAAM,kBAAkB;AAAA,EAC7B,CAAC,EAAE,OAAO,UAAU,aAAa,WAAW,SAAS,GAAG,QAAQ;AAC9D,UAAM,YAAY,gBAAgB;AAClC,UAAM,sBAAsB,eAAe,UAAU,0CAA0C;AAC/F,UAAM,CAAC,MAAM,OAAO,IAAI,SAAS,KAAK;AACtC,UAAM,CAAC,OAAO,QAAQ,IAAI,SAAgC,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AA,UACC,WAAU;AAAA,UACV,OAAM;AAAA,UACN,YAAY;AAAA,UAEZ,8BAAC,SAAI,WAAU,OACb;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,UAAU;AAAA,cACV,UAAU;AAAA,cACV,gBAAgB;AAAA;AAAA,UAClB,GACF;AAAA;AAAA,MACF;AAAA,OACF;AAAA,EAEJ;AACF;AAEA,gBAAgB,cAAc;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/form/FormField.tsx"],"sourcesContent":["'use client';\
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/form/FormField.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, type ComponentPropsWithoutRef } from 'react';\nimport { IconLock, IconEye, IconEyeOff } from '@tabler/icons-react';\nimport type { TablerIcon } from '@tabler/icons-react';\nimport { Input } from './Input';\nimport { cn } from '../../../infra/utils/clsx';\n\ntype FormFieldSize = 'default' | 'large';\n\ninterface FormFieldProps extends Omit<ComponentPropsWithoutRef<'input'>, 'size'> {\n label?: string;\n optional?: boolean;\n required?: boolean;\n leftIcon?: TablerIcon;\n rightIcon?: TablerIcon;\n rightIconColor?: string;\n hintMessage?: string;\n classnameContainer?: string;\n size?: FormFieldSize;\n error?: boolean;\n errorMessage?: string;\n showCharCount?: boolean;\n showPassword?: boolean;\n onTogglePassword?: () => void;\n}\n\nexport const FormField = forwardRef<HTMLInputElement, FormFieldProps>(\n (\n {\n label,\n optional = false,\n required = false,\n leftIcon: LeftIcon,\n rightIcon: RightIcon,\n rightIconColor = 'var(--color-gray-400)',\n hintMessage,\n size = 'default',\n type = 'text',\n error = false,\n errorMessage,\n className,\n classnameContainer,\n showCharCount = false,\n showPassword = false,\n onTogglePassword,\n ...inputProps\n },\n ref\n ) => {\n const isPasswordField = type === 'password';\n const inputType = isPasswordField && showPassword ? 'text' : type;\n const containerHeight = size === 'large' ? 'h-12' : 'h-10';\n\n const FinalLeftIcon = isPasswordField ? IconLock : LeftIcon;\n const FinalRightIcon = isPasswordField ? (!showPassword ? IconEyeOff : IconEye) : RightIcon;\n\n const finalMessage = error && errorMessage ? errorMessage : hintMessage;\n const messageColor = error ? 'text-red-600' : 'text-gray-600';\n\n const currentLength = typeof inputProps.value === 'string' ? inputProps.value.length : 0;\n const shouldShowCharCount = showCharCount && inputProps.maxLength;\n\n return (\n <div className=\"flex flex-col gap-1.5 w-full\">\n <div className=\"flex items-center gap-1 paragraph-xsmall-semibold truncate\">\n {label && <span className=\"text-gray-600\">{label}</span>}\n {optional && <span className=\"text-gray-500\">(Opcional)</span>}\n {required && <span className=\"text-red-600\">*</span>}\n </div>\n\n <div\n className={cn(\n 'flex gap-2 px-4 items-center border rounded-lg transition-color',\n containerHeight,\n classnameContainer,\n error\n ? 'border-red-600 hover:border-red-700'\n : inputProps.disabled\n ? 'border-transparent'\n : 'border-gray-200 hover:border-gray-400 focus-within:border-gray-950'\n )}\n >\n {FinalLeftIcon && <FinalLeftIcon size={20} className=\"text-gray-400\" />}\n\n <Input\n ref={ref}\n type={inputType}\n className={cn(\n 'paragraph-small-medium w-full h-full text-gray-950',\n error && 'placeholder:text-red-400',\n className\n )}\n {...inputProps}\n />\n\n {FinalRightIcon && (\n <button\n type=\"button\"\n onClick={isPasswordField ? onTogglePassword : undefined}\n className={cn(\n 'flex items-center justify-center',\n isPasswordField && 'cursor-pointer hover:opacity-70 transition-opacity'\n )}\n aria-label={\n isPasswordField ? (showPassword ? 'Ocultar senha' : 'Mostrar senha') : undefined\n }\n >\n <FinalRightIcon\n size={20}\n color={isPasswordField ? 'var(--color-gray-950)' : rightIconColor}\n />\n </button>\n )}\n </div>\n\n {finalMessage && (\n <span className={cn('paragraph-xsmall-medium', messageColor)}>{finalMessage}</span>\n )}\n\n {shouldShowCharCount && (\n <span className=\"paragraph-xsmall-medium text-gray-600\">\n {currentLength}/{inputProps.maxLength}\n </span>\n )}\n </div>\n );\n }\n);\n\nFormField.displayName = 'FormField';\n\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,iBAAgB;AAAA,YAErE;AAAA,cAAC;AAAA;AAAA,gBACC;AAAA,gBACA,MAAM;AAAA,gBACN,WAAW;AAAA,kBACT;AAAA,kBACA,SAAS;AAAA,kBACT;AAAA,gBACF;AAAA,gBACC,GAAG;AAAA;AAAA,YACN;AAAA,YAEC,kBACC;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,SAAS,kBAAkB,mBAAmB;AAAA,gBAC9C,WAAW;AAAA,kBACT;AAAA,kBACA,mBAAmB;AAAA,gBACrB;AAAA,gBACA,cACE,kBAAmB,eAAe,kBAAkB,kBAAmB;AAAA,gBAGzE;AAAA,kBAAC;AAAA;AAAA,oBACC,MAAM;AAAA,oBACN,OAAO,kBAAkB,0BAA0B;AAAA;AAAA,gBACrD;AAAA;AAAA,YACF;AAAA;AAAA;AAAA,MAEJ;AAAA,MAEC,gBACC,oBAAC,UAAK,WAAW,GAAG,2BAA2B,YAAY,GAAI,wBAAa;AAAA,MAG7E,uBACC,qBAAC,UAAK,WAAU,yCACb;AAAA;AAAA,QAAc;AAAA,QAAE,WAAW;AAAA,SAC9B;AAAA,OAEJ;AAAA,EAEJ;AACF;AAEA,UAAU,cAAc;AAExB,IAAO,oBAAQ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/form/Input.tsx"],"sourcesContent":["'use client';\
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/form/Input.tsx"],"sourcesContent":["'use client';\n\nimport * as React from \"react\"\nimport { cn } from \"../../../infra/utils/clsx\"\n\nfunction Input({ className, type, ...props }: React.ComponentProps<\"input\">) {\n return (\n <input\n type={type}\n data-slot=\"input\"\n className={cn(\n \"outline-none disabled:opacity-50 disabled:placeholder:opacity-50\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Input }\n"],"mappings":";AAOI;AAJJ,SAAS,UAAU;AAEnB,SAAS,MAAM,EAAE,WAAW,MAAM,GAAG,MAAM,GAAkC;AAC3E,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/form/InputOtp.tsx"],"sourcesContent":["'use client';\
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/form/InputOtp.tsx"],"sourcesContent":["'use client';\n\n\"use client\"\n\nimport * as React from \"react\"\nimport { OTPInput, OTPInputContext } from \"input-otp\"\nimport { IconMinus } from '@tabler/icons-react'\nimport { cn } from \"../../../infra/utils/clsx\"\n\nfunction InputOTP({\n className,\n containerClassName,\n ...props\n}: React.ComponentProps<typeof OTPInput> & {\n containerClassName?: string\n}) {\n return (\n <OTPInput\n data-slot=\"input-otp\"\n containerClassName={cn(\n \"flex items-center gap-2 has-disabled:opacity-50\",\n containerClassName\n )}\n className={cn(\"disabled:cursor-not-allowed\", className)}\n {...props}\n />\n )\n}\n\nfunction InputOTPGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"input-otp-group\"\n className={cn(\"flex items-center\", className)}\n {...props}\n />\n )\n}\n\nfunction InputOTPSlot({\n index,\n className,\n ...props\n}: React.ComponentProps<\"div\"> & {\n index: number\n}) {\n const inputOTPContext = React.useContext(OTPInputContext)\n const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {}\n\n return (\n <div\n data-slot=\"input-otp-slot\"\n data-active={isActive}\n className={cn(\n \"relative flex h-9 w-9 items-center justify-center border text-sm transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md\",\n \"border-gray-200 hover:border-gray-400 data-[active=true]:border-gray-950\",\n \"data-[active=true]:z-10\",\n className\n )}\n {...props}\n >\n {char}\n {hasFakeCaret && (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"animate-caret-blink bg-foreground h-4 w-px duration-1000\" />\n </div>\n )}\n </div>\n )\n}\n\nfunction InputOTPSeparator({ ...props }: React.ComponentProps<\"div\">) {\n return (\n <div data-slot=\"input-otp-separator\" role=\"separator\" {...props}>\n <IconMinus />\n </div>\n )\n}\n\nexport { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator }\n"],"mappings":";AAiBI,cAiCA,YAjCA;AAbJ,YAAY,WAAW;AACvB,SAAS,UAAU,uBAAuB;AAC1C,SAAS,iBAAiB;AAC1B,SAAS,UAAU;AAEnB,SAAS,SAAS;AAAA,EAChB;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAEG;AACD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,oBAAoB;AAAA,QAClB;AAAA,QACA;AAAA,MACF;AAAA,MACA,WAAW,GAAG,+BAA+B,SAAS;AAAA,MACrD,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,cAAc,EAAE,WAAW,GAAG,MAAM,GAAgC;AAC3E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,qBAAqB,SAAS;AAAA,MAC3C,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,aAAa;AAAA,EACpB;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAEG;AACD,QAAM,kBAAkB,MAAM,WAAW,eAAe;AACxD,QAAM,EAAE,MAAM,cAAc,SAAS,IAAI,iBAAiB,MAAM,KAAK,KAAK,CAAC;AAE3E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,eAAa;AAAA,MACb,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,QACA,gBACC,oBAAC,SAAI,WAAU,yEACb,8BAAC,SAAI,WAAU,4DAA2D,GAC5E;AAAA;AAAA;AAAA,EAEJ;AAEJ;AAEA,SAAS,kBAAkB,EAAE,GAAG,MAAM,GAAgC;AACpE,SACE,oBAAC,SAAI,aAAU,uBAAsB,MAAK,aAAa,GAAG,OACxD,8BAAC,aAAU,GACb;AAEJ;","names":[]}
|