@expo/ui 55.0.8 → 55.0.10
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/CHANGELOG.md +13 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/ui/BadgeView.kt +74 -0
- package/android/src/main/java/expo/modules/ui/BadgedBoxView.kt +24 -0
- package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +21 -0
- package/android/src/main/java/expo/modules/ui/SlotView.kt +8 -0
- package/android/src/main/java/expo/modules/ui/TooltipView.kt +177 -0
- package/build/jetpack-compose/Badge/index.d.ts +31 -0
- package/build/jetpack-compose/Badge/index.d.ts.map +1 -0
- package/build/jetpack-compose/BadgedBox/index.d.ts +29 -0
- package/build/jetpack-compose/BadgedBox/index.d.ts.map +1 -0
- package/build/jetpack-compose/Tooltip/index.d.ts +100 -0
- package/build/jetpack-compose/Tooltip/index.d.ts.map +1 -0
- package/build/jetpack-compose/index.d.ts +3 -0
- package/build/jetpack-compose/index.d.ts.map +1 -1
- package/build/swift-ui/modifiers/index.d.ts +31 -1
- package/build/swift-ui/modifiers/index.d.ts.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/Modifiers/ScrollTargetBehaviorModifier.swift +26 -0
- package/ios/Modifiers/ScrollTargetLayoutModifier.swift +14 -0
- package/ios/Modifiers/TextContentTypeModifier.swift +191 -0
- package/ios/Modifiers/TextInputAutocapitalizationModifier.swift +28 -0
- package/ios/Modifiers/ViewModifierRegistry.swift +16 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.8/expo.modules.ui-55.0.8-sources.jar → 55.0.10/expo.modules.ui-55.0.10-sources.jar} +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.8/expo.modules.ui-55.0.8.module → 55.0.10/expo.modules.ui-55.0.10.module} +22 -22
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.8/expo.modules.ui-55.0.8.pom → 55.0.10/expo.modules.ui-55.0.10.pom} +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10.pom.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +4 -4
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +1 -1
- package/package.json +2 -2
- package/src/jetpack-compose/Badge/index.tsx +49 -0
- package/src/jetpack-compose/BadgedBox/index.tsx +58 -0
- package/src/jetpack-compose/Tooltip/index.tsx +176 -0
- package/src/jetpack-compose/index.ts +3 -0
- package/src/swift-ui/modifiers/index.ts +88 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.8/expo.modules.ui-55.0.8-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.8/expo.modules.ui-55.0.8-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.8/expo.modules.ui-55.0.8-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.8/expo.modules.ui-55.0.8-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.8/expo.modules.ui-55.0.8.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.8/expo.modules.ui-55.0.8.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.8/expo.modules.ui-55.0.8.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.8/expo.modules.ui-55.0.8.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.8/expo.modules.ui-55.0.8.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.8/expo.modules.ui-55.0.8.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.8/expo.modules.ui-55.0.8.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.8/expo.modules.ui-55.0.8.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.8/expo.modules.ui-55.0.8.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.8/expo.modules.ui-55.0.8.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.8/expo.modules.ui-55.0.8.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.8/expo.modules.ui-55.0.8.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.8/expo.modules.ui-55.0.8.pom.sha512 +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,14 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 55.0.10 — 2026-04-07
|
|
14
|
+
|
|
15
|
+
_This version does not introduce any user-facing changes._
|
|
16
|
+
|
|
17
|
+
## 55.0.9 — 2026-04-06
|
|
18
|
+
|
|
19
|
+
_This version does not introduce any user-facing changes._
|
|
20
|
+
|
|
13
21
|
## 55.0.8 — 2026-04-02
|
|
14
22
|
|
|
15
23
|
_This version does not introduce any user-facing changes._
|
|
@@ -65,6 +73,8 @@ _This version does not introduce any user-facing changes._
|
|
|
65
73
|
|
|
66
74
|
### 🎉 New features
|
|
67
75
|
|
|
76
|
+
- [android] Added `TooltipBox`, `PlainTooltip`, and `RichTooltip` components matching native Compose Tooltip API. Supports plain and rich tooltips with slot-based content, programmatic show/dismiss via ref, and `isPersistent`, `hasAction`, `enableUserInput`, `focusable` props. ([#44373](https://github.com/expo/expo/pull/44373) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
77
|
+
- [android] Added `Badge` and `BadgedBox` components wrapping Jetpack Compose's Badge API for status indicators and count overlays. ([#44139](https://github.com/expo/expo/pull/44139) by [@benjaminkomen](https://github.com/benjaminkomen))
|
|
68
78
|
- [android] Added `shape`, `border`, `selected`, `checked`, `onClick`, and `onCheckedChange` props to `Surface`, supporting clickable, selectable, and toggleable variants. ([#44079](https://github.com/expo/expo/pull/44079) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
69
79
|
- [android] Added nested text support for Compose `Text` with style inheritance, custom fonts via `expo-font`, `background`, `shadow`, and `lineBreak` properties. ([#44094](https://github.com/expo/expo/pull/44094) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
70
80
|
- [android] Added `outlined` variant to `TextInput` component. ([#43719](https://github.com/expo/expo/pull/43719) by [@benjaminkomen](https://github.com/benjaminkomen))
|
|
@@ -86,6 +96,9 @@ _This version does not introduce any user-facing changes._
|
|
|
86
96
|
- [Android] Added border color customization for `Switch` and `Checkbox` components. ([#43770](https://github.com/expo/expo/pull/43770) by [@liestig](https://github.com/liestig))
|
|
87
97
|
- [iOS] Added `defaultScrollAnchor` modifier for controlling initial scroll position (iOS 17+). ([#43914](https://github.com/expo/expo/pull/43914) by [@ramonclaudio](https://github.com/ramonclaudio))
|
|
88
98
|
- [iOS] Added `defaultScrollAnchorForRole` modifier for per-role scroll anchor control (iOS 18+). ([#43923](https://github.com/expo/expo/pull/43923) by [@ramonclaudio](https://github.com/ramonclaudio))
|
|
99
|
+
- [iOS] Added `scrollTargetBehavior` and `scrollTargetLayout` modifiers for scroll target configuration (iOS 17+). ([#43955](https://github.com/expo/expo/pull/43955) by [@ramonclaudio](https://github.com/ramonclaudio))
|
|
100
|
+
- [iOS] Added `textInputAutocapitalization` modifier for controlling keyboard autocapitalization behavior (iOS 15+). ([#44547](https://github.com/expo/expo/pull/44547) by [@ramonclaudio](https://github.com/ramonclaudio))
|
|
101
|
+
- [iOS] Added `textContentType` modifier for enabling autofill and semantic text input hints (iOS 13+). ([#44548](https://github.com/expo/expo/pull/44548) by [@ramonclaudio](https://github.com/ramonclaudio))
|
|
89
102
|
- [iOS] Added `rotation3DEffect` modifier for 3D rotation transforms ([#43640](https://github.com/expo/expo/pull/43640) by [@vonovak](https://github.com/vonovak))
|
|
90
103
|
- [iOS] Added `ControlGroup` component. ([#43581](https://github.com/expo/expo/pull/43581) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
91
104
|
- [android] detect FAB in HorizontalFloatingToolbar ([#43601](https://github.com/expo/expo/pull/43601) by [@Ubax](https://github.com/Ubax))
|
package/android/build.gradle
CHANGED
|
@@ -12,13 +12,13 @@ apply plugin: 'expo-module-gradle-plugin'
|
|
|
12
12
|
apply plugin: 'org.jetbrains.kotlin.plugin.compose'
|
|
13
13
|
|
|
14
14
|
group = 'expo.modules.ui'
|
|
15
|
-
version = '55.0.
|
|
15
|
+
version = '55.0.10'
|
|
16
16
|
|
|
17
17
|
android {
|
|
18
18
|
namespace "expo.modules.ui"
|
|
19
19
|
defaultConfig {
|
|
20
20
|
versionCode 1
|
|
21
|
-
versionName "55.0.
|
|
21
|
+
versionName "55.0.10"
|
|
22
22
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
23
23
|
}
|
|
24
24
|
buildFeatures {
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
package expo.modules.ui
|
|
2
|
+
|
|
3
|
+
import android.graphics.Color
|
|
4
|
+
import androidx.compose.foundation.layout.Box
|
|
5
|
+
import androidx.compose.material3.Badge
|
|
6
|
+
import androidx.compose.material3.BadgeDefaults
|
|
7
|
+
import androidx.compose.material3.contentColorFor
|
|
8
|
+
import androidx.compose.runtime.Composable
|
|
9
|
+
import androidx.compose.ui.Alignment
|
|
10
|
+
import androidx.compose.ui.Modifier
|
|
11
|
+
import androidx.compose.ui.layout.layout
|
|
12
|
+
import androidx.compose.ui.unit.dp
|
|
13
|
+
import androidx.core.view.size
|
|
14
|
+
import expo.modules.kotlin.views.ComposableScope
|
|
15
|
+
import expo.modules.kotlin.views.ComposeProps
|
|
16
|
+
import expo.modules.kotlin.views.FunctionalComposableScope
|
|
17
|
+
|
|
18
|
+
data class BadgeProps(
|
|
19
|
+
val containerColor: Color? = null,
|
|
20
|
+
val contentColor: Color? = null,
|
|
21
|
+
val modifiers: ModifierList = emptyList()
|
|
22
|
+
) : ComposeProps
|
|
23
|
+
|
|
24
|
+
@Composable
|
|
25
|
+
fun FunctionalComposableScope.BadgeContent(props: BadgeProps) {
|
|
26
|
+
val resolvedContainerColor = props.containerColor.composeOrNull ?: BadgeDefaults.containerColor
|
|
27
|
+
val modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)
|
|
28
|
+
|
|
29
|
+
if (view.size > 0) {
|
|
30
|
+
Badge(
|
|
31
|
+
modifier = modifier,
|
|
32
|
+
containerColor = resolvedContainerColor,
|
|
33
|
+
contentColor = props.contentColor.composeOrNull ?: contentColorFor(resolvedContainerColor)
|
|
34
|
+
) {
|
|
35
|
+
Box(
|
|
36
|
+
modifier = Modifier.ensureBadgeContentCircular(),
|
|
37
|
+
contentAlignment = Alignment.Center
|
|
38
|
+
) {
|
|
39
|
+
Children(ComposableScope())
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
} else {
|
|
43
|
+
// No content lambda → renders as small 6dp dot per M3 spec
|
|
44
|
+
Badge(
|
|
45
|
+
modifier = modifier,
|
|
46
|
+
containerColor = resolvedContainerColor
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Layout modifier that sizes the Badge content so the Badge renders as a circle
|
|
53
|
+
* for narrow content (single digits). Badge internally adds 4dp horizontal padding
|
|
54
|
+
* on each side (8dp total) but no vertical padding. To make the Badge square
|
|
55
|
+
* (and thus circular with CornerFull shape), the content width must be
|
|
56
|
+
* `height - totalHorizontalPadding`. For wide content (e.g. "999+"), the natural
|
|
57
|
+
* width is used, producing a pill shape.
|
|
58
|
+
*
|
|
59
|
+
* This is a workaround for Compose Badge becoming oval at font scales > 1.0.
|
|
60
|
+
* @see: https://issuetracker.google.com/issues/365493087
|
|
61
|
+
*/
|
|
62
|
+
private fun Modifier.ensureBadgeContentCircular() = layout { measurable, constraints ->
|
|
63
|
+
val placeable = measurable.measure(constraints)
|
|
64
|
+
// Badge adds 4dp padding on each side = 8dp total horizontal padding
|
|
65
|
+
val targetWidth = placeable.height - BadgeHorizontalPaddingTotal.roundToPx()
|
|
66
|
+
val width = maxOf(placeable.width, targetWidth)
|
|
67
|
+
layout(width, placeable.height) {
|
|
68
|
+
placeable.placeRelative((width - placeable.width) / 2, 0)
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Badge internal horizontal padding: 4dp per side = 8dp total
|
|
73
|
+
// (BadgeWithContentHorizontalPadding is internal in Material 3)
|
|
74
|
+
private val BadgeHorizontalPaddingTotal = 8.dp
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
package expo.modules.ui
|
|
2
|
+
|
|
3
|
+
import androidx.compose.material3.Badge
|
|
4
|
+
import androidx.compose.material3.BadgedBox
|
|
5
|
+
import androidx.compose.runtime.Composable
|
|
6
|
+
import expo.modules.kotlin.views.ComposableScope
|
|
7
|
+
import expo.modules.kotlin.views.ComposeProps
|
|
8
|
+
import expo.modules.kotlin.views.FunctionalComposableScope
|
|
9
|
+
|
|
10
|
+
data class BadgedBoxProps(
|
|
11
|
+
val modifiers: ModifierList = emptyList()
|
|
12
|
+
) : ComposeProps
|
|
13
|
+
|
|
14
|
+
@Composable
|
|
15
|
+
fun FunctionalComposableScope.BadgedBoxContent(props: BadgedBoxProps) {
|
|
16
|
+
val badgeSlot = findChildSlotView(view, "badge")
|
|
17
|
+
|
|
18
|
+
BadgedBox(
|
|
19
|
+
badge = { badgeSlot?.renderSlot() ?: Badge() },
|
|
20
|
+
modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)
|
|
21
|
+
) {
|
|
22
|
+
Children(ComposableScope()) { !isSlotView(it) }
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -407,6 +407,14 @@ class ExpoUIModule : Module() {
|
|
|
407
407
|
ListItemContent(props)
|
|
408
408
|
}
|
|
409
409
|
|
|
410
|
+
ExpoUIView("BadgeView") { props: BadgeProps ->
|
|
411
|
+
BadgeContent(props)
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
ExpoUIView("BadgedBoxView") { props: BadgedBoxProps ->
|
|
415
|
+
BadgedBoxContent(props)
|
|
416
|
+
}
|
|
417
|
+
|
|
410
418
|
ExpoUIView("SpacerView") { props: SpacerProps ->
|
|
411
419
|
SpacerContent(props)
|
|
412
420
|
}
|
|
@@ -430,6 +438,19 @@ class ExpoUIModule : Module() {
|
|
|
430
438
|
AnimatedVisibilityContent(props)
|
|
431
439
|
}
|
|
432
440
|
|
|
441
|
+
// Class-based views so TooltipBoxView can detect them by type via findChildOfType
|
|
442
|
+
View(PlainTooltipView::class)
|
|
443
|
+
View(RichTooltipView::class)
|
|
444
|
+
|
|
445
|
+
View(TooltipBoxView::class) {
|
|
446
|
+
AsyncFunction("show") Coroutine { view: TooltipBoxView ->
|
|
447
|
+
view.show()
|
|
448
|
+
}
|
|
449
|
+
AsyncFunction("dismiss") Coroutine { view: TooltipBoxView ->
|
|
450
|
+
view.dismiss()
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
433
454
|
ExpoUIView("RadioButtonView", events = {
|
|
434
455
|
Events("onButtonPressed")
|
|
435
456
|
}) { props: RadioButtonProps ->
|
|
@@ -59,3 +59,11 @@ fun findChildSlotView(viewGroup: ViewGroup, slotName: String): SlotView? {
|
|
|
59
59
|
}
|
|
60
60
|
return null
|
|
61
61
|
}
|
|
62
|
+
|
|
63
|
+
inline fun <reified T> findChildOfType(viewGroup: ViewGroup): T? {
|
|
64
|
+
for (index in 0..<viewGroup.size) {
|
|
65
|
+
val child = viewGroup.getChildAt(index)
|
|
66
|
+
if (child is T) return child
|
|
67
|
+
}
|
|
68
|
+
return null
|
|
69
|
+
}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
@file:OptIn(ExperimentalMaterial3Api::class)
|
|
2
|
+
|
|
3
|
+
package expo.modules.ui
|
|
4
|
+
|
|
5
|
+
import android.annotation.SuppressLint
|
|
6
|
+
import android.content.Context
|
|
7
|
+
import android.graphics.Color
|
|
8
|
+
import androidx.compose.material3.ExperimentalMaterial3Api
|
|
9
|
+
import androidx.compose.material3.PlainTooltip
|
|
10
|
+
import androidx.compose.material3.RichTooltip
|
|
11
|
+
import androidx.compose.material3.TooltipBox
|
|
12
|
+
import androidx.compose.material3.TooltipDefaults
|
|
13
|
+
import androidx.compose.material3.TooltipState
|
|
14
|
+
import androidx.compose.material3.rememberTooltipState
|
|
15
|
+
import androidx.compose.runtime.Composable
|
|
16
|
+
import androidx.compose.runtime.mutableStateOf
|
|
17
|
+
import androidx.compose.runtime.MutableState
|
|
18
|
+
import androidx.compose.runtime.rememberCoroutineScope
|
|
19
|
+
import kotlin.coroutines.cancellation.CancellationException
|
|
20
|
+
import kotlinx.coroutines.CoroutineScope
|
|
21
|
+
import kotlinx.coroutines.withContext
|
|
22
|
+
import expo.modules.kotlin.AppContext
|
|
23
|
+
import expo.modules.kotlin.views.ComposableScope
|
|
24
|
+
import expo.modules.kotlin.views.ComposeProps
|
|
25
|
+
import expo.modules.kotlin.views.ExpoComposeView
|
|
26
|
+
|
|
27
|
+
// --- PlainTooltipView ---
|
|
28
|
+
|
|
29
|
+
data class PlainTooltipViewProps(
|
|
30
|
+
val containerColor: MutableState<Color?> = mutableStateOf(null),
|
|
31
|
+
val contentColor: MutableState<Color?> = mutableStateOf(null),
|
|
32
|
+
val modifiers: MutableState<ModifierList> = mutableStateOf(emptyList())
|
|
33
|
+
) : ComposeProps
|
|
34
|
+
|
|
35
|
+
@SuppressLint("ViewConstructor")
|
|
36
|
+
class PlainTooltipView(context: Context, appContext: AppContext) :
|
|
37
|
+
ExpoComposeView<PlainTooltipViewProps>(context, appContext) {
|
|
38
|
+
override val props = PlainTooltipViewProps()
|
|
39
|
+
|
|
40
|
+
@Composable
|
|
41
|
+
override fun ComposableScope.Content() {
|
|
42
|
+
Children(this)
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// --- RichTooltipView ---
|
|
47
|
+
|
|
48
|
+
data class RichTooltipViewProps(
|
|
49
|
+
val containerColor: MutableState<Color?> = mutableStateOf(null),
|
|
50
|
+
val contentColor: MutableState<Color?> = mutableStateOf(null),
|
|
51
|
+
val titleContentColor: MutableState<Color?> = mutableStateOf(null),
|
|
52
|
+
val actionContentColor: MutableState<Color?> = mutableStateOf(null),
|
|
53
|
+
val modifiers: MutableState<ModifierList> = mutableStateOf(emptyList())
|
|
54
|
+
) : ComposeProps
|
|
55
|
+
|
|
56
|
+
@SuppressLint("ViewConstructor")
|
|
57
|
+
class RichTooltipView(context: Context, appContext: AppContext) :
|
|
58
|
+
ExpoComposeView<RichTooltipViewProps>(context, appContext) {
|
|
59
|
+
override val props = RichTooltipViewProps()
|
|
60
|
+
|
|
61
|
+
@Composable
|
|
62
|
+
override fun ComposableScope.Content() {
|
|
63
|
+
Children(this)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// --- TooltipBoxView ---
|
|
68
|
+
|
|
69
|
+
data class TooltipBoxViewProps(
|
|
70
|
+
val isPersistent: MutableState<Boolean> = mutableStateOf(false),
|
|
71
|
+
val hasAction: MutableState<Boolean?> = mutableStateOf(null),
|
|
72
|
+
val enableUserInput: MutableState<Boolean> = mutableStateOf(true),
|
|
73
|
+
val focusable: MutableState<Boolean> = mutableStateOf(false),
|
|
74
|
+
val modifiers: MutableState<ModifierList> = mutableStateOf(emptyList())
|
|
75
|
+
) : ComposeProps
|
|
76
|
+
|
|
77
|
+
@SuppressLint("ViewConstructor")
|
|
78
|
+
class TooltipBoxView(context: Context, appContext: AppContext) :
|
|
79
|
+
ExpoComposeView<TooltipBoxViewProps>(context, appContext) {
|
|
80
|
+
override val props = TooltipBoxViewProps()
|
|
81
|
+
internal var tooltipState: TooltipState? = null
|
|
82
|
+
private var composeScope: CoroutineScope? = null
|
|
83
|
+
|
|
84
|
+
suspend fun show() {
|
|
85
|
+
val scope = composeScope ?: return
|
|
86
|
+
val state = tooltipState ?: return
|
|
87
|
+
try {
|
|
88
|
+
withContext(scope.coroutineContext) {
|
|
89
|
+
state.show()
|
|
90
|
+
}
|
|
91
|
+
} catch (_: CancellationException) {
|
|
92
|
+
// Can occur if the compose scope is cancelled (view disposed) or if a
|
|
93
|
+
// competing show/dismiss call cancels this one. Safe to ignore in both cases.
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
suspend fun dismiss() {
|
|
98
|
+
val scope = composeScope ?: return
|
|
99
|
+
val state = tooltipState ?: return
|
|
100
|
+
try {
|
|
101
|
+
withContext(scope.coroutineContext) {
|
|
102
|
+
state.dismiss()
|
|
103
|
+
}
|
|
104
|
+
} catch (_: CancellationException) {
|
|
105
|
+
// Can occur if the compose scope is cancelled (view disposed) or if a
|
|
106
|
+
// competing show/dismiss call cancels this one. Safe to ignore in both cases.
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@Composable
|
|
111
|
+
override fun ComposableScope.Content() {
|
|
112
|
+
val tooltipSlotView = findChildSlotView(this@TooltipBoxView, "tooltip")
|
|
113
|
+
val plainTooltipView = tooltipSlotView?.let { findChildOfType<PlainTooltipView>(it) }
|
|
114
|
+
val richTooltipView = tooltipSlotView?.let { findChildOfType<RichTooltipView>(it) }
|
|
115
|
+
|
|
116
|
+
val tooltipState = rememberTooltipState(isPersistent = props.isPersistent.value)
|
|
117
|
+
val scope = rememberCoroutineScope()
|
|
118
|
+
this@TooltipBoxView.tooltipState = tooltipState
|
|
119
|
+
this@TooltipBoxView.composeScope = scope
|
|
120
|
+
|
|
121
|
+
val actionSlotView = richTooltipView?.let { findChildSlotView(it, "action") }
|
|
122
|
+
val hasAction = props.hasAction.value ?: (actionSlotView != null)
|
|
123
|
+
|
|
124
|
+
val positionProvider = if (richTooltipView != null) {
|
|
125
|
+
TooltipDefaults.rememberRichTooltipPositionProvider()
|
|
126
|
+
} else {
|
|
127
|
+
TooltipDefaults.rememberPlainTooltipPositionProvider()
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
TooltipBox(
|
|
131
|
+
positionProvider = positionProvider,
|
|
132
|
+
enableUserInput = props.enableUserInput.value,
|
|
133
|
+
focusable = props.focusable.value,
|
|
134
|
+
hasAction = hasAction,
|
|
135
|
+
tooltip = {
|
|
136
|
+
if (plainTooltipView != null) {
|
|
137
|
+
PlainTooltip(
|
|
138
|
+
containerColor = plainTooltipView.props.containerColor.value.composeOrNull
|
|
139
|
+
?: TooltipDefaults.plainTooltipContainerColor,
|
|
140
|
+
contentColor = plainTooltipView.props.contentColor.value.composeOrNull
|
|
141
|
+
?: TooltipDefaults.plainTooltipContentColor,
|
|
142
|
+
modifier = ModifierRegistry.applyModifiers(plainTooltipView.props.modifiers.value, appContext, this@Content, globalEventDispatcher)
|
|
143
|
+
) {
|
|
144
|
+
with(ComposableScope()) { with(plainTooltipView) { Content() } }
|
|
145
|
+
}
|
|
146
|
+
} else if (richTooltipView != null) {
|
|
147
|
+
val titleSlotView = findChildSlotView(richTooltipView, "title")
|
|
148
|
+
val textSlotView = findChildSlotView(richTooltipView, "text")
|
|
149
|
+
val defaultColors = TooltipDefaults.richTooltipColors()
|
|
150
|
+
|
|
151
|
+
RichTooltip(
|
|
152
|
+
title = titleSlotView?.let { { it.renderSlot() } },
|
|
153
|
+
action = actionSlotView?.let { { it.renderSlot() } },
|
|
154
|
+
colors = TooltipDefaults.richTooltipColors(
|
|
155
|
+
containerColor = richTooltipView.props.containerColor.value.composeOrNull
|
|
156
|
+
?: defaultColors.containerColor,
|
|
157
|
+
contentColor = richTooltipView.props.contentColor.value.composeOrNull
|
|
158
|
+
?: defaultColors.contentColor,
|
|
159
|
+
titleContentColor = richTooltipView.props.titleContentColor.value.composeOrNull
|
|
160
|
+
?: defaultColors.titleContentColor,
|
|
161
|
+
actionContentColor = richTooltipView.props.actionContentColor.value.composeOrNull
|
|
162
|
+
?: defaultColors.actionContentColor
|
|
163
|
+
),
|
|
164
|
+
modifier = ModifierRegistry.applyModifiers(richTooltipView.props.modifiers.value, appContext, this@Content, globalEventDispatcher)
|
|
165
|
+
) {
|
|
166
|
+
textSlotView?.renderSlot()
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
state = tooltipState,
|
|
171
|
+
modifier = ModifierRegistry.applyModifiers(props.modifiers.value, appContext, this@Content, globalEventDispatcher)
|
|
172
|
+
) {
|
|
173
|
+
Children(ComposableScope(), filter = { !isSlotView(it) })
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ColorValue } from 'react-native';
|
|
2
|
+
import { type ModifierConfig } from '../../types';
|
|
3
|
+
export type BadgeProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Background color of the badge.
|
|
6
|
+
* @default BadgeDefaults.containerColor
|
|
7
|
+
*/
|
|
8
|
+
containerColor?: ColorValue;
|
|
9
|
+
/**
|
|
10
|
+
* Content color inside the badge (text/icon tint).
|
|
11
|
+
* @default BadgeDefaults.contentColor
|
|
12
|
+
*/
|
|
13
|
+
contentColor?: ColorValue;
|
|
14
|
+
/**
|
|
15
|
+
* Modifiers for the component.
|
|
16
|
+
*/
|
|
17
|
+
modifiers?: ModifierConfig[];
|
|
18
|
+
/**
|
|
19
|
+
* Optional content inside the badge (for example, a `Text` with a count).
|
|
20
|
+
* When omitted, renders as a small indicator dot.
|
|
21
|
+
*/
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* A badge component matching Compose's `Badge`.
|
|
26
|
+
* Renders as a small colored indicator dot, or with content (for example, a count).
|
|
27
|
+
*
|
|
28
|
+
* @see [Jetpack Compose Badge](https://developer.android.com/develop/ui/compose/components/badges)
|
|
29
|
+
*/
|
|
30
|
+
export declare function Badge(props: BadgeProps): import("react").JSX.Element;
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/Badge/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,MAAM,MAAM,UAAU,GAAG;IACvB;;;OAGG;IACH,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B;;;OAGG;IACH,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAaF;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,+BAGtC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type ModifierConfig } from '../../types';
|
|
2
|
+
export type BadgedBoxProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Modifiers for the component.
|
|
5
|
+
*/
|
|
6
|
+
modifiers?: ModifierConfig[];
|
|
7
|
+
/**
|
|
8
|
+
* Children containing the main content and a `BadgedBox.Badge` slot.
|
|
9
|
+
*/
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Slot for the badge overlay. Place a `Badge` component inside.
|
|
14
|
+
*/
|
|
15
|
+
declare function BadgeSlot(props: {
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
/**
|
|
19
|
+
* A badged box matching Compose's `BadgedBox`.
|
|
20
|
+
* Overlays a badge on top of content (for example, an icon).
|
|
21
|
+
*
|
|
22
|
+
* @see [Jetpack Compose BadgedBox](https://developer.android.com/develop/ui/compose/components/badges)
|
|
23
|
+
*/
|
|
24
|
+
declare function BadgedBoxComponent(props: BadgedBoxProps): import("react").JSX.Element;
|
|
25
|
+
declare namespace BadgedBoxComponent {
|
|
26
|
+
var Badge: typeof BadgeSlot;
|
|
27
|
+
}
|
|
28
|
+
export { BadgedBoxComponent as BadgedBox };
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/BadgedBox/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;IAC7B;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAuBF;;GAEG;AACH,iBAAS,SAAS,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,+BAEtD;AAED;;;;;GAKG;AACH,iBAAS,kBAAkB,CAAC,KAAK,EAAE,cAAc,+BAGhD;kBAHQ,kBAAkB;;;AAO3B,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { type Ref } from 'react';
|
|
2
|
+
import { type ColorValue } from 'react-native';
|
|
3
|
+
import { type ModifierConfig } from '../../types';
|
|
4
|
+
export type TooltipBoxRef = {
|
|
5
|
+
/**
|
|
6
|
+
* Programmatically shows the tooltip.
|
|
7
|
+
*/
|
|
8
|
+
show: () => Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* Programmatically dismisses the tooltip.
|
|
11
|
+
*/
|
|
12
|
+
dismiss: () => Promise<void>;
|
|
13
|
+
};
|
|
14
|
+
export type TooltipBoxProps = {
|
|
15
|
+
/**
|
|
16
|
+
* Ref to imperatively show/dismiss the tooltip.
|
|
17
|
+
*/
|
|
18
|
+
ref?: Ref<TooltipBoxRef>;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the tooltip persists instead of auto-dismissing after a short timeout.
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
isPersistent?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Whether the tooltip contains an action. Affects accessibility and dismiss behavior.
|
|
26
|
+
* When not specified, this is automatically derived from the presence of a `RichTooltip.Action` slot.
|
|
27
|
+
*/
|
|
28
|
+
hasAction?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Whether user input (long-press, hover) triggers the tooltip.
|
|
31
|
+
* @default true
|
|
32
|
+
*/
|
|
33
|
+
enableUserInput?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Whether the tooltip popup is focusable.
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
focusable?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Modifiers for the component.
|
|
41
|
+
*/
|
|
42
|
+
modifiers?: ModifierConfig[];
|
|
43
|
+
/**
|
|
44
|
+
* Children containing a `TooltipBox.PlainTooltip` or `TooltipBox.RichTooltip` slot and the anchor/trigger content.
|
|
45
|
+
* The anchor content triggers the tooltip on long-press.
|
|
46
|
+
*/
|
|
47
|
+
children: React.ReactNode;
|
|
48
|
+
};
|
|
49
|
+
export type PlainTooltipProps = {
|
|
50
|
+
containerColor?: ColorValue;
|
|
51
|
+
contentColor?: ColorValue;
|
|
52
|
+
modifiers?: ModifierConfig[];
|
|
53
|
+
children: React.ReactNode;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* A simple tooltip. Place inside `TooltipBox` as `TooltipBox.PlainTooltip`.
|
|
57
|
+
* Children become the tooltip content.
|
|
58
|
+
*/
|
|
59
|
+
declare function PlainTooltipComponent(props: PlainTooltipProps): import("react").JSX.Element;
|
|
60
|
+
export type RichTooltipProps = {
|
|
61
|
+
containerColor?: ColorValue;
|
|
62
|
+
contentColor?: ColorValue;
|
|
63
|
+
titleContentColor?: ColorValue;
|
|
64
|
+
actionContentColor?: ColorValue;
|
|
65
|
+
modifiers?: ModifierConfig[];
|
|
66
|
+
children: React.ReactNode;
|
|
67
|
+
};
|
|
68
|
+
declare function RichTooltipTitle(props: {
|
|
69
|
+
children: React.ReactNode;
|
|
70
|
+
}): import("react").JSX.Element;
|
|
71
|
+
declare function RichTooltipText(props: {
|
|
72
|
+
children: React.ReactNode;
|
|
73
|
+
}): import("react").JSX.Element;
|
|
74
|
+
declare function RichTooltipAction(props: {
|
|
75
|
+
children: React.ReactNode;
|
|
76
|
+
}): import("react").JSX.Element;
|
|
77
|
+
/**
|
|
78
|
+
* A detailed tooltip with optional title, body text, and action. Place inside `TooltipBox` as `TooltipBox.RichTooltip`.
|
|
79
|
+
* Content is provided via sub-components: `TooltipBox.RichTooltip.Title`, `TooltipBox.RichTooltip.Text`, `TooltipBox.RichTooltip.Action`.
|
|
80
|
+
*/
|
|
81
|
+
declare function RichTooltipComponent(props: RichTooltipProps): import("react").JSX.Element;
|
|
82
|
+
declare namespace RichTooltipComponent {
|
|
83
|
+
var Title: typeof RichTooltipTitle;
|
|
84
|
+
var Text: typeof RichTooltipText;
|
|
85
|
+
var Action: typeof RichTooltipAction;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* A container that wraps anchor content and shows a tooltip on long-press.
|
|
89
|
+
* Provide the tooltip content via `TooltipBox.PlainTooltip` or `TooltipBox.RichTooltip`.
|
|
90
|
+
* All other children are the anchor/trigger.
|
|
91
|
+
*
|
|
92
|
+
* Use `ref` to imperatively `show()` or `dismiss()` the tooltip.
|
|
93
|
+
*/
|
|
94
|
+
declare function TooltipBoxComponent(props: TooltipBoxProps): import("react").JSX.Element;
|
|
95
|
+
declare namespace TooltipBoxComponent {
|
|
96
|
+
var PlainTooltip: typeof PlainTooltipComponent;
|
|
97
|
+
var RichTooltip: typeof RichTooltipComponent;
|
|
98
|
+
}
|
|
99
|
+
export { TooltipBoxComponent as TooltipBox };
|
|
100
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/Tooltip/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B;;OAEG;IACH,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC;IACzB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;IAC7B;;;OAGG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AA0BF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAOF;;;GAGG;AACH,iBAAS,qBAAqB,CAAC,KAAK,EAAE,iBAAiB,+BAYtD;AAID,MAAM,MAAM,gBAAgB,GAAG;IAC7B,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC/B,kBAAkB,CAAC,EAAE,UAAU,CAAC;IAChC,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAOF,iBAAS,gBAAgB,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,+BAE7D;AAED,iBAAS,eAAe,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,+BAE5D;AAED,iBAAS,iBAAiB,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,+BAE9D;AAED;;;GAGG;AACH,iBAAS,oBAAoB,CAAC,KAAK,EAAE,gBAAgB,+BAYpD;kBAZQ,oBAAoB;;;;;AAoB7B;;;;;;GAMG;AACH,iBAAS,mBAAmB,CAAC,KAAK,EAAE,eAAe,+BAGlD;kBAHQ,mBAAmB;;;;AAQ5B,OAAO,EAAE,mBAAmB,IAAI,UAAU,EAAE,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import './MaterialSymbolsAssetsTransformer.fx';
|
|
2
2
|
export * from './AlertDialog';
|
|
3
|
+
export * from './Badge';
|
|
4
|
+
export * from './BadgedBox';
|
|
3
5
|
export { BasicAlertDialog, type BasicAlertDialogProps } from './BasicAlertDialog';
|
|
4
6
|
export * from './Card';
|
|
5
7
|
export * from './Checkbox';
|
|
@@ -32,6 +34,7 @@ export * from './PullToRefreshBox';
|
|
|
32
34
|
export * from './RadioButton';
|
|
33
35
|
export * from './Surface';
|
|
34
36
|
export { type TextProps, Text } from './Text';
|
|
37
|
+
export * from './Tooltip';
|
|
35
38
|
export * from './AnimatedVisibility';
|
|
36
39
|
export * from './Box';
|
|
37
40
|
export * from './Row';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/jetpack-compose/index.ts"],"names":[],"mappings":"AAAA,OAAO,uCAAuC,CAAC;AAE/C,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAClF,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,KAAK,SAAS,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/jetpack-compose/index.ts"],"names":[],"mappings":"AAAA,OAAO,uCAAuC,CAAC;AAE/C,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAClF,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,KAAK,SAAS,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9C,cAAc,WAAW,CAAC;AAE1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -476,6 +476,21 @@ export declare const defaultScrollAnchor: (anchor: UnitPointValue | null) => Mod
|
|
|
476
476
|
* @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/defaultscrollanchor(_:for:)).
|
|
477
477
|
*/
|
|
478
478
|
export declare const defaultScrollAnchorForRole: (anchor: UnitPointValue | null, role: "initialOffset" | "sizeChanges" | "alignment") => ModifierConfig;
|
|
479
|
+
/**
|
|
480
|
+
* Sets the scroll snapping behavior for scrollable views.
|
|
481
|
+
* Use with `scrollTargetLayout` on the content container.
|
|
482
|
+
* @param behavior - `'paging'` for container-aligned snapping, `'viewAligned'` for view-aligned snapping.
|
|
483
|
+
* @platform ios 17.0+
|
|
484
|
+
* @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/scrolltargetbehavior(_:)).
|
|
485
|
+
*/
|
|
486
|
+
export declare const scrollTargetBehavior: (behavior: "paging" | "viewAligned") => ModifierConfig;
|
|
487
|
+
/**
|
|
488
|
+
* Configures a layout container as a scroll target layout for view-aligned snapping.
|
|
489
|
+
* Apply to `VStack` or `HStack` inside a `ScrollView`.
|
|
490
|
+
* @platform ios 17.0+
|
|
491
|
+
* @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/scrolltargetlayout(isenabled:)).
|
|
492
|
+
*/
|
|
493
|
+
export declare const scrollTargetLayout: () => ModifierConfig;
|
|
479
494
|
/**
|
|
480
495
|
* Disables the move action for a view in a list.
|
|
481
496
|
* Apply to items within a `ForEach` to prevent them from being moved.
|
|
@@ -812,6 +827,21 @@ export declare const gridCellAnchor: (anchor: {
|
|
|
812
827
|
* ```
|
|
813
828
|
*/
|
|
814
829
|
export declare const submitLabel: (submitLabel: "continue" | "done" | "go" | "join" | "next" | "return" | "route" | "search" | "send") => ModifierConfig;
|
|
830
|
+
/**
|
|
831
|
+
* Sets how often the shift key in the keyboard is automatically enabled.
|
|
832
|
+
* @param autocapitalization - The autocapitalization behavior.
|
|
833
|
+
* @platform ios 15.0+
|
|
834
|
+
* @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/textinputautocapitalization(_:)).
|
|
835
|
+
*/
|
|
836
|
+
export declare const textInputAutocapitalization: (autocapitalization: "never" | "words" | "sentences" | "characters") => ModifierConfig;
|
|
837
|
+
/**
|
|
838
|
+
* Sets the text content type for input text, which the system uses to offer
|
|
839
|
+
* suggestions (like autofill) while the user enters text.
|
|
840
|
+
* @param textContentType - The semantic meaning of the text input area.
|
|
841
|
+
* @platform ios 13.0+
|
|
842
|
+
* @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/textcontenttype(_:)-ufdv).
|
|
843
|
+
*/
|
|
844
|
+
export declare const textContentType: (textContentType: "URL" | "namePrefix" | "name" | "nameSuffix" | "givenName" | "middleName" | "familyName" | "nickname" | "organizationName" | "jobTitle" | "location" | "fullStreetAddress" | "streetAddressLine1" | "streetAddressLine2" | "addressCity" | "addressCityAndState" | "addressState" | "postalCode" | "sublocality" | "countryName" | "username" | "password" | "newPassword" | "oneTimeCode" | "emailAddress" | "telephoneNumber" | "cellularEID" | "cellularIMEI" | "creditCardNumber" | "creditCardExpiration" | "creditCardExpirationMonth" | "creditCardExpirationYear" | "creditCardSecurityCode" | "creditCardType" | "creditCardName" | "creditCardGivenName" | "creditCardMiddleName" | "creditCardFamilyName" | "birthdate" | "birthdateDay" | "birthdateMonth" | "birthdateYear" | "dateTime" | "flightNumber" | "shipmentTrackingNumber") => ModifierConfig;
|
|
815
845
|
/**
|
|
816
846
|
* Sets the content transition type for a view.
|
|
817
847
|
* Useful for animating changes in text content, especially numeric text.
|
|
@@ -864,7 +894,7 @@ export declare const resizable: (capInsets?: {
|
|
|
864
894
|
* This provides type safety for the modifiers array.
|
|
865
895
|
* @hidden
|
|
866
896
|
*/
|
|
867
|
-
export type BuiltInModifier = ReturnType<typeof listSectionSpacing> | ReturnType<typeof background> | ReturnType<typeof cornerRadius> | ReturnType<typeof shadow> | ReturnType<typeof frame> | ReturnType<typeof padding> | ReturnType<typeof fixedSize> | ReturnType<typeof ignoreSafeArea> | ReturnType<typeof onTapGesture> | ReturnType<typeof onLongPressGesture> | ReturnType<typeof onAppear> | ReturnType<typeof luminanceToAlpha> | ReturnType<typeof onDisappear> | ReturnType<typeof opacity> | ReturnType<typeof clipShape> | ReturnType<typeof border> | ReturnType<typeof scaleEffect> | ReturnType<typeof rotationEffect> | ReturnType<typeof rotation3DEffect> | ReturnType<typeof offset> | ReturnType<typeof foregroundColor> | ReturnType<typeof foregroundStyle> | ReturnType<typeof bold> | ReturnType<typeof italic> | ReturnType<typeof monospacedDigit> | ReturnType<typeof tint> | ReturnType<typeof hidden> | ReturnType<typeof disabled> | ReturnType<typeof zIndex> | ReturnType<typeof blur> | ReturnType<typeof brightness> | ReturnType<typeof contrast> | ReturnType<typeof saturation> | ReturnType<typeof hueRotation> | ReturnType<typeof colorInvert> | ReturnType<typeof grayscale> | ReturnType<typeof buttonStyle> | ReturnType<typeof toggleStyle> | ReturnType<typeof controlSize> | ReturnType<typeof labelStyle> | ReturnType<typeof labelsHidden> | ReturnType<typeof textFieldStyle> | ReturnType<typeof menuActionDismissBehavior> | ReturnType<typeof accessibilityLabel> | ReturnType<typeof accessibilityHint> | ReturnType<typeof accessibilityValue> | ReturnType<typeof layoutPriority> | ReturnType<typeof mask> | ReturnType<typeof overlay> | ReturnType<typeof backgroundOverlay> | ReturnType<typeof aspectRatio> | ReturnType<typeof clipped> | ReturnType<typeof glassEffect> | ReturnType<typeof glassEffectId> | ReturnType<typeof animation> | ReturnType<typeof containerShape> | ReturnType<typeof contentShape> | ReturnType<typeof containerRelativeFrame> | ReturnType<typeof scrollContentBackground> | ReturnType<typeof scrollDisabled> | ReturnType<typeof defaultScrollAnchor> | ReturnType<typeof defaultScrollAnchorForRole> | ReturnType<typeof moveDisabled> | ReturnType<typeof deleteDisabled> | ReturnType<typeof environment> | ReturnType<typeof listRowBackground> | ReturnType<typeof listRowSeparator> | ReturnType<typeof truncationMode> | ReturnType<typeof allowsTightening> | ReturnType<typeof kerning> | ReturnType<typeof textCase> | ReturnType<typeof underline> | ReturnType<typeof strikethrough> | ReturnType<typeof multilineTextAlignment> | ReturnType<typeof textSelection> | ReturnType<typeof lineSpacing> | ReturnType<typeof lineLimit> | ReturnType<typeof headerProminence> | ReturnType<typeof listRowInsets> | ReturnType<typeof badgeProminence> | ReturnType<typeof badge> | ReturnType<typeof listSectionMargins> | ReturnType<typeof font> | ReturnType<typeof gridCellUnsizedAxes> | ReturnType<typeof gridCellColumns> | ReturnType<typeof gridColumnAlignment> | ReturnType<typeof gridCellAnchor> | ReturnType<typeof submitLabel> | ReturnType<typeof datePickerStyle> | ReturnType<typeof progressViewStyle> | ReturnType<typeof gaugeStyle> | ReturnType<typeof listStyle> | ReturnType<typeof contentTransition> | ReturnType<typeof resizable> | ReturnType<typeof widgetAccentedRenderingMode> | ReturnType<typeof widgetURL>;
|
|
897
|
+
export type BuiltInModifier = ReturnType<typeof listSectionSpacing> | ReturnType<typeof background> | ReturnType<typeof cornerRadius> | ReturnType<typeof shadow> | ReturnType<typeof frame> | ReturnType<typeof padding> | ReturnType<typeof fixedSize> | ReturnType<typeof ignoreSafeArea> | ReturnType<typeof onTapGesture> | ReturnType<typeof onLongPressGesture> | ReturnType<typeof onAppear> | ReturnType<typeof luminanceToAlpha> | ReturnType<typeof onDisappear> | ReturnType<typeof opacity> | ReturnType<typeof clipShape> | ReturnType<typeof border> | ReturnType<typeof scaleEffect> | ReturnType<typeof rotationEffect> | ReturnType<typeof rotation3DEffect> | ReturnType<typeof offset> | ReturnType<typeof foregroundColor> | ReturnType<typeof foregroundStyle> | ReturnType<typeof bold> | ReturnType<typeof italic> | ReturnType<typeof monospacedDigit> | ReturnType<typeof tint> | ReturnType<typeof hidden> | ReturnType<typeof disabled> | ReturnType<typeof zIndex> | ReturnType<typeof blur> | ReturnType<typeof brightness> | ReturnType<typeof contrast> | ReturnType<typeof saturation> | ReturnType<typeof hueRotation> | ReturnType<typeof colorInvert> | ReturnType<typeof grayscale> | ReturnType<typeof buttonStyle> | ReturnType<typeof toggleStyle> | ReturnType<typeof controlSize> | ReturnType<typeof labelStyle> | ReturnType<typeof labelsHidden> | ReturnType<typeof textFieldStyle> | ReturnType<typeof menuActionDismissBehavior> | ReturnType<typeof accessibilityLabel> | ReturnType<typeof accessibilityHint> | ReturnType<typeof accessibilityValue> | ReturnType<typeof layoutPriority> | ReturnType<typeof mask> | ReturnType<typeof overlay> | ReturnType<typeof backgroundOverlay> | ReturnType<typeof aspectRatio> | ReturnType<typeof clipped> | ReturnType<typeof glassEffect> | ReturnType<typeof glassEffectId> | ReturnType<typeof animation> | ReturnType<typeof containerShape> | ReturnType<typeof contentShape> | ReturnType<typeof containerRelativeFrame> | ReturnType<typeof scrollContentBackground> | ReturnType<typeof scrollDisabled> | ReturnType<typeof defaultScrollAnchor> | ReturnType<typeof defaultScrollAnchorForRole> | ReturnType<typeof scrollTargetBehavior> | ReturnType<typeof scrollTargetLayout> | ReturnType<typeof moveDisabled> | ReturnType<typeof deleteDisabled> | ReturnType<typeof environment> | ReturnType<typeof listRowBackground> | ReturnType<typeof listRowSeparator> | ReturnType<typeof truncationMode> | ReturnType<typeof allowsTightening> | ReturnType<typeof kerning> | ReturnType<typeof textCase> | ReturnType<typeof underline> | ReturnType<typeof strikethrough> | ReturnType<typeof multilineTextAlignment> | ReturnType<typeof textSelection> | ReturnType<typeof lineSpacing> | ReturnType<typeof lineLimit> | ReturnType<typeof headerProminence> | ReturnType<typeof listRowInsets> | ReturnType<typeof badgeProminence> | ReturnType<typeof badge> | ReturnType<typeof listSectionMargins> | ReturnType<typeof font> | ReturnType<typeof gridCellUnsizedAxes> | ReturnType<typeof gridCellColumns> | ReturnType<typeof gridColumnAlignment> | ReturnType<typeof gridCellAnchor> | ReturnType<typeof submitLabel> | ReturnType<typeof textInputAutocapitalization> | ReturnType<typeof textContentType> | ReturnType<typeof datePickerStyle> | ReturnType<typeof progressViewStyle> | ReturnType<typeof gaugeStyle> | ReturnType<typeof listStyle> | ReturnType<typeof contentTransition> | ReturnType<typeof resizable> | ReturnType<typeof widgetAccentedRenderingMode> | ReturnType<typeof widgetURL>;
|
|
868
898
|
/**
|
|
869
899
|
* Main ViewModifier type that supports both built-in and 3rd party modifiers.
|
|
870
900
|
* 3rd party modifiers should return ModifierConfig objects with their own type strings.
|