@greatapps/common 1.1.786 → 1.1.787

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 (98) hide show
  1. package/dist/components/layouts/AppMobileNavBar.mjs +64 -5
  2. package/dist/components/layouts/AppMobileNavBar.mjs.map +1 -1
  3. package/dist/components/layouts/AppNavBar.mjs +2 -0
  4. package/dist/components/layouts/AppNavBar.mjs.map +1 -1
  5. package/dist/components/layouts/GreatDomainIcon.mjs +40 -0
  6. package/dist/components/layouts/GreatDomainIcon.mjs.map +1 -0
  7. package/dist/components/layouts/NavBar.mjs +111 -52
  8. package/dist/components/layouts/NavBar.mjs.map +1 -1
  9. package/dist/components/ui/form/PhoneInput.mjs +1 -1
  10. package/dist/components/ui/form/PhoneInput.mjs.map +1 -1
  11. package/dist/handlers.mjs +2 -0
  12. package/dist/handlers.mjs.map +1 -1
  13. package/dist/i18n/messages/en-us.mjs +3 -1
  14. package/dist/i18n/messages/en-us.mjs.map +1 -1
  15. package/dist/i18n/messages/es-es.mjs +3 -1
  16. package/dist/i18n/messages/es-es.mjs.map +1 -1
  17. package/dist/i18n/messages/pt-br.mjs +3 -1
  18. package/dist/i18n/messages/pt-br.mjs.map +1 -1
  19. package/dist/index.mjs +9 -1
  20. package/dist/index.mjs.map +1 -1
  21. package/dist/infra/api/client.mjs +5 -1
  22. package/dist/infra/api/client.mjs.map +1 -1
  23. package/dist/infra/api/types.mjs +1 -1
  24. package/dist/infra/api/types.mjs.map +1 -1
  25. package/dist/infra/route/safe-route-handler.mjs +4 -1
  26. package/dist/infra/route/safe-route-handler.mjs.map +1 -1
  27. package/dist/modules/auth/utils/assert-account-not-frozen.mjs +6 -5
  28. package/dist/modules/auth/utils/assert-account-not-frozen.mjs.map +1 -1
  29. package/dist/modules/auth/utils/assert-management-subscription.mjs +7 -14
  30. package/dist/modules/auth/utils/assert-management-subscription.mjs.map +1 -1
  31. package/dist/modules/auth/utils/assert-paid-subscription.mjs +7 -12
  32. package/dist/modules/auth/utils/assert-paid-subscription.mjs.map +1 -1
  33. package/dist/modules/auth/utils/assert-subscription-addon.mjs +2 -10
  34. package/dist/modules/auth/utils/assert-subscription-addon.mjs.map +1 -1
  35. package/dist/modules/plans/hooks/use-plan-by-id.hook.mjs.map +1 -1
  36. package/dist/modules/subscriptions/actions/get-current-subscription.action.mjs +10 -0
  37. package/dist/modules/subscriptions/actions/get-current-subscription.action.mjs.map +1 -0
  38. package/dist/modules/subscriptions/constants/subscription.constants.mjs +2 -0
  39. package/dist/modules/subscriptions/constants/subscription.constants.mjs.map +1 -1
  40. package/dist/modules/subscriptions/handlers/current-subscription.handler.mjs +17 -0
  41. package/dist/modules/subscriptions/handlers/current-subscription.handler.mjs.map +1 -0
  42. package/dist/modules/subscriptions/hooks/find-active-subscription.hook.mjs +2 -13
  43. package/dist/modules/subscriptions/hooks/find-active-subscription.hook.mjs.map +1 -1
  44. package/dist/modules/subscriptions/hooks/use-current-subscription.hook.mjs +28 -0
  45. package/dist/modules/subscriptions/hooks/use-current-subscription.hook.mjs.map +1 -0
  46. package/dist/modules/subscriptions/services/subscriptions.service.mjs +26 -0
  47. package/dist/modules/subscriptions/services/subscriptions.service.mjs.map +1 -1
  48. package/dist/modules/subscriptions/types/subscription.type.mjs.map +1 -1
  49. package/dist/modules/subscriptions/utils/group-subscriptions-by-product.mjs +16 -0
  50. package/dist/modules/subscriptions/utils/group-subscriptions-by-product.mjs.map +1 -0
  51. package/dist/modules/subscriptions/utils/has-active-paid-subscription.mjs +1 -1
  52. package/dist/modules/subscriptions/utils/has-active-paid-subscription.mjs.map +1 -1
  53. package/dist/modules/subscriptions/utils/has-paid-subscription.mjs +1 -1
  54. package/dist/modules/subscriptions/utils/has-paid-subscription.mjs.map +1 -1
  55. package/dist/modules/subscriptions/utils/read-current-subscription.mjs +21 -0
  56. package/dist/modules/subscriptions/utils/read-current-subscription.mjs.map +1 -0
  57. package/dist/server.mjs +4 -0
  58. package/dist/server.mjs.map +1 -1
  59. package/dist/store/useMdSidebarStore.mjs +17 -4
  60. package/dist/store/useMdSidebarStore.mjs.map +1 -1
  61. package/dist/utils/safeServerAction.mjs +4 -1
  62. package/dist/utils/safeServerAction.mjs.map +1 -1
  63. package/dist/utils/withAction.mjs +2 -1
  64. package/dist/utils/withAction.mjs.map +1 -1
  65. package/package.json +1 -1
  66. package/src/components/layouts/AppMobileNavBar.tsx +90 -6
  67. package/src/components/layouts/AppNavBar.tsx +5 -1
  68. package/src/components/layouts/GreatDomainIcon.tsx +43 -0
  69. package/src/components/layouts/NavBar.tsx +160 -66
  70. package/src/components/ui/form/PhoneInput.tsx +1 -1
  71. package/src/handlers.ts +1 -0
  72. package/src/i18n/messages/en-us.ts +2 -0
  73. package/src/i18n/messages/es-es.ts +2 -0
  74. package/src/i18n/messages/pt-br.ts +2 -0
  75. package/src/index.ts +7 -1
  76. package/src/infra/api/client.ts +11 -3
  77. package/src/infra/api/types.ts +7 -5
  78. package/src/infra/route/safe-route-handler.ts +4 -1
  79. package/src/modules/auth/utils/assert-account-not-frozen.ts +7 -6
  80. package/src/modules/auth/utils/assert-management-subscription.ts +15 -23
  81. package/src/modules/auth/utils/assert-paid-subscription.ts +7 -15
  82. package/src/modules/auth/utils/assert-subscription-addon.ts +2 -12
  83. package/src/modules/plans/hooks/use-plan-by-id.hook.ts +1 -1
  84. package/src/modules/subscriptions/actions/get-current-subscription.action.ts +8 -0
  85. package/src/modules/subscriptions/constants/subscription.constants.ts +3 -0
  86. package/src/modules/subscriptions/handlers/current-subscription.handler.ts +16 -0
  87. package/src/modules/subscriptions/hooks/find-active-subscription.hook.ts +7 -17
  88. package/src/modules/subscriptions/hooks/use-current-subscription.hook.ts +38 -0
  89. package/src/modules/subscriptions/services/subscriptions.service.ts +34 -0
  90. package/src/modules/subscriptions/types/subscription.type.ts +2 -0
  91. package/src/modules/subscriptions/utils/group-subscriptions-by-product.ts +23 -0
  92. package/src/modules/subscriptions/utils/has-active-paid-subscription.ts +1 -2
  93. package/src/modules/subscriptions/utils/has-paid-subscription.ts +1 -2
  94. package/src/modules/subscriptions/utils/read-current-subscription.ts +34 -0
  95. package/src/server.ts +2 -0
  96. package/src/store/useMdSidebarStore.ts +20 -5
  97. package/src/utils/safeServerAction.ts +4 -6
  98. package/src/utils/withAction.ts +2 -1
