@momo-kits/native-kits 0.300.7-debug → 0.300.8-beta.1-debug

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.
Files changed (202) hide show
  1. package/CLAUDE.md +12 -8
  2. package/README.md +8 -7
  3. package/compose/build.gradle.kts +2 -4
  4. package/compose/build.gradle.kts.backup +1 -3
  5. package/compose/src/androidMain/kotlin/vn/momo/kits/const/HostFont.android.kt +1 -2
  6. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +3 -2
  7. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReduceMotion.android.kt +17 -0
  8. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +1 -1
  9. package/compose/src/commonMain/kotlin/vn/momo/kits/application/DesignSystemKits.kt +2 -3
  10. package/compose/src/commonMain/kotlin/vn/momo/kits/application/KitsBinding.kt +60 -0
  11. package/compose/src/commonMain/kotlin/vn/momo/kits/application/KitsHost.kt +32 -0
  12. package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +20 -24
  13. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +5 -6
  14. package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +7 -17
  15. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +18 -18
  16. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +2 -2
  17. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +15 -18
  18. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +4 -2
  19. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +13 -73
  20. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +1 -1
  21. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +1 -8
  22. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +1 -53
  23. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +3 -8
  24. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +2 -3
  25. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +12 -15
  26. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +11 -9
  27. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +17 -12
  28. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +20 -5
  29. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +3 -5
  30. package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +7 -8
  31. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +1 -2
  32. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +0 -2
  33. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +1 -2
  34. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +83 -82
  35. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +3 -3
  36. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +6 -10
  37. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +9 -9
  38. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +0 -2
  39. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +13 -35
  40. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +2 -4
  41. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +5 -22
  42. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +0 -2
  43. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +0 -3
  44. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +6 -24
  45. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +55 -5
  46. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +1 -7
  47. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +3 -6
  48. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +1 -1
  49. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +22 -50
  50. package/compose/src/commonMain/kotlin/vn/momo/kits/const/HostFont.kt +2 -7
  51. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +11 -7
  52. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/HeaderLayout.kt +71 -0
  53. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ModalLayout.kt +184 -0
  54. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ScreenLayout.kt +18 -9
  55. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +5 -3
  56. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +123 -64
  57. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +24 -8
  58. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +11 -9
  59. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +16 -19
  60. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +59 -41
  61. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +69 -51
  62. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackTransition.kt +14 -10
  63. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/SwipeBackHaptic.kt +5 -10
  64. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +43 -32
  65. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +330 -149
  66. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +87 -70
  67. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoBarCompression.kt +1 -5
  68. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoTabBar.kt +92 -261
  69. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/TabBarMetrics.kt +133 -0
  70. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +0 -2
  71. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +31 -40
  72. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +3 -1
  73. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +46 -72
  74. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HelpCenterRequest.kt +8 -12
  75. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SideBar.kt +29 -24
  76. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/ToolkitRequests.kt +8 -11
  77. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +9 -9
  78. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +26 -3
  79. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +1 -3
  80. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +3 -1
  81. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReduceMotion.kt +7 -0
  82. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReservedRegions.kt +4 -3
  83. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +2 -3
  84. package/compose/src/commonTest/kotlin/vn/momo/kits/application/KitsHostTest.kt +44 -0
  85. package/compose/src/commonTest/kotlin/vn/momo/kits/navigation/component/HelpCenterRequestTest.kt +2 -7
  86. package/compose/src/commonTest/kotlin/vn/momo/kits/navigation/component/ToolkitRequestsTest.kt +9 -18
  87. package/compose/src/iosMain/kotlin/vn/momo/kits/const/HostFont.ios.kt +1 -1
  88. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +3 -6
  89. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/OsFontScale.ios.kt +5 -6
  90. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +12 -12
  91. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReduceMotion.ios.kt +48 -0
  92. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReservedRegions.ios.kt +11 -6
  93. package/gradle/libs.versions.toml +1 -3
  94. package/gradle.properties +1 -3
  95. package/ios/Application/ApplicationEnvironment.swift +6 -4
  96. package/ios/Application/DesignSystemKits.swift +59 -13
  97. package/ios/Application/DesignSystemKitsPayload.swift +0 -8
  98. package/ios/Application/LanguageSource.swift +2 -11
  99. package/ios/Application/Localize.swift +8 -35
  100. package/ios/Application/LocalizeModifier.swift +2 -11
  101. package/ios/Application/MaxApi.swift +3 -11
  102. package/ios/Avatar/Avatar.swift +0 -1
  103. package/ios/Badge/Badge.swift +5 -8
  104. package/ios/Badge/BadgeRibbon.swift +2 -5
  105. package/ios/Button/Button.swift +4 -8
  106. package/ios/CalculatorKeyboard/CalculatorKeyboard.swift +5 -7
  107. package/ios/Carousel/Carousel.swift +4 -17
  108. package/ios/Checkbox/Checkbox.swift +0 -2
  109. package/ios/Collapse/Collapse.swift +17 -11
  110. package/ios/Colors+Radius+Spacing/Theme.swift +0 -7
  111. package/ios/DateTimePicker/DateTimePicker.swift +4 -10
  112. package/ios/DateTimePicker/DateTimePickerTypes.swift +1 -3
  113. package/ios/DateTimePicker/DateTimePickerUtils.swift +0 -3
  114. package/ios/DateTimePicker/WheelPicker.swift +2 -4
  115. package/ios/Extensions/ActiveOpacityButtonStyle.swift +2 -3
  116. package/ios/Extensions/Color++.swift +2 -4
  117. package/ios/Extensions/SkeletonUICompat.swift +0 -8
  118. package/ios/Icon/Icon.swift +3 -6
  119. package/ios/IconButton/IconButton.swift +2 -5
  120. package/ios/Input/ErrorView.swift +0 -7
  121. package/ios/Input/Input.swift +9 -20
  122. package/ios/Input/InputPhoneNumber.swift +37 -20
  123. package/ios/Input/InputSearch.swift +23 -12
  124. package/ios/Input/InputTextArea.swift +4 -13
  125. package/ios/InputDropDown/InputDropDown.swift +1 -11
  126. package/ios/InputMoney/InputMoney.swift +9 -28
  127. package/ios/InputOTP/InputOTP.swift +2 -9
  128. package/ios/Layout/HeaderLayout.swift +72 -0
  129. package/ios/Layout/Item.swift +1 -2
  130. package/ios/Layout/ModalLayout.swift +144 -0
  131. package/ios/Layout/ScreenLayout.swift +48 -31
  132. package/ios/Layout/Section.swift +2 -3
  133. package/ios/Loader/Loader.swift +3 -12
  134. package/ios/Lottie/LottieView.swift +0 -11
  135. package/ios/Navigation/BottomSheet.swift +73 -94
  136. package/ios/Navigation/BottomTab/BottomTab.swift +58 -73
  137. package/ios/Navigation/BottomTab/BottomTabBar.swift +286 -121
  138. package/ios/Navigation/BottomTab/CurvedContainer.swift +52 -54
  139. package/ios/Navigation/BottomTab/DuoBarCompression.swift +5 -12
  140. package/ios/Navigation/BottomTab/DuoTabBar.swift +67 -202
  141. package/ios/Navigation/BottomTab/TabBarMetrics.swift +97 -0
  142. package/ios/Navigation/Component/FloatingButton.swift +4 -11
  143. package/ios/Navigation/Component/Header.swift +35 -54
  144. package/ios/Navigation/Component/HeaderBackground.swift +2 -8
  145. package/ios/Navigation/Component/HeaderJourney.swift +4 -8
  146. package/ios/Navigation/Component/HeaderLocation.swift +4 -8
  147. package/ios/Navigation/Component/HeaderRight.swift +20 -22
  148. package/ios/Navigation/Component/HeaderTitle.swift +1 -6
  149. package/ios/Navigation/Component/HeaderUser.swift +4 -10
  150. package/ios/Navigation/Component/SideBar.swift +6 -21
  151. package/ios/Navigation/Component/SnackBar.swift +9 -13
  152. package/ios/Navigation/HostBackGestureBridge.swift +2 -9
  153. package/ios/Navigation/ModalScreen.swift +24 -13
  154. package/ios/Navigation/Navigation.swift +35 -19
  155. package/ios/Navigation/NavigationContainer.swift +4 -15
  156. package/ios/Navigation/Navigator.swift +21 -39
  157. package/ios/Navigation/StackScreen.swift +64 -51
  158. package/ios/Navigation/StackTransition.swift +7 -14
  159. package/ios/Navigation/SwipeBackHaptic.swift +2 -7
  160. package/ios/Navigation/Tracking/ScreenTracker.swift +2 -7
  161. package/ios/Pagination/PaginationDot.swift +0 -9
  162. package/ios/Pagination/PaginationNumber.swift +1 -9
  163. package/ios/Pagination/PaginationScroll.swift +2 -14
  164. package/ios/Pagination/PaginationWhiteDot.swift +1 -10
  165. package/ios/Popup/PopupDisplay.swift +7 -5
  166. package/ios/Popup/PopupInput.swift +6 -4
  167. package/ios/Popup/PopupLayout.swift +17 -9
  168. package/ios/Popup/PopupNotify.swift +32 -25
  169. package/ios/PopupView/FullscreenPopup.swift +3 -4
  170. package/ios/PopupView/PopupView.swift +2 -2
  171. package/ios/PopupView/Utils++.swift +1 -2
  172. package/ios/ProgressInfo/ProgressInfo.swift +2 -13
  173. package/ios/Skeleton/Skeleton.swift +5 -16
  174. package/ios/Slider/Slider.swift +5 -12
  175. package/ios/StatusBarTap/StatusBarTap.h +2 -3
  176. package/ios/StatusBarTap/StatusBarTap.m +3 -16
  177. package/ios/Stepper/Stepper.swift +8 -27
  178. package/ios/Steps/Steps.swift +29 -26
  179. package/ios/Swipeable/SwipeCell.swift +2 -2
  180. package/ios/Swipeable/SwipeCellModel.swift +3 -6
  181. package/ios/TabView/TabView.swift +14 -28
  182. package/ios/Template/TrustBanner/TrustBanner.swift +2 -9
  183. package/ios/Title/Title.swift +1 -3
  184. package/ios/Tooltip/Tooltip.swift +4 -9
  185. package/ios/Typography/FontScale.swift +79 -24
  186. package/ios/Typography/Text.swift +6 -12
  187. package/ios/Typography/Typography.swift +8 -11
  188. package/ios/Uploader/Uploader.swift +2 -17
  189. package/ios-demo/Resources/tabbar_scan_qr_button.json +1 -0
  190. package/ios-demo/Resources/tabbar_scan_qr_label.json +1 -0
  191. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AnimatedHeaderDemo.swift +11 -2
  192. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BottomTabDemo.swift +296 -59
  193. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputPhoneNumberDemo.swift +15 -4
  194. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/LocalizeDemo.swift +0 -8
  195. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +114 -0
  196. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupNotifyDemo.swift +29 -1
  197. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TypographyDemo.swift +16 -0
  198. package/package.json +1 -1
  199. package/publish.sh +8 -2
  200. package/scripts/ci/build-swiftui.sh +22 -0
  201. package/scripts/ci/resolve-version.mjs +144 -0
  202. package/settings.gradle.kts +0 -1
