@greatapps/common 1.1.173 → 1.1.174

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/dist/components/account/AccountModals.mjs +18 -0
  2. package/dist/components/account/AccountModals.mjs.map +1 -0
  3. package/dist/components/account/ConfigurationsMyAccountModal.mjs +132 -0
  4. package/dist/components/account/ConfigurationsMyAccountModal.mjs.map +1 -0
  5. package/dist/components/account/ConfirmDeleteAccountModal.mjs +45 -0
  6. package/dist/components/account/ConfirmDeleteAccountModal.mjs.map +1 -0
  7. package/dist/components/account/ConfirmGlobalPreferencesModal.mjs +45 -0
  8. package/dist/components/account/ConfirmGlobalPreferencesModal.mjs.map +1 -0
  9. package/dist/components/account/DeleteAccountModal.mjs +123 -0
  10. package/dist/components/account/DeleteAccountModal.mjs.map +1 -0
  11. package/dist/components/account/DisableTwoFactorAuthModal.mjs +67 -0
  12. package/dist/components/account/DisableTwoFactorAuthModal.mjs.map +1 -0
  13. package/dist/components/account/IsntPossibleDeleteAccountModal.mjs +42 -0
  14. package/dist/components/account/IsntPossibleDeleteAccountModal.mjs.map +1 -0
  15. package/dist/components/account/TwoFactorAuthModal.mjs +190 -0
  16. package/dist/components/account/TwoFactorAuthModal.mjs.map +1 -0
  17. package/dist/components/account/constants.mjs +29 -0
  18. package/dist/components/account/constants.mjs.map +1 -0
  19. package/dist/components/account/hooks/useChangeEmailForm.mjs +53 -0
  20. package/dist/components/account/hooks/useChangeEmailForm.mjs.map +1 -0
  21. package/dist/components/account/hooks/useChangePasswordForm.mjs +47 -0
  22. package/dist/components/account/hooks/useChangePasswordForm.mjs.map +1 -0
  23. package/dist/components/account/hooks/useChangePhoneForm.mjs +72 -0
  24. package/dist/components/account/hooks/useChangePhoneForm.mjs.map +1 -0
  25. package/dist/components/account/hooks/useConfigurationsModal.mjs +33 -0
  26. package/dist/components/account/hooks/useConfigurationsModal.mjs.map +1 -0
  27. package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs +54 -0
  28. package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs.map +1 -0
  29. package/dist/components/account/hooks/useOtpVerification.mjs +94 -0
  30. package/dist/components/account/hooks/useOtpVerification.mjs.map +1 -0
  31. package/dist/components/account/hooks/useTwoFactorAuthForm.mjs +80 -0
  32. package/dist/components/account/hooks/useTwoFactorAuthForm.mjs.map +1 -0
  33. package/dist/components/account/sections/ChangeEmailModal.mjs +181 -0
  34. package/dist/components/account/sections/ChangeEmailModal.mjs.map +1 -0
  35. package/dist/components/account/sections/ChangePasswordSection.mjs +64 -0
  36. package/dist/components/account/sections/ChangePasswordSection.mjs.map +1 -0
  37. package/dist/components/account/sections/ChangePhoneModal.mjs +187 -0
  38. package/dist/components/account/sections/ChangePhoneModal.mjs.map +1 -0
  39. package/dist/components/account/sections/MyProfileSection.mjs +303 -0
  40. package/dist/components/account/sections/MyProfileSection.mjs.map +1 -0
  41. package/dist/components/account/sections/PreferencesSection.mjs +250 -0
  42. package/dist/components/account/sections/PreferencesSection.mjs.map +1 -0
  43. package/dist/components/account/sections/SecuritySection.mjs +147 -0
  44. package/dist/components/account/sections/SecuritySection.mjs.map +1 -0
  45. package/dist/components/handlers/SearchParamsHandler.mjs +24 -0
  46. package/dist/components/handlers/SearchParamsHandler.mjs.map +1 -0
  47. package/dist/components/layouts/AppMobileNavBar.mjs +115 -0
  48. package/dist/components/layouts/AppMobileNavBar.mjs.map +1 -0
  49. package/dist/components/layouts/AppNavBar.mjs +49 -0
  50. package/dist/components/layouts/AppNavBar.mjs.map +1 -0
  51. package/dist/components/layouts/MainLayout.mjs +60 -0
  52. package/dist/components/layouts/MainLayout.mjs.map +1 -0
  53. package/dist/components/layouts/MdSideBarNavigation.mjs +54 -0
  54. package/dist/components/layouts/MdSideBarNavigation.mjs.map +1 -0
  55. package/dist/components/layouts/NavBar.mjs +132 -0
  56. package/dist/components/layouts/NavBar.mjs.map +1 -0
  57. package/dist/components/layouts/NavBarItem.mjs +23 -0
  58. package/dist/components/layouts/NavBarItem.mjs.map +1 -0
  59. package/dist/components/layouts/NotificationsPopover.mjs +97 -0
  60. package/dist/components/layouts/NotificationsPopover.mjs.map +1 -0
  61. package/dist/components/layouts/ProfilePopover.mjs +149 -0
  62. package/dist/components/layouts/ProfilePopover.mjs.map +1 -0
  63. package/dist/components/layouts/SideBarNavigation.mjs +22 -0
  64. package/dist/components/layouts/SideBarNavigation.mjs.map +1 -0
  65. package/dist/components/layouts/UsersSelectorPopover.mjs +230 -0
  66. package/dist/components/layouts/UsersSelectorPopover.mjs.map +1 -0
  67. package/dist/components/modals/ModalManager.mjs +19 -0
  68. package/dist/components/modals/ModalManager.mjs.map +1 -0
  69. package/dist/components/modals/Modals.mjs +20 -0
  70. package/dist/components/modals/Modals.mjs.map +1 -0
  71. package/dist/components/navigation/AppNavigation.mjs +30 -0
  72. package/dist/components/navigation/AppNavigation.mjs.map +1 -0
  73. package/dist/components/navigation/AppNavigationContext.mjs +13 -0
  74. package/dist/components/navigation/AppNavigationContext.mjs.map +1 -0
  75. package/dist/components/navigation/CancelledSubscriptionBanner.mjs +59 -0
  76. package/dist/components/navigation/CancelledSubscriptionBanner.mjs.map +1 -0
  77. package/dist/components/navigation/NavItem.mjs +35 -0
  78. package/dist/components/navigation/NavItem.mjs.map +1 -0
  79. package/dist/components/navigation/NavItemsContext.mjs +16 -0
  80. package/dist/components/navigation/NavItemsContext.mjs.map +1 -0
  81. package/dist/components/navigation/ProjectSelectorPopover.mjs +128 -0
  82. package/dist/components/navigation/ProjectSelectorPopover.mjs.map +1 -0
  83. package/dist/components/navigation/shells/DesktopShell.mjs +11 -0
  84. package/dist/components/navigation/shells/DesktopShell.mjs.map +1 -0
  85. package/dist/components/navigation/shells/MdShell.mjs +11 -0
  86. package/dist/components/navigation/shells/MdShell.mjs.map +1 -0
  87. package/dist/components/navigation/shells/MobileShell.mjs +27 -0
  88. package/dist/components/navigation/shells/MobileShell.mjs.map +1 -0
  89. package/dist/components/navigation/shells/TabsMobileShell.mjs +59 -0
  90. package/dist/components/navigation/shells/TabsMobileShell.mjs.map +1 -0
  91. package/dist/components/navigation/subcomponents/CreditsCard.mjs +30 -0
  92. package/dist/components/navigation/subcomponents/CreditsCard.mjs.map +1 -0
  93. package/dist/components/navigation/subcomponents/NavItems.mjs +25 -0
  94. package/dist/components/navigation/subcomponents/NavItems.mjs.map +1 -0
  95. package/dist/components/navigation/subcomponents/PlanCard.mjs +25 -0
  96. package/dist/components/navigation/subcomponents/PlanCard.mjs.map +1 -0
  97. package/dist/components/navigation/subcomponents/ProjectSelector.mjs +130 -0
  98. package/dist/components/navigation/subcomponents/ProjectSelector.mjs.map +1 -0
  99. package/dist/components/navigation/types.mjs +1 -0
  100. package/dist/components/navigation/types.mjs.map +1 -0
  101. package/dist/components/pages/notifications/Notifications.mjs +156 -0
  102. package/dist/components/pages/notifications/Notifications.mjs.map +1 -0
  103. package/dist/components/ui/buttons/Button.mjs +52 -0
  104. package/dist/components/ui/buttons/Button.mjs.map +1 -0
  105. package/dist/components/ui/buttons/CancelButton.mjs +17 -0
  106. package/dist/components/ui/buttons/CancelButton.mjs.map +1 -0
  107. package/dist/components/ui/buttons/CopyButton.mjs +42 -0
  108. package/dist/components/ui/buttons/CopyButton.mjs.map +1 -0
  109. package/dist/components/ui/data-display/Accordion.mjs +76 -0
  110. package/dist/components/ui/data-display/Accordion.mjs.map +1 -0
  111. package/dist/components/ui/data-display/Badge.mjs +42 -0
  112. package/dist/components/ui/data-display/Badge.mjs.map +1 -0
  113. package/dist/components/ui/data-display/Card.mjs +92 -0
  114. package/dist/components/ui/data-display/Card.mjs.map +1 -0
  115. package/dist/components/ui/data-display/Pagination.mjs +118 -0
  116. package/dist/components/ui/data-display/Pagination.mjs.map +1 -0
  117. package/dist/components/ui/data-display/ScrollArea.mjs +62 -0
  118. package/dist/components/ui/data-display/ScrollArea.mjs.map +1 -0
  119. package/dist/components/ui/data-display/Separator.mjs +28 -0
  120. package/dist/components/ui/data-display/Separator.mjs.map +1 -0
  121. package/dist/components/ui/data-display/Table.mjs +116 -0
  122. package/dist/components/ui/data-display/Table.mjs.map +1 -0
  123. package/dist/components/ui/data-display/Tabs.mjs +69 -0
  124. package/dist/components/ui/data-display/Tabs.mjs.map +1 -0
  125. package/dist/components/ui/data-display/UserAvatar.mjs +49 -0
  126. package/dist/components/ui/data-display/UserAvatar.mjs.map +1 -0
  127. package/dist/components/ui/feedback/CircularProgress.mjs +71 -0
  128. package/dist/components/ui/feedback/CircularProgress.mjs.map +1 -0
  129. package/dist/components/ui/feedback/DefaultCircularProgress.mjs +50 -0
  130. package/dist/components/ui/feedback/DefaultCircularProgress.mjs.map +1 -0
  131. package/dist/components/ui/feedback/LoadingOverlay.mjs +19 -0
  132. package/dist/components/ui/feedback/LoadingOverlay.mjs.map +1 -0
  133. package/dist/components/ui/feedback/Progress.mjs +37 -0
  134. package/dist/components/ui/feedback/Progress.mjs.map +1 -0
  135. package/dist/components/ui/feedback/Toast.mjs +77 -0
  136. package/dist/components/ui/feedback/Toast.mjs.map +1 -0
  137. package/dist/components/ui/form/Calendar.mjs +204 -0
  138. package/dist/components/ui/form/Calendar.mjs.map +1 -0
  139. package/dist/components/ui/form/Checkbox.mjs +33 -0
  140. package/dist/components/ui/form/Checkbox.mjs.map +1 -0
  141. package/dist/components/ui/form/ComboboxField.mjs +130 -0
  142. package/dist/components/ui/form/ComboboxField.mjs.map +1 -0
  143. package/dist/components/ui/form/DatePicker.mjs +82 -0
  144. package/dist/components/ui/form/DatePicker.mjs.map +1 -0
  145. package/dist/components/ui/form/DateRangePicker.mjs +92 -0
  146. package/dist/components/ui/form/DateRangePicker.mjs.map +1 -0
  147. package/dist/components/ui/form/FormField.mjs +103 -0
  148. package/dist/components/ui/form/FormField.mjs.map +1 -0
  149. package/dist/components/ui/form/Input.mjs +21 -0
  150. package/dist/components/ui/form/Input.mjs.map +1 -0
  151. package/dist/components/ui/form/InputOtp.mjs +70 -0
  152. package/dist/components/ui/form/InputOtp.mjs.map +1 -0
  153. package/dist/components/ui/form/PhoneInput.mjs +119 -0
  154. package/dist/components/ui/form/PhoneInput.mjs.map +1 -0
  155. package/dist/components/ui/form/RadioGroup.mjs +37 -0
  156. package/dist/components/ui/form/RadioGroup.mjs.map +1 -0
  157. package/dist/components/ui/form/Select.mjs +179 -0
  158. package/dist/components/ui/form/Select.mjs.map +1 -0
  159. package/dist/components/ui/form/SelectField.mjs +80 -0
  160. package/dist/components/ui/form/SelectField.mjs.map +1 -0
  161. package/dist/components/ui/form/Switch.mjs +33 -0
  162. package/dist/components/ui/form/Switch.mjs.map +1 -0
  163. package/dist/components/ui/form/SwitchOptionFieldWithIcon.mjs +40 -0
  164. package/dist/components/ui/form/SwitchOptionFieldWithIcon.mjs.map +1 -0
  165. package/dist/components/ui/form/TextAreaField.mjs +56 -0
  166. package/dist/components/ui/form/TextAreaField.mjs.map +1 -0
  167. package/dist/components/ui/form/Textarea.mjs +20 -0
  168. package/dist/components/ui/form/Textarea.mjs.map +1 -0
  169. package/dist/components/ui/overlay/Command.mjs +178 -0
  170. package/dist/components/ui/overlay/Command.mjs.map +1 -0
  171. package/dist/components/ui/overlay/Dialog.mjs +142 -0
  172. package/dist/components/ui/overlay/Dialog.mjs.map +1 -0
  173. package/dist/components/ui/overlay/Popover.mjs +46 -0
  174. package/dist/components/ui/overlay/Popover.mjs.map +1 -0
  175. package/dist/components/ui/overlay/Sheet.mjs +142 -0
  176. package/dist/components/ui/overlay/Sheet.mjs.map +1 -0
  177. package/dist/components/ui/overlay/Tooltip.mjs +57 -0
  178. package/dist/components/ui/overlay/Tooltip.mjs.map +1 -0
  179. package/dist/components/widgets/notifications/NotificationCard.mjs +54 -0
  180. package/dist/components/widgets/notifications/NotificationCard.mjs.map +1 -0
  181. package/dist/enums/AccountSectionType.mjs +11 -0
  182. package/dist/enums/AccountSectionType.mjs.map +1 -0
  183. package/dist/hooks/copy-to-clipboard.hook.mjs +52 -0
  184. package/dist/hooks/copy-to-clipboard.hook.mjs.map +1 -0
  185. package/dist/hooks/useCountdownTimer.mjs +29 -0
  186. package/dist/hooks/useCountdownTimer.mjs.map +1 -0
  187. package/dist/hooks/useDebounce.mjs +19 -0
  188. package/dist/hooks/useDebounce.mjs.map +1 -0
  189. package/dist/hooks/useDebounceState.mjs +12 -0
  190. package/dist/hooks/useDebounceState.mjs.map +1 -0
  191. package/dist/hooks/useDebouncedEffect.mjs +44 -0
  192. package/dist/hooks/useDebouncedEffect.mjs.map +1 -0
  193. package/dist/hooks/useIsMobile.mjs +18 -0
  194. package/dist/hooks/useIsMobile.mjs.map +1 -0
  195. package/dist/hooks/usePasswordVisibility.mjs +13 -0
  196. package/dist/hooks/usePasswordVisibility.mjs.map +1 -0
  197. package/dist/index.mjs +457 -0
  198. package/dist/index.mjs.map +1 -0
  199. package/dist/infra/api/client.mjs +136 -0
  200. package/dist/infra/api/client.mjs.map +1 -0
  201. package/dist/infra/api/types.mjs +31 -0
  202. package/dist/infra/api/types.mjs.map +1 -0
  203. package/dist/infra/utils/client-info.mjs +27 -0
  204. package/dist/infra/utils/client-info.mjs.map +1 -0
  205. package/dist/infra/utils/clsx.mjs +9 -0
  206. package/dist/infra/utils/clsx.mjs.map +1 -0
  207. package/dist/infra/utils/params.mjs +21 -0
  208. package/dist/infra/utils/params.mjs.map +1 -0
  209. package/dist/infra/utils/parser.mjs +24 -0
  210. package/dist/infra/utils/parser.mjs.map +1 -0
  211. package/dist/infra/utils/percentage.mjs +20 -0
  212. package/dist/infra/utils/percentage.mjs.map +1 -0
  213. package/dist/middleware.mjs +10 -0
  214. package/dist/middleware.mjs.map +1 -0
  215. package/dist/middlewares/chain.mjs +37 -0
  216. package/dist/middlewares/chain.mjs.map +1 -0
  217. package/dist/middlewares/create-auth-middleware.mjs +28 -0
  218. package/dist/middlewares/create-auth-middleware.mjs.map +1 -0
  219. package/dist/middlewares/types.mjs +11 -0
  220. package/dist/middlewares/types.mjs.map +1 -0
  221. package/dist/modules/accounts/actions/account-management.action.mjs +82 -0
  222. package/dist/modules/accounts/actions/account-management.action.mjs.map +1 -0
  223. package/dist/modules/accounts/actions/find-current-account.action.mjs +10 -0
  224. package/dist/modules/accounts/actions/find-current-account.action.mjs.map +1 -0
  225. package/dist/modules/accounts/actions/list-currencies.action.mjs +10 -0
  226. package/dist/modules/accounts/actions/list-currencies.action.mjs.map +1 -0
  227. package/dist/modules/accounts/actions/list-timezones.action.mjs +10 -0
  228. package/dist/modules/accounts/actions/list-timezones.action.mjs.map +1 -0
  229. package/dist/modules/accounts/hooks/current-account.hook.mjs +24 -0
  230. package/dist/modules/accounts/hooks/current-account.hook.mjs.map +1 -0
  231. package/dist/modules/accounts/hooks/useAccountManagement.mjs +71 -0
  232. package/dist/modules/accounts/hooks/useAccountManagement.mjs.map +1 -0
  233. package/dist/modules/accounts/hooks/useCurrencies.mjs +17 -0
  234. package/dist/modules/accounts/hooks/useCurrencies.mjs.map +1 -0
  235. package/dist/modules/accounts/hooks/useTimezones.mjs +17 -0
  236. package/dist/modules/accounts/hooks/useTimezones.mjs.map +1 -0
  237. package/dist/modules/accounts/services/account.service.mjs +180 -0
  238. package/dist/modules/accounts/services/account.service.mjs.map +1 -0
  239. package/dist/modules/accounts/services/currency.service.mjs +24 -0
  240. package/dist/modules/accounts/services/currency.service.mjs.map +1 -0
  241. package/dist/modules/accounts/services/timezone.service.mjs +65 -0
  242. package/dist/modules/accounts/services/timezone.service.mjs.map +1 -0
  243. package/dist/modules/accounts/services/two-factor.service.mjs +77 -0
  244. package/dist/modules/accounts/services/two-factor.service.mjs.map +1 -0
  245. package/dist/modules/accounts/types.mjs +1 -0
  246. package/dist/modules/accounts/types.mjs.map +1 -0
  247. package/dist/modules/auth/actions/login.action.mjs +14 -0
  248. package/dist/modules/auth/actions/login.action.mjs.map +1 -0
  249. package/dist/modules/auth/actions/logout.action.mjs +14 -0
  250. package/dist/modules/auth/actions/logout.action.mjs.map +1 -0
  251. package/dist/modules/auth/actions/register.action.mjs +14 -0
  252. package/dist/modules/auth/actions/register.action.mjs.map +1 -0
  253. package/dist/modules/auth/actions/validate-session.action.mjs +60 -0
  254. package/dist/modules/auth/actions/validate-session.action.mjs.map +1 -0
  255. package/dist/modules/auth/actions/verify-two-factor.action.mjs +17 -0
  256. package/dist/modules/auth/actions/verify-two-factor.action.mjs.map +1 -0
  257. package/dist/modules/auth/hooks/login.hook.mjs +13 -0
  258. package/dist/modules/auth/hooks/login.hook.mjs.map +1 -0
  259. package/dist/modules/auth/hooks/logout.hook.mjs +13 -0
  260. package/dist/modules/auth/hooks/logout.hook.mjs.map +1 -0
  261. package/dist/modules/auth/hooks/register.hook.mjs +13 -0
  262. package/dist/modules/auth/hooks/register.hook.mjs.map +1 -0
  263. package/dist/modules/auth/hooks/useUserQuery.mjs +63 -0
  264. package/dist/modules/auth/hooks/useUserQuery.mjs.map +1 -0
  265. package/dist/modules/auth/schema.mjs +1 -0
  266. package/dist/modules/auth/schema.mjs.map +1 -0
  267. package/dist/modules/auth/services/auth.service.mjs +294 -0
  268. package/dist/modules/auth/services/auth.service.mjs.map +1 -0
  269. package/dist/modules/auth/utils/get-user-context.mjs +24 -0
  270. package/dist/modules/auth/utils/get-user-context.mjs.map +1 -0
  271. package/dist/modules/ia-credits/actions/list-ia-credits.action.mjs +10 -0
  272. package/dist/modules/ia-credits/actions/list-ia-credits.action.mjs.map +1 -0
  273. package/dist/modules/ia-credits/hooks/ia-credits.hook.mjs +76 -0
  274. package/dist/modules/ia-credits/hooks/ia-credits.hook.mjs.map +1 -0
  275. package/dist/modules/ia-credits/services/ia-credits.service.mjs +31 -0
  276. package/dist/modules/ia-credits/services/ia-credits.service.mjs.map +1 -0
  277. package/dist/modules/ia-credits/types.mjs +25 -0
  278. package/dist/modules/ia-credits/types.mjs.map +1 -0
  279. package/dist/modules/projects/actions/add-project-user.action.mjs +10 -0
  280. package/dist/modules/projects/actions/add-project-user.action.mjs.map +1 -0
  281. package/dist/modules/projects/actions/list-available-users.action.mjs +10 -0
  282. package/dist/modules/projects/actions/list-available-users.action.mjs.map +1 -0
  283. package/dist/modules/projects/actions/list-project-users.action.mjs +10 -0
  284. package/dist/modules/projects/actions/list-project-users.action.mjs.map +1 -0
  285. package/dist/modules/projects/actions/remove-project-user.action.mjs +10 -0
  286. package/dist/modules/projects/actions/remove-project-user.action.mjs.map +1 -0
  287. package/dist/modules/projects/hooks/list-available-users.hook.mjs +34 -0
  288. package/dist/modules/projects/hooks/list-available-users.hook.mjs.map +1 -0
  289. package/dist/modules/projects/hooks/list-project-users.hook.mjs +34 -0
  290. package/dist/modules/projects/hooks/list-project-users.hook.mjs.map +1 -0
  291. package/dist/modules/projects/services/project-users.service.mjs +78 -0
  292. package/dist/modules/projects/services/project-users.service.mjs.map +1 -0
  293. package/dist/modules/projects/types.mjs +22 -0
  294. package/dist/modules/projects/types.mjs.map +1 -0
  295. package/dist/modules/subscriptions/actions/list-subscriptions.action.mjs +10 -0
  296. package/dist/modules/subscriptions/actions/list-subscriptions.action.mjs.map +1 -0
  297. package/dist/modules/subscriptions/constants/addons.constants.mjs +12 -0
  298. package/dist/modules/subscriptions/constants/addons.constants.mjs.map +1 -0
  299. package/dist/modules/subscriptions/hooks/find-active-subscription.hook.mjs +20 -0
  300. package/dist/modules/subscriptions/hooks/find-active-subscription.hook.mjs.map +1 -0
  301. package/dist/modules/subscriptions/hooks/list-subscriptions.hook.mjs +18 -0
  302. package/dist/modules/subscriptions/hooks/list-subscriptions.hook.mjs.map +1 -0
  303. package/dist/modules/subscriptions/services/subscriptions.service.mjs +32 -0
  304. package/dist/modules/subscriptions/services/subscriptions.service.mjs.map +1 -0
  305. package/dist/modules/subscriptions/types.mjs +57 -0
  306. package/dist/modules/subscriptions/types.mjs.map +1 -0
  307. package/dist/modules/users/action/find-user-by-id.action.mjs +10 -0
  308. package/dist/modules/users/action/find-user-by-id.action.mjs.map +1 -0
  309. package/dist/modules/users/action/list-messages.action.mjs +13 -0
  310. package/dist/modules/users/action/list-messages.action.mjs.map +1 -0
  311. package/dist/modules/users/action/mark-all-messages-as-read.action.mjs +10 -0
  312. package/dist/modules/users/action/mark-all-messages-as-read.action.mjs.map +1 -0
  313. package/dist/modules/users/action/mark-message-as-read.action.mjs +10 -0
  314. package/dist/modules/users/action/mark-message-as-read.action.mjs.map +1 -0
  315. package/dist/modules/users/hooks/messages.hook.mjs +57 -0
  316. package/dist/modules/users/hooks/messages.hook.mjs.map +1 -0
  317. package/dist/modules/users/schema/messages.schema.mjs +21 -0
  318. package/dist/modules/users/schema/messages.schema.mjs.map +1 -0
  319. package/dist/modules/users/schema.mjs +11 -0
  320. package/dist/modules/users/schema.mjs.map +1 -0
  321. package/dist/modules/users/services/messages.service.mjs +35 -0
  322. package/dist/modules/users/services/messages.service.mjs.map +1 -0
  323. package/dist/modules/users/services/user.service.mjs +50 -0
  324. package/dist/modules/users/services/user.service.mjs.map +1 -0
  325. package/dist/modules/whitelabel/actions/find-whitelabel-styles.action.mjs +15 -0
  326. package/dist/modules/whitelabel/actions/find-whitelabel-styles.action.mjs.map +1 -0
  327. package/dist/modules/whitelabel/actions/find-whitelabel.action.mjs +21 -0
  328. package/dist/modules/whitelabel/actions/find-whitelabel.action.mjs.map +1 -0
  329. package/dist/modules/whitelabel/schema.mjs +1 -0
  330. package/dist/modules/whitelabel/schema.mjs.map +1 -0
  331. package/dist/modules/whitelabel/services/whitelabel-styles.service.mjs +81 -0
  332. package/dist/modules/whitelabel/services/whitelabel-styles.service.mjs.map +1 -0
  333. package/dist/modules/whitelabel/services/whitelabel.service.mjs +61 -0
  334. package/dist/modules/whitelabel/services/whitelabel.service.mjs.map +1 -0
  335. package/dist/modules/whitelabel/styles-schema.mjs +1 -0
  336. package/dist/modules/whitelabel/styles-schema.mjs.map +1 -0
  337. package/dist/providers/auth.provider.mjs +100 -0
  338. package/dist/providers/auth.provider.mjs.map +1 -0
  339. package/dist/providers/query.provider.mjs +99 -0
  340. package/dist/providers/query.provider.mjs.map +1 -0
  341. package/dist/providers/whitelabel.provider.mjs +31 -0
  342. package/dist/providers/whitelabel.provider.mjs.map +1 -0
  343. package/dist/server.mjs +84 -0
  344. package/dist/server.mjs.map +1 -0
  345. package/dist/store/useAccountModals.mjs +18 -0
  346. package/dist/store/useAccountModals.mjs.map +1 -0
  347. package/dist/store/useMdSidebarStore.mjs +11 -0
  348. package/dist/store/useMdSidebarStore.mjs.map +1 -0
  349. package/dist/store/useMobileNavbarSheet.mjs +14 -0
  350. package/dist/store/useMobileNavbarSheet.mjs.map +1 -0
  351. package/dist/store/useModalManager.mjs +75 -0
  352. package/dist/store/useModalManager.mjs.map +1 -0
  353. package/dist/utils/browser/clipboard.mjs +36 -0
  354. package/dist/utils/browser/clipboard.mjs.map +1 -0
  355. package/dist/utils/file/index.mjs +9 -0
  356. package/dist/utils/file/index.mjs.map +1 -0
  357. package/dist/utils/format/masks.mjs +56 -0
  358. package/dist/utils/format/masks.mjs.map +1 -0
  359. package/dist/utils/intl/locales.mjs +12 -0
  360. package/dist/utils/intl/locales.mjs.map +1 -0
  361. package/dist/utils/safeServerAction.mjs +16 -0
  362. package/dist/utils/safeServerAction.mjs.map +1 -0
  363. package/dist/utils/validators/account.mjs +26 -0
  364. package/dist/utils/validators/account.mjs.map +1 -0
  365. package/dist/utils/validators/common.mjs +47 -0
  366. package/dist/utils/validators/common.mjs.map +1 -0
  367. package/dist/utils/withAction.mjs +13 -0
  368. package/dist/utils/withAction.mjs.map +1 -0
  369. package/package.json +1 -1
  370. package/src/components/account/hooks/useChangePhoneForm.tsx +78 -69
  371. package/src/components/account/sections/ChangeEmailModal.tsx +2 -1
  372. package/src/components/account/sections/ChangePhoneModal.tsx +234 -229
  373. package/src/components/ui/form/PhoneInput.tsx +148 -98
  374. package/src/modules/accounts/actions/account-management.action.ts +4 -4
  375. package/src/modules/accounts/services/account.service.ts +4 -4
