@@ -91,20 +91,22 @@ fun DaxTextField(
9191 interactionSource : MutableInteractionSource ? = null,
9292 trailingIcon : (@Composable DaxTextFieldTrailingIconScope .() -> Unit )? = null,
9393) {
94+ val daxTextFieldColors = daxTextFieldColors()
95+
9496 // override is needed as TextField uses MaterialTheme.typography internally for animating the label text style
9597 MaterialTheme (
9698 typography = Typography (
9799 bodySmall = DuckDuckGoTheme .typography.caption.asTextStyle.copy(
98100 fontFamily = FontFamily .Default ,
99- color = DuckDuckGoTheme .colors.text .secondary,
101+ color = DuckDuckGoTheme .textColors .secondary,
100102 ),
101103 bodyLarge = DuckDuckGoTheme .typography.body1.asTextStyle.copy(
102104 fontFamily = FontFamily .Default ,
103- color = DuckDuckGoTheme .colors.text .secondary,
105+ color = DuckDuckGoTheme .textColors .secondary,
104106 ),
105107 ),
106108 ) {
107- CompositionLocalProvider (LocalTextSelectionColors provides daxTextFieldColors() .textSelectionColors) {
109+ CompositionLocalProvider (LocalTextSelectionColors provides daxTextFieldColors.textSelectionColors) {
108110 OutlinedTextField (
109111 state = state,
110112 modifier = modifier
@@ -163,7 +165,7 @@ fun DaxTextField(
163165 lineLimits = lineLimits.toLineLimits(),
164166 inputTransformation = inputTransformation,
165167 interactionSource = interactionSource,
166- colors = daxTextFieldColors() ,
168+ colors = daxTextFieldColors,
167169 )
168170 }
169171 }
@@ -248,6 +250,10 @@ object DaxTextFieldTrailingIconScope {
248250 )
249251 }
250252 }
253+
254+ @Composable
255+ fun SomeComposable () {
256+ }
251257}
252258
253259@Stable
@@ -299,10 +305,10 @@ enum class DaxTextFieldInputMode {
299305
300306@Composable
301307internal fun daxTextFieldColors (): TextFieldColors = OutlinedTextFieldDefaults .colors(
302- focusedTextColor = DuckDuckGoTheme .colors.text .primary,
303- unfocusedTextColor = DuckDuckGoTheme .colors.text .primary,
304- disabledTextColor = DuckDuckGoTheme .colors.text .primary,
305- errorTextColor = DuckDuckGoTheme .colors.text .primary,
308+ focusedTextColor = DuckDuckGoTheme .textColors .primary,
309+ unfocusedTextColor = DuckDuckGoTheme .textColors .primary,
310+ disabledTextColor = DuckDuckGoTheme .textColors .primary,
311+ errorTextColor = DuckDuckGoTheme .textColors .primary,
306312 focusedContainerColor = Transparent ,
307313 unfocusedContainerColor = Transparent ,
308314 disabledContainerColor = Transparent ,
@@ -312,39 +318,39 @@ internal fun daxTextFieldColors(): TextFieldColors = OutlinedTextFieldDefaults.c
312318 disabledBorderColor = DuckDuckGoTheme .colors.textField.borders,
313319 errorBorderColor = DuckDuckGoTheme .colors.destructive,
314320 focusedLabelColor = DuckDuckGoTheme .colors.accentBlue,
315- unfocusedLabelColor = DuckDuckGoTheme .colors.text .secondary,
316- disabledLabelColor = DuckDuckGoTheme .colors.text .secondary,
321+ unfocusedLabelColor = DuckDuckGoTheme .textColors .secondary,
322+ disabledLabelColor = DuckDuckGoTheme .textColors .secondary,
317323 errorLabelColor = DuckDuckGoTheme .colors.destructive,
318- focusedTrailingIconColor = DuckDuckGoTheme .colors.icons .primary,
319- unfocusedTrailingIconColor = DuckDuckGoTheme .colors.icons .primary,
320- disabledTrailingIconColor = DuckDuckGoTheme .colors.icons .primary,
324+ focusedTrailingIconColor = DuckDuckGoTheme .iconColors .primary,
325+ unfocusedTrailingIconColor = DuckDuckGoTheme .iconColors .primary,
326+ disabledTrailingIconColor = DuckDuckGoTheme .iconColors .primary,
321327 errorTrailingIconColor = DuckDuckGoTheme .colors.destructive,
322328 focusedSupportingTextColor = DuckDuckGoTheme .colors.destructive,
323329 unfocusedSupportingTextColor = DuckDuckGoTheme .colors.destructive,
324330 disabledSupportingTextColor = DuckDuckGoTheme .colors.destructive,
325331 errorSupportingTextColor = DuckDuckGoTheme .colors.destructive,
326332 cursorColor = DuckDuckGoTheme .colors.accentBlue,
327- errorCursorColor = DuckDuckGoTheme .colors.destructive ,
333+ errorCursorColor = DuckDuckGoTheme .colors.accentBlue ,
328334 selectionColors = TextSelectionColors (
329335 handleColor = DuckDuckGoTheme .colors.accentBlue,
330336 backgroundColor = DuckDuckGoTheme .colors.accentBlue.copy(alpha = DaxTextFieldDefaults .ALPHA_DISABLED ),
331337 ),
332- focusedLeadingIconColor = DuckDuckGoTheme .colors.icons .primary,
333- unfocusedLeadingIconColor = DuckDuckGoTheme .colors.icons .primary,
334- disabledLeadingIconColor = DuckDuckGoTheme .colors.icons .primary,
338+ focusedLeadingIconColor = DuckDuckGoTheme .iconColors .primary,
339+ unfocusedLeadingIconColor = DuckDuckGoTheme .iconColors .primary,
340+ disabledLeadingIconColor = DuckDuckGoTheme .iconColors .primary,
335341 errorLeadingIconColor = DuckDuckGoTheme .colors.destructive,
336- focusedPrefixColor = DuckDuckGoTheme .colors.text .secondary,
337- unfocusedPrefixColor = DuckDuckGoTheme .colors.text .secondary,
338- disabledPrefixColor = DuckDuckGoTheme .colors.text .secondary,
339- errorPrefixColor = DuckDuckGoTheme .colors.text .secondary,
340- focusedSuffixColor = DuckDuckGoTheme .colors.text .secondary,
341- unfocusedSuffixColor = DuckDuckGoTheme .colors.text .secondary,
342- disabledSuffixColor = DuckDuckGoTheme .colors.text .secondary,
343- errorSuffixColor = DuckDuckGoTheme .colors.text .secondary,
344- focusedPlaceholderColor = DuckDuckGoTheme .colors.text .secondary,
345- unfocusedPlaceholderColor = DuckDuckGoTheme .colors.text .secondary,
346- disabledPlaceholderColor = DuckDuckGoTheme .colors.text .secondary,
347- errorPlaceholderColor = DuckDuckGoTheme .colors.text .secondary,
342+ focusedPrefixColor = DuckDuckGoTheme .textColors .secondary,
343+ unfocusedPrefixColor = DuckDuckGoTheme .textColors .secondary,
344+ disabledPrefixColor = DuckDuckGoTheme .textColors .secondary,
345+ errorPrefixColor = DuckDuckGoTheme .textColors .secondary,
346+ focusedSuffixColor = DuckDuckGoTheme .textColors .secondary,
347+ unfocusedSuffixColor = DuckDuckGoTheme .textColors .secondary,
348+ disabledSuffixColor = DuckDuckGoTheme .textColors .secondary,
349+ errorSuffixColor = DuckDuckGoTheme .textColors .secondary,
350+ focusedPlaceholderColor = DuckDuckGoTheme .textColors .secondary,
351+ unfocusedPlaceholderColor = DuckDuckGoTheme .textColors .secondary,
352+ disabledPlaceholderColor = DuckDuckGoTheme .textColors .secondary,
353+ errorPlaceholderColor = DuckDuckGoTheme .textColors .secondary,
348354)
349355
350356@PreviewLightDark
0 commit comments