Padroniza copias e badges da interface

This commit is contained in:
Felipe Coutinho
2026-03-14 18:36:02 +00:00
parent 1e8e6e0d3d
commit 62b94e6b1d
45 changed files with 184 additions and 200 deletions

View File

@@ -269,7 +269,7 @@ export function AnticipateInstallmentsDialog({
</Field>
<Field className="gap-1">
<FieldLabel htmlFor="anticipation-pagador">Payer</FieldLabel>
<FieldLabel htmlFor="anticipation-pagador">Pagador</FieldLabel>
<FieldContent>
<Select
value={formState.payerId}

View File

@@ -24,8 +24,8 @@ import {
SelectValue,
} from "@/shared/components/ui/select";
import {
CategorySelectContent,
AccountCardSelectContent,
CategorySelectContent,
PayerSelectContent,
} from "../select-items";
import type { SelectOption, TransactionItem } from "../types";
@@ -203,7 +203,7 @@ export function BulkImportDialog({
<form className="space-y-4" onSubmit={handleSubmit}>
<div className="space-y-2">
<Label htmlFor="pagador">Payer *</Label>
<Label htmlFor="pagador">Pagador *</Label>
<Select value={payerId} onValueChange={setPagadorId}>
<SelectTrigger id="pagador" className="w-full">
<SelectValue placeholder="Selecione o pagador">
@@ -235,7 +235,7 @@ export function BulkImportDialog({
</div>
<div className="space-y-2">
<Label htmlFor="categoria">Category *</Label>
<Label htmlFor="categoria">Categoria *</Label>
<Select value={categoryId} onValueChange={setCategoriaId}>
<SelectTrigger id="categoria" className="w-full">
<SelectValue placeholder="Selecione a categoria">
@@ -274,7 +274,7 @@ export function BulkImportDialog({
{hasNonCredit && (
<div className="space-y-2">
<Label htmlFor="conta">
FinancialAccount {hasCredit ? "(para não cartão)" : "*"}
Conta {hasCredit ? "(para não cartão)" : "*"}
</Label>
<Select value={accountId} onValueChange={setContaId}>
<SelectTrigger id="conta" className="w-full">

View File

@@ -44,8 +44,8 @@ import {
periodToDate,
} from "@/shared/utils/period";
import {
CategorySelectContent,
AccountCardSelectContent,
CategorySelectContent,
PayerSelectContent,
PaymentMethodSelectContent,
TransactionTypeSelectContent,
@@ -413,7 +413,7 @@ export function MassAddDialog({
{/* FinancialAccount (for non-credit-card methods) */}
{!isCartaoSelected ? (
<div className="space-y-2">
<Label htmlFor="conta">FinancialAccount</Label>
<Label htmlFor="conta">Conta</Label>
<Select value={accountId} onValueChange={setContaId}>
<SelectTrigger id="conta" className="w-full">
<SelectValue placeholder="Selecione">
@@ -534,7 +534,7 @@ export function MassAddDialog({
htmlFor={`pagador-${transaction.id}`}
className="sr-only"
>
Payer {index + 1}
Pagador {index + 1}
</Label>
<Select
value={transaction.payerId}
@@ -546,7 +546,7 @@ export function MassAddDialog({
id={`pagador-${transaction.id}`}
className="w-32 truncate"
>
<SelectValue placeholder="Payer">
<SelectValue placeholder="Pagador">
{transaction.payerId &&
(() => {
const selectedOption = payerOptions.find(
@@ -579,7 +579,7 @@ export function MassAddDialog({
htmlFor={`categoria-${transaction.id}`}
className="sr-only"
>
Category {index + 1}
Categoria {index + 1}
</Label>
<Select
value={transaction.categoryId}
@@ -591,7 +591,7 @@ export function MassAddDialog({
id={`categoria-${transaction.id}`}
className="w-32 truncate"
>
<SelectValue placeholder="Category" />
<SelectValue placeholder="Categoria" />
</SelectTrigger>
<SelectContent>
{groupedCategorias.map((group) => (

View File

@@ -5,9 +5,8 @@ import {
formatCondition,
formatDate,
formatPeriod,
getTransactionBadgeVariant,
} from "@/features/transactions/formatting-helpers";
import { Badge } from "@/shared/components/ui/badge";
import { TransactionTypeBadge } from "@/shared/components/transaction-type-badge";
import { Button } from "@/shared/components/ui/button";
import {
CardContent,
@@ -93,12 +92,12 @@ export function TransactionDetailsDialog({
</li>
<DetailRow
label={transaction.cartaoName ? "Cartão" : "FinancialAccount"}
label={transaction.cartaoName ? "Cartão" : "Conta"}
value={transaction.cartaoName ?? transaction.contaName ?? "—"}
/>
<DetailRow
label="Category"
label="Categoria"
value={transaction.categoriaName ?? "—"}
/>
@@ -106,19 +105,13 @@ export function TransactionDetailsDialog({
<span className="text-muted-foreground">
Tipo de Transação
</span>
<span className="capitalize">
<Badge
variant={getTransactionBadgeVariant(
transaction.categoriaName === "Saldo inicial"
? "Saldo inicial"
: transaction.transactionType,
)}
>
{transaction.categoriaName === "Saldo inicial"
? "Saldo Inicial"
: transaction.transactionType}
</Badge>
</span>
<TransactionTypeBadge
kind={
transaction.categoriaName === "Saldo inicial"
? "Saldo inicial"
: transaction.transactionType
}
/>
</li>
<DetailRow

View File

@@ -65,7 +65,7 @@ export function CategorySection({
showTransactionTypeField ? "md:w-1/2" : "md:w-full",
)}
>
<Label htmlFor="categoria">Category</Label>
<Label htmlFor="categoria">Categoria</Label>
<Select
value={formState.categoryId}
onValueChange={(value) => onFieldChange("categoryId", value)}

View File

@@ -36,7 +36,7 @@ export function PayerSection({
return (
<div className="flex w-full flex-col gap-2 md:flex-row">
<div className="w-full space-y-1">
<Label htmlFor="payer">Payer</Label>
<Label htmlFor="payer">Pagador</Label>
<div className="flex gap-2">
<Select
value={formState.payerId}

View File

@@ -194,7 +194,7 @@ export function PaymentMethodSection({
!isUpdateMode ? "md:w-1/2" : "md:w-full",
)}
>
<Label htmlFor="conta">FinancialAccount</Label>
<Label htmlFor="conta">Conta</Label>
<Select
value={formState.accountId}
onValueChange={(value) => onFieldChange("accountId", value)}
@@ -308,7 +308,7 @@ export function PaymentMethodSection({
!isUpdateMode ? "md:w-1/2" : "md:w-full",
)}
>
<Label htmlFor="contaUpdate">FinancialAccount</Label>
<Label htmlFor="contaUpdate">Conta</Label>
<Select
value={formState.accountId}
onValueChange={(value) => onFieldChange("accountId", value)}

View File

@@ -134,14 +134,14 @@ export function AnticipationCard({
{anticipation.payer && (
<div>
<dt className="text-muted-foreground">Payer</dt>
<dt className="text-muted-foreground">Pagador</dt>
<dd className="mt-1 font-medium">{anticipation.payer.name}</dd>
</div>
)}
{anticipation.category && (
<div>
<dt className="text-muted-foreground">Category</dt>
<dt className="text-muted-foreground">Categoria</dt>
<dd className="mt-1 font-medium">{anticipation.category.name}</dd>
</div>
)}

View File

@@ -368,7 +368,7 @@ export function TransactionsFilters({
</div>
<div className="space-y-2">
<label className="text-sm font-medium">Payer</label>
<label className="text-sm font-medium">Pagador</label>
<Select
value={getParamValue("payer")}
onValueChange={(value) =>
@@ -409,7 +409,7 @@ export function TransactionsFilters({
</div>
<div className="space-y-2">
<label className="text-sm font-medium">Category</label>
<label className="text-sm font-medium">Categoria</label>
<Popover
open={categoryOpen}
onOpenChange={setCategoryOpen}

View File

@@ -34,7 +34,7 @@ import { CategoryIcon } from "@/features/categories/components/category-icon";
import { DEFAULT_LANCAMENTOS_COLUMN_ORDER } from "@/features/transactions/column-order";
import { EmptyState } from "@/shared/components/empty-state";
import MoneyValues from "@/shared/components/money-values";
import { TypeBadge } from "@/shared/components/type-badge";
import { TransactionTypeBadge } from "@/shared/components/transaction-type-badge";
import {
Avatar,
AvatarFallback,
@@ -302,8 +302,8 @@ const buildColumns = ({
: row.original.transactionType;
return (
<TypeBadge
type={
<TransactionTypeBadge
kind={
type as "Despesa" | "Receita" | "Transferência" | "Saldo inicial"
}
/>
@@ -458,7 +458,7 @@ const buildColumns = ({
<Tooltip>
<TooltipTrigger asChild>{content}</TooltipTrigger>
<TooltipContent side="top">
{isCartao ? "Cartão" : "FinancialAccount"}: {label}
{isCartao ? "Cartão" : "Conta"}: {label}
</TooltipContent>
</Tooltip>
);
@@ -484,7 +484,7 @@ const buildColumns = ({
</Link>
</TooltipTrigger>
<TooltipContent side="top">
{isCartao ? "Cartão" : "FinancialAccount"}: {label}
{isCartao ? "Cartão" : "Conta"}: {label}
</TooltipContent>
</Tooltip>
);
@@ -607,7 +607,7 @@ const buildColumns = ({
row.original.userId !== currentUserId && (
<DropdownMenuItem onSelect={() => handleImport(row.original)}>
<RiFileCopyLine className="size-4" />
Importar para Minha FinancialAccount
Importar para Minha Conta
</DropdownMenuItem>
)}
{row.original.userId === currentUserId && (
@@ -866,14 +866,14 @@ export function TransactionsTable({
onClick={() => onCreate("Receita")}
className="w-full sm:w-auto"
>
<RiAddCircleLine className="size-4" />
<RiAddCircleFill className="size-4" />
Nova Receita
</Button>
<Button
onClick={() => onCreate("Despesa")}
className="w-full sm:w-auto"
>
<RiAddCircleLine className="size-4" />
<RiAddCircleFill className="size-4" />
Nova Despesa
</Button>
</>
@@ -887,7 +887,7 @@ export function TransactionsTable({
size="icon"
className="hidden size-9 sm:inline-flex"
>
<RiAddCircleFill className="size-4" />
<RiAddCircleLine className="size-4" />
<span className="sr-only">
Adicionar múltiplos lançamentos
</span>

View File

@@ -72,21 +72,6 @@ export function formatCondition(value?: string | null): string {
return capitalize(value);
}
/**
* Gets the badge variant for a transaction type
* @param type - Transaction type (Receita/Despesa)
* @returns Badge variant
*/
export function getTransactionBadgeVariant(
type?: string | null,
): "default" | "destructive" | "secondary" {
if (!type) return "secondary";
const normalized = type.toLowerCase();
return normalized === "receita" || normalized === "saldo inicial"
? "default"
: "destructive";
}
/**
* Formats currency value
* @param value - Numeric value