@greatapps/common 1.1.429 → 1.1.430
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/AccountModals.mjs +18 -0
- package/dist/components/account/AccountModals.mjs.map +1 -0
- package/dist/components/account/ConfigurationsMyAccountModal.mjs +129 -0
- package/dist/components/account/ConfigurationsMyAccountModal.mjs.map +1 -0
- package/dist/components/account/ConfirmDeleteAccountModal.mjs +45 -0
- package/dist/components/account/ConfirmDeleteAccountModal.mjs.map +1 -0
- package/dist/components/account/ConfirmGlobalPreferencesModal.mjs +45 -0
- package/dist/components/account/ConfirmGlobalPreferencesModal.mjs.map +1 -0
- package/dist/components/account/DeleteAccountModal.mjs +123 -0
- package/dist/components/account/DeleteAccountModal.mjs.map +1 -0
- package/dist/components/account/DisableTwoFactorAuthModal.mjs +67 -0
- package/dist/components/account/DisableTwoFactorAuthModal.mjs.map +1 -0
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs +42 -0
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs.map +1 -0
- package/dist/components/account/TwoFactorAuthModal.mjs +182 -0
- package/dist/components/account/TwoFactorAuthModal.mjs.map +1 -0
- package/dist/components/account/constants.mjs +29 -0
- package/dist/components/account/constants.mjs.map +1 -0
- package/dist/components/account/hooks/useChangeEmailForm.mjs +53 -0
- package/dist/components/account/hooks/useChangeEmailForm.mjs.map +1 -0
- package/dist/components/account/hooks/useChangePasswordForm.mjs +47 -0
- package/dist/components/account/hooks/useChangePasswordForm.mjs.map +1 -0
- package/dist/components/account/hooks/useChangePhoneForm.mjs +91 -0
- package/dist/components/account/hooks/useChangePhoneForm.mjs.map +1 -0
- package/dist/components/account/hooks/useConfigurationsModal.mjs +34 -0
- package/dist/components/account/hooks/useConfigurationsModal.mjs.map +1 -0
- package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs +54 -0
- package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs.map +1 -0
- package/dist/components/account/hooks/useOtpVerification.mjs +94 -0
- package/dist/components/account/hooks/useOtpVerification.mjs.map +1 -0
- package/dist/components/account/hooks/useTwoFactorAuthForm.mjs +80 -0
- package/dist/components/account/hooks/useTwoFactorAuthForm.mjs.map +1 -0
- package/dist/components/account/sections/ChangeEmailModal.mjs +181 -0
- package/dist/components/account/sections/ChangeEmailModal.mjs.map +1 -0
- package/dist/components/account/sections/ChangePasswordSection.mjs +64 -0
- package/dist/components/account/sections/ChangePasswordSection.mjs.map +1 -0
- package/dist/components/account/sections/ChangePhoneModal.mjs +192 -0
- package/dist/components/account/sections/ChangePhoneModal.mjs.map +1 -0
- package/dist/components/account/sections/MyProfileSection.mjs +317 -0
- package/dist/components/account/sections/MyProfileSection.mjs.map +1 -0
- package/dist/components/account/sections/PreferencesSection.mjs +227 -0
- package/dist/components/account/sections/PreferencesSection.mjs.map +1 -0
- package/dist/components/account/sections/SecuritySection.mjs +31 -0
- package/dist/components/account/sections/SecuritySection.mjs.map +1 -0
- package/dist/components/embeds/CrispEmbed.mjs +89 -0
- package/dist/components/embeds/CrispEmbed.mjs.map +1 -0
- package/dist/components/embeds/FrillEmbed.mjs +107 -0
- package/dist/components/embeds/FrillEmbed.mjs.map +1 -0
- package/dist/components/handlers/SearchParamsHandler.mjs +24 -0
- package/dist/components/handlers/SearchParamsHandler.mjs.map +1 -0
- package/dist/components/layouts/AppMobileNavBar.mjs +60 -0
- package/dist/components/layouts/AppMobileNavBar.mjs.map +1 -0
- package/dist/components/layouts/AppNavBar.mjs +37 -0
- package/dist/components/layouts/AppNavBar.mjs.map +1 -0
- package/dist/components/layouts/CollapsibleSidebar.mjs +65 -0
- package/dist/components/layouts/CollapsibleSidebar.mjs.map +1 -0
- package/dist/components/layouts/MainLayout.mjs +60 -0
- package/dist/components/layouts/MainLayout.mjs.map +1 -0
- package/dist/components/layouts/MdSideBarNavigation.mjs +54 -0
- package/dist/components/layouts/MdSideBarNavigation.mjs.map +1 -0
- package/dist/components/layouts/NavBar.mjs +152 -0
- package/dist/components/layouts/NavBar.mjs.map +1 -0
- package/dist/components/layouts/NavBarItem.mjs +23 -0
- package/dist/components/layouts/NavBarItem.mjs.map +1 -0
- package/dist/components/layouts/NotificationsPopover.mjs +97 -0
- package/dist/components/layouts/NotificationsPopover.mjs.map +1 -0
- package/dist/components/layouts/ProfilePopover.mjs +152 -0
- package/dist/components/layouts/ProfilePopover.mjs.map +1 -0
- package/dist/components/layouts/SideBarNavigation.mjs +63 -0
- package/dist/components/layouts/SideBarNavigation.mjs.map +1 -0
- package/dist/components/layouts/UsersSelectorPopover.mjs +210 -0
- package/dist/components/layouts/UsersSelectorPopover.mjs.map +1 -0
- package/dist/components/layouts/WhitelabelCodes.mjs +50 -0
- package/dist/components/layouts/WhitelabelCodes.mjs.map +1 -0
- package/dist/components/modals/BuyCreditsModal.mjs +281 -0
- package/dist/components/modals/BuyCreditsModal.mjs.map +1 -0
- package/dist/components/modals/ModalManager.mjs +19 -0
- package/dist/components/modals/ModalManager.mjs.map +1 -0
- package/dist/components/modals/Modals.mjs +20 -0
- package/dist/components/modals/Modals.mjs.map +1 -0
- package/dist/components/modals/PaidPlanRequiredModal.mjs +46 -0
- package/dist/components/modals/PaidPlanRequiredModal.mjs.map +1 -0
- package/dist/components/modals/cards/AddCardModal.mjs +215 -0
- package/dist/components/modals/cards/AddCardModal.mjs.map +1 -0
- package/dist/components/modals/cards/CardFormFields.mjs +268 -0
- package/dist/components/modals/cards/CardFormFields.mjs.map +1 -0
- package/dist/components/navigation/AppNavigation.mjs +33 -0
- package/dist/components/navigation/AppNavigation.mjs.map +1 -0
- package/dist/components/navigation/AppNavigationContext.mjs +13 -0
- package/dist/components/navigation/AppNavigationContext.mjs.map +1 -0
- package/dist/components/navigation/CancelledSubscriptionBanner.mjs +52 -0
- package/dist/components/navigation/CancelledSubscriptionBanner.mjs.map +1 -0
- package/dist/components/navigation/NavItem.mjs +41 -0
- package/dist/components/navigation/NavItem.mjs.map +1 -0
- package/dist/components/navigation/NavItemsContext.mjs +16 -0
- package/dist/components/navigation/NavItemsContext.mjs.map +1 -0
- package/dist/components/navigation/ProjectSelectorPopover.mjs +147 -0
- package/dist/components/navigation/ProjectSelectorPopover.mjs.map +1 -0
- package/dist/components/navigation/shells/DesktopShell.mjs +11 -0
- package/dist/components/navigation/shells/DesktopShell.mjs.map +1 -0
- package/dist/components/navigation/shells/MdShell.mjs +11 -0
- package/dist/components/navigation/shells/MdShell.mjs.map +1 -0
- package/dist/components/navigation/shells/MobileShell.mjs +27 -0
- package/dist/components/navigation/shells/MobileShell.mjs.map +1 -0
- package/dist/components/navigation/shells/TabsMobileShell.mjs +61 -0
- package/dist/components/navigation/shells/TabsMobileShell.mjs.map +1 -0
- package/dist/components/navigation/subcomponents/BottomLinks.mjs +35 -0
- package/dist/components/navigation/subcomponents/BottomLinks.mjs.map +1 -0
- package/dist/components/navigation/subcomponents/CreditsCard.mjs +33 -0
- package/dist/components/navigation/subcomponents/CreditsCard.mjs.map +1 -0
- package/dist/components/navigation/subcomponents/NavItems.mjs +25 -0
- package/dist/components/navigation/subcomponents/NavItems.mjs.map +1 -0
- package/dist/components/navigation/subcomponents/PlanCard.mjs +25 -0
- package/dist/components/navigation/subcomponents/PlanCard.mjs.map +1 -0
- package/dist/components/navigation/subcomponents/ProjectSelector.mjs +145 -0
- package/dist/components/navigation/subcomponents/ProjectSelector.mjs.map +1 -0
- package/dist/components/navigation/types.mjs +1 -0
- package/dist/components/navigation/types.mjs.map +1 -0
- package/dist/components/pages/NotFoundPage.mjs +47 -0
- package/dist/components/pages/NotFoundPage.mjs.map +1 -0
- package/dist/components/pages/notifications/Notifications.mjs +159 -0
- package/dist/components/pages/notifications/Notifications.mjs.map +1 -0
- package/dist/components/ui/buttons/Button.mjs +52 -0
- package/dist/components/ui/buttons/Button.mjs.map +1 -0
- package/dist/components/ui/buttons/CancelButton.mjs +17 -0
- package/dist/components/ui/buttons/CancelButton.mjs.map +1 -0
- package/dist/components/ui/buttons/CopyButton.mjs +42 -0
- package/dist/components/ui/buttons/CopyButton.mjs.map +1 -0
- package/dist/components/ui/data-display/Accordion.mjs +76 -0
- package/dist/components/ui/data-display/Accordion.mjs.map +1 -0
- package/dist/components/ui/data-display/Badge.mjs +42 -0
- package/dist/components/ui/data-display/Badge.mjs.map +1 -0
- package/dist/components/ui/data-display/Card.mjs +92 -0
- package/dist/components/ui/data-display/Card.mjs.map +1 -0
- package/dist/components/ui/data-display/CardBrandIcons.mjs +484 -0
- package/dist/components/ui/data-display/CardBrandIcons.mjs.map +1 -0
- package/dist/components/ui/data-display/CardItem.mjs +67 -0
- package/dist/components/ui/data-display/CardItem.mjs.map +1 -0
- package/dist/components/ui/data-display/Pagination.mjs +118 -0
- package/dist/components/ui/data-display/Pagination.mjs.map +1 -0
- package/dist/components/ui/data-display/PaymentInfoCard.mjs +161 -0
- package/dist/components/ui/data-display/PaymentInfoCard.mjs.map +1 -0
- package/dist/components/ui/data-display/ScrollArea.mjs +62 -0
- package/dist/components/ui/data-display/ScrollArea.mjs.map +1 -0
- package/dist/components/ui/data-display/Separator.mjs +28 -0
- package/dist/components/ui/data-display/Separator.mjs.map +1 -0
- package/dist/components/ui/data-display/Table.mjs +116 -0
- package/dist/components/ui/data-display/Table.mjs.map +1 -0
- package/dist/components/ui/data-display/Tabs.mjs +69 -0
- package/dist/components/ui/data-display/Tabs.mjs.map +1 -0
- package/dist/components/ui/data-display/UserAvatar.mjs +49 -0
- package/dist/components/ui/data-display/UserAvatar.mjs.map +1 -0
- package/dist/components/ui/feedback/CircularProgress.mjs +71 -0
- package/dist/components/ui/feedback/CircularProgress.mjs.map +1 -0
- package/dist/components/ui/feedback/DefaultCircularProgress.mjs +63 -0
- package/dist/components/ui/feedback/DefaultCircularProgress.mjs.map +1 -0
- package/dist/components/ui/feedback/LoadingOverlay.mjs +19 -0
- package/dist/components/ui/feedback/LoadingOverlay.mjs.map +1 -0
- package/dist/components/ui/feedback/Progress.mjs +37 -0
- package/dist/components/ui/feedback/Progress.mjs.map +1 -0
- package/dist/components/ui/feedback/Skeleton.mjs +9 -0
- package/dist/components/ui/feedback/Skeleton.mjs.map +1 -0
- package/dist/components/ui/feedback/Toast.mjs +77 -0
- package/dist/components/ui/feedback/Toast.mjs.map +1 -0
- package/dist/components/ui/form/Calendar.mjs +204 -0
- package/dist/components/ui/form/Calendar.mjs.map +1 -0
- package/dist/components/ui/form/Checkbox.mjs +33 -0
- package/dist/components/ui/form/Checkbox.mjs.map +1 -0
- package/dist/components/ui/form/ComboboxField.mjs +130 -0
- package/dist/components/ui/form/ComboboxField.mjs.map +1 -0
- package/dist/components/ui/form/DatePicker.mjs +82 -0
- package/dist/components/ui/form/DatePicker.mjs.map +1 -0
- package/dist/components/ui/form/DateRangePicker.mjs +92 -0
- package/dist/components/ui/form/DateRangePicker.mjs.map +1 -0
- package/dist/components/ui/form/FormField.mjs +103 -0
- package/dist/components/ui/form/FormField.mjs.map +1 -0
- package/dist/components/ui/form/Input.mjs +21 -0
- package/dist/components/ui/form/Input.mjs.map +1 -0
- package/dist/components/ui/form/InputOtp.mjs +70 -0
- package/dist/components/ui/form/InputOtp.mjs.map +1 -0
- package/dist/components/ui/form/PhoneInput.mjs +176 -0
- package/dist/components/ui/form/PhoneInput.mjs.map +1 -0
- package/dist/components/ui/form/RadioGroup.mjs +37 -0
- package/dist/components/ui/form/RadioGroup.mjs.map +1 -0
- package/dist/components/ui/form/Select.mjs +179 -0
- package/dist/components/ui/form/Select.mjs.map +1 -0
- package/dist/components/ui/form/SelectField.mjs +80 -0
- package/dist/components/ui/form/SelectField.mjs.map +1 -0
- package/dist/components/ui/form/Switch.mjs +33 -0
- package/dist/components/ui/form/Switch.mjs.map +1 -0
- package/dist/components/ui/form/SwitchOptionFieldWithIcon.mjs +40 -0
- package/dist/components/ui/form/SwitchOptionFieldWithIcon.mjs.map +1 -0
- package/dist/components/ui/form/TextAreaField.mjs +56 -0
- package/dist/components/ui/form/TextAreaField.mjs.map +1 -0
- package/dist/components/ui/form/Textarea.mjs +20 -0
- package/dist/components/ui/form/Textarea.mjs.map +1 -0
- package/dist/components/ui/overlay/Command.mjs +178 -0
- package/dist/components/ui/overlay/Command.mjs.map +1 -0
- package/dist/components/ui/overlay/Dialog.mjs +142 -0
- package/dist/components/ui/overlay/Dialog.mjs.map +1 -0
- package/dist/components/ui/overlay/Popover.mjs +46 -0
- package/dist/components/ui/overlay/Popover.mjs.map +1 -0
- package/dist/components/ui/overlay/Sheet.mjs +149 -0
- package/dist/components/ui/overlay/Sheet.mjs.map +1 -0
- package/dist/components/ui/overlay/Tooltip.mjs +57 -0
- package/dist/components/ui/overlay/Tooltip.mjs.map +1 -0
- package/dist/components/widgets/notifications/NotificationCard.mjs +54 -0
- package/dist/components/widgets/notifications/NotificationCard.mjs.map +1 -0
- package/dist/enums/AccountSectionType.mjs +11 -0
- package/dist/enums/AccountSectionType.mjs.map +1 -0
- package/dist/hooks/copy-to-clipboard.hook.mjs +52 -0
- package/dist/hooks/copy-to-clipboard.hook.mjs.map +1 -0
- package/dist/hooks/useCountdownTimer.mjs +29 -0
- package/dist/hooks/useCountdownTimer.mjs.map +1 -0
- package/dist/hooks/useDebounce.mjs +19 -0
- package/dist/hooks/useDebounce.mjs.map +1 -0
- package/dist/hooks/useDebounceState.mjs +12 -0
- package/dist/hooks/useDebounceState.mjs.map +1 -0
- package/dist/hooks/useDebouncedEffect.mjs +44 -0
- package/dist/hooks/useDebouncedEffect.mjs.map +1 -0
- package/dist/hooks/useIsMobile.mjs +18 -0
- package/dist/hooks/useIsMobile.mjs.map +1 -0
- package/dist/hooks/usePasswordVisibility.mjs +13 -0
- package/dist/hooks/usePasswordVisibility.mjs.map +1 -0
- package/dist/index.mjs +528 -0
- package/dist/index.mjs.map +1 -0
- package/dist/infra/api/client.mjs +162 -0
- package/dist/infra/api/client.mjs.map +1 -0
- package/dist/infra/api/types.mjs +31 -0
- package/dist/infra/api/types.mjs.map +1 -0
- package/dist/infra/utils/client-info.mjs +27 -0
- package/dist/infra/utils/client-info.mjs.map +1 -0
- package/dist/infra/utils/clsx.mjs +9 -0
- package/dist/infra/utils/clsx.mjs.map +1 -0
- package/dist/infra/utils/date.mjs +11 -0
- package/dist/infra/utils/date.mjs.map +1 -0
- package/dist/infra/utils/params.mjs +21 -0
- package/dist/infra/utils/params.mjs.map +1 -0
- package/dist/infra/utils/parser.mjs +24 -0
- package/dist/infra/utils/parser.mjs.map +1 -0
- package/dist/infra/utils/percentage.mjs +20 -0
- package/dist/infra/utils/percentage.mjs.map +1 -0
- package/dist/middleware.mjs +10 -0
- package/dist/middleware.mjs.map +1 -0
- package/dist/middlewares/chain.mjs +37 -0
- package/dist/middlewares/chain.mjs.map +1 -0
- package/dist/middlewares/create-auth-middleware.mjs +32 -0
- package/dist/middlewares/create-auth-middleware.mjs.map +1 -0
- package/dist/middlewares/types.mjs +11 -0
- package/dist/middlewares/types.mjs.map +1 -0
- package/dist/modules/accounts/actions/account-management.action.mjs +98 -0
- package/dist/modules/accounts/actions/account-management.action.mjs.map +1 -0
- package/dist/modules/accounts/actions/find-current-account.action.mjs +10 -0
- package/dist/modules/accounts/actions/find-current-account.action.mjs.map +1 -0
- package/dist/modules/accounts/actions/list-currencies.action.mjs +10 -0
- package/dist/modules/accounts/actions/list-currencies.action.mjs.map +1 -0
- package/dist/modules/accounts/actions/list-timezones.action.mjs +10 -0
- package/dist/modules/accounts/actions/list-timezones.action.mjs.map +1 -0
- package/dist/modules/accounts/hooks/current-account.hook.mjs +24 -0
- package/dist/modules/accounts/hooks/current-account.hook.mjs.map +1 -0
- package/dist/modules/accounts/hooks/useAccountManagement.mjs +71 -0
- package/dist/modules/accounts/hooks/useAccountManagement.mjs.map +1 -0
- package/dist/modules/accounts/hooks/useCurrencies.mjs +17 -0
- package/dist/modules/accounts/hooks/useCurrencies.mjs.map +1 -0
- package/dist/modules/accounts/hooks/useTimezones.mjs +17 -0
- package/dist/modules/accounts/hooks/useTimezones.mjs.map +1 -0
- package/dist/modules/accounts/hooks/useViaCep.mjs +19 -0
- package/dist/modules/accounts/hooks/useViaCep.mjs.map +1 -0
- package/dist/modules/accounts/services/account.service.mjs +182 -0
- package/dist/modules/accounts/services/account.service.mjs.map +1 -0
- package/dist/modules/accounts/services/currency.service.mjs +24 -0
- package/dist/modules/accounts/services/currency.service.mjs.map +1 -0
- package/dist/modules/accounts/services/timezone.service.mjs +65 -0
- package/dist/modules/accounts/services/timezone.service.mjs.map +1 -0
- package/dist/modules/accounts/services/two-factor.service.mjs +78 -0
- package/dist/modules/accounts/services/two-factor.service.mjs.map +1 -0
- package/dist/modules/accounts/types.mjs +1 -0
- package/dist/modules/accounts/types.mjs.map +1 -0
- package/dist/modules/auth/actions/login.action.mjs +14 -0
- package/dist/modules/auth/actions/login.action.mjs.map +1 -0
- package/dist/modules/auth/actions/logout.action.mjs +14 -0
- package/dist/modules/auth/actions/logout.action.mjs.map +1 -0
- package/dist/modules/auth/actions/register.action.mjs +14 -0
- package/dist/modules/auth/actions/register.action.mjs.map +1 -0
- package/dist/modules/auth/actions/validate-session.action.mjs +48 -0
- package/dist/modules/auth/actions/validate-session.action.mjs.map +1 -0
- package/dist/modules/auth/actions/verify-two-factor.action.mjs +17 -0
- package/dist/modules/auth/actions/verify-two-factor.action.mjs.map +1 -0
- package/dist/modules/auth/hooks/login.hook.mjs +13 -0
- package/dist/modules/auth/hooks/login.hook.mjs.map +1 -0
- package/dist/modules/auth/hooks/logout.hook.mjs +13 -0
- package/dist/modules/auth/hooks/logout.hook.mjs.map +1 -0
- package/dist/modules/auth/hooks/register.hook.mjs +13 -0
- package/dist/modules/auth/hooks/register.hook.mjs.map +1 -0
- package/dist/modules/auth/hooks/useManagementPermissions.mjs +41 -0
- package/dist/modules/auth/hooks/useManagementPermissions.mjs.map +1 -0
- package/dist/modules/auth/hooks/useUserQuery.mjs +63 -0
- package/dist/modules/auth/hooks/useUserQuery.mjs.map +1 -0
- package/dist/modules/auth/schema.mjs +1 -0
- package/dist/modules/auth/schema.mjs.map +1 -0
- package/dist/modules/auth/services/auth.service.mjs +341 -0
- package/dist/modules/auth/services/auth.service.mjs.map +1 -0
- package/dist/modules/auth/types/management-permission.type.mjs +1 -0
- package/dist/modules/auth/types/management-permission.type.mjs.map +1 -0
- package/dist/modules/auth/utils/assert-management-permission.mjs +42 -0
- package/dist/modules/auth/utils/assert-management-permission.mjs.map +1 -0
- package/dist/modules/auth/utils/assert-management-subscription.mjs +33 -0
- package/dist/modules/auth/utils/assert-management-subscription.mjs.map +1 -0
- package/dist/modules/auth/utils/assert-paid-subscription.mjs +40 -0
- package/dist/modules/auth/utils/assert-paid-subscription.mjs.map +1 -0
- package/dist/modules/auth/utils/assert-subscription-addon.mjs +35 -0
- package/dist/modules/auth/utils/assert-subscription-addon.mjs.map +1 -0
- package/dist/modules/auth/utils/build-wl-override.mjs +27 -0
- package/dist/modules/auth/utils/build-wl-override.mjs.map +1 -0
- package/dist/modules/auth/utils/get-user-context.mjs +25 -0
- package/dist/modules/auth/utils/get-user-context.mjs.map +1 -0
- package/dist/modules/cards/actions/create-card.action.mjs +10 -0
- package/dist/modules/cards/actions/create-card.action.mjs.map +1 -0
- package/dist/modules/cards/actions/list-cards.action.mjs +10 -0
- package/dist/modules/cards/actions/list-cards.action.mjs.map +1 -0
- package/dist/modules/cards/hooks/cards.hook.mjs +16 -0
- package/dist/modules/cards/hooks/cards.hook.mjs.map +1 -0
- package/dist/modules/cards/hooks/create-card.hook.mjs +18 -0
- package/dist/modules/cards/hooks/create-card.hook.mjs.map +1 -0
- package/dist/modules/cards/services/cards.service.mjs +44 -0
- package/dist/modules/cards/services/cards.service.mjs.map +1 -0
- package/dist/modules/cards/types.mjs +27 -0
- package/dist/modules/cards/types.mjs.map +1 -0
- package/dist/modules/ia-credits/actions/list-ia-credits.action.mjs +10 -0
- package/dist/modules/ia-credits/actions/list-ia-credits.action.mjs.map +1 -0
- package/dist/modules/ia-credits/hooks/ia-credits.hook.mjs +76 -0
- package/dist/modules/ia-credits/hooks/ia-credits.hook.mjs.map +1 -0
- package/dist/modules/ia-credits/services/ia-credits.service.mjs +31 -0
- package/dist/modules/ia-credits/services/ia-credits.service.mjs.map +1 -0
- package/dist/modules/ia-credits/types.mjs +25 -0
- package/dist/modules/ia-credits/types.mjs.map +1 -0
- package/dist/modules/plans/actions/find-plan-by-id.action.mjs +10 -0
- package/dist/modules/plans/actions/find-plan-by-id.action.mjs.map +1 -0
- package/dist/modules/plans/hooks/use-has-plan-addon.hook.mjs +13 -0
- package/dist/modules/plans/hooks/use-has-plan-addon.hook.mjs.map +1 -0
- package/dist/modules/plans/hooks/use-plan-by-id.hook.mjs +15 -0
- package/dist/modules/plans/hooks/use-plan-by-id.hook.mjs.map +1 -0
- package/dist/modules/plans/services/plans.service.mjs +34 -0
- package/dist/modules/plans/services/plans.service.mjs.map +1 -0
- package/dist/modules/plans/types/plan.type.mjs +20 -0
- package/dist/modules/plans/types/plan.type.mjs.map +1 -0
- package/dist/modules/projects/actions/add-project-user.action.mjs +10 -0
- package/dist/modules/projects/actions/add-project-user.action.mjs.map +1 -0
- package/dist/modules/projects/actions/list-all-account-users.action.mjs +10 -0
- package/dist/modules/projects/actions/list-all-account-users.action.mjs.map +1 -0
- package/dist/modules/projects/actions/list-available-users.action.mjs +10 -0
- package/dist/modules/projects/actions/list-available-users.action.mjs.map +1 -0
- package/dist/modules/projects/actions/list-project-users.action.mjs +10 -0
- package/dist/modules/projects/actions/list-project-users.action.mjs.map +1 -0
- package/dist/modules/projects/actions/remove-project-user.action.mjs +10 -0
- package/dist/modules/projects/actions/remove-project-user.action.mjs.map +1 -0
- package/dist/modules/projects/hooks/add-project-user.hook.mjs +61 -0
- package/dist/modules/projects/hooks/add-project-user.hook.mjs.map +1 -0
- package/dist/modules/projects/hooks/list-all-account-users.hook.mjs +35 -0
- package/dist/modules/projects/hooks/list-all-account-users.hook.mjs.map +1 -0
- package/dist/modules/projects/hooks/list-available-users.hook.mjs +34 -0
- package/dist/modules/projects/hooks/list-available-users.hook.mjs.map +1 -0
- package/dist/modules/projects/hooks/list-project-users.hook.mjs +34 -0
- package/dist/modules/projects/hooks/list-project-users.hook.mjs.map +1 -0
- package/dist/modules/projects/hooks/remove-project-user.hook.mjs +61 -0
- package/dist/modules/projects/hooks/remove-project-user.hook.mjs.map +1 -0
- package/dist/modules/projects/services/project-users.service.mjs +96 -0
- package/dist/modules/projects/services/project-users.service.mjs.map +1 -0
- package/dist/modules/projects/types.mjs +23 -0
- package/dist/modules/projects/types.mjs.map +1 -0
- package/dist/modules/subscriptions/actions/calculate-subscription.action.mjs +10 -0
- package/dist/modules/subscriptions/actions/calculate-subscription.action.mjs.map +1 -0
- package/dist/modules/subscriptions/actions/list-subscriptions.action.mjs +10 -0
- package/dist/modules/subscriptions/actions/list-subscriptions.action.mjs.map +1 -0
- package/dist/modules/subscriptions/actions/update-subscription-plan.action.mjs +12 -0
- package/dist/modules/subscriptions/actions/update-subscription-plan.action.mjs.map +1 -0
- package/dist/modules/subscriptions/constants/addons.constants.mjs +24 -0
- package/dist/modules/subscriptions/constants/addons.constants.mjs.map +1 -0
- package/dist/modules/subscriptions/constants/query-keys.constants.mjs +5 -0
- package/dist/modules/subscriptions/constants/query-keys.constants.mjs.map +1 -0
- package/dist/modules/subscriptions/hooks/calculate-subscription.hook.mjs +13 -0
- package/dist/modules/subscriptions/hooks/calculate-subscription.hook.mjs.map +1 -0
- package/dist/modules/subscriptions/hooks/find-active-subscription.hook.mjs +17 -0
- package/dist/modules/subscriptions/hooks/find-active-subscription.hook.mjs.map +1 -0
- package/dist/modules/subscriptions/hooks/list-subscriptions.hook.mjs +17 -0
- package/dist/modules/subscriptions/hooks/list-subscriptions.hook.mjs.map +1 -0
- package/dist/modules/subscriptions/hooks/update-subscription-plan.hook.mjs +22 -0
- package/dist/modules/subscriptions/hooks/update-subscription-plan.hook.mjs.map +1 -0
- package/dist/modules/subscriptions/hooks/use-cancelled-subscription-guard.mjs +37 -0
- package/dist/modules/subscriptions/hooks/use-cancelled-subscription-guard.mjs.map +1 -0
- package/dist/modules/subscriptions/services/subscriptions.service.mjs +75 -0
- package/dist/modules/subscriptions/services/subscriptions.service.mjs.map +1 -0
- package/dist/modules/subscriptions/types/billing-period.type.mjs +1 -0
- package/dist/modules/subscriptions/types/billing-period.type.mjs.map +1 -0
- package/dist/modules/subscriptions/types/calculate-subscription.type.mjs +72 -0
- package/dist/modules/subscriptions/types/calculate-subscription.type.mjs.map +1 -0
- package/dist/modules/subscriptions/types/subscription.type.mjs +57 -0
- package/dist/modules/subscriptions/types/subscription.type.mjs.map +1 -0
- package/dist/modules/subscriptions/utils/build-plan-extras.mjs +37 -0
- package/dist/modules/subscriptions/utils/build-plan-extras.mjs.map +1 -0
- package/dist/modules/subscriptions/utils/has-subscription-expired.mjs +10 -0
- package/dist/modules/subscriptions/utils/has-subscription-expired.mjs.map +1 -0
- package/dist/modules/subscriptions/utils/periodicity.mjs +48 -0
- package/dist/modules/subscriptions/utils/periodicity.mjs.map +1 -0
- package/dist/modules/subscriptions/utils/resolve-plan-extras-prices.mjs +14 -0
- package/dist/modules/subscriptions/utils/resolve-plan-extras-prices.mjs.map +1 -0
- package/dist/modules/users/action/find-user-by-id.action.mjs +10 -0
- package/dist/modules/users/action/find-user-by-id.action.mjs.map +1 -0
- package/dist/modules/users/action/list-messages.action.mjs +13 -0
- package/dist/modules/users/action/list-messages.action.mjs.map +1 -0
- package/dist/modules/users/action/mark-all-messages-as-read.action.mjs +10 -0
- package/dist/modules/users/action/mark-all-messages-as-read.action.mjs.map +1 -0
- package/dist/modules/users/action/mark-message-as-read.action.mjs +10 -0
- package/dist/modules/users/action/mark-message-as-read.action.mjs.map +1 -0
- package/dist/modules/users/hooks/messages.hook.mjs +57 -0
- package/dist/modules/users/hooks/messages.hook.mjs.map +1 -0
- package/dist/modules/users/schema/messages.schema.mjs +21 -0
- package/dist/modules/users/schema/messages.schema.mjs.map +1 -0
- package/dist/modules/users/schema.mjs +11 -0
- package/dist/modules/users/schema.mjs.map +1 -0
- package/dist/modules/users/services/messages.service.mjs +35 -0
- package/dist/modules/users/services/messages.service.mjs.map +1 -0
- package/dist/modules/users/services/user.service.mjs +52 -0
- package/dist/modules/users/services/user.service.mjs.map +1 -0
- package/dist/modules/whitelabel/actions/find-whitelabel.action.mjs +21 -0
- package/dist/modules/whitelabel/actions/find-whitelabel.action.mjs.map +1 -0
- package/dist/modules/whitelabel/actions/revalidate-whitelabel.action.mjs +19 -0
- package/dist/modules/whitelabel/actions/revalidate-whitelabel.action.mjs.map +1 -0
- package/dist/modules/whitelabel/schema.mjs +1 -0
- package/dist/modules/whitelabel/schema.mjs.map +1 -0
- package/dist/modules/whitelabel/services/whitelabel.service.mjs +146 -0
- package/dist/modules/whitelabel/services/whitelabel.service.mjs.map +1 -0
- package/dist/modules/whitelabel/utils/normalize-hostname.mjs +35 -0
- package/dist/modules/whitelabel/utils/normalize-hostname.mjs.map +1 -0
- package/dist/providers/auth.provider.mjs +114 -0
- package/dist/providers/auth.provider.mjs.map +1 -0
- package/dist/providers/query.provider.mjs +99 -0
- package/dist/providers/query.provider.mjs.map +1 -0
- package/dist/providers/whitelabel.provider.mjs +42 -0
- package/dist/providers/whitelabel.provider.mjs.map +1 -0
- package/dist/server.mjs +111 -0
- package/dist/server.mjs.map +1 -0
- package/dist/store/useAccountModals.mjs +18 -0
- package/dist/store/useAccountModals.mjs.map +1 -0
- package/dist/store/useBuyCreditsModal.mjs +16 -0
- package/dist/store/useBuyCreditsModal.mjs.map +1 -0
- package/dist/store/useDesktopSidebarStore.mjs +39 -0
- package/dist/store/useDesktopSidebarStore.mjs.map +1 -0
- package/dist/store/useMdSidebarStore.mjs +28 -0
- package/dist/store/useMdSidebarStore.mjs.map +1 -0
- package/dist/store/useMobileNavbarSheet.mjs +14 -0
- package/dist/store/useMobileNavbarSheet.mjs.map +1 -0
- package/dist/store/useModalManager.mjs +75 -0
- package/dist/store/useModalManager.mjs.map +1 -0
- package/dist/store/usePaidPlanRequiredModal.mjs +14 -0
- package/dist/store/usePaidPlanRequiredModal.mjs.map +1 -0
- package/dist/utils/browser/clipboard.mjs +36 -0
- package/dist/utils/browser/clipboard.mjs.map +1 -0
- package/dist/utils/constants/br-states.mjs +33 -0
- package/dist/utils/constants/br-states.mjs.map +1 -0
- package/dist/utils/countries.mjs +219 -0
- package/dist/utils/countries.mjs.map +1 -0
- package/dist/utils/file/index.mjs +9 -0
- package/dist/utils/file/index.mjs.map +1 -0
- package/dist/utils/format/masks.mjs +67 -0
- package/dist/utils/format/masks.mjs.map +1 -0
- package/dist/utils/intl/locales.mjs +12 -0
- package/dist/utils/intl/locales.mjs.map +1 -0
- package/dist/utils/safeServerAction.mjs +16 -0
- package/dist/utils/safeServerAction.mjs.map +1 -0
- package/dist/utils/validators/account.mjs +27 -0
- package/dist/utils/validators/account.mjs.map +1 -0
- package/dist/utils/validators/common.mjs +47 -0
- package/dist/utils/validators/common.mjs.map +1 -0
- package/dist/utils/withAction.mjs +13 -0
- package/dist/utils/withAction.mjs.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { IconLock, IconEye, IconEyeOff } from "@tabler/icons-react";
|
|
5
|
+
import { Input } from "./Input";
|
|
6
|
+
import { cn } from "../../../infra/utils/clsx";
|
|
7
|
+
const FormField = forwardRef(
|
|
8
|
+
({
|
|
9
|
+
label,
|
|
10
|
+
optional = false,
|
|
11
|
+
required = false,
|
|
12
|
+
leftIcon: LeftIcon,
|
|
13
|
+
rightIcon: RightIcon,
|
|
14
|
+
rightIconColor = "var(--color-gray-400)",
|
|
15
|
+
hintMessage,
|
|
16
|
+
size = "default",
|
|
17
|
+
type = "text",
|
|
18
|
+
error = false,
|
|
19
|
+
errorMessage,
|
|
20
|
+
className,
|
|
21
|
+
classnameContainer,
|
|
22
|
+
showCharCount = false,
|
|
23
|
+
showPassword = false,
|
|
24
|
+
onTogglePassword,
|
|
25
|
+
...inputProps
|
|
26
|
+
}, ref) => {
|
|
27
|
+
const isPasswordField = type === "password";
|
|
28
|
+
const inputType = isPasswordField && showPassword ? "text" : type;
|
|
29
|
+
const containerHeight = size === "large" ? "h-12" : "h-10";
|
|
30
|
+
const FinalLeftIcon = isPasswordField ? IconLock : LeftIcon;
|
|
31
|
+
const FinalRightIcon = isPasswordField ? !showPassword ? IconEyeOff : IconEye : RightIcon;
|
|
32
|
+
const finalMessage = error && errorMessage ? errorMessage : hintMessage;
|
|
33
|
+
const messageColor = error ? "text-red-600" : "text-gray-600";
|
|
34
|
+
const currentLength = typeof inputProps.value === "string" ? inputProps.value.length : 0;
|
|
35
|
+
const shouldShowCharCount = showCharCount && inputProps.maxLength;
|
|
36
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5 w-full", children: [
|
|
37
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 paragraph-xsmall-semibold truncate", children: [
|
|
38
|
+
label && /* @__PURE__ */ jsx("span", { className: "text-gray-600", children: label }),
|
|
39
|
+
optional && /* @__PURE__ */ jsx("span", { className: "text-gray-500", children: "(Opcional)" }),
|
|
40
|
+
required && /* @__PURE__ */ jsx("span", { className: "text-red-600", children: "*" })
|
|
41
|
+
] }),
|
|
42
|
+
/* @__PURE__ */ jsxs(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
className: cn(
|
|
46
|
+
"flex gap-2 px-4 items-center border rounded-lg transition-color",
|
|
47
|
+
containerHeight,
|
|
48
|
+
classnameContainer,
|
|
49
|
+
error ? "border-red-600 hover:border-red-700" : "border-gray-200 hover:border-gray-400 focus-within:border-gray-950"
|
|
50
|
+
),
|
|
51
|
+
children: [
|
|
52
|
+
FinalLeftIcon && /* @__PURE__ */ jsx(FinalLeftIcon, { size: 20, className: "text-gray-400" }),
|
|
53
|
+
/* @__PURE__ */ jsx(
|
|
54
|
+
Input,
|
|
55
|
+
{
|
|
56
|
+
ref,
|
|
57
|
+
type: inputType,
|
|
58
|
+
className: cn(
|
|
59
|
+
"paragraph-small-medium w-full h-full text-gray-950",
|
|
60
|
+
error && "placeholder:text-red-400",
|
|
61
|
+
className
|
|
62
|
+
),
|
|
63
|
+
...inputProps
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
FinalRightIcon && /* @__PURE__ */ jsx(
|
|
67
|
+
"button",
|
|
68
|
+
{
|
|
69
|
+
type: "button",
|
|
70
|
+
onClick: isPasswordField ? onTogglePassword : void 0,
|
|
71
|
+
className: cn(
|
|
72
|
+
"flex items-center justify-center",
|
|
73
|
+
isPasswordField && "cursor-pointer hover:opacity-70 transition-opacity"
|
|
74
|
+
),
|
|
75
|
+
"aria-label": isPasswordField ? showPassword ? "Ocultar senha" : "Mostrar senha" : void 0,
|
|
76
|
+
children: /* @__PURE__ */ jsx(
|
|
77
|
+
FinalRightIcon,
|
|
78
|
+
{
|
|
79
|
+
size: 20,
|
|
80
|
+
color: isPasswordField ? "var(--color-gray-950)" : rightIconColor
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
finalMessage && /* @__PURE__ */ jsx("span", { className: cn("paragraph-xsmall-medium", messageColor), children: finalMessage }),
|
|
89
|
+
shouldShowCharCount && /* @__PURE__ */ jsxs("span", { className: "paragraph-xsmall-medium text-gray-600", children: [
|
|
90
|
+
currentLength,
|
|
91
|
+
"/",
|
|
92
|
+
inputProps.maxLength
|
|
93
|
+
] })
|
|
94
|
+
] });
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
FormField.displayName = "FormField";
|
|
98
|
+
var FormField_default = FormField;
|
|
99
|
+
export {
|
|
100
|
+
FormField,
|
|
101
|
+
FormField_default as default
|
|
102
|
+
};
|
|
103
|
+
//# sourceMappingURL=FormField.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
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 : '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\nexport default FormField;\n"],"mappings":";AAiEQ,SACY,KADZ;AA/DR,SAAS,kBAAiD;AAC1D,SAAS,UAAU,SAAS,kBAAkB;AAE9C,SAAS,aAAa;AACtB,SAAS,UAAU;AAqBZ,MAAM,YAAY;AAAA,EACvB,CACE;AAAA,IACE;AAAA,IACA,WAAW;AAAA,IACX,WAAW;AAAA,IACX,UAAU;AAAA,IACV,WAAW;AAAA,IACX,iBAAiB;AAAA,IACjB;AAAA,IACA,OAAO;AAAA,IACP,OAAO;AAAA,IACP,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB,eAAe;AAAA,IACf;AAAA,IACA,GAAG;AAAA,EACL,GACA,QACG;AACH,UAAM,kBAAkB,SAAS;AACjC,UAAM,YAAY,mBAAmB,eAAe,SAAS;AAC7D,UAAM,kBAAkB,SAAS,UAAU,SAAS;AAEpD,UAAM,gBAAgB,kBAAkB,WAAW;AACnD,UAAM,iBAAiB,kBAAmB,CAAC,eAAe,aAAa,UAAW;AAElF,UAAM,eAAe,SAAS,eAAe,eAAe;AAC5D,UAAM,eAAe,QAAQ,iBAAiB;AAE9C,UAAM,gBAAgB,OAAO,WAAW,UAAU,WAAW,WAAW,MAAM,SAAS;AACvF,UAAM,sBAAsB,iBAAiB,WAAW;AAExD,WACE,qBAAC,SAAI,WAAU,gCACb;AAAA,2BAAC,SAAI,WAAU,8DACZ;AAAA,iBAAS,oBAAC,UAAK,WAAU,iBAAiB,iBAAM;AAAA,QAChD,YAAY,oBAAC,UAAK,WAAU,iBAAgB,wBAAU;AAAA,QACtD,YAAY,oBAAC,UAAK,WAAU,gBAAe,eAAC;AAAA,SAC/C;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,WAAW;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,YACA,QACI,wCACA;AAAA,UACN;AAAA,UAEC;AAAA,6BAAiB,oBAAC,iBAAc,MAAM,IAAI,WAAU,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":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../../../infra/utils/clsx";
|
|
4
|
+
function Input({ className, type, ...props }) {
|
|
5
|
+
return /* @__PURE__ */ jsx(
|
|
6
|
+
"input",
|
|
7
|
+
{
|
|
8
|
+
type,
|
|
9
|
+
"data-slot": "input",
|
|
10
|
+
className: cn(
|
|
11
|
+
"outline-none disabled:opacity-50 disabled:placeholder:opacity-50",
|
|
12
|
+
className
|
|
13
|
+
),
|
|
14
|
+
...props
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
Input
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=Input.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
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":[]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { OTPInput, OTPInputContext } from "input-otp";
|
|
5
|
+
import { IconMinus } from "@tabler/icons-react";
|
|
6
|
+
import { cn } from "../../../infra/utils/clsx";
|
|
7
|
+
function InputOTP({
|
|
8
|
+
className,
|
|
9
|
+
containerClassName,
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
OTPInput,
|
|
14
|
+
{
|
|
15
|
+
"data-slot": "input-otp",
|
|
16
|
+
containerClassName: cn(
|
|
17
|
+
"flex items-center gap-2 has-disabled:opacity-50",
|
|
18
|
+
containerClassName
|
|
19
|
+
),
|
|
20
|
+
className: cn("disabled:cursor-not-allowed", className),
|
|
21
|
+
...props
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
function InputOTPGroup({ className, ...props }) {
|
|
26
|
+
return /* @__PURE__ */ jsx(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
"data-slot": "input-otp-group",
|
|
30
|
+
className: cn("flex items-center", className),
|
|
31
|
+
...props
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
function InputOTPSlot({
|
|
36
|
+
index,
|
|
37
|
+
className,
|
|
38
|
+
...props
|
|
39
|
+
}) {
|
|
40
|
+
const inputOTPContext = React.useContext(OTPInputContext);
|
|
41
|
+
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
|
|
42
|
+
return /* @__PURE__ */ jsxs(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
"data-slot": "input-otp-slot",
|
|
46
|
+
"data-active": isActive,
|
|
47
|
+
className: cn(
|
|
48
|
+
"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",
|
|
49
|
+
"border-gray-200 hover:border-gray-400 data-[active=true]:border-gray-950",
|
|
50
|
+
"data-[active=true]:z-10",
|
|
51
|
+
className
|
|
52
|
+
),
|
|
53
|
+
...props,
|
|
54
|
+
children: [
|
|
55
|
+
char,
|
|
56
|
+
hasFakeCaret && /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "animate-caret-blink bg-foreground h-4 w-px duration-1000" }) })
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
function InputOTPSeparator({ ...props }) {
|
|
62
|
+
return /* @__PURE__ */ jsx("div", { "data-slot": "input-otp-separator", role: "separator", ...props, children: /* @__PURE__ */ jsx(IconMinus, {}) });
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
InputOTP,
|
|
66
|
+
InputOTPGroup,
|
|
67
|
+
InputOTPSeparator,
|
|
68
|
+
InputOTPSlot
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=InputOtp.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
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":[]}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState, useEffect, useRef } from "react";
|
|
4
|
+
import { AsYouType } from "libphonenumber-js";
|
|
5
|
+
import { Input, Separator, Popover, PopoverTrigger, PopoverContent, cn } from "@greatapps/common";
|
|
6
|
+
import { IconChevronDown, IconSearch } from "@tabler/icons-react";
|
|
7
|
+
import { COUNTRIES, flagUrl, parsePhoneValue } from "../../../utils/countries";
|
|
8
|
+
function formatNational(digits, iso) {
|
|
9
|
+
const raw = digits.replace(/\D/g, "");
|
|
10
|
+
if (!raw) return "";
|
|
11
|
+
return new AsYouType(iso).input(raw);
|
|
12
|
+
}
|
|
13
|
+
function PhoneInput({
|
|
14
|
+
value,
|
|
15
|
+
onChange,
|
|
16
|
+
label,
|
|
17
|
+
optional = false,
|
|
18
|
+
required = false,
|
|
19
|
+
hintMessage,
|
|
20
|
+
error = false,
|
|
21
|
+
errorMessage,
|
|
22
|
+
placeholder,
|
|
23
|
+
disabled = false,
|
|
24
|
+
classnameContainer,
|
|
25
|
+
className
|
|
26
|
+
}) {
|
|
27
|
+
const parsed = parsePhoneValue(value ?? "");
|
|
28
|
+
const [selectedCountry, setSelectedCountry] = useState(parsed.country);
|
|
29
|
+
const [phoneNumber, setPhoneNumber] = useState(parsed.number);
|
|
30
|
+
const [search, setSearch] = useState("");
|
|
31
|
+
const [open, setOpen] = useState(false);
|
|
32
|
+
const prevValueRef = useRef(value);
|
|
33
|
+
const inputRef = useRef(null);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (value !== prevValueRef.current) {
|
|
36
|
+
prevValueRef.current = value;
|
|
37
|
+
const p = parsePhoneValue(value ?? "");
|
|
38
|
+
setSelectedCountry(p.country);
|
|
39
|
+
setPhoneNumber(formatNational(p.number, p.country.iso));
|
|
40
|
+
}
|
|
41
|
+
}, [value]);
|
|
42
|
+
const emit = (country, number) => {
|
|
43
|
+
onChange?.(`${country.dial} ${number}`);
|
|
44
|
+
};
|
|
45
|
+
const handleCountrySelect = (country) => {
|
|
46
|
+
const reformatted = formatNational(phoneNumber, country.iso);
|
|
47
|
+
setSelectedCountry(country);
|
|
48
|
+
setPhoneNumber(reformatted);
|
|
49
|
+
setOpen(false);
|
|
50
|
+
setSearch("");
|
|
51
|
+
emit(country, reformatted);
|
|
52
|
+
};
|
|
53
|
+
const handleNumberChange = (e) => {
|
|
54
|
+
const rawInput = e.target.value;
|
|
55
|
+
const digits = rawInput.replace(/\D/g, "");
|
|
56
|
+
if (digits.length > 15) return;
|
|
57
|
+
const cursorPos = e.target.selectionStart ?? rawInput.length;
|
|
58
|
+
const digitsBeforeCursor = rawInput.slice(0, cursorPos).replace(/\D/g, "").length;
|
|
59
|
+
const formatted = formatNational(rawInput, selectedCountry.iso);
|
|
60
|
+
setPhoneNumber(formatted);
|
|
61
|
+
emit(selectedCountry, formatted);
|
|
62
|
+
requestAnimationFrame(() => {
|
|
63
|
+
if (!inputRef.current) return;
|
|
64
|
+
let digitCount = 0;
|
|
65
|
+
let newPos = formatted.length;
|
|
66
|
+
for (let i = 0; i < formatted.length; i++) {
|
|
67
|
+
if (/\d/.test(formatted[i])) {
|
|
68
|
+
digitCount++;
|
|
69
|
+
if (digitCount === digitsBeforeCursor) {
|
|
70
|
+
newPos = i + 1;
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
inputRef.current.setSelectionRange(newPos, newPos);
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
const filtered = COUNTRIES.filter(
|
|
79
|
+
(c) => c.name.toLowerCase().includes(search.toLowerCase()) || c.dial.includes(search) || c.iso.toLowerCase().includes(search.toLowerCase())
|
|
80
|
+
);
|
|
81
|
+
const finalMessage = error && errorMessage ? errorMessage : hintMessage;
|
|
82
|
+
const showMessage = finalMessage && finalMessage.trim() !== "";
|
|
83
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
84
|
+
label && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 paragraph-xsmall-semibold", children: [
|
|
85
|
+
/* @__PURE__ */ jsx("span", { className: "text-zinc-600", children: label }),
|
|
86
|
+
optional && /* @__PURE__ */ jsx("span", { className: "text-zinc-500", children: "(Opcional)" }),
|
|
87
|
+
required && /* @__PURE__ */ jsx("span", { className: "text-red-600", children: "*" })
|
|
88
|
+
] }),
|
|
89
|
+
/* @__PURE__ */ jsxs(
|
|
90
|
+
"div",
|
|
91
|
+
{
|
|
92
|
+
className: cn(
|
|
93
|
+
"flex gap-2 items-center border rounded-lg h-10 transition-colors",
|
|
94
|
+
error ? "border-red-600 hover:border-red-700" : "border-zinc-200 hover:border-zinc-400 focus-within:border-zinc-950",
|
|
95
|
+
disabled && "cursor-not-allowed",
|
|
96
|
+
classnameContainer
|
|
97
|
+
),
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
100
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
101
|
+
"button",
|
|
102
|
+
{
|
|
103
|
+
type: "button",
|
|
104
|
+
className: "flex items-center gap-1.5 px-3 h-full shrink-0 focus:outline-none",
|
|
105
|
+
disabled,
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ jsx("img", { src: flagUrl(selectedCountry.iso), alt: selectedCountry.iso, className: "w-5 h-5 rounded-full" }),
|
|
108
|
+
/* @__PURE__ */ jsx("span", { className: "paragraph-small-regular text-zinc-950", children: selectedCountry.dial }),
|
|
109
|
+
/* @__PURE__ */ jsx(IconChevronDown, { size: 14, className: cn("text-zinc-500 transition-transform duration-200", open && "rotate-180") })
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
) }),
|
|
113
|
+
/* @__PURE__ */ jsxs(PopoverContent, { className: "w-72 p-0 z-[1010]", align: "start", side: "top", children: [
|
|
114
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 p-2 border-b border-zinc-100", children: [
|
|
115
|
+
/* @__PURE__ */ jsx(IconSearch, { size: 14, className: "text-zinc-400 shrink-0" }),
|
|
116
|
+
/* @__PURE__ */ jsx(
|
|
117
|
+
"input",
|
|
118
|
+
{
|
|
119
|
+
type: "text",
|
|
120
|
+
className: "flex-1 text-sm outline-none placeholder:text-zinc-400",
|
|
121
|
+
placeholder: "Buscar pa\xEDs...",
|
|
122
|
+
value: search,
|
|
123
|
+
onChange: (e) => setSearch(e.target.value),
|
|
124
|
+
autoFocus: true
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
] }),
|
|
128
|
+
/* @__PURE__ */ jsxs("div", { className: "max-h-60 overflow-y-auto overscroll-contain", onTouchMove: (e) => e.stopPropagation(), onWheel: (e) => e.stopPropagation(), children: [
|
|
129
|
+
filtered.map((country) => /* @__PURE__ */ jsxs(
|
|
130
|
+
"button",
|
|
131
|
+
{
|
|
132
|
+
type: "button",
|
|
133
|
+
className: cn(
|
|
134
|
+
"flex items-center gap-2.5 w-full px-3 py-2 text-left hover:bg-zinc-50 transition-colors",
|
|
135
|
+
selectedCountry.iso === country.iso && "bg-zinc-100"
|
|
136
|
+
),
|
|
137
|
+
onClick: () => handleCountrySelect(country),
|
|
138
|
+
children: [
|
|
139
|
+
/* @__PURE__ */ jsx("img", { src: flagUrl(country.iso), alt: country.iso, className: "w-5 h-5 rounded-full shrink-0" }),
|
|
140
|
+
/* @__PURE__ */ jsx("span", { className: "paragraph-small-regular text-zinc-950 flex-1 truncate", children: country.name }),
|
|
141
|
+
/* @__PURE__ */ jsx("span", { className: "paragraph-small-regular text-zinc-500 shrink-0", children: country.dial })
|
|
142
|
+
]
|
|
143
|
+
},
|
|
144
|
+
country.iso
|
|
145
|
+
)),
|
|
146
|
+
filtered.length === 0 && /* @__PURE__ */ jsx("p", { className: "text-sm text-zinc-500 p-3 text-center", children: "Nenhum pa\xEDs encontrado" })
|
|
147
|
+
] })
|
|
148
|
+
] })
|
|
149
|
+
] }),
|
|
150
|
+
/* @__PURE__ */ jsx(Separator, { orientation: "vertical" }),
|
|
151
|
+
/* @__PURE__ */ jsx(
|
|
152
|
+
Input,
|
|
153
|
+
{
|
|
154
|
+
ref: inputRef,
|
|
155
|
+
type: "tel",
|
|
156
|
+
value: phoneNumber,
|
|
157
|
+
onChange: handleNumberChange,
|
|
158
|
+
placeholder,
|
|
159
|
+
disabled,
|
|
160
|
+
className: cn(
|
|
161
|
+
"paragraph-small-medium w-full h-full text-zinc-950 border-0 focus-visible:ring-0 focus-visible:ring-offset-0",
|
|
162
|
+
disabled && "cursor-not-allowed",
|
|
163
|
+
className
|
|
164
|
+
)
|
|
165
|
+
}
|
|
166
|
+
)
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
),
|
|
170
|
+
showMessage && /* @__PURE__ */ jsx("span", { className: cn("paragraph-xsmall-medium", error ? "text-red-600" : "text-zinc-600"), children: finalMessage })
|
|
171
|
+
] });
|
|
172
|
+
}
|
|
173
|
+
export {
|
|
174
|
+
PhoneInput as default
|
|
175
|
+
};
|
|
176
|
+
//# sourceMappingURL=PhoneInput.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/form/PhoneInput.tsx"],"sourcesContent":["'use client';\n\nimport { useState, useEffect, useRef } from 'react';\nimport { AsYouType, CountryCode } from 'libphonenumber-js';\nimport { Input, Separator, Popover, PopoverTrigger, PopoverContent, cn } from '@greatapps/common';\nimport { IconChevronDown, IconSearch } from '@tabler/icons-react';\nimport { COUNTRIES, Country, flagUrl, parsePhoneValue } from '../../../utils/countries';\n\nfunction formatNational(digits: string, iso: string): string {\n const raw = digits.replace(/\\D/g, '');\n if (!raw) return '';\n return new AsYouType(iso as CountryCode).input(raw);\n}\n\ninterface PhoneInputProps {\n value?: string;\n onChange?: (value: string) => void;\n label?: string;\n optional?: boolean;\n required?: boolean;\n hintMessage?: string;\n error?: boolean;\n errorMessage?: string;\n placeholder?: string;\n disabled?: boolean;\n classnameContainer?: string;\n className?: string;\n}\n\nexport default function PhoneInput({\n value,\n onChange,\n label,\n optional = false,\n required = false,\n hintMessage,\n error = false,\n errorMessage,\n placeholder,\n disabled = false,\n classnameContainer,\n className,\n}: PhoneInputProps) {\n const parsed = parsePhoneValue(value ?? '');\n const [selectedCountry, setSelectedCountry] = useState<Country>(parsed.country);\n const [phoneNumber, setPhoneNumber] = useState(parsed.number);\n const [search, setSearch] = useState('');\n const [open, setOpen] = useState(false);\n const prevValueRef = useRef(value);\n const inputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (value !== prevValueRef.current) {\n prevValueRef.current = value;\n const p = parsePhoneValue(value ?? '');\n setSelectedCountry(p.country);\n setPhoneNumber(formatNational(p.number, p.country.iso));\n }\n }, [value]);\n\n const emit = (country: Country, number: string) => {\n onChange?.(`${country.dial} ${number}`);\n };\n\n const handleCountrySelect = (country: Country) => {\n const reformatted = formatNational(phoneNumber, country.iso);\n setSelectedCountry(country);\n setPhoneNumber(reformatted);\n setOpen(false);\n setSearch('');\n emit(country, reformatted);\n };\n\n const handleNumberChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const rawInput = e.target.value;\n const digits = rawInput.replace(/\\D/g, '');\n if (digits.length > 15) return;\n\n const cursorPos = e.target.selectionStart ?? rawInput.length;\n const digitsBeforeCursor = rawInput.slice(0, cursorPos).replace(/\\D/g, '').length;\n\n const formatted = formatNational(rawInput, selectedCountry.iso);\n setPhoneNumber(formatted);\n emit(selectedCountry, formatted);\n\n requestAnimationFrame(() => {\n if (!inputRef.current) return;\n let digitCount = 0;\n let newPos = formatted.length;\n for (let i = 0; i < formatted.length; i++) {\n if (/\\d/.test(formatted[i])) {\n digitCount++;\n if (digitCount === digitsBeforeCursor) {\n newPos = i + 1;\n break;\n }\n }\n }\n inputRef.current.setSelectionRange(newPos, newPos);\n });\n };\n\n const filtered = COUNTRIES.filter(\n (c) =>\n c.name.toLowerCase().includes(search.toLowerCase()) ||\n c.dial.includes(search) ||\n c.iso.toLowerCase().includes(search.toLowerCase())\n );\n\n const finalMessage = error && errorMessage ? errorMessage : hintMessage;\n const showMessage = finalMessage && finalMessage.trim() !== '';\n\n return (\n <div className=\"flex flex-col gap-1.5\">\n {label && (\n <div className=\"flex items-center gap-1 paragraph-xsmall-semibold\">\n <span className=\"text-zinc-600\">{label}</span>\n {optional && <span className=\"text-zinc-500\">(Opcional)</span>}\n {required && <span className=\"text-red-600\">*</span>}\n </div>\n )}\n\n <div\n className={cn(\n 'flex gap-2 items-center border rounded-lg h-10 transition-colors',\n error\n ? 'border-red-600 hover:border-red-700'\n : 'border-zinc-200 hover:border-zinc-400 focus-within:border-zinc-950',\n disabled && 'cursor-not-allowed',\n classnameContainer\n )}\n >\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n className=\"flex items-center gap-1.5 px-3 h-full shrink-0 focus:outline-none\"\n disabled={disabled}\n >\n <img src={flagUrl(selectedCountry.iso)} alt={selectedCountry.iso} className=\"w-5 h-5 rounded-full\" />\n <span className=\"paragraph-small-regular text-zinc-950\">{selectedCountry.dial}</span>\n <IconChevronDown size={14} className={cn(\"text-zinc-500 transition-transform duration-200\", open && \"rotate-180\")} />\n </button>\n </PopoverTrigger>\n <PopoverContent className=\"w-72 p-0 z-[1010]\" align=\"start\" side=\"top\">\n <div className=\"flex items-center gap-2 p-2 border-b border-zinc-100\">\n <IconSearch size={14} className=\"text-zinc-400 shrink-0\" />\n <input\n type=\"text\"\n className=\"flex-1 text-sm outline-none placeholder:text-zinc-400\"\n placeholder=\"Buscar país...\"\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n autoFocus\n />\n </div>\n <div className=\"max-h-60 overflow-y-auto overscroll-contain\" onTouchMove={(e) => e.stopPropagation()} onWheel={(e) => e.stopPropagation()}>\n {filtered.map((country) => (\n <button\n key={country.iso}\n type=\"button\"\n className={cn(\n 'flex items-center gap-2.5 w-full px-3 py-2 text-left hover:bg-zinc-50 transition-colors',\n selectedCountry.iso === country.iso && 'bg-zinc-100'\n )}\n onClick={() => handleCountrySelect(country)}\n >\n <img src={flagUrl(country.iso)} alt={country.iso} className=\"w-5 h-5 rounded-full shrink-0\" />\n <span className=\"paragraph-small-regular text-zinc-950 flex-1 truncate\">\n {country.name}\n </span>\n <span className=\"paragraph-small-regular text-zinc-500 shrink-0\">\n {country.dial}\n </span>\n </button>\n ))}\n {filtered.length === 0 && (\n <p className=\"text-sm text-zinc-500 p-3 text-center\">Nenhum país encontrado</p>\n )}\n </div>\n </PopoverContent>\n </Popover>\n\n <Separator orientation=\"vertical\" />\n\n <Input\n ref={inputRef}\n type=\"tel\"\n value={phoneNumber}\n onChange={handleNumberChange}\n placeholder={placeholder}\n disabled={disabled}\n className={cn(\n 'paragraph-small-medium w-full h-full text-zinc-950 border-0 focus-visible:ring-0 focus-visible:ring-offset-0',\n disabled && 'cursor-not-allowed',\n className\n )}\n />\n </div>\n\n {showMessage && (\n <span className={cn('paragraph-xsmall-medium', error ? 'text-red-600' : 'text-zinc-600')}>\n {finalMessage}\n </span>\n )}\n </div>\n );\n}\n"],"mappings":"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","names":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
5
|
+
import { IconCircle } from "@tabler/icons-react";
|
|
6
|
+
import { cn } from "../../../infra/utils/clsx";
|
|
7
|
+
const RadioGroup = React.forwardRef(({ className, ...props }, ref) => {
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
RadioGroupPrimitive.Root,
|
|
10
|
+
{
|
|
11
|
+
className: cn("grid gap-2", className),
|
|
12
|
+
...props,
|
|
13
|
+
ref
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
});
|
|
17
|
+
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
18
|
+
const RadioGroupItem = React.forwardRef(({ className, ...props }, ref) => {
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
RadioGroupPrimitive.Item,
|
|
21
|
+
{
|
|
22
|
+
ref,
|
|
23
|
+
className: cn(
|
|
24
|
+
"aspect-square h-4 w-4 rounded-full border border-gray-300 text-gray-950 ring-offset-white focus:outline-none focus-visible:ring-2 focus-visible:ring-gray-950 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
25
|
+
className
|
|
26
|
+
),
|
|
27
|
+
...props,
|
|
28
|
+
children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(IconCircle, { className: "h-2.5 w-2.5 fill-current text-current" }) })
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
});
|
|
32
|
+
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
33
|
+
export {
|
|
34
|
+
RadioGroup,
|
|
35
|
+
RadioGroupItem
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=RadioGroup.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/form/RadioGroup.tsx"],"sourcesContent":["'use client';\n\n\"use client\"\n\nimport * as React from \"react\"\nimport * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\"\nimport { IconCircle } from '@tabler/icons-react'\nimport { cn } from \"../../../infra/utils/clsx\"\n\nconst RadioGroup = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\n>(({ className, ...props }, ref) => {\n return (\n <RadioGroupPrimitive.Root\n className={cn(\"grid gap-2\", className)}\n {...props}\n ref={ref}\n />\n )\n})\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName\n\nconst RadioGroupItem = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>\n>(({ className, ...props }, ref) => {\n return (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n \"aspect-square h-4 w-4 rounded-full border border-gray-300 text-gray-950 ring-offset-white focus:outline-none focus-visible:ring-2 focus-visible:ring-gray-950 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"flex items-center justify-center\">\n <IconCircle className=\"h-2.5 w-2.5 fill-current text-current\" />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n )\n})\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName\n\nexport { RadioGroup, RadioGroupItem }\n"],"mappings":";AAcI;AAVJ,YAAY,WAAW;AACvB,YAAY,yBAAyB;AACrC,SAAS,kBAAkB;AAC3B,SAAS,UAAU;AAEnB,MAAM,aAAa,MAAM,WAGvB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AAClC,SACE;AAAA,IAAC,oBAAoB;AAAA,IAApB;AAAA,MACC,WAAW,GAAG,cAAc,SAAS;AAAA,MACpC,GAAG;AAAA,MACJ;AAAA;AAAA,EACF;AAEJ,CAAC;AACD,WAAW,cAAc,oBAAoB,KAAK;AAElD,MAAM,iBAAiB,MAAM,WAG3B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AAClC,SACE;AAAA,IAAC,oBAAoB;AAAA,IAApB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ,8BAAC,oBAAoB,WAApB,EAA8B,WAAU,oCACvC,8BAAC,cAAW,WAAU,yCAAwC,GAChE;AAAA;AAAA,EACF;AAEJ,CAAC;AACD,eAAe,cAAc,oBAAoB,KAAK;","names":[]}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
4
|
+
import { IconCheck, IconChevronDown, IconChevronUp } from "@tabler/icons-react";
|
|
5
|
+
import { cn } from "../../../infra/utils/clsx";
|
|
6
|
+
function Select({
|
|
7
|
+
...props
|
|
8
|
+
}) {
|
|
9
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Root, { "data-slot": "select", ...props });
|
|
10
|
+
}
|
|
11
|
+
function SelectGroup({
|
|
12
|
+
...props
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Group, { "data-slot": "select-group", ...props });
|
|
15
|
+
}
|
|
16
|
+
function SelectValue({
|
|
17
|
+
...props
|
|
18
|
+
}) {
|
|
19
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
|
|
20
|
+
}
|
|
21
|
+
function SelectTrigger({
|
|
22
|
+
className,
|
|
23
|
+
size = "default",
|
|
24
|
+
children,
|
|
25
|
+
icon,
|
|
26
|
+
...props
|
|
27
|
+
}) {
|
|
28
|
+
return /* @__PURE__ */ jsxs(
|
|
29
|
+
SelectPrimitive.Trigger,
|
|
30
|
+
{
|
|
31
|
+
"data-slot": "select-trigger",
|
|
32
|
+
"data-size": size,
|
|
33
|
+
className: cn(
|
|
34
|
+
"group/data-select border-input data-placeholder:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 cursor-pointer",
|
|
35
|
+
className
|
|
36
|
+
),
|
|
37
|
+
...props,
|
|
38
|
+
children: [
|
|
39
|
+
children,
|
|
40
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: icon ?? /* @__PURE__ */ jsx(
|
|
41
|
+
IconChevronDown,
|
|
42
|
+
{
|
|
43
|
+
className: "\n size-4 opacity-50 transition-all duration-200\n group-data-[state=open]/data-select:rotate-180\n group-data-[state=open]/data-select:opacity-100\n group-data-[state=open]/data-select:text-gray-950!\n "
|
|
44
|
+
}
|
|
45
|
+
) })
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
function SelectContent({
|
|
51
|
+
className,
|
|
52
|
+
children,
|
|
53
|
+
position = "popper",
|
|
54
|
+
align = "center",
|
|
55
|
+
...props
|
|
56
|
+
}) {
|
|
57
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
58
|
+
SelectPrimitive.Content,
|
|
59
|
+
{
|
|
60
|
+
"data-slot": "select-content",
|
|
61
|
+
className: cn(
|
|
62
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-[1001] max-h-(--radix-select-content-available-height) min-w-32 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
|
|
63
|
+
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
64
|
+
className
|
|
65
|
+
),
|
|
66
|
+
position,
|
|
67
|
+
align,
|
|
68
|
+
...props,
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
71
|
+
/* @__PURE__ */ jsx(
|
|
72
|
+
SelectPrimitive.Viewport,
|
|
73
|
+
{
|
|
74
|
+
className: cn(
|
|
75
|
+
"p-1",
|
|
76
|
+
position === "popper" && "h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width) scroll-my-1"
|
|
77
|
+
),
|
|
78
|
+
children
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
) });
|
|
85
|
+
}
|
|
86
|
+
function SelectLabel({
|
|
87
|
+
className,
|
|
88
|
+
...props
|
|
89
|
+
}) {
|
|
90
|
+
return /* @__PURE__ */ jsx(
|
|
91
|
+
SelectPrimitive.Label,
|
|
92
|
+
{
|
|
93
|
+
"data-slot": "select-label",
|
|
94
|
+
className: cn("text-muted-foreground px-2 py-1.5 text-xs", className),
|
|
95
|
+
...props
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
function SelectItem({
|
|
100
|
+
className,
|
|
101
|
+
children,
|
|
102
|
+
...props
|
|
103
|
+
}) {
|
|
104
|
+
return /* @__PURE__ */ jsxs(
|
|
105
|
+
SelectPrimitive.Item,
|
|
106
|
+
{
|
|
107
|
+
"data-slot": "select-item",
|
|
108
|
+
className: cn(
|
|
109
|
+
"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 cursor-pointer",
|
|
110
|
+
className
|
|
111
|
+
),
|
|
112
|
+
...props,
|
|
113
|
+
children: [
|
|
114
|
+
/* @__PURE__ */ jsx("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(IconCheck, { className: "size-4" }) }) }),
|
|
115
|
+
/* @__PURE__ */ jsx(SelectPrimitive.ItemText, { className: "cursor-pointer", children })
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
function SelectSeparator({
|
|
121
|
+
className,
|
|
122
|
+
...props
|
|
123
|
+
}) {
|
|
124
|
+
return /* @__PURE__ */ jsx(
|
|
125
|
+
SelectPrimitive.Separator,
|
|
126
|
+
{
|
|
127
|
+
"data-slot": "select-separator",
|
|
128
|
+
className: cn("bg-border pointer-events-none -mx-1 my-1 h-px", className),
|
|
129
|
+
...props
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
function SelectScrollUpButton({
|
|
134
|
+
className,
|
|
135
|
+
...props
|
|
136
|
+
}) {
|
|
137
|
+
return /* @__PURE__ */ jsx(
|
|
138
|
+
SelectPrimitive.ScrollUpButton,
|
|
139
|
+
{
|
|
140
|
+
"data-slot": "select-scroll-up-button",
|
|
141
|
+
className: cn(
|
|
142
|
+
"flex cursor-default items-center justify-center py-1",
|
|
143
|
+
className
|
|
144
|
+
),
|
|
145
|
+
...props,
|
|
146
|
+
children: /* @__PURE__ */ jsx(IconChevronUp, { className: "size-4" })
|
|
147
|
+
}
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
function SelectScrollDownButton({
|
|
151
|
+
className,
|
|
152
|
+
...props
|
|
153
|
+
}) {
|
|
154
|
+
return /* @__PURE__ */ jsx(
|
|
155
|
+
SelectPrimitive.ScrollDownButton,
|
|
156
|
+
{
|
|
157
|
+
"data-slot": "select-scroll-down-button",
|
|
158
|
+
className: cn(
|
|
159
|
+
"flex cursor-default items-center justify-center py-1",
|
|
160
|
+
className
|
|
161
|
+
),
|
|
162
|
+
...props,
|
|
163
|
+
children: /* @__PURE__ */ jsx(IconChevronDown, { className: "size-4" })
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
export {
|
|
168
|
+
Select,
|
|
169
|
+
SelectContent,
|
|
170
|
+
SelectGroup,
|
|
171
|
+
SelectItem,
|
|
172
|
+
SelectLabel,
|
|
173
|
+
SelectScrollDownButton,
|
|
174
|
+
SelectScrollUpButton,
|
|
175
|
+
SelectSeparator,
|
|
176
|
+
SelectTrigger,
|
|
177
|
+
SelectValue
|
|
178
|
+
};
|
|
179
|
+
//# sourceMappingURL=Select.mjs.map
|