@@ -1,7 +1,10 @@
1
1
  package vn.momo.kits.navigation.bottomtab
2
2
 
3
+ import androidx.compose.runtime.getValue
4
+ import androidx.compose.runtime.setValue
3
5
  import androidx.compose.animation.core.Animatable
4
6
  import androidx.compose.animation.core.AnimationVector1D
7
+ import androidx.compose.animation.core.CubicBezierEasing
5
8
  import androidx.compose.animation.core.Easing
6
9
  import androidx.compose.animation.core.tween
7
10
  import androidx.compose.foundation.background
@@ -10,14 +13,12 @@ import androidx.compose.runtime.Composable
10
13
  import androidx.compose.runtime.CompositionLocalProvider
11
14
  import androidx.compose.runtime.DisposableEffect
12
15
  import androidx.compose.runtime.LaunchedEffect
13
- import androidx.compose.runtime.getValue
14
16
  import androidx.compose.runtime.key
15
17
  import androidx.compose.runtime.mutableIntStateOf
16
18
  import androidx.compose.runtime.mutableStateOf
17
19
  import androidx.compose.runtime.remember
18
20
  import androidx.compose.runtime.saveable.rememberSaveable
19
21
  import androidx.compose.runtime.saveable.rememberSaveableStateHolder
20
- import androidx.compose.runtime.setValue
21
22
  import androidx.compose.runtime.staticCompositionLocalOf
