@momo-kits/native-kits 0.168.1-beta.25-debug → 0.168.1-beta.26-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.
@@ -16,7 +16,6 @@ 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)?
20
19
 
21
20
  @EnvironmentObject private var navigator: Navigator
22
21
  /// The screen hosting the tabs (Compose's `LocalNavigation` in BottomTab).
@@ -35,22 +34,19 @@ public struct BottomTab: View {
35
34
  /// starts compressed; tapping the compressed one swaps them.
36
35
  /// `onTabPress` gets every tab press with the switch to perform, e.g. after a login gate.
37
36
  /// `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.
39
37
  public init(
40
38
  items: [BottomTabItem],
41
39
  floatingButton: BottomTabFloatingButton? = nil,
42
40
  compressionBehavior: DuoBarCompressionBehavior = .toolbar,
43
41
  initialRouteName: String? = nil,
44
42
  onTabPress: ((_ index: Int, _ switchTab: @escaping () -> Void) -> Void)? = nil,
45
- backToInitialTab: Bool = true,
46
- onTabLongPress: ((_ index: Int) -> Void)? = nil
43
+ backToInitialTab: Bool = true
47
44
  ) {
48
45
  self.items = items
49
46
  self.floatingButton = floatingButton
50
47
  self.compressionBehavior = compressionBehavior
51
48
  self.onTabPress = onTabPress
52
49
  self.backToInitialTab = backToInitialTab
53
- self.onTabLongPress = onTabLongPress
54
50
  let start = items.firstIndex { $0.name == initialRouteName } ?? 0
55
51
  _startIndex = State(initialValue: start)
56
52
  _selectedIndex = State(initialValue: start)
@@ -105,15 +101,7 @@ public struct BottomTab: View {
105
101
  floatingButton: floatingButton,
106
102
  selectedIndex: selectedIndex,
107
103
  onTabSelected: selectTab,
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
+ compression: compression
117
105
  )
118
106
  } else {
119
107
  // Tab bar + home-indicator filler.
@@ -122,8 +110,7 @@ public struct BottomTab: View {
122
110
  items: items,
123
111
  floatingButton: floatingButton,
124
112
  selectedIndex: selectedIndex,
125
- onTabSelected: selectTab,
126
- onTabLongPress: onTabLongPress
113
+ onTabSelected: selectTab
127
114
  )
128
115
  theme.colors.background.surface
129
116
  .frame(height: bottomInset + Spacing.S)
@@ -67,7 +67,6 @@ struct BottomTabBar: View {
67
67
  let floatingButton: BottomTabFloatingButton?
68
68
  let selectedIndex: Int
69
69
  let onTabSelected: (Int) -> Void
70
- var onTabLongPress: ((Int) -> Void)?
71
70
 
72
71
  @Environment(\.screenLayout) private var layout
73
72
  @Environment(\.appTheme) private var theme
@@ -134,10 +133,7 @@ struct BottomTabBar: View {
134
133
  TabBarItem(
135
134
  item: items[index],
136
135
  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) } }
136
+ onClick: { onTabSelected(index) }
141
137
  )
142
138
  .frame(maxWidth: .infinity)
143
139
  }
