From f1dc27b6d2c7a333dcf9d600eb08106b19963f65 Mon Sep 17 00:00:00 2001 From: andresmr Date: Fri, 27 Sep 2024 11:18:10 +0200 Subject: [PATCH] docs: remove deprecated components --- .../ui/designsystem/component/Avatar.kt | 72 +--- .../designsystem/component/IndicatorInput.kt | 72 ---- .../designsystem/component/InputDateTime.kt | 348 +----------------- .../designsystem/component/MetadataAvatar.kt | 57 --- 4 files changed, 2 insertions(+), 547 deletions(-) delete mode 100644 designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/IndicatorInput.kt diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/Avatar.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/Avatar.kt index 5a388898c..cff1654dd 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/Avatar.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/Avatar.kt @@ -16,19 +16,11 @@ import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.painter.Painter import androidx.compose.ui.layout.ContentScale -import org.hisp.dhis.mobile.ui.designsystem.resource.provideDHIS2Icon import org.hisp.dhis.mobile.ui.designsystem.theme.Radius import org.hisp.dhis.mobile.ui.designsystem.theme.Spacing import org.hisp.dhis.mobile.ui.designsystem.theme.SurfaceColor -@Deprecated("Use data class AvatarStyle") -enum class AvatarStyle { - TEXT, - IMAGE, - METADATA, -} - -sealed class AvatarStyleData() { +sealed class AvatarStyleData { data class Text(val textAvatar: String) : AvatarStyleData() data class Image(val imagePainter: Painter) : AvatarStyleData() data class Metadata( @@ -97,65 +89,3 @@ fun Avatar( } } } - -/** - * DHIS2 Avatar, - * used to display the avatar composable in card, - * must be one of the three styles given as parameters - * @param style not nullable parameter that manages the avatar style - * @param textAvatar style must be TEXT, will show a single character as avatar - * @param imagePainter style must be IMAGE, will display an image as avatar - * @param metadataAvatar style must be METADATA, composable should be DHIS2 [MetadataAvatar] - * @param modifier allows a modifier to be passed externally - */ -@Suppress("DEPRECATION") -@Deprecated("Use new Avatar constructor") -@Composable -fun Avatar( - textAvatar: String? = null, - imagePainter: Painter = provideDHIS2Icon("dhis2_microscope_outline"), - metadataAvatar: (@Composable () -> Unit)? = null, - style: AvatarStyle = AvatarStyle.TEXT, - onImageClick: (() -> Unit)? = null, - modifier: Modifier = Modifier, -) { - when (style) { - AvatarStyle.TEXT -> { - textAvatar?.let { - Box( - modifier = modifier - .size(Spacing.Spacing40) - .background( - color = SurfaceColor.PrimaryContainer, - shape = RoundedCornerShape(Radius.Full), - ), - contentAlignment = Alignment.Center, - ) { - Text( - text = textAvatar, - color = SurfaceColor.Primary, - style = MaterialTheme.typography.titleSmall, - ) - } - } - } - - AvatarStyle.METADATA -> { - metadataAvatar?.let { - metadataAvatar.invoke() - } - } - - AvatarStyle.IMAGE -> { - Image( - painter = imagePainter, - contentDescription = "avatarImage", - contentScale = ContentScale.Crop, - modifier = modifier - .size(Spacing.Spacing40) - .clip(CircleShape) - .clickable(onClick = { onImageClick?.invoke() }), - ) - } - } -} diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/IndicatorInput.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/IndicatorInput.kt deleted file mode 100644 index 4ffb6c6dc..000000000 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/IndicatorInput.kt +++ /dev/null @@ -1,72 +0,0 @@ -package org.hisp.dhis.mobile.ui.designsystem.component - -import androidx.compose.foundation.background -import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.IntrinsicSize -import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.fillMaxHeight -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height -import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.requiredWidth -import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.Text -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip -import androidx.compose.ui.graphics.Color -import org.hisp.dhis.mobile.ui.designsystem.theme.Spacing -import org.hisp.dhis.mobile.ui.designsystem.theme.SurfaceColor - -/** - * DHIS2 IndicatorInput. Wraps compose [Row]. - * A component designed to display indicators, each featuring a key and a value, - * is complemented by a color badge for visual distinction. - * This configuration allows for clear and efficient presentation of important data points. - * has been replaced by [Indicator] to be removed. - * @param title: the header to be displayed. - * @param content: description to be displayed. - * @param modifier: optional modifier. - * @param indicatorColor: indicator main color. - */ -@Deprecated("Replaced by Indicator class") -@Composable -fun IndicatorInput( - title: String, - content: String, - modifier: Modifier = Modifier, - indicatorColor: Color = SurfaceColor.Container, -) { - val backgroundColor = indicatorColor.copy(alpha = 0.1f) - - Row( - modifier = modifier.fillMaxWidth() - .height(IntrinsicSize.Max) - .clip(RoundedCornerShape(Spacing.Spacing8)) - .background(backgroundColor), - ) { - Box( - Modifier.padding( - horizontal = Spacing.Spacing16, - vertical = Spacing.Spacing8, - ).weight(1f), - ) { - Column { - Text( - text = title, - style = MaterialTheme.typography.bodyMedium, - modifier = Modifier.fillMaxWidth(), - ) - Text( - text = content, - style = MaterialTheme.typography.bodyLarge, - modifier = Modifier.fillMaxWidth(), - ) - } - } - - Box(Modifier.background(indicatorColor).requiredWidth(Spacing.Spacing16).fillMaxHeight()) - } -} diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputDateTime.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputDateTime.kt index c24272fe5..24360fe15 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputDateTime.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputDateTime.kt @@ -26,8 +26,6 @@ import androidx.compose.material3.Text import androidx.compose.material3.TimePicker import androidx.compose.material3.TimePickerLayoutType import androidx.compose.material3.TimePickerState -import androidx.compose.material3.rememberDatePickerState -import androidx.compose.material3.rememberTimePickerState import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf @@ -55,16 +53,11 @@ import androidx.compose.ui.window.DialogProperties import org.hisp.dhis.mobile.ui.designsystem.component.internal.convertStringToTextFieldValue import org.hisp.dhis.mobile.ui.designsystem.component.internal.formatStoredDateToUI import org.hisp.dhis.mobile.ui.designsystem.component.internal.formatUIDateToStored -import org.hisp.dhis.mobile.ui.designsystem.component.internal.getDefaultFormat -import org.hisp.dhis.mobile.ui.designsystem.component.internal.getSelectableDates import org.hisp.dhis.mobile.ui.designsystem.component.internal.getSupportingTextList import org.hisp.dhis.mobile.ui.designsystem.component.internal.getTime import org.hisp.dhis.mobile.ui.designsystem.component.internal.getTimePickerState -import org.hisp.dhis.mobile.ui.designsystem.component.internal.isValidHourFormat -import org.hisp.dhis.mobile.ui.designsystem.component.internal.parseDate import org.hisp.dhis.mobile.ui.designsystem.component.internal.provideDatePickerState import org.hisp.dhis.mobile.ui.designsystem.component.internal.timePickerColors -import org.hisp.dhis.mobile.ui.designsystem.component.internal.yearIsInRange import org.hisp.dhis.mobile.ui.designsystem.component.model.DateTimeVisualTransformation import org.hisp.dhis.mobile.ui.designsystem.component.model.DateTransformation import org.hisp.dhis.mobile.ui.designsystem.component.model.RegExValidations @@ -82,316 +75,6 @@ import java.util.GregorianCalendar import java.util.Locale import java.util.TimeZone -/** - * DHIS2 Input Date Time - * Input field to enter date, time or date&time. It will format content based on given visual - * transformation. - * component uses Material 3 [DatePicker] and [TimePicker] - * input formats supported are mentioned in the date time input ui model documentation. - * [DatePicker] Input mode will always follow locale format. - * @param uiModel: an [InputDateTimeModel] with all the parameters for the input - * @param modifier: optional modifier. - */ - -@Suppress("DEPRECATION") -@Deprecated("This component is deprecated and will be removed in the next release. Use InputDateTime instead.") -@OptIn(ExperimentalMaterial3Api::class) -@Composable -fun InputDateTime( - uiModel: InputDateTimeModel, - modifier: Modifier = Modifier, -) { - val allowedCharacters = RegExValidations.DATE_TIME.regex - val focusManager = LocalFocusManager.current - val focusRequester = remember { FocusRequester() } - var showDatePicker by rememberSaveable { mutableStateOf(false) } - var showTimePicker by rememberSaveable { mutableStateOf(false) } - var dateOutOfRangeText = uiModel.outOfRangeText ?: provideStringResource("date_out_of_range") - - dateOutOfRangeText = "$dateOutOfRangeText (" + formatStringToDate( - uiModel.selectableDates.initialDate, - ) + " - " + - formatStringToDate(uiModel.selectableDates.endDate) + ")" - val incorrectHourFormatText = uiModel.incorrectHourFormatText ?: provideStringResource("wrong_hour_format") - val incorrectHourFormatItem = SupportingTextData( - text = incorrectHourFormatText, - SupportingTextState.ERROR, - ) - val incorrectDateFormatItem = SupportingTextData( - text = provideStringResource("incorrect_date_format"), - SupportingTextState.ERROR, - ) - val dateOutOfRangeItem = SupportingTextData( - text = dateOutOfRangeText, - SupportingTextState.ERROR, - ) - val supportingTextList = - getSupportingTextList(uiModel, dateOutOfRangeItem, incorrectHourFormatItem, incorrectDateFormatItem) - - InputShell( - modifier = modifier.testTag("INPUT_DATE_TIME") - .focusRequester(focusRequester), - title = uiModel.title, - state = if (supportingTextList.contains(dateOutOfRangeItem) || supportingTextList.contains(incorrectDateFormatItem)) InputShellState.ERROR else uiModel.state, - isRequiredField = uiModel.isRequired, - onFocusChanged = uiModel.onFocusChanged, - inputField = { - if (uiModel.allowsManualInput) { - BasicTextField( - modifier = Modifier - .testTag("INPUT_DATE_TIME_TEXT_FIELD") - .fillMaxWidth(), - inputTextValue = TextFieldValue(uiModel.inputTextFieldValue?.text ?: "", TextRange(uiModel.inputTextFieldValue?.text?.length ?: 0)), - isSingleLine = true, - onInputChanged = { newText -> - if (newText.text.length > uiModel.visualTransformation.maskLength) { - return@BasicTextField - } - - if (allowedCharacters.containsMatchIn(newText.text) || newText.text.isBlank()) { - uiModel.onValueChanged.invoke(newText) - } - }, - enabled = uiModel.state != InputShellState.DISABLED, - state = uiModel.state, - keyboardOptions = KeyboardOptions(imeAction = uiModel.imeAction, keyboardType = KeyboardType.Number), - visualTransformation = uiModel.visualTransformation, - onNextClicked = { - if (uiModel.onNextClicked != null) { - uiModel.onNextClicked.invoke() - } else { - focusManager.moveFocus(FocusDirection.Down) - } - }, - ) - } else { - Box { - Text( - modifier = Modifier - .testTag("INPUT_DATE_TIME_TEXT") - .fillMaxWidth(), - text = uiModel.visualTransformation.filter(AnnotatedString(uiModel.inputTextFieldValue?.text.orEmpty())).text, - style = MaterialTheme.typography.bodyLarge.copy( - color = if (uiModel.state != InputShellState.DISABLED && !uiModel.inputTextFieldValue?.text.isNullOrEmpty()) { - TextColor.OnSurface - } else { - TextColor.OnDisabledSurface - }, - ), - ) - Box( - modifier = Modifier - .matchParentSize() - .alpha(0f) - .clickable( - enabled = uiModel.state != InputShellState.DISABLED, - onClick = { - if (uiModel.actionType == DateTimeActionType.TIME) { - showTimePicker = !showTimePicker - } else { - showDatePicker = !showDatePicker - } - }, - ), - ) - } - } - }, - primaryButton = { - if (!uiModel.inputTextFieldValue?.text.isNullOrBlank() && uiModel.state != InputShellState.DISABLED) { - IconButton( - modifier = Modifier.testTag("INPUT_DATE_TIME_RESET_BUTTON").padding(Spacing.Spacing0), - icon = { - Icon( - imageVector = Icons.Outlined.Cancel, - contentDescription = "Icon Button", - ) - }, - onClick = { - uiModel.onValueChanged.invoke(TextFieldValue()) - focusRequester.requestFocus() - }, - ) - } - }, - secondaryButton = { - val icon = when (uiModel.actionType) { - DateTimeActionType.DATE, DateTimeActionType.DATE_TIME -> Icons.Filled.Event - DateTimeActionType.TIME -> Icons.Filled.Schedule - } - - SquareIconButton( - modifier = Modifier.testTag("INPUT_DATE_TIME_ACTION_BUTTON") - .focusable(), - icon = { - Icon( - imageVector = icon, - contentDescription = null, - ) - }, - onClick = { - focusRequester.requestFocus() - if (uiModel.onActionClicked != null) { - uiModel.onActionClicked.invoke() - } else { - if (uiModel.actionType == DateTimeActionType.TIME) { - showTimePicker = !showTimePicker - } else { - showDatePicker = !showDatePicker - } - } - }, - enabled = uiModel.state != InputShellState.DISABLED, - ) - }, - supportingText = - { - supportingTextList.forEach { item -> - SupportingText( - item.text, - item.state, - modifier = Modifier.testTag("INPUT_DATE_TIME_SUPPORTING_TEXT" + item.text), - ) - } - }, - legend = { - uiModel.legendData?.let { - Legend(uiModel.legendData, Modifier.testTag("INPUT_DATE_TIME_LEGEND")) - } - }, - inputStyle = uiModel.inputStyle, - ) - val datePickerState = provideDatePickerState(uiModel) - - if (showDatePicker) { - MaterialTheme( - colorScheme = DHIS2LightColorScheme.copy( - outlineVariant = Outline.Medium, - ), - ) { - DatePickerDialog( - modifier = Modifier.testTag("DATE_PICKER"), - onDismissRequest = { showDatePicker = false }, - confirmButton = { - Button( - enabled = true, - ButtonStyle.TEXT, - ColorStyle.DEFAULT, - uiModel.acceptText ?: provideStringResource("ok"), - ) { - showDatePicker = false - if (uiModel.actionType != DateTimeActionType.DATE_TIME) { - datePickerState.selectedDateMillis?.let { - uiModel.onValueChanged(TextFieldValue(getDate(it, uiModel.format), selection = TextRange(uiModel.inputTextFieldValue?.text?.length ?: 0))) - } - } else { - showTimePicker = true - } - } - }, - colors = datePickerColors(), - dismissButton = { - Button( - enabled = true, - ButtonStyle.TEXT, - ColorStyle.DEFAULT, - uiModel.cancelText ?: provideStringResource("cancel"), - - ) { - showDatePicker = false - } - }, - properties = DialogProperties( - dismissOnBackPress = true, - dismissOnClickOutside = true, - usePlatformDefaultWidth = true, - ), - ) { - DatePicker( - title = { - Text( - text = uiModel.title, - style = MaterialTheme.typography.bodyLarge, - modifier = Modifier.padding(start = Spacing.Spacing24, top = Spacing.Spacing24), - ) - }, - state = datePickerState, - showModeToggle = true, - modifier = Modifier.padding(Spacing.Spacing0), - ) - } - } - } - - if (showTimePicker) { - var timePickerState = rememberTimePickerState(0, 0, is24Hour = uiModel.is24hourFormat) - if (!uiModel.inputTextFieldValue?.text.isNullOrEmpty() && uiModel.actionType == DateTimeActionType.TIME && isValidHourFormat(uiModel.inputTextFieldValue?.text ?: "")) { - timePickerState = rememberTimePickerState( - initialHour = uiModel.inputTextFieldValue?.text?.substring(0, 2)!! - .toInt(), - uiModel.inputTextFieldValue.text.substring(2, 4).toInt(), is24Hour = uiModel.is24hourFormat, - ) - } else { - if (uiModel.inputTextFieldValue?.text?.length == 12 && isValidHourFormat(uiModel.inputTextFieldValue.text.substring(8, 12))) { - timePickerState = rememberTimePickerState( - initialHour = uiModel.inputTextFieldValue.text.substring(uiModel.inputTextFieldValue.text.length - 4, uiModel.inputTextFieldValue.text.length - 2) - .toInt(), - uiModel.inputTextFieldValue.text.substring(uiModel.inputTextFieldValue.text.length - 2, uiModel.inputTextFieldValue.text.length).toInt(), is24Hour = uiModel.is24hourFormat, - ) - } - } - Dialog( - onDismissRequest = { showDatePicker = false }, - properties = DialogProperties(dismissOnBackPress = true, dismissOnClickOutside = true, usePlatformDefaultWidth = true), - ) { - Column( - horizontalAlignment = Alignment.CenterHorizontally, - modifier = Modifier.background( - color = SurfaceColor.Container, - shape = RoundedCornerShape(Radius.L), - ).testTag("TIME_PICKER") - .padding(vertical = Spacing.Spacing16, horizontal = Spacing.Spacing24), - ) { - Text( - text = uiModel.title, - style = MaterialTheme.typography.titleSmall, - modifier = Modifier.padding(bottom = Spacing.Spacing16).align(Alignment.Start), - ) - TimePicker( - state = timePickerState, - layoutType = TimePickerLayoutType.Vertical, - colors = timePickerColors(), - modifier = Modifier.align(Alignment.CenterHorizontally), - ) - Row(Modifier.align(Alignment.End)) { - Button( - enabled = true, - ButtonStyle.TEXT, - ColorStyle.DEFAULT, - uiModel.cancelText ?: provideStringResource("cancel"), - - ) { - showTimePicker = false - } - Button( - enabled = true, - ButtonStyle.TEXT, - ColorStyle.DEFAULT, - uiModel.acceptText ?: provideStringResource("ok"), - ) { - showTimePicker = false - if (uiModel.actionType != DateTimeActionType.DATE_TIME) { - uiModel.onValueChanged(TextFieldValue(getTime(timePickerState), selection = TextRange(uiModel.inputTextFieldValue?.text?.length ?: 0))) - } else { - uiModel.onValueChanged(TextFieldValue(getDate(datePickerState.selectedDateMillis) + getTime(timePickerState), selection = TextRange(uiModel.inputTextFieldValue?.text?.length ?: 0))) - } - } - } - } - } - } -} - fun getInputState(supportingTextList: List, dateOutOfRangeItem: SupportingTextData, incorrectDateFormatItem: SupportingTextData, currentState: InputShellState): InputShellState { return if (supportingTextList.contains(dateOutOfRangeItem) || supportingTextList.contains(incorrectDateFormatItem)) InputShellState.ERROR else currentState } @@ -410,7 +93,7 @@ fun getActionButtonIcon(actionType: DateTimeActionType): ImageVector { * component uses Material 3 [DatePicker] and [TimePicker] * input formats supported are mentioned in the date time input ui model documentation. * [DatePicker] Input mode will always follow locale format. - * @param uiModel: an [InputDateTimeModel] with all the parameters for the input + * @param state: an [InputDateTimeState] with all the parameters for the input * @param modifier: optional modifier. */ @OptIn(ExperimentalMaterial3Api::class) @@ -720,26 +403,6 @@ private fun manageOnValueChangedFromDateTimePicker(newValue: TextFieldValue?, on } } -@Suppress("deprecation") -@Deprecated("This function is deprecated and will be removed in the next release.", replaceWith = ReplaceWith("provideDatePickerState(state: InputDateTimeState, data: InputDateTimeData)")) -@Composable -@OptIn(ExperimentalMaterial3Api::class) -internal fun provideDatePickerState(uiModel: InputDateTimeModel): DatePickerState { - return uiModel.inputTextFieldValue?.text?.takeIf { - it.isNotEmpty() && - yearIsInRange(it, getDefaultFormat(uiModel.actionType), uiModel.yearRange) - }?.let { - rememberDatePickerState( - initialSelectedDateMillis = parseStringDateToMillis( - dateString = it, - pattern = getDefaultFormat(uiModel.actionType), - ), - yearRange = uiModel.yearRange, - selectableDates = getSelectableDates(uiModel), - ) - } ?: rememberDatePickerState(selectableDates = getSelectableDates(uiModel)) -} - @OptIn(ExperimentalMaterial3Api::class) @Composable fun datePickerColors(): DatePickerColors { @@ -753,15 +416,6 @@ fun datePickerColors(): DatePickerColors { ) } -@Deprecated("This function is deprecated and will be removed in the near future", replaceWith = ReplaceWith("parseStringDateToMillis(dateString: String, pattern: String)")) -fun parseStringDateToMillis(dateString: String, pattern: String = "ddMMyyyy"): Long { - val cal = Calendar.getInstance() - return dateString.parseDate(pattern)?.let { - cal.time = it - cal.timeInMillis - } ?: 0L -} - internal fun getDate(milliSeconds: Long?, format: String? = "ddMMyyyy"): String { val cal = Calendar.getInstance() val currentTimeZone: TimeZone = cal.getTimeZone() diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/MetadataAvatar.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/MetadataAvatar.kt index ba8a4fb99..ad9ccc813 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/MetadataAvatar.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/MetadataAvatar.kt @@ -111,60 +111,3 @@ sealed class MetadataAvatarSize( Spacing.Spacing0, ) } - -/** - * DHIS2 Metadata Avatar. - * - * @param icon: Icon content. - * @param iconTint: Color of the icon. - * @param backgroundColor: Background color of the avatar. By default it's icon tine with 10% alpha. - * @param size: size of the component [AvatarSize]. - * @param modifier: optional modifier. - */ -@Suppress("DEPRECATION") -@Composable -@Deprecated("Use new MetadataAvatar") -fun MetadataAvatar( - icon: @Composable () -> Unit, - modifier: Modifier = Modifier, - iconTint: Color = Color.Unspecified, - backgroundColor: Color = Color.Unspecified, - size: AvatarSize = AvatarSize.Normal, -) { - val backgroundPadding = when (size) { - AvatarSize.Normal -> Spacing.Spacing0 - AvatarSize.Large -> Spacing.Spacing4 - } - val cornerRadius = when (size) { - AvatarSize.Normal -> Radius.XS - AvatarSize.Large -> Radius.S - } - val boxBackgroundColor = if (backgroundColor != Color.Unspecified) { - backgroundColor - } else { - iconTint.copy(alpha = 0.1f) - } - - Box( - modifier = modifier - .clip(RoundedCornerShape(cornerRadius)) - .background(color = Color.White) - .background(color = boxBackgroundColor) - .padding(backgroundPadding) - .size(Spacing.Spacing40), - contentAlignment = Alignment.Center, - ) { - CompositionLocalProvider( - LocalContentColor provides iconTint, - ) { - Box(modifier = Modifier.clip(RoundedCornerShape(Radius.XS))) { - icon() - } - } - } -} - -@Deprecated("Use new MetadataAvatarSize data class") -enum class AvatarSize { - Normal, Large -}