@momo-kits/native-kits 0.169.5-beta.2-debug → 0.169.5-beta.3-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.
- package/CLAUDE.md +1 -1
- package/PUBLISH_GUIDE.md +11 -4
- package/compose/build.gradle.kts +1 -1
- package/compose/compose.podspec +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ModalLayout.kt +2 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +1 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +9 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +9 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoTabBar.kt +6 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/TabBarMetrics.kt +25 -4
- package/gradle.properties +2 -2
- package/ios/Layout/ModalLayout.swift +2 -2
- package/ios/Navigation/BottomTab/BottomTabBar.swift +8 -2
- package/ios/Navigation/BottomTab/CurvedContainer.swift +13 -12
- package/ios/Navigation/BottomTab/DuoTabBar.swift +5 -1
- package/ios/Navigation/BottomTab/TabBarMetrics.swift +18 -4
- package/ios/Popup/PopupDisplay.swift +3 -3
- package/ios/Popup/PopupInput.swift +1 -1
- package/ios/Popup/PopupLayout.swift +3 -3
- package/ios/native-kits.podspec +1 -1
- package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
- package/package.json +4 -1
- package/publish.sh +43 -10
package/CLAUDE.md
CHANGED
|
@@ -42,7 +42,7 @@ xcodebuild -project sample/iosApp/Pods/Pods.xcodeproj -scheme MoMoUIKits -sdk ip
|
|
|
42
42
|
-destination 'generic/platform=iOS Simulator' build
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
Publishing is automated (`.gitlab-ci.yml` → `publish.sh`; see `PUBLISH_GUIDE.md`): `main` → npm latest + 1 patch (tag `latest`; a manual run with `RELEASE_VERSION` sets the sprint version), other branches on `[ci build]` → `<npm latest + 1 patch>-beta.N`. The version is never stored in the repo — `scripts/ci/resolve-version.mjs` bases it on npm and only takes a number free on **both** npm (incl. `-debug`) and GitLab Maven. Do not publish
|
|
45
|
+
Publishing is automated (`.gitlab-ci.yml` → `publish.sh`; see `PUBLISH_GUIDE.md`): `main` → npm latest + 1 patch (tag `latest`; a manual run with `RELEASE_VERSION` sets the sprint version), other branches on `[ci build]` → `<npm latest + 1 patch>-beta.N`. The version is never stored in the repo — `scripts/ci/resolve-version.mjs` bases it on npm and only takes a number free on **both** npm (incl. `-debug`) and GitLab Maven. Locally, `bash publish.sh local` publishes a beta of the working tree as is (uncommitted changes too, any branch; same beta numbering); `release` is CI-only. Do not publish unless asked; `bash publish.sh local --dry-run` shows the version and packs the tarballs without uploading.
|
|
46
46
|
|
|
47
47
|
## Architecture essentials
|
|
48
48
|
|
package/PUBLISH_GUIDE.md
CHANGED
|
@@ -28,11 +28,18 @@ GitLab → **Build → Pipelines → Run pipeline** → chọn `main` → `RELEA
|
|
|
28
28
|
## Chạy local
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
bash publish.sh build
|
|
32
|
-
bash publish.sh
|
|
33
|
-
bash publish.sh
|
|
31
|
+
bash publish.sh build # build tất cả artifact sẽ publish (không upload)
|
|
32
|
+
bash publish.sh local --dry-run # xem version sẽ ra + pack tarball npm vào build/npm
|
|
33
|
+
bash publish.sh local # publish beta thật từ working tree hiện tại
|
|
34
|
+
yarn publish:local # như trên (thêm --dry-run để chạy thử)
|
|
34
35
|
```
|
|
35
36
|
|
|
37
|
+
- `local` chỉ publish **beta**, ở bất kỳ nhánh nào, và lấy **nguyên working tree**, kể cả thay đổi chưa commit. Dùng khi cần nhanh một version để test mà chưa muốn commit.
|
|
38
|
+
- Version theo đúng quy tắc beta của CI: `<npm latest + 1 patch>-beta.N`, npm tag `beta`, và số phải còn trống trên cả npm lẫn Maven. Beta local và beta CI dùng chung dãy `N`.
|
|
39
|
+
- `release` (npm tag `latest`) chỉ chạy trên CI. Chạy ở local sẽ bị chặn, trừ khi có `--dry-run`.
|
|
40
|
+
- Local không giữ khoá `kits-publish` của CI. Vì vậy script build xong mới chọn version, để khoảng thời gian có thể bị trùng số với một job CI đang chạy là ngắn nhất.
|
|
41
|
+
- `gitHead` trên npm trỏ tới commit HEAD, nhưng package có thể chứa cả thay đổi chưa commit.
|
|
42
|
+
|
|
36
43
|
Các file bị sửa trong lúc publish được trả lại nguyên trạng khi script kết thúc, kể cả khi fail.
|
|
37
44
|
|
|
38
45
|
## CI/CD variables
|
|
@@ -40,6 +47,6 @@ Các file bị sửa trong lúc publish được trả lại nguyên trạng khi
|
|
|
40
47
|
| Biến | Dùng cho |
|
|
41
48
|
|---|---|
|
|
42
49
|
| `NPM_TOKEN` | npm automation token. Nếu không có thì dùng `_authToken` trong `.npmrc`. |
|
|
43
|
-
| `
|
|
50
|
+
| `PUBLISHING_USER` / `PUBLISHING_PASSWORD` | Tài khoản upload Maven lên MoMo Artifacts (ưu tiên). `MAVEN_USER` / `MAVEN_TOKEN` chỉ còn là fallback cũ. |
|
|
44
51
|
|
|
45
52
|
Đặt các biến này ở chế độ **masked**, **không bật protected**, vì beta publish từ các nhánh không được protect. Sau đó xoá token khỏi `.npmrc` / `gradle.properties`.
|
package/compose/build.gradle.kts
CHANGED
package/compose/compose.podspec
CHANGED
|
@@ -111,8 +111,8 @@ fun modalLayoutOf(
|
|
|
111
111
|
return ModalLayout(
|
|
112
112
|
isFoldable = false,
|
|
113
113
|
placement = placement,
|
|
114
|
-
popup = popupGeometry(placement.width, null, Spacing.XL, Radius.
|
|
115
|
-
sheet = SheetGeometry(width = null, maxHeight = null, minHeight = 0.dp, margin = 0.dp, radius = Radius.
|
|
114
|
+
popup = popupGeometry(placement.width, null, Spacing.XL, Radius.L),
|
|
115
|
+
sheet = SheetGeometry(width = null, maxHeight = null, minHeight = 0.dp, margin = 0.dp, radius = Radius.M),
|
|
116
116
|
scrimOpacity = PHONE_SCRIM_OPACITY,
|
|
117
117
|
)
|
|
118
118
|
}
|
|
@@ -33,7 +33,6 @@ import androidx.compose.runtime.setValue
|
|
|
33
33
|
import androidx.compose.runtime.rememberCoroutineScope
|
|
34
34
|
import androidx.compose.ui.Alignment
|
|
35
35
|
import androidx.compose.ui.Modifier
|
|
36
|
-
import androidx.compose.ui.draw.clip
|
|
37
36
|
import androidx.compose.ui.graphics.Brush
|
|
38
37
|
import androidx.compose.ui.graphics.Color
|
|
39
38
|
import androidx.compose.ui.input.pointer.pointerInput
|
|
@@ -92,7 +91,6 @@ internal fun BottomSheet(
|
|
|
92
91
|
val modal = rememberModalLayout()
|
|
93
92
|
val isFoldable = modal.isFoldable
|
|
94
93
|
val sheet = modal.sheet
|
|
95
|
-
val sheetShape = RoundedCornerShape(topStart = sheet.radius, topEnd = sheet.radius)
|
|
96
94
|
val title = header as? BottomHeader.Title
|
|
97
95
|
// the screen is the outer display on iPhone Duo, even when unfolded
|
|
98
96
|
val screenHeightDp = if (isFoldable) layout.height else getScreenHeight()
|
|
@@ -208,11 +206,9 @@ internal fun BottomSheet(
|
|
|
208
206
|
.offset { IntOffset(x = 0, y = sheetOffset.value.toInt()) }
|
|
209
207
|
.then(if (sheet.width != null) Modifier.width(sheet.width) else Modifier.fillMaxWidth())
|
|
210
208
|
.heightIn(max = maxHeight)
|
|
211
|
-
// clip too, so content (images, scrims) follows the corners like iOS clipShape
|
|
212
|
-
.clip(sheetShape)
|
|
213
209
|
.background(
|
|
214
210
|
color = if (isSurface) AppTheme.current.colors.background.surface else AppTheme.current.colors.background.default,
|
|
215
|
-
shape =
|
|
211
|
+
shape = RoundedCornerShape(topStart = sheet.radius, topEnd = sheet.radius)
|
|
216
212
|
)
|
|
217
213
|
.conditional(IsShowBaseLineDebug) {
|
|
218
214
|
border(1.dp, Colors.blue_03)
|
|
@@ -13,6 +13,7 @@ import androidx.compose.runtime.mutableStateMapOf
|
|
|
13
13
|
import androidx.compose.ui.draw.clip
|
|
14
14
|
import androidx.compose.ui.draw.dropShadow
|
|
15
15
|
import androidx.compose.ui.draw.innerShadow
|
|
16
|
+
import androidx.compose.ui.graphics.Color
|
|
16
17
|
import androidx.compose.ui.graphics.Shape
|
|
17
18
|
import androidx.compose.ui.graphics.graphicsLayer
|
|
18
19
|
import androidx.compose.ui.layout.onPlaced
|
|
@@ -73,7 +74,12 @@ internal fun BottomTabBar(
|
|
|
73
74
|
fixedFontScale = true,
|
|
74
75
|
modifier = Modifier
|
|
75
76
|
.offset(x = (layout.insetLeft - layout.insetRight) / 2)
|
|
76
|
-
.width(
|
|
77
|
+
.width(
|
|
78
|
+
horizontalBarWidth(
|
|
79
|
+
layout.width, layout.height, layout.insetLeft, layout.insetRight,
|
|
80
|
+
items.size, hasCenterAction(floatingButton, items.size),
|
|
81
|
+
),
|
|
82
|
+
),
|
|
77
83
|
)
|
|
78
84
|
}
|
|
79
85
|
}
|
|
@@ -187,7 +193,7 @@ private fun RowScope.TabBarItem(
|
|
|
187
193
|
contentDescription = item.label
|
|
188
194
|
},
|
|
189
195
|
horizontalAlignment = Alignment.CenterHorizontally,
|
|
190
|
-
verticalArrangement = Arrangement.spacedBy(
|
|
196
|
+
verticalArrangement = Arrangement.spacedBy(TabBarMetrics.itemIconLabelGap),
|
|
191
197
|
) {
|
|
192
198
|
TabItemContent(item, selected, fixedFontScale = fixedFontScale)
|
|
193
199
|
}
|
|
@@ -364,6 +370,7 @@ internal fun Modifier.centerActionButton(size: androidx.compose.ui.unit.Dp, pres
|
|
|
364
370
|
.size(size)
|
|
365
371
|
.then(CtaShadows.fold(Modifier as Modifier) { acc, shadow -> acc.spreadShadow(CircleShape, shadow) })
|
|
366
372
|
.background(AppTheme.current.colors.primary, CircleShape)
|
|
373
|
+
.border(1.dp, Color.White.copy(alpha = TabBarMetrics.ctaBorderOpacity), CircleShape)
|
|
367
374
|
}
|
|
368
375
|
|
|
369
376
|
@Composable
|
|
@@ -19,6 +19,7 @@ import androidx.compose.ui.unit.DpOffset
|
|
|
19
19
|
import androidx.compose.ui.unit.LayoutDirection
|
|
20
20
|
import androidx.compose.ui.unit.dp
|
|
21
21
|
import androidx.compose.foundation.background
|
|
22
|
+
import androidx.compose.foundation.border
|
|
22
23
|
import androidx.compose.runtime.Composable
|
|
23
24
|
import vn.momo.kits.const.AppTheme
|
|
24
25
|
|
|
@@ -82,8 +83,8 @@ internal fun Modifier.spreadShadow(shape: Shape, shadow: Shadow): Modifier =
|
|
|
82
83
|
)
|
|
83
84
|
else dropShadow(shape, shadow)
|
|
84
85
|
|
|
85
|
-
// Navigation bar container:
|
|
86
|
-
// Shadow/floating: 12% blur 24, 4% y12 blur 32 spread -16).
|
|
86
|
+
// Navigation bar container: translucent glass fill with the floating shadow following the shape (Figma
|
|
87
|
+
// Shadow/floating: 12% blur 24, 4% y12 blur 32 spread -16; .Nav/Background: white 86%, Blur=On).
|
|
87
88
|
@Composable
|
|
88
89
|
internal fun Modifier.tabBarContainer(shape: Shape): Modifier =
|
|
89
90
|
dropShadow(shape, Shadow(radius = 24.dp, color = Color.Black, alpha = 0.12f))
|
|
@@ -91,4 +92,9 @@ internal fun Modifier.tabBarContainer(shape: Shape): Modifier =
|
|
|
91
92
|
shape,
|
|
92
93
|
Shadow(radius = 32.dp, spread = (-16).dp, color = Color.Black, alpha = 0.04f, offset = DpOffset(0.dp, 12.dp)),
|
|
93
94
|
)
|
|
94
|
-
.background(
|
|
95
|
+
.background(
|
|
96
|
+
AppTheme.current.colors.background.surface.copy(alpha = TabBarMetrics.backgroundOpacity),
|
|
97
|
+
shape,
|
|
98
|
+
)
|
|
99
|
+
// Figma .Nav/Background: 1px light-gray hairline defining the pill edge
|
|
100
|
+
.border(1.dp, AppTheme.current.colors.border.default, shape)
|
|
@@ -84,7 +84,12 @@ internal fun BoxScope.DuoTabBar(
|
|
|
84
84
|
modifier = Modifier
|
|
85
85
|
.align(Alignment.BottomCenter)
|
|
86
86
|
.padding(bottom = tabBarBottomGap(layout.insetBottom))
|
|
87
|
-
.width(
|
|
87
|
+
.width(
|
|
88
|
+
horizontalBarWidth(
|
|
89
|
+
layout.width, layout.height, layout.insetLeft, layout.insetRight,
|
|
90
|
+
items.size, hasCenterAction(floatingButton, items.size),
|
|
91
|
+
),
|
|
92
|
+
),
|
|
88
93
|
)
|
|
89
94
|
}
|
|
90
95
|
}
|
|
@@ -15,11 +15,18 @@ import vn.momo.kits.platform.getPlatformName
|
|
|
15
15
|
// Horizontal: floating container with items split evenly, center action in a notch.
|
|
16
16
|
// Vertical: iPhone Duo rail, center action under the container.
|
|
17
17
|
internal object TabBarMetrics {
|
|
18
|
-
val height =
|
|
18
|
+
val height = 60.dp
|
|
19
19
|
val margin = Spacing.S
|
|
20
|
-
val paddingVertical = Spacing.
|
|
20
|
+
val paddingVertical = Spacing.XS
|
|
21
21
|
val paddingHorizontal = Spacing.M
|
|
22
|
-
val itemGap =
|
|
22
|
+
val itemGap = 1.dp
|
|
23
|
+
// gap between the icon slot and the label inside a tab (Figma: none)
|
|
24
|
+
val itemIconLabelGap = 0.dp
|
|
25
|
+
// .Nav/Background: Compose has no backdrop blur, so use the Figma Blur=Off spec (opacity 95%, no blur)
|
|
26
|
+
// — nearly solid, matching the frosted sample — plus the 1px border below; surface keeps dark-mode support.
|
|
27
|
+
val backgroundOpacity = 0.95f
|
|
28
|
+
// white 60% hairline around the center action button (Figma Icon Button border)
|
|
29
|
+
val ctaBorderOpacity = 0.6f
|
|
23
30
|
val iconSize = 24.dp
|
|
24
31
|
val indicatorHeight = 32.dp
|
|
25
32
|
// label_s_medium / label_xs_medium line heights: the label slot keeps this height so a scaled
|
|
@@ -35,6 +42,9 @@ internal object TabBarMetrics {
|
|
|
35
42
|
// centered; phones and folded outer displays fill the window
|
|
36
43
|
val foldableMinShortSide = 600.dp
|
|
37
44
|
const val FOLDABLE_WIDTH_RATIO = 0.65f
|
|
45
|
+
// a 2-tab bar doesn't stretch to the full width: each item is this fixed width and the bar is sized
|
|
46
|
+
// to its content, centered (Figma Navigation · 2 Tab: item 100, bar ~225)
|
|
47
|
+
val twoTabItemWidth = 100.dp
|
|
38
48
|
val ctaSlotWidth = 92.dp
|
|
39
49
|
val ctaSize = 48.dp
|
|
40
50
|
// the icon sits 10 inside the 48 button (prototype .cta: 28 icon), 12 inside the 52 rail one
|
|
@@ -92,7 +102,18 @@ internal val NOTCH_CURVES = listOf(
|
|
|
92
102
|
|
|
93
103
|
// Width of the horizontal bar: 65% of the short side on an unfolded foldable, otherwise the window minus
|
|
94
104
|
// the side safe areas and margins.
|
|
95
|
-
internal fun horizontalBarWidth(
|
|
105
|
+
internal fun horizontalBarWidth(
|
|
106
|
+
width: Dp,
|
|
107
|
+
height: Dp,
|
|
108
|
+
insetLeft: Dp,
|
|
109
|
+
insetRight: Dp,
|
|
110
|
+
itemCount: Int,
|
|
111
|
+
hasCta: Boolean,
|
|
112
|
+
): Dp {
|
|
113
|
+
// 2 tabs (no center action) stay content-sized and centered instead of filling the window
|
|
114
|
+
if (itemCount == 2 && !hasCta) {
|
|
115
|
+
return TabBarMetrics.twoTabItemWidth * 2 + TabBarMetrics.paddingHorizontal * 2 + TabBarMetrics.itemGap
|
|
116
|
+
}
|
|
96
117
|
val shortSide = minOf(width, height)
|
|
97
118
|
if (shortSide >= TabBarMetrics.foldableMinShortSide) return shortSide * TabBarMetrics.FOLDABLE_WIDTH_RATIO
|
|
98
119
|
return width - insetLeft - insetRight - TabBarMetrics.margin * 2
|
package/gradle.properties
CHANGED
|
@@ -18,7 +18,7 @@ kotlin.apple.xcodeCompatibility.nowarn=true
|
|
|
18
18
|
name="ComposeKits"
|
|
19
19
|
group=vn.momo.kits
|
|
20
20
|
artifact.id=kits
|
|
21
|
-
version=0.169.5-beta.
|
|
21
|
+
version=0.169.5-beta.3
|
|
22
22
|
|
|
23
23
|
repo=GitLab
|
|
24
|
-
url=https://
|
|
24
|
+
url=https://artifacts.mservice.com.vn/repository/maven-momo-app/
|
|
@@ -79,8 +79,8 @@ public extension ModalLayout {
|
|
|
79
79
|
return ModalLayout(
|
|
80
80
|
isFoldable: false,
|
|
81
81
|
placement: placement,
|
|
82
|
-
popup: popupGeometry(placementWidth: width, maxHeight: nil, margin: Spacing.XL, radius: Radius.
|
|
83
|
-
sheet: SheetGeometry(width: nil, maxHeight: nil, minHeight: 0, margin: 0, radius: Radius.
|
|
82
|
+
popup: popupGeometry(placementWidth: width, maxHeight: nil, margin: Spacing.XL, radius: Radius.L),
|
|
83
|
+
sheet: SheetGeometry(width: nil, maxHeight: nil, minHeight: 0, margin: 0, radius: Radius.M),
|
|
84
84
|
scrimOpacity: ModalMetrics.phoneScrimOpacity
|
|
85
85
|
)
|
|
86
86
|
}
|
|
@@ -96,7 +96,11 @@ struct BottomTabBar: View {
|
|
|
96
96
|
floatingButton: floatingButton,
|
|
97
97
|
selectedIndex: selectedIndex,
|
|
98
98
|
onTabSelected: onTabSelected,
|
|
99
|
-
width: TabBarMetrics.horizontalBarWidth(
|
|
99
|
+
width: TabBarMetrics.horizontalBarWidth(
|
|
100
|
+
layout,
|
|
101
|
+
itemCount: items.count,
|
|
102
|
+
hasCta: TabBarMetrics.hasCenterAction(floatingButton, tabCount: items.count)
|
|
103
|
+
),
|
|
100
104
|
fixedFontScale: true
|
|
101
105
|
)
|
|
102
106
|
.padding(.bottom, TabBarMetrics.bottomGap(bottomInset))
|
|
@@ -147,7 +151,7 @@ struct HorizontalTabBar: View {
|
|
|
147
151
|
Color.clear.frame(width: TabBarMetrics.ctaSlotWidth)
|
|
148
152
|
}
|
|
149
153
|
SwiftUI.Button { onTabSelected(index) } label: {
|
|
150
|
-
VStack(spacing:
|
|
154
|
+
VStack(spacing: TabBarMetrics.itemIconLabelGap) {
|
|
151
155
|
TabItemContent(item: items[index], selected: index == selectedIndex, fixedFontScale: fixedFontScale)
|
|
152
156
|
}
|
|
153
157
|
.frame(width: itemWidth)
|
|
@@ -359,6 +363,8 @@ struct CenterActionStyle: ButtonStyle {
|
|
|
359
363
|
Circle().inset(by: 16).fill(theme.colors.primary)
|
|
360
364
|
.shadow(color: Color.black.opacity(0.04), radius: 16, x: 0, y: 12)
|
|
361
365
|
Circle().fill(theme.colors.primary)
|
|
366
|
+
// Figma Icon Button border: white 60% hairline
|
|
367
|
+
.overlay(Circle().stroke(Color.white.opacity(TabBarMetrics.ctaBorderOpacity), lineWidth: 1))
|
|
362
368
|
if let iconContent {
|
|
363
369
|
// custom content (e.g. an oversized Lottie) is clipped to the round button
|
|
364
370
|
iconContent
|
|
@@ -45,7 +45,10 @@ struct NotchedBarShape: Shape {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
/// Navigation bar container:
|
|
48
|
+
/// Navigation bar container: translucent glass fill (Figma .Nav/Background white 86%, Blur=On) with the
|
|
49
|
+
/// floating shadow following the shape. A single translucent fill keeps the glass see-through — stacking
|
|
50
|
+
/// opaque shadow layers would make it solid — so the two shadows are applied over it (compositingGroup
|
|
51
|
+
/// keeps the first from being re-cast). iOS could back this with a real material later; see Compose note.
|
|
49
52
|
struct TabBarContainer<S: Shape>: ViewModifier {
|
|
50
53
|
let shape: S
|
|
51
54
|
|
|
@@ -53,17 +56,15 @@ struct TabBarContainer<S: Shape>: ViewModifier {
|
|
|
53
56
|
|
|
54
57
|
func body(content: Content) -> some View {
|
|
55
58
|
content.background(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
shape.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
.allowsHitTesting(false)
|
|
59
|
+
shape
|
|
60
|
+
.fill(theme.colors.background.surface.opacity(TabBarMetrics.backgroundOpacity))
|
|
61
|
+
// Figma .Nav/Background: 1px light-gray hairline defining the pill edge
|
|
62
|
+
.overlay(shape.stroke(theme.colors.border.default, lineWidth: 1))
|
|
63
|
+
.compositingGroup()
|
|
64
|
+
// Figma Shadow/floating: 12% blur 24, then 4% blur 32 spread -16 offset y12
|
|
65
|
+
.shadow(color: Color.black.opacity(0.12), radius: 12)
|
|
66
|
+
.shadow(color: Color.black.opacity(0.04), radius: 16, x: 0, y: 12)
|
|
67
|
+
.allowsHitTesting(false)
|
|
67
68
|
)
|
|
68
69
|
}
|
|
69
70
|
}
|
|
@@ -171,7 +171,11 @@ private struct DuoFloatingTabBar: View {
|
|
|
171
171
|
floatingButton: floatingButton,
|
|
172
172
|
selectedIndex: selectedIndex,
|
|
173
173
|
onTabSelected: onTabSelected,
|
|
174
|
-
width: TabBarMetrics.horizontalBarWidth(
|
|
174
|
+
width: TabBarMetrics.horizontalBarWidth(
|
|
175
|
+
layout,
|
|
176
|
+
itemCount: items.count,
|
|
177
|
+
hasCta: TabBarMetrics.hasCenterAction(floatingButton, tabCount: items.count)
|
|
178
|
+
),
|
|
175
179
|
fixedFontScale: true
|
|
176
180
|
)
|
|
177
181
|
.padding(.bottom, layout.duoFloatingTabBarBottom)
|
|
@@ -11,11 +11,18 @@
|
|
|
11
11
|
import SwiftUI
|
|
12
12
|
|
|
13
13
|
enum TabBarMetrics {
|
|
14
|
-
static let height: CGFloat =
|
|
14
|
+
static let height: CGFloat = 60
|
|
15
15
|
static let margin = Spacing.S
|
|
16
|
-
static let paddingVertical = Spacing.
|
|
16
|
+
static let paddingVertical = Spacing.XS
|
|
17
17
|
static let paddingHorizontal = Spacing.M
|
|
18
|
-
static let itemGap =
|
|
18
|
+
static let itemGap: CGFloat = 1
|
|
19
|
+
// gap between the icon slot and the label inside a tab (Figma: none)
|
|
20
|
+
static let itemIconLabelGap: CGFloat = 0
|
|
21
|
+
// .Nav/Background: no backdrop blur, so use the Figma Blur=Off spec (opacity 95%, no blur) plus the 1px
|
|
22
|
+
// border below — nearly solid, matching the frosted sample; surface keeps dark-mode support
|
|
23
|
+
static let backgroundOpacity: CGFloat = 0.95
|
|
24
|
+
// white 60% hairline around the center action button (Figma Icon Button border)
|
|
25
|
+
static let ctaBorderOpacity: CGFloat = 0.6
|
|
19
26
|
static let iconSize: CGFloat = 24
|
|
20
27
|
static let indicatorHeight: CGFloat = 32
|
|
21
28
|
// label_s_medium / label_xs_medium line heights: the label slot keeps this height so a scaled
|
|
@@ -29,6 +36,9 @@ enum TabBarMetrics {
|
|
|
29
36
|
// centered; phones and folded outer displays fill the window
|
|
30
37
|
static let foldableMinShortSide: CGFloat = 600
|
|
31
38
|
static let foldableWidthRatio: CGFloat = 0.65
|
|
39
|
+
// a 2-tab bar doesn't stretch to the full width: each item is this fixed width and the bar is sized
|
|
40
|
+
// to its content, centered (Figma Navigation · 2 Tab: item 100, bar ~225)
|
|
41
|
+
static let twoTabItemWidth: CGFloat = 100
|
|
32
42
|
static let ctaSlotWidth: CGFloat = 92
|
|
33
43
|
static let ctaSize: CGFloat = 48
|
|
34
44
|
// the icon sits 10 inside the 48 button (prototype .cta: 28 icon), 12 inside the 52 rail one
|
|
@@ -70,7 +80,11 @@ enum TabBarMetrics {
|
|
|
70
80
|
|
|
71
81
|
/// Width of the horizontal bar: 65% of the short side on an unfolded foldable, otherwise the window
|
|
72
82
|
/// minus the side safe areas and margins.
|
|
73
|
-
static func horizontalBarWidth(_ layout: ScreenLayout) -> CGFloat {
|
|
83
|
+
static func horizontalBarWidth(_ layout: ScreenLayout, itemCount: Int, hasCta: Bool) -> CGFloat {
|
|
84
|
+
// 2 tabs (no center action) stay content-sized and centered instead of filling the window
|
|
85
|
+
if itemCount == 2 && !hasCta {
|
|
86
|
+
return twoTabItemWidth * 2 + paddingHorizontal * 2 + itemGap
|
|
87
|
+
}
|
|
74
88
|
let shortSide = min(layout.width, layout.height)
|
|
75
89
|
if shortSide >= foldableMinShortSide { return shortSide * foldableWidthRatio }
|
|
76
90
|
return layout.width - layout.insets.leading - layout.insets.trailing - 2 * margin
|
|
@@ -108,7 +108,7 @@ public struct PopupDisplay: View {
|
|
|
108
108
|
}
|
|
109
109
|
.fixedSize(horizontal: false, vertical: true)
|
|
110
110
|
.background(theme.colors.background.surface)
|
|
111
|
-
.clipShape(RoundedRectangle(cornerRadius: layout.popupRadius))
|
|
111
|
+
.clipShape(RoundedRectangle(cornerRadius: layout.popupRadius()))
|
|
112
112
|
|
|
113
113
|
if isShowCloseIcon {
|
|
114
114
|
ModalIconButton(icon: "navigation_close", accessibilityId: "ic_popup_close", action: onClose)
|
|
@@ -116,8 +116,8 @@ public struct PopupDisplay: View {
|
|
|
116
116
|
.padding(.trailing, Spacing.M)
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
|
|
120
|
-
.
|
|
119
|
+
.frame(maxWidth: layout.popupMaxWidth)
|
|
120
|
+
.padding(.horizontal, layout.popupHorizontalPadding(12))
|
|
121
121
|
.accessibilityElement(children: .contain)
|
|
122
122
|
.accessibilityIdentifier("popup_notify")
|
|
123
123
|
}
|
|
@@ -61,7 +61,7 @@ public struct PopupInput: View {
|
|
|
61
61
|
.padding(.trailing, Spacing.M)
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
.background(theme.colors.background.surface.cornerRadius(layout.popupRadius))
|
|
64
|
+
.background(theme.colors.background.surface.cornerRadius(layout.popupRadius(8)))
|
|
65
65
|
.shadow(color: .black.opacity(0.08), radius: 2, x: 0, y: 0)
|
|
66
66
|
.shadow(color: .black.opacity(0.16), radius: 24, x: 0, y: 0)
|
|
67
67
|
.frame(maxWidth: layout.popupMaxWidth)
|
|
@@ -19,9 +19,9 @@ extension ScreenLayout {
|
|
|
19
19
|
modalLayout.popup.maxHeight
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
func popupRadius(_ regular: CGFloat = Radius.L) -> CGFloat {
|
|
23
|
+
let modal = modalLayout
|
|
24
|
+
return modal.isFoldable ? modal.popup.radius : regular
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
package/ios/native-kits.podspec
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momo-kits/native-kits",
|
|
3
|
-
"version": "0.169.5-beta.
|
|
3
|
+
"version": "0.169.5-beta.3-debug",
|
|
4
4
|
"private": false,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"publish:local": "bash publish.sh local"
|
|
7
|
+
},
|
|
5
8
|
"dependeNavigationncies": {},
|
|
6
9
|
"devDependencies": {},
|
|
7
10
|
"license": "MoMo"
|
package/publish.sh
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
# Build & publish vn.momo.kits:kits / :demo (GitLab Maven) and @momo-kits/native-kits (npm).
|
|
3
3
|
#
|
|
4
4
|
# bash publish.sh build # build everything that gets published, no upload
|
|
5
|
-
# bash publish.sh
|
|
6
|
-
# bash publish.sh beta # <npm latest + 1 patch>-beta.N, npm tag beta
|
|
5
|
+
# bash publish.sh local # beta of the working tree as is (uncommitted too), any branch
|
|
6
|
+
# bash publish.sh beta # CI, other branches: <npm latest + 1 patch>-beta.N, npm tag beta
|
|
7
|
+
# bash publish.sh release [--version 0.169.1] # CI, main only: npm tag latest; default = npm latest + 1 patch
|
|
7
8
|
# --dry-run: resolve the version and pack the npm tarballs, upload nothing
|
|
8
9
|
#
|
|
9
10
|
# The version is never read from the repo; files touched here are put back on exit.
|
|
@@ -26,6 +27,7 @@ MODE="${1:-}"
|
|
|
26
27
|
[ $# -gt 0 ] && shift
|
|
27
28
|
RELEASE_VERSION="${RELEASE_VERSION:-}"
|
|
28
29
|
DRY_RUN=false
|
|
30
|
+
CHANNEL=""
|
|
29
31
|
while [ $# -gt 0 ]; do
|
|
30
32
|
case "$1" in
|
|
31
33
|
--version) RELEASE_VERSION="${2:-}"; shift 2 ;;
|
|
@@ -85,6 +87,11 @@ set_podspec_version() {
|
|
|
85
87
|
}
|
|
86
88
|
|
|
87
89
|
GRADLE_ARGS=(--stacktrace)
|
|
90
|
+
# IMPORTANT: Maven now publishes to MoMo Artifacts, so its PUBLISHING_* credentials win over a legacy
|
|
91
|
+
# MAVEN_USER/MAVEN_TOKEN (GitLab 5400 deploy token) that may still be set on the project.
|
|
92
|
+
# exported so the resolve-version.mjs subprocess reads them from the environment (reads Maven metadata)
|
|
93
|
+
export MAVEN_USER="${PUBLISHING_USER:-${MAVEN_USER:-}}"
|
|
94
|
+
export MAVEN_TOKEN="${PUBLISHING_PASSWORD:-${MAVEN_TOKEN:-}}"
|
|
88
95
|
if [ -n "${MAVEN_USER:-}" ] && [ -n "${MAVEN_TOKEN:-}" ]; then
|
|
89
96
|
GRADLE_ARGS+=("-Pgitlab.user=$MAVEN_USER" "-Pgitlab.password=$MAVEN_TOKEN")
|
|
90
97
|
fi
|
|
@@ -107,17 +114,20 @@ phase_build() {
|
|
|
107
114
|
# ----------------------------------------------------------------------------
|
|
108
115
|
# version: ask the registries, then stamp package.json + podspecs.
|
|
109
116
|
# ----------------------------------------------------------------------------
|
|
110
|
-
|
|
111
|
-
section "📋 VERSION ($MODE)"
|
|
112
|
-
local args=("$MODE")
|
|
113
|
-
if [ -n "$RELEASE_VERSION" ]; then
|
|
114
|
-
[ "$MODE" = "release" ] || die "--version / RELEASE_VERSION is only for release"
|
|
115
|
-
args+=(--version "$RELEASE_VERSION")
|
|
116
|
-
fi
|
|
117
|
+
check_npm_auth() {
|
|
117
118
|
# A bad token only surfaces as a 404 on the PUT, so check auth before anything is uploaded.
|
|
118
119
|
if [ "$DRY_RUN" != true ] && ! npm whoami "${NPM_ARGS[@]}" >/dev/null 2>&1; then
|
|
119
120
|
die "npm auth failed (npm whoami): set NPM_TOKEN or renew the token in .npmrc"
|
|
120
121
|
fi
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
phase_version() {
|
|
125
|
+
section "📋 VERSION ($CHANNEL)"
|
|
126
|
+
local args=("$CHANNEL")
|
|
127
|
+
if [ -n "$RELEASE_VERSION" ]; then
|
|
128
|
+
[ "$CHANNEL" = "release" ] || die "--version / RELEASE_VERSION is only for release"
|
|
129
|
+
args+=(--version "$RELEASE_VERSION")
|
|
130
|
+
fi
|
|
121
131
|
|
|
122
132
|
local resolved
|
|
123
133
|
resolved="$(node scripts/ci/resolve-version.mjs "${args[@]}")"
|
|
@@ -142,6 +152,8 @@ phase_maven() {
|
|
|
142
152
|
echo "⏭️ dry run: skipping Maven upload"
|
|
143
153
|
return
|
|
144
154
|
fi
|
|
155
|
+
# Publishing target is MoMo Artifacts (url in gradle.properties); credentials reach Gradle via GRADLE_ARGS.
|
|
156
|
+
[ -n "${MAVEN_USER:-}" ] && [ -n "${MAVEN_TOKEN:-}" ] || die "Set PUBLISHING_USER/PUBLISHING_PASSWORD for MoMo Artifacts"
|
|
145
157
|
strip_sample_resources
|
|
146
158
|
./gradlew :compose:publishAllPublicationsToGitLabPackagesRepository \
|
|
147
159
|
:sample:shared:publishAllPublicationsToGitLabPackagesRepository \
|
|
@@ -193,6 +205,7 @@ build/
|
|
|
193
205
|
.gitattributes
|
|
194
206
|
.gitlab-ci.yml
|
|
195
207
|
scripts/ci/
|
|
208
|
+
local.properties
|
|
196
209
|
EOF
|
|
197
210
|
npm_publish
|
|
198
211
|
echo "✅ $VERSION-debug done"
|
|
@@ -208,12 +221,32 @@ case "$MODE" in
|
|
|
208
221
|
phase_build
|
|
209
222
|
;;
|
|
210
223
|
release|beta)
|
|
224
|
+
if [ "$MODE" = release ] && [ -z "${GITLAB_CI:-}" ] && [ "$DRY_RUN" != true ]; then
|
|
225
|
+
die "release (npm tag latest) is published by CI from main only; locally use: bash publish.sh local"
|
|
226
|
+
fi
|
|
227
|
+
CHANNEL="$MODE"
|
|
228
|
+
check_npm_auth
|
|
229
|
+
phase_version
|
|
230
|
+
phase_maven
|
|
231
|
+
phase_npm
|
|
232
|
+
section "🎉 $VERSION published (npm tag $NPM_TAG)"
|
|
233
|
+
;;
|
|
234
|
+
local)
|
|
235
|
+
[ -z "$RELEASE_VERSION" ] || die "local only publishes betas; --version / RELEASE_VERSION is for release"
|
|
236
|
+
CHANNEL=beta
|
|
237
|
+
BRANCH="$(git branch --show-current)"
|
|
238
|
+
DIRTY=""
|
|
239
|
+
[ -z "$(git status --porcelain)" ] || DIRTY=" + uncommitted changes"
|
|
240
|
+
section "🏠 LOCAL beta from ${BRANCH:-detached HEAD} @ $(git rev-parse --short HEAD)$DIRTY"
|
|
241
|
+
check_npm_auth
|
|
242
|
+
# Outside CI's kits-publish lock: build first so the number is picked right before the upload.
|
|
243
|
+
[ "$DRY_RUN" = true ] || phase_build
|
|
211
244
|
phase_version
|
|
212
245
|
phase_maven
|
|
213
246
|
phase_npm
|
|
214
247
|
section "🎉 $VERSION published (npm tag $NPM_TAG)"
|
|
215
248
|
;;
|
|
216
249
|
*)
|
|
217
|
-
die "Usage: bash publish.sh build |
|
|
250
|
+
die "Usage: bash publish.sh build | local [--dry-run] | beta [--dry-run] | release [--version x.y.z] (CI)"
|
|
218
251
|
;;
|
|
219
252
|
esac
|