@momo-kits/native-kits 0.168.1-beta.30-debug → 0.168.1-beta.31

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 (150) hide show
  1. package/CLAUDE.md +2 -1
  2. package/ios/Input/Input.swift +3 -1
  3. package/ios/Input/InputTextArea.swift +3 -1
  4. package/ios/Navigation/BottomTab/BottomTab.swift +33 -14
  5. package/ios/Navigation/BottomTab/BottomTabBar.swift +131 -254
  6. package/ios/Navigation/BottomTab/CurvedContainer.swift +47 -51
  7. package/ios/Navigation/BottomTab/DuoLiquidSelection.swift +364 -0
  8. package/ios/Navigation/BottomTab/DuoTabBar.swift +292 -71
  9. package/ios/Navigation/StackScreen.swift +1 -3
  10. package/ios/native-kits.podspec +1 -1
  11. package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
  12. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BottomTabDemo.swift +59 -224
  13. package/package.json +1 -1
  14. package/build.gradle.kts +0 -11
  15. package/compose/build.gradle.kts +0 -198
  16. package/compose/build.gradle.kts.backup +0 -198
  17. package/compose/compose.podspec +0 -47
  18. package/compose/src/androidMain/kotlin/vn/momo/kits/const/HostFont.android.kt +0 -20
  19. package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +0 -6
  20. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/BackGesture.android.kt +0 -12
  21. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/OsFontScale.android.kt +0 -7
  22. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +0 -153
  23. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReservedRegions.android.kt +0 -6
  24. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +0 -110
  25. package/compose/src/commonMain/kotlin/vn/momo/kits/application/DesignSystemKits.kt +0 -62
  26. package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +0 -1071
  27. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +0 -269
  28. package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +0 -56
  29. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +0 -157
  30. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +0 -81
  31. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +0 -32
  32. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +0 -338
  33. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +0 -175
  34. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +0 -357
  35. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +0 -115
  36. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +0 -89
  37. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +0 -128
  38. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +0 -209
  39. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +0 -542
  40. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +0 -49
  41. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +0 -86
  42. package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +0 -125
  43. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +0 -231
  44. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +0 -189
  45. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +0 -478
  46. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +0 -114
  47. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +0 -265
  48. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +0 -235
  49. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +0 -223
  50. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +0 -265
  51. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +0 -185
  52. package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +0 -343
  53. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +0 -108
  54. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +0 -56
  55. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +0 -41
  56. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +0 -84
  57. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +0 -40
  58. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +0 -370
  59. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +0 -108
  60. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +0 -308
  61. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +0 -59
  62. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +0 -87
  63. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +0 -21
  64. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +0 -90
  65. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +0 -330
  66. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +0 -220
  67. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +0 -473
  68. package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +0 -122
  69. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +0 -207
  70. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +0 -92
  71. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +0 -560
  72. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +0 -86
  73. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +0 -125
  74. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +0 -207
  75. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +0 -501
  76. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +0 -176
  77. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +0 -182
  78. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +0 -193
  79. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +0 -29
  80. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +0 -236
  81. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +0 -180
  82. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +0 -325
  83. package/compose/src/commonMain/kotlin/vn/momo/kits/const/HostFont.kt +0 -17
  84. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +0 -12
  85. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +0 -16
  86. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +0 -194
  87. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +0 -287
  88. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +0 -54
  89. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +0 -50
  90. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ScreenLayout.kt +0 -321
  91. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +0 -41
  92. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +0 -52
  93. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +0 -66
  94. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +0 -11
  95. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +0 -104
  96. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +0 -48
  97. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +0 -51
  98. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +0 -502
  99. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/HostBackGestureBridge.kt +0 -58
  100. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +0 -148
  101. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +0 -116
  102. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +0 -205
  103. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +0 -422
  104. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +0 -8
  105. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +0 -732
  106. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackTransition.kt +0 -148
  107. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/SwipeBackHaptic.kt +0 -35
  108. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +0 -224
  109. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +0 -383
  110. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +0 -94
  111. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoBarCompression.kt +0 -97
  112. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoTabBar.kt +0 -203
  113. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/TabBarMetrics.kt +0 -106
  114. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +0 -169
  115. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +0 -455
  116. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +0 -105
  117. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderJourney.kt +0 -106
  118. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderLocation.kt +0 -74
  119. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +0 -399
  120. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +0 -39
  121. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +0 -363
  122. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SideBar.kt +0 -192
  123. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +0 -133
  124. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +0 -127
  125. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/BackGesture.kt +0 -12
  126. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +0 -91
  127. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +0 -9
  128. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +0 -74
  129. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReservedRegions.kt +0 -20
  130. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +0 -1329
  131. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +0 -55
  132. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +0 -15
  133. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +0 -118
  134. package/compose/src/iosMain/kotlin/vn/momo/kits/const/HostFont.ios.kt +0 -42
  135. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/HostBackGesture.ios.kt +0 -45
  136. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +0 -32
  137. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/BackGesture.ios.kt +0 -38
  138. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/OsFontScale.ios.kt +0 -66
  139. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +0 -218
  140. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReservedRegions.ios.kt +0 -138
  141. package/gradle/libs.versions.toml +0 -69
  142. package/gradle/wrapper/gradle-wrapper.jar +0 -0
  143. package/gradle/wrapper/gradle-wrapper.properties +0 -8
  144. package/gradle.properties +0 -26
  145. package/gradlew +0 -252
  146. package/gradlew.bat +0 -94
  147. package/ios/Navigation/BottomTab/TabBarMetrics.swift +0 -88
  148. package/ios-demo/README.md +0 -120
  149. package/local.properties +0 -9
  150. package/settings.gradle.kts +0 -64