22
23
  import androidx.compose.ui.Alignment
23
24
  import androidx.compose.ui.Modifier
@@ -25,11 +26,11 @@ import androidx.compose.ui.graphics.graphicsLayer
25
26
  import androidx.compose.ui.layout.layout
26
27
  import androidx.compose.ui.unit.dp
27
28
  import androidx.compose.ui.zIndex
28
- import vn.momo.kits.const.AppNavigationBar
29
+ import kotlin.math.abs
30
+ import vn.momo.kits.components.ScaleSizeScope
29
31
  import vn.momo.kits.const.AppTheme
30
- import vn.momo.kits.const.Spacing
31
32
  import vn.momo.kits.navigation.KeyboardOptions
32
- import vn.momo.kits.navigation.LocalMaxApi
33
+ import vn.momo.kits.navigation.LocalKitsBinding
33
34
  import vn.momo.kits.navigation.LocalNavigation
34
35
  import vn.momo.kits.navigation.LocalNavigator
35
36
  import vn.momo.kits.navigation.NavigationOptions
@@ -40,11 +41,14 @@ import vn.momo.kits.platform.reportFloatingArrowBack
40
41
  import vn.momo.kits.layout.getScreenLayout
41
42
  import kotlinx.coroutines.launch
42
43
  // AI-GENERATED START: use the typed tab haptic pattern
