@momo-kits/native-kits 0.89.30-rc.4 → 0.89.30-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,7 +3,6 @@ package vn.momo.kits.components
|
|
|
3
3
|
import androidx.compose.foundation.background
|
|
4
4
|
import androidx.compose.foundation.border
|
|
5
5
|
import androidx.compose.foundation.clickable
|
|
6
|
-
import androidx.compose.foundation.interaction.MutableInteractionSource
|
|
7
6
|
import androidx.compose.foundation.layout.Arrangement
|
|
8
7
|
import androidx.compose.foundation.layout.Box
|
|
9
8
|
import androidx.compose.foundation.layout.Row
|
|
@@ -13,10 +12,8 @@ import androidx.compose.foundation.layout.height
|
|
|
13
12
|
import androidx.compose.foundation.layout.padding
|
|
14
13
|
import androidx.compose.foundation.layout.size
|
|
15
14
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
16
|
-
import androidx.compose.material.ripple.rememberRipple
|
|
17
15
|
import androidx.compose.material3.CircularProgressIndicator
|
|
18
16
|
import androidx.compose.runtime.Composable
|
|
19
|
-
import androidx.compose.runtime.remember
|
|
20
17
|
import androidx.compose.ui.Alignment
|
|
21
18
|
import androidx.compose.ui.Modifier
|
|
22
19
|
import androidx.compose.ui.draw.clip
|
|
@@ -221,9 +218,6 @@ fun getTypeStyle(
|
|
|
221
218
|
* @param iconLeft [String] the icon at the left of title
|
|
222
219
|
* @param title [String] title of button
|
|
223
220
|
* @param loading [Boolean] used when you want to use loading animation
|
|
224
|
-
* @param enabled controls the enabled state of this button. When `false`,
|
|
225
|
-
* this component will not respond to user input, and it will appear
|
|
226
|
-
* visually disabled and disabled to accessibility services.
|
|
227
221
|
* @param useTintColor [Boolean] controls color of the icon.
|
|
228
222
|
*/
|
|
229
223
|
@Composable
|
|
@@ -235,7 +229,6 @@ fun Button(
|
|
|
235
229
|
iconLeft: String = "",
|
|
236
230
|
title: String = "Button",
|
|
237
231
|
loading: Boolean = false,
|
|
238
|
-
enabled: Boolean = true,
|
|
239
232
|
useTintColor: Boolean = true,
|
|
240
233
|
isFull: Boolean = true,
|
|
241
234
|
modifier: Modifier = Modifier,
|
|
@@ -244,14 +237,14 @@ fun Button(
|
|
|
244
237
|
modifier
|
|
245
238
|
.fillMaxWidth()
|
|
246
239
|
.clip(RoundedCornerShape(size.value.radius)).clickable(
|
|
247
|
-
enabled =
|
|
240
|
+
enabled = type != ButtonType.DISABLED,
|
|
248
241
|
onClick = onClick
|
|
249
242
|
)
|
|
250
243
|
|
|
251
244
|
} else {
|
|
252
245
|
modifier
|
|
253
246
|
.clip(RoundedCornerShape(size.value.radius)).clickable(
|
|
254
|
-
enabled =
|
|
247
|
+
enabled = type != ButtonType.DISABLED,
|
|
255
248
|
onClick = onClick
|
|
256
249
|
)
|
|
257
250
|
}
|
|
@@ -110,7 +110,7 @@ fun IconButton(
|
|
|
110
110
|
.then(getIconStyle(type))
|
|
111
111
|
.clip(RoundedCornerShape(size.value.radius))
|
|
112
112
|
.clickable(
|
|
113
|
-
enabled = type
|
|
113
|
+
enabled = type != ButtonType.DISABLED,
|
|
114
114
|
onClick = onClick
|
|
115
115
|
),
|
|
116
116
|
contentAlignment = Alignment.Center
|
|
@@ -51,7 +51,7 @@ fun InputDropDown(
|
|
|
51
51
|
loading: Boolean = false,
|
|
52
52
|
required: Boolean = false,
|
|
53
53
|
) {
|
|
54
|
-
|
|
54
|
+
val isFocused by remember { mutableStateOf(false) }
|
|
55
55
|
|
|
56
56
|
val disabledColor = AppTheme.current.colors.text.disable
|
|
57
57
|
var textColor = AppTheme.current.colors.text.default
|