package/CLAUDE.md CHANGED
@@ -71,12 +71,13 @@ Publishing is automated (`publish.sh` + GitLab CI on `[ci build]` / `main`). Do
71
71
  ## Screen layout / iPhone Duo (port of RN `useScreenLayout`, momo-kits !664)
72
72
 
73
73
  - `layout/ScreenLayout.kt`: `getScreenLayout()` returns window size, raw top/bottom + side insets, `contentWidth`, header geometry, the iPhone Duo `sideBar` and `duoTopInset`. `NavigationContainer` computes it once and provides `LocalScreenLayout`; reactive to fold/unfold and rotation (window size + `WindowInsets`). Metrics (`DuoMetrics`, 72pt iPhone header floor, 20pt status-bar threshold) mirror RN `Layout/utils.ts` — change both together.
74
- - iPhone-only: everything gates on `isPhoneIdiom()` (`platform/`), never on "iOS", so iPad windows keep the regular layout. Two detectors, as in RN: `isIPhoneDuo` (window aspect < 1.6 or asymmetric side insets) drives layout; `isIPhoneDuoDevice` (Apple's foldable check: a `.division` reserved region, queried with include-inactive; Swift also latches on `UIHingeInteraction`; or asymmetric side insets, since the outer display reports no hinge) drives popups, modal and bottom sheet.
74
+ - iPhone-only: everything gates on `isPhoneIdiom()` (`platform/`), never on "iOS", so iPad windows keep the regular layout. Two detectors, as in RN: `isIPhoneDuo` (window aspect < 1.6 or asymmetric side insets) drives layout; `isIPhoneDuoDevice` (Apple's foldable check: a `.division` reserved region, queried with include-inactive; Swift also latches on `UIHingeInteraction`; or asymmetric side insets, since the outer display reports no hinge; on Android the hinge angle sensor feature, so foldables get the sizes but no side strip or side column) drives popups, modal and bottom sheet.
75
75
  - Header height is `headerHeight` (not `AppStatusBar + HEADER_HEIGHT`); the bar row is `headerBarHeight` and starts `headerStatusBarHeight` below the window top. When the status bar is off the top edge (iPhone landscape, iPhone Duo) `headerStatusBarHeight` is 0 so the title stays centered — except on the Duo outer display: in portrait the header is 76pt and the row starts at 14pt so the title centers on the camera punchout; in landscape the row centers on the camera when it sits at the top end of the strip (else on the back button) and the header reaches 8pt below the back button.
76
76
  - iPhone Duo inner display in portrait (status bar on top): the header row shares the status bar band — `headerHeight` 94pt (2 × the clock digits' y 47), `headerStatusBarHeight` 0 — and `ScreenLayout.statusBarClearance` keeps it between the clock / battery clusters (from reserved regions, else 128pt on the right). Back and toolkit use the 48pt side bar controls laid out horizontally (`ToolkitLayout.SideBarRow`); the collapsed search and a centered title stay clear of the clusters. Port of momo-kits `90af33ba2`.
77
77
  - iPhone Duo with a side strip ≥ 60pt: back + toolkit leave the bar for `HeaderSideBar` (`navigation/component/SideBar.kt`, 48pt glass controls); custom header-right stays in the bar. `sideBar.top` is 170pt in portrait, 120pt on the inner display in landscape (height ≥ 600), 24pt on the outer display in landscape, or below the header when the status bar is on top; UIKit's `statusBarFrame` is useless on Duo. Unlike RN the column is clamped above footer (24pt gap) / rail (12pt gap).
78
78
  - Reserved regions (iOS 27.1 `reservedRegionsOfKind:`, reached through the ObjC runtime so older SDKs still build): a probe `UIView` (`platform/ReservedRegions.ios.kt` on the Compose root view; `ReservedRegionsProbe` inside SwiftUI `momoScreenLayout()`) re-reads them in `layoutSubviews`, which UIKit re-runs when they change. They push `sideBar.top` below the status cluster as it grows for calls / Live Activities, and `sideBar.bottom` (≥ 24pt) above a camera at the bottom end of the strip.
79
79
  - Tab bar on Duo is `bottomtab/DuoTabBar.kt`: a rail in the side strip (`sideBar.bottom` above the window bottom, QR below it) or, without a side bar, a floating bar spanning 6/8 grid columns. Both overlay the content; `duoFloatingTabBarInset` pads tab content, footer and FAB.
80
+ - Duo tab selection motion (`bottomtab/DuoLiquidSelection.kt` / `ios/Navigation/BottomTab/DuoLiquidSelection.swift`, port of RN `useLiquidSelection.ts`, momo-kits !682): press lifts the lens, a drag past 10pt takes over (Compose: the bar's `pointerInput` consumes and so cancels the tab's clickable; SwiftUI: one `DragGesture` over the bar, tabs are not `Button`s), long press calls `BottomTab(onTabLongPress)` and release still selects, Reduce Motion (`platform/ReduceMotion`) falls back to a plain slide. SwiftUI integrates the lens spring on a display link because the stretch and the tabs' active tint read it every frame. Constants mirror RN — change both together.
80
81
  - Bar compression (`bottomtab/DuoBarCompression.kt`, HIG "Vertical controls"): when toolbar + rail don't fit in the strip, one is compressed — the toolkit into a `navigation_menu` button, the rail into one button showing the current tab — and tapping it swaps them; `BottomTab(compressionBehavior)` picks which starts compressed. If neither fits beside the other compressed, both rest compressed and a tap opens one for a moment. Side bar columns report their full height (0 when the screen puts nothing there) so the decision follows each screen's toolkit.
81
82
  - Glass header: on Duo with a side bar, Default/Extended headers without search and with a `ScrollState` let content scroll under the bar (`usesDuoGlassHeader`); the bar fades in a translucent surface + hairline over 16pt (Compose has no backdrop blur — RN's fallback look), the gradient leaves with the content.
82
83
  - Quick return header: glass headers and Animated headers (with a `ScrollState`) on the Duo side bar layout slide out with the content and back in on a reverse scroll; a half-shown header settles in or out once the scroll stops. The side bar is drawn apart from the header, so it stays put.
@@ -252,7 +252,9 @@ public struct Input: View {
252
252
  }
253
253
  .padding(.horizontal, Spacing.S)
254
254
  .background(theme.colors.background.surface)
255
- .alignmentGuide(.top) { $0[VerticalAlignment.center] }
255
+ // A zero-height frame on the top edge centers the label on the border, re-laid out with font scale.
256
+ .fixedSize(horizontal: false, vertical: true)
257
+ .frame(height: 0)
256
258
  .offset(x: Spacing.S)
257
259
  }
258
260
  }
@@ -279,7 +279,9 @@ public struct InputTextArea: View {
279
279
  }
280
280
  .padding(.horizontal, Spacing.S)
281
281
  .background(theme.colors.background.surface)
282
- .alignmentGuide(.top) { $0[VerticalAlignment.center] }
282
+ // A zero-height frame on the top edge centers the label on the border, re-laid out with font scale.
283
+ .fixedSize(horizontal: false, vertical: true)
284
+ .frame(height: 0)
283
285
  .offset(x: Spacing.S)
284
286
  }
285
287
  }