43
- import vn.momo.maxapi.contract.device.vibration.model.VibrateStyle
44
44
  // AI-GENERATED END: use the typed tab haptic pattern
45
45
 
46
- private val inOutQuad = Easing { t -> if (t < 0.5f) 2 * t * t else 1 - 2 * (1 - t) * (1 - t) }
47
- internal val tabTimingSpec = tween<Float>(durationMillis = 200, easing = inOutQuad)
46
+ internal val inOutQuad = Easing { t -> if (t < 0.5f) 2 * t * t else 1 - 2 * (1 - t) * (1 - t) }
47
+ // the tab screens slide in index order over 280ms, CSS `ease`
48
+ private val tabSwitchSpec = tween<Float>(durationMillis = 280, easing = CubicBezierEasing(0.25f, 0.1f, 0.25f, 1f))
49
+
50
+ // -1 for tabs before the selected one, 1 for tabs after it: they wait a full width off screen on their side
51
+ private fun tabPosition(index: Int, selected: Int) = (index - selected).coerceIn(-1, 1).toFloat()
48
52
 
49
53
  internal val LocalBottomTabFocused = staticCompositionLocalOf { true }
50
54
 
@@ -78,7 +82,7 @@ fun BottomTab(
78
82
  ) {
79
83
  val navigation = LocalNavigation.current
80
84
  val navigator = LocalNavigator.current
81
- val maxApi = LocalMaxApi.current
85
+ val binding = LocalKitsBinding.current
82
86
  val startIndex = remember { items.indexOfFirst { it.name == initialRouteName }.coerceAtLeast(0) }
83
87
 
84
88
  remember(items) {
@@ -108,14 +112,21 @@ fun BottomTab(
108
112
  var lastFocusedIndex by rememberSaveable { mutableStateOf<Int?>(null) }
109
113
  val tabProgress = remember { mutableMapOf<Int, Animatable<Float, AnimationVector1D>>() }
110
114
  fun progressOf(index: Int) = tabProgress.getOrPut(index) {
111
- Animatable(if (index == lastFocusedIndex) 1f else 0f)
115
+ Animatable(tabPosition(index, lastFocusedIndex ?: index))
112
116
  }
113
117
  LaunchedEffect(selectedIndex) {
118
+ val previousIndex = lastFocusedIndex
114
119
  lastFocusedIndex = selectedIndex
115
120
  tabProgress.forEach { (index, progress) ->
116
- if (index != selectedIndex) launch { progress.animateTo(0f, tabTimingSpec) }
121
+ val target = tabPosition(index, selectedIndex)
122
+ launch {
123
+ if (index == selectedIndex || index == previousIndex) {
124
+ progress.animateTo(target, tabSwitchSpec)
125
+ } else {
126
+ progress.snapTo(target)
127
+ }
128
+ }
117
129
  }
118
- progressOf(selectedIndex).animateTo(1f, tabTimingSpec)
119
130
  }
120
131
 
121
132
  DisposableEffect(isFirstTab) {
@@ -135,9 +146,7 @@ fun BottomTab(
135
146
  it.bottom + duoRailHeight(items.size, hasQr, compressed = compression.tabBarCompressed) + DUO_GROUP_GAP
136
147
  } ?: 0.dp
137
148
  val onTabSelected: (Int) -> Unit = { index ->
138
- // AI-GENERATED START: preserve the light haptic on tab selection
139
- runCatching { maxApi?.vibrate(VibrateStyle.LIGHT) }
140
- // AI-GENERATED END: preserve the light haptic on tab selection
149
+ runCatching { binding?.vibrateLight() }
141
150
  val switchTab = {
142
151
  if (index != selectedIndex) selectTab(index)
143
152
  }
@@ -152,21 +161,20 @@ fun BottomTab(
152
161
  CompositionLocalProvider(
153
162
  LocalDuoRailReserve provides railReserve,
154
163
  LocalDuoBarCompression provides compression,
164
+ LocalTabBarHasCenterAction provides hasCenterAction(floatingButton, items.size),
155
165
  ) {
156
166
  loadedTabs.forEach { index ->
157
167
  val item = items.getOrNull(index) ?: return@forEach
158
168
  val focused = index == selectedIndex
159
169
  val progress = progressOf(index)
170
+ // the leaving tab stays drawn until it has slid off screen
171
+ val visible = focused || abs(progress.value) < 1f
160
172
  key(index) {
161
173
  Box(
162
174
  Modifier
163
175
  .fillMaxSize()
164
176
  .zIndex(if (focused) 0f else -1f)
165
- .then(if (focused) Modifier.graphicsLayer {
166
- alpha = 0.3f + 0.7f * progress.value
167
- scaleX = 0.97f + 0.03f * progress.value
168
- scaleY = scaleX
169
- } else Hidden)
177
+ .then(if (visible) Modifier.graphicsLayer { translationX = progress.value * size.width } else Hidden)
170
178
  ) {
171
179
  CompositionLocalProvider(LocalBottomTabFocused provides focused) {
172
180
  tabStateHolder.SaveableStateProvider(index) {
@@ -192,24 +200,23 @@ fun BottomTab(
192
200
  BackHandler(enabled = !onFirstTab) {
193
201
  if (backToInitialTab) backToFirstTab() else navigator.pop()
194
202
  }
195
- if (layout.isIPhoneDuo) {
196
- DuoTabBar(
197
- layout = layout,
198
- items = items,
199
- floatingButton = floatingButton,
200
- selectedIndex = selectedIndex,
201
- onTabSelected = onTabSelected,
202
- compression = compression,
203
- )
204
- } else {
205
- Column {
203
+ ScaleSizeScope(TabBarMetrics.LABEL_MAX_SCALE) {
204
+ if (layout.isIPhoneDuo) {
205
+ DuoTabBar(
206
+ layout = layout,
207
+ items = items,
208
+ floatingButton = floatingButton,
209
+ selectedIndex = selectedIndex,
210
+ onTabSelected = onTabSelected,
211
+ compression = compression,
212
+ )
213
+ } else {
206
214
  BottomTabBar(
207
215
  items = items,
208
216
  floatingButton = floatingButton,
209
217
  selectedIndex = selectedIndex,
210
218
  onTabSelected = onTabSelected,
211
219
  )
212
- Spacer(modifier = Modifier.fillMaxWidth().height(AppNavigationBar.current + Spacing.S).background(AppTheme.current.colors.background.surface))
213
220
  }
214
221
  }
215
222
  }
@@ -230,4 +237,8 @@ data class BottomTabFloatingButton(
230
237
  val icon: String,
231
238
  val label: String,
232
239
  val onPress: () -> Unit,
240
+ // replaces the icon inside the 48 button, e.g. the button part of a Lottie; centered, unclipped
241
+ val iconContent: (@Composable () -> Unit)? = null,
242
+ // drawn over the label text, which stays, e.g. the label part of a Lottie; centered, unclipped
243
+ val labelContent: (@Composable () -> Unit)? = null,
233
244
  )