feat(03-01): add CSS animation tokens, i18n keys, and carryover display
- Add collapsible-open/close keyframes and CSS animation tokens to index.css - Add dashboard.sections and dashboard.carryoverIncludes keys to en.json and de.json - Add optional subtitle/subtitleClassName props to StatCard - Extend SummaryStrip balance prop with carryoverSubtitle/carryoverIsNegative - Compute and pass carryover subtitle from DashboardContent to SummaryStrip
This commit is contained in:
@@ -7,6 +7,8 @@ interface StatCardProps {
|
||||
title: string
|
||||
value: string
|
||||
valueClassName?: string
|
||||
subtitle?: string
|
||||
subtitleClassName?: string
|
||||
variance?: {
|
||||
amount: string
|
||||
direction: "up" | "down" | "neutral"
|
||||
@@ -24,6 +26,8 @@ export function StatCard({
|
||||
title,
|
||||
value,
|
||||
valueClassName,
|
||||
subtitle,
|
||||
subtitleClassName,
|
||||
variance,
|
||||
}: StatCardProps) {
|
||||
return (
|
||||
@@ -42,6 +46,11 @@ export function StatCard({
|
||||
>
|
||||
{value}
|
||||
</p>
|
||||
{subtitle && (
|
||||
<p className={cn("mt-0.5 text-xs text-muted-foreground", subtitleClassName)}>
|
||||
{subtitle}
|
||||
</p>
|
||||
)}
|
||||
{variance && (
|
||||
<div className="mt-1 flex items-center gap-1 text-xs text-muted-foreground">
|
||||
{(() => {
|
||||
|
||||
@@ -3,7 +3,12 @@ import { StatCard } from "./StatCard"
|
||||
interface SummaryStripProps {
|
||||
income: { value: string; budgeted: string }
|
||||
expenses: { value: string; budgeted: string }
|
||||
balance: { value: string; isPositive: boolean }
|
||||
balance: {
|
||||
value: string
|
||||
isPositive: boolean
|
||||
carryoverSubtitle?: string
|
||||
carryoverIsNegative?: boolean
|
||||
}
|
||||
t: (key: string) => string
|
||||
}
|
||||
|
||||
@@ -39,6 +44,8 @@ export function SummaryStrip({
|
||||
title={t("dashboard.availableBalance")}
|
||||
value={balance.value}
|
||||
valueClassName={balance.isPositive ? "text-on-budget" : "text-over-budget"}
|
||||
subtitle={balance.carryoverSubtitle}
|
||||
subtitleClassName={balance.carryoverIsNegative ? "text-over-budget" : undefined}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user