@@ -16,6 +16,7 @@ public struct BottomTab: View {
16
16
  private let compressionBehavior: DuoBarCompressionBehavior
17
17
  private let onTabPress: ((_ index: Int, _ switchTab: @escaping () -> Void) -> Void)?
18
18
  private let backToInitialTab: Bool
19
+ private let onTabLongPress: ((_ index: Int) -> Void)?
19
20
 
20
21
  @EnvironmentObject private var navigator: Navigator
21
22
  /// The screen hosting the tabs (Compose's `LocalNavigation` in BottomTab).
@@ -34,28 +35,32 @@ public struct BottomTab: View {
34
35
  /// starts compressed; tapping the compressed one swaps them.
35
36
  /// `onTabPress` gets every tab press with the switch to perform, e.g. after a login gate.
36
37
  /// `backToInitialTab`: back off another tab returns to the initial one before leaving the screen.
38
+ /// `onTabLongPress`: RN `tabLongPress`; on iPhone Duo the held tab is still selected on release.
37
39
  public init(
38
40
  items: [BottomTabItem],
39
41
  floatingButton: BottomTabFloatingButton? = nil,
40
42
  compressionBehavior: DuoBarCompressionBehavior = .toolbar,
41
43
  initialRouteName: String? = nil,
42
44
  onTabPress: ((_ index: Int, _ switchTab: @escaping () -> Void) -> Void)? = nil,
43
- backToInitialTab: Bool = true
45
+ backToInitialTab: Bool = true,
46
+ onTabLongPress: ((_ index: Int) -> Void)? = nil
44
47
  ) {
45
48
  self.items = items
46
49
  self.floatingButton = floatingButton
47
50
  self.compressionBehavior = compressionBehavior
48
51
  self.onTabPress = onTabPress
49
52
  self.backToInitialTab = backToInitialTab
53
+ self.onTabLongPress = onTabLongPress
50
54
  let start = items.firstIndex { $0.name == initialRouteName } ?? 0
51
55
  _startIndex = State(initialValue: start)
52
56
  _selectedIndex = State(initialValue: start)
53
57
  }
54
58
 
55
59
  private var bottomInset: CGFloat { safeAreaBottomInset() }
56
- // the bars float over the content (tab screens keep clear of them through duoTabBarInsets) or sit
57
- // in the side strip, so only the home indicator is kept clear
58
- private var reservedBottom: CGFloat { layout.insets.bottom }
60
+ // the Duo bars overlay the content or sit in the side strip, so only the home indicator is kept clear
61
+ private var reservedBottom: CGFloat {
62
+ layout.isIPhoneDuo ? layout.insets.bottom : BOTTOM_TAB_BAR_HEIGHT + bottomInset + Spacing.S
63
+ }
59
64
 
60
65
  private var compression: DuoBarCompression {
61
66
  DuoBarCompression.resolve(
@@ -100,16 +105,30 @@ public struct BottomTab: View {
100
105
  floatingButton: floatingButton,
101
106
  selectedIndex: selectedIndex,
102
107
  onTabSelected: selectTab,
103
- compression: compression
108
+ compression: compression,
109
+ onTabLongPress: onTabLongPress,
110
+ onTick: { [maxApi = navigator.maxApi] in
111
+ if let maxApi {
112
+ maxApi.triggerEventVibration("light")
113
+ } else {
114
+ UIImpactFeedbackGenerator(style: .light).impactOccurred()
115
+ }
116
+ }
104
117
  )
105
118
  } else {
106
- BottomTabBar(
107
- items: items,
108
- floatingButton: floatingButton,
109
- selectedIndex: selectedIndex,
110
- onTabSelected: selectTab,
111
- bottomInset: bottomInset
112
- )
119
+ // Tab bar + home-indicator filler.
120
+ VStack(spacing: 0) {
121
+ BottomTabBar(
122
+ items: items,
123
+ floatingButton: floatingButton,
124
+ selectedIndex: selectedIndex,
125
+ onTabSelected: selectTab,
126
+ onTabLongPress: onTabLongPress
127
+ )
128
+ theme.colors.background.surface
129
+ .frame(height: bottomInset + Spacing.S)
130
+ .ignoresSafeArea(edges: .horizontal)
131
+ }
113
132
  }
114
133
  }
115
134
  .frame(maxWidth: .infinity, maxHeight: .infinity)
@@ -131,7 +150,6 @@ public struct BottomTab: View {
131
150
  }
132
151
 
133
152
  private func selectTab(_ index: Int) {
134
- navigator.maxApi?.triggerEventVibration("light")
135
153
  let switchTab = { if index != selectedIndex { selectedIndex = index } }
136
154
  if let onTabPress { onTabPress(index, switchTab) } else { switchTab() }
137
155
  }
@@ -320,7 +338,8 @@ private struct TabCard: View {
320
338
 
321
339
  /// Bottom safe-area inset (home indicator).
322
340
  private func safeAreaBottomInset() -> CGFloat {
323
- UIApplication.shared.connectedScenes
341
+ let bottomInset = UIApplication.shared.connectedScenes
324
342
  .compactMap { ($0 as? UIWindowScene)?.keyWindow?.safeAreaInsets.bottom }
325
343
  .first ?? 0
344
+ return min(bottomInset, 21)
326
345
  }
@@ -3,8 +3,8 @@
3
3
  // MoMoUIKits
4
4
  //
5
5
  // SwiftUI mirror of Compose's `navigation/bottomtab/BottomTabBar.kt`.
6
- // Horizontal navigation bar (Figma "Specs Navigation", DS-984): floating container, items split
7
- // evenly with a tonal active indicator, badges/dots, and the Special type's center action in a notch.
6
+ // Renders the row of tab items, an animated selection indicator, a top shadow,
7
+ // badges/dots, and an optional center floating button (with the curved notch).
8
8
  //
9
9
 
10
10
  import SwiftUI
@@ -57,311 +57,188 @@ public struct BottomTabFloatingButton {
57
57
  }
58
58
  }
59
59
 
60
- let BOTTOM_TAB_BAR_HEIGHT: CGFloat = TabBarMetrics.height
60
+ let bottomTabFloatingButtonWidth: CGFloat = 75
61
+ let BOTTOM_TAB_BAR_HEIGHT: CGFloat = 64
61
62
 
62
63
  // MARK: - Tab bar
63
64
 
64
- /// Phone tab bar: the horizontal navigation bar filling the window, above the home indicator.
65
65
  struct BottomTabBar: View {
66
66
  let items: [BottomTabItem]
67
67
  let floatingButton: BottomTabFloatingButton?
68
68
  let selectedIndex: Int
69
69
  let onTabSelected: (Int) -> Void
70
- let bottomInset: CGFloat
70
+ var onTabLongPress: ((Int) -> Void)?
71
71
 
72
72
  @Environment(\.screenLayout) private var layout
73
+ @Environment(\.appTheme) private var theme
73
74
 
74
- var body: some View {
75
- HorizontalTabBar(
76
- items: items,
77
- floatingButton: floatingButton,
78
- selectedIndex: selectedIndex,
79
- onTabSelected: onTabSelected,
80
- width: TabBarMetrics.horizontalBarWidth(layout)
81
- )
82
- .padding(.bottom, TabBarMetrics.bottomGap(bottomInset))
83
- .frame(maxWidth: .infinity)
84
- }
85
- }
86
-
87
- /// Horizontal navigation bar: floating container, items split evenly; Special type puts the center
88
- /// action in a notch in the middle, rising ctaLift above the container. One active indicator slides
89
- /// behind the selected item.
90
- struct HorizontalTabBar: View {
91
- let items: [BottomTabItem]
92
- let floatingButton: BottomTabFloatingButton?
93
- let selectedIndex: Int
94
- let onTabSelected: (Int) -> Void
95
- let width: CGFloat
96
- var fixedFontScale = false
75
+ // the bar sits between the side safe areas
76
+ private var screenWidth: CGFloat { layout.width - layout.insets.leading - layout.insets.trailing }
77
+ private var mid: Int { items.count / 2 }
97
78
 
98
- private var cta: BottomTabFloatingButton? {
99
- TabBarMetrics.hasCenterAction(floatingButton, tabCount: items.count) ? floatingButton : nil
100
- }
101
-
102
- /// Items share what the padding, gaps and center action slot leave.
103
- private var itemWidth: CGFloat {
104
- let slots = CGFloat(items.count + (cta == nil ? 0 : 1))
105
- let content = width - 2 * TabBarMetrics.paddingHorizontal - (slots - 1) * TabBarMetrics.itemGap
106
- return max((content - (cta == nil ? 0 : TabBarMetrics.ctaSlotWidth)) / CGFloat(max(items.count, 1)), 0)
79
+ private var tabWidth: CGFloat {
80
+ if floatingButton != nil {
81
+ return (screenWidth - bottomTabFloatingButtonWidth) / CGFloat(items.count)
82
+ }
83
+ return screenWidth / CGFloat(items.count)
107
84
  }
108
85
 
109
- private func itemX(_ index: Int) -> CGFloat {
110
- let afterCta = cta != nil && index >= items.count / 2
111
- return TabBarMetrics.paddingHorizontal + CGFloat(index) * (itemWidth + TabBarMetrics.itemGap)
112
- + (afterCta ? TabBarMetrics.ctaSlotWidth + TabBarMetrics.itemGap : 0)
86
+ private var indicatorOffset: CGFloat {
87
+ let adjust: CGFloat = (floatingButton != nil && selectedIndex >= mid) ? bottomTabFloatingButtonWidth : 0
88
+ return tabWidth * CGFloat(selectedIndex) + tabWidth / 2 - screenWidth / 2 + adjust
113
89
  }
114
90
 
115
91
  var body: some View {
116
- let shape = NotchedBarShape(radius: TabBarMetrics.height / 2, notchCenterX: cta == nil ? nil : width / 2)
117
- ZStack(alignment: .top) {
118
- ZStack(alignment: .topLeading) {
119
- ActiveIndicator(radius: TabBarMetrics.indicatorRadius)
120
- .frame(width: itemWidth, height: TabBarMetrics.indicatorHeight)
121
- .offset(x: itemX(selectedIndex), y: TabBarMetrics.paddingVertical)
122
- .animation(TabBarMetrics.indicatorMotion, value: selectedIndex)
123
-
124
- HStack(spacing: TabBarMetrics.itemGap) {
125
- ForEach(items.indices, id: \.self) { index in
126
- if cta != nil && index == items.count / 2 {
127
- Color.clear.frame(width: TabBarMetrics.ctaSlotWidth)
128
- }
129
- SwiftUI.Button { onTabSelected(index) } label: {
130
- VStack(spacing: Spacing.XXS) {
131
- TabItemContent(item: items[index], selected: index == selectedIndex, fixedFontScale: fixedFontScale)
132
- }
133
- .frame(width: itemWidth)
134
- .contentShape(Rectangle())
135
- }
136
- .buttonStyle(.plain)
137
- .accessibilityLabel(items[index].label)
138
- .accessibilityAddTraits(index == selectedIndex ? .isSelected : [])
139
- }
92
+ ZStack(alignment: .bottom) {
93
+ HStack(spacing: 0) {
94
+ if floatingButton == nil {
95
+ tabItems(from: 0, to: items.count)
96
+ } else {
97
+ tabItems(from: 0, to: mid)
98
+ Spacer()
99
+ .frame(width: bottomTabFloatingButtonWidth)
100
+ .padding(.horizontal, Spacing.XXS)
101
+ tabItems(from: mid, to: items.count)
140
102
  }
141
- .padding(.horizontal, TabBarMetrics.paddingHorizontal)
142
- .padding(.vertical, TabBarMetrics.paddingVertical)
143
103
  }
144
- .frame(width: width, height: TabBarMetrics.height, alignment: .topLeading)
145
- .modifier(TabBarContainer(shape: shape))
146
- .accessibilityElement(children: .contain)
147
- .accessibilityIdentifier("bottom_tab_bar")
148
- .padding(.top, cta == nil ? 0 : TabBarMetrics.ctaLift)
104
+ .frame(maxWidth: .infinity)
105
+ .frame(height: BOTTOM_TAB_BAR_HEIGHT)
106
+ .background(theme.colors.background.surface.ignoresSafeArea(edges: .horizontal))
107
+
108
+ // Animated selection indicator.
109
+ RoundedRectangle(cornerRadius: 2)
110
+ .fill(theme.colors.primary)
111
+ .frame(width: 44, height: 2)
112
+ .offset(x: indicatorOffset, y: -BOTTOM_TAB_BAR_HEIGHT + 2)
113
+ .animation(.easeInOut(duration: 0.25), value: selectedIndex)
114
+
115
+ // Top shadow.
116
+ LinearGradient(
117
+ colors: [Color.black.opacity(0.05), .clear],
118
+ startPoint: .bottom,
119
+ endPoint: .top
120
+ )
121
+ .frame(height: 6)
122
+ .frame(maxWidth: .infinity)
123
+ .offset(y: -BOTTOM_TAB_BAR_HEIGHT)
149
124
 
150
- if let cta {
151
- CenterAction(data: cta, fixedFontScale: fixedFontScale)
125
+ if let floatingButton {
126
+ CenterFloatingButton(data: floatingButton)
152
127
  }
153
128
  }
154
- .frame(width: width)
155
129
  }
156
- }
157
-
158
- /// One active indicator per bar: Background/tonal with its inner light (white 12% from below) and
159
- /// tint (primary 12% from above).
160
- struct ActiveIndicator: View {
161
- let radius: CGFloat
162
-
163
- @Environment(\.appTheme) private var theme
164
130
 
165
- var body: some View {
166
- let shape = RoundedRectangle(cornerRadius: radius)
167
- shape
168
- .fill(theme.colors.background.tonal)
169
- // inner shadows: primary 12% falling 1 from the top edge, white 12% rising 2 from the bottom one
170
- .overlay(
171
- LinearGradient(
172
- stops: [
173
- .init(color: theme.colors.primary.opacity(0.12), location: 0),
174
- .init(color: theme.colors.primary.opacity(0), location: 0.1),
175
- .init(color: Color.white.opacity(0), location: 0.85),
176
- .init(color: Color.white.opacity(0.12), location: 1),
177
- ],
178
- startPoint: .top,
179
- endPoint: .bottom
180
- )
181
- .clipShape(shape)
131
+ @ViewBuilder
132
+ private func tabItems(from: Int, to: Int) -> some View {
133
+ ForEach(from..<to, id: \.self) { index in
134
+ TabBarItem(
135
+ item: items[index],
136
+ selected: index == selectedIndex,
137
+ // from the icon's center to the cell's end edge, inside both XXS paddings
138
+ badgeMaxWidth: tabWidth / 2 - Spacing.XXS * 2,
139
+ onClick: { onTabSelected(index) },
140
+ onLongClick: onTabLongPress.map { callback in { callback(index) } }
182
141
  )
183
- .allowsHitTesting(false)
184
- }
185
- }
186
-
187
- /// Like the system tab bar, text keeps its design size instead of growing with the wide Duo displays.
188
- struct FixedFontScale: ViewModifier {
189
- let enabled: Bool
190
-
191
- @Environment(\.momoFontScale) private var fontScale
192
-
193
- func body(content: Content) -> some View {
194
- content.environment(\.momoFontScale, enabled ? FontScale(userScaleRate: 1, useOSScaleRate: false) : fontScale)
142
+ .frame(maxWidth: .infinity)
143
+ }
195
144
  }
196
145
  }
197
146
 
198
147
  // MARK: - Tab item
199
148
 
200
- /// Icon in its indicator slot, label under it. The bar slides one shared active indicator behind the
201
- /// slots; the icon and label tint cross-fade on focus.
202
- struct TabItemContent: View {
149
+ private struct TabBarItem: View {
203
150
  let item: BottomTabItem
204
151
  let selected: Bool
205
- var vertical = false
206
- var showLabel = true
207
- var fixedFontScale = false
152
+ let badgeMaxWidth: CGFloat
153
+ let onClick: () -> Void
154
+ let onLongClick: (() -> Void)?
208
155
 
209
156
  @Environment(\.appTheme) private var theme
210
157
 
211
- var body: some View {
212
- TabIcon(item: item, selected: selected, vertical: vertical)
213
- .frame(height: vertical ? TabBarMetrics.railIndicatorHeight : TabBarMetrics.indicatorHeight)
214
- if showLabel {
215
- let label = ZStack {
216
- labelText(theme.colors.text.secondary).opacity(selected ? 0 : 1)
217
- labelText(theme.colors.primary).opacity(selected ? 1 : 0)
218
- }
219
- .animation(TabBarMetrics.tintMotion, value: selected)
220
- .frame(maxWidth: vertical ? nil : .infinity)
221
- label.modifier(FixedFontScale(enabled: fixedFontScale))
222
- }
223
- }
158
+ private var tintColor: Color { selected ? theme.colors.primary : theme.colors.text.hint }
224
159
 
225
- private func labelText(_ color: Color) -> some View {
226
- MomoText(
227
- item.label,
228
- typography: vertical ? .labelXsMedium : .labelSMedium,
229
- color: color,
230
- textAlign: .center,
231
- maxLines: 1
232
- )
233
- .truncationMode(.tail)
160
+ /// Mirrors Compose's `formatLabel`: hide a badge that is the number "0".
161
+ private var badgeLabel: String? {
162
+ guard let label = item.badgeLabel else { return nil }
163
+ if let n = Int(label), n == 0 { return nil }
164
+ return label
234
165
  }
235
- }
236
-
237
- /// Badge value shown on a tab: nil hides it, "" is a dot, numbers cap at 99+ ("0" hides it, RN parity).
238
- func tabBadgeLabel(_ item: BottomTabItem) -> String? {
239
- guard let label = item.badgeLabel else { return item.showDot ? "" : nil }
240
- if label.isEmpty { return "" }
241
- if label.allSatisfy({ ("0"..."9").contains($0) }) {
242
- let value = Int(label) ?? Int.max
243
- if value == 0 { return item.showDot ? "" : nil }
244
- return value > 99 ? "99+" : label
245
- }
246
- return label
247
- }
248
-
249
- /// 24 icon, active and inactive tints cross-faded; badges hang off it: dot at 16/-2, label badge at
250
- /// 12/-7 growing right, or centered over the icon at -10 on the rail.
251
- struct TabIcon: View {
252
- let item: BottomTabItem
253
- let selected: Bool
254
- var vertical = false
255
-
256
- @Environment(\.appTheme) private var theme
257
166
 
258
167
  var body: some View {
259
- ZStack {
260
- Icon(source: item.icon, size: TabBarMetrics.iconSize, color: theme.colors.text.secondary)
261
- .opacity(selected ? 0 : 1)
262
- Icon(source: item.icon, size: TabBarMetrics.iconSize, color: theme.colors.primary)
263
- .opacity(selected ? 1 : 0)
264
- }
265
- .animation(TabBarMetrics.tintMotion, value: selected)
266
- .frame(width: TabBarMetrics.iconSize, height: TabBarMetrics.iconSize)
267
- .overlay(alignment: vertical ? .top : .topLeading) {
268
- if let badge = tabBadgeLabel(item) {
269
- if badge.isEmpty {
270
- BadgeDot(size: .small)
271
- .offset(x: vertical ? 16 - (TabBarMetrics.iconSize - 10) / 2 : 16, y: -Spacing.XXS)
272
- } else {
273
- TabBadge(label: badge)
274
- .fixedSize()
275
- .frame(width: TabBarMetrics.badgeMaxWidth, alignment: vertical ? .center : .leading)
276
- .offset(x: vertical ? 0 : Spacing.M, y: vertical ? -10 : -7)
168
+ VStack(spacing: 0) {
169
+ Icon(source: item.icon, size: 28, color: tintColor)
170
+ .overlay(alignment: .topLeading) {
171
+ // starts at the icon's center and grows toward the cell's end edge, ellipsized past it
172
+ if let badgeLabel, !badgeLabel.isEmpty {
173
+ Badge(label: badgeLabel)
174
+ .frame(width: max(badgeMaxWidth, 0), alignment: .leading)
175
+ .offset(x: 14, y: -Spacing.S)
176
+ }
277
177
  }
278
- }
178
+ .overlay(alignment: .topTrailing) {
179
+ if badgeLabel?.isEmpty == true || (badgeLabel == nil && item.showDot) {
180
+ BadgeDot(size: .small).offset(x: 4, y: -4)
181
+ }
182
+ }
183
+ .padding(Spacing.XS)
184
+ MomoText(
185
+ item.label,
186
+ typography: selected ? .labelXsMedium : .descriptionXsRegular,
187
+ color: tintColor,
188
+ textAlign: .center,
189
+ maxLines: 1
190
+ )
191
+ .truncationMode(.tail)
279
192
  }
193
+ .frame(maxWidth: .infinity, maxHeight: .infinity)
194
+ .padding(.horizontal, Spacing.S)
195
+ .padding(.vertical, Spacing.S)
196
+ .frame(maxWidth: .infinity, maxHeight: .infinity)
197
+ .padding(.horizontal, Spacing.XXS)
198
+ .contentShape(Rectangle())
199
+ .onTapGesture { onClick() }
200
+ .modifier(TabLongPress(action: onLongClick))
280
201
  }
281
202
  }
282
203
 
283
- /// Numbers use the error color, text the warning color (Figma Badge round numeric / text); the text
284
- /// keeps its design size so it fits the 16 height on the Duo displays too.
285
- private struct TabBadge: View {
286
- let label: String
287
-
288
- @Environment(\.appTheme) private var theme
289
-
290
- private var isNumber: Bool {
291
- let digits = label.hasSuffix("+") ? String(label.dropLast()) : label
292
- return !digits.isEmpty && digits.allSatisfy { ("0"..."9").contains($0) }
293
- }
204
+ /// Only attached with a callback, so a held tab without one still selects on release.
205
+ private struct TabLongPress: ViewModifier {
206
+ let action: (() -> Void)?
294
207
 
295
- var body: some View {
296
- MomoText(label, typography: .actionXxsBold, color: Colors.black01, maxLines: 1)
297
- .truncationMode(.tail)
298
- .environment(\.momoFontScale, FontScale(userScaleRate: 1, useOSScaleRate: false))
299
- .padding(.horizontal, Spacing.XS)
300
- .frame(minWidth: 16, maxWidth: TabBarMetrics.badgeMaxWidth, minHeight: 16, maxHeight: 16)
301
- .background(Capsule().fill(isNumber ? theme.colors.error.primary : theme.colors.warning.primary))
302
- .overlay(Capsule().strokeBorder(theme.colors.background.surface, lineWidth: 1))
208
+ func body(content: Content) -> some View {
209
+ if let action {
210
+ content.onLongPressGesture(minimumDuration: 0.5, perform: action)
211
+ } else {
212
+ content
213
+ }
303
214
  }
304
215
  }
305
216
 
306
- // MARK: - Center action
217
+ // MARK: - Center floating button
307
218
 
308
- /// Center action press: the button shrinks while held and its label turns active (label in a
309
- /// Background/primary pill, white text).
310
- struct CenterActionStyle: ButtonStyle {
311
- let size: CGFloat
312
- let vertical: Bool
313
- let icon: String
314
- let label: String
315
- var fixedFontScale = false
219
+ private struct CenterFloatingButton: View {
220
+ let data: BottomTabFloatingButton
316
221
 
317
222
  @Environment(\.appTheme) private var theme
318
223
 
319
- func makeBody(configuration: Configuration) -> some View {
320
- let pressed = configuration.isPressed
321
- VStack(spacing: vertical ? TabBarMetrics.railCtaLabelGap : TabBarMetrics.ctaLabelGap) {
322
- ZStack {
323
- // Figma Effect/Popover, one layer per shadow, spread as a shrunk circle:
324
- // 8% y8 blur 24 spread -12, 4% y12 blur 32 spread -16
325
- Circle().inset(by: 12).fill(theme.colors.primary)
326
- .shadow(color: Color.black.opacity(0.08), radius: 12, x: 0, y: 8)
327
- Circle().inset(by: 16).fill(theme.colors.primary)
328
- .shadow(color: Color.black.opacity(0.04), radius: 16, x: 0, y: 12)
329
- Circle().fill(theme.colors.primary)
330
- Icon(source: icon, size: TabBarMetrics.ctaIconSize, color: Colors.black01)
331
- }
332
- .frame(width: size, height: size)
333
- .scaleEffect(pressed ? TabBarMetrics.ctaPressedScale : 1)
334
- .animation(TabBarMetrics.ctaPressMotion, value: pressed)
335
- MomoText(
336
- label,
337
- typography: vertical ? .labelXsMedium : .labelSMedium,
338
- color: pressed ? Colors.black01 : theme.colors.text.secondary,
339
- textAlign: .center,
340
- maxLines: 1
341
- )
342
- .truncationMode(.tail)
343
- .modifier(FixedFontScale(enabled: fixedFontScale))
344
- .padding(.horizontal, vertical ? Spacing.XS : Spacing.XXS)
345
- .frame(minHeight: vertical ? nil : TabBarMetrics.ctaLabelHeight)
346
- .background(Capsule().fill(pressed ? theme.colors.primary : Color.clear))
224
+ var body: some View {
225
+ VStack(spacing: 0) {
226
+ CurvedContainer()
227
+ Circle()
228
+ .fill(theme.colors.primary)
229
+ .frame(width: 48, height: 48)
230
+ .overlay(Icon(source: data.icon, size: 28, color: .white))
231
+ Spacer().frame(height: 4)
232
+ MomoText(data.label, typography: .labelXsMedium, color: Colors.black01, textAlign: .center, maxLines: 1)
233
+ .frame(maxWidth: .infinity)
234
+ .frame(height: 14)
235
+ .background(theme.colors.primary)
236
+ .clipShape(RoundedRectangle(cornerRadius: Radius.XL))
347
237
  }
348
- // the whole slot is the hit area, not just the button and label
349
- .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top)
238
+ .frame(width: bottomTabFloatingButtonWidth)
239
+ .padding(.horizontal, Spacing.XXS)
240
+ .padding(.vertical, Spacing.S)
350
241
  .contentShape(Rectangle())
351
- }
352
- }
353
-
354
- /// Center action (.Nav/CTA): button rising out of the notch, label under it.
355
- private struct CenterAction: View {
356
- let data: BottomTabFloatingButton
357
- var fixedFontScale = false
358
-
359
- var body: some View {
360
- SwiftUI.Button(action: data.onPress) { EmptyView() }
361
- .buttonStyle(CenterActionStyle(size: TabBarMetrics.ctaSize, vertical: false, icon: data.icon,
362
- label: data.label, fixedFontScale: fixedFontScale))
363
- .frame(width: TabBarMetrics.ctaSlotWidth, height: TabBarMetrics.ctaSize + TabBarMetrics.ctaLabelGap + TabBarMetrics.ctaLabelHeight)
364
- .accessibilityLabel(data.label)
365
- .accessibilityIdentifier(data.label)
242
+ .onTapGesture { data.onPress() }
366
243
  }
367
244
  }