@@ -0,0 +1,47 @@
1
+ function isValidEmail(value) {
2
+ const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
3
+ return emailRegex.test(value.trim());
4
+ }
5
+ function isNumericString(value) {
6
+ return /^\d+$/.test(value);
7
+ }
8
+ function clampNumber(value, min, max) {
9
+ return Math.min(Math.max(value, min), max);
10
+ }
11
+ function isInRange(value, min, max) {
12
+ return !isNaN(value) && value >= min && value <= max;
13
+ }
14
+ function isConfirmationMatch(input, expected) {
15
+ return input === expected;
16
+ }
17
+ function hasExactLength(value, length) {
18
+ return value.length === length;
19
+ }
20
+ function hasMinLength(value, minLength) {
21
+ return value.length >= minLength;
22
+ }
23
+ function areFieldsRequired(...values) {
24
+ return values.every((v) => v.trim().length > 0);
25
+ }
26
+ const MIN_PHONE_LENGTH = 14;
27
+ function isNonEmptyString(value) {
28
+ return value.trim().length > 0;
29
+ }
30
+ function trimOrDefault(value, fallback) {
31
+ const trimmed = value.trim();
32
+ return trimmed.length > 0 ? trimmed : fallback;
33
+ }
34
+ export {
35
+ MIN_PHONE_LENGTH,
36
+ areFieldsRequired,
37
+ clampNumber,
38
+ hasExactLength,
39
+ hasMinLength,
40
+ isConfirmationMatch,
41
+ isInRange,
42
+ isNonEmptyString,
43
+ isNumericString,
44
+ isValidEmail,
45
+ trimOrDefault
46
+ };
47
+ //# sourceMappingURL=common.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/validators/common.ts"],"sourcesContent":["export function isValidEmail(value: string): boolean {\r\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\r\n return emailRegex.test(value.trim());\r\n}\r\n\r\nexport function isNumericString(value: string): boolean {\r\n return /^\\d+$/.test(value);\r\n}\r\n\r\nexport function clampNumber(value: number, min: number, max: number): number {\r\n return Math.min(Math.max(value, min), max);\r\n}\r\n\r\nexport function isInRange(value: number, min: number, max: number): boolean {\r\n return !isNaN(value) && value >= min && value <= max;\r\n}\r\n\r\nexport function isConfirmationMatch(input: string, expected: string): boolean {\r\n return input === expected;\r\n}\r\n\r\nexport function hasExactLength(value: string, length: number): boolean {\r\n return value.length === length;\r\n}\r\n\r\nexport function hasMinLength(value: string, minLength: number): boolean {\r\n return value.length >= minLength;\r\n}\r\n\r\nexport function areFieldsRequired(...values: string[]): boolean {\r\n return values.every((v) => v.trim().length > 0);\r\n}\r\n\r\nexport const MIN_PHONE_LENGTH = 14;\r\n\r\nexport function isNonEmptyString(value: string): boolean {\r\n return value.trim().length > 0;\r\n}\r\n\r\nexport function trimOrDefault(value: string, fallback: string): string {\r\n const trimmed = value.trim();\r\n return trimmed.length > 0 ? trimmed : fallback;\r\n}\r\n"],"mappings":"AAAO,SAAS,aAAa,OAAwB;AACnD,QAAM,aAAa;AACnB,SAAO,WAAW,KAAK,MAAM,KAAK,CAAC;AACrC;AAEO,SAAS,gBAAgB,OAAwB;AACtD,SAAO,QAAQ,KAAK,KAAK;AAC3B;AAEO,SAAS,YAAY,OAAe,KAAa,KAAqB;AAC3E,SAAO,KAAK,IAAI,KAAK,IAAI,OAAO,GAAG,GAAG,GAAG;AAC3C;AAEO,SAAS,UAAU,OAAe,KAAa,KAAsB;AAC1E,SAAO,CAAC,MAAM,KAAK,KAAK,SAAS,OAAO,SAAS;AACnD;AAEO,SAAS,oBAAoB,OAAe,UAA2B;AAC5E,SAAO,UAAU;AACnB;AAEO,SAAS,eAAe,OAAe,QAAyB;AACrE,SAAO,MAAM,WAAW;AAC1B;AAEO,SAAS,aAAa,OAAe,WAA4B;AACtE,SAAO,MAAM,UAAU;AACzB;AAEO,SAAS,qBAAqB,QAA2B;AAC9D,SAAO,OAAO,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC;AAChD;AAEO,MAAM,mBAAmB;AAEzB,SAAS,iBAAiB,OAAwB;AACvD,SAAO,MAAM,KAAK,EAAE,SAAS;AAC/B;AAEO,SAAS,cAAc,OAAe,UAA0B;AACrE,QAAM,UAAU,MAAM,KAAK;AAC3B,SAAO,QAAQ,SAAS,IAAI,UAAU;AACxC;","names":[]}
@@ -0,0 +1,13 @@
1
+ function withAction(action) {
2
+ return async (...args) => {
3
+ const result = await action(...args);
4
+ if (!result.success) {
5
+ throw new Error(result.error ?? "Erro desconhecido");
6
+ }
7
+ return result.data;
8
+ };
9
+ }
10
+ export {
11
+ withAction
12
+ };
13
+ //# sourceMappingURL=withAction.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/withAction.ts"],"sourcesContent":["import type { ActionResult } from '../infra/api/types';\n\nexport function withAction<TArgs extends any[], TData>(\n action: (...args: TArgs) => Promise<ActionResult<TData>>\n): (...args: TArgs) => Promise<TData> {\n return async (...args) => {\n const result = await action(...args);\n if (!result.success) {\n throw new Error(result.error ?? 'Erro desconhecido');\n }\n return result.data as TData;\n };\n}\n"],"mappings":"AAEO,SAAS,WACd,QACoC;AACpC,SAAO,UAAU,SAAS;AACxB,UAAM,SAAS,MAAM,OAAO,GAAG,IAAI;AACnC,QAAI,CAAC,OAAO,SAAS;AACnB,YAAM,IAAI,MAAM,OAAO,SAAS,mBAAmB;AAAA,IACrD;AACA,WAAO,OAAO;AAAA,EAChB;AACF;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greatapps/common",
3
- "version": "1.1.173",
3
+ "version": "1.1.174",
4
4
  "description": "Shared library for GreatApps frontend applications",
