Files
radiola-android/app/src/main/java/com/radiola/ui/components/SearchBar.kt
nk f81dc52e92 feat(ui): рестайл общих компонентов под дизайн-систему
- StationCard: обложка/иконка-заглушка, анимированное сердечко, pressScale
- MiniPlayer: elevated-бар, метка «СЕЙЧАС ИГРАЕТ», Crossfade play/pause
- SearchBar: surface-поле, акцентный курсор, скругление 14
- FilterChips: акцентный активный чип с анимацией цвета
- EmptyState: иконка-плашка + текст
- TrackListItem: thumb-заглушка, pressScale
2026-06-02 21:17:28 +03:00

44 lines
1.6 KiB
Kotlin

package com.radiola.ui.components
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.material3.TextField
import androidx.compose.material3.TextFieldDefaults
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import com.composables.icons.lucide.Lucide
import com.composables.icons.lucide.Search
import com.radiola.ui.theme.RadiolaTheme
@Composable
fun SearchBar(
query: String,
onQueryChange: (String) -> Unit,
placeholder: String = "Поиск станции...",
modifier: Modifier = Modifier
) {
val colors = RadiolaTheme.colors
TextField(
value = query,
onValueChange = onQueryChange,
modifier = modifier.fillMaxWidth(),
shape = RoundedCornerShape(14.dp),
placeholder = { Text(placeholder, color = colors.textMuted) },
leadingIcon = { Icon(Lucide.Search, contentDescription = null, tint = colors.textMuted) },
singleLine = true,
colors = TextFieldDefaults.colors(
focusedContainerColor = colors.surface,
unfocusedContainerColor = colors.surface,
focusedIndicatorColor = Color.Transparent,
unfocusedIndicatorColor = Color.Transparent,
cursorColor = colors.accent,
focusedTextColor = colors.textPrimary,
unfocusedTextColor = colors.textPrimary
)
)
}