Estados Interativos
Pressed states, disabled states e focus em todo o app.
Pressed States
Todos os elementos táteis do app respondem ao toque com redução de opacidade via Pressable ou TouchableOpacity.
| Componente | Opacity | Obs |
|---|---|---|
| PrimaryButton | 0.9 | Leve — botão principal visível |
| CancelButton / Ghost | 0.7 | |
| Modal CTA | 0.85 | |
| CloseButton (modal) | 0.7 | |
| BackButton (header) | 0.7 | |
| TripCard | 0.85 | |
| ViatorHighlightCard | 0.95 | Leve — card grande |
| Botão Sair | 0.7 | |
| Menu Row (Perfil) | 0.7 | |
| Favorite (coração) | 0.7 | |
| Service Selector button | 0.8 |
// Padrão Pressable com pressed state
<Pressable
style={({ pressed }) => [
styles.button,
pressed && { opacity: 0.85 },
]}
onPress={onPress}
>
<Text style={styles.label}>Ação</Text>
</Pressable>Disabled States
Estados desabilitados usam sempre opacidade — nunca mudam cor. O componente permanece visível mas sem resposta ao toque.
| Componente | Propriedade | Valor |
|---|---|---|
| PrimaryButton | opacity | 0.4 |
| Modal CTA (input inválido) | opacity | 0.45 |
| Service Selector (indisponível) | opacity | 0.45 |
| Input desabilitado | opacity | 0.5 |
| FAB (sem viagens) | Não aparece | — |
// Disabled com Pressable
<Pressable
style={[styles.btn, !isValid && styles.btnDisabled]}
onPress={onPress}
disabled={!isValid}
>
<Text style={styles.btnText}>Confirmar</Text>
</Pressable>
// btnDisabled: { opacity: 0.45 }Input Focus
Ao focar um input, a borda muda de white10 para embarko_blue. Sem shadow ou scale.
// components/TextInput padrão — borda com foco
const [isFocused, setIsFocused] = useState(false);
<TextInput
style={[
styles.input,
isFocused && styles.inputFocused,
]}
onFocus={() => setIsFocused(true)}
onBlur={() => setIsFocused(false)}
/>
// input: {
// borderWidth: 1,
// borderColor: colors.white10, // rgba(255,255,255,0.10)
// borderRadius: radius.md, // 12
// backgroundColor: colors.white10,
// }
// inputFocused: {
// borderColor: colors.inputBorderFocused, // #4494FC
// }Favorito ativo
O ícone de coração alterna entre favorite_border (inativo) e favorite (ativo) com cor embarko_blue.
// ViatorHighlightCard — favorito
<Pressable
style={({ pressed }) => [
styles.favoriteBtn,
pressed && { opacity: 0.7 },
]}
onPress={() => onFavoritePress(item.productCode)}
>
<MaterialIcons
name={isFavorite ? 'favorite' : 'favorite-border'}
size={20}
color={isFavorite ? colors.embarko_blue : colors.white}
/>
</Pressable>
// favoriteBtn: {
// width: 36, height: 36, borderRadius: 18,
// backgroundColor: colors.dark60, // rgba(0,0,0,0.60)
// alignItems: 'center', justifyContent: 'center',
// }