import React from "react"; import { Pressable, StyleProp, StyleSheet, Text, View, ViewStyle, TextStyle, } from "react-native"; interface CheckboxProps { value: boolean; onValueChange: (value: boolean) => void; label?: string; disabled?: boolean; size?: "sm" | "md" | "lg"; color?: string; borderColor?: string; uncheckedBg?: string; style?: StyleProp; labelStyle?: StyleProp; accessibilityLabel?: string; indeterminate?: boolean; } const SIZE_MAP = { sm: { box: 16, check: 10, fontSize: 13 }, md: { box: 20, check: 12, fontSize: 14 }, lg: { box: 24, check: 14, fontSize: 16 }, }; const Checkbox: React.FC = ({ value, onValueChange, label, disabled = false, size = "md", color = "#2563EB", borderColor = "#9CA3AF", uncheckedBg = "transparent", style, labelStyle, accessibilityLabel, indeterminate = false, }) => { const sz = SIZE_MAP[size]; const handlePress = () => { if (disabled) return; onValueChange(!value); }; const checked = value || indeterminate; return ( {indeterminate ? ( ) : value ? ( ) : null} {label ? ( {label} ) : null} ); }; const styles = StyleSheet.create({ row: { flexDirection: "row", alignItems: "center", gap: 8, }, box: { borderWidth: 2, alignItems: "center", justifyContent: "center", }, label: { color: "#111827", }, }); export default Checkbox;