@expo/ui 58.0.21 → 58.0.23
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 +34 -0
- package/README.md +86 -2
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/ui/ComposeViews.kt +53 -29
- package/android/src/main/java/expo/modules/ui/CompositionLocalProviderView.kt +26 -0
- package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +12 -0
- package/android/src/main/java/expo/modules/ui/HostView.kt +56 -9
- package/android/src/main/java/expo/modules/ui/MaskView.kt +3 -2
- package/android/src/main/java/expo/modules/ui/ModifierRegistry.kt +43 -13
- package/android/src/main/java/expo/modules/ui/RNHostView.kt +11 -7
- package/android/src/main/java/expo/modules/ui/SwitchView.kt +6 -1
- package/android/src/main/java/expo/modules/ui/TopAppBarView.kt +62 -0
- package/android/src/main/java/expo/modules/ui/UniversalLayout.kt +610 -0
- package/android/src/main/java/expo/modules/ui/colors/MaterialColors.kt +61 -0
- package/android/src/main/java/expo/modules/ui/state/ObservableState.kt +2 -0
- package/android/src/main/java/expo/modules/ui/state/WorkletCallback.kt +2 -0
- package/build/community/bottom-sheet/BottomSheet.ios.js +8 -3
- package/build/community/bottom-sheet/BottomSheet.ios.js.map +1 -1
- package/build/community/pager-view/PagerView.ios.js +25 -8
- package/build/community/pager-view/PagerView.ios.js.map +1 -1
- package/build/community/segmented-control/SegmentedControl.ios.js +11 -2
- package/build/community/segmented-control/SegmentedControl.ios.js.map +1 -1
- package/build/community/segmented-control/types.d.ts +5 -1
- package/build/community/segmented-control/types.js.map +1 -1
- package/build/jetpack-compose/Column/index.d.ts +5 -0
- package/build/jetpack-compose/Column/index.js.map +1 -1
- package/build/jetpack-compose/CompositionLocalProvider/index.d.ts +28 -0
- package/build/jetpack-compose/CompositionLocalProvider/index.js +15 -0
- package/build/jetpack-compose/CompositionLocalProvider/index.js.map +1 -0
- package/build/jetpack-compose/Host/index.d.ts +8 -0
- package/build/jetpack-compose/Host/index.js +38 -5
- package/build/jetpack-compose/Host/index.js.map +1 -1
- package/build/jetpack-compose/Row/index.d.ts +5 -0
- package/build/jetpack-compose/Row/index.js.map +1 -1
- package/build/jetpack-compose/Switch/index.d.ts +2 -0
- package/build/jetpack-compose/Switch/index.js +1 -0
- package/build/jetpack-compose/Switch/index.js.map +1 -1
- package/build/jetpack-compose/TopAppBar/index.d.ts +72 -0
- package/build/jetpack-compose/TopAppBar/index.js +45 -0
- package/build/jetpack-compose/TopAppBar/index.js.map +1 -0
- package/build/jetpack-compose/index.d.ts +2 -0
- package/build/jetpack-compose/index.js +2 -0
- package/build/jetpack-compose/index.js.map +1 -1
- package/build/jetpack-compose/modifiers/index.d.ts +5 -1
- package/build/jetpack-compose/modifiers/index.js +6 -2
- package/build/jetpack-compose/modifiers/index.js.map +1 -1
- package/build/recycling/useRecycledRows.d.ts +2 -0
- package/build/recycling/useRecycledRows.js +1 -0
- package/build/recycling/useRecycledRows.js.map +1 -1
- package/build/swift-ui/BottomSheet/index.d.ts +6 -0
- package/build/swift-ui/BottomSheet/index.js +9 -3
- package/build/swift-ui/BottomSheet/index.js.map +1 -1
- package/build/swift-ui/HStack/index.d.ts +6 -0
- package/build/swift-ui/HStack/index.js.map +1 -1
- package/build/swift-ui/VStack/index.d.ts +6 -0
- package/build/swift-ui/VStack/index.js.map +1 -1
- package/build/universal/Button/index.android.js +3 -1
- package/build/universal/Button/index.android.js.map +1 -1
- package/build/universal/Button/index.ios.js +3 -1
- package/build/universal/Button/index.ios.js.map +1 -1
- package/build/universal/Checkbox/index.android.js +16 -4
- package/build/universal/Checkbox/index.android.js.map +1 -1
- package/build/universal/Collapsible/index.ios.js +1 -0
- package/build/universal/Collapsible/index.ios.js.map +1 -1
- package/build/universal/Column/index.android.js +4 -1
- package/build/universal/Column/index.android.js.map +1 -1
- package/build/universal/Column/index.ios.js +2 -0
- package/build/universal/Column/index.ios.js.map +1 -1
- package/build/universal/Column/index.js +13 -4
- package/build/universal/Column/index.js.map +1 -1
- package/build/universal/FieldGroup/FieldGroup.android.js +3 -1
- package/build/universal/FieldGroup/FieldGroup.android.js.map +1 -1
- package/build/universal/FieldGroup/FieldGroup.ios.js +3 -1
- package/build/universal/FieldGroup/FieldGroup.ios.js.map +1 -1
- package/build/universal/FieldGroup/FieldSection.android.js +13 -4
- package/build/universal/FieldGroup/FieldSection.android.js.map +1 -1
- package/build/universal/FieldGroup/FieldSection.ios.js +3 -1
- package/build/universal/FieldGroup/FieldSection.ios.js.map +1 -1
- package/build/universal/Icon/index.android.js +3 -1
- package/build/universal/Icon/index.android.js.map +1 -1
- package/build/universal/Icon/index.ios.js +3 -1
- package/build/universal/Icon/index.ios.js.map +1 -1
- package/build/universal/List/ListForEach.android.d.ts +7 -0
- package/build/universal/List/ListForEach.android.js +6 -0
- package/build/universal/List/ListForEach.android.js.map +1 -0
- package/build/universal/List/ListForEach.d.ts +5 -0
- package/build/universal/List/ListForEach.ios.d.ts +5 -0
- package/build/universal/List/ListForEach.ios.js +11 -0
- package/build/universal/List/ListForEach.ios.js.map +1 -0
- package/build/universal/List/ListForEach.js +263 -0
- package/build/universal/List/ListForEach.js.map +1 -0
- package/build/universal/List/ListScrollContext.d.ts +5 -0
- package/build/universal/List/ListScrollContext.js +6 -0
- package/build/universal/List/ListScrollContext.js.map +1 -0
- package/build/universal/List/index.android.d.ts +5 -0
- package/build/universal/List/index.android.js +3 -0
- package/build/universal/List/index.android.js.map +1 -1
- package/build/universal/List/index.d.ts +5 -0
- package/build/universal/List/index.ios.d.ts +5 -0
- package/build/universal/List/index.ios.js +3 -0
- package/build/universal/List/index.ios.js.map +1 -1
- package/build/universal/List/index.js +12 -1
- package/build/universal/List/index.js.map +1 -1
- package/build/universal/List/types.d.ts +42 -1
- package/build/universal/List/types.js +1 -3
- package/build/universal/List/types.js.map +1 -1
- package/build/universal/RNHostView/index.android.js +3 -1
- package/build/universal/RNHostView/index.android.js.map +1 -1
- package/build/universal/Row/index.android.js +4 -1
- package/build/universal/Row/index.android.js.map +1 -1
- package/build/universal/Row/index.ios.js +2 -0
- package/build/universal/Row/index.ios.js.map +1 -1
- package/build/universal/Row/index.js +13 -7
- package/build/universal/Row/index.js.map +1 -1
- package/build/universal/ScrollView/index.android.js +8 -1
- package/build/universal/ScrollView/index.android.js.map +1 -1
- package/build/universal/ScrollView/index.ios.js +15 -7
- package/build/universal/ScrollView/index.ios.js.map +1 -1
- package/build/universal/Spacer/index.android.js +3 -1
- package/build/universal/Spacer/index.android.js.map +1 -1
- package/build/universal/Spacer/index.ios.js +3 -1
- package/build/universal/Spacer/index.ios.js.map +1 -1
- package/build/universal/Switch/index.android.js +17 -4
- package/build/universal/Switch/index.android.js.map +1 -1
- package/build/universal/Switch/index.js +1 -0
- package/build/universal/Switch/index.js.map +1 -1
- package/build/universal/Text/index.android.js +3 -1
- package/build/universal/Text/index.android.js.map +1 -1
- package/build/universal/Text/index.ios.js +3 -1
- package/build/universal/Text/index.ios.js.map +1 -1
- package/build/universal/Text/index.js +2 -2
- package/build/universal/Text/index.js.map +1 -1
- package/build/universal/TextInput/index.android.js +22 -7
- package/build/universal/TextInput/index.android.js.map +1 -1
- package/build/universal/TextInput/index.ios.js +1 -0
- package/build/universal/TextInput/index.ios.js.map +1 -1
- package/build/universal/index.d.ts +1 -1
- package/build/universal/modifierUtils.d.ts +34 -1
- package/build/universal/modifierUtils.js +98 -2
- package/build/universal/modifierUtils.js.map +1 -1
- package/build/universal/stackAxis.d.ts +9 -0
- package/build/universal/stackAxis.js +11 -0
- package/build/universal/stackAxis.js.map +1 -0
- package/build/universal/transformStyle.android.d.ts +6 -2
- package/build/universal/transformStyle.android.js +18 -11
- package/build/universal/transformStyle.android.js.map +1 -1
- package/build/universal/transformStyle.ios.d.ts +5 -1
- package/build/universal/transformStyle.ios.js +29 -11
- package/build/universal/transformStyle.ios.js.map +1 -1
- package/build/universal/types.d.ts +26 -1
- package/build/universal/types.js.map +1 -1
- package/build/universal/webUtils.js +4 -0
- package/build/universal/webUtils.js.map +1 -1
- package/ios/BottomSheetView.swift +11 -2
- package/ios/DatePickerView.swift +134 -9
- package/ios/GroupView.swift +3 -0
- package/ios/HStackView.swift +26 -2
- package/ios/HostView.swift +21 -12
- package/ios/Modifiers/SelectedSegmentTintColorModifier.swift +86 -0
- package/ios/Modifiers/ViewModifierRegistry.swift +8 -0
- package/ios/RNHostView.swift +34 -16
- package/ios/ScrollViewComponent.swift +20 -0
- package/ios/UIBaseView.swift +4 -1
- package/ios/UniversalLayout.swift +691 -0
- package/ios/VStackView.swift +26 -2
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.21/expo.modules.ui-58.0.21-sources.jar → 58.0.23/expo.modules.ui-58.0.23-sources.jar} +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.21/expo.modules.ui-58.0.21.module → 58.0.23/expo.modules.ui-58.0.23.module} +22 -22
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.21/expo.modules.ui-58.0.21.pom → 58.0.23/expo.modules.ui-58.0.23.pom} +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.pom.sha512 +1 -0
- package/package.json +2 -2
- package/src/community/bottom-sheet/BottomSheet.ios.tsx +7 -3
- package/src/community/pager-view/PagerView.ios.tsx +25 -8
- package/src/community/segmented-control/SegmentedControl.ios.tsx +13 -1
- package/src/community/segmented-control/types.tsx +5 -1
- package/src/jetpack-compose/Column/index.tsx +5 -0
- package/src/jetpack-compose/CompositionLocalProvider/index.tsx +43 -0
- package/src/jetpack-compose/Host/index.tsx +50 -4
- package/src/jetpack-compose/Row/index.tsx +5 -0
- package/src/jetpack-compose/Switch/index.tsx +4 -0
- package/src/jetpack-compose/TopAppBar/index.tsx +113 -0
- package/src/jetpack-compose/index.ts +2 -0
- package/src/jetpack-compose/modifiers/index.ts +11 -3
- package/src/recycling/useRecycledRows.tsx +3 -0
- package/src/swift-ui/BottomSheet/index.tsx +24 -3
- package/src/swift-ui/HStack/index.tsx +6 -0
- package/src/swift-ui/VStack/index.tsx +6 -0
- package/src/universal/Button/index.android.tsx +3 -1
- package/src/universal/Button/index.ios.tsx +2 -1
- package/src/universal/Checkbox/index.android.tsx +24 -5
- package/src/universal/Collapsible/index.ios.tsx +4 -1
- package/src/universal/Column/index.android.tsx +3 -1
- package/src/universal/Column/index.ios.tsx +2 -1
- package/src/universal/Column/index.tsx +9 -4
- package/src/universal/FieldGroup/FieldGroup.android.tsx +8 -1
- package/src/universal/FieldGroup/FieldGroup.ios.tsx +2 -1
- package/src/universal/FieldGroup/FieldSection.android.tsx +17 -4
- package/src/universal/FieldGroup/FieldSection.ios.tsx +2 -1
- package/src/universal/Icon/index.android.tsx +2 -1
- package/src/universal/Icon/index.ios.tsx +2 -1
- package/src/universal/List/ListForEach.android.tsx +6 -0
- package/src/universal/List/ListForEach.ios.tsx +9 -0
- package/src/universal/List/ListForEach.tsx +246 -0
- package/src/universal/List/ListScrollContext.ts +6 -0
- package/src/universal/List/index.android.tsx +5 -0
- package/src/universal/List/index.ios.tsx +5 -0
- package/src/universal/List/index.tsx +11 -2
- package/src/universal/List/types.ts +45 -1
- package/src/universal/RNHostView/index.android.tsx +2 -1
- package/src/universal/Row/index.android.tsx +3 -1
- package/src/universal/Row/index.ios.tsx +2 -1
- package/src/universal/Row/index.tsx +9 -10
- package/src/universal/ScrollView/index.android.tsx +15 -3
- package/src/universal/ScrollView/index.ios.tsx +16 -4
- package/src/universal/Spacer/index.android.tsx +6 -4
- package/src/universal/Spacer/index.ios.tsx +2 -1
- package/src/universal/Switch/index.android.tsx +23 -4
- package/src/universal/Switch/index.tsx +1 -0
- package/src/universal/Text/index.android.tsx +2 -1
- package/src/universal/Text/index.ios.tsx +2 -1
- package/src/universal/Text/index.tsx +2 -2
- package/src/universal/TextInput/index.android.tsx +26 -5
- package/src/universal/TextInput/index.ios.tsx +1 -1
- package/src/universal/index.ts +6 -1
- package/src/universal/modifierUtils.ts +159 -2
- package/src/universal/stackAxis.ts +17 -0
- package/src/universal/transformStyle.android.ts +30 -12
- package/src/universal/transformStyle.ios.ts +41 -13
- package/src/universal/types.ts +27 -3
- package/src/universal/webUtils.ts +4 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.pom.sha512 +0 -1
|
@@ -116,10 +116,15 @@ function findNearestDetentIndex(detents, position) {
|
|
|
116
116
|
} else if (indexProp >= 0) {
|
|
117
117
|
closedRef.current = false;
|
|
118
118
|
setIsPresented(true);
|
|
119
|
-
const clampedIndex = Math.min(indexProp, detents.length - 1);
|
|
120
|
-
setCurrentIndex(clampedIndex);
|
|
121
|
-
currentIndexRef.current = clampedIndex;
|
|
122
119
|
}
|
|
120
|
+
}, [
|
|
121
|
+
indexProp
|
|
122
|
+
]);
|
|
123
|
+
useEffect(()=>{
|
|
124
|
+
const requestedIndex = indexProp >= 0 ? indexProp : currentIndexRef.current;
|
|
125
|
+
const clampedIndex = Math.min(requestedIndex, detents.length - 1);
|
|
126
|
+
setCurrentIndex(clampedIndex);
|
|
127
|
+
currentIndexRef.current = clampedIndex;
|
|
123
128
|
}, [
|
|
124
129
|
indexProp,
|
|
125
130
|
detents.length
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["community/bottom-sheet/BottomSheet.ios.tsx"],"sourcesContent":[null],"names":["useCallback","useEffect","useImperativeHandle","useMemo","useRef","useState","useWindowDimensions","View","StyleSheet","BottomSheet","NativeBottomSheet","Group","Host","RNHostView","interactiveDismissDisabled","presentationBackground","presentationDetents","presentationDragIndicator","presentationSizing","BottomSheetContext","BottomSheetInternalContext","SheetScrollContextReset","parseSnapPoint","useBottomSheet","extractBackgroundColor","style","undefined","flat","flatten","color","backgroundColor","snapPointToDetent","point","parsed","type","fraction","value","height","detentsAreEqual","a","b","findDetentIndex","detents","detent","findIndex","d","findNearestDetentIndex","position","nearestIndex","nearestDist","Infinity","forEach","i","pValue","dValue","dist","Math","abs","props","ref","snapPoints","snapPointsProp","index","indexProp","onChange","onClose","onDismiss","enablePanDownToClose","enableDynamicSizing","handleComponent","backgroundStyle","children","width","isPresented","setIsPresented","currentIndex","setCurrentIndex","max","currentIndexRef","closedRef","onChangeRef","current","onCloseRef","onDismissRef","length","map","selectedDetent","fitToContents","internalContextValue","fireCloseCallbacks","clampedIndex","min","handlePresentedChange","presented","handleDetentChange","newIndex","methods","snapToIndex","close","snapToPosition","expand","collapse","forceClose","present","dismiss","modifiers","bg","fitted","horizontal","vertical","selection","onSelectionChange","Provider","pointerEvents","onIsPresentedChange","matchContents","paddingTop","flexGrow"],"mappings":";AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,mBAAmB,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AAC/F,SAASC,mBAAmB,EAAEC,IAAI,EAAEC,UAAU,QAAQ,eAAe;AAGrE,SAASC,eAAeC,iBAAiB,QAAQ,6BAA6B;AAC9E,SAASC,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,IAAI,QAAQ,sBAAsB;AAC3C,SAASC,UAAU,QAAQ,4BAA4B;AACvD,SAEEC,0BAA0B,EAC1BC,sBAAsB,EACtBC,mBAAmB,EACnBC,yBAAyB,EACzBC,kBAAkB,QACb,iDAAiD;AACxD,SAASC,kBAAkB,EAAEC,0BAA0B,QAAQ,YAAY;AAC3E,SAASC,uBAAuB,QAAQ,uBAAuB;AAE/D,SAASC,cAAc,QAAQ,UAAU;AAEzC,SAASC,cAAc,QAAQ,YAAY;AAE3C,kBAAkB;AAElB,SAASC,uBAAuBC,KAA2B;IACzD,IAAI,CAACA,OAAO,OAAOC;IACnB,MAAMC,OAAOnB,WAAWoB,OAAO,CAACH;IAChC,MAAMI,QAAQF,MAAMG;IACpB,OAAO,OAAOD,UAAU,WAAWA,QAAQH;AAC7C;AAEA,SAASK,kBAAkBC,KAAsB;IAC/C,MAAMC,SAASX,eAAeU;IAC9B,OAAOC,OAAOC,IAAI,KAAK,aAAa;QAAEC,UAAUF,OAAOG,KAA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OAAO,GAAG,CAAC;IACzB,GAAG,EAAE;IAEL,wCAAwC;IACxChF,UAAU;QACR,IAAI8D,cAAc,CAAC,GAAG;YACpBW,eAAe;QACjB,OAAO,IAAIX,aAAa,GAAG;YACzBgB,UAAUE,OAAO,GAAG;YACpBP,eAAe;
|
|
1
|
+
{"version":3,"sources":["community/bottom-sheet/BottomSheet.ios.tsx"],"sourcesContent":[null],"names":["useCallback","useEffect","useImperativeHandle","useMemo","useRef","useState","useWindowDimensions","View","StyleSheet","BottomSheet","NativeBottomSheet","Group","Host","RNHostView","interactiveDismissDisabled","presentationBackground","presentationDetents","presentationDragIndicator","presentationSizing","BottomSheetContext","BottomSheetInternalContext","SheetScrollContextReset","parseSnapPoint","useBottomSheet","extractBackgroundColor","style","undefined","flat","flatten","color","backgroundColor","snapPointToDetent","point","parsed","type","fraction","value","height","detentsAreEqual","a","b","findDetentIndex","detents","detent","findIndex","d","findNearestDetentIndex","position","nearestIndex","nearestDist","Infinity","forEach","i","pValue","dValue","dist","Math","abs","props","ref","snapPoints","snapPointsProp","index","indexProp","onChange","onClose","onDismiss","enablePanDownToClose","enableDynamicSizing","handleComponent","backgroundStyle","children","width","isPresented","setIsPresented","currentIndex","setCurrentIndex","max","currentIndexRef","closedRef","onChangeRef","current","onCloseRef","onDismissRef","length","map","selectedDetent","fitToContents","internalContextValue","fireCloseCallbacks","requestedIndex","clampedIndex","min","handlePresentedChange","presented","handleDetentChange","newIndex","methods","snapToIndex","close","snapToPosition","expand","collapse","forceClose","present","dismiss","modifiers","bg","fitted","horizontal","vertical","selection","onSelectionChange","Provider","pointerEvents","onIsPresentedChange","matchContents","paddingTop","flexGrow"],"mappings":";AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,mBAAmB,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AAC/F,SAASC,mBAAmB,EAAEC,IAAI,EAAEC,UAAU,QAAQ,eAAe;AAGrE,SAASC,eAAeC,iBAAiB,QAA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AAmBjB;gBACrB;aACD;YACL9E,0BAA0BoD,oBAAoB,OAAO,WAAW;YAChEvD,2BAA2B,CAACqD;eACxBwC,KAAK;gBAAC5F,uBAAuB4F;aAAI,GAAG,EAAE;SAC3C;IACH,GAAG;QACDpB;QACA7C;QACA4C;QACAS;QACA1B;QACAF;QACAG;KACD;IAED,qBACE,KAAClD,2BAA2B6F,QAAQ;QAAC7E,OAAOoD;kBAC1C,cAAA,KAACrE,mBAAmB8F,QAAQ;YAAC7E,OAAO6D;sBAClC,cAAA,KAACrF;gBAAKa,OAAO;oBAAEsB,UAAU;oBAAYyB;gBAAM;gBAAG0C,eAAc;0BAC1D,cAAA,KAACxG;oBACC+D,aAAaA;oBACb0C,qBAAqBtB;oBACrB3B,WAAWuB;oBACXF,eAAeA;8BACf,cAAA,KAAC5E;wBAAM+F,WAAWA;kCAChB,cAAA,KAAC7F;4BAAWuG,eAAe7B,gBAAgB;gCAAEuB,UAAU;4BAAK,IAAI;sCAM9D,cAAA,KAACvG;gCACCkB,OACE8D,gBACI;oCAAE8B,YAAYhD,oBAAoB,OAAO,KAAK;gCAAE,IAChD;oCAAEiD,UAAU;oCAAGjF,QAAQ;oCAAGgF,YAAYhD,oBAAoB,OAAO,KAAK;gCAAE;0CAE9E,cAAA,KAAChD;8CAAyBkD;;;;;;;;;AAS5C"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Children, isValidElement, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
-
import { Platform } from 'react-native';
|
|
3
|
+
import { Platform, StyleSheet, View } from 'react-native';
|
|
4
4
|
import { useNativeState, worklets } from '../../State';
|
|
5
5
|
import { Group } from '../../swift-ui/Group';
|
|
6
6
|
import { Host } from '../../swift-ui/Host';
|
|
@@ -51,6 +51,11 @@ function phaseToPageState(phase) {
|
|
|
51
51
|
const pageCount = validChildren.length;
|
|
52
52
|
const pageCountRef = useRef(0);
|
|
53
53
|
pageCountRef.current = pageCount;
|
|
54
|
+
const isScrollingRef = useRef(false);
|
|
55
|
+
// The SwiftUI scroll doesn't cancel React Native touches on its pages. Like
|
|
56
|
+
// React Native's `ScrollView`, take the touch from the page content while
|
|
57
|
+
// the pager moves, so a swipe or a tap that stops it doesn't press anything.
|
|
58
|
+
const shouldCaptureTouch = ()=>isScrollingRef.current;
|
|
54
59
|
// Clamp on first render — out-of-range initials produce an id that matches
|
|
55
60
|
// no `Group`, leaving `.scrollPosition(id:)` silently stuck at 0.
|
|
56
61
|
const [clampedInitialPage] = useState(()=>{
|
|
@@ -141,9 +146,13 @@ function phaseToPageState(phase) {
|
|
|
141
146
|
onPageScroll
|
|
142
147
|
]);
|
|
143
148
|
const geometryModifier = useScrollGeometryChange(handleScrollGeometry);
|
|
144
|
-
const phaseModifier =
|
|
145
|
-
|
|
146
|
-
|
|
149
|
+
const phaseModifier = onScrollPhaseChange((phase)=>{
|
|
150
|
+
const pageScrollState = phaseToPageState(phase);
|
|
151
|
+
isScrollingRef.current = pageScrollState !== 'idle';
|
|
152
|
+
onPageScrollStateChanged?.(wrapNativeEvent({
|
|
153
|
+
pageScrollState
|
|
154
|
+
}));
|
|
155
|
+
});
|
|
147
156
|
const pages = validChildren.map((child, index)=>/*#__PURE__*/ _jsx(Group, {
|
|
148
157
|
modifiers: [
|
|
149
158
|
containerRelativeFrame({
|
|
@@ -152,7 +161,12 @@ function phaseToPageState(phase) {
|
|
|
152
161
|
id(String(index))
|
|
153
162
|
],
|
|
154
163
|
children: /*#__PURE__*/ _jsx(RNHostView, {
|
|
155
|
-
children:
|
|
164
|
+
children: /*#__PURE__*/ _jsx(View, {
|
|
165
|
+
style: styles.page,
|
|
166
|
+
onStartShouldSetResponderCapture: shouldCaptureTouch,
|
|
167
|
+
onMoveShouldSetResponderCapture: shouldCaptureTouch,
|
|
168
|
+
children: child
|
|
169
|
+
})
|
|
156
170
|
})
|
|
157
171
|
}, child.key ?? String(index)));
|
|
158
172
|
// Toggle the flag rather than splicing the modifier in/out — SwiftUI diffs
|
|
@@ -166,9 +180,7 @@ function phaseToPageState(phase) {
|
|
|
166
180
|
...geometryModifier ? [
|
|
167
181
|
geometryModifier
|
|
168
182
|
] : [],
|
|
169
|
-
|
|
170
|
-
phaseModifier
|
|
171
|
-
] : []
|
|
183
|
+
phaseModifier
|
|
172
184
|
];
|
|
173
185
|
return /*#__PURE__*/ _jsx(Host, {
|
|
174
186
|
style: style ?? {
|
|
@@ -227,5 +239,10 @@ function warnIfPreIOS18ScrollCallbacksDropped(onPageScroll, onPageScrollStateCha
|
|
|
227
239
|
console.warn(`[expo-ui PagerView] onPageScroll and onPageScrollStateChanged require iOS 18+ ` + `and will not fire on iOS ${Platform.Version}. Guard with Platform.Version or ` + `provide a fallback for older iOS targets.`);
|
|
228
240
|
}
|
|
229
241
|
}
|
|
242
|
+
const styles = StyleSheet.create({
|
|
243
|
+
page: {
|
|
244
|
+
flex: 1
|
|
245
|
+
}
|
|
246
|
+
});
|
|
230
247
|
|
|
231
248
|
//# sourceMappingURL=PagerView.ios.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["community/pager-view/PagerView.ios.tsx"],"sourcesContent":[null],"names":["Children","isValidElement","useEffect","useImperativeHandle","useLayoutEffect","useMemo","useRef","useState","Platform","useNativeState","worklets","Group","Host","LazyHStack","RNHostView","ScrollView","containerRelativeFrame","id","onScrollPhaseChange","scrollDisabled","scrollPosition","scrollTargetBehavior","scrollTargetLayout","useScrollGeometryChange","Animation","withAnimation","wrapNativeEvent","phaseToPageState","phase","PagerView","props","ref","initialPage","scrollEnabled","onPageScroll","onPageScrollStateChanged","onPageSelected","children","style","layoutDirection","_layoutDirection","offscreenPageLimit","_offscreenPageLimit","pageMargin","_pageMargin","passthrough","warnIfPreIOS18ScrollCallbacksDropped","scrollEnabledState","setScrollEnabledState","validChildren","toArray","filter","c","pageCount","length","pageCountRef","current","clampedInitialPage","Math","max","min","activePageState","String","lastSelectedPageRef","onPageSelectedRef","handleScrolledIDChange","newId","page","parseInt","Number","isFinite","position","clampPage","count","writePageFromJS","setValue","value","clamped","setPage","nextId","default","setPageWithoutAnimation","setScrollEnabled","handleScrollGeometry","buildHandleScrollGeometry","undefined","geometryModifier","phaseModifier","pageScrollState","pages","map","child","index","modifiers","axes","key","onChange","flex","ignoreSafeArea","showsIndicators","spacing","geometryToPageScroll","geometry","round","contentWidth","containerWidth","positionFloat","contentOffsetX","floor","offset","userOnPageScroll","isWorkletFunction","didWarnPreIOS18","__DEV__","major","Version","console","warn"],"mappings":";AAAA,SACEA,QAAQ,EACRC,cAAc,EACdC,SAAS,EACTC,mBAAmB,EACnBC,eAAe,EACfC,OAAO,EACPC,MAAM,EACNC,QAAQ,QAEH,QAAQ;AACf,SAASC,QAAQ,QAAQ,eAAe;
|
|
1
|
+
{"version":3,"sources":["community/pager-view/PagerView.ios.tsx"],"sourcesContent":[null],"names":["Children","isValidElement","useEffect","useImperativeHandle","useLayoutEffect","useMemo","useRef","useState","Platform","StyleSheet","View","useNativeState","worklets","Group","Host","LazyHStack","RNHostView","ScrollView","containerRelativeFrame","id","onScrollPhaseChange","scrollDisabled","scrollPosition","scrollTargetBehavior","scrollTargetLayout","useScrollGeometryChange","Animation","withAnimation","wrapNativeEvent","phaseToPageState","phase","PagerView","props","ref","initialPage","scrollEnabled","onPageScroll","onPageScrollStateChanged","onPageSelected","children","style","layoutDirection","_layoutDirection","offscreenPageLimit","_offscreenPageLimit","pageMargin","_pageMargin","passthrough","warnIfPreIOS18ScrollCallbacksDropped","scrollEnabledState","setScrollEnabledState","validChildren","toArray","filter","c","pageCount","length","pageCountRef","current","isScrollingRef","shouldCaptureTouch","clampedInitialPage","Math","max","min","activePageState","String","lastSelectedPageRef","onPageSelectedRef","handleScrolledIDChange","newId","page","parseInt","Number","isFinite","position","clampPage","count","writePageFromJS","setValue","value","clamped","setPage","nextId","default","setPageWithoutAnimation","setScrollEnabled","handleScrollGeometry","buildHandleScrollGeometry","undefined","geometryModifier","phaseModifier","pageScrollState","pages","map","child","index","modifiers","axes","styles","onStartShouldSetResponderCapture","onMoveShouldSetResponderCapture","key","onChange","flex","ignoreSafeArea","showsIndicators","spacing","geometryToPageScroll","geometry","round","contentWidth","containerWidth","positionFloat","contentOffsetX","floor","offset","userOnPageScroll","isWorkletFunction","didWarnPreIOS18","__DEV__","major","Version","console","warn","create"],"mappings":";AAAA,SACEA,QAAQ,EACRC,cAAc,EACdC,SAAS,EACTC,mBAAmB,EACnBC,eAAe,EACfC,OAAO,EACPC,MAAM,EACNC,QAAQ,QAEH,QAAQ;AACf,SAASC,QAAQ,EAAEC,UAAU,EAAEC,IAAI,QAAQ,eAAe;AAE1D,SAASC,cAAc,EAAEC,QAAQ,QAAQ,cAAc;AACvD,SAASC,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,IAAI,QAAQ,sBAAsB;AAC3C,SAASC,UAAU,QAAQ,4BAA4B;AACvD,SAASC,UAAU,QAAQ,4BAA4B;AACvD,SAASC,UAAU,QAA+C,4BAA4B;AAC9F,SACEC,sBAAsB,EACtBC,EAAE,EACFC,mBAAmB,EACnBC,cAAc,EACdC,cAAc,EACdC,oBAAoB,EACpBC,kBAAkB,EAClBC,uBAAuB,QAClB,2BAA2B;AAClC,SAASC,SAAS,QAAQ,qCAAqC;AAC/D,SAASC,aAAa,QAAQ,+BAA+B;AAC7D,SAASC,eAAe,QAA6B,UAAU;AAE/D,SAASC,iBAAiBC,KAAkB;IAC1C,OAAQA;QACN,KAAK;YACH,OAAO;QACT,KAAK;QACL,KAAK;YACH,OAAO;QACT,KAAK;QACL,KAAK;YACH,OAAO;IACX;AACF;AAEA;;;;;;;;;;;CAWC,GACD,OAAO,SAASC,UAAUC,KAAqB;IAC7C,MAAM,EACJC,GAAG,EACHC,cAAc,CAAC,EACfC,gBAAgB,IAAI,EACpBC,YAAY,EACZC,wBAAwB,EACxBC,cAAc,EACdC,QAAQ,EACRC,KAAK,EACL,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KAAKgD,KAAK,CAACD,SAASE,YAAY,GAAGF,SAASG,cAAc;IACxF,MAAMC,gBAAgBnD,KAAKC,GAAG,CAC5B,GACAD,KAAKE,GAAG,CAACT,YAAY,GAAGsD,SAASK,cAAc,GAAGL,SAASG,cAAc;IAE3E,MAAMrC,WAAWb,KAAKqD,KAAK,CAACF;IAC5B,OAAO;QAAEtC;QAAUyC,QAAQH,gBAAgBtC;IAAS;AACtD;AAEA,2EAA2E;AAC3E,uDAAuD;AACvD,SAASa,0BACP6B,gBAA6D;IAE7D,IAAIzG,UAAU0G,oBAAoBD,mBAAmB;QACnD,OAAO,CAACR;YACN;YACA,IAAIA,SAASG,cAAc,IAAI,GAAG;YAClCK,iBAAiBzF,gBAAgBgF,qBAAqBC;QACxD;IACF;IACA,OAAO,CAACA;QACN,IAAIA,SAASG,cAAc,IAAI,GAAG;QAClCK,iBAAiBzF,gBAAgBgF,qBAAqBC;IACxD;AACF;AAEA,IAAIU,kBAAkB;AACtB,SAASvE,qCACPZ,YAA4C,EAC5CC,wBAAoE;IAEpE,IAAI,CAACmF,WAAWD,iBAAiB;IACjC,IAAI,CAACnF,gBAAgB,CAACC,0BAA0B;IAChD,MAAMoF,QAAQjD,SAASN,OAAO1D,SAASkH,OAAO,GAAG;IACjD,IAAIjD,OAAOC,QAAQ,CAAC+C,UAAUA,QAAQ,IAAI;QACxCF,kBAAkB;QAClBI,QAAQC,IAAI,CACV,CAAC,8EAA8E,CAAC,GAC9E,CAAC,yBAAyB,EAAEpH,SAASkH,OAAO,CAAC,iCAAiC,CAAC,GAC/E,CAAC,yCAAyC,CAAC;IAEjD;AACF;AAEA,MAAMvB,SAAS1F,WAAWoH,MAAM,CAAC;IAC/BtD,MAAM;QAAEiC,MAAM;IAAE;AAClB"}
|
|
@@ -2,19 +2,28 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Host } from '../../swift-ui/Host';
|
|
3
3
|
import { Picker } from '../../swift-ui/Picker';
|
|
4
4
|
import { Text } from '../../swift-ui/Text';
|
|
5
|
-
import { disabled as disabledModifier } from '../../swift-ui/modifiers';
|
|
5
|
+
import { accessibilityLabel as accessibilityLabelModifier, disabled as disabledModifier } from '../../swift-ui/modifiers';
|
|
6
|
+
import { createModifier } from '../../swift-ui/modifiers/createModifier';
|
|
6
7
|
import { environment } from '../../swift-ui/modifiers/environment';
|
|
7
8
|
import { pickerStyle } from '../../swift-ui/modifiers/pickerStyle';
|
|
8
9
|
import { tag } from '../../swift-ui/modifiers/tag';
|
|
9
10
|
import { buildChangeEvent } from './types';
|
|
10
11
|
export function SegmentedControl(props) {
|
|
11
|
-
const { values, selectedIndex, enabled = true, onChange, onValueChange, appearance, style, testID } = props;
|
|
12
|
+
const { values, selectedIndex, enabled = true, onChange, onValueChange, tintColor, appearance, style, testID, accessibilityLabel } = props;
|
|
12
13
|
const modifiers = [
|
|
13
14
|
pickerStyle('segmented')
|
|
14
15
|
];
|
|
15
16
|
if (!enabled) {
|
|
16
17
|
modifiers.push(disabledModifier());
|
|
17
18
|
}
|
|
19
|
+
if (accessibilityLabel) {
|
|
20
|
+
modifiers.push(accessibilityLabelModifier(accessibilityLabel));
|
|
21
|
+
}
|
|
22
|
+
if (tintColor) {
|
|
23
|
+
modifiers.push(createModifier('selectedSegmentTintColor', {
|
|
24
|
+
color: tintColor
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
18
27
|
if (appearance) {
|
|
19
28
|
modifiers.push(environment('colorScheme', appearance));
|
|
20
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["community/segmented-control/SegmentedControl.ios.tsx"],"sourcesContent":[null],"names":["Host","Picker","Text","disabled","disabledModifier","environment","pickerStyle","tag","buildChangeEvent","SegmentedControl","props","values","selectedIndex","enabled","onChange","onValueChange","appearance","style","testID","modifiers","push","handleSelectionChange","selection","val","matchContents","vertical","ignoreSafeArea","onSelectionChange","label","map","index"],"mappings":";AAAA,SAASA,IAAI,QAAQ,sBAAsB;AAC3C,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,IAAI,QAAQ,sBAAsB;AAC3C,
|
|
1
|
+
{"version":3,"sources":["community/segmented-control/SegmentedControl.ios.tsx"],"sourcesContent":[null],"names":["Host","Picker","Text","accessibilityLabel","accessibilityLabelModifier","disabled","disabledModifier","createModifier","environment","pickerStyle","tag","buildChangeEvent","SegmentedControl","props","values","selectedIndex","enabled","onChange","onValueChange","tintColor","appearance","style","testID","modifiers","push","color","handleSelectionChange","selection","val","matchContents","vertical","ignoreSafeArea","onSelectionChange","label","map","index"],"mappings":";AAAA,SAASA,IAAI,QAAQ,sBAAsB;AAC3C,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,IAAI,QAAQ,sBAAsB;AAC3C,SACEC,sBAAsBC,0BAA0B,EAChDC,YAAYC,gBAAgB,QACvB,2BAA2B;AAClC,SAASC,cAAc,QAAQ,0CAA0C;AACzE,SAASC,WAAW,QAAQ,uCAAuC;AACnE,SAASC,WAAW,QAAQ,uCAAuC;AACnE,SAASC,GAAG,QAAQ,+BAA+B;AAEnD,SAASC,gBAAgB,QAAoC,UAAU;AAEvE,OAAO,SAASC,iBAAiBC,KAA4B;IAC3D,MAAM,EACJC,MAAM,EACNC,aAAa,EACbC,UAAU,IAAI,EACdC,QAAQ,EACRC,aAAa,EACbC,SAAS,EACTC,UAAU,EACVC,KAAK,EACLC,MAAM,EACNnB,kBAAkB,EACnB,GAAGU;IAEJ,MAAMU,YAA8B;QAACd,YAAY;KAAa;IAC9D,IAAI,CAACO,SAAS;QACZO,UAAUC,IAAI,CAAClB;IACjB;IACA,IAAIH,oBAAoB;QACtBoB,UAAUC,IAAI,CAACpB,2BAA2BD;IAC5C;IACA,IAAIgB,WAAW;QACbI,UAAUC,IAAI,CAACjB,eAAe,4BAA4B;YAAEkB,OAAON;QAAU;IAC/E;IACA,IAAIC,YAAY;QACdG,UAAUC,IAAI,CAAChB,YAAY,eAAeY;IAC5C;IAEA,MAAMM,wBAAwB,CAACC;QAC7B,MAAMC,MAAMd,QAAQ,CAACa,UAAU,IAAI;QACnCT,gBAAgBU;QAChBX,WAAWN,iBAAiBgB,WAAWC;IACzC;IAEA,qBACE,KAAC5B;QAAK6B,eAAe;YAAEC,UAAU;QAAK;QAAGT,OAAOA;QAAOU,gBAAe;kBACpE,cAAA,KAAC9B;YACC0B,WAAWZ;YACXiB,mBAAmBN;YACnBH,WAAWA;YACXU,OAAM;YACNX,QAAQA;sBACP,AAACR,CAAAA,UAAU,EAAE,AAAD,EAAGoB,GAAG,CAAC,CAACD,OAAOE,sBAC1B,KAACjC;oBAAiBqB,WAAW;wBAACb,IAAIyB;qBAAO;8BACtCF;mBADQE;;;AAOrB"}
|
|
@@ -40,7 +40,6 @@ export interface SegmentedControlProps {
|
|
|
40
40
|
onValueChange?: (value: string) => void;
|
|
41
41
|
/**
|
|
42
42
|
* Accent color of the control.
|
|
43
|
-
* @platform android, web
|
|
44
43
|
*/
|
|
45
44
|
tintColor?: string;
|
|
46
45
|
/**
|
|
@@ -49,6 +48,11 @@ export interface SegmentedControlProps {
|
|
|
49
48
|
appearance?: 'dark' | 'light';
|
|
50
49
|
style?: StyleProp<ViewStyle>;
|
|
51
50
|
testID?: string;
|
|
51
|
+
/**
|
|
52
|
+
* The name of the control that screen readers announce.
|
|
53
|
+
* @platform ios
|
|
54
|
+
*/
|
|
55
|
+
accessibilityLabel?: string;
|
|
52
56
|
}
|
|
53
57
|
/**
|
|
54
58
|
* Builds a synthetic `onChange` event matching the community library shape.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["community/segmented-control/types.tsx"],"sourcesContent":[null],"names":["buildChangeEvent","index","value","nativeEvent","selectedSegmentIndex"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["community/segmented-control/types.tsx"],"sourcesContent":[null],"names":["buildChangeEvent","index","value","nativeEvent","selectedSegmentIndex"],"mappings":"AA4DA;;CAEC,GACD,OAAO,SAASA,iBAAiBC,KAAa,EAAEC,KAAa;IAC3D,OAAO;QACLC,aAAa;YACXC,sBAAsBH;YACtBC;QACF;IACF;AACF"}
|
|
@@ -17,5 +17,10 @@ export interface ColumnProps extends PrimitiveBaseProps {
|
|
|
17
17
|
* Vertical alignment of children.
|
|
18
18
|
*/
|
|
19
19
|
verticalAlignment?: VerticalAlignment;
|
|
20
|
+
/**
|
|
21
|
+
* When `true`, a child percentage is a fraction of this column.
|
|
22
|
+
* Universal `Column` sets this. Leave it unset to keep the Compose `Column`.
|
|
23
|
+
*/
|
|
24
|
+
resolvesChildPercentages?: boolean;
|
|
20
25
|
}
|
|
21
26
|
export declare function Column(props: ColumnProps): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["jetpack-compose/Column/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","transformProps","ColumnNativeView","Column","props"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAEzC,SAMEC,cAAc,QACT,kBAAkB;
|
|
1
|
+
{"version":3,"sources":["jetpack-compose/Column/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","transformProps","ColumnNativeView","Column","props"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAEzC,SAMEC,cAAc,QACT,kBAAkB;AA2BzB,MAAMC,mBAAqDF,kBACzD,UACA;AAGF,OAAO,SAASG,OAAOC,KAAkB;IACvC,qBAAO,KAACF;QAAkB,GAAGD,eAAeG,MAAM;;AACpD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Composition local values that `CompositionLocalProvider` can provide.
|
|
4
|
+
*/
|
|
5
|
+
export type CompositionLocalValues = {
|
|
6
|
+
/**
|
|
7
|
+
* The minimum size, in dp, that Material components such as `Button`, `IconButton`, `Checkbox`, and
|
|
8
|
+
* `Switch` reserve for their touch target. Maps to `LocalMinimumInteractiveComponentSize`.
|
|
9
|
+
* Set it to `0` to let these components be smaller than Material's default of 48dp.
|
|
10
|
+
*/
|
|
11
|
+
minimumInteractiveComponentSize?: number;
|
|
12
|
+
};
|
|
13
|
+
export type CompositionLocalProviderProps = {
|
|
14
|
+
/**
|
|
15
|
+
* The values to provide to the children.
|
|
16
|
+
*/
|
|
17
|
+
values: CompositionLocalValues;
|
|
18
|
+
/**
|
|
19
|
+
* The content that receives the values.
|
|
20
|
+
*/
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Provides composition local values to its children, like Jetpack Compose's `CompositionLocalProvider`.
|
|
25
|
+
* It adds no layout of its own, so children keep modifiers such as `weight` from the parent `Row`
|
|
26
|
+
* or `Column`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function CompositionLocalProvider({ values, children }: CompositionLocalProviderProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { requireNativeView } from 'expo';
|
|
3
|
+
const CompositionLocalProviderNativeView = requireNativeView('ExpoUI', 'CompositionLocalProviderView');
|
|
4
|
+
/**
|
|
5
|
+
* Provides composition local values to its children, like Jetpack Compose's `CompositionLocalProvider`.
|
|
6
|
+
* It adds no layout of its own, so children keep modifiers such as `weight` from the parent `Row`
|
|
7
|
+
* or `Column`.
|
|
8
|
+
*/ export function CompositionLocalProvider({ values, children }) {
|
|
9
|
+
return /*#__PURE__*/ _jsx(CompositionLocalProviderNativeView, {
|
|
10
|
+
...values,
|
|
11
|
+
children: children
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["jetpack-compose/CompositionLocalProvider/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","CompositionLocalProviderNativeView","CompositionLocalProvider","values","children"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AA8BzC,MAAMC,qCACJD,kBAAkB,UAAU;AAE9B;;;;CAIC,GACD,OAAO,SAASE,yBAAyB,EAAEC,MAAM,EAAEC,QAAQ,EAAiC;IAC1F,qBACE,KAACH;QAAoC,GAAGE,MAAM;kBAAGC;;AAErD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Ref } from 'react';
|
|
2
2
|
import { type ColorSchemeName, type ColorValue, type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import { type MaterialColors } from '../colors';
|
|
3
4
|
import { type PrimitiveBaseProps } from '../layout';
|
|
4
5
|
export interface HostProps extends PrimitiveBaseProps {
|
|
5
6
|
/**
|
|
@@ -41,6 +42,13 @@ export interface HostProps extends PrimitiveBaseProps {
|
|
|
41
42
|
* available to descendants via `useMaterialColors()`.
|
|
42
43
|
*/
|
|
43
44
|
seedColor?: ColorValue;
|
|
45
|
+
/**
|
|
46
|
+
* Material 3 color roles that replace the matching roles of the palette from
|
|
47
|
+
* `colorScheme` and `seedColor`. Roles you omit keep their palette value.
|
|
48
|
+
* The overrides theme Compose children and are returned by `useMaterialColors()`
|
|
49
|
+
* in the same `#RRGGBBAA` form as the other roles.
|
|
50
|
+
*/
|
|
51
|
+
colorOverrides?: Partial<MaterialColors>;
|
|
44
52
|
/**
|
|
45
53
|
* The layout direction for the content.
|
|
46
54
|
* Defaults to the current locale direction from I18nManager.
|
|
@@ -1,23 +1,36 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { requireNativeView } from 'expo';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
|
-
import { I18nManager, useColorScheme as useRNColorScheme } from 'react-native';
|
|
4
|
+
import { I18nManager, processColor, useColorScheme as useRNColorScheme } from 'react-native';
|
|
5
5
|
import { NativeTreeContext, useWarnIfNestedHost } from '../../NativeTreeContext';
|
|
6
6
|
import { TextInputHostProvider, useTextInputHostRef } from '../../keyboard';
|
|
7
7
|
import { useMergeRefs } from '../../utils/useMergeRefs';
|
|
8
8
|
import { getMaterialColors, HostPaletteContext } from '../colors';
|
|
9
9
|
const HostNativeView = requireNativeView('ExpoUI', 'HostView');
|
|
10
10
|
export function Host(props) {
|
|
11
|
-
const { matchContents, modifiers, onLayoutContent, layoutDirection, colorScheme, seedColor, ref, children, ...restProps } = props;
|
|
11
|
+
const { matchContents, modifiers, onLayoutContent, layoutDirection, colorScheme, seedColor, colorOverrides, ref, children, ...restProps } = props;
|
|
12
12
|
const schemeString = colorScheme === 'light' || colorScheme === 'dark' ? colorScheme : undefined;
|
|
13
13
|
const systemScheme = useRNColorScheme();
|
|
14
14
|
const resolvedScheme = schemeString ?? (systemScheme === 'dark' ? 'dark' : 'light');
|
|
15
|
-
|
|
15
|
+
// Key on the normalized values, not the object, so an inline `colorOverrides` object keeps
|
|
16
|
+
// the palette from `useMaterialColors()` reference-stable across re-renders.
|
|
17
|
+
const overridesKey = colorOverrides ? JSON.stringify(normalizeColorOverrides(colorOverrides)) : null;
|
|
18
|
+
const normalizedOverrides = useMemo(()=>overridesKey ? JSON.parse(overridesKey) : undefined, [
|
|
19
|
+
overridesKey
|
|
20
|
+
]);
|
|
21
|
+
const palette = useMemo(()=>{
|
|
22
|
+
const basePalette = getMaterialColors({
|
|
16
23
|
scheme: resolvedScheme,
|
|
17
24
|
seedColor
|
|
18
|
-
})
|
|
25
|
+
});
|
|
26
|
+
return normalizedOverrides ? {
|
|
27
|
+
...basePalette,
|
|
28
|
+
...normalizedOverrides
|
|
29
|
+
} : basePalette;
|
|
30
|
+
}, [
|
|
19
31
|
resolvedScheme,
|
|
20
|
-
seedColor
|
|
32
|
+
seedColor,
|
|
33
|
+
normalizedOverrides
|
|
21
34
|
]);
|
|
22
35
|
const hostRef = useTextInputHostRef();
|
|
23
36
|
const mergedRef = useMergeRefs(ref, hostRef);
|
|
@@ -33,6 +46,7 @@ export function Host(props) {
|
|
|
33
46
|
matchContentsHorizontal: typeof matchContents === 'object' ? matchContents.horizontal : matchContents,
|
|
34
47
|
colorScheme: schemeString,
|
|
35
48
|
seedColor: seedColor,
|
|
49
|
+
colorOverrides: normalizedOverrides,
|
|
36
50
|
onLayoutContent: onLayoutContent,
|
|
37
51
|
layoutDirection: layoutDirection ?? (I18nManager.getConstants().isRTL ? 'rightToLeft' : 'leftToRight'),
|
|
38
52
|
ref: mergedRef,
|
|
@@ -44,5 +58,24 @@ export function Host(props) {
|
|
|
44
58
|
})
|
|
45
59
|
});
|
|
46
60
|
}
|
|
61
|
+
function normalizeColorOverrides(overrides) {
|
|
62
|
+
const normalized = {};
|
|
63
|
+
for (const [role, color] of Object.entries(overrides)){
|
|
64
|
+
const hex = color != null ? toRgbaHex(color) : null;
|
|
65
|
+
if (hex) {
|
|
66
|
+
normalized[role] = hex;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return normalized;
|
|
70
|
+
}
|
|
71
|
+
// `processColor` returns `0xAARRGGBB`; the palette uses `#RRGGBBAA` like native `toTokenMap()`.
|
|
72
|
+
function toRgbaHex(color) {
|
|
73
|
+
const argb = processColor(color);
|
|
74
|
+
if (typeof argb !== 'number') {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
const rgba = (argb << 8 | argb >>> 24) >>> 0;
|
|
78
|
+
return `#${rgba.toString(16).padStart(8, '0').toUpperCase()}`;
|
|
79
|
+
}
|
|
47
80
|
|
|
48
81
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["jetpack-compose/Host/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","useMemo","I18nManager","useColorScheme","useRNColorScheme","NativeTreeContext","useWarnIfNestedHost","TextInputHostProvider","useTextInputHostRef","useMergeRefs","getMaterialColors","HostPaletteContext","HostNativeView","Host","props","matchContents","modifiers","onLayoutContent","layoutDirection","colorScheme","seedColor","ref","children","restProps","schemeString","undefined","systemScheme","resolvedScheme","palette","scheme","hostRef","mergedRef","Provider","value","matchContentsVertical","vertical","matchContentsHorizontal","horizontal","getConstants","isRTL"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AACzC,SAASC,OAAO,QAAkB,QAAQ;AAC1C,SAKEC,WAAW,EACXC,kBAAkBC,gBAAgB,QAC7B,eAAe;AAEtB,SAASC,iBAAiB,EAAEC,mBAAmB,QAAQ,0BAA0B;AACjF,SAASC,qBAAqB,EAAEC,mBAAmB,QAAQ,iBAAiB;AAC5E,SAASC,YAAY,QAAQ,2BAA2B;AACxD,
|
|
1
|
+
{"version":3,"sources":["jetpack-compose/Host/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","useMemo","I18nManager","processColor","useColorScheme","useRNColorScheme","NativeTreeContext","useWarnIfNestedHost","TextInputHostProvider","useTextInputHostRef","useMergeRefs","getMaterialColors","HostPaletteContext","HostNativeView","Host","props","matchContents","modifiers","onLayoutContent","layoutDirection","colorScheme","seedColor","colorOverrides","ref","children","restProps","schemeString","undefined","systemScheme","resolvedScheme","overridesKey","JSON","stringify","normalizeColorOverrides","normalizedOverrides","parse","palette","basePalette","scheme","hostRef","mergedRef","Provider","value","matchContentsVertical","vertical","matchContentsHorizontal","horizontal","getConstants","isRTL","overrides","normalized","role","color","Object","entries","hex","toRgbaHex","argb","rgba","toString","padStart","toUpperCase"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AACzC,SAASC,OAAO,QAAkB,QAAQ;AAC1C,SAKEC,WAAW,EACXC,YAAY,EACZC,kBAAkBC,gBAAgB,QAC7B,eAAe;AAEtB,SAASC,iBAAiB,EAAEC,mBAAmB,QAAQ,0BAA0B;AACjF,SAASC,qBAAqB,EAAEC,mBAAmB,QAAQ,iBAAiB;AAC5E,SAASC,YAAY,QAAQ,2BAA2B;AACxD,SACEC,iBAAiB,EACjBC,kBAAkB,QAGb,YAAY;AA4EnB,MAAMC,iBAAuDb,kBAC3D,UACA;AAGF,OAAO,SAASc,KAAKC,KAAgB;IACnC,MAAM,EACJC,aAAa,EACbC,SAAS,EACTC,eAAe,EACfC,eA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wBAAwBgB,SAAkC;IACjE,MAAMC,aAAsC,CAAC;IAC7C,KAAK,MAAM,CAACC,MAAMC,MAAM,IAAIC,OAAOC,OAAO,CAACL,WAAiD;QAC1F,MAAMM,MAAMH,SAAS,OAAOI,UAAUJ,SAAS;QAC/C,IAAIG,KAAK;YACPL,UAAU,CAACC,KAAK,GAAGI;QACrB;IACF;IACA,OAAOL;AACT;AAEA,gGAAgG;AAChG,SAASM,UAAUJ,KAAc;IAC/B,MAAMK,OAAOtD,aAAaiD;IAC1B,IAAI,OAAOK,SAAS,UAAU;QAC5B,OAAO;IACT;IACA,MAAMC,OAAO,AAAC,CAAA,AAACD,QAAQ,IAAMA,SAAS,EAAE,MAAO;IAC/C,OAAO,CAAC,CAAC,EAAEC,KAAKC,QAAQ,CAAC,IAAIC,QAAQ,CAAC,GAAG,KAAKC,WAAW,IAAI;AAC/D"}
|
|
@@ -17,5 +17,10 @@ export interface RowProps extends PrimitiveBaseProps {
|
|
|
17
17
|
* Vertical alignment of children.
|
|
18
18
|
*/
|
|
19
19
|
verticalAlignment?: VerticalAlignment;
|
|
20
|
+
/**
|
|
21
|
+
* When `true`, a child percentage is a fraction of this row.
|
|
22
|
+
* Universal `Row` sets this. Leave it unset to keep the Compose `Row`.
|
|
23
|
+
*/
|
|
24
|
+
resolvesChildPercentages?: boolean;
|
|
20
25
|
}
|
|
21
26
|
export declare function Row(props: RowProps): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["jetpack-compose/Row/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","transformProps","RowNativeView","Row","props"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAEzC,SAMEC,cAAc,QACT,kBAAkB;
|
|
1
|
+
{"version":3,"sources":["jetpack-compose/Row/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","transformProps","RowNativeView","Row","props"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAEzC,SAMEC,cAAc,QACT,kBAAkB;AA2BzB,MAAMC,gBAA+CF,kBAAkB,UAAU;AAEjF,OAAO,SAASG,IAAIC,KAAe;IACjC,qBAAO,KAACF;QAAe,GAAGD,eAAeG,MAAM;;AACjD"}
|
|
@@ -33,6 +33,8 @@ export interface SwitchProps {
|
|
|
33
33
|
enabled?: boolean;
|
|
34
34
|
/**
|
|
35
35
|
* Callback function that is called when the checked state changes.
|
|
36
|
+
* When omitted, the switch is not interactive on its own, so a parent with the
|
|
37
|
+
* `toggleable` modifier can handle input and accessibility for it.
|
|
36
38
|
*/
|
|
37
39
|
onCheckedChange?: (value: boolean) => void;
|
|
38
40
|
/**
|
|
@@ -19,6 +19,7 @@ function transformSwitchProps(props) {
|
|
|
19
19
|
modifiers,
|
|
20
20
|
...modifiers ? createViewModifierEventListener(modifiers) : undefined,
|
|
21
21
|
...restProps,
|
|
22
|
+
nativeClickable: onCheckedChange != null,
|
|
22
23
|
onCheckedChange: ({ nativeEvent: { value } })=>{
|
|
23
24
|
onCheckedChange?.(value);
|
|
24
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["jetpack-compose/Switch/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","ExpoUIModule","createViewModifierEventListener","SwitchNativeView","SlotNativeView","SwitchThumbContent","props","slotName","children","transformSwitchProps","modifiers","onCheckedChange","restProps","undefined","nativeEvent","value","SwitchComponent","ThumbContent","DefaultIconSize","SwitchDefaultIconSize","Switch"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAIzC,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,+BAA+B,QAAQ,qBAAqB;
|
|
1
|
+
{"version":3,"sources":["jetpack-compose/Switch/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","ExpoUIModule","createViewModifierEventListener","SwitchNativeView","SlotNativeView","SwitchThumbContent","props","slotName","children","transformSwitchProps","modifiers","onCheckedChange","restProps","undefined","nativeClickable","nativeEvent","value","SwitchComponent","ThumbContent","DefaultIconSize","SwitchDefaultIconSize","Switch"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAIzC,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,+BAA+B,QAAQ,qBAAqB;AAsErE,MAAMC,mBAA2DH,kBAC/D,UACA;AAGF,MAAMI,iBAA2DJ,kBAC/D,UACA;AAGF;;;CAGC,GACD,OAAO,SAASK,mBAAmBC,KAAwB;IACzD,qBAAO,KAACF;QAAeG,UAAS;kBAAgBD,MAAME,QAAQ;;AAChE;AAEA,SAASC,qBAAqBH,KAAkB;IAC9C,MAAM,EAAEI,SAAS,EAAEF,QAAQ,EAAEG,eAAe,EAAE,GAAGC,WAAW,GAAGN;IAC/D,OAAO;QACLI;QACA,GAAIA,YAAYR,gCAAgCQ,aAAaG,SAAS;QACtE,GAAGD,SAAS;QACZE,iBAAiBH,mBAAmB;QACpCA,iBAAiB,CAAC,EAAEI,aAAa,EAAEC,KAAK,EAAE,EAAE;YAC1CL,kBAAkBK;QACpB;IACF;AACF;AAEA;;CAEC,GACD,SAASC,gBAAgBX,KAAkB;IACzC,qBAAO,KAACH;QAAkB,GAAGM,qBAAqBH,MAAM;kBAAGA,MAAME,QAAQ;;AAC3E;AAEAS,gBAAgBC,YAAY,GAAGb;AAC/BY,gBAAgBE,eAAe,GAAGlB,aAAamB,qBAAqB;AAEpE,SAASH,mBAAmBI,MAAM,GAAG"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { ColorValue } from 'react-native';
|
|
2
|
+
import type { ExpoModifier } from '../../types';
|
|
3
|
+
import type { PaddingValuesRecord } from '../Carousel';
|
|
4
|
+
export type { PaddingValuesRecord };
|
|
5
|
+
/**
|
|
6
|
+
* Colors for the top app bar.
|
|
7
|
+
*/
|
|
8
|
+
export type TopAppBarColors = {
|
|
9
|
+
/**
|
|
10
|
+
* Color of the container (background).
|
|
11
|
+
*/
|
|
12
|
+
containerColor?: ColorValue;
|
|
13
|
+
/**
|
|
14
|
+
* Color of the navigation icon.
|
|
15
|
+
*/
|
|
16
|
+
navigationIconContentColor?: ColorValue;
|
|
17
|
+
/**
|
|
18
|
+
* Color of the title.
|
|
19
|
+
*/
|
|
20
|
+
titleContentColor?: ColorValue;
|
|
21
|
+
/**
|
|
22
|
+
* Color of the action icons.
|
|
23
|
+
*/
|
|
24
|
+
actionIconContentColor?: ColorValue;
|
|
25
|
+
};
|
|
26
|
+
export interface TopAppBarProps {
|
|
27
|
+
/**
|
|
28
|
+
* Colors for the app bar. Unset colors use `TopAppBarDefaults.topAppBarColors()`.
|
|
29
|
+
*/
|
|
30
|
+
colors?: TopAppBarColors;
|
|
31
|
+
/**
|
|
32
|
+
* Insets in dp that the app bar adds around its content. Missing sides are `0`.
|
|
33
|
+
* When omitted, the app bar uses `TopAppBarDefaults.windowInsets`, which assumes
|
|
34
|
+
* the bar is at the top edge of the window, even inside a nested `Host`.
|
|
35
|
+
* Pass `{}` when a parent handles the insets. This removes both the top status
|
|
36
|
+
* bar inset and the horizontal system bar and display cutout insets.
|
|
37
|
+
*/
|
|
38
|
+
windowInsets?: PaddingValuesRecord;
|
|
39
|
+
/**
|
|
40
|
+
* Modifiers for the component.
|
|
41
|
+
*/
|
|
42
|
+
modifiers?: ExpoModifier[];
|
|
43
|
+
/**
|
|
44
|
+
* `TopAppBar.Title`, `TopAppBar.NavigationIcon`, and `TopAppBar.Actions` slots.
|
|
45
|
+
*/
|
|
46
|
+
children: React.ReactNode;
|
|
47
|
+
}
|
|
48
|
+
type SlotProps = {
|
|
49
|
+
children: React.ReactNode;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Title slot for `TopAppBar`.
|
|
53
|
+
*/
|
|
54
|
+
declare function TopAppBarTitle(props: SlotProps): import("react").JSX.Element;
|
|
55
|
+
/**
|
|
56
|
+
* Navigation icon slot for `TopAppBar`. It appears at the start of the app bar.
|
|
57
|
+
*/
|
|
58
|
+
declare function TopAppBarNavigationIcon(props: SlotProps): import("react").JSX.Element;
|
|
59
|
+
/**
|
|
60
|
+
* Actions slot for `TopAppBar`. Its children appear in a row at the end of the app bar.
|
|
61
|
+
*/
|
|
62
|
+
declare function TopAppBarActions(props: SlotProps): import("react").JSX.Element;
|
|
63
|
+
/**
|
|
64
|
+
* A Material 3 small top app bar that shows a title, a navigation icon, and actions.
|
|
65
|
+
*/
|
|
66
|
+
declare function TopAppBar(props: TopAppBarProps): import("react").JSX.Element;
|
|
67
|
+
declare namespace TopAppBar {
|
|
68
|
+
var Title: typeof TopAppBarTitle;
|
|
69
|
+
var NavigationIcon: typeof TopAppBarNavigationIcon;
|
|
70
|
+
var Actions: typeof TopAppBarActions;
|
|
71
|
+
}
|
|
72
|
+
export { TopAppBar };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { requireNativeView } from 'expo';
|
|
3
|
+
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
4
|
+
const TopAppBarNativeView = requireNativeView('ExpoUI', 'TopAppBarView');
|
|
5
|
+
const SlotNativeView = requireNativeView('ExpoUI', 'SlotView');
|
|
6
|
+
/**
|
|
7
|
+
* Title slot for `TopAppBar`.
|
|
8
|
+
*/ function TopAppBarTitle(props) {
|
|
9
|
+
return /*#__PURE__*/ _jsx(SlotNativeView, {
|
|
10
|
+
slotName: "title",
|
|
11
|
+
children: props.children
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Navigation icon slot for `TopAppBar`. It appears at the start of the app bar.
|
|
16
|
+
*/ function TopAppBarNavigationIcon(props) {
|
|
17
|
+
return /*#__PURE__*/ _jsx(SlotNativeView, {
|
|
18
|
+
slotName: "navigationIcon",
|
|
19
|
+
children: props.children
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Actions slot for `TopAppBar`. Its children appear in a row at the end of the app bar.
|
|
24
|
+
*/ function TopAppBarActions(props) {
|
|
25
|
+
return /*#__PURE__*/ _jsx(SlotNativeView, {
|
|
26
|
+
slotName: "actions",
|
|
27
|
+
children: props.children
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A Material 3 small top app bar that shows a title, a navigation icon, and actions.
|
|
32
|
+
*/ function TopAppBar(props) {
|
|
33
|
+
const { modifiers, ...restProps } = props;
|
|
34
|
+
return /*#__PURE__*/ _jsx(TopAppBarNativeView, {
|
|
35
|
+
modifiers: modifiers,
|
|
36
|
+
...modifiers ? createViewModifierEventListener(modifiers) : undefined,
|
|
37
|
+
...restProps
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
TopAppBar.Title = TopAppBarTitle;
|
|
41
|
+
TopAppBar.NavigationIcon = TopAppBarNavigationIcon;
|
|
42
|
+
TopAppBar.Actions = TopAppBarActions;
|
|
43
|
+
export { TopAppBar };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["jetpack-compose/TopAppBar/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","createViewModifierEventListener","TopAppBarNativeView","SlotNativeView","TopAppBarTitle","props","slotName","children","TopAppBarNavigationIcon","TopAppBarActions","TopAppBar","modifiers","restProps","undefined","Title","NavigationIcon","Actions"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAKzC,SAASC,+BAA+B,QAAQ,qBAAqB;AA0DrE,MAAMC,sBAA2DF,kBAC/D,UACA;AAGF,MAAMG,iBAA2DH,kBAC/D,UACA;AAGF;;CAEC,GACD,SAASI,eAAeC,KAAgB;IACtC,qBAAO,KAACF;QAAeG,UAAS;kBAASD,MAAME,QAAQ;;AACzD;AAEA;;CAEC,GACD,SAASC,wBAAwBH,KAAgB;IAC/C,qBAAO,KAACF;QAAeG,UAAS;kBAAkBD,MAAME,QAAQ;;AAClE;AAEA;;CAEC,GACD,SAASE,iBAAiBJ,KAAgB;IACxC,qBAAO,KAACF;QAAeG,UAAS;kBAAWD,MAAME,QAAQ;;AAC3D;AAEA;;CAEC,GACD,SAASG,UAAUL,KAAqB;IACtC,MAAM,EAAEM,SAAS,EAAE,GAAGC,WAAW,GAAGP;IACpC,qBACE,KAACH;QACCS,WAAWA;QACV,GAAIA,YAAYV,gCAAgCU,aAAaE,SAAS;QACtE,GAAGD,SAAS;;AAGnB;AAEAF,UAAUI,KAAK,GAAGV;AAClBM,UAAUK,cAAc,GAAGP;AAC3BE,UAAUM,OAAO,GAAGP;AAEpB,SAASC,SAAS,GAAG"}
|
|
@@ -37,6 +37,7 @@ export * from './SearchBar';
|
|
|
37
37
|
export * from './Snackbar';
|
|
38
38
|
export * from './DockedSearchBar';
|
|
39
39
|
export * from './HorizontalFloatingToolbar';
|
|
40
|
+
export * from './TopAppBar';
|
|
40
41
|
export * from './FloatingActionButton';
|
|
41
42
|
export * from './PullToRefreshBox';
|
|
42
43
|
export * from './RadioButton';
|
|
@@ -48,6 +49,7 @@ export * from './AnimatedVisibility';
|
|
|
48
49
|
export * from './Box';
|
|
49
50
|
export * from './Row';
|
|
50
51
|
export * from './Column';
|
|
52
|
+
export * from './CompositionLocalProvider';
|
|
51
53
|
export * from './FlowRow';
|
|
52
54
|
export { useNativeState, useWorkletCallback, type WorkletCallback } from '../State';
|
|
53
55
|
export type { ViewEvent } from '../types';
|