PM-13937: Update button padding, remove unused buttons, and rename button (#4151)

This commit is contained in:
David Perez 2024-10-24 13:21:38 -05:00 committed by GitHub
parent 0ff2fe6d6a
commit e80585f77e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 77 additions and 191 deletions

View file

@ -42,8 +42,10 @@ fun BitwardenFilledButton(
onClick = onClick,
enabled = isEnabled,
contentPadding = PaddingValues(
vertical = 10.dp,
horizontal = 24.dp,
top = 10.dp,
bottom = 10.dp,
start = if (icon == null) 24.dp else 16.dp,
end = 24.dp,
),
colors = colors,
) {

View file

@ -1,92 +0,0 @@
package com.x8bit.bitwarden.ui.platform.components.button
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.width
import androidx.compose.material3.Button
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.x8bit.bitwarden.R
import com.x8bit.bitwarden.ui.platform.components.button.color.bitwardenFilledTonalButtonColors
import com.x8bit.bitwarden.ui.platform.components.util.rememberVectorPainter
import com.x8bit.bitwarden.ui.platform.theme.BitwardenTheme
/**
* A filled tonal button for the Bitwarden UI with a customized appearance.
*
* @param label The text to be displayed on the button.
* @param icon The icon for the button.
* @param onClick A lambda which will be invoked when the button is clicked.
* @param isEnabled Whether or not the button is enabled.
* @param modifier A [Modifier] for this composable, allowing for adjustments to its appearance
* or behavior. This can be used to apply padding, layout, and other Modifiers.
*/
@Composable
fun BitwardenFilledTonalButton(
label: String,
onClick: () -> Unit,
modifier: Modifier = Modifier,
icon: Painter? = null,
isEnabled: Boolean = true,
) {
Button(
modifier = modifier.semantics(mergeDescendants = true) { },
onClick = onClick,
contentPadding = PaddingValues(
vertical = 10.dp,
horizontal = 24.dp,
),
enabled = isEnabled,
colors = bitwardenFilledTonalButtonColors(),
) {
icon?.let {
Icon(
painter = icon,
contentDescription = null,
)
Spacer(modifier = Modifier.width(8.dp))
}
Text(
text = label,
style = BitwardenTheme.typography.labelLarge,
)
}
}
@Preview(showBackground = true)
@Composable
private fun BitwardenFilledTonalButton_preview() {
Column {
BitwardenFilledTonalButton(
label = "Label",
onClick = {},
icon = null,
isEnabled = true,
)
BitwardenFilledTonalButton(
label = "Label",
onClick = {},
icon = rememberVectorPainter(id = R.drawable.ic_question_circle),
isEnabled = true,
)
BitwardenFilledTonalButton(
label = "Label",
onClick = {},
icon = null,
isEnabled = false,
)
BitwardenFilledTonalButton(
label = "Label",
onClick = {},
icon = rememberVectorPainter(id = R.drawable.ic_question_circle),
isEnabled = false,
)
}
}

View file

@ -45,8 +45,10 @@ fun BitwardenOutlinedButton(
onClick = onClick,
enabled = isEnabled,
contentPadding = PaddingValues(
vertical = 10.dp,
horizontal = 24.dp,
top = 10.dp,
bottom = 10.dp,
start = if (icon == null) 24.dp else 16.dp,
end = 24.dp,
),
colors = colors.materialButtonColors,
border = BorderStroke(

View file

@ -2,11 +2,15 @@ package com.x8bit.bitwarden.ui.platform.components.button
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.width
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
@ -19,6 +23,7 @@ import com.x8bit.bitwarden.ui.platform.theme.BitwardenTheme
* @param label The label for the button.
* @param onClick The callback when the button is clicked.
* @param modifier The [Modifier] to be applied to the button.
* @param icon The icon for the button.
* @param labelTextColor The color for the label text.
*/
@Composable
@ -26,6 +31,7 @@ fun BitwardenTextButton(
label: String,
onClick: () -> Unit,
modifier: Modifier = Modifier,
icon: Painter? = null,
isEnabled: Boolean = true,
labelTextColor: Color = BitwardenTheme.colorScheme.outlineButton.foreground,
) {
@ -34,11 +40,20 @@ fun BitwardenTextButton(
onClick = onClick,
enabled = isEnabled,
contentPadding = PaddingValues(
vertical = 10.dp,
horizontal = 24.dp,
top = 10.dp,
bottom = 10.dp,
start = 12.dp,
end = if (icon == null) 12.dp else 16.dp,
),
colors = bitwardenTextButtonColors(contentColor = labelTextColor),
) {
icon?.let {
Icon(
painter = icon,
contentDescription = null,
)
Spacer(modifier = Modifier.width(8.dp))
}
Text(
text = label,
style = BitwardenTheme.typography.labelLarge,

View file

@ -8,12 +8,12 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.tooling.preview.Preview
import com.x8bit.bitwarden.R
import com.x8bit.bitwarden.ui.platform.components.button.color.bitwardenFilledIconButtonColors
import com.x8bit.bitwarden.ui.platform.components.button.color.bitwardenTonalIconButtonColors
import com.x8bit.bitwarden.ui.platform.components.util.rememberVectorPainter
import com.x8bit.bitwarden.ui.platform.theme.BitwardenTheme
/**
* A filled icon button that displays an icon.
* A tonal icon button that displays an icon.
*
* @param vectorIconRes Icon to display on the button.
* @param contentDescription The content description for this icon button.
@ -22,7 +22,7 @@ import com.x8bit.bitwarden.ui.platform.theme.BitwardenTheme
* @param isEnabled Whether or not the button should be enabled.
*/
@Composable
fun BitwardenFilledIconButton(
fun BitwardenTonalIconButton(
@DrawableRes vectorIconRes: Int,
contentDescription: String,
onClick: () -> Unit,
@ -32,7 +32,7 @@ fun BitwardenFilledIconButton(
FilledIconButton(
modifier = modifier.semantics(mergeDescendants = true) {},
onClick = onClick,
colors = bitwardenFilledIconButtonColors(),
colors = bitwardenTonalIconButtonColors(),
enabled = isEnabled,
) {
Icon(
@ -44,9 +44,9 @@ fun BitwardenFilledIconButton(
@Preview(showBackground = true)
@Composable
private fun BitwardenFilledIconButton_preview() {
private fun BitwardenTonalIconButton_preview() {
BitwardenTheme {
BitwardenFilledIconButton(
BitwardenTonalIconButton(
vectorIconRes = R.drawable.ic_question_circle,
contentDescription = "Sample Icon",
onClick = {},

View file

@ -28,17 +28,6 @@ fun bitwardenFilledErrorButtonColors() = ButtonColors(
disabledContentColor = BitwardenTheme.colorScheme.filledButton.foregroundDisabled,
)
/**
* Provides a default set of Bitwarden-styled colors for a tonal button.
*/
@Composable
fun bitwardenFilledTonalButtonColors(): ButtonColors = ButtonColors(
containerColor = BitwardenTheme.colorScheme.tonalButton.background,
contentColor = BitwardenTheme.colorScheme.tonalButton.foreground,
disabledContainerColor = BitwardenTheme.colorScheme.tonalButton.backgroundDisabled,
disabledContentColor = BitwardenTheme.colorScheme.tonalButton.foregroundDisabled,
)
/**
* Provides a default set of Bitwarden-styled colors for an outlined button.
*/

View file

@ -5,17 +5,6 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import com.x8bit.bitwarden.ui.platform.theme.BitwardenTheme
/**
* Provides a default set of Bitwarden-styled colors for a filled icon button.
*/
@Composable
fun bitwardenFilledIconButtonColors(): IconButtonColors = IconButtonColors(
containerColor = BitwardenTheme.colorScheme.background.tertiary,
contentColor = BitwardenTheme.colorScheme.filledButton.foregroundReversed,
disabledContainerColor = BitwardenTheme.colorScheme.filledButton.backgroundDisabled,
disabledContentColor = BitwardenTheme.colorScheme.filledButton.foregroundDisabled,
)
/**
* Provides a default set of Bitwarden-styled colors for a standard icon button.
*/
@ -28,3 +17,14 @@ fun bitwardenStandardIconButtonColors(
disabledContainerColor = Color.Transparent,
disabledContentColor = BitwardenTheme.colorScheme.filledButton.foregroundDisabled,
)
/**
* Provides a default set of Bitwarden-styled colors for a filled icon button.
*/
@Composable
fun bitwardenTonalIconButtonColors(): IconButtonColors = IconButtonColors(
containerColor = BitwardenTheme.colorScheme.background.tertiary,
contentColor = BitwardenTheme.colorScheme.filledButton.foregroundReversed,
disabledContainerColor = BitwardenTheme.colorScheme.filledButton.backgroundDisabled,
disabledContentColor = BitwardenTheme.colorScheme.filledButton.foregroundDisabled,
)

View file

@ -15,7 +15,7 @@ import androidx.compose.ui.semantics.testTag
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.x8bit.bitwarden.R
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledIconButton
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenTonalIconButton
import com.x8bit.bitwarden.ui.platform.theme.BitwardenTheme
/**
@ -130,7 +130,7 @@ private fun BitwardenPasswordFieldWithActions_preview() {
value = "samplePassword",
onValueChange = {},
actions = {
BitwardenFilledIconButton(
BitwardenTonalIconButton(
vectorIconRes = R.drawable.ic_check_mark,
contentDescription = "",
onClick = {},

View file

@ -8,7 +8,7 @@ import androidx.compose.ui.text.input.KeyboardType
import com.x8bit.bitwarden.R
import com.x8bit.bitwarden.ui.platform.base.util.ZERO_WIDTH_CHARACTER
import com.x8bit.bitwarden.ui.platform.base.util.orNullIfBlank
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledIconButton
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenTonalIconButton
import com.x8bit.bitwarden.ui.platform.components.field.BitwardenTextFieldWithActions
/**
@ -54,7 +54,7 @@ fun BitwardenStepper(
value = clampedValue?.toString() ?: ZERO_WIDTH_CHARACTER,
actionsTestTag = stepperActionsTestTag,
actions = {
BitwardenFilledIconButton(
BitwardenTonalIconButton(
vectorIconRes = R.drawable.ic_minus,
contentDescription = "\u2212",
onClick = {
@ -68,7 +68,7 @@ fun BitwardenStepper(
decreaseButtonTestTag?.let { testTag = it }
},
)
BitwardenFilledIconButton(
BitwardenTonalIconButton(
vectorIconRes = R.drawable.ic_plus,
contentDescription = "+",
onClick = {

View file

@ -14,7 +14,6 @@ data class BitwardenColorScheme(
val icon: IconColors,
val filledButton: FilledButtonColors,
val outlineButton: OutlineButtonColors,
val tonalButton: TonalButtonColors,
val toggleButton: ToggleButtonColors,
val sliderButton: SliderButtonColors,
val status: StatusColors,
@ -93,17 +92,6 @@ data class BitwardenColorScheme(
val foregroundReversed: Color,
)
/**
* Defines all the tonal button colors for the app.
*/
@Immutable
data class TonalButtonColors(
val background: Color,
val backgroundDisabled: Color,
val foreground: Color,
val foregroundDisabled: Color,
)
/**
* Defines all the toggle colors for the app.
*/

View file

@ -51,12 +51,6 @@ val darkBitwardenColorScheme: BitwardenColorScheme = BitwardenColorScheme(
foregroundDisabled = PrimitiveColors.gray900,
foregroundReversed = PrimitiveColors.gray1100,
),
tonalButton = BitwardenColorScheme.TonalButtonColors(
background = PrimitiveColors.gray900,
backgroundDisabled = PrimitiveColors.gray900,
foreground = PrimitiveColors.gray200,
foregroundDisabled = PrimitiveColors.gray500,
),
toggleButton = BitwardenColorScheme.ToggleButtonColors(
backgroundOn = PrimitiveColors.blue400,
backgroundOff = PrimitiveColors.gray900,
@ -125,12 +119,6 @@ val lightBitwardenColorScheme: BitwardenColorScheme = BitwardenColorScheme(
foregroundDisabled = PrimitiveColors.gray500,
foregroundReversed = PrimitiveColors.gray100,
),
tonalButton = BitwardenColorScheme.TonalButtonColors(
background = PrimitiveColors.blue100,
backgroundDisabled = PrimitiveColors.gray400,
foreground = PrimitiveColors.gray1300,
foregroundDisabled = PrimitiveColors.gray500,
),
toggleButton = BitwardenColorScheme.ToggleButtonColors(
backgroundOn = PrimitiveColors.blue500,
backgroundOff = PrimitiveColors.gray500,
@ -205,12 +193,6 @@ fun dynamicBitwardenColorScheme(
foregroundDisabled = materialColorScheme.onSurface,
foregroundReversed = materialColorScheme.inversePrimary,
),
tonalButton = BitwardenColorScheme.TonalButtonColors(
background = materialColorScheme.primary,
backgroundDisabled = materialColorScheme.onSurface.copy(alpha = 0.12f),
foreground = materialColorScheme.onPrimary,
foregroundDisabled = materialColorScheme.onSurface.copy(alpha = 0.38f),
),
toggleButton = BitwardenColorScheme.ToggleButtonColors(
backgroundOn = materialColorScheme.primary,
backgroundOff = materialColorScheme.surfaceContainerHighest,

View file

@ -39,8 +39,8 @@ import com.x8bit.bitwarden.ui.platform.components.appbar.BitwardenMediumTopAppBa
import com.x8bit.bitwarden.ui.platform.components.appbar.BitwardenTopAppBar
import com.x8bit.bitwarden.ui.platform.components.appbar.action.BitwardenOverflowActionItem
import com.x8bit.bitwarden.ui.platform.components.appbar.action.OverflowMenuItemData
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledIconButton
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenTextButton
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenTonalIconButton
import com.x8bit.bitwarden.ui.platform.components.card.BitwardenInfoCalloutCard
import com.x8bit.bitwarden.ui.platform.components.dropdown.BitwardenMultiSelectButton
import com.x8bit.bitwarden.ui.platform.components.field.BitwardenPasswordField
@ -374,13 +374,13 @@ private fun GeneratedStringItem(
value = generatedText,
singleLine = false,
actions = {
BitwardenFilledIconButton(
BitwardenTonalIconButton(
vectorIconRes = R.drawable.ic_copy,
contentDescription = stringResource(id = R.string.copy),
onClick = onCopyClick,
modifier = Modifier.testTag("CopyValueButton"),
)
BitwardenFilledIconButton(
BitwardenTonalIconButton(
vectorIconRes = R.drawable.ic_generate,
contentDescription = stringResource(id = R.string.generate_password),
onClick = onRegenerateClick,

View file

@ -12,7 +12,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import com.x8bit.bitwarden.R
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledIconButton
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenTonalIconButton
import com.x8bit.bitwarden.ui.platform.components.dialog.BitwardenSelectionDialog
import com.x8bit.bitwarden.ui.platform.components.dialog.BitwardenTextEntryDialog
import com.x8bit.bitwarden.ui.platform.components.dialog.row.BitwardenBasicDialogRow
@ -155,7 +155,7 @@ private fun CustomFieldBoolean(
BitwardenRowOfActions(
actions = {
BitwardenFilledIconButton(
BitwardenTonalIconButton(
vectorIconRes = R.drawable.ic_cog,
contentDescription = stringResource(id = R.string.edit),
onClick = onEditValue,
@ -190,7 +190,7 @@ private fun CustomFieldHiddenField(
singleLine = true,
modifier = modifier,
actions = {
BitwardenFilledIconButton(
BitwardenTonalIconButton(
vectorIconRes = R.drawable.ic_cog,
contentDescription = stringResource(id = R.string.edit),
onClick = onEditValue,
@ -217,7 +217,7 @@ private fun CustomFieldTextField(
singleLine = true,
modifier = modifier,
actions = {
BitwardenFilledIconButton(
BitwardenTonalIconButton(
vectorIconRes = R.drawable.ic_cog,
contentDescription = stringResource(id = R.string.edit),
onClick = onEditValue,
@ -262,7 +262,7 @@ private fun CustomFieldLinkedField(
BitwardenRowOfActions(
actions = {
BitwardenFilledIconButton(
BitwardenTonalIconButton(
vectorIconRes = R.drawable.ic_cog,
contentDescription = stringResource(id = R.string.edit),
onClick = onEditValue,

View file

@ -18,9 +18,9 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.x8bit.bitwarden.R
import com.x8bit.bitwarden.ui.platform.base.util.Text
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledIconButton
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenOutlinedButton
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenStandardIconButton
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenTonalIconButton
import com.x8bit.bitwarden.ui.platform.components.dialog.BitwardenTwoButtonDialog
import com.x8bit.bitwarden.ui.platform.components.dropdown.BitwardenMultiSelectButton
import com.x8bit.bitwarden.ui.platform.components.field.BitwardenHiddenPasswordField
@ -124,14 +124,14 @@ fun LazyListScope.vaultAddEditLoginItems(
readOnly = true,
singleLine = true,
actions = {
BitwardenFilledIconButton(
BitwardenTonalIconButton(
vectorIconRes = R.drawable.ic_copy,
contentDescription = stringResource(id = R.string.copy_totp),
onClick = {
loginItemTypeHandlers.onCopyTotpKeyClick(loginState.totp)
},
)
BitwardenFilledIconButton(
BitwardenTonalIconButton(
vectorIconRes = R.drawable.ic_camera,
contentDescription = stringResource(id = R.string.camera),
onClick = onTotpSetupClick,
@ -377,7 +377,7 @@ private fun UsernameRow(
value = username,
onValueChange = loginItemTypeHandlers.onUsernameTextChange,
actions = {
BitwardenFilledIconButton(
BitwardenTonalIconButton(
vectorIconRes = R.drawable.ic_generate,
contentDescription = stringResource(id = R.string.generate_username),
onClick = {
@ -444,13 +444,13 @@ private fun PasswordRow(
.fillMaxWidth()
.padding(horizontal = 16.dp),
) {
BitwardenFilledIconButton(
BitwardenTonalIconButton(
vectorIconRes = R.drawable.ic_check_mark,
contentDescription = stringResource(id = R.string.check_password),
onClick = loginItemTypeHandlers.onPasswordCheckerClick,
modifier = Modifier.testTag(tag = "CheckPasswordButton"),
)
BitwardenFilledIconButton(
BitwardenTonalIconButton(
vectorIconRes = R.drawable.ic_generate,
contentDescription = stringResource(id = R.string.generate_password),
onClick = {
@ -513,7 +513,7 @@ private fun PasskeyField(
modifier = modifier,
actions = {
if (canRemovePasskey) {
BitwardenFilledIconButton(
BitwardenTonalIconButton(
vectorIconRes = R.drawable.ic_minus,
contentDescription = stringResource(id = R.string.remove_passkey),
onClick = loginItemTypeHandlers.onClearFido2CredentialClick,

View file

@ -11,7 +11,7 @@ import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.x8bit.bitwarden.R
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledIconButton
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenTonalIconButton
import com.x8bit.bitwarden.ui.platform.components.dialog.BitwardenSelectionDialog
import com.x8bit.bitwarden.ui.platform.components.dialog.row.BitwardenBasicDialogRow
import com.x8bit.bitwarden.ui.platform.components.dialog.row.BitwardenSelectionRow
@ -39,7 +39,7 @@ fun VaultAddEditUriItem(
value = uriItem.uri.orEmpty(),
onValueChange = { onUriValueChange(uriItem.copy(uri = it)) },
actions = {
BitwardenFilledIconButton(
BitwardenTonalIconButton(
vectorIconRes = R.drawable.ic_cog,
contentDescription = stringResource(id = R.string.options),
onClick = { shouldShowOptionsDialog = true },

View file

@ -13,7 +13,7 @@ import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.x8bit.bitwarden.R
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledIconButton
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenTonalIconButton
import com.x8bit.bitwarden.ui.platform.components.field.BitwardenPasswordFieldWithActions
import com.x8bit.bitwarden.ui.platform.components.field.BitwardenTextField
import com.x8bit.bitwarden.ui.platform.components.header.BitwardenListHeaderText
@ -85,7 +85,7 @@ fun VaultItemCardContent(
readOnly = true,
singleLine = false,
actions = {
BitwardenFilledIconButton(
BitwardenTonalIconButton(
vectorIconRes = R.drawable.ic_copy,
contentDescription = stringResource(id = R.string.copy_number),
onClick = vaultCardItemTypeHandlers.onCopyNumberClick,
@ -147,7 +147,7 @@ fun VaultItemCardContent(
readOnly = true,
singleLine = false,
actions = {
BitwardenFilledIconButton(
BitwardenTonalIconButton(
vectorIconRes = R.drawable.ic_copy,
contentDescription = stringResource(id = R.string.copy_security_code),
onClick = vaultCardItemTypeHandlers.onCopySecurityCodeClick,

View file

@ -4,7 +4,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import com.x8bit.bitwarden.R
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledIconButton
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenTonalIconButton
import com.x8bit.bitwarden.ui.platform.components.field.BitwardenPasswordFieldWithActions
import com.x8bit.bitwarden.ui.platform.components.field.BitwardenTextField
import com.x8bit.bitwarden.ui.platform.components.field.BitwardenTextFieldWithActions
@ -47,7 +47,7 @@ fun CustomField(
modifier = modifier,
actions = {
if (customField.isCopyable) {
BitwardenFilledIconButton(
BitwardenTonalIconButton(
vectorIconRes = R.drawable.ic_copy,
contentDescription = stringResource(id = R.string.copy),
onClick = { onCopyCustomHiddenField(customField.value) },
@ -82,7 +82,7 @@ fun CustomField(
modifier = modifier,
actions = {
if (customField.isCopyable) {
BitwardenFilledIconButton(
BitwardenTonalIconButton(
vectorIconRes = R.drawable.ic_copy,
contentDescription = stringResource(id = R.string.copy),
onClick = { onCopyCustomTextField(customField.value) },

View file

@ -17,7 +17,7 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.unit.dp
import com.x8bit.bitwarden.R
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledIconButton
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenTonalIconButton
import com.x8bit.bitwarden.ui.platform.components.field.BitwardenHiddenPasswordField
import com.x8bit.bitwarden.ui.platform.components.field.BitwardenPasswordFieldWithActions
import com.x8bit.bitwarden.ui.platform.components.field.BitwardenTextField
@ -303,7 +303,7 @@ private fun PasswordField(
readOnly = true,
singleLine = false,
actions = {
BitwardenFilledIconButton(
BitwardenTonalIconButton(
vectorIconRes = R.drawable.ic_check_mark,
contentDescription = stringResource(
id = R.string.check_known_data_breaches_for_this_password,
@ -311,7 +311,7 @@ private fun PasswordField(
onClick = onCheckForBreachClick,
modifier = Modifier.testTag(tag = "LoginCheckPasswordButton"),
)
BitwardenFilledIconButton(
BitwardenTonalIconButton(
vectorIconRes = R.drawable.ic_copy,
contentDescription = stringResource(id = R.string.copy_password),
onClick = onCopyPasswordClick,
@ -377,7 +377,7 @@ private fun TotpField(
timeLeftSeconds = totpCodeItemData.timeLeftSeconds,
periodSeconds = totpCodeItemData.periodSeconds,
)
BitwardenFilledIconButton(
BitwardenTonalIconButton(
vectorIconRes = R.drawable.ic_copy,
contentDescription = stringResource(id = R.string.copy_totp),
onClick = onCopyTotpClick,
@ -416,7 +416,7 @@ private fun UriField(
singleLine = false,
actions = {
if (uriData.isLaunchable) {
BitwardenFilledIconButton(
BitwardenTonalIconButton(
vectorIconRes = R.drawable.ic_external_link,
contentDescription = stringResource(id = R.string.launch),
onClick = { onLaunchUriClick(uriData.uri) },
@ -424,7 +424,7 @@ private fun UriField(
)
}
if (uriData.isCopyable) {
BitwardenFilledIconButton(
BitwardenTonalIconButton(
vectorIconRes = R.drawable.ic_copy,
contentDescription = stringResource(id = R.string.copy),
onClick = { onCopyUriClick(uriData.uri) },
@ -450,7 +450,7 @@ private fun UsernameField(
readOnly = true,
singleLine = false,
actions = {
BitwardenFilledIconButton(
BitwardenTonalIconButton(
vectorIconRes = R.drawable.ic_copy,
contentDescription = stringResource(id = R.string.copy_username),
onClick = onCopyUsernameClick,