From 2c2dfba45357bbd205a59145ae55a2779c911ae0 Mon Sep 17 00:00:00 2001 From: Lucas Faria Mendes Date: Fri, 14 Aug 2026 15:06:35 -0300 Subject: remake Signed-off-by: Lucas Faria Mendes --- src/components/ui/primitives.tsx | 104 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 src/components/ui/primitives.tsx (limited to 'src/components/ui/primitives.tsx') diff --git a/src/components/ui/primitives.tsx b/src/components/ui/primitives.tsx new file mode 100644 index 0000000..d598bd2 --- /dev/null +++ b/src/components/ui/primitives.tsx @@ -0,0 +1,104 @@ +import React from 'react'; +import { StyleSheet, Text, View } from 'react-native'; +import { Colors, Radius, Shadow, Spacing, Typography } from '@/constants/theme'; + +interface CardProps { + children: React.ReactNode; + style?: object; +} + +export function Card({ children, style }: CardProps) { + return {children}; +} + +interface LabelProps { + text: string; + color?: string; +} + +export function SectionLabel({ text, color = Colors.textSecondary }: LabelProps) { + return {text}; +} + +interface CurrencyDisplayProps { + amount: number; + size?: 'display' | 'large' | 'normal'; + showSign?: boolean; +} + +export function CurrencyDisplay({ + amount, + size = 'normal', + showSign = false, +}: CurrencyDisplayProps) { + const isNegative = amount < 0; + const color = isNegative ? Colors.negative : Colors.positive; + const formatted = Math.abs(amount).toLocaleString('pt-BR', { + minimumFractionDigits: 2, + maximumFractionDigits: 2, + }); + const sign = showSign ? (isNegative ? '- ' : '+ ') : ''; + + const textStyle = + size === 'display' + ? styles.displayAmount + : size === 'large' + ? styles.largeAmount + : styles.normalAmount; + + return ( + + + {sign}R${' '} + + {formatted} + + ); +} + +interface DividerProps { + style?: object; +} + +export function Divider({ style }: DividerProps) { + return ; +} + +const styles = StyleSheet.create({ + card: { + backgroundColor: Colors.surface, + borderRadius: Radius.lg, + padding: Spacing.lg, + borderWidth: 1, + borderColor: Colors.border, + ...Shadow.card, + }, + label: { + ...Typography.caption, + textTransform: 'uppercase', + letterSpacing: 1.2, + }, + currencyRow: { + flexDirection: 'row', + alignItems: 'flex-end', + }, + currencyPrefix: { + ...Typography.currencyLabel, + paddingBottom: 4, + }, + displayAmount: { + ...Typography.display, + }, + largeAmount: { + ...Typography.h1, + }, + normalAmount: { + ...Typography.bodyLarge, + fontFamily: 'DMSans_600SemiBold', + }, + divider: { + height: 1, + backgroundColor: Colors.border, + marginVertical: Spacing.md, + }, +}); -- cgit v1.2.3