package/dist/server.mjs CHANGED
@@ -22,6 +22,8 @@ import { findUserById } from "./modules/users/action/find-user-by-id.action";
22
22
  import { findCurrentAccount } from "./modules/accounts/actions/find-current-account.action";
23
23
  import { getAccountTokenAction } from "./modules/accounts/actions/get-account-token.action";
24
24
  import { listSubscriptionsAction } from "./modules/subscriptions/actions/list-subscriptions.action";
25
+ import { getCurrentSubscriptionAction } from "./modules/subscriptions/actions/get-current-subscription.action";
26
+ import { readCurrentSubscription } from "./modules/subscriptions/utils/read-current-subscription";
25
27
  import { ackFreezeNoticeAction } from "./modules/subscriptions/actions/ack-freeze-notice.action";
26
28
  import { calculateSubscriptionAction } from "./modules/subscriptions/actions/calculate-subscription.action";
27
29
  import { updateSubscriptionPlanAction } from "./modules/subscriptions/actions/update-subscription-plan.action";
@@ -110,6 +112,7 @@ export {
110
112
  generateTwoFactorAction,
111
113
  getAccountTokenAction,
112
114
  getClientInfoFromRequest,
115
+ getCurrentSubscriptionAction,
113
116
  getUserContext,
114
117
  hasActivePaidSubscription,
115
118
  hasSubscriptionExpired,
@@ -123,6 +126,7 @@ export {
123
126
  processImageAction,
124
127
  projectUsersService,
125
128
  projectsService,
129
+ readCurrentSubscription,
126
130
  removeProjectUserAction,
127
131
  requestEmailChangeAction,
128
132
  requestPhoneChangeAction,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/server.ts"],"sourcesContent":["import 'server-only';\r\n\r\n// API Client\r\nexport { ApiClient, api, apiClient } from './infra/api/client';\r\n\r\n// Services\r\nexport { authService } from './modules/auth/services/auth.service';\r\nexport { whitelabelService } from './modules/whitelabel/services/whitelabel.service';\r\nexport { revalidateWhitelabelAction } from './modules/whitelabel/actions/revalidate-whitelabel.action';\r\nexport { assertManagementPermission } from './modules/auth/utils/assert-management-permission';\r\nexport { assertManagementSubscription } from './modules/auth/utils/assert-management-subscription';\r\nexport { assertSubscriptionAddon } from './modules/auth/utils/assert-subscription-addon';\r\nexport { assertPaidSubscription } from './modules/auth/utils/assert-paid-subscription';\r\nexport { assertAccountNotFrozen } from './modules/auth/utils/assert-account-not-frozen';\r\nexport { subscriptionsService } from './modules/subscriptions/services/subscriptions.service';\r\nexport { plansService } from './modules/plans/services/plans.service';\r\nexport { cardsService } from './modules/cards/services/cards.service';\r\nexport { chargesService } from './modules/charges/services/charges.service';\r\nexport { iaCreditsService } from './modules/ia-credits/services/ia-credits.service';\r\n\r\n// Actions\r\nexport { findWhitelabel } from './modules/whitelabel/actions/find-whitelabel.action';\r\nexport { validateSessionAction } from './modules/auth/actions/validate-session.action';\r\nexport { socialGoogleLoginAction } from './modules/auth/actions/social-google-login.action';\r\nexport { socialGoogleOnboardingAction } from './modules/auth/actions/social-google-onboarding.action';\r\nexport { unlinkGoogleAction } from './modules/auth/actions/unlink-google.action';\r\nexport { findUserById } from './modules/users/action/find-user-by-id.action';\r\nexport { findCurrentAccount } from './modules/accounts/actions/find-current-account.action';\r\nexport { getAccountTokenAction } from './modules/accounts/actions/get-account-token.action';\r\nexport { listSubscriptionsAction } from './modules/subscriptions/actions/list-subscriptions.action';\r\nexport { ackFreezeNoticeAction } from './modules/subscriptions/actions/ack-freeze-notice.action';\r\nexport { calculateSubscriptionAction } from './modules/subscriptions/actions/calculate-subscription.action';\r\nexport { updateSubscriptionPlanAction } from './modules/subscriptions/actions/update-subscription-plan.action';\r\nexport { updateSubscriptionPaymentAction } from './modules/subscriptions/actions/update-subscription-payment.action';\r\nexport { createCardAction } from './modules/cards/actions/create-card.action';\r\nexport { createSetupIntentAction } from './modules/cards/actions/create-setup-intent.action';\r\nexport { chargeActionAction } from './modules/charges/actions/charge-action.action';\r\nexport { resolvePlanExtrasPrices } from './modules/subscriptions/utils/resolve-plan-extras-prices';\r\nexport { hasSubscriptionExpired } from './modules/subscriptions/utils/has-subscription-expired';\r\nexport { hasActivePaidSubscription } from './modules/subscriptions/utils/has-active-paid-subscription';\r\n\r\n// Project Services & Actions (server-only)\r\nexport { projectsService } from './modules/projects/services/projects.service';\r\nexport { listProjectsAction } from './modules/projects/actions/list-projects.action';\r\nexport { findProjectAction } from './modules/projects/actions/find-project.action';\r\nexport { createProjectAction } from './modules/projects/actions/create-project.action';\r\nexport { updateProjectAction } from './modules/projects/actions/update-project.action';\r\nexport { deleteProjectAction } from './modules/projects/actions/delete-project.action';\r\n\r\n// Project Users Services & Actions (server-only)\r\nexport { projectUsersService } from './modules/projects/services/project-users.service';\r\nexport { listProjectUsersAction } from './modules/projects/actions/list-project-users.action';\r\nexport { addProjectUserAction } from './modules/projects/actions/add-project-user.action';\r\nexport { removeProjectUserAction } from './modules/projects/actions/remove-project-user.action';\r\n\r\n// Account Services & Actions (server-only)\r\nexport { accountService } from './modules/accounts/services/account.service';\r\nexport { twoFactorService } from './modules/accounts/services/two-factor.service';\r\nexport {\r\n listAccountUsersAction,\r\n updateUserAction,\r\n updateAccountAction,\r\n updateAccountUserByIdAction,\r\n updateBillingDataAction,\r\n deleteAccountUserAction,\r\n deleteAccountAction,\r\n createAccountUserAction,\r\n changePasswordAction,\r\n requestEmailChangeAction,\r\n confirmEmailChangeAction,\r\n requestPhoneChangeAction,\r\n confirmPhoneChangeAction,\r\n generateTwoFactorAction,\r\n confirmTwoFactorAction,\r\n disableTwoFactorAction,\r\n} from './modules/accounts/actions/account-management.action';\r\n\r\n// Server Utils\r\nexport { getClientInfoFromRequest } from './infra/utils/client-info';\r\nexport { getUserContext } from './modules/auth/utils/get-user-context';\r\nexport { resolveLocale } from './i18n/resolve-locale';\r\nexport type { ResolveLocaleOptions } from './i18n/resolve-locale';\r\nexport { requireValidSession } from './modules/auth/utils/require-valid-session';\r\nexport { requireTokenNotExpired } from './modules/auth/utils/require-token-not-expired';\r\nexport { buildWlOverride, buildWlOverrideFromJwt } from './modules/auth/utils/build-wl-override';\r\nexport { safeServerAction } from './utils/safeServerAction';\r\nexport { safeMutationAction } from './utils/safeMutationAction';\r\n\r\n// Image Processing (server-side)\r\nexport { processImageAction } from './modules/images/actions/process-image.action';\r\nexport { processImage } from './modules/images/services/image-processing.service';\r\nexport type {\r\n ProcessImageInput,\r\n ProcessImageOutput,\r\n ProcessImageActionInput,\r\n ProcessImageActionOutput,\r\n} from './modules/images/types/image.type';\r\n"],"mappings":"AAAA,OAAO;AAGP,SAAS,WAAW,KAAK,iBAAiB;AAG1C,SAAS,mBAAmB;AAC5B,SAAS,yBAAyB;AAClC,SAAS,kCAAkC;AAC3C,SAAS,kCAAkC;AAC3C,SAAS,oCAAoC;AAC7C,SAAS,+BAA+B;AACxC,SAAS,8BAA8B;AACvC,SAAS,8BAA8B;AACvC,SAAS,4BAA4B;AACrC,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AAGjC,SAAS,sBAAsB;AAC/B,SAAS,6BAA6B;AACtC,SAAS,+BAA+B;AACxC,SAAS,oCAAoC;AAC7C,SAAS,0BAA0B;AACnC,SAAS,oBAAoB;AAC7B,SAAS,0BAA0B;AACnC,SAAS,6BAA6B;AACtC,SAAS,+BAA+B;AACxC,SAAS,6BAA6B;AACtC,SAAS,mCAAmC;AAC5C,SAAS,oCAAoC;AAC7C,SAAS,uCAAuC;AAChD,SAAS,wBAAwB;AACjC,SAAS,+BAA+B;AACxC,SAAS,0BAA0B;AACnC,SAAS,+BAA+B;AACxC,SAAS,8BAA8B;AACvC,SAAS,iCAAiC;AAG1C,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,yBAAyB;AAClC,SAAS,2BAA2B;AACpC,SAAS,2BAA2B;AACpC,SAAS,2BAA2B;AAGpC,SAAS,2BAA2B;AACpC,SAAS,8BAA8B;AACvC,SAAS,4BAA4B;AACrC,SAAS,+BAA+B;AAGxC,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AACjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,gCAAgC;AACzC,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAE9B,SAAS,2BAA2B;AACpC,SAAS,8BAA8B;AACvC,SAAS,iBAAiB,8BAA8B;AACxD,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AAGnC,SAAS,0BAA0B;AACnC,SAAS,oBAAoB;","names":[]}
1
+ {"version":3,"sources":["../src/server.ts"],"sourcesContent":["import 'server-only';\r\n\r\n// API Client\r\nexport { ApiClient, api, apiClient } from './infra/api/client';\r\n\r\n// Services\r\nexport { authService } from './modules/auth/services/auth.service';\r\nexport { whitelabelService } from './modules/whitelabel/services/whitelabel.service';\r\nexport { revalidateWhitelabelAction } from './modules/whitelabel/actions/revalidate-whitelabel.action';\r\nexport { assertManagementPermission } from './modules/auth/utils/assert-management-permission';\r\nexport { assertManagementSubscription } from './modules/auth/utils/assert-management-subscription';\r\nexport { assertSubscriptionAddon } from './modules/auth/utils/assert-subscription-addon';\r\nexport { assertPaidSubscription } from './modules/auth/utils/assert-paid-subscription';\r\nexport { assertAccountNotFrozen } from './modules/auth/utils/assert-account-not-frozen';\r\nexport { subscriptionsService } from './modules/subscriptions/services/subscriptions.service';\r\nexport { plansService } from './modules/plans/services/plans.service';\r\nexport { cardsService } from './modules/cards/services/cards.service';\r\nexport { chargesService } from './modules/charges/services/charges.service';\r\nexport { iaCreditsService } from './modules/ia-credits/services/ia-credits.service';\r\n\r\n// Actions\r\nexport { findWhitelabel } from './modules/whitelabel/actions/find-whitelabel.action';\r\nexport { validateSessionAction } from './modules/auth/actions/validate-session.action';\r\nexport { socialGoogleLoginAction } from './modules/auth/actions/social-google-login.action';\r\nexport { socialGoogleOnboardingAction } from './modules/auth/actions/social-google-onboarding.action';\r\nexport { unlinkGoogleAction } from './modules/auth/actions/unlink-google.action';\r\nexport { findUserById } from './modules/users/action/find-user-by-id.action';\r\nexport { findCurrentAccount } from './modules/accounts/actions/find-current-account.action';\r\nexport { getAccountTokenAction } from './modules/accounts/actions/get-account-token.action';\r\nexport { listSubscriptionsAction } from './modules/subscriptions/actions/list-subscriptions.action';\r\nexport { getCurrentSubscriptionAction } from './modules/subscriptions/actions/get-current-subscription.action';\r\nexport { readCurrentSubscription } from './modules/subscriptions/utils/read-current-subscription';\r\nexport { ackFreezeNoticeAction } from './modules/subscriptions/actions/ack-freeze-notice.action';\r\nexport { calculateSubscriptionAction } from './modules/subscriptions/actions/calculate-subscription.action';\r\nexport { updateSubscriptionPlanAction } from './modules/subscriptions/actions/update-subscription-plan.action';\r\nexport { updateSubscriptionPaymentAction } from './modules/subscriptions/actions/update-subscription-payment.action';\r\nexport { createCardAction } from './modules/cards/actions/create-card.action';\r\nexport { createSetupIntentAction } from './modules/cards/actions/create-setup-intent.action';\r\nexport { chargeActionAction } from './modules/charges/actions/charge-action.action';\r\nexport { resolvePlanExtrasPrices } from './modules/subscriptions/utils/resolve-plan-extras-prices';\r\nexport { hasSubscriptionExpired } from './modules/subscriptions/utils/has-subscription-expired';\r\nexport { hasActivePaidSubscription } from './modules/subscriptions/utils/has-active-paid-subscription';\r\n\r\n// Project Services & Actions (server-only)\r\nexport { projectsService } from './modules/projects/services/projects.service';\r\nexport { listProjectsAction } from './modules/projects/actions/list-projects.action';\r\nexport { findProjectAction } from './modules/projects/actions/find-project.action';\r\nexport { createProjectAction } from './modules/projects/actions/create-project.action';\r\nexport { updateProjectAction } from './modules/projects/actions/update-project.action';\r\nexport { deleteProjectAction } from './modules/projects/actions/delete-project.action';\r\n\r\n// Project Users Services & Actions (server-only)\r\nexport { projectUsersService } from './modules/projects/services/project-users.service';\r\nexport { listProjectUsersAction } from './modules/projects/actions/list-project-users.action';\r\nexport { addProjectUserAction } from './modules/projects/actions/add-project-user.action';\r\nexport { removeProjectUserAction } from './modules/projects/actions/remove-project-user.action';\r\n\r\n// Account Services & Actions (server-only)\r\nexport { accountService } from './modules/accounts/services/account.service';\r\nexport { twoFactorService } from './modules/accounts/services/two-factor.service';\r\nexport {\r\n listAccountUsersAction,\r\n updateUserAction,\r\n updateAccountAction,\r\n updateAccountUserByIdAction,\r\n updateBillingDataAction,\r\n deleteAccountUserAction,\r\n deleteAccountAction,\r\n createAccountUserAction,\r\n changePasswordAction,\r\n requestEmailChangeAction,\r\n confirmEmailChangeAction,\r\n requestPhoneChangeAction,\r\n confirmPhoneChangeAction,\r\n generateTwoFactorAction,\r\n confirmTwoFactorAction,\r\n disableTwoFactorAction,\r\n} from './modules/accounts/actions/account-management.action';\r\n\r\n// Server Utils\r\nexport { getClientInfoFromRequest } from './infra/utils/client-info';\r\nexport { getUserContext } from './modules/auth/utils/get-user-context';\r\nexport { resolveLocale } from './i18n/resolve-locale';\r\nexport type { ResolveLocaleOptions } from './i18n/resolve-locale';\r\nexport { requireValidSession } from './modules/auth/utils/require-valid-session';\r\nexport { requireTokenNotExpired } from './modules/auth/utils/require-token-not-expired';\r\nexport { buildWlOverride, buildWlOverrideFromJwt } from './modules/auth/utils/build-wl-override';\r\nexport { safeServerAction } from './utils/safeServerAction';\r\nexport { safeMutationAction } from './utils/safeMutationAction';\r\n\r\n// Image Processing (server-side)\r\nexport { processImageAction } from './modules/images/actions/process-image.action';\r\nexport { processImage } from './modules/images/services/image-processing.service';\r\nexport type {\r\n ProcessImageInput,\r\n ProcessImageOutput,\r\n ProcessImageActionInput,\r\n ProcessImageActionOutput,\r\n} from './modules/images/types/image.type';\r\n"],"mappings":"AAAA,OAAO;AAGP,SAAS,WAAW,KAAK,iBAAiB;AAG1C,SAAS,mBAAmB;AAC5B,SAAS,yBAAyB;AAClC,SAAS,kCAAkC;AAC3C,SAAS,kCAAkC;AAC3C,SAAS,oCAAoC;AAC7C,SAAS,+BAA+B;AACxC,SAAS,8BAA8B;AACvC,SAAS,8BAA8B;AACvC,SAAS,4BAA4B;AACrC,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AAGjC,SAAS,sBAAsB;AAC/B,SAAS,6BAA6B;AACtC,SAAS,+BAA+B;AACxC,SAAS,oCAAoC;AAC7C,SAAS,0BAA0B;AACnC,SAAS,oBAAoB;AAC7B,SAAS,0BAA0B;AACnC,SAAS,6BAA6B;AACtC,SAAS,+BAA+B;AACxC,SAAS,oCAAoC;AAC7C,SAAS,+BAA+B;AACxC,SAAS,6BAA6B;AACtC,SAAS,mCAAmC;AAC5C,SAAS,oCAAoC;AAC7C,SAAS,uCAAuC;AAChD,SAAS,wBAAwB;AACjC,SAAS,+BAA+B;AACxC,SAAS,0BAA0B;AACnC,SAAS,+BAA+B;AACxC,SAAS,8BAA8B;AACvC,SAAS,iCAAiC;AAG1C,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,yBAAyB;AAClC,SAAS,2BAA2B;AACpC,SAAS,2BAA2B;AACpC,SAAS,2BAA2B;AAGpC,SAAS,2BAA2B;AACpC,SAAS,8BAA8B;AACvC,SAAS,4BAA4B;AACrC,SAAS,+BAA+B;AAGxC,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AACjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,gCAAgC;AACzC,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAE9B,SAAS,2BAA2B;AACpC,SAAS,8BAA8B;AACvC,SAAS,iBAAiB,8BAA8B;AACxD,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AAGnC,SAAS,0BAA0B;AACnC,SAAS,oBAAoB;","names":[]}
@@ -1,11 +1,10 @@
1
1
  import { create } from "zustand";
2
+ import { useEffect } from "react";
2
3
  import { readStorage, writeStorage } from "../utils/browser/safe-storage";
3
4
  const STORAGE_KEY = "md-sidebar-expanded";
4
- function getInitialState() {
5
- return readStorage(STORAGE_KEY) === "true";
6
- }
7
5
  const useMdSidebarStore = create((set) => ({
8
- isExpanded: getInitialState(),
6
+ isExpanded: false,
7
+ _hydrated: false,
9
8
  toggle: () => set((state) => {
10
9
  const next = !state.isExpanded;
11
10
  writeStorage(STORAGE_KEY, String(next));
@@ -18,9 +17,23 @@ const useMdSidebarStore = create((set) => ({
18
17
  collapse: () => {
19
18
  writeStorage(STORAGE_KEY, "false");
20
19
  return set({ isExpanded: false });
20
+ },
21
+ _hydrate: () => {
22
+ const value = readStorage(STORAGE_KEY) === "true";
23
+ set({ isExpanded: value, _hydrated: true });
21
24
  }
22
25
  }));
26
+ function useMdSidebarHydration() {
27
+ const hydrate = useMdSidebarStore((s) => s._hydrate);
28
+ const hydrated = useMdSidebarStore((s) => s._hydrated);
29
+ useEffect(() => {
30
+ if (!hydrated) {
31
+ hydrate();
32
+ }
33
+ }, [hydrate, hydrated]);
34
+ }
23
35
  export {
36
+ useMdSidebarHydration,
24
37
  useMdSidebarStore
25
38
  };
26
39
  //# sourceMappingURL=useMdSidebarStore.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/store/useMdSidebarStore.ts"],"sourcesContent":["import { create } from \"zustand\";\nimport { readStorage, writeStorage } from \"../utils/browser/safe-storage\";\n\nconst STORAGE_KEY = \"md-sidebar-expanded\";\n\nfunction getInitialState(): boolean {\n return readStorage(STORAGE_KEY) === \"true\";\n}\n\ntype MdSidebarStore = {\n isExpanded: boolean;\n toggle: () => void;\n expand: () => void;\n collapse: () => void;\n};\n\nexport const useMdSidebarStore = create<MdSidebarStore>((set) => ({\n isExpanded: getInitialState(),\n toggle: () => set((state) => {\n const next = !state.isExpanded;\n writeStorage(STORAGE_KEY, String(next));\n return { isExpanded: next };\n }),\n expand: () => {\n writeStorage(STORAGE_KEY, \"true\");\n return set({ isExpanded: true });\n },\n collapse: () => {\n writeStorage(STORAGE_KEY, \"false\");\n return set({ isExpanded: false });\n },\n}));\n"],"mappings":"AAAA,SAAS,cAAc;AACvB,SAAS,aAAa,oBAAoB;AAE1C,MAAM,cAAc;AAEpB,SAAS,kBAA2B;AAChC,SAAO,YAAY,WAAW,MAAM;AACxC;AASO,MAAM,oBAAoB,OAAuB,CAAC,SAAS;AAAA,EAC9D,YAAY,gBAAgB;AAAA,EAC5B,QAAQ,MAAM,IAAI,CAAC,UAAU;AACzB,UAAM,OAAO,CAAC,MAAM;AACpB,iBAAa,aAAa,OAAO,IAAI,CAAC;AACtC,WAAO,EAAE,YAAY,KAAK;AAAA,EAC9B,CAAC;AAAA,EACD,QAAQ,MAAM;AACV,iBAAa,aAAa,MAAM;AAChC,WAAO,IAAI,EAAE,YAAY,KAAK,CAAC;AAAA,EACnC;AAAA,EACA,UAAU,MAAM;AACZ,iBAAa,aAAa,OAAO;AACjC,WAAO,IAAI,EAAE,YAAY,MAAM,CAAC;AAAA,EACpC;AACJ,EAAE;","names":[]}
1
+ {"version":3,"sources":["../../src/store/useMdSidebarStore.ts"],"sourcesContent":["import { create } from \"zustand\";\nimport { useEffect } from \"react\";\nimport { readStorage, writeStorage } from \"../utils/browser/safe-storage\";\n\nconst STORAGE_KEY = \"md-sidebar-expanded\";\n\ntype MdSidebarStore = {\n isExpanded: boolean;\n _hydrated: boolean;\n toggle: () => void;\n expand: () => void;\n collapse: () => void;\n _hydrate: () => void;\n};\n\nexport const useMdSidebarStore = create<MdSidebarStore>((set) => ({\n isExpanded: false,\n _hydrated: false,\n toggle: () => set((state) => {\n const next = !state.isExpanded;\n writeStorage(STORAGE_KEY, String(next));\n return { isExpanded: next };\n }),\n expand: () => {\n writeStorage(STORAGE_KEY, \"true\");\n return set({ isExpanded: true });\n },\n collapse: () => {\n writeStorage(STORAGE_KEY, \"false\");\n return set({ isExpanded: false });\n },\n _hydrate: () => {\n const value = readStorage(STORAGE_KEY) === \"true\";\n set({ isExpanded: value, _hydrated: true });\n },\n}));\n\nexport function useMdSidebarHydration() {\n const hydrate = useMdSidebarStore((s) => s._hydrate);\n const hydrated = useMdSidebarStore((s) => s._hydrated);\n\n useEffect(() => {\n if (!hydrated) {\n hydrate();\n }\n }, [hydrate, hydrated]);\n}\n"],"mappings":"AAAA,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAC1B,SAAS,aAAa,oBAAoB;AAE1C,MAAM,cAAc;AAWb,MAAM,oBAAoB,OAAuB,CAAC,SAAS;AAAA,EAC9D,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,QAAQ,MAAM,IAAI,CAAC,UAAU;AACzB,UAAM,OAAO,CAAC,MAAM;AACpB,iBAAa,aAAa,OAAO,IAAI,CAAC;AACtC,WAAO,EAAE,YAAY,KAAK;AAAA,EAC9B,CAAC;AAAA,EACD,QAAQ,MAAM;AACV,iBAAa,aAAa,MAAM;AAChC,WAAO,IAAI,EAAE,YAAY,KAAK,CAAC;AAAA,EACnC;AAAA,EACA,UAAU,MAAM;AACZ,iBAAa,aAAa,OAAO;AACjC,WAAO,IAAI,EAAE,YAAY,MAAM,CAAC;AAAA,EACpC;AAAA,EACA,UAAU,MAAM;AACZ,UAAM,QAAQ,YAAY,WAAW,MAAM;AAC3C,QAAI,EAAE,YAAY,OAAO,WAAW,KAAK,CAAC;AAAA,EAC9C;AACJ,EAAE;AAEK,SAAS,wBAAwB;AACpC,QAAM,UAAU,kBAAkB,CAAC,MAAM,EAAE,QAAQ;AACnD,QAAM,WAAW,kBAAkB,CAAC,MAAM,EAAE,SAAS;AAErD,YAAU,MAAM;AACZ,QAAI,CAAC,UAAU;AACX,cAAQ;AAAA,IACZ;AAAA,EACJ,GAAG,CAAC,SAAS,QAAQ,CAAC;AAC1B;","names":[]}
@@ -6,7 +6,10 @@ async function safeServerAction(fn) {
6
6
  return { success: true, data };
7
7
  } catch (error) {
8
8
  if (isRedirectError(error)) throw error;
9
- const message = error instanceof ApiError ? error.message : error instanceof Error ? error.message : "Erro desconhecido";
9
+ if (error instanceof ApiError) {
10
+ return { success: false, error: error.message, code: error.code, statusCode: error.statusCode };
11
+ }
12
+ const message = error instanceof Error ? error.message : "Erro desconhecido";
10
13
  return { success: false, error: message };
11
14
  }
12
15
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/safeServerAction.ts"],"sourcesContent":["import { isRedirectError } from 'next/dist/client/components/redirect-error';\nimport { ApiError } from '../infra/api/types';\nimport type { ActionResult } from '../infra/api/types';\n\nexport async function safeServerAction<T>(\n fn: () => Promise<T>\n): Promise<ActionResult<T>> {\n try {\n const data = await fn();\n return { success: true, data };\n } catch (error) {\n if (isRedirectError(error)) throw error;\n const message =\n error instanceof ApiError\n ? error.message\n : error instanceof Error\n ? error.message\n : 'Erro desconhecido';\n return { success: false, error: message };\n }\n}\n"],"mappings":"AAAA,SAAS,uBAAuB;AAChC,SAAS,gBAAgB;AAGzB,eAAsB,iBACpB,IAC0B;AAC1B,MAAI;AACF,UAAM,OAAO,MAAM,GAAG;AACtB,WAAO,EAAE,SAAS,MAAM,KAAK;AAAA,EAC/B,SAAS,OAAO;AACd,QAAI,gBAAgB,KAAK,EAAG,OAAM;AAClC,UAAM,UACJ,iBAAiB,WACb,MAAM,UACN,iBAAiB,QACf,MAAM,UACN;AACR,WAAO,EAAE,SAAS,OAAO,OAAO,QAAQ;AAAA,EAC1C;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/utils/safeServerAction.ts"],"sourcesContent":["import { isRedirectError } from 'next/dist/client/components/redirect-error';\nimport { ApiError } from '../infra/api/types';\nimport type { ActionResult } from '../infra/api/types';\n\nexport async function safeServerAction<T>(\n fn: () => Promise<T>\n): Promise<ActionResult<T>> {\n try {\n const data = await fn();\n return { success: true, data };\n } catch (error) {\n if (isRedirectError(error)) throw error;\n if (error instanceof ApiError) {\n return { success: false, error: error.message, code: error.code, statusCode: error.statusCode };\n }\n const message = error instanceof Error ? error.message : 'Erro desconhecido';\n return { success: false, error: message };\n }\n}\n"],"mappings":"AAAA,SAAS,uBAAuB;AAChC,SAAS,gBAAgB;AAGzB,eAAsB,iBACpB,IAC0B;AAC1B,MAAI;AACF,UAAM,OAAO,MAAM,GAAG;AACtB,WAAO,EAAE,SAAS,MAAM,KAAK;AAAA,EAC/B,SAAS,OAAO;AACd,QAAI,gBAAgB,KAAK,EAAG,OAAM;AAClC,QAAI,iBAAiB,UAAU;AAC7B,aAAO,EAAE,SAAS,OAAO,OAAO,MAAM,SAAS,MAAM,MAAM,MAAM,YAAY,MAAM,WAAW;AAAA,IAChG;AACA,UAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU;AACzD,WAAO,EAAE,SAAS,OAAO,OAAO,QAAQ;AAAA,EAC1C;AACF;","names":[]}
@@ -1,8 +1,9 @@
1
+ import { ApiError } from "../infra/api/types";
1
2
  function withAction(action) {
2
3
  return async (...args) => {
3
4
  const result = await action(...args);
4
5
  if (!result.success) {
5
- throw new Error(result.error ?? "Erro desconhecido");
6
+ throw new ApiError(result.error, result.code, result.statusCode);
6
7
  }
7
8
  return result.data;
8
9
  };
@@ -1 +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":[]}
1
+ {"version":3,"sources":["../../src/utils/withAction.ts"],"sourcesContent":["import { ApiError } from '../infra/api/types';\nimport 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 ApiError(result.error, result.code, result.statusCode);\n }\n return result.data as TData;\n };\n}\n"],"mappings":"AAAA,SAAS,gBAAgB;AAGlB,SAAS,WACd,QACoC;AACpC,SAAO,UAAU,SAAS;AACxB,UAAM,SAAS,MAAM,OAAO,GAAG,IAAI;AACnC,QAAI,CAAC,OAAO,SAAS;AACnB,YAAM,IAAI,SAAS,OAAO,OAAO,OAAO,MAAM,OAAO,UAAU;AAAA,IACjE;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.786",
3
+ "version": "1.1.787",
4
4
  "description": "Shared library for GreatApps frontend applications",
5
5
  "main": "./dist/index.mjs",
6
6
  "types": "./src/index.ts",
@@ -2,8 +2,10 @@
2
2
 
3
3
  import { ReactNode } from "react";
4
4
  import Image from "next/image";
5
+ import { useTranslations } from "next-intl";
5
6
  import { IconMenu2, IconX } from "@tabler/icons-react";
6
7
  import { ProfilePopover } from "./ProfilePopover";
8
+ import { GreatDomainIcon } from "./GreatDomainIcon";
7
9
  import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/overlay/Tooltip";
8
10
  import { useMobileNavbarSheet } from "../../store/useMobileNavbarSheet";
9
11
  import {
@@ -15,11 +17,13 @@ import type { ProfileMenuItem } from "./ProfilePopover";
15
17
 
16
18
  export interface AppMobileNavBarProps {
17
19
  /** Which app is currently active — controls which icon gets the indicator */
18
- activeApp?: "gapps" | "gpages";
20
+ activeApp?: "gapps" | "gpages" | "gdomain";
19
21
  /** Called when the GreatApps logo is clicked */
20
22
  onLogoClick?: () => void;
21
23
  /** Called when the app icon (e.g. GreatPages) is clicked */
22
24
  onAppIconClick?: () => void;
25
+ /** Called when the GreatDomain icon is clicked; without it the icon is not rendered (app flag) */
26
+ onDomainIconClick?: () => void;
23
27
  /** Extra slot rendered after the app icon (e.g. project selector) */
24
28
  extraLeftSlot?: ReactNode;
25
29
  menuItems?: ProfileMenuItem[];
@@ -30,10 +34,12 @@ export function AppMobileNavBar({
30
34
  activeApp,
31
35
  onLogoClick,
32
36
  onAppIconClick,
37
+ onDomainIconClick,
33
38
  extraLeftSlot,
34
39
  menuItems = [],
35
40
  showMenuToggle = true,
36
41
  }: AppMobileNavBarProps) {
42
+ const translate = useTranslations();
37
43
  const { isOpen, toggle } = useMobileNavbarSheet();
38
44
  const { whitelabel } = useWhitelabel();
39
45
  const isDefaultWl = useIsDefaultWhitelabel();
@@ -42,6 +48,7 @@ export function AppMobileNavBar({
42
48
 
43
49
  const isGappsActive = activeApp === "gapps";
44
50
  const isGpagesActive = activeApp === "gpages";
51
+ const isGdomainActive = activeApp === "gdomain";
45
52
 
46
53
  const wlIcon = whitelabel?.secondary_logo ? (
47
54
  <Image
@@ -80,9 +87,9 @@ export function AppMobileNavBar({
80
87
 
81
88
  return (
82
89
  <div className="fixed top-0 left-0 right-0 flex md:hidden items-center justify-between p-4 bg-white z-50 border-b border-gray-200">
83
- <div className="flex items-center gap-1.5">
90
+ <div className="flex items-center gap-1.5 min-w-0">
84
91
  {/* GreatApps logo */}
85
- <div className="relative">
92
+ <div className="relative shrink-0">
86
93
  <Tooltip>
87
94
  <TooltipTrigger asChild>
88
95
  <div
@@ -119,7 +126,7 @@ export function AppMobileNavBar({
119
126
  </div>
120
127
 
121
128
  {/* GreatPages icon */}
122
- <div className="relative">
129
+ <div className="relative shrink-0">
123
130
  <Tooltip>
124
131
  <TooltipTrigger asChild>
125
132
  <div
@@ -187,9 +194,86 @@ export function AppMobileNavBar({
187
194
  />
188
195
  </div>
189
196
 
190
- {extraLeftSlot}
197
+ {/* GreatDomain icon */}
198
+ {onDomainIconClick ? (
199
+ <div className="relative shrink-0">
200
+ <Tooltip>
201
+ <TooltipTrigger asChild>
202
+ <div
203
+ aria-label={
204
+ isDefaultWl
205
+ ? translate("common.layout.navbar.greatDomain")
206
+ : translate("common.layout.navbar.domains")
207
+ }
208
+ className={cn(
209
+ "size-10 rounded-[10px] flex items-center justify-center border-2 ring-2 transition-colors duration-300",
210
+ isGdomainActive
211
+ ? isDefaultWl
212
+ ? "bg-[#EDE9FE] border-white ring-[#C092FF]"
213
+ : "border-white ring-transparent"
214
+ : isDefaultWl
215
+ ? "hover:bg-gray-100 border-transparent ring-transparent"
216
+ : "border-transparent ring-transparent",
217
+ "cursor-pointer",
218
+ )}
219
+ style={
220
+ !isDefaultWl
221
+ ? {
222
+ backgroundColor: primaryColor,
223
+ boxShadow: isGdomainActive
224
+ ? `0 0 0 2px ${primaryColor}40`
225
+ : undefined,
226
+ opacity: !isGdomainActive ? 0.2 : undefined,
227
+ }
228
+ : undefined
229
+ }
230
+ onClick={onDomainIconClick}
231
+ >
232
+ {isDefaultWl ? (
233
+ <GreatDomainIcon active={isGdomainActive} />
234
+ ) : (
235
+ <svg
236
+ xmlns="http://www.w3.org/2000/svg"
237
+ width="24"
238
+ height="24"
239
+ viewBox="0 0 24 24"
240
+ fill="none"
241
+ stroke="white"
242
+ strokeWidth="2"
243
+ strokeLinecap="round"
244
+ strokeLinejoin="round"
245
+ >
246
+ <path d="M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0" />
247
+ <path d="M3.6 9h16.8" />
248
+ <path d="M3.6 15h16.8" />
249
+ <path d="M11.5 3a17 17 0 0 0 0 18" />
250
+ <path d="M12.5 3a17 17 0 0 1 0 18" />
251
+ </svg>
252
+ )}
253
+ </div>
254
+ </TooltipTrigger>
255
+ <TooltipContent side="bottom">
256
+ {isDefaultWl
257
+ ? translate("common.layout.navbar.greatDomain")
258
+ : translate("common.layout.navbar.domains")}
259
+ </TooltipContent>
260
+ </Tooltip>
261
+ <div
262
+ className={cn(
263
+ "absolute -bottom-[17px] left-1/2 -translate-x-1/2 w-5 h-[3px] rounded-t-xl transition-opacity duration-300",
264
+ isDefaultWl ? "bg-[#984DFF]" : "",
265
+ isGdomainActive ? "opacity-100" : "opacity-0",
266
+ )}
267
+ style={!isDefaultWl ? { backgroundColor: primaryColor } : undefined}
268
+ />
269
+ </div>
270
+ ) : null}
271
+
272
+ {extraLeftSlot ? (
273
+ <div className="min-w-0 shrink [&>*]:max-w-full">{extraLeftSlot}</div>
274
+ ) : null}
191
275
  </div>
192
- <div className="flex items-center gap-1.5">
276
+ <div className="flex items-center gap-1.5 shrink-0">
193
277
  <ProfilePopover
194
278
  side="bottom"
195
279
  align="end"
@@ -8,8 +8,10 @@ import type { ProfileMenuItem } from "./ProfilePopover";
8
8
  export interface AppNavBarProps {
9
9
  logoHref: string;
10
10
  appIconHref: string;
11
+ /** Sem href o ícone do GreatDomain não é renderizado: é a flag do app. */
12
+ domainIconHref?: string;
11
13
  /** Which app is currently active — controls which icon gets the indicator */
12
- activeApp?: "gapps" | "gpages";
14
+ activeApp?: "gapps" | "gpages" | "gdomain";
13
15
  showExpandButton?: boolean;
14
16
  onExpandClick?: () => void;
15
17
  menuItems?: ProfileMenuItem[];
@@ -19,6 +21,7 @@ export interface AppNavBarProps {
19
21
  export function AppNavBar({
20
22
  logoHref,
21
23
  appIconHref,
24
+ domainIconHref,
22
25
  activeApp,
23
26
  showExpandButton = false,
24
27
  onExpandClick,
@@ -29,6 +32,7 @@ export function AppNavBar({
29
32
  <NavBar
30
33
  logoHref={logoHref}
31
34
  appIconHref={appIconHref}
35
+ domainIconHref={domainIconHref}
32
36
  activeApp={activeApp}
33
37
  showExpandButton={showExpandButton}
34
38
  onExpandClick={onExpandClick}
@@ -0,0 +1,43 @@
1
+ "use client";
2
+
3
+ import { cn } from "../../infra/utils/clsx";
4
+
5
+ type GreatDomainIconProps = {
6
+ /** Em repouso o círculo é #650CE4; só no estado ativo vira #984DFF. */
7
+ active?: boolean;
8
+ className?: string;
9
+ };
10
+
11
+ /**
12
+ * Glifo do GreatDomain — geometria exportada do Figma (node 5929:2700), 23×23.
13
+ * O círculo só troca de cor quando ativo. No hover o container ganha fundo cinza
14
+ * (igual ao GreatPages) e o glifo fica como está.
15
+ */
16
+ function GreatDomainIcon({ active, className }: GreatDomainIconProps) {
17
+ return (
18
+ <svg
19
+ width="23"
20
+ height="23"
21
+ viewBox="0 0 23 23"
22
+ fill="none"
23
+ xmlns="http://www.w3.org/2000/svg"
24
+ className={className}
25
+ aria-hidden="true"
26
+ >
27
+ <path
28
+ d="M11.8444 17.0777C11.8444 20.3487 9.19292 23.0003 5.92218 23.0003C2.65145 23.0003 0 20.3487 0 17.0777C0 13.8068 2.65145 11.1551 5.92218 11.1551C9.19292 11.1551 11.8444 13.8068 11.8444 17.0777Z"
29
+ className={cn(
30
+ "transition-colors duration-300",
31
+ active ? "fill-[#984DFF]" : "fill-[#650CE4]",
32
+ )}
33
+ />
34
+ <path
35
+ d="M11.8436 3.06666C11.8436 1.37299 13.2166 0 14.9103 0H19.9331C21.6267 0 22.9997 1.37299 22.9997 3.06666V19.9333C22.9997 21.6269 21.6267 22.9999 19.9331 22.9999H14.9103C13.2166 22.9999 11.8436 21.6269 11.8436 19.9333V3.06666Z"
36
+ fill="#C9B2FF"
37
+ />
38
+ </svg>
39
+ );
40
+ }
41
+
42
+ export { GreatDomainIcon };
43
+ export type { GreatDomainIconProps };