5
5
  "main": "./dist/index.mjs",
6
6
  "types": "./src/index.ts",
@@ -1,69 +1,78 @@
1
- 'use client';
2
-
3
- import { useState, useCallback } from 'react';
4
- import { useForm } from 'react-hook-form';
5
- import { zodResolver } from '@hookform/resolvers/zod';
6
- import { toast } from 'sonner';
7
- import { Toast } from '../../ui/feedback/Toast';
8
- import { changePhoneSchema, type ChangePhoneFormData } from '../../../utils/validators/account';
9
- import { formatPhone } from '../../../utils/format/masks';
10
- import { requestPhoneChangeAction } from '../../../modules/accounts/actions/account-management.action';
11
-
12
- export default function useChangePhoneForm() {
13
- const [showVerification, setShowVerification] = useState(false);
14
-
15
- const form = useForm<ChangePhoneFormData>({
16
- resolver: zodResolver(changePhoneSchema),
17
- mode: 'onChange',
18
- defaultValues: { phone: '' },
19
- });
20
-
21
- const phoneValue = form.watch('phone');
22
- const errors = form.formState.errors;
23
- const isSubmitting = form.formState.isSubmitting;
24
-
25
- const handlePhoneChange = useCallback(
26
- (e: React.ChangeEvent<HTMLInputElement>) => {
27
- const formatted = formatPhone(e.target.value);
28
- form.setValue('phone', formatted, { shouldValidate: true });
29
- },
30
- [form]
31
- );
32
-
33
- const handleContinue = form.handleSubmit(async (data) => {
34
- const result = await requestPhoneChangeAction(data.phone);
35
-
36
- if (!result.success) {
37
- toast.custom((t) => (
38
- <Toast
39
- variant="error"
40
- message={result.error ?? 'Número já existente ou ocorreu um erro. Tente novamente mais tarde.'}
41
- toastId={t}
42
- />
43
- ));
44
- return;
45
- }
46
-
47
- setShowVerification(true);
48
- });
49
-
50
- const handleBack = useCallback(() => {
51
- setShowVerification(false);
52
- }, []);
53
-
54
- const resetForm = useCallback(() => {
55
- form.reset();
56
- setShowVerification(false);
57
- }, [form]);
58
-
59
- return {
60
- showVerification,
61
- phoneValue,
62
- isSubmitting,
63
- errors,
64
- handlePhoneChange,
65
- handleContinue,
66
- handleBack,
67
- resetForm,
68
- };
69
- }
1
+ 'use client';
2
+
3
+ import { useState, useCallback } from 'react';
4
+ import { useForm } from 'react-hook-form';
5
+ import { zodResolver } from '@hookform/resolvers/zod';
6
+ import { toast } from 'sonner';
7
+ import { Toast } from '../../ui/feedback/Toast';
8
+ import { changePhoneSchema, type ChangePhoneFormData } from '../../../utils/validators/account';
9
+ import { formatPhone } from '../../../utils/format/masks';
10
+ import { requestPhoneChangeAction } from '../../../modules/accounts/actions/account-management.action';
11
+ import { PHONE_COUNTRIES, type PhoneCountry } from '../../ui/form/PhoneInput';
12
+
13
+ export default function useChangePhoneForm() {
14
+ const [showVerification, setShowVerification] = useState(false);
15
+ const [selectedCountry, setSelectedCountry] = useState<PhoneCountry>(PHONE_COUNTRIES[0]);
16
+
17
+ const form = useForm<ChangePhoneFormData>({
18
+ resolver: zodResolver(changePhoneSchema),
19
+ mode: 'onChange',
20
+ defaultValues: { phone: '' },
21
+ });
22
+
23
+ const phoneValue = form.watch('phone');
24
+ const errors = form.formState.errors;
25
+ const isSubmitting = form.formState.isSubmitting;
26
+
27
+ const handlePhoneChange = useCallback(
28
+ (e: React.ChangeEvent<HTMLInputElement>) => {
29
+ const formatted = formatPhone(e.target.value);
30
+ form.setValue('phone', formatted, { shouldValidate: true });
31
+ },
32
+ [form]
33
+ );
34
+
35
+ const handleCountryChange = useCallback((country: PhoneCountry) => {
36
+ setSelectedCountry(country);
37
+ }, []);
38
+
39
+ const handleContinue = form.handleSubmit(async (data) => {
40
+ const result = await requestPhoneChangeAction(data.phone, selectedCountry.code);
41
+
42
+ if (!result.success) {
43
+ toast.custom((t) => (
44
+ <Toast
45
+ variant="error"
46
+ message={result.error ?? 'Número já existente ou ocorreu um erro. Tente novamente mais tarde.'}
47
+ toastId={t}
48
+ />
49
+ ));
50
+ return;
51
+ }
52
+
53
+ setShowVerification(true);
54
+ });
55
+
56
+ const handleBack = useCallback(() => {
57
+ setShowVerification(false);
58
+ }, []);
59
+
60
+ const resetForm = useCallback(() => {
61
+ form.reset();
62
+ setShowVerification(false);
63
+ setSelectedCountry(PHONE_COUNTRIES[0]);
64
+ }, [form]);
65
+
66
+ return {
67
+ showVerification,
68
+ phoneValue,
69
+ isSubmitting,
70
+ errors,
71
+ selectedCountry,
72
+ handlePhoneChange,
73
+ handleCountryChange,
74
+ handleContinue,
75
+ handleBack,
76
+ resetForm,
77
+ };
78
+ }
@@ -82,7 +82,8 @@ export function ChangeEmailModal({ open, onClose }: ChangeEmailModalProps) {
82
82
  <Dialog open={open} onOpenChange={handleClose}>
83
83
  <DialogContent
84
84
  showCloseButton={false}
85
- className="flex flex-col p-0 gap-0 max-w-full! border-0 rounded-t-2xl rounded-b-none h-dvh top-0! bottom-0! left-0! right-0! translate-x-0! translate-y-0! lg:max-w-125! lg:h-auto! lg:rounded-lg lg:border lg:top-[50%]! lg:left-[50%]! lg:right-auto! lg:bottom-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]!"
85
+ overlayClassName="z-[1002]"
86
+ className="flex flex-col p-0 gap-0 max-w-full! border-0 rounded-t-2xl rounded-b-none h-dvh top-0! bottom-0! left-0! right-0! translate-x-0! translate-y-0! lg:max-w-125! lg:h-auto! lg:rounded-lg lg:border lg:top-[50%]! lg:left-[50%]! lg:right-auto! lg:bottom-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]! z-[1003]!"
86
87
  >
87
88
  {showVerification ? (
88
89
  <DialogHeader className="flex flex-row items-center justify-between px-4 py-3 border-b border-gray-200 lg:border-b-0">