@@ -149,9 +145,7 @@ struct BottomTabBar: View {
149
145
  private struct TabBarItem: View {
150
146
  let item: BottomTabItem
151
147
  let selected: Bool
152
- let badgeMaxWidth: CGFloat
153
148
  let onClick: () -> Void
154
- let onLongClick: (() -> Void)?
155
149
 
156
150
  @Environment(\.appTheme) private var theme
157
151
 
@@ -165,52 +159,40 @@ private struct TabBarItem: View {
165
159
  }
166
160
 
167
161
  var body: some View {
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
- }
177
- }
178
- .overlay(alignment: .topTrailing) {
179
- if badgeLabel?.isEmpty == true || (badgeLabel == nil && item.showDot) {
180
- BadgeDot(size: .small).offset(x: 4, y: -4)
181
- }
162
+ ZStack(alignment: .topTrailing) {
163
+ VStack(spacing: 0) {
164
+ Icon(source: item.icon, size: 28, color: tintColor)
165
+ .padding(Spacing.XS)
166
+ MomoText(
167
+ item.label,
168
+ typography: selected ? .labelXsMedium : .descriptionXsRegular,
169
+ color: tintColor,
170
+ textAlign: .center,
171
+ maxLines: 1
172
+ )
173
+ .truncationMode(.tail)
174
+ }
175
+ .frame(maxWidth: .infinity, maxHeight: .infinity)
176
+ .padding(.horizontal, Spacing.S)
177
+ .padding(.vertical, Spacing.S)
178
+
179
+ if let badgeLabel {
180
+ if badgeLabel.isEmpty {
181
+ BadgeDot(size: .small)
182
+ .offset(x: -Spacing.S, y: Spacing.XS)
183
+ } else {
184
+ Badge(label: badgeLabel)
185
+ .offset(x: -Spacing.XS, y: 0)
182
186
  }
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)
187
+ } else if item.showDot {
188
+ BadgeDot(size: .small)
189
+ .offset(x: -Spacing.S, y: Spacing.XS)
190
+ }
192
191
  }
193
192
  .frame(maxWidth: .infinity, maxHeight: .infinity)
194
- .padding(.horizontal, Spacing.S)
195
- .padding(.vertical, Spacing.S)
196
- .frame(maxWidth: .infinity, maxHeight: .infinity)
197
193
  .padding(.horizontal, Spacing.XXS)
198
194
  .contentShape(Rectangle())
199
195
  .onTapGesture { onClick() }
200
- .modifier(TabLongPress(action: onLongClick))
201
- }
202
- }
203
-
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)?
207
-
208
- func body(content: Content) -> some View {
209
- if let action {
210
- content.onLongPressGesture(minimumDuration: 0.5, perform: action)
211
- } else {
212
- content
213
- }
214
196
  }
215
197
  }
216
198
 
@@ -20,11 +20,12 @@ private let floatingHeight = DuoMetrics.floatingTabBarHeight
20
20
  private let floatingPadding = Spacing.XS
21
21
  // the system bar sizes its pill to the tabs instead of stretching it across the display
22
22
  private let floatingItemWidth: CGFloat = 80
23
- // the rail's badge stays inside the capsule: its end sits XXS off the cell's end edge
24
- private let railBadgeMaxWidth = itemSize - Spacing.XXS * 2
25
- private let railBadgeEndOffset = (itemSize - iconSize) / 2 - Spacing.XXS
23
+ // while pressed the selection bubble grows into a lens past the pill's edges
24
+ private let lensScaleX: CGFloat = 1.2
25
+ private let lensScaleY: CGFloat = 1.3
26
26
  // Figma Home-2026 tab bar "Selection": brand pink at 8%
27
27
  private let selectionTintOpacity: Double = 0x14 / 255
28
+ private let tabSpring = Animation.interpolatingSpring(mass: 0.8, stiffness: 220, damping: 18)
28
29
 
29
30
  /// Room tab screens leave for the Duo tab bar, provided by BottomTab to its tab StackScreens.
30
31
  struct DuoTabBarInsets: Equatable {
@@ -90,20 +91,16 @@ struct DuoTabBar: View {
90
91
  let selectedIndex: Int
91
92
  let onTabSelected: (Int) -> Void
92
93
  var compression = DuoBarCompression()
93
- var onTabLongPress: ((Int) -> Void)?
94
- /// A tick per tab the lens enters while dragged.
95
- var onTick: () -> Void = {}
96
94
 
97
95
  @Environment(\.screenLayout) private var layout
98
96
 
99
97
  var body: some View {
100
98
  if let sideBar = layout.sideBar {
101
99
  DuoRailTabBar(sideBar: sideBar, items: items, floatingButton: floatingButton,
102
- selectedIndex: selectedIndex, onTabSelected: onTabSelected, compression: compression,
103
- onTabLongPress: onTabLongPress, onTick: onTick)
100
+ selectedIndex: selectedIndex, onTabSelected: onTabSelected, compression: compression)
104
101
  } else {
105
- DuoFloatingTabBar(items: items, floatingButton: floatingButton, selectedIndex: selectedIndex,
106
- onTabSelected: onTabSelected, onTabLongPress: onTabLongPress, onTick: onTick)
102
+ DuoFloatingTabBar(items: items, floatingButton: floatingButton,
103
+ selectedIndex: selectedIndex, onTabSelected: onTabSelected)
107
104
  }
108
105
  }
109
106
  }
