@momo-kits/native-kits 0.169.8-beta.3-debug → 0.169.8-beta.4

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 (154) hide show
  1. package/ios/Input/InputSearch.swift +23 -6
  2. package/ios/Layout/HeaderLayout.swift +60 -0
  3. package/ios/Navigation/BottomTab/BottomTabBar.swift +0 -9
  4. package/ios/Navigation/Component/Header.swift +25 -15
  5. package/ios/Navigation/Component/HeaderJourney.swift +2 -1
  6. package/ios/Navigation/Component/HeaderLocation.swift +2 -1
  7. package/ios/Navigation/Component/HeaderRight.swift +13 -8
  8. package/ios/Navigation/Component/HeaderUser.swift +2 -1
  9. package/ios/Navigation/Navigation.swift +6 -26
  10. package/ios/Navigation/StackScreen.swift +30 -26
  11. package/ios/native-kits.podspec +1 -1
  12. package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
  13. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AnimatedHeaderDemo.swift +11 -2
  14. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BottomTabDemo.swift +1 -13
  15. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +11 -0
  16. package/package.json +1 -1
  17. package/build.gradle.kts +0 -11
  18. package/compose/build.gradle.kts +0 -198
  19. package/compose/compose.podspec +0 -47
  20. package/compose/src/androidMain/kotlin/vn/momo/kits/const/HostFont.android.kt +0 -19
  21. package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +0 -6
  22. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/BackGesture.android.kt +0 -12
  23. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/OsFontScale.android.kt +0 -7
  24. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +0 -154
  25. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReduceMotion.android.kt +0 -17
  26. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReservedRegions.android.kt +0 -6
  27. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +0 -110
  28. package/compose/src/commonMain/kotlin/vn/momo/kits/application/DesignSystemKits.kt +0 -62
  29. package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +0 -1067
  30. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +0 -267
  31. package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +0 -56
  32. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +0 -157
  33. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +0 -82
  34. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +0 -32
  35. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +0 -338
  36. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +0 -175
  37. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +0 -356
  38. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +0 -115
  39. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +0 -89
  40. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +0 -128
  41. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +0 -209
  42. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +0 -482
  43. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +0 -49
  44. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +0 -86
  45. package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +0 -125
  46. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +0 -224
  47. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +0 -195
  48. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +0 -473
  49. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +0 -113
  50. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +0 -263
  51. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +0 -235
  52. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +0 -228
  53. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +0 -265
  54. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +0 -183
  55. package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +0 -343
  56. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +0 -108
  57. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +0 -56
  58. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +0 -40
  59. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +0 -82
  60. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +0 -39
  61. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +0 -363
  62. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +0 -108
  63. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +0 -307
  64. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +0 -59
  65. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +0 -87
  66. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +0 -21
  67. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +0 -88
  68. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +0 -306
  69. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +0 -220
  70. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +0 -457
  71. package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +0 -122
  72. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +0 -205
  73. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +0 -89
  74. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +0 -542
  75. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +0 -86
  76. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +0 -120
  77. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +0 -201
  78. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +0 -498
  79. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +0 -176
  80. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +0 -182
  81. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +0 -193
  82. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +0 -29
  83. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +0 -210
  84. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +0 -180
  85. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +0 -325
  86. package/compose/src/commonMain/kotlin/vn/momo/kits/const/HostFont.kt +0 -12
  87. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +0 -12
  88. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +0 -16
  89. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +0 -194
  90. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +0 -292
  91. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +0 -54
  92. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +0 -50
  93. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ModalLayout.kt +0 -184
  94. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ScreenLayout.kt +0 -316
  95. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +0 -41
  96. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +0 -52
  97. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +0 -66
  98. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +0 -11
  99. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +0 -104
  100. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +0 -48
  101. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +0 -51
  102. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +0 -397
  103. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/HostBackGestureBridge.kt +0 -58
  104. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +0 -153
  105. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +0 -113
  106. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +0 -205
  107. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +0 -422
  108. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +0 -8
  109. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +0 -727
  110. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackTransition.kt +0 -148
  111. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/SwipeBackHaptic.kt +0 -35
  112. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +0 -242
  113. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +0 -400
  114. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +0 -100
  115. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoBarCompression.kt +0 -97
  116. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoTabBar.kt +0 -207
  117. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/TabBarMetrics.kt +0 -132
  118. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +0 -167
  119. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +0 -456
  120. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +0 -105
  121. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderJourney.kt +0 -106
  122. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderLocation.kt +0 -74
  123. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +0 -399
  124. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +0 -39
  125. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +0 -363
  126. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SideBar.kt +0 -204
  127. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +0 -133
  128. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +0 -127
  129. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/BackGesture.kt +0 -12
  130. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +0 -114
  131. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +0 -9
  132. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +0 -76
  133. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReduceMotion.kt +0 -7
  134. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReservedRegions.kt +0 -22
  135. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +0 -1329
  136. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +0 -55
  137. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +0 -15
  138. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +0 -118
  139. package/compose/src/iosMain/kotlin/vn/momo/kits/const/HostFont.ios.kt +0 -42
  140. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/HostBackGesture.ios.kt +0 -45
  141. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +0 -32
  142. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/BackGesture.ios.kt +0 -38
  143. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/OsFontScale.ios.kt +0 -66
  144. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +0 -218
  145. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReduceMotion.ios.kt +0 -48
  146. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReservedRegions.ios.kt +0 -144
  147. package/gradle/libs.versions.toml +0 -67
  148. package/gradle/wrapper/gradle-wrapper.jar +0 -0
  149. package/gradle/wrapper/gradle-wrapper.properties +0 -8
  150. package/gradle.properties +0 -24
  151. package/gradlew +0 -252
  152. package/gradlew.bat +0 -94
  153. package/ios-demo/README.md +0 -120
  154. package/settings.gradle.kts +0 -64
@@ -1,5 +1,13 @@
1
1
  import SwiftUI
2
2
 
3
+ /// Body searches keep 36 / 24; the header search matches the 32pt header buttons.
4
+ enum InputSearchSize {
5
+ case `default`, header
6
+
7
+ var height: CGFloat { self == .header ? HeaderLayoutMetrics.searchHeight : 36 }
8
+ var iconSize: CGFloat { self == .header ? HeaderLayoutMetrics.iconSize : 24 }
9
+ }
10
+
3
11
  // MARK: - RenderRightIconSearch
4
12
 
5
13
  struct RenderRightIconSearch: View {
@@ -7,6 +15,7 @@ struct RenderRightIconSearch: View {
7
15
  let loading: Bool
8
16
  let icon: String
9
17
  let color: Color
18
+ var size: InputSearchSize = .default
10
19
  let onClick: () -> Void
11
20
 
12
21
  var body: some View {
@@ -17,13 +26,13 @@ struct RenderRightIconSearch: View {
17
26
  .padding(.horizontal, Spacing.S)
18
27
  }
19
28
  if !icon.isEmpty {
20
- // Compose: a 1pt rule inset S from the top and bottom of the 36pt bar.
29
+ // Compose: a 1pt rule inset S from the top and bottom of the bar.
21
30
  Rectangle()
22
31
  .fill(theme.colors.primary)
23
- .frame(width: 1, height: 36 - Spacing.S * 2)
32
+ .frame(width: 1, height: size.height - Spacing.S * 2)
24
33
  .padding(.leading, Spacing.S)
25
34
 
26
- Icon(source: icon, size: 24, color: color)
35
+ Icon(source: icon, size: size.iconSize, color: color)
27
36
  .padding(.leading, Spacing.S)
28
37
  .onTapGesture(perform: onClick)
29
38
  }
@@ -137,6 +146,7 @@ public struct InputSearch: View {
137
146
  var clearCondition: (() -> Bool)? = nil
138
147
  var onClearPress: () -> Void = {}
139
148
  var onSubmit: () -> Void = {}
149
+ var size: InputSearchSize = .default
140
150
 
141
151
  @State private var isFocused = false
142
152
  @State private var isBlurred = false
@@ -226,7 +236,7 @@ public struct InputSearch: View {
226
236
  if let searchIcon = searchIcon {
227
237
  searchIcon()
228
238
  } else {
229
- Icon(source: "navigation_search", size: 24, color: theme.colors.text.hint)
239
+ Icon(source: "navigation_search", size: size.iconSize, color: theme.colors.text.hint)
230
240
  .padding(.trailing, Spacing.XS)
231
241
  }
232
242
 
@@ -275,11 +285,11 @@ public struct InputSearch: View {
275
285
  .padding(.leading, Spacing.XS)
276
286
  }
277
287
 
278
- RenderRightIconSearch(loading: loading, icon: icon, color: iconColor, onClick: onRightIconPressed)
288
+ RenderRightIconSearch(loading: loading, icon: icon, color: iconColor, size: size, onClick: onRightIconPressed)
279
289
  }
280
290
  .padding(.horizontal, Spacing.M)
281
291
  .frame(maxWidth: .infinity, alignment: .leading)
282
- .frame(height: 36)
292
+ .frame(height: size.height)
283
293
  .background(
284
294
  RoundedRectangle(cornerRadius: Radius.XL)
285
295
  .fill(backgroundColor ?? theme.colors.background.surface)
@@ -298,6 +308,13 @@ public struct InputSearch: View {
298
308
  }
299
309
  }
300
310
 
311
+ /// The header search: 32pt tall with a 20pt icon, level with the header buttons.
312
+ func headerSize() -> InputSearch {
313
+ var copy = self
314
+ copy.size = .header
315
+ return copy
316
+ }
317
+
301
318
  // MARK: - Helper Functions
302
319
 
303
320
  func getBorderColor(isFocused: Bool, error: String, disabled: Bool) -> Color {
@@ -0,0 +1,60 @@
1
+ // Top navigation spec (Figma "Top Navigation · Màn hình gập"). Mirrors Compose `layout/HeaderLayout.kt`
2
+ // and RN; keep the three in sync.
3
+
4
+ import SwiftUI
5
+
6
+ /// Header spec values, in points. Public so custom header rights and extensions can match them.
7
+ public enum HeaderLayoutMetrics {
8
+ public static let buttonSize: CGFloat = 32
9
+ public static let iconSize: CGFloat = 20
10
+ public static let pillWidth: CGFloat = 72
11
+ public static let searchHeight: CGFloat = 32
12
+ public static let titleGap: CGFloat = Spacing.S
13
+ public static let sidePadding: CGFloat = Spacing.M
14
+ /// shortcut + gap + help/home pill
15
+ public static let clusterWidth: CGFloat = buttonSize + titleGap + pillWidth
16
+ public static let frameMaxWidth: CGFloat = 600
17
+ /// Banner image width on every device: wide windows keep the phone size, centered.
18
+ public static let bannerWidth: CGFloat = 375
19
+ }
20
+
21
+ /// How a screen lays out its content on wide windows; the header row follows it.
22
+ public enum ContentLayout: Equatable {
23
+ /// 12 column grid: the header keeps the 12pt side padding.
24
+ case grid
25
+ /// One column of at most `HeaderLayoutMetrics.frameMaxWidth`, centered: the header row sits in the same frame.
26
+ case stretch
27
+ }
28
+
29
+ /// Header geometry for a window; see `ScreenLayout.headerLayout(_:)`.
30
+ public struct HeaderLayout: Equatable {
31
+ /// Short side >= 600, iPhone Duo excluded (it has its own layout).
32
+ public let isWide: Bool
33
+ /// Padding from each side of the safe area to the header row (back, title / search, right cluster).
34
+ public let frameInset: CGFloat
35
+ /// Width of the header row, so tabs and other header extensions can line up with it.
36
+ public let frameWidth: CGFloat
37
+ }
38
+
39
+ public extension ScreenLayout {
40
+ func headerLayout(_ contentLayout: ContentLayout = .grid) -> HeaderLayout {
41
+ let isWide = !isIPhoneDuo && !isDuoDevice && min(width, height) >= ModalMetrics.foldableMinWidth
42
+ let safeWidth = width - insets.leading - insets.trailing
43
+ let frameInset = isWide && contentLayout == .stretch
44
+ ? max(HeaderLayoutMetrics.sidePadding, (safeWidth - HeaderLayoutMetrics.frameMaxWidth) / 2)
45
+ : HeaderLayoutMetrics.sidePadding
46
+ return HeaderLayout(isWide: isWide, frameInset: frameInset, frameWidth: safeWidth - frameInset * 2)
47
+ }
48
+ }
49
+
50
+ private struct ContentLayoutKey: EnvironmentKey {
51
+ static let defaultValue: ContentLayout = .grid
52
+ }
53
+
54
+ public extension EnvironmentValues {
55
+ /// The enclosing screen's `NavigationOptions.contentLayout`, set by `StackScreen`.
56
+ var contentLayout: ContentLayout {
57
+ get { self[ContentLayoutKey.self] }
58
+ set { self[ContentLayoutKey.self] = newValue }
59
+ }
60
+ }
@@ -166,19 +166,10 @@ struct HorizontalTabBar: View {
166
166
 
167
167
  if let cta {
168
168
  CenterAction(data: cta)
169
- .offset(y: centerActionTop)
170
169
  }
171
170
  }
172
171
  .frame(width: width)
173
172
  }
174
-
175
- /// Offset of the center action column from the bar top: the items sit at the top of the container
176
- /// (which starts ctaLift down), so the column is placed for its label to start on the tab labels' line.
177
- private var centerActionTop: CGFloat {
178
- let itemLabelTop = TabBarMetrics.ctaLift + TabBarMetrics.paddingVertical
179
- + TabBarMetrics.indicatorHeight + TabBarMetrics.itemIconLabelGap
180
- return itemLabelTop - TabBarMetrics.ctaLabelGap - TabBarMetrics.ctaSize
181
- }
182
173
  }
183
174
 
184
175
  /// One active indicator per bar: Background/tonal with its inner light (white 12% from below) and
@@ -6,10 +6,11 @@ import SwiftUI
6
6
  /// Header bar height, mirrors Compose's `HEADER_HEIGHT`.
7
7
  public let HEADER_HEIGHT: CGFloat = 52
8
8
 
9
- /// Room the back button and toolkit take from the bar (Compose `HEADER_ACTIONS_WIDTH`).
10
- let headerActionsWidth: CGFloat = 172
11
- // Extra width the 48pt back and toolkit take on the iPhone Duo status bar row.
12
- private let statusBarRowActionsExtra: CGFloat = 55
9
+ /// Room the back button, the gaps around the title and the right cluster take from the header row
10
+ /// (Compose `HEADER_ACTIONS_WIDTH`).
11
+ let headerActionsWidth: CGFloat = HeaderLayoutMetrics.buttonSize + HeaderLayoutMetrics.titleGap * 2 + HeaderLayoutMetrics.clusterWidth
12
+ // Side padding, 48pt back and toolkit on the iPhone Duo status bar row.
13
+ private let statusBarRowActionsWidth: CGFloat = 227
13
14
 
14
15
  public enum TitlePosition {
15
16
  case left, center
@@ -24,15 +25,19 @@ public struct AnimatedHeader {
24
25
  public var aspectRatio: AnimatedHeaderRatio = .ratio16_9
25
26
  public var isSurface: Bool = true
26
27
  public var composable: (_ scrollState: CGFloat) -> AnyView = { _ in AnyView(EmptyView()) }
28
+ /// Wide windows: fills the sides of the phone-sized banner, fading out downward.
29
+ public var bannerBackgroundColor: Color?
27
30
 
28
31
  public init(
29
32
  aspectRatio: AnimatedHeaderRatio = .ratio16_9,
30
33
  isSurface: Bool = true,
31
- composable: @escaping (_ scrollState: CGFloat) -> AnyView = { _ in AnyView(EmptyView()) }
34
+ composable: @escaping (_ scrollState: CGFloat) -> AnyView = { _ in AnyView(EmptyView()) },
35
+ bannerBackgroundColor: Color? = nil
32
36
  ) {
33
37
  self.aspectRatio = aspectRatio
34
38
  self.isSurface = isSurface
35
39
  self.composable = composable
40
+ self.bannerBackgroundColor = bannerBackgroundColor
36
41
  }
37
42
  }
38
43
 
@@ -286,10 +291,11 @@ func headerSearchProps(
286
291
  }
287
292
 
288
293
  /// Max title width: back button and toolkit share the bar unless the iPhone Duo side bar holds them.
289
- func headerTitleMaxWidth(_ layout: ScreenLayout) -> CGFloat {
294
+ func headerTitleMaxWidth(_ layout: ScreenLayout, _ contentLayout: ContentLayout) -> CGFloat {
290
295
  let clearance = layout.statusBarClearance.map { $0.left + $0.right } ?? 0
291
296
  if layout.sideBar != nil { return layout.contentWidth - Spacing.M * 2 - clearance }
292
- return layout.width - headerActionsWidth - (layout.statusBarClearance != nil ? statusBarRowActionsExtra : 0) - clearance
297
+ if layout.statusBarClearance != nil { return layout.width - statusBarRowActionsWidth - clearance }
298
+ return layout.headerLayout(contentLayout).frameWidth - headerActionsWidth
293
299
  }
294
300
 
295
301
  // MARK: - Header
@@ -339,10 +345,13 @@ public struct NavigationHeader: View {
339
345
  }
340
346
 
341
347
  @Environment(\.screenLayout) private var layout
348
+ @Environment(\.contentLayout) private var contentLayout
342
349
  @Environment(\.appTheme) private var theme
343
350
  @OptionalEnvironmentObject private var navigator: Navigator?
344
351
  @State private var headerRightWidth: CGFloat = 0
345
352
 
353
+ private var headerLayout: HeaderLayout { layout.headerLayout(contentLayout) }
354
+
346
355
  /// iPhone Duo side bar holds back and the toolkit; a custom header right stays in the bar.
347
356
  private var useSideBar: Bool { layout.sideBar != nil }
348
357
 
@@ -352,7 +361,7 @@ public struct NavigationHeader: View {
352
361
  /// Max centered title width; on the status bar row the clusters are lopsided, so both sides
353
362
  /// keep the wider one's room.
354
363
  private var centerTitleMaxWidth: CGFloat {
355
- guard let clearance = layout.statusBarClearance else { return (layout.contentWidth - Spacing.M * 2) / 2 }
364
+ guard let clearance = layout.statusBarClearance else { return headerLayout.frameWidth / 2 }
356
365
  let back = goBack == nil || useSideBar ? 0 : DuoMetrics.controlSize + Spacing.S
357
366
  let inset = max(clearance.left + back, clearance.right + headerRightWidth) + Spacing.S
358
367
  return max(layout.contentWidth - (Spacing.M + inset) * 2, 0)
@@ -388,7 +397,7 @@ public struct NavigationHeader: View {
388
397
  } else {
389
398
  BackButton(color: headerColor, onBack: goBack)
390
399
  }
391
- Spacer().frame(width: Spacing.S)
400
+ Spacer().frame(width: HeaderLayoutMetrics.titleGap)
392
401
  }
393
402
 
394
403
  if centerTitle {
@@ -418,14 +427,14 @@ public struct NavigationHeader: View {
418
427
  )
419
428
  }
420
429
  }
421
- .padding(.leading, Spacing.M + (layout.statusBarClearance?.left ?? 0))
422
- .padding(.trailing, Spacing.M + (layout.statusBarClearance?.right ?? 0))
430
+ .padding(.leading, headerLayout.frameInset + (layout.statusBarClearance?.left ?? 0))
431
+ .padding(.trailing, headerLayout.frameInset + (layout.statusBarClearance?.right ?? 0))
423
432
 
424
433
  if centerTitle {
425
434
  titleArea(centered: true)
426
435
  // Compose caps a centered title at half the bar
427
436
  .frame(maxWidth: centerTitleMaxWidth)
428
- .padding(.horizontal, Spacing.M)
437
+ .padding(.horizontal, headerLayout.frameInset)
429
438
  }
430
439
  }
431
440
  .onPreferenceChange(HeaderRightWidthKey.self) { headerRightWidth = $0 }
@@ -448,6 +457,7 @@ public struct NavigationHeader: View {
448
457
  theme: theme,
449
458
  pop: navigator.map { navigator in { navigator.pop() } }
450
459
  ))
460
+ .headerSize()
451
461
  } else {
452
462
  switch headerTitle {
453
463
  case let .user(data)?:
@@ -501,7 +511,7 @@ struct HeaderBarBackground: View {
501
511
 
502
512
  // MARK: - Back button
503
513
 
504
- /// Mirrors Compose's `BackButton`: a 28pt circle with the back arrow.
514
+ /// Mirrors Compose's `BackButton`: a 32pt circle with the back arrow.
505
515
  private struct BackButton: View {
506
516
  let color: HeaderColor
507
517
  let onBack: () -> Void
@@ -511,8 +521,8 @@ private struct BackButton: View {
511
521
  Circle()
512
522
  .fill(color.backgroundButton)
513
523
  .overlay(Circle().stroke(color.borderColor, lineWidth: 0.2))
514
- .frame(width: 28, height: 28)
515
- .overlay(Icon(source: "arrow-back", size: 20, color: color.tintIconColor))
524
+ .frame(width: HeaderLayoutMetrics.buttonSize, height: HeaderLayoutMetrics.buttonSize)
525
+ .overlay(Icon(source: "arrow-back", size: HeaderLayoutMetrics.iconSize, color: color.tintIconColor))
516
526
  }
517
527
  .buttonStyle(ActiveOpacityButtonStyle())
518
528
  .accessibilityIdentifier("btn_navigation_back")
@@ -13,6 +13,7 @@ public struct HeaderJourneyView: View {
13
13
  }
14
14
 
15
15
  @Environment(\.screenLayout) private var layout
16
+ @Environment(\.contentLayout) private var contentLayout
16
17
 
17
18
  public var body: some View {
18
19
  if data.isLoading {
@@ -45,7 +46,7 @@ public struct HeaderJourneyView: View {
45
46
  MomoText(description, typography: .descriptionXsRegular, color: tint, maxLines: 1)
46
47
  }
47
48
  }
48
- .frame(maxWidth: headerTitleMaxWidth(layout), alignment: .leading)
49
+ .frame(maxWidth: headerTitleMaxWidth(layout, contentLayout), alignment: .leading)
49
50
  }
50
51
  .buttonStyle(ActiveOpacityButtonStyle())
51
52
  .disabled(data.onPress == nil)
@@ -13,6 +13,7 @@ public struct HeaderLocationView: View {
13
13
  }
14
14
 
15
15
  @Environment(\.screenLayout) private var layout
16
+ @Environment(\.contentLayout) private var contentLayout
16
17
 
17
18
  public var body: some View {
18
19
  if data.isLoading {
@@ -34,7 +35,7 @@ public struct HeaderLocationView: View {
34
35
  Icon(source: "16_arrow_chevron_down_small", size: 16, color: tint)
35
36
  }
36
37
  }
37
- .frame(maxWidth: headerTitleMaxWidth(layout), alignment: .leading)
38
+ .frame(maxWidth: headerTitleMaxWidth(layout, contentLayout), alignment: .leading)
38
39
  }
39
40
  .buttonStyle(ActiveOpacityButtonStyle())
40
41
  .disabled(data.onPress == nil)
@@ -354,25 +354,30 @@ struct Toolkit: View {
354
354
  }
355
355
  toolButton(icon: headerRight.closeIcon, accessibilityId: "btn_navigation_close", action: onPressClose)
356
356
  }
357
- .frame(width: usesHelpCenter(context) ? 65 : 28, height: 28)
357
+ .frame(
358
+ width: usesHelpCenter(context) ? HeaderLayoutMetrics.pillWidth : HeaderLayoutMetrics.buttonSize,
359
+ height: HeaderLayoutMetrics.buttonSize
360
+ )
358
361
  .background(headerColor.backgroundButton)
359
- .cornerRadius(14)
360
- .overlay(RoundedRectangle(cornerRadius: 14).stroke(headerColor.borderColor, lineWidth: 0.2))
362
+ .clipShape(Capsule())
363
+ .overlay(Capsule().stroke(headerColor.borderColor, lineWidth: 0.2))
361
364
  .padding(.leading, Spacing.S)
362
365
  }
363
366
  }
364
367
 
368
+ /// One half of the help / home pill; each half takes an equal share of the pill width.
365
369
  private func toolButton(icon: String, accessibilityId: String, action: @escaping () -> Void) -> some View {
366
370
  SwiftUI.Button(action: action) {
367
- Icon(source: icon, size: 20, color: headerColor.tintIconColor)
368
- .padding(4)
371
+ Icon(source: icon, size: HeaderLayoutMetrics.iconSize, color: headerColor.tintIconColor)
372
+ .frame(maxWidth: .infinity, maxHeight: .infinity)
373
+ .contentShape(Rectangle())
369
374
  }
370
375
  .buttonStyle(ActiveOpacityButtonStyle())
371
376
  .accessibilityIdentifier(accessibilityId)
372
377
  }
373
378
  }
374
379
 
375
- /// Mirrors Compose's `NavigationButton`: the 28pt circular shortcut / more button.
380
+ /// Mirrors Compose's `NavigationButton`: the 32pt circular shortcut / more button.
376
381
  public struct NavigationButton: View {
377
382
  var disabled: Bool
378
383
  var icon: String
@@ -405,9 +410,9 @@ public struct NavigationButton: View {
405
410
  Circle()
406
411
  .fill(colors.backgroundButton)
407
412
  .overlay(Circle().stroke(colors.borderColor, lineWidth: 0.2))
408
- Icon(source: icon, size: 20, color: colors.tintIconColor)
413
+ Icon(source: icon, size: HeaderLayoutMetrics.iconSize, color: colors.tintIconColor)
409
414
  }
410
- .frame(width: 28, height: 28)
415
+ .frame(width: HeaderLayoutMetrics.buttonSize, height: HeaderLayoutMetrics.buttonSize)
411
416
  .overlay(alignment: .topTrailing) {
412
417
  if showBadge {
413
418
  BadgeDot(size: .small).offset(x: -Spacing.XXS, y: -Spacing.XXS)
@@ -13,6 +13,7 @@ public struct HeaderUserView: View {
13
13
  private let avatarSize: CGFloat = Spacing.XXL // 32
14
14
 
15
15
  @Environment(\.screenLayout) private var layout
16
+ @Environment(\.contentLayout) private var contentLayout
16
17
 
17
18
  public var body: some View {
18
19
  if data.isLoading {
@@ -67,7 +68,7 @@ public struct HeaderUserView: View {
67
68
  }
68
69
  }
69
70
  }
70
- .frame(maxWidth: headerTitleMaxWidth(layout), alignment: .leading)
71
+ .frame(maxWidth: headerTitleMaxWidth(layout, contentLayout), alignment: .leading)
71
72
 
72
73
  Spacer(minLength: 0)
73
74
  }
@@ -14,9 +14,6 @@ public final class Navigation: ObservableObject {
14
14
  private weak var registry: DynamicScreenRegistry?
15
15
  /// What the footer (or navigation bar) takes from the window bottom; lifts snack bars.
16
16
  var bottomObstruction: CGFloat = 0
17
- /// A tab that pads itself asks (via `floatingTabBarEdgeToEdge()`) to run edge to edge behind the floating
18
- /// bar and the home indicator; the kit then stops reserving that space. Compose's `bottomTabEdgeToEdge`.
19
- @Published var bottomTabEdgeToEdge = false
20
17
 
21
18
  init(
22
19
  id: Int = -1,
@@ -87,6 +84,8 @@ public struct NavigationOptions {
87
84
  public var inputSearchProps: InputSearchProps?
88
85
  public var fabProps: FabProps?
89
86
  public var onBackHandler: (() -> Void)?
87
+ /// Wide windows: `.stretch` puts the header row in the centered 600pt content frame.
88
+ public var contentLayout: ContentLayout
90
89
 
91
90
  public init(
92
91
  screenName: String? = nil,
@@ -115,7 +114,8 @@ public struct NavigationOptions {
115
114
  layoutOffset: CGFloat = 56,
116
115
  inputSearchProps: InputSearchProps? = nil,
117
116
  fabProps: FabProps? = nil,
118
- onBackHandler: (() -> Void)? = nil
117
+ onBackHandler: (() -> Void)? = nil,
118
+ contentLayout: ContentLayout = .grid
119
119
  ) {
120
120
  self.screenName = screenName
121
121
  self.title = title
@@ -144,6 +144,7 @@ public struct NavigationOptions {
144
144
  self.inputSearchProps = inputSearchProps
145
145
  self.fabProps = fabProps
146
146
  self.onBackHandler = onBackHandler
147
+ self.contentLayout = contentLayout
147
148
  }
148
149
  }
149
150
 
@@ -187,30 +188,9 @@ struct OptionsStackScreen: View {
187
188
  layoutOffset: options.layoutOffset,
188
189
  inputSearchProps: options.inputSearchProps,
189
190
  fabProps: options.fabProps,
191
+ contentLayout: options.contentLayout,
190
192
  screenName: screenName,
191
193
  content: content
192
194
  )
193
195
  }
194
196
  }
195
-
196
- // MARK: - Edge-to-edge tab content
197
-
198
- public extension View {
199
- /// Compose's `floatingTabBarContentPadding()`: the content of a `BottomTab` tab runs edge to edge behind
200
- /// the floating tab bar and the home indicator, and pads its own bottom (e.g. a full-screen native view
201
- /// with its own safe area). No effect outside a tab.
202
- func floatingTabBarEdgeToEdge() -> some View {
203
- modifier(FloatingTabBarEdgeToEdge())
204
- }
205
- }
206
-
207
- private struct FloatingTabBarEdgeToEdge: ViewModifier {
208
- @OptionalEnvironmentObject private var navigation: Navigation?
209
-
210
- func body(content: Content) -> some View {
211
- content.onAppear {
212
- guard let navigation, navigation.bottomTabIndex != -1, !navigation.bottomTabEdgeToEdge else { return }
213
- navigation.bottomTabEdgeToEdge = true
214
- }
215
- }
216
- }
@@ -34,6 +34,7 @@ public struct StackScreen<Content: View>: View {
34
34
  var layoutOffset: CGFloat
35
35
  var inputSearchProps: InputSearchProps?
36
36
  var fabProps: FabProps?
37
+ var contentLayout: ContentLayout = .grid
37
38
  var screenName: String = ""
38
39
  var content: () -> Content
39
40
 
@@ -65,6 +66,7 @@ public struct StackScreen<Content: View>: View {
65
66
  layoutOffset: CGFloat = 56,
66
67
  inputSearchProps: InputSearchProps? = nil,
67
68
  fabProps: FabProps? = nil,
69
+ contentLayout: ContentLayout = .grid,
68
70
  screenName: String = "",
69
71
  @ViewBuilder content: @escaping () -> Content
70
72
  ) {
@@ -95,6 +97,7 @@ public struct StackScreen<Content: View>: View {
95
97
  self.layoutOffset = layoutOffset
96
98
  self.inputSearchProps = inputSearchProps
97
99
  self.fabProps = fabProps
100
+ self.contentLayout = contentLayout
98
101
  self.screenName = screenName
99
102
  self.content = content
100
103
  }
@@ -161,16 +164,6 @@ public struct StackScreen<Content: View>: View {
161
164
  && inputSearchProps == nil && !headerTransparent && !fullScreenContent
162
165
  }
163
166
 
164
- /// Bottom room for the tab's content: clear of the floating bar, unless the tab runs edge to edge
165
- /// (`floatingTabBarEdgeToEdge()`), when it also covers the home indicator that BottomTab keeps clear of
166
- /// (a negative inset extends the content past the tab's frame).
167
- private var contentBottomInset: CGFloat {
168
- guard let navigation, navigation.bottomTabIndex != -1, navigation.bottomTabEdgeToEdge else {
169
- return duoTabBarInsets.overlay
170
- }
171
- return -layout.insets.bottom
172
- }
173
-
174
167
  /// iPhone Duo: the header leaves with the content and slides back in on a reverse scroll
175
168
  /// (RN DuoQuickReturnHeader). The side bar is drawn apart from the header, so it stays put.
176
169
  private var useQuickReturn: Bool {
@@ -307,6 +300,7 @@ public struct StackScreen<Content: View>: View {
307
300
  }
308
301
  }
309
302
  .ignoresSafeArea(.keyboard, edges: .bottom)
303
+ .environment(\.contentLayout, contentLayout)
310
304
  .onChange(of: scrollOffset) { updateHeaderHide($0) }
311
305
  .onAppear { reportEmptySideBar() }
312
306
  .onChange(of: showsSideBar) { _ in reportEmptySideBar() }
@@ -389,7 +383,7 @@ public struct StackScreen<Content: View>: View {
389
383
  scrollOffset: $scrollOffset,
390
384
  scrollToTopCallback: scrollToTopCallback,
391
385
  animatedSearchInset: animatedSearchInset,
392
- bottomInset: contentBottomInset,
386
+ bottomInset: duoTabBarInsets.overlay,
393
387
  snapDistance: searchSnapDistance,
394
388
  onScrollIdle: settleHeader,
395
389
  content: { animatedHeroBody(animatedHeader) }
@@ -422,7 +416,7 @@ public struct StackScreen<Content: View>: View {
422
416
  scrollOffset: $scrollOffset,
423
417
  scrollToTopCallback: scrollToTopCallback,
424
418
  animatedSearchInset: animatedSearchInset,
425
- bottomInset: contentBottomInset,
419
+ bottomInset: duoTabBarInsets.overlay,
426
420
  snapDistance: searchSnapDistance,
427
421
  onScrollIdle: settleHeader,
428
422
  content: { duoInsetContent }
@@ -443,7 +437,7 @@ public struct StackScreen<Content: View>: View {
443
437
  scrollOffset: $scrollOffset,
444
438
  scrollToTopCallback: scrollToTopCallback,
445
439
  topInset: layout.headerHeight - layout.insets.top,
446
- bottomInset: contentBottomInset,
440
+ bottomInset: duoTabBarInsets.overlay,
447
441
  snapDistance: searchSnapDistance,
448
442
  onScrollIdle: settleHeader,
449
443
  content: content
@@ -489,7 +483,7 @@ public struct StackScreen<Content: View>: View {
489
483
  scrollOffset: $scrollOffset,
490
484
  scrollToTopCallback: scrollToTopCallback,
491
485
  animatedSearchInset: animatedSearchInset,
492
- bottomInset: contentBottomInset,
486
+ bottomInset: duoTabBarInsets.overlay,
493
487
  snapDistance: searchSnapDistance,
494
488
  onScrollIdle: settleHeader,
495
489
  content: content
@@ -506,18 +500,28 @@ public struct StackScreen<Content: View>: View {
506
500
  }
507
501
 
508
502
  private func heroGlassStart(_ animatedHeader: AnimatedHeader) -> CGFloat {
509
- max(layout.width / animatedHeader.aspectRatio.value - layout.headerHeight, 0)
503
+ max(bannerWidth / animatedHeader.aspectRatio.value - layout.headerHeight, 0)
504
+ }
505
+
506
+ /// Wide windows keep the phone banner size, centered; phones fill the width.
507
+ private var bannerWidth: CGFloat {
508
+ layout.headerLayout(contentLayout).isWide ? HeaderLayoutMetrics.bannerWidth : layout.width
510
509
  }
511
510
 
512
511
  /// The banner fills the width at its aspect ratio; the body starts `layoutOffset` below the
513
- /// header band so it overlaps the banner's lower part.
512
+ /// header band so it overlaps the banner's lower part. On wide windows `bannerBackgroundColor`
513
+ /// fills the sides, fading out downward.
514
514
  @ViewBuilder
515
515
  private func animatedHeroBody(_ animatedHeader: AnimatedHeader) -> some View {
516
- let width = layout.width
516
+ let width = bannerWidth
517
517
  let imageHeight = width / animatedHeader.aspectRatio.value
518
518
  let contentTopInset = layout.headerHeight + layoutOffset
519
519
 
520
520
  ZStack(alignment: .top) {
521
+ if width < layout.width, let fill = animatedHeader.bannerBackgroundColor {
522
+ LinearGradient(colors: [fill, fill.opacity(0)], startPoint: .top, endPoint: .bottom)
523
+ .frame(width: layout.width, height: imageHeight)
524
+ }
521
525
  animatedHeader.composable(scrollOffset)
522
526
  .frame(width: width, height: imageHeight)
523
527
  .clipped()
@@ -571,8 +575,7 @@ private struct StackScreenContent<Content: View>: View {
571
575
  /// Room for a header the content scrolls under (iPhone Duo glass header).
572
576
  var topInset: CGFloat = 0
573
577
  /// Room for the floating tab bar that overlays the content: scrolling content runs under it and
574
- /// ends clear of it, static content stays above it. Negative for an edge-to-edge tab: the content
575
- /// reaches that far past its frame.
578
+ /// ends clear of it, static content stays above it.
576
579
  var bottomInset: CGFloat = 0
577
580
  /// Compose's animated-search snap: a scroll that comes to rest part way through this distance
578
581
  /// finishes the move, up or back down.
@@ -633,8 +636,6 @@ private struct StackScreenContent<Content: View>: View {
633
636
  }
634
637
  }
635
638
  .coordinateSpace(name: scrollSpace)
636
- // an edge-to-edge tab's scroll reaches past its frame, under the home indicator
637
- .padding(.bottom, min(bottomInset, 0))
638
639
  .modifier(ScrollRest(offset: scrollOffset, onRest: scrollDidRest))
639
640
  // Status-bar tap (MoMoStatusBarTap swizzle) scrolls to top and notifies the consumer.
640
641
  .onReceive(NotificationCenter.default.publisher(for: MoMoStatusBarTap.notificationName)) { _ in
@@ -735,6 +736,7 @@ private struct SearchAnimatedHeader: View {
735
736
  var hasToolkit: Bool = false
736
737
 
737
738
  @Environment(\.screenLayout) private var layout
739
+ @Environment(\.contentLayout) private var contentLayout
738
740
  @Environment(\.appTheme) private var theme
739
741
  @OptionalEnvironmentObject private var navigator: Navigator?
740
742
 
@@ -745,14 +747,15 @@ private struct SearchAnimatedHeader: View {
745
747
  let rowTop = layout.headerStatusBarHeight - layout.insets.top
746
748
  let minTop = rowTop + (layout.headerBarHeight - HEADER_HEIGHT) / 2
747
749
  let maxTop = layout.headerHeight - layout.insets.top
748
- let minSide = Spacing.M
750
+ // stretch screens on wide windows keep the search in the header's centered frame
751
+ let minSide = layout.headerLayout(contentLayout).frameInset
749
752
  // collapsed on the iPhone Duo status bar row, the search stays between its clusters (48pt back there)
750
753
  let clearance = layout.statusBarClearance
751
- let backWidth: CGFloat = clearance != nil && !useSideBar ? DuoMetrics.controlSize : 28
752
- let maxStart = (clearance?.left ?? 0) + (hiddenBack || useSideBar ? Spacing.M : backWidth + Spacing.M + Spacing.S)
754
+ let backWidth: CGFloat = clearance != nil && !useSideBar ? DuoMetrics.controlSize : HeaderLayoutMetrics.buttonSize
755
+ let maxStart = (clearance?.left ?? 0) + (hiddenBack || useSideBar ? minSide : backWidth + minSide + HeaderLayoutMetrics.titleGap)
753
756
  let maxEnd = (clearance?.right ?? 0) + (useSideBar && hasToolkit
754
- ? Spacing.M
755
- : headerRightWidth + (hasHeaderRight ? Spacing.M * 2 : Spacing.M))
757
+ ? minSide
758
+ : headerRightWidth + (hasHeaderRight ? minSide + Spacing.M : minSide))
756
759
 
757
760
  // one progress for all three, so the field docks with its final insets and never covers the toolkit
758
761
  let progress = min(scroll / HEADER_HEIGHT, 1)
@@ -768,6 +771,7 @@ private struct SearchAnimatedHeader: View {
768
771
  theme: theme,
769
772
  pop: navigator.map { navigator in { navigator.pop() } }
770
773
  ))
774
+ .headerSize()
771
775
  .frame(height: HEADER_HEIGHT)
772
776
  .padding(.leading, start)
773
777
  .padding(.trailing, end)
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'MoMoUIKits'
3
- s.version = '0.169.8-beta.3'
3
+ s.version = '0.169.8-beta.4'
4
4
  s.summary = 'MoMoUIKits for iOS'
5
5
  s.homepage = 'https://momo.vn'
6
6
  s.license = { :type => 'MIT' }
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'MoMoUIKitsDemo'
3
- s.version = '0.169.8-beta.3'
3
+ s.version = '0.169.8-beta.4'
4
4
  s.summary = 'Demo browser for MoMoUIKits SwiftUI components'
5
5
  s.homepage = 'https://momo.vn'
6
6
  s.license = { :type => 'MIT' }