@greatapps/common 1.1.674 → 1.1.675
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/account/ConfigurationsMyAccountModal.mjs +6 -8
- package/dist/components/account/ConfigurationsMyAccountModal.mjs.map +1 -1
- package/dist/components/account/ConfirmDeleteAccountModal.mjs +19 -20
- package/dist/components/account/ConfirmDeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/ConfirmGlobalPreferencesModal.mjs +11 -10
- package/dist/components/account/ConfirmGlobalPreferencesModal.mjs.map +1 -1
- package/dist/components/account/DeleteAccountModal.mjs +28 -34
- package/dist/components/account/DeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/DisableTwoFactorAuthModal.mjs +5 -7
- package/dist/components/account/DisableTwoFactorAuthModal.mjs.map +1 -1
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs +9 -8
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/TwoFactorAuthModal.mjs +23 -22
- package/dist/components/account/TwoFactorAuthModal.mjs.map +1 -1
- package/dist/components/account/constants.mjs +4 -4
- package/dist/components/account/constants.mjs.map +1 -1
- package/dist/components/account/hooks/useChangeEmailForm.mjs +3 -5
- package/dist/components/account/hooks/useChangeEmailForm.mjs.map +1 -1
- package/dist/components/account/hooks/useChangePasswordForm.mjs +3 -26
- package/dist/components/account/hooks/useChangePasswordForm.mjs.map +1 -1
- package/dist/components/account/hooks/useChangePhoneForm.mjs +9 -18
- package/dist/components/account/hooks/useChangePhoneForm.mjs.map +1 -1
- package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs +3 -26
- package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs.map +1 -1
- package/dist/components/account/hooks/useOtpVerification.mjs +3 -19
- package/dist/components/account/hooks/useOtpVerification.mjs.map +1 -1
- package/dist/components/account/hooks/useTwoFactorAuthForm.mjs +4 -27
- package/dist/components/account/hooks/useTwoFactorAuthForm.mjs.map +1 -1
- package/dist/components/account/sections/ChangeEmailModal.mjs +28 -25
- package/dist/components/account/sections/ChangeEmailModal.mjs.map +1 -1
- package/dist/components/account/sections/ChangePasswordSection.mjs +6 -8
- package/dist/components/account/sections/ChangePasswordSection.mjs.map +1 -1
- package/dist/components/account/sections/ChangePhoneModal.mjs +27 -24
- package/dist/components/account/sections/ChangePhoneModal.mjs.map +1 -1
- package/dist/components/account/sections/MyProfileSection.mjs +22 -37
- package/dist/components/account/sections/MyProfileSection.mjs.map +1 -1
- package/dist/components/account/sections/PreferencesSection.mjs +24 -48
- package/dist/components/account/sections/PreferencesSection.mjs.map +1 -1
- package/dist/components/account/sections/SecuritySection.mjs +9 -11
- package/dist/components/account/sections/SecuritySection.mjs.map +1 -1
- package/dist/components/account/sections/TokenSection.mjs +8 -24
- package/dist/components/account/sections/TokenSection.mjs.map +1 -1
- package/dist/components/layouts/AppMobileNavBar.mjs +148 -2
- package/dist/components/layouts/AppMobileNavBar.mjs.map +1 -1
- package/dist/components/layouts/NavBar.mjs +3 -5
- package/dist/components/layouts/NavBar.mjs.map +1 -1
- package/dist/components/layouts/NotificationsPopover.mjs +3 -5
- package/dist/components/layouts/NotificationsPopover.mjs.map +1 -1
- package/dist/components/layouts/ProfilePopover.mjs +4 -6
- package/dist/components/layouts/ProfilePopover.mjs.map +1 -1
- package/dist/components/layouts/UsersSelectorPopover.mjs +7 -9
- package/dist/components/layouts/UsersSelectorPopover.mjs.map +1 -1
- package/dist/components/modals/BuyCreditsModal.mjs +18 -17
- package/dist/components/modals/BuyCreditsModal.mjs.map +1 -1
- package/dist/components/modals/CreditsDisabledModal.mjs +4 -6
- package/dist/components/modals/CreditsDisabledModal.mjs.map +1 -1
- package/dist/components/modals/PaidPlanRequiredModal.mjs +3 -5
- package/dist/components/modals/PaidPlanRequiredModal.mjs.map +1 -1
- package/dist/components/modals/cards/AddCardModal.mjs +24 -27
- package/dist/components/modals/cards/AddCardModal.mjs.map +1 -1
- package/dist/components/modals/cards/CannotDeleteCardModal.mjs +7 -9
- package/dist/components/modals/cards/CannotDeleteCardModal.mjs.map +1 -1
- package/dist/components/modals/cards/CardFormFields.mjs +22 -25
- package/dist/components/modals/cards/CardFormFields.mjs.map +1 -1
- package/dist/components/modals/cards/DeleteCardModal.mjs +8 -10
- package/dist/components/modals/cards/DeleteCardModal.mjs.map +1 -1
- package/dist/components/navigation/CancelledSubscriptionBanner.mjs +2 -4
- package/dist/components/navigation/CancelledSubscriptionBanner.mjs.map +1 -1
- package/dist/components/navigation/OverdueInvoiceBanner.mjs +2 -4
- package/dist/components/navigation/OverdueInvoiceBanner.mjs.map +1 -1
- package/dist/components/navigation/PendingCancellationBanner.mjs +6 -4
- package/dist/components/navigation/PendingCancellationBanner.mjs.map +1 -1
- package/dist/components/navigation/ProjectSelectorPopover.mjs +6 -8
- package/dist/components/navigation/ProjectSelectorPopover.mjs.map +1 -1
- package/dist/components/navigation/UpcomingInvoiceBanner.mjs +6 -4
- package/dist/components/navigation/UpcomingInvoiceBanner.mjs.map +1 -1
- package/dist/components/navigation/subcomponents/BottomLinks.mjs +3 -5
- package/dist/components/navigation/subcomponents/BottomLinks.mjs.map +1 -1
- package/dist/components/navigation/subcomponents/CreditsCard.mjs +1 -3
- package/dist/components/navigation/subcomponents/CreditsCard.mjs.map +1 -1
- package/dist/components/navigation/subcomponents/PlanCard.mjs +1 -3
- package/dist/components/navigation/subcomponents/PlanCard.mjs.map +1 -1
- package/dist/components/navigation/subcomponents/ProjectSelector.mjs +3 -5
- package/dist/components/navigation/subcomponents/ProjectSelector.mjs.map +1 -1
- package/dist/components/pages/NotFoundPage.mjs +3 -5
- package/dist/components/pages/NotFoundPage.mjs.map +1 -1
- package/dist/components/pages/notifications/Notifications.mjs +10 -13
- package/dist/components/pages/notifications/Notifications.mjs.map +1 -1
- package/dist/components/ui/buttons/CopyButton.mjs +5 -9
- package/dist/components/ui/buttons/CopyButton.mjs.map +1 -1
- package/dist/components/ui/data-display/CardItem.mjs +5 -7
- package/dist/components/ui/data-display/CardItem.mjs.map +1 -1
- package/dist/components/ui/data-display/PaymentInfoCard.mjs +8 -10
- package/dist/components/ui/data-display/PaymentInfoCard.mjs.map +1 -1
- package/dist/components/ui/feedback/CircularProgress.mjs.map +1 -1
- package/dist/components/ui/feedback/DefaultCircularProgress.mjs +1 -3
- package/dist/components/ui/feedback/DefaultCircularProgress.mjs.map +1 -1
- package/dist/components/ui/form/ComboboxField.mjs +6 -11
- package/dist/components/ui/form/ComboboxField.mjs.map +1 -1
- package/dist/components/ui/form/DatePicker.mjs +2 -5
- package/dist/components/ui/form/DatePicker.mjs.map +1 -1
- package/dist/components/ui/form/DateRangePicker.mjs +2 -5
- package/dist/components/ui/form/DateRangePicker.mjs.map +1 -1
- package/dist/components/ui/form/PhoneInput.mjs +3 -5
- package/dist/components/ui/form/PhoneInput.mjs.map +1 -1
- package/dist/components/ui/form/SelectField.mjs +3 -6
- package/dist/components/ui/form/SelectField.mjs.map +1 -1
- package/dist/components/widgets/ImageUpload/ImageCropModal.mjs +18 -11
- package/dist/components/widgets/ImageUpload/ImageCropModal.mjs.map +1 -1
- package/dist/components/widgets/ImageUpload/ImageTooSmallModal.mjs +15 -6
- package/dist/components/widgets/ImageUpload/ImageTooSmallModal.mjs.map +1 -1
- package/dist/index.mjs +2 -16
- package/dist/index.mjs.map +1 -1
- package/dist/modules/cards/hooks/handle-delete-card.hook.mjs +1 -2
- package/dist/modules/cards/hooks/handle-delete-card.hook.mjs.map +1 -1
- package/dist/modules/images/utils/validate-image.mjs +8 -8
- package/dist/modules/images/utils/validate-image.mjs.map +1 -1
- package/dist/modules/plans/types/plan.type.mjs +0 -3
- package/dist/modules/plans/types/plan.type.mjs.map +1 -1
- package/dist/modules/plans/utils/map-api-plan-to-ui.mjs +34 -56
- package/dist/modules/plans/utils/map-api-plan-to-ui.mjs.map +1 -1
- package/dist/modules/subscriptions/utils/periodicity.mjs +14 -20
- package/dist/modules/subscriptions/utils/periodicity.mjs.map +1 -1
- package/dist/providers/auth.provider.mjs +1 -9
- package/dist/providers/auth.provider.mjs.map +1 -1
- package/dist/server.mjs +0 -2
- package/dist/server.mjs.map +1 -1
- package/dist/utils/format/currency.mjs +4 -32
- package/dist/utils/format/currency.mjs.map +1 -1
- package/dist/utils/intl/locales.mjs +2 -3
- package/dist/utils/intl/locales.mjs.map +1 -1
- package/package.json +1 -7
- package/src/components/account/ConfigurationsMyAccountModal.tsx +6 -10
- package/src/components/account/ConfirmDeleteAccountModal.tsx +13 -22
- package/src/components/account/ConfirmGlobalPreferencesModal.tsx +10 -12
- package/src/components/account/DeleteAccountModal.tsx +24 -34
- package/src/components/account/DisableTwoFactorAuthModal.tsx +6 -11
- package/src/components/account/IsntPossibleDeleteAccountModal.tsx +6 -8
- package/src/components/account/TwoFactorAuthModal.tsx +29 -33
- package/src/components/account/constants.ts +5 -8
- package/src/components/account/hooks/useChangeEmailForm.tsx +3 -5
- package/src/components/account/hooks/useChangePasswordForm.tsx +6 -20
- package/src/components/account/hooks/useChangePhoneForm.tsx +10 -16
- package/src/components/account/hooks/useDisableTwoFactorAuthForm.tsx +6 -20
- package/src/components/account/hooks/useOtpVerification.tsx +4 -16
- package/src/components/account/hooks/useTwoFactorAuthForm.tsx +7 -21
- package/src/components/account/sections/ChangeEmailModal.tsx +21 -35
- package/src/components/account/sections/ChangePasswordSection.tsx +6 -10
- package/src/components/account/sections/ChangePhoneModal.tsx +22 -50
- package/src/components/account/sections/MyProfileSection.tsx +23 -37
- package/src/components/account/sections/PreferencesSection.tsx +25 -52
- package/src/components/account/sections/SecuritySection.tsx +10 -19
- package/src/components/account/sections/TokenSection.tsx +10 -22
- package/src/components/layouts/AppMobileNavBar.tsx +154 -1
- package/src/components/layouts/NavBar.tsx +3 -5
- package/src/components/layouts/NotificationsPopover.tsx +3 -5
- package/src/components/layouts/ProfilePopover.tsx +4 -6
- package/src/components/layouts/UsersSelectorPopover.tsx +7 -9
- package/src/components/modals/BuyCreditsModal.tsx +16 -18
- package/src/components/modals/CreditsDisabledModal.tsx +6 -6
- package/src/components/modals/PaidPlanRequiredModal.tsx +3 -5
- package/src/components/modals/cards/AddCardModal.tsx +27 -29
- package/src/components/modals/cards/CannotDeleteCardModal.tsx +8 -9
- package/src/components/modals/cards/CardFormFields.tsx +22 -25
- package/src/components/modals/cards/DeleteCardModal.tsx +8 -10
- package/src/components/navigation/CancelledSubscriptionBanner.tsx +2 -4
- package/src/components/navigation/OverdueInvoiceBanner.tsx +2 -4
- package/src/components/navigation/PendingCancellationBanner.tsx +2 -4
- package/src/components/navigation/ProjectSelectorPopover.tsx +6 -8
- package/src/components/navigation/UpcomingInvoiceBanner.tsx +2 -4
- package/src/components/navigation/subcomponents/BottomLinks.tsx +3 -5
- package/src/components/navigation/subcomponents/CreditsCard.tsx +1 -3
- package/src/components/navigation/subcomponents/PlanCard.tsx +1 -3
- package/src/components/navigation/subcomponents/ProjectSelector.tsx +3 -5
- package/src/components/pages/NotFoundPage.tsx +3 -5
- package/src/components/pages/notifications/Notifications.tsx +10 -13
- package/src/components/ui/buttons/CopyButton.tsx +5 -10
- package/src/components/ui/data-display/CardItem.tsx +5 -7
- package/src/components/ui/data-display/PaymentInfoCard.tsx +8 -10
- package/src/components/ui/feedback/CircularProgress.tsx +0 -4
- package/src/components/ui/feedback/DefaultCircularProgress.tsx +1 -3
- package/src/components/ui/form/ComboboxField.tsx +6 -11
- package/src/components/ui/form/DatePicker.tsx +2 -5
- package/src/components/ui/form/DateRangePicker.tsx +2 -5
- package/src/components/ui/form/PhoneInput.tsx +3 -5
- package/src/components/ui/form/SelectField.tsx +3 -6
- package/src/components/widgets/ImageUpload/ImageCropModal.tsx +11 -19
- package/src/components/widgets/ImageUpload/ImageTooSmallModal.tsx +5 -6
- package/src/index.ts +2 -12
- package/src/modules/cards/hooks/handle-delete-card.hook.ts +3 -8
- package/src/modules/images/utils/validate-image.ts +8 -23
- package/src/modules/plans/types/plan.type.ts +0 -3
- package/src/modules/plans/utils/map-api-plan-to-ui.ts +46 -103
- package/src/modules/subscriptions/utils/periodicity.ts +12 -29
- package/src/providers/auth.provider.tsx +1 -13
- package/src/server.ts +0 -2
- package/src/utils/format/currency.ts +7 -62
- package/src/utils/intl/locales.ts +2 -3
- package/dist/i18n/config.mjs +0 -13
- package/dist/i18n/config.mjs.map +0 -1
- package/dist/i18n/country-language.mjs +0 -74
- package/dist/i18n/country-language.mjs.map +0 -1
- package/dist/i18n/messages/en-us.mjs +0 -492
- package/dist/i18n/messages/en-us.mjs.map +0 -1
- package/dist/i18n/messages/es-es.mjs +0 -492
- package/dist/i18n/messages/es-es.mjs.map +0 -1
- package/dist/i18n/messages/index.mjs +0 -16
- package/dist/i18n/messages/index.mjs.map +0 -1
- package/dist/i18n/messages/pt-br.mjs +0 -505
- package/dist/i18n/messages/pt-br.mjs.map +0 -1
- package/dist/i18n/normalize.mjs +0 -12
- package/dist/i18n/normalize.mjs.map +0 -1
- package/dist/i18n/resolve-locale.mjs +0 -42
- package/dist/i18n/resolve-locale.mjs.map +0 -1
- package/dist/i18n.mjs +0 -14
- package/dist/i18n.mjs.map +0 -1
- package/dist/modules/accounts/hooks/use-currency-formatter.hook.mjs +0 -20
- package/dist/modules/accounts/hooks/use-currency-formatter.hook.mjs.map +0 -1
- package/dist/utils/intl/cookie-domain.mjs +0 -17
- package/dist/utils/intl/cookie-domain.mjs.map +0 -1
- package/dist/utils/intl/locale-cookie.mjs +0 -13
- package/dist/utils/intl/locale-cookie.mjs.map +0 -1
- package/src/i18n/config.ts +0 -17
- package/src/i18n/country-language.ts +0 -60
- package/src/i18n/messages/en-us.ts +0 -512
- package/src/i18n/messages/es-es.ts +0 -513
- package/src/i18n/messages/index.ts +0 -24
- package/src/i18n/messages/pt-br.ts +0 -536
- package/src/i18n/normalize.ts +0 -15
- package/src/i18n/resolve-locale.ts +0 -77
- package/src/i18n.ts +0 -10
- package/src/modules/accounts/hooks/use-currency-formatter.hook.tsx +0 -32
- package/src/utils/intl/cookie-domain.ts +0 -29
- package/src/utils/intl/locale-cookie.ts +0 -18
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { useState, useEffect, useCallback } from 'react';
|
|
4
4
|
import { IconAlertTriangle, IconX } from '@tabler/icons-react';
|
|
5
5
|
import { formatShortDate } from '../../infra/utils/date';
|
|
6
|
-
import { useTranslations } from 'next-intl';
|
|
7
6
|
|
|
8
7
|
interface UpcomingInvoiceBannerProps {
|
|
9
8
|
dueDate?: Date | null;
|
|
@@ -11,7 +10,6 @@ interface UpcomingInvoiceBannerProps {
|
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
export function UpcomingInvoiceBanner({ dueDate, onDetails }: UpcomingInvoiceBannerProps) {
|
|
14
|
-
const translate = useTranslations();
|
|
15
13
|
const [visible, setVisible] = useState(true);
|
|
16
14
|
const [animated, setAnimated] = useState(false);
|
|
17
15
|
|
|
@@ -34,7 +32,7 @@ export function UpcomingInvoiceBanner({ dueDate, onDetails }: UpcomingInvoiceBan
|
|
|
34
32
|
<div className="flex items-center gap-2 flex-1 w-full sm:w-auto">
|
|
35
33
|
<IconAlertTriangle size={16} className="text-zinc-950 shrink-0" />
|
|
36
34
|
<span className="paragraph-xsmall-semibold text-zinc-950">
|
|
37
|
-
|
|
35
|
+
Fatura em aberto. Pague até {formattedDueDate} para evitar a suspensão das suas páginas.
|
|
38
36
|
</span>
|
|
39
37
|
</div>
|
|
40
38
|
<div className="flex items-center gap-1.5 w-full sm:w-auto justify-between sm:justify-start">
|
|
@@ -43,7 +41,7 @@ export function UpcomingInvoiceBanner({ dueDate, onDetails }: UpcomingInvoiceBan
|
|
|
43
41
|
className="flex items-center justify-center p-1.5 cursor-pointer"
|
|
44
42
|
onClick={onDetails}
|
|
45
43
|
>
|
|
46
|
-
<span className="paragraph-xsmall-semibold text-zinc-950 underline">
|
|
44
|
+
<span className="paragraph-xsmall-semibold text-zinc-950 underline">Detalhes</span>
|
|
47
45
|
</button>
|
|
48
46
|
<button type="button" className="cursor-pointer shrink-0" onClick={dismiss}>
|
|
49
47
|
<IconX size={18} className="text-zinc-700" />
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import { IconHelp, IconBulb, IconStar, type TablerIcon } from '@tabler/icons-react';
|
|
4
4
|
import { useIsDefaultWhitelabel, useWhitelabel } from '../../../providers/whitelabel.provider';
|
|
5
|
-
import { useTranslations } from 'next-intl';
|
|
6
5
|
|
|
7
6
|
interface BottomLink {
|
|
8
7
|
label: string;
|
|
@@ -18,7 +17,6 @@ function openFrillWidget() {
|
|
|
18
17
|
}
|
|
19
18
|
|
|
20
19
|
export function BottomLinks() {
|
|
21
|
-
const translate = useTranslations();
|
|
22
20
|
const { whitelabel } = useWhitelabel();
|
|
23
21
|
const isMainWhitelabel = useIsDefaultWhitelabel();
|
|
24
22
|
|
|
@@ -28,7 +26,7 @@ export function BottomLinks() {
|
|
|
28
26
|
...(isMainWhitelabel
|
|
29
27
|
? [
|
|
30
28
|
{
|
|
31
|
-
label:
|
|
29
|
+
label: 'Novidades',
|
|
32
30
|
icon: IconStar,
|
|
33
31
|
className: 'novidades',
|
|
34
32
|
onClick: openFrillWidget,
|
|
@@ -36,14 +34,14 @@ export function BottomLinks() {
|
|
|
36
34
|
]
|
|
37
35
|
: []),
|
|
38
36
|
{
|
|
39
|
-
label:
|
|
37
|
+
label: 'Central de ajuda',
|
|
40
38
|
icon: IconHelp,
|
|
41
39
|
href: helpUrl,
|
|
42
40
|
},
|
|
43
41
|
...(isMainWhitelabel
|
|
44
42
|
? [
|
|
45
43
|
{
|
|
46
|
-
label:
|
|
44
|
+
label: 'Enviar sugestões',
|
|
47
45
|
icon: IconBulb,
|
|
48
46
|
href: 'https://ideias.greatpages.com.br/b/y0geg1ve/feature-ideas',
|
|
49
47
|
},
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import { useAppNavigationContext } from '../AppNavigationContext';
|
|
4
4
|
import { Progress } from '../../../index';
|
|
5
|
-
import { useTranslations } from 'next-intl';
|
|
6
5
|
import { useBuyCreditsModal } from '../../../store/useBuyCreditsModal';
|
|
7
6
|
import { useCreditsDisabledModal } from '../../../store/useCreditsDisabledModal';
|
|
8
7
|
import { useAuth } from '../../../providers/auth.provider';
|
|
@@ -14,7 +13,6 @@ export interface CreditsCardProps {
|
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
export function CreditsCard({ used, total, onClick }: CreditsCardProps) {
|
|
17
|
-
const translate = useTranslations();
|
|
18
16
|
const { breakpoint } = useAppNavigationContext();
|
|
19
17
|
const { openModal } = useBuyCreditsModal();
|
|
20
18
|
const { openModal: openDisabledModal } = useCreditsDisabledModal();
|
|
@@ -37,7 +35,7 @@ export function CreditsCard({ used, total, onClick }: CreditsCardProps) {
|
|
|
37
35
|
onClick={handleClick}
|
|
38
36
|
>
|
|
39
37
|
<div className="flex items-center justify-between">
|
|
40
|
-
<span className="paragraph-xsmall-semibold text-white">
|
|
38
|
+
<span className="paragraph-xsmall-semibold text-white">Créditos usados</span>
|
|
41
39
|
<span className="paragraph-xsmall-medium text-white/50">{used} / {total}</span>
|
|
42
40
|
</div>
|
|
43
41
|
<Progress className="bg-white/10 h-[6px]" indicatorColor="bg-white" value={Math.round((used / total) * 100)} />
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { Button, Progress } from '../../../index';
|
|
4
|
-
import { useTranslations } from 'next-intl';
|
|
5
4
|
|
|
6
5
|
export interface PlanCardProps {
|
|
7
6
|
planName: string;
|
|
@@ -11,7 +10,6 @@ export interface PlanCardProps {
|
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
export function PlanCard({ planName, trialLabel, progressValue, onKnowPlans }: PlanCardProps) {
|
|
14
|
-
const translate = useTranslations();
|
|
15
13
|
return (
|
|
16
14
|
<div className="flex flex-col rounded-md p-4 gap-4 bg-gray-50">
|
|
17
15
|
<div className="flex flex-col gap-1">
|
|
@@ -24,7 +22,7 @@ export function PlanCard({ planName, trialLabel, progressValue, onKnowPlans }: P
|
|
|
24
22
|
className="paragraph-small-semibold text-gray-950"
|
|
25
23
|
onClick={onKnowPlans}
|
|
26
24
|
>
|
|
27
|
-
|
|
25
|
+
Conheça os planos
|
|
28
26
|
</Button>
|
|
29
27
|
</div>
|
|
30
28
|
);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { useState, useRef, useEffect, useMemo, RefObject } from 'react';
|
|
4
|
-
import { useTranslations } from 'next-intl';
|
|
5
4
|
import { useMobileNavbarSheet } from '../../../store/useMobileNavbarSheet';
|
|
6
5
|
import { useAppNavigationContext } from '../AppNavigationContext';
|
|
7
6
|
import { ProjectSelectorPopover } from '../ProjectSelectorPopover';
|
|
@@ -31,7 +30,6 @@ export function ProjectSelector({
|
|
|
31
30
|
onSelectProject,
|
|
32
31
|
onManageProjects,
|
|
33
32
|
}: ProjectSelectorProps) {
|
|
34
|
-
const translate = useTranslations();
|
|
35
33
|
const isMainWhitelabel = useIsDefaultWhitelabel();
|
|
36
34
|
const { breakpoint } = useAppNavigationContext();
|
|
37
35
|
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
|
|
@@ -126,10 +124,10 @@ export function ProjectSelector({
|
|
|
126
124
|
{activeSection === 'projects' && (
|
|
127
125
|
<div className="flex flex-col p-3 gap-2 border border-gray-200 rounded-lg animate-in fade-in duration-400">
|
|
128
126
|
<div className="flex items-center justify-between">
|
|
129
|
-
<span className="paragraph-small-semibold">
|
|
127
|
+
<span className="paragraph-small-semibold">Projetos</span>
|
|
130
128
|
</div>
|
|
131
129
|
<Command className="gap-2" shouldFilter={false}>
|
|
132
|
-
<CommandInput placeholder=
|
|
130
|
+
<CommandInput placeholder="Busque aqui" value={search} onValueChange={setSearch} />
|
|
133
131
|
<CommandList
|
|
134
132
|
className="custom-scrollbar paragraph-small-medium text-gray-600 h-[227px]"
|
|
135
133
|
onScroll={(event) => {
|
|
@@ -143,7 +141,7 @@ export function ProjectSelector({
|
|
|
143
141
|
}
|
|
144
142
|
}}
|
|
145
143
|
>
|
|
146
|
-
<CommandEmpty>
|
|
144
|
+
<CommandEmpty>Nenhum resultado encontrado.</CommandEmpty>
|
|
147
145
|
{showListSkeleton ? (
|
|
148
146
|
<>
|
|
149
147
|
<ProjectItemSkeleton />
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import Image from "next/image";
|
|
4
4
|
import { useEffect } from "react";
|
|
5
|
-
import { useTranslations } from "next-intl";
|
|
6
5
|
import { useRouter } from "next/navigation";
|
|
7
6
|
import { useWhitelabel, useIsDefaultWhitelabel } from "../../providers/whitelabel.provider";
|
|
8
7
|
import { Button } from "../ui/buttons/Button";
|
|
@@ -19,7 +18,6 @@ function GreatAppsLogo() {
|
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
export function NotFoundPage() {
|
|
22
|
-
const translate = useTranslations();
|
|
23
21
|
const router = useRouter();
|
|
24
22
|
|
|
25
23
|
useEffect(() => {
|
|
@@ -49,11 +47,11 @@ export function NotFoundPage() {
|
|
|
49
47
|
</div>
|
|
50
48
|
|
|
51
49
|
<h1 className="max-w-[554px] px-6 font-[family-name:var(--font-outfit)] text-[32px] leading-[36px] font-semibold text-zinc-950 sm:px-0 sm:text-[56px] sm:leading-[56px]">
|
|
52
|
-
|
|
50
|
+
Página não foi encontrada!
|
|
53
51
|
</h1>
|
|
54
52
|
|
|
55
53
|
<p className="max-w-[496px] px-6 paragraph-medium-medium text-zinc-950 sm:px-0">
|
|
56
|
-
|
|
54
|
+
A página que você está procurando não existe. Verifique se digitou corretamente o link que está procurando.
|
|
57
55
|
</p>
|
|
58
56
|
|
|
59
57
|
<Button
|
|
@@ -67,7 +65,7 @@ export function NotFoundPage() {
|
|
|
67
65
|
}
|
|
68
66
|
}}
|
|
69
67
|
>
|
|
70
|
-
|
|
68
|
+
Voltar para o início
|
|
71
69
|
</Button>
|
|
72
70
|
</div>
|
|
73
71
|
</div>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { IconBell, IconCheck, IconLoader2 } from '@tabler/icons-react';
|
|
4
|
-
import { useTranslations } from 'next-intl';
|
|
5
4
|
import { Button } from "../../ui/buttons/Button";
|
|
6
5
|
import {
|
|
7
6
|
Tabs,
|
|
@@ -35,7 +34,6 @@ function NotificationsList({
|
|
|
35
34
|
hasNextPage: boolean;
|
|
36
35
|
fetchNextPage: () => void;
|
|
37
36
|
}) {
|
|
38
|
-
const translate = useTranslations();
|
|
39
37
|
const notifications = pages?.pages.flatMap((p) => p.data) ?? [];
|
|
40
38
|
|
|
41
39
|
const handleScroll = (e: React.UIEvent<HTMLDivElement>) => {
|
|
@@ -52,7 +50,7 @@ function NotificationsList({
|
|
|
52
50
|
return (
|
|
53
51
|
<div className="rounded-lg border border-zinc-200 bg-white">
|
|
54
52
|
<div className="flex flex-col items-center justify-center py-16 gap-2">
|
|
55
|
-
<span className="paragraph-medium-regular text-zinc-500">
|
|
53
|
+
<span className="paragraph-medium-regular text-zinc-500">Nenhuma notificação encontrada.</span>
|
|
56
54
|
</div>
|
|
57
55
|
</div>
|
|
58
56
|
);
|
|
@@ -82,7 +80,7 @@ function NotificationsList({
|
|
|
82
80
|
actions={
|
|
83
81
|
detailsUrl ? (
|
|
84
82
|
<Button asChild variant="secondary" className="h-8! px-3! paragraph-small-semibold">
|
|
85
|
-
<Link href={detailsUrl}>
|
|
83
|
+
<Link href={detailsUrl}>Detalhes</Link>
|
|
86
84
|
</Button>
|
|
87
85
|
) : undefined
|
|
88
86
|
}
|
|
@@ -99,7 +97,6 @@ function NotificationsList({
|
|
|
99
97
|
}
|
|
100
98
|
|
|
101
99
|
export function NotificationPageContent() {
|
|
102
|
-
const translate = useTranslations();
|
|
103
100
|
const unreadNotifications = useInfiniteMessages({
|
|
104
101
|
readed: false,
|
|
105
102
|
type: "notification",
|
|
@@ -119,12 +116,12 @@ export function NotificationPageContent() {
|
|
|
119
116
|
markAllAsRead(undefined, {
|
|
120
117
|
onSuccess: () => {
|
|
121
118
|
toast.custom((t) => (
|
|
122
|
-
<Toast variant="success" message=
|
|
119
|
+
<Toast variant="success" message="Todas as notificações foram marcadas como lidas" toastId={t} />
|
|
123
120
|
));
|
|
124
121
|
},
|
|
125
122
|
onError: () => {
|
|
126
123
|
toast.custom((t) => (
|
|
127
|
-
<Toast variant="error" message=
|
|
124
|
+
<Toast variant="error" message="Erro ao marcar notificações como lidas" toastId={t} />
|
|
128
125
|
));
|
|
129
126
|
},
|
|
130
127
|
});
|
|
@@ -135,10 +132,10 @@ export function NotificationPageContent() {
|
|
|
135
132
|
<div className="flex items-center justify-between gap-4">
|
|
136
133
|
<div className="flex flex-col gap-2">
|
|
137
134
|
<h1 className="title-large-semibold text-gray-950">
|
|
138
|
-
|
|
135
|
+
Notificações
|
|
139
136
|
</h1>
|
|
140
137
|
<p className="paragraph-small-regular text-gray-600 hidden lg:block">
|
|
141
|
-
|
|
138
|
+
Tenha controle total sobre páginas, experiências e conversões.
|
|
142
139
|
</p>
|
|
143
140
|
</div>
|
|
144
141
|
<Button
|
|
@@ -148,8 +145,8 @@ export function NotificationPageContent() {
|
|
|
148
145
|
disabled={isMarkingAll || totalUnread === 0}
|
|
149
146
|
>
|
|
150
147
|
{isMarkingAll ? <IconLoader2 size={20} className="animate-spin" /> : <IconCheck size={20} />}
|
|
151
|
-
<span className="lg:block hidden">
|
|
152
|
-
<span className="lg:hidden">
|
|
148
|
+
<span className="lg:block hidden">Marcar todos como lidos</span>
|
|
149
|
+
<span className="lg:hidden">Marcar como lidos</span>
|
|
153
150
|
</Button>
|
|
154
151
|
</div>
|
|
155
152
|
<Tabs
|
|
@@ -158,11 +155,11 @@ export function NotificationPageContent() {
|
|
|
158
155
|
>
|
|
159
156
|
<TabsList className="h-auto pb-0 bg-transparent">
|
|
160
157
|
<TabsTrigger className="gap-2" value="all">
|
|
161
|
-
{
|
|
158
|
+
Todas as notificações{" "}
|
|
162
159
|
<span className="text-gray-500">({totalAll})</span>
|
|
163
160
|
</TabsTrigger>
|
|
164
161
|
<TabsTrigger className="gap-2" value="unreads" disabled={totalUnread === 0}>
|
|
165
|
-
{
|
|
162
|
+
Não lidas{" "}
|
|
166
163
|
<span className="text-gray-500">({totalUnread})</span>
|
|
167
164
|
</TabsTrigger>
|
|
168
165
|
</TabsList>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { useTranslations } from 'next-intl';
|
|
4
3
|
import { IconCheck, IconCopy } from '@tabler/icons-react';
|
|
5
4
|
import { toast } from "sonner";
|
|
6
5
|
import { Toast } from "../feedback/Toast";
|
|
@@ -20,22 +19,18 @@ export function CopyButton({
|
|
|
20
19
|
textToCopy,
|
|
21
20
|
size = 14,
|
|
22
21
|
className,
|
|
23
|
-
tooltipText,
|
|
24
|
-
successMessage,
|
|
22
|
+
tooltipText = "Copiar link",
|
|
23
|
+
successMessage = "Link copiado",
|
|
25
24
|
}: CopyButtonProps) {
|
|
26
|
-
const translate = useTranslations();
|
|
27
|
-
const resolvedTooltipText = tooltipText ?? translate('common.forms.copyButton.tooltipDefault');
|
|
28
|
-
const resolvedSuccessMessage = successMessage ?? translate('common.forms.copyButton.successDefault');
|
|
29
|
-
|
|
30
25
|
const { isCopied, copy } = useCopyToClipboard({
|
|
31
26
|
onSuccess: () => {
|
|
32
27
|
toast.custom((t) => (
|
|
33
|
-
<Toast variant="success" message={
|
|
28
|
+
<Toast variant="success" message={successMessage} toastId={t} />
|
|
34
29
|
));
|
|
35
30
|
},
|
|
36
31
|
onError: () => {
|
|
37
32
|
toast.custom((t) => (
|
|
38
|
-
<Toast variant="error" message=
|
|
33
|
+
<Toast variant="error" message="Não foi possível copiar o link" toastId={t} />
|
|
39
34
|
));
|
|
40
35
|
},
|
|
41
36
|
});
|
|
@@ -53,7 +48,7 @@ export function CopyButton({
|
|
|
53
48
|
{isCopied ? <IconCheck size={size} /> : <IconCopy size={size} />}
|
|
54
49
|
</span>
|
|
55
50
|
</TooltipTrigger>
|
|
56
|
-
<TooltipContent>{isCopied ?
|
|
51
|
+
<TooltipContent>{isCopied ? "Copiado!" : tooltipText}</TooltipContent>
|
|
57
52
|
</Tooltip>
|
|
58
53
|
);
|
|
59
54
|
}
|
|
@@ -10,7 +10,6 @@ import { CardBrandIcon } from './CardBrandIcons';
|
|
|
10
10
|
import { useSetDefaultCard } from '../../../modules/cards/hooks/set-default-card.hook';
|
|
11
11
|
import { useHandleDeleteCard } from '../../../modules/cards/hooks/handle-delete-card.hook';
|
|
12
12
|
import type { Card } from '../../../modules/cards/types';
|
|
13
|
-
import { useTranslations } from 'next-intl';
|
|
14
13
|
|
|
15
14
|
type CardItemProps = {
|
|
16
15
|
card: Card;
|
|
@@ -33,7 +32,6 @@ export function CardItem({
|
|
|
33
32
|
onAfterDelete,
|
|
34
33
|
onAfterSetDefault,
|
|
35
34
|
}: CardItemProps) {
|
|
36
|
-
const translate = useTranslations();
|
|
37
35
|
const [popoverOpen, setPopoverOpen] = useState(false);
|
|
38
36
|
|
|
39
37
|
const setDefaultCardMutation = useSetDefaultCard();
|
|
@@ -46,7 +44,7 @@ export function CardItem({
|
|
|
46
44
|
toast.custom((t) => (
|
|
47
45
|
<Toast
|
|
48
46
|
variant="success"
|
|
49
|
-
message=
|
|
47
|
+
message="Cartão definido como padrão"
|
|
50
48
|
toastId={t}
|
|
51
49
|
/>
|
|
52
50
|
));
|
|
@@ -56,7 +54,7 @@ export function CardItem({
|
|
|
56
54
|
toast.custom((t) => (
|
|
57
55
|
<Toast
|
|
58
56
|
variant="error"
|
|
59
|
-
message=
|
|
57
|
+
message="Erro ao definir cartão padrão"
|
|
60
58
|
toastId={t}
|
|
61
59
|
/>
|
|
62
60
|
));
|
|
@@ -88,7 +86,7 @@ export function CardItem({
|
|
|
88
86
|
</div>
|
|
89
87
|
{card.is_default && (
|
|
90
88
|
<span className="paragraph-xsmall-semibold text-zinc-600 bg-zinc-100 px-2 py-0.5 rounded-lg whitespace-nowrap">
|
|
91
|
-
|
|
89
|
+
Padrão
|
|
92
90
|
</span>
|
|
93
91
|
)}
|
|
94
92
|
<CardBrandIcon brand={card.brand} />
|
|
@@ -110,7 +108,7 @@ export function CardItem({
|
|
|
110
108
|
{menuHasSetDefault && (
|
|
111
109
|
<NavBarItem
|
|
112
110
|
icon={<IconStar size={18} className="text-zinc-400" />}
|
|
113
|
-
label=
|
|
111
|
+
label="Tornar padrão"
|
|
114
112
|
onClick={() => {
|
|
115
113
|
setPopoverOpen(false);
|
|
116
114
|
handleSetDefault();
|
|
@@ -120,7 +118,7 @@ export function CardItem({
|
|
|
120
118
|
{menuHasDelete && (
|
|
121
119
|
<NavBarItem
|
|
122
120
|
icon={<IconTrash size={18} className="text-zinc-400" />}
|
|
123
|
-
label=
|
|
121
|
+
label="Excluir"
|
|
124
122
|
onClick={() => {
|
|
125
123
|
setPopoverOpen(false);
|
|
126
124
|
handleDeleteCard(card);
|
|
@@ -9,7 +9,6 @@ import { useCards } from '../../../modules/cards/hooks/cards.hook';
|
|
|
9
9
|
import { useModalManager } from '../../../store/useModalManager';
|
|
10
10
|
import { useIsDefaultWhitelabel } from '../../../providers/whitelabel.provider';
|
|
11
11
|
import type { Card } from '../../../modules/cards/types';
|
|
12
|
-
import { useTranslations } from 'next-intl';
|
|
13
12
|
|
|
14
13
|
type PaymentInfoCardProps = {
|
|
15
14
|
email?: string;
|
|
@@ -30,7 +29,6 @@ export function PaymentInfoCard({
|
|
|
30
29
|
hideDelete,
|
|
31
30
|
hideSetDefault,
|
|
32
31
|
}: PaymentInfoCardProps) {
|
|
33
|
-
const translate = useTranslations();
|
|
34
32
|
const isMobile = useIsMobile();
|
|
35
33
|
const { openModal } = useModalManager();
|
|
36
34
|
const isDefaultWl = useIsDefaultWhitelabel();
|
|
@@ -85,19 +83,19 @@ export function PaymentInfoCard({
|
|
|
85
83
|
<div className="border border-zinc-200 rounded-lg overflow-hidden">
|
|
86
84
|
{email && (
|
|
87
85
|
<div className="flex items-center h-[60px] px-4 border-b border-zinc-200 gap-3">
|
|
88
|
-
<span className="paragraph-small-medium text-zinc-500 w-[100px]">
|
|
86
|
+
<span className="paragraph-small-medium text-zinc-500 w-[100px]">E-mail</span>
|
|
89
87
|
<span className="paragraph-small-medium text-zinc-950 flex-1">{email}</span>
|
|
90
88
|
</div>
|
|
91
89
|
)}
|
|
92
90
|
<div className="flex items-center h-[60px] px-4 gap-3">
|
|
93
|
-
<span className="paragraph-small-medium text-zinc-500 w-[100px]">
|
|
91
|
+
<span className="paragraph-small-medium text-zinc-500 w-[100px]">Pagamento</span>
|
|
94
92
|
<button
|
|
95
93
|
type="button"
|
|
96
94
|
onClick={handleOpenAddCardModal}
|
|
97
95
|
className="flex items-center h-8 px-2 paragraph-small-semibold text-zinc-950 border border-zinc-200 rounded-md hover:border-zinc-400 transition-colors cursor-pointer w-fit"
|
|
98
96
|
>
|
|
99
97
|
<IconPlus className="size-[18px]" />
|
|
100
|
-
<span className="px-1.5">
|
|
98
|
+
<span className="px-1.5">Adicionar cartão</span>
|
|
101
99
|
</button>
|
|
102
100
|
</div>
|
|
103
101
|
</div>
|
|
@@ -109,7 +107,7 @@ export function PaymentInfoCard({
|
|
|
109
107
|
<div className="border border-zinc-200 rounded-lg overflow-hidden">
|
|
110
108
|
{email && (
|
|
111
109
|
<div className="flex items-center h-[60px] px-4 border-b border-zinc-200 gap-3">
|
|
112
|
-
<span className="paragraph-small-medium text-zinc-500 w-[100px]">
|
|
110
|
+
<span className="paragraph-small-medium text-zinc-500 w-[100px]">E-mail</span>
|
|
113
111
|
<span className="paragraph-small-medium text-zinc-950 flex-1">{email}</span>
|
|
114
112
|
</div>
|
|
115
113
|
)}
|
|
@@ -120,7 +118,7 @@ export function PaymentInfoCard({
|
|
|
120
118
|
>
|
|
121
119
|
{!isExpanded ? (
|
|
122
120
|
<>
|
|
123
|
-
<span className="paragraph-small-medium text-zinc-500 w-[100px]">
|
|
121
|
+
<span className="paragraph-small-medium text-zinc-500 w-[100px]">Pagamento</span>
|
|
124
122
|
<div className="flex flex-col gap-0.5 flex-1 min-w-0">
|
|
125
123
|
<span className="paragraph-small-semibold text-zinc-950 truncate">
|
|
126
124
|
{selectedCard?.name}
|
|
@@ -137,7 +135,7 @@ export function PaymentInfoCard({
|
|
|
137
135
|
) : (
|
|
138
136
|
<>
|
|
139
137
|
<span className="paragraph-small-semibold text-zinc-950 flex-1">
|
|
140
|
-
|
|
138
|
+
Selecione a forma de pagamento
|
|
141
139
|
</span>
|
|
142
140
|
<div className="size-8 flex items-center justify-center rounded-lg">
|
|
143
141
|
<IconChevronDown className="size-[18px] text-zinc-500 rotate-180" />
|
|
@@ -172,7 +170,7 @@ export function PaymentInfoCard({
|
|
|
172
170
|
: 'text-zinc-600 border border-zinc-200 hover:bg-zinc-50'
|
|
173
171
|
}`}
|
|
174
172
|
>
|
|
175
|
-
|
|
173
|
+
Gerenciar cartões
|
|
176
174
|
</button>
|
|
177
175
|
)}
|
|
178
176
|
</div>
|
|
@@ -185,7 +183,7 @@ export function PaymentInfoCard({
|
|
|
185
183
|
>
|
|
186
184
|
<IconPlus className="size-[18px]" />
|
|
187
185
|
<span className="px-1.5">
|
|
188
|
-
{isExpanded ?
|
|
186
|
+
{isExpanded ? 'Adicionar cartão' : 'Nova forma de pagamento'}
|
|
189
187
|
</span>
|
|
190
188
|
</button>
|
|
191
189
|
</div>
|
|
@@ -34,10 +34,6 @@ export default function CircularProgress({
|
|
|
34
34
|
aria-valuenow={current}
|
|
35
35
|
aria-valuemin={0}
|
|
36
36
|
aria-valuemax={total}
|
|
37
|
-
// i18n-TODO: aria-label hardcoded — CircularProgress has no 'use client' directive and
|
|
38
|
-
// receives no translate prop, so useTranslations() cannot be called here without
|
|
39
|
-
// converting it to a client component. Key to use: common.forms.progressAriaLabel ('Progresso').
|
|
40
|
-
// Either add 'use client' + useTranslations(), or accept a translate prop from the caller.
|
|
41
37
|
aria-label="Progresso"
|
|
42
38
|
>
|
|
43
39
|
<svg width={size} height={size} className="absolute">
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { useTranslations } from 'next-intl';
|
|
4
3
|
import {
|
|
5
4
|
calculateRadius,
|
|
6
5
|
calculateCircumference,
|
|
@@ -22,7 +21,6 @@ export default function DefaultCircularProgress({
|
|
|
22
21
|
size = 62,
|
|
23
22
|
strokeWidth = 3,
|
|
24
23
|
}: CircularProgressProps) {
|
|
25
|
-
const translate = useTranslations();
|
|
26
24
|
const isDefaultWl = useIsDefaultWhitelabel();
|
|
27
25
|
const radius = calculateRadius(size, strokeWidth);
|
|
28
26
|
const circumference = calculateCircumference(radius);
|
|
@@ -37,7 +35,7 @@ export default function DefaultCircularProgress({
|
|
|
37
35
|
aria-valuenow={current}
|
|
38
36
|
aria-valuemin={0}
|
|
39
37
|
aria-valuemax={total}
|
|
40
|
-
aria-label=
|
|
38
|
+
aria-label="Progresso de exportação"
|
|
41
39
|
>
|
|
42
40
|
<svg width={size} height={size} className="absolute">
|
|
43
41
|
<circle
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { useState, useMemo } from 'react';
|
|
4
|
-
import { useTranslations } from 'next-intl';
|
|
5
4
|
import { IconCheck, IconChevronDown, IconSearch } from '@tabler/icons-react';
|
|
6
5
|
import { Popover, PopoverContent, PopoverTrigger } from '../overlay/Popover';
|
|
7
6
|
import { cn } from '../../../infra/utils/clsx';
|
|
@@ -29,9 +28,9 @@ interface ComboboxFieldProps {
|
|
|
29
28
|
export function ComboboxField({
|
|
30
29
|
options,
|
|
31
30
|
label,
|
|
32
|
-
placeholder,
|
|
33
|
-
searchPlaceholder,
|
|
34
|
-
emptyMessage,
|
|
31
|
+
placeholder = 'Selecione uma opção',
|
|
32
|
+
searchPlaceholder = 'Buscar...',
|
|
33
|
+
emptyMessage = 'Nenhuma opção encontrada.',
|
|
35
34
|
value,
|
|
36
35
|
onChange,
|
|
37
36
|
disabled = false,
|
|
@@ -39,10 +38,6 @@ export function ComboboxField({
|
|
|
39
38
|
className,
|
|
40
39
|
containerClassName,
|
|
41
40
|
}: ComboboxFieldProps) {
|
|
42
|
-
const translate = useTranslations();
|
|
43
|
-
const resolvedPlaceholder = placeholder ?? translate('common.forms.combobox.placeholder');
|
|
44
|
-
const resolvedSearchPlaceholder = searchPlaceholder ?? translate('common.forms.combobox.searchPlaceholder');
|
|
45
|
-
const resolvedEmptyMessage = emptyMessage ?? translate('common.forms.combobox.emptyMessage');
|
|
46
41
|
const [open, setOpen] = useState(false);
|
|
47
42
|
const [search, setSearch] = useState('');
|
|
48
43
|
|
|
@@ -95,7 +90,7 @@ export function ComboboxField({
|
|
|
95
90
|
<span className={cn('truncate text-left', !selectedOption && 'text-gray-400')}>
|
|
96
91
|
{selectedOption
|
|
97
92
|
? (selectedOption.displayValue ?? selectedOption.label)
|
|
98
|
-
:
|
|
93
|
+
: placeholder}
|
|
99
94
|
</span>
|
|
100
95
|
{icon ?? (
|
|
101
96
|
<IconChevronDown
|
|
@@ -119,7 +114,7 @@ export function ComboboxField({
|
|
|
119
114
|
<IconSearch className="size-4 shrink-0 opacity-50 text-gray-500" />
|
|
120
115
|
<input
|
|
121
116
|
autoFocus
|
|
122
|
-
placeholder={
|
|
117
|
+
placeholder={searchPlaceholder}
|
|
123
118
|
value={search}
|
|
124
119
|
onChange={(e) => setSearch(e.target.value)}
|
|
125
120
|
className="flex h-full w-full bg-transparent text-sm outline-none placeholder:text-gray-400 paragraph-small-medium text-gray-950"
|
|
@@ -128,7 +123,7 @@ export function ComboboxField({
|
|
|
128
123
|
|
|
129
124
|
<div className="overflow-y-auto max-h-[280px] p-1">
|
|
130
125
|
{filteredOptions.length === 0 ? (
|
|
131
|
-
<p className="py-6 text-center paragraph-small-medium text-gray-500">{
|
|
126
|
+
<p className="py-6 text-center paragraph-small-medium text-gray-500">{emptyMessage}</p>
|
|
132
127
|
) : (
|
|
133
128
|
filteredOptions.map((option) => {
|
|
134
129
|
const isSelected = value === option.value;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useState, forwardRef, useEffect } from "react";
|
|
4
|
-
import { useTranslations } from "next-intl";
|
|
5
4
|
import { format } from "date-fns";
|
|
6
5
|
import { Calendar } from "./Calendar";
|
|
7
6
|
import { Popover, PopoverContent, PopoverTrigger } from "../overlay/Popover";
|
|
@@ -24,11 +23,9 @@ interface DatePickerProps {
|
|
|
24
23
|
|
|
25
24
|
export const DatePicker = forwardRef<HTMLButtonElement, DatePickerProps>(
|
|
26
25
|
(
|
|
27
|
-
{ value, onChange, placeholder, className, disabled },
|
|
26
|
+
{ value, onChange, placeholder = "Selecione a data", className, disabled },
|
|
28
27
|
ref,
|
|
29
28
|
) => {
|
|
30
|
-
const translate = useTranslations();
|
|
31
|
-
const resolvedPlaceholder = placeholder ?? translate('common.forms.datePicker.placeholder');
|
|
32
29
|
const [open, setOpen] = useState(false);
|
|
33
30
|
const [date, setDate] = useState<Date | undefined>(() => {
|
|
34
31
|
return value ? isoParaDataLocal(value) : undefined;
|
|
@@ -54,7 +51,7 @@ export const DatePicker = forwardRef<HTMLButtonElement, DatePickerProps>(
|
|
|
54
51
|
}
|
|
55
52
|
};
|
|
56
53
|
|
|
57
|
-
const displayText = date ? format(date, "dd/MM/yyyy") :
|
|
54
|
+
const displayText = date ? format(date, "dd/MM/yyyy") : placeholder;
|
|
58
55
|
|
|
59
56
|
return (
|
|
60
57
|
<Popover open={open} onOpenChange={setOpen}>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useState, forwardRef, useEffect } from "react";
|
|
4
|
-
import { useTranslations } from "next-intl";
|
|
5
4
|
import { format } from "date-fns";
|
|
6
5
|
import { IconCalendar } from '@tabler/icons-react';
|
|
7
6
|
import { DateRange } from "react-day-picker";
|
|
@@ -25,9 +24,7 @@ interface DateRangePickerProps {
|
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
export const DateRangePicker = forwardRef<HTMLButtonElement, DateRangePickerProps>(
|
|
28
|
-
({ value, onChange, placeholder, className, disabled }, ref) => {
|
|
29
|
-
const translate = useTranslations();
|
|
30
|
-
const resolvedPlaceholder = placeholder ?? translate('common.forms.dateRangePicker.placeholder');
|
|
27
|
+
({ value, onChange, placeholder = "Selecione o período", className, disabled }, ref) => {
|
|
31
28
|
const [open, setOpen] = useState(false);
|
|
32
29
|
const [range, setRange] = useState<DateRange | undefined>(() => {
|
|
33
30
|
if (value?.from && value?.to) {
|
|
@@ -65,7 +62,7 @@ export const DateRangePicker = forwardRef<HTMLButtonElement, DateRangePickerProp
|
|
|
65
62
|
|
|
66
63
|
const displayText = range?.from && range?.to
|
|
67
64
|
? `${format(range.from, "dd/MM/yyyy")} - ${format(range.to, "dd/MM/yyyy")}`
|
|
68
|
-
:
|
|
65
|
+
: placeholder;
|
|
69
66
|
|
|
70
67
|
return (
|
|
71
68
|
<Popover open={open} onOpenChange={setOpen}>
|