@@ -118,11 +115,8 @@ private struct DuoRailTabBar: View {
118
115
  let selectedIndex: Int
119
116
  let onTabSelected: (Int) -> Void
120
117
  let compression: DuoBarCompression
121
- let onTabLongPress: ((Int) -> Void)?
122
- let onTick: () -> Void
123
118
 
124
- @Environment(\.accessibilityReduceMotion) private var reduceMotion
125
- @StateObject private var selection = DuoLiquidSelection()
119
+ @State private var pressedIndex: Int?
126
120
 
127
121
  private var isRight: Bool { sideBar.edge == .right }
128
122
 
@@ -130,11 +124,11 @@ private struct DuoRailTabBar: View {
130
124
  VStack(spacing: Spacing.M) {
131
125
  if compression.tabBarCompressed, items.indices.contains(selectedIndex) {
132
126
  SwiftUI.Button(action: compression.expandTabBar) {
133
- DuoTabIcon(item: items[selectedIndex], selected: true, badgeMaxWidth: railBadgeMaxWidth, inRail: true)
127
+ DuoTabIcon(item: items[selectedIndex], selected: true)
134
128
  .frame(width: itemSize, height: itemSize)
135
129
  .contentShape(Circle())
136
130
  }
137
- .buttonStyle(DuoPressLiftStyle())
131
+ .buttonStyle(.plain)
138
132
  .modifier(DuoBarMaterial(shape: Circle()))
139
133
  .accessibilityLabel(items[selectedIndex].label)
140
134
  .accessibilityIdentifier("bottom_tab_bar")
@@ -153,51 +147,35 @@ private struct DuoRailTabBar: View {
153
147
  .ignoresSafeArea()
154
148
  }
155
149
 
156
- private func select(_ index: Int) {
157
- onTabSelected(index)
158
- compression.onTabSelected()
159
- }
160
-
161
- /// Column of icon-only tab items with the sliding selection lens.
150
+ /// Column of icon-only tab items with the sliding selection bubble.
162
151
  private var rail: some View {
163
- let selection = configured()
164
- let lens = selection.lensScale
165
- return ZStack(alignment: .top) {
166
- DuoSelectionMaterial()
152
+ ZStack(alignment: .top) {
153
+ DuoSelectionMaterial(lens: pressedIndex != nil)
167
154
  .frame(width: railBubbleWidth, height: railBubbleHeight)
168
- .scaleEffect(x: lens.x * lens.across, y: lens.y * lens.along)
169
- .offset(y: railPadding - (railBubbleHeight - itemSize) / 2 + selection.offset)
155
+ .offset(y: railPadding - (railBubbleHeight - itemSize) / 2
156
+ + CGFloat(pressedIndex ?? selectedIndex) * (itemSize + railGap))
157
+ .animation(tabSpring, value: selectedIndex)
158
+ .animation(tabSpring, value: pressedIndex)
170
159
 
171
160
  VStack(spacing: railGap) {
172
161
  ForEach(items.indices, id: \.self) { index in
173
- DuoLiquidTab(selection: selection, index: index, label: items[index].label,
174
- selected: index == selectedIndex, onSelect: { select(index) }) { active in
175
- DuoTabIcon(item: items[index], selected: active, badgeMaxWidth: railBadgeMaxWidth, inRail: true)
162
+ SwiftUI.Button {
163
+ onTabSelected(index)
164
+ compression.onTabSelected()
165
+ } label: {
166
+ DuoTabIcon(item: items[index], selected: index == selectedIndex)
176
167
  .frame(width: itemSize, height: itemSize)
168
+ .contentShape(Rectangle())
177
169
  }
170
+ .buttonStyle(DuoLensPressStyle(index: index, pressedIndex: $pressedIndex))
171
+ .accessibilityLabel(items[index].label)
178
172
  }
179
173
  }
180
174
  .padding(.vertical, railPadding)
181
175
  }
182
176
  .frame(width: itemSize)
183
- .modifier(DuoLiquidInput(selection: selection, space: "DuoRail"))
184
177
  .modifier(DuoBarMaterial(shape: Capsule()))
185
- .scaleEffect(selection.barScale)
186
178
  .accessibilityIdentifier("bottom_tab_bar")
187
- .onAppear { selection.sync(index: selectedIndex) }
188
- .onChange(of: selectedIndex) { selection.sync(index: $0) }
189
- }
190
-
191
- private func configured() -> DuoLiquidSelection {
192
- selection.axis = .y
193
- selection.count = items.count
194
- selection.pitch = itemSize + railGap
195
- selection.firstCenter = railPadding + itemSize / 2
196
- selection.reduceMotion = reduceMotion
197
- selection.onSelect = select
198
- selection.onLongPress = onTabLongPress
199
- selection.onTick = onTick
200
- return selection
201
179
  }
202
180
  }
203
181
 
@@ -207,13 +185,10 @@ private struct DuoFloatingTabBar: View {
207
185
  let floatingButton: BottomTabFloatingButton?
208
186
  let selectedIndex: Int
209
187
  let onTabSelected: (Int) -> Void
210
- let onTabLongPress: ((Int) -> Void)?
211
- let onTick: () -> Void
212
188
 
213
189
  @Environment(\.screenLayout) private var layout
214
190
  @Environment(\.appTheme) private var theme
215
- @Environment(\.accessibilityReduceMotion) private var reduceMotion
216
- @StateObject private var selection = DuoLiquidSelection()
191
+ @State private var pressedIndex: Int?
217
192
 
218
193
  private var barWidth: CGFloat {
219
194
  let margins = layout.insets.leading + layout.insets.trailing + 2 * DuoMetrics.floatingTabBarMargin
@@ -238,139 +213,82 @@ private struct DuoFloatingTabBar: View {
238
213
  }
239
214
 
240
215
  private var bar: some View {
241
- let selection = configured()
242
- let lens = selection.lensScale
243
- return ZStack(alignment: .leading) {
244
- DuoSelectionMaterial()
216
+ ZStack(alignment: .leading) {
217
+ DuoSelectionMaterial(lens: pressedIndex != nil)
245
218
  .frame(width: cellWidth)
246
- .scaleEffect(x: lens.x * lens.along, y: lens.y * lens.across)
247
- .offset(x: selection.offset)
219
+ .offset(x: CGFloat(pressedIndex ?? selectedIndex) * cellWidth)
220
+ .animation(tabSpring, value: selectedIndex)
221
+ .animation(tabSpring, value: pressedIndex)
248
222
 
249
223
  HStack(spacing: 0) {
250
224
  ForEach(items.indices, id: \.self) { index in
251
- DuoLiquidTab(selection: selection, index: index, label: items[index].label,
252
- selected: index == selectedIndex, onSelect: { onTabSelected(index) }) { active in
253
- tabCell(index, active: active)
254
- }
225
+ tabCell(index)
255
226
  }
256
227
  }
257
228
  }
258
- .modifier(DuoLiquidInput(selection: selection, space: "DuoFloatingBar"))
259
229
  .padding(floatingPadding)
260
230
  .frame(width: barWidth, height: floatingHeight)
261
231
  .modifier(DuoBarMaterial(shape: Capsule()))
262
- .scaleEffect(selection.barScale)
263
232
  .accessibilityIdentifier("bottom_tab_bar")
264
- .onAppear { selection.sync(index: selectedIndex) }
265
- .onChange(of: selectedIndex) { selection.sync(index: $0) }
266
- .onChange(of: cellWidth) { _ in selection.sync(index: selectedIndex) }
267
- }
268
-
269
- private func configured() -> DuoLiquidSelection {
270
- selection.axis = .x
271
- selection.count = items.count
272
- selection.pitch = cellWidth
273
- selection.firstCenter = cellWidth / 2
274
- selection.reduceMotion = reduceMotion
275
- selection.onSelect = onTabSelected
276
- selection.onLongPress = onTabLongPress
277
- selection.onTick = onTick
278
- return selection
279
233
  }
280
234
 
281
- private func tabCell(_ index: Int, active: Bool) -> some View {
282
- VStack(spacing: Spacing.XXS) {
283
- DuoTabIcon(item: items[index], selected: active, badgeMaxWidth: cellWidth / 2 - Spacing.XXS)
284
- MomoText(
285
- items[index].label,
286
- typography: .labelXsMedium,
287
- color: active ? theme.colors.primary : theme.colors.text.hint,
288
- textAlign: .center,
289
- maxLines: 1
290
- )
291
- // like the system tab bar the label keeps its design size; a constant snapshot, nothing to observe
292
- .environment(\.momoFontScale, FontScale(userScaleRate: 1, useOSScaleRate: false))
293
- }
294
- .frame(width: cellWidth)
295
- .frame(maxHeight: .infinity)
296
- }
297
- }
298
-
299
- /// One gesture over the whole bar drives the selection; SwiftUI drops `onEnded` when the system
300
- /// cancels a touch, so the reset of the gesture state ends it instead.
301
- private struct DuoLiquidInput: ViewModifier {
302
- let selection: DuoLiquidSelection
303
- let space: String
304
-
305
- @GestureState private var touching = false
306
-
307
- func body(content: Content) -> some View {
308
- content
309
- .coordinateSpace(name: space)
235
+ private func tabCell(_ index: Int) -> some View {
236
+ let selected = index == selectedIndex
237
+ return SwiftUI.Button { onTabSelected(index) } label: {
238
+ VStack(spacing: Spacing.XXS) {
239
+ DuoTabIcon(item: items[index], selected: selected)
240
+ MomoText(
241
+ items[index].label,
242
+ typography: .labelXsMedium,
243
+ color: selected ? theme.colors.primary : theme.colors.text.hint,
244
+ textAlign: .center,
245
+ maxLines: 1
246
+ )
247
+ // like the system tab bar the label keeps its design size; a constant snapshot, nothing to observe
248
+ .environment(\.momoFontScale, FontScale(userScaleRate: 1, useOSScaleRate: false))
249
+ }
250
+ .frame(width: cellWidth)
251
+ .frame(maxHeight: .infinity)
310
252
  .contentShape(Rectangle())
311
- .gesture(
312
- DragGesture(minimumDistance: 0, coordinateSpace: .named(space))
313
- .updating($touching) { _, state, _ in state = true }
314
- .onChanged { selection.touchChanged(location: $0.location, translation: $0.translation, time: $0.time) }
315
- .onEnded { selection.touchEnded(location: $0.location) }
316
- )
317
- .onChange(of: touching) { if !$0 { selection.touchCancelled() } }
318
- }
319
- }
320
-
321
- /// A tab drawn twice, inactive with the active layer over it fading in as the lens passes;
322
- /// the tab the lens lands on pops.
323
- private struct DuoLiquidTab<Content: View>: View {
324
- @ObservedObject var selection: DuoLiquidSelection
325
- let index: Int
326
- let label: String
327
- let selected: Bool
328
- let onSelect: () -> Void
329
- @ViewBuilder let content: (_ active: Bool) -> Content
330
-
331
- var body: some View {
332
- ZStack {
333
- content(false)
334
- content(true).opacity(selection.activeOpacity(index))
335
253
  }
336
- .scaleEffect(selection.popIndex == index ? selection.pop : 1)
337
- .accessibilityElement(children: .ignore)
338
- .accessibilityLabel(label)
339
- .accessibilityAddTraits(selected ? [.isButton, .isSelected] : .isButton)
340
- .accessibilityAction { onSelect() }
254
+ .buttonStyle(DuoLensPressStyle(index: index, pressedIndex: $pressedIndex))
255
+ .accessibilityLabel(items[index].label)
341
256
  }
342
257
  }
343
258
 
344
- /// Pink tinted capsule under the selected tab.
259
+ /// Pink tinted capsule under the selected tab; while pressed it grows into a lens (80x54 to about 96x70).
345
260
  private struct DuoSelectionMaterial: View {
261
+ let lens: Bool
262
+
346
263
  @Environment(\.appTheme) private var theme
347
264
 
348
265
  var body: some View {
349
266
  Capsule()
350
267
  .fill(theme.colors.primary.opacity(selectionTintOpacity))
268
+ .scaleEffect(x: lens ? lensScaleX : 1, y: lens ? lensScaleY : 1)
351
269
  .allowsHitTesting(false)
352
270
  }
353
271
  }
354
272
 
355
- /// Lift of a single button, e.g. the compressed rail (RN `usePressLift`).
356
- private struct DuoPressLiftStyle: ButtonStyle {
357
- @Environment(\.accessibilityReduceMotion) private var reduceMotion
273
+ /// Tracks the finger so the selection lens jumps to the pressed tab before it is selected.
274
+ private struct DuoLensPressStyle: ButtonStyle {
275
+ let index: Int
276
+ @Binding var pressedIndex: Int?
358
277
 
359
278
  func makeBody(configuration: Configuration) -> some View {
360
- configuration.label
361
- .scaleEffect(configuration.isPressed && !reduceMotion ? 1 + (liquidLensScaleX - 1) * 0.5 : 1)
362
- .animation(liquidSpring, value: configuration.isPressed)
279
+ configuration.label.onChange(of: configuration.isPressed) { pressed in
280
+ if pressed {
281
+ pressedIndex = index
282
+ } else if pressedIndex == index {
283
+ pressedIndex = nil
284
+ }
285
+ }
363
286
  }
364
287
  }
365
288
 
366
- /// Floating bar: the badge starts at the icon's center and grows toward the cell's end edge.
367
- /// Rail: it ends just inside the capsule and grows back over the icon (RN TabBarIcon `end: -3`).
368
- /// Capped at `badgeMaxWidth` (an overlay alone would only offer it the icon's 28pt).
369
289
  private struct DuoTabIcon: View {
370
290
  let item: BottomTabItem
371
291
  let selected: Bool
372
- let badgeMaxWidth: CGFloat
373
- var inRail = false
374
292
 
375
293
  @Environment(\.appTheme) private var theme
376
294
 
@@ -382,15 +300,10 @@ private struct DuoTabIcon: View {
382
300
 
383
301
  var body: some View {
384
302
  Icon(source: item.icon, size: iconSize, color: selected ? theme.colors.primary : theme.colors.text.hint)
385
- .overlay(alignment: inRail ? .topTrailing : .topLeading) {
386
- if let badgeLabel, !badgeLabel.isEmpty {
387
- Badge(label: badgeLabel)
388
- .frame(width: max(badgeMaxWidth, 0), alignment: inRail ? .trailing : .leading)
389
- .offset(x: inRail ? railBadgeEndOffset : iconSize / 2, y: -Spacing.XS)
390
- }
391
- }
392
303
  .overlay(alignment: .topTrailing) {
393
- if badgeLabel?.isEmpty == true || (badgeLabel == nil && item.showDot) {
304
+ if let badgeLabel, !badgeLabel.isEmpty {
305
+ Badge(label: badgeLabel).offset(x: Spacing.S, y: -Spacing.XS)
306
+ } else if badgeLabel != nil || item.showDot {
394
307
  BadgeDot(size: .small)
395
308
  }
396
309
  }
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'MoMoUIKits'
3
- s.version = '0.168.1-beta.8'
3
+ s.version = '0.168.1-beta.24'
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.168.1-beta.8'
3
+ s.version = '0.168.1-beta.24'
4
4
  s.summary = 'Demo browser for MoMoUIKits SwiftUI components'
5
5
  s.homepage = 'https://momo.vn'
6
6
  s.license = { :type => 'MIT' }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.168.1-beta.25-debug",
3
+ "version": "0.168.1-beta.26-debug",
4
4
  "private": false,
5
5
  "dependeNavigationncies": {},
6
6
  "devDependencies": {},
@@ -1,17 +0,0 @@
1
- package vn.momo.kits.platform
2
-
3
- import android.provider.Settings
4
- import androidx.compose.runtime.Composable
5
- import androidx.compose.runtime.remember
6
- import androidx.compose.ui.platform.LocalConfiguration
7
- import androidx.compose.ui.platform.LocalContext
8
-
9
- @Composable
10
- actual fun rememberReduceMotion(): Boolean {
11
- val context = LocalContext.current
12
- // re-read on configuration changes; the setting has no observer of its own
13
- val configuration = LocalConfiguration.current
14
- return remember(context, configuration) {
15
- Settings.Global.getFloat(context.contentResolver, Settings.Global.ANIMATOR_DURATION_SCALE, 1f) == 0f
16
- }
17
- }