@yahoo/uds-mobile 2.3.4 → 2.4.1
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/android/build.gradle +39 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/java/com/yahoo/uds/screencornerradius/UDSScreenCornerRadiusModule.kt +44 -0
- package/dist/bin/generateTheme.mjs +10 -0
- package/dist/bin/mobile/scripts/utils/configToRNMappings.mjs +4 -1
- package/dist/components/AndroidBackHandler.cjs +31 -0
- package/dist/components/AndroidBackHandler.d.cts +21 -0
- package/dist/components/AndroidBackHandler.d.cts.map +1 -0
- package/dist/components/AndroidBackHandler.d.ts +21 -0
- package/dist/components/AndroidBackHandler.d.ts.map +1 -0
- package/dist/components/AndroidBackHandler.js +30 -0
- package/dist/components/AndroidBackHandler.js.map +1 -0
- package/dist/components/Avatar.cjs +1 -1
- package/dist/components/Avatar.js +1 -1
- package/dist/components/Badge.cjs +1 -1
- package/dist/components/Badge.js +1 -1
- package/dist/components/BottomSheet/BottomSheet.cjs +336 -0
- package/dist/components/BottomSheet/BottomSheet.d.cts +33 -0
- package/dist/components/BottomSheet/BottomSheet.d.cts.map +1 -0
- package/dist/components/BottomSheet/BottomSheet.d.ts +33 -0
- package/dist/components/BottomSheet/BottomSheet.d.ts.map +1 -0
- package/dist/components/BottomSheet/BottomSheet.js +334 -0
- package/dist/components/BottomSheet/BottomSheet.js.map +1 -0
- package/dist/components/BottomSheet/BottomSheetContent.cjs +65 -0
- package/dist/components/BottomSheet/BottomSheetContent.d.cts +22 -0
- package/dist/components/BottomSheet/BottomSheetContent.d.cts.map +1 -0
- package/dist/components/BottomSheet/BottomSheetContent.d.ts +22 -0
- package/dist/components/BottomSheet/BottomSheetContent.d.ts.map +1 -0
- package/dist/components/BottomSheet/BottomSheetContent.js +63 -0
- package/dist/components/BottomSheet/BottomSheetContent.js.map +1 -0
- package/dist/components/BottomSheet/BottomSheetDismiss.cjs +28 -0
- package/dist/components/BottomSheet/BottomSheetDismiss.d.cts +25 -0
- package/dist/components/BottomSheet/BottomSheetDismiss.d.cts.map +1 -0
- package/dist/components/BottomSheet/BottomSheetDismiss.d.ts +25 -0
- package/dist/components/BottomSheet/BottomSheetDismiss.d.ts.map +1 -0
- package/dist/components/BottomSheet/BottomSheetDismiss.js +27 -0
- package/dist/components/BottomSheet/BottomSheetDismiss.js.map +1 -0
- package/dist/components/BottomSheet/BottomSheetHandle.cjs +56 -0
- package/dist/components/BottomSheet/BottomSheetHandle.d.cts +14 -0
- package/dist/components/BottomSheet/BottomSheetHandle.d.cts.map +1 -0
- package/dist/components/BottomSheet/BottomSheetHandle.d.ts +14 -0
- package/dist/components/BottomSheet/BottomSheetHandle.d.ts.map +1 -0
- package/dist/components/BottomSheet/BottomSheetHandle.js +55 -0
- package/dist/components/BottomSheet/BottomSheetHandle.js.map +1 -0
- package/dist/components/BottomSheet/BottomSheetHeader.cjs +69 -0
- package/dist/components/BottomSheet/BottomSheetHeader.d.cts +16 -0
- package/dist/components/BottomSheet/BottomSheetHeader.d.cts.map +1 -0
- package/dist/components/BottomSheet/BottomSheetHeader.d.ts +16 -0
- package/dist/components/BottomSheet/BottomSheetHeader.d.ts.map +1 -0
- package/dist/components/BottomSheet/BottomSheetHeader.js +68 -0
- package/dist/components/BottomSheet/BottomSheetHeader.js.map +1 -0
- package/dist/components/BottomSheet/BottomSheetInternalProvider.cjs +26 -0
- package/dist/components/BottomSheet/BottomSheetInternalProvider.d.cts +23 -0
- package/dist/components/BottomSheet/BottomSheetInternalProvider.d.cts.map +1 -0
- package/dist/components/BottomSheet/BottomSheetInternalProvider.d.ts +23 -0
- package/dist/components/BottomSheet/BottomSheetInternalProvider.d.ts.map +1 -0
- package/dist/components/BottomSheet/BottomSheetInternalProvider.js +24 -0
- package/dist/components/BottomSheet/BottomSheetInternalProvider.js.map +1 -0
- package/dist/components/BottomSheet/BottomSheetProvider.cjs +33 -0
- package/dist/components/BottomSheet/BottomSheetProvider.d.cts +24 -0
- package/dist/components/BottomSheet/BottomSheetProvider.d.cts.map +1 -0
- package/dist/components/BottomSheet/BottomSheetProvider.d.ts +24 -0
- package/dist/components/BottomSheet/BottomSheetProvider.d.ts.map +1 -0
- package/dist/components/BottomSheet/BottomSheetProvider.js +31 -0
- package/dist/components/BottomSheet/BottomSheetProvider.js.map +1 -0
- package/dist/components/BottomSheet/BottomSheetTrigger.cjs +28 -0
- package/dist/components/BottomSheet/BottomSheetTrigger.d.cts +25 -0
- package/dist/components/BottomSheet/BottomSheetTrigger.d.cts.map +1 -0
- package/dist/components/BottomSheet/BottomSheetTrigger.d.ts +25 -0
- package/dist/components/BottomSheet/BottomSheetTrigger.d.ts.map +1 -0
- package/dist/components/BottomSheet/BottomSheetTrigger.js +27 -0
- package/dist/components/BottomSheet/BottomSheetTrigger.js.map +1 -0
- package/dist/components/BottomSheet/index.cjs +19 -0
- package/dist/components/BottomSheet/index.d.cts +11 -0
- package/dist/components/BottomSheet/index.d.ts +11 -0
- package/dist/components/BottomSheet/index.js +11 -0
- package/dist/components/BottomSheet/types.cjs +1 -0
- package/dist/components/BottomSheet/types.d.cts +173 -0
- package/dist/components/BottomSheet/types.d.cts.map +1 -0
- package/dist/components/BottomSheet/types.d.ts +173 -0
- package/dist/components/BottomSheet/types.d.ts.map +1 -0
- package/dist/components/BottomSheet/types.js +1 -0
- package/dist/components/BottomSheet/useBottomSheetDrag.cjs +191 -0
- package/dist/components/BottomSheet/useBottomSheetDrag.d.cts +69 -0
- package/dist/components/BottomSheet/useBottomSheetDrag.d.cts.map +1 -0
- package/dist/components/BottomSheet/useBottomSheetDrag.d.ts +69 -0
- package/dist/components/BottomSheet/useBottomSheetDrag.d.ts.map +1 -0
- package/dist/components/BottomSheet/useBottomSheetDrag.js +190 -0
- package/dist/components/BottomSheet/useBottomSheetDrag.js.map +1 -0
- package/dist/components/BottomSheet/useBottomSheetScroll.cjs +61 -0
- package/dist/components/BottomSheet/useBottomSheetScroll.d.cts +48 -0
- package/dist/components/BottomSheet/useBottomSheetScroll.d.cts.map +1 -0
- package/dist/components/BottomSheet/useBottomSheetScroll.d.ts +48 -0
- package/dist/components/BottomSheet/useBottomSheetScroll.d.ts.map +1 -0
- package/dist/components/BottomSheet/useBottomSheetScroll.js +60 -0
- package/dist/components/BottomSheet/useBottomSheetScroll.js.map +1 -0
- package/dist/components/BottomSheet/useBottomSheetSnapModel.cjs +142 -0
- package/dist/components/BottomSheet/useBottomSheetSnapModel.d.cts +79 -0
- package/dist/components/BottomSheet/useBottomSheetSnapModel.d.cts.map +1 -0
- package/dist/components/BottomSheet/useBottomSheetSnapModel.d.ts +79 -0
- package/dist/components/BottomSheet/useBottomSheetSnapModel.d.ts.map +1 -0
- package/dist/components/BottomSheet/useBottomSheetSnapModel.js +140 -0
- package/dist/components/BottomSheet/useBottomSheetSnapModel.js.map +1 -0
- package/dist/components/BottomSheet/useBottomSheetStore.cjs +79 -0
- package/dist/components/BottomSheet/useBottomSheetStore.d.cts +45 -0
- package/dist/components/BottomSheet/useBottomSheetStore.d.cts.map +1 -0
- package/dist/components/BottomSheet/useBottomSheetStore.d.ts +45 -0
- package/dist/components/BottomSheet/useBottomSheetStore.d.ts.map +1 -0
- package/dist/components/BottomSheet/useBottomSheetStore.js +77 -0
- package/dist/components/BottomSheet/useBottomSheetStore.js.map +1 -0
- package/dist/components/BottomSheet/useExpansionMargins.cjs +57 -0
- package/dist/components/BottomSheet/useExpansionMargins.d.cts +59 -0
- package/dist/components/BottomSheet/useExpansionMargins.d.cts.map +1 -0
- package/dist/components/BottomSheet/useExpansionMargins.d.ts +59 -0
- package/dist/components/BottomSheet/useExpansionMargins.d.ts.map +1 -0
- package/dist/components/BottomSheet/useExpansionMargins.js +56 -0
- package/dist/components/BottomSheet/useExpansionMargins.js.map +1 -0
- package/dist/components/BottomSheet/useKeyboardAvoidance.cjs +53 -0
- package/dist/components/BottomSheet/useKeyboardAvoidance.d.cts +31 -0
- package/dist/components/BottomSheet/useKeyboardAvoidance.d.cts.map +1 -0
- package/dist/components/BottomSheet/useKeyboardAvoidance.d.ts +31 -0
- package/dist/components/BottomSheet/useKeyboardAvoidance.d.ts.map +1 -0
- package/dist/components/BottomSheet/useKeyboardAvoidance.js +52 -0
- package/dist/components/BottomSheet/useKeyboardAvoidance.js.map +1 -0
- package/dist/components/BottomSheet/utils.cjs +77 -0
- package/dist/components/BottomSheet/utils.d.cts +50 -0
- package/dist/components/BottomSheet/utils.d.cts.map +1 -0
- package/dist/components/BottomSheet/utils.d.ts +50 -0
- package/dist/components/BottomSheet/utils.d.ts.map +1 -0
- package/dist/components/BottomSheet/utils.js +72 -0
- package/dist/components/BottomSheet/utils.js.map +1 -0
- package/dist/components/Box.cjs +1 -1
- package/dist/components/Box.js +1 -1
- package/dist/components/Button.cjs +1 -1
- package/dist/components/Button.js +1 -1
- package/dist/components/Checkbox.cjs +1 -1
- package/dist/components/Checkbox.js +1 -1
- package/dist/components/Chip.cjs +1 -1
- package/dist/components/Chip.js +1 -1
- package/dist/components/Icon.cjs +1 -1
- package/dist/components/Icon.js +1 -1
- package/dist/components/IconButton.cjs +1 -1
- package/dist/components/IconButton.js +1 -1
- package/dist/components/Image.cjs +1 -1
- package/dist/components/Image.js +1 -1
- package/dist/components/Input.cjs +1 -1
- package/dist/components/Input.js +1 -1
- package/dist/components/Link.cjs +1 -1
- package/dist/components/Link.js +1 -1
- package/dist/components/Pressable.cjs +1 -1
- package/dist/components/Pressable.js +1 -1
- package/dist/components/Radio.cjs +1 -1
- package/dist/components/Radio.js +1 -1
- package/dist/components/Screen.cjs +1 -1
- package/dist/components/Screen.js +1 -1
- package/dist/components/Scrim.cjs +73 -0
- package/dist/components/Scrim.d.cts +43 -0
- package/dist/components/Scrim.d.cts.map +1 -0
- package/dist/components/Scrim.d.ts +43 -0
- package/dist/components/Scrim.d.ts.map +1 -0
- package/dist/components/Scrim.js +71 -0
- package/dist/components/Scrim.js.map +1 -0
- package/dist/components/Switch.cjs +1 -1
- package/dist/components/Switch.js +1 -1
- package/dist/components/Text.cjs +1 -1
- package/dist/components/Text.js +1 -1
- package/dist/components/UDSProvider.cjs +38 -0
- package/dist/components/UDSProvider.d.cts +30 -0
- package/dist/components/UDSProvider.d.cts.map +1 -0
- package/dist/components/UDSProvider.d.ts +30 -0
- package/dist/components/UDSProvider.d.ts.map +1 -0
- package/dist/components/UDSProvider.js +37 -0
- package/dist/components/UDSProvider.js.map +1 -0
- package/dist/native/UDSScreenCornerRadiusModule.cjs +12 -0
- package/dist/native/UDSScreenCornerRadiusModule.d.cts +12 -0
- package/dist/native/UDSScreenCornerRadiusModule.d.cts.map +1 -0
- package/dist/native/UDSScreenCornerRadiusModule.d.ts +12 -0
- package/dist/native/UDSScreenCornerRadiusModule.d.ts.map +1 -0
- package/dist/native/UDSScreenCornerRadiusModule.js +9 -0
- package/dist/native/UDSScreenCornerRadiusModule.js.map +1 -0
- package/dist/portal.cjs +81 -0
- package/dist/portal.d.cts +18 -0
- package/dist/portal.d.cts.map +1 -0
- package/dist/portal.d.ts +18 -0
- package/dist/portal.d.ts.map +1 -0
- package/dist/portal.js +79 -0
- package/dist/portal.js.map +1 -0
- package/expo-module.config.json +9 -0
- package/generated/styles.cjs +10 -0
- package/generated/styles.d.ts +15 -2
- package/generated/styles.mjs +10 -0
- package/generated/unistyles.d.ts +21 -0
- package/ios/UDSMobile.podspec +25 -0
- package/ios/UDSScreenCornerRadiusModule.swift +218 -0
- package/package.json +40 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
3
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
4
|
+
const require_components_Box = require('./Box.cjs');
|
|
5
|
+
let react = require("react");
|
|
6
|
+
let react_native = require("react-native");
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
let generated_styles = require("../../generated/styles");
|
|
9
|
+
let react_native_reanimated = require("react-native-reanimated");
|
|
10
|
+
react_native_reanimated = require_runtime.__toESM(react_native_reanimated);
|
|
11
|
+
let react_native_gesture_handler = require("react-native-gesture-handler");
|
|
12
|
+
|
|
13
|
+
//#region src/components/Scrim.tsx
|
|
14
|
+
/**
|
|
15
|
+
* Semi-transparent backdrop for modal overlays.
|
|
16
|
+
*
|
|
17
|
+
* Reads `backgroundColor` and `opacity` from the configurator's scrim tokens.
|
|
18
|
+
* Opacity is interpolated between 0 (closed) and the token value (open) based
|
|
19
|
+
* on the content's current `translateY` position.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <Scrim
|
|
24
|
+
* translateY={translateY}
|
|
25
|
+
* openTranslateY={openY}
|
|
26
|
+
* closedTranslateY={closedY}
|
|
27
|
+
* dismissible
|
|
28
|
+
* onDismiss={handleDismiss}
|
|
29
|
+
* />
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
const Scrim = (0, react.memo)(function Scrim({ translateY, openTranslateY, closedTranslateY, dismissible, onDismiss, blurTarget }) {
|
|
33
|
+
generated_styles.scrimStyles.useVariants({});
|
|
34
|
+
const scrimTokens = react_native.StyleSheet.flatten(generated_styles.scrimStyles.root);
|
|
35
|
+
const targetColor = scrimTokens.backgroundColor ?? "rgba(0, 0, 0, 1)";
|
|
36
|
+
const targetOpacity = scrimTokens.opacity ?? .2;
|
|
37
|
+
const blurIntensity = scrimTokens.backgroundBlurRadius ?? 0;
|
|
38
|
+
const showBlur = blurIntensity > 0 && (react_native.Platform.OS === "ios" || blurTarget != null);
|
|
39
|
+
const handleDismiss = (0, react.useCallback)(() => {
|
|
40
|
+
onDismiss();
|
|
41
|
+
}, [onDismiss]);
|
|
42
|
+
const animatedColorStyle = (0, react_native_reanimated.useAnimatedStyle)(() => {
|
|
43
|
+
return { opacity: (0, react_native_reanimated.interpolate)(translateY.value, [openTranslateY, closedTranslateY], [targetOpacity, 0], "clamp") };
|
|
44
|
+
});
|
|
45
|
+
const animatedBlurStyle = (0, react_native_reanimated.useAnimatedStyle)(() => {
|
|
46
|
+
return { opacity: (0, react_native_reanimated.interpolate)(translateY.value, [openTranslateY, closedTranslateY], [1, 0], "clamp") };
|
|
47
|
+
});
|
|
48
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native_gesture_handler.GestureDetector, {
|
|
49
|
+
gesture: react_native_gesture_handler.Gesture.Tap().enabled(dismissible).onEnd(() => {
|
|
50
|
+
"worklet";
|
|
51
|
+
(0, react_native_reanimated.runOnJS)(handleDismiss)();
|
|
52
|
+
}),
|
|
53
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_native.View, {
|
|
54
|
+
style: internalStyles.scrim,
|
|
55
|
+
children: [showBlur && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native_reanimated.default.View, {
|
|
56
|
+
style: [react_native.StyleSheet.absoluteFill, animatedBlurStyle],
|
|
57
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Box.Box, {
|
|
58
|
+
style: react_native.StyleSheet.absoluteFill,
|
|
59
|
+
blur: blurIntensity,
|
|
60
|
+
blurTarget
|
|
61
|
+
})
|
|
62
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native_reanimated.default.View, { style: [
|
|
63
|
+
react_native.StyleSheet.absoluteFill,
|
|
64
|
+
{ backgroundColor: targetColor },
|
|
65
|
+
animatedColorStyle
|
|
66
|
+
] })]
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
const internalStyles = react_native.StyleSheet.create({ scrim: { ...react_native.StyleSheet.absoluteFill } });
|
|
71
|
+
|
|
72
|
+
//#endregion
|
|
73
|
+
exports.Scrim = Scrim;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
import * as react from "react";
|
|
3
|
+
import { RefObject } from "react";
|
|
4
|
+
import { View } from "react-native";
|
|
5
|
+
import { SharedValue } from "react-native-reanimated";
|
|
6
|
+
|
|
7
|
+
//#region src/components/Scrim.d.ts
|
|
8
|
+
interface ScrimProps {
|
|
9
|
+
/** Animated translateY position of the overlaying content (UI-thread shared value). */
|
|
10
|
+
translateY: SharedValue<number>;
|
|
11
|
+
/** `translateY` value when the content is at its open position. */
|
|
12
|
+
openTranslateY: number;
|
|
13
|
+
/** `translateY` value when the content is fully closed / off-screen. */
|
|
14
|
+
closedTranslateY: number;
|
|
15
|
+
/** Whether tapping the scrim dismisses the content. */
|
|
16
|
+
dismissible: boolean;
|
|
17
|
+
/** Callback invoked when the scrim is tapped and `dismissible` is `true`. */
|
|
18
|
+
onDismiss: () => void;
|
|
19
|
+
/** Ref to a `<BlurTarget>` view for Android backdrop blur. Not needed on iOS. */
|
|
20
|
+
blurTarget?: RefObject<View | null>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Semi-transparent backdrop for modal overlays.
|
|
24
|
+
*
|
|
25
|
+
* Reads `backgroundColor` and `opacity` from the configurator's scrim tokens.
|
|
26
|
+
* Opacity is interpolated between 0 (closed) and the token value (open) based
|
|
27
|
+
* on the content's current `translateY` position.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <Scrim
|
|
32
|
+
* translateY={translateY}
|
|
33
|
+
* openTranslateY={openY}
|
|
34
|
+
* closedTranslateY={closedY}
|
|
35
|
+
* dismissible
|
|
36
|
+
* onDismiss={handleDismiss}
|
|
37
|
+
* />
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
declare const Scrim: react.NamedExoticComponent<ScrimProps>;
|
|
41
|
+
//#endregion
|
|
42
|
+
export { Scrim, type ScrimProps };
|
|
43
|
+
//# sourceMappingURL=Scrim.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Scrim.d.cts","names":[],"sources":["../../src/components/Scrim.tsx"],"mappings":";;;;;;;UAgBU,UAAA;;EAER,UAAA,EAAY,WAAA;EAFJ;EAIR,cAAA;;EAEA,gBAAA;EAMuB;EAJvB,WAAA;EAIsB;EAFtB,SAAA;EARA;EAUA,UAAA,GAAa,SAAA,CAAU,IAAA;AAAA;;;;;;;;;AAAI;;;;;;;;;;cAqBvB,KAAA,EAAK,KAAA,CAAA,oBAAA,CAAA,UAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
import * as react from "react";
|
|
3
|
+
import { RefObject } from "react";
|
|
4
|
+
import { View } from "react-native";
|
|
5
|
+
import { SharedValue } from "react-native-reanimated";
|
|
6
|
+
|
|
7
|
+
//#region src/components/Scrim.d.ts
|
|
8
|
+
interface ScrimProps {
|
|
9
|
+
/** Animated translateY position of the overlaying content (UI-thread shared value). */
|
|
10
|
+
translateY: SharedValue<number>;
|
|
11
|
+
/** `translateY` value when the content is at its open position. */
|
|
12
|
+
openTranslateY: number;
|
|
13
|
+
/** `translateY` value when the content is fully closed / off-screen. */
|
|
14
|
+
closedTranslateY: number;
|
|
15
|
+
/** Whether tapping the scrim dismisses the content. */
|
|
16
|
+
dismissible: boolean;
|
|
17
|
+
/** Callback invoked when the scrim is tapped and `dismissible` is `true`. */
|
|
18
|
+
onDismiss: () => void;
|
|
19
|
+
/** Ref to a `<BlurTarget>` view for Android backdrop blur. Not needed on iOS. */
|
|
20
|
+
blurTarget?: RefObject<View | null>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Semi-transparent backdrop for modal overlays.
|
|
24
|
+
*
|
|
25
|
+
* Reads `backgroundColor` and `opacity` from the configurator's scrim tokens.
|
|
26
|
+
* Opacity is interpolated between 0 (closed) and the token value (open) based
|
|
27
|
+
* on the content's current `translateY` position.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <Scrim
|
|
32
|
+
* translateY={translateY}
|
|
33
|
+
* openTranslateY={openY}
|
|
34
|
+
* closedTranslateY={closedY}
|
|
35
|
+
* dismissible
|
|
36
|
+
* onDismiss={handleDismiss}
|
|
37
|
+
* />
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
declare const Scrim: react.NamedExoticComponent<ScrimProps>;
|
|
41
|
+
//#endregion
|
|
42
|
+
export { Scrim, type ScrimProps };
|
|
43
|
+
//# sourceMappingURL=Scrim.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Scrim.d.ts","names":[],"sources":["../../src/components/Scrim.tsx"],"mappings":";;;;;;;UAgBU,UAAA;;EAER,UAAA,EAAY,WAAA;EAFJ;EAIR,cAAA;;EAEA,gBAAA;EAMuB;EAJvB,WAAA;EAIsB;EAFtB,SAAA;EARA;EAUA,UAAA,GAAa,SAAA,CAAU,IAAA;AAAA;;;;;;;;;AAAI;;;;;;;;;;cAqBvB,KAAA,EAAK,KAAA,CAAA,oBAAA,CAAA,UAAA"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
import { Box } from "./Box.js";
|
|
3
|
+
import { memo, useCallback } from "react";
|
|
4
|
+
import { Platform, StyleSheet, View } from "react-native";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { scrimStyles } from "../../generated/styles";
|
|
7
|
+
import Animated, { interpolate, runOnJS, useAnimatedStyle } from "react-native-reanimated";
|
|
8
|
+
import { Gesture, GestureDetector } from "react-native-gesture-handler";
|
|
9
|
+
|
|
10
|
+
//#region src/components/Scrim.tsx
|
|
11
|
+
/**
|
|
12
|
+
* Semi-transparent backdrop for modal overlays.
|
|
13
|
+
*
|
|
14
|
+
* Reads `backgroundColor` and `opacity` from the configurator's scrim tokens.
|
|
15
|
+
* Opacity is interpolated between 0 (closed) and the token value (open) based
|
|
16
|
+
* on the content's current `translateY` position.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <Scrim
|
|
21
|
+
* translateY={translateY}
|
|
22
|
+
* openTranslateY={openY}
|
|
23
|
+
* closedTranslateY={closedY}
|
|
24
|
+
* dismissible
|
|
25
|
+
* onDismiss={handleDismiss}
|
|
26
|
+
* />
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
const Scrim = memo(function Scrim({ translateY, openTranslateY, closedTranslateY, dismissible, onDismiss, blurTarget }) {
|
|
30
|
+
scrimStyles.useVariants({});
|
|
31
|
+
const scrimTokens = StyleSheet.flatten(scrimStyles.root);
|
|
32
|
+
const targetColor = scrimTokens.backgroundColor ?? "rgba(0, 0, 0, 1)";
|
|
33
|
+
const targetOpacity = scrimTokens.opacity ?? .2;
|
|
34
|
+
const blurIntensity = scrimTokens.backgroundBlurRadius ?? 0;
|
|
35
|
+
const showBlur = blurIntensity > 0 && (Platform.OS === "ios" || blurTarget != null);
|
|
36
|
+
const handleDismiss = useCallback(() => {
|
|
37
|
+
onDismiss();
|
|
38
|
+
}, [onDismiss]);
|
|
39
|
+
const animatedColorStyle = useAnimatedStyle(() => {
|
|
40
|
+
return { opacity: interpolate(translateY.value, [openTranslateY, closedTranslateY], [targetOpacity, 0], "clamp") };
|
|
41
|
+
});
|
|
42
|
+
const animatedBlurStyle = useAnimatedStyle(() => {
|
|
43
|
+
return { opacity: interpolate(translateY.value, [openTranslateY, closedTranslateY], [1, 0], "clamp") };
|
|
44
|
+
});
|
|
45
|
+
return /* @__PURE__ */ jsx(GestureDetector, {
|
|
46
|
+
gesture: Gesture.Tap().enabled(dismissible).onEnd(() => {
|
|
47
|
+
"worklet";
|
|
48
|
+
runOnJS(handleDismiss)();
|
|
49
|
+
}),
|
|
50
|
+
children: /* @__PURE__ */ jsxs(View, {
|
|
51
|
+
style: internalStyles.scrim,
|
|
52
|
+
children: [showBlur && /* @__PURE__ */ jsx(Animated.View, {
|
|
53
|
+
style: [StyleSheet.absoluteFill, animatedBlurStyle],
|
|
54
|
+
children: /* @__PURE__ */ jsx(Box, {
|
|
55
|
+
style: StyleSheet.absoluteFill,
|
|
56
|
+
blur: blurIntensity,
|
|
57
|
+
blurTarget
|
|
58
|
+
})
|
|
59
|
+
}), /* @__PURE__ */ jsx(Animated.View, { style: [
|
|
60
|
+
StyleSheet.absoluteFill,
|
|
61
|
+
{ backgroundColor: targetColor },
|
|
62
|
+
animatedColorStyle
|
|
63
|
+
] })]
|
|
64
|
+
})
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
const internalStyles = StyleSheet.create({ scrim: { ...StyleSheet.absoluteFill } });
|
|
68
|
+
|
|
69
|
+
//#endregion
|
|
70
|
+
export { Scrim };
|
|
71
|
+
//# sourceMappingURL=Scrim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Scrim.js","names":[],"sources":["../../src/components/Scrim.tsx"],"sourcesContent":["import type { RefObject } from 'react';\nimport { memo, useCallback } from 'react';\nimport { Platform, StyleSheet, View } from 'react-native';\nimport { Gesture, GestureDetector } from 'react-native-gesture-handler';\nimport type { SharedValue } from 'react-native-reanimated';\nimport Animated, { interpolate, runOnJS, useAnimatedStyle } from 'react-native-reanimated';\n\nimport { scrimStyles } from '../../generated/styles';\nimport { Box } from './Box';\n\ninterface ScrimRootTokens {\n backgroundColor?: string;\n backgroundBlurRadius?: number;\n opacity?: number;\n}\n\ninterface ScrimProps {\n /** Animated translateY position of the overlaying content (UI-thread shared value). */\n translateY: SharedValue<number>;\n /** `translateY` value when the content is at its open position. */\n openTranslateY: number;\n /** `translateY` value when the content is fully closed / off-screen. */\n closedTranslateY: number;\n /** Whether tapping the scrim dismisses the content. */\n dismissible: boolean;\n /** Callback invoked when the scrim is tapped and `dismissible` is `true`. */\n onDismiss: () => void;\n /** Ref to a `<BlurTarget>` view for Android backdrop blur. Not needed on iOS. */\n blurTarget?: RefObject<View | null>;\n}\n\n/**\n * Semi-transparent backdrop for modal overlays.\n *\n * Reads `backgroundColor` and `opacity` from the configurator's scrim tokens.\n * Opacity is interpolated between 0 (closed) and the token value (open) based\n * on the content's current `translateY` position.\n *\n * @example\n * ```tsx\n * <Scrim\n * translateY={translateY}\n * openTranslateY={openY}\n * closedTranslateY={closedY}\n * dismissible\n * onDismiss={handleDismiss}\n * />\n * ```\n */\nconst Scrim = memo(function Scrim({\n translateY,\n openTranslateY,\n closedTranslateY,\n dismissible,\n onDismiss,\n blurTarget,\n}: ScrimProps) {\n scrimStyles.useVariants({});\n const scrimTokens = StyleSheet.flatten(scrimStyles.root) as ScrimRootTokens;\n const targetColor = scrimTokens.backgroundColor ?? 'rgba(0, 0, 0, 1)';\n const targetOpacity = scrimTokens.opacity ?? 0.2;\n const blurIntensity = scrimTokens.backgroundBlurRadius ?? 0;\n // iOS blur works without a target; Android requires a blurTarget ref.\n const showBlur = blurIntensity > 0 && (Platform.OS === 'ios' || blurTarget != null);\n\n const handleDismiss = useCallback(() => {\n onDismiss();\n }, [onDismiss]);\n\n const animatedColorStyle = useAnimatedStyle(() => {\n const opacity = interpolate(\n translateY.value,\n [openTranslateY, closedTranslateY],\n [targetOpacity, 0],\n 'clamp',\n );\n\n return { opacity };\n });\n\n // Blur needs its own opacity animation (1 → 0) separate from the color overlay.\n // On iOS, UIVisualEffectView breaks if its parent rests at a fractional opacity.\n const animatedBlurStyle = useAnimatedStyle(() => {\n const opacity = interpolate(\n translateY.value,\n [openTranslateY, closedTranslateY],\n [1, 0],\n 'clamp',\n );\n\n return { opacity };\n });\n\n // Tap gesture on scrim for dismissal.\n const tapGesture = Gesture.Tap()\n .enabled(dismissible)\n .onEnd(() => {\n 'worklet';\n runOnJS(handleDismiss)();\n });\n\n return (\n <GestureDetector gesture={tapGesture}>\n <View style={internalStyles.scrim}>\n {showBlur && (\n <Animated.View style={[StyleSheet.absoluteFill, animatedBlurStyle]}>\n <Box style={StyleSheet.absoluteFill} blur={blurIntensity} blurTarget={blurTarget} />\n </Animated.View>\n )}\n <Animated.View\n style={[StyleSheet.absoluteFill, { backgroundColor: targetColor }, animatedColorStyle]}\n />\n </View>\n </GestureDetector>\n );\n});\n\nconst internalStyles = StyleSheet.create({\n scrim: {\n ...StyleSheet.absoluteFill,\n },\n});\n\nexport { Scrim };\nexport type { ScrimProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,MAAM,QAAQ,KAAK,SAAS,MAAM,EAChC,YACA,gBACA,kBACA,aACA,WACA,cACa;AACb,aAAY,YAAY,EAAE,CAAC;CAC3B,MAAM,cAAc,WAAW,QAAQ,YAAY,KAAK;CACxD,MAAM,cAAc,YAAY,mBAAmB;CACnD,MAAM,gBAAgB,YAAY,WAAW;CAC7C,MAAM,gBAAgB,YAAY,wBAAwB;CAE1D,MAAM,WAAW,gBAAgB,MAAM,SAAS,OAAO,SAAS,cAAc;CAE9E,MAAM,gBAAgB,kBAAkB;AACtC,aAAW;IACV,CAAC,UAAU,CAAC;CAEf,MAAM,qBAAqB,uBAAuB;AAQhD,SAAO,EAAE,SAPO,YACd,WAAW,OACX,CAAC,gBAAgB,iBAAiB,EAClC,CAAC,eAAe,EAAE,EAClB,QACD,EAEiB;GAClB;CAIF,MAAM,oBAAoB,uBAAuB;AAQ/C,SAAO,EAAE,SAPO,YACd,WAAW,OACX,CAAC,gBAAgB,iBAAiB,EAClC,CAAC,GAAG,EAAE,EACN,QACD,EAEiB;GAClB;AAUF,QACE,oBAAC;EAAgB,SARA,QAAQ,KAAK,CAC7B,QAAQ,YAAY,CACpB,YAAY;AACX;AACA,WAAQ,cAAc,EAAE;IACxB;YAIA,qBAAC;GAAK,OAAO,eAAe;cACzB,YACC,oBAAC,SAAS;IAAK,OAAO,CAAC,WAAW,cAAc,kBAAkB;cAChE,oBAAC;KAAI,OAAO,WAAW;KAAc,MAAM;KAA2B;MAAc;KACtE,EAElB,oBAAC,SAAS,QACR,OAAO;IAAC,WAAW;IAAc,EAAE,iBAAiB,aAAa;IAAE;IAAmB,GACtF;IACG;GACS;EAEpB;AAEF,MAAM,iBAAiB,WAAW,OAAO,EACvC,OAAO,EACL,GAAG,WAAW,cACf,EACF,CAAC"}
|
|
@@ -6,9 +6,9 @@ const require_components_Text = require('./Text.cjs');
|
|
|
6
6
|
const require_components_HStack = require('./HStack.cjs');
|
|
7
7
|
let react = require("react");
|
|
8
8
|
let react_native = require("react-native");
|
|
9
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
10
|
let generated_styles = require("../../generated/styles");
|
|
10
11
|
let react_native_unistyles = require("react-native-unistyles");
|
|
11
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
12
12
|
let react_native_reanimated = require("react-native-reanimated");
|
|
13
13
|
react_native_reanimated = require_runtime.__toESM(react_native_reanimated);
|
|
14
14
|
let react_native_unistyles_reanimated = require("react-native-unistyles/reanimated");
|
|
@@ -4,9 +4,9 @@ import { Text as Text$1 } from "./Text.js";
|
|
|
4
4
|
import { HStack } from "./HStack.js";
|
|
5
5
|
import { memo, useCallback, useEffect, useMemo, useState } from "react";
|
|
6
6
|
import { AccessibilityInfo, Pressable } from "react-native";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
8
|
import { switchStyles } from "../../generated/styles";
|
|
8
9
|
import { StyleSheet as StyleSheet$1 } from "react-native-unistyles";
|
|
9
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import Animated, { useAnimatedStyle, useDerivedValue, withTiming } from "react-native-reanimated";
|
|
11
11
|
import { useAnimatedVariantColor } from "react-native-unistyles/reanimated";
|
|
12
12
|
|
package/dist/components/Text.cjs
CHANGED
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
3
3
|
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
4
4
|
let react = require("react");
|
|
5
5
|
let react_native = require("react-native");
|
|
6
|
-
let generated_styles = require("../../generated/styles");
|
|
7
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
let generated_styles = require("../../generated/styles");
|
|
8
8
|
|
|
9
9
|
//#region src/components/Text.tsx
|
|
10
10
|
/**
|
package/dist/components/Text.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
2
|
import { memo, useMemo } from "react";
|
|
3
3
|
import { Text as Text$1 } from "react-native";
|
|
4
|
-
import { styles } from "../../generated/styles";
|
|
5
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { styles } from "../../generated/styles";
|
|
6
6
|
|
|
7
7
|
//#region src/components/Text.tsx
|
|
8
8
|
/**
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
3
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
4
|
+
const require_portal = require('../portal.cjs');
|
|
5
|
+
let react = require("react");
|
|
6
|
+
let react_native = require("react-native");
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
let react_native_gesture_handler = require("react-native-gesture-handler");
|
|
9
|
+
|
|
10
|
+
//#region src/components/UDSProvider.tsx
|
|
11
|
+
/**
|
|
12
|
+
* Root provider for UDS Mobile.
|
|
13
|
+
*
|
|
14
|
+
* Place this at the top of your app layout:
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* import { UDSProvider } from '@yahoo/uds-mobile/UDSProvider';
|
|
19
|
+
*
|
|
20
|
+
* export default function RootLayout() {
|
|
21
|
+
* return (
|
|
22
|
+
* <UDSProvider>
|
|
23
|
+
* <Stack />
|
|
24
|
+
* </UDSProvider>
|
|
25
|
+
* );
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
const UDSProvider = (0, react.memo)(function UDSProvider({ children }) {
|
|
30
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native_gesture_handler.GestureHandlerRootView, {
|
|
31
|
+
style: styles.root,
|
|
32
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portal.PortalProvider, { children })
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
const styles = react_native.StyleSheet.create({ root: { flex: 1 } });
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
exports.UDSProvider = UDSProvider;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
|
|
2
|
+
import * as react from "react";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/UDSProvider.d.ts
|
|
6
|
+
interface UDSProviderProps {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Root provider for UDS Mobile.
|
|
11
|
+
*
|
|
12
|
+
* Place this at the top of your app layout:
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* import { UDSProvider } from '@yahoo/uds-mobile/UDSProvider';
|
|
17
|
+
*
|
|
18
|
+
* export default function RootLayout() {
|
|
19
|
+
* return (
|
|
20
|
+
* <UDSProvider>
|
|
21
|
+
* <Stack />
|
|
22
|
+
* </UDSProvider>
|
|
23
|
+
* );
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
declare const UDSProvider: react.NamedExoticComponent<UDSProviderProps>;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { UDSProvider, type UDSProviderProps };
|
|
30
|
+
//# sourceMappingURL=UDSProvider.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UDSProvider.d.cts","names":[],"sources":["../../src/components/UDSProvider.tsx"],"mappings":";;;;;UAOU,gBAAA;EACR,QAAA,EAAU,SAAA;AAAA;AAR2B;;;;;AAQlB;;;;;;;;;;;;;AARkB,cA6BjC,WAAA,EAAW,KAAA,CAAA,oBAAA,CAAA,gBAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
|
|
2
|
+
import * as react from "react";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/UDSProvider.d.ts
|
|
6
|
+
interface UDSProviderProps {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Root provider for UDS Mobile.
|
|
11
|
+
*
|
|
12
|
+
* Place this at the top of your app layout:
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* import { UDSProvider } from '@yahoo/uds-mobile/UDSProvider';
|
|
17
|
+
*
|
|
18
|
+
* export default function RootLayout() {
|
|
19
|
+
* return (
|
|
20
|
+
* <UDSProvider>
|
|
21
|
+
* <Stack />
|
|
22
|
+
* </UDSProvider>
|
|
23
|
+
* );
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
declare const UDSProvider: react.NamedExoticComponent<UDSProviderProps>;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { UDSProvider, type UDSProviderProps };
|
|
30
|
+
//# sourceMappingURL=UDSProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UDSProvider.d.ts","names":[],"sources":["../../src/components/UDSProvider.tsx"],"mappings":";;;;;UAOU,gBAAA;EACR,QAAA,EAAU,SAAA;AAAA;AAR2B;;;;;AAQlB;;;;;;;;;;;;;AARkB,cA6BjC,WAAA,EAAW,KAAA,CAAA,oBAAA,CAAA,gBAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
import { PortalProvider } from "../portal.js";
|
|
3
|
+
import { memo } from "react";
|
|
4
|
+
import { StyleSheet } from "react-native";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
|
7
|
+
|
|
8
|
+
//#region src/components/UDSProvider.tsx
|
|
9
|
+
/**
|
|
10
|
+
* Root provider for UDS Mobile.
|
|
11
|
+
*
|
|
12
|
+
* Place this at the top of your app layout:
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* import { UDSProvider } from '@yahoo/uds-mobile/UDSProvider';
|
|
17
|
+
*
|
|
18
|
+
* export default function RootLayout() {
|
|
19
|
+
* return (
|
|
20
|
+
* <UDSProvider>
|
|
21
|
+
* <Stack />
|
|
22
|
+
* </UDSProvider>
|
|
23
|
+
* );
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
const UDSProvider = memo(function UDSProvider({ children }) {
|
|
28
|
+
return /* @__PURE__ */ jsx(GestureHandlerRootView, {
|
|
29
|
+
style: styles.root,
|
|
30
|
+
children: /* @__PURE__ */ jsx(PortalProvider, { children })
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
const styles = StyleSheet.create({ root: { flex: 1 } });
|
|
34
|
+
|
|
35
|
+
//#endregion
|
|
36
|
+
export { UDSProvider };
|
|
37
|
+
//# sourceMappingURL=UDSProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UDSProvider.js","names":[],"sources":["../../src/components/UDSProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { memo } from 'react';\nimport { StyleSheet } from 'react-native';\nimport { GestureHandlerRootView } from 'react-native-gesture-handler';\n\nimport { PortalProvider } from '../portal';\n\ninterface UDSProviderProps {\n children: ReactNode;\n}\n\n/**\n * Root provider for UDS Mobile.\n *\n * Place this at the top of your app layout:\n *\n * @example\n * ```tsx\n * import { UDSProvider } from '@yahoo/uds-mobile/UDSProvider';\n *\n * export default function RootLayout() {\n * return (\n * <UDSProvider>\n * <Stack />\n * </UDSProvider>\n * );\n * }\n * ```\n */\nconst UDSProvider = memo(function UDSProvider({ children }: UDSProviderProps) {\n return (\n <GestureHandlerRootView style={styles.root}>\n <PortalProvider>{children}</PortalProvider>\n </GestureHandlerRootView>\n );\n});\n\nconst styles = StyleSheet.create({\n root: {\n flex: 1,\n },\n});\n\nexport { UDSProvider };\nexport type { UDSProviderProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,cAAc,KAAK,SAAS,YAAY,EAAE,YAA8B;AAC5E,QACE,oBAAC;EAAuB,OAAO,OAAO;YACpC,oBAAC,kBAAgB,WAA0B;GACpB;EAE3B;AAEF,MAAM,SAAS,WAAW,OAAO,EAC/B,MAAM,EACJ,MAAM,GACP,EACF,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
3
|
+
|
|
4
|
+
//#region src/native/UDSScreenCornerRadiusModule.ts
|
|
5
|
+
const nativeModule = (globalThis.expo?.modules)?.UDSScreenCornerRadius ?? null;
|
|
6
|
+
const loadState = nativeModule ? "loaded" : "failed";
|
|
7
|
+
const loadListeners = [];
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
exports.loadListeners = loadListeners;
|
|
11
|
+
exports.loadState = loadState;
|
|
12
|
+
exports.nativeModule = nativeModule;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/native/UDSScreenCornerRadiusModule.d.ts
|
|
3
|
+
interface UDSScreenCornerRadiusModuleType {
|
|
4
|
+
getCornerRadiusSync(): number | null;
|
|
5
|
+
getCornerRadius(): Promise<number | null>;
|
|
6
|
+
}
|
|
7
|
+
declare const nativeModule: UDSScreenCornerRadiusModuleType;
|
|
8
|
+
declare const loadState: 'pending' | 'loaded' | 'failed';
|
|
9
|
+
declare const loadListeners: (() => void)[];
|
|
10
|
+
//#endregion
|
|
11
|
+
export { loadListeners, loadState, nativeModule };
|
|
12
|
+
//# sourceMappingURL=UDSScreenCornerRadiusModule.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UDSScreenCornerRadiusModule.d.cts","names":[],"sources":["../../src/native/UDSScreenCornerRadiusModule.ts"],"mappings":";;UAAU,+BAAA;EACR,mBAAA;EACA,eAAA,IAAmB,OAAA;AAAA;AAAA,cAOf,YAAA,EAAY,+BAAA;AAAA,cAEZ,SAAA;AAAA,cAGA,aAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/native/UDSScreenCornerRadiusModule.d.ts
|
|
3
|
+
interface UDSScreenCornerRadiusModuleType {
|
|
4
|
+
getCornerRadiusSync(): number | null;
|
|
5
|
+
getCornerRadius(): Promise<number | null>;
|
|
6
|
+
}
|
|
7
|
+
declare const nativeModule: UDSScreenCornerRadiusModuleType;
|
|
8
|
+
declare const loadState: 'pending' | 'loaded' | 'failed';
|
|
9
|
+
declare const loadListeners: (() => void)[];
|
|
10
|
+
//#endregion
|
|
11
|
+
export { loadListeners, loadState, nativeModule };
|
|
12
|
+
//# sourceMappingURL=UDSScreenCornerRadiusModule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UDSScreenCornerRadiusModule.d.ts","names":[],"sources":["../../src/native/UDSScreenCornerRadiusModule.ts"],"mappings":";;UAAU,+BAAA;EACR,mBAAA;EACA,eAAA,IAAmB,OAAA;AAAA;AAAA,cAOf,YAAA,EAAY,+BAAA;AAAA,cAEZ,SAAA;AAAA,cAGA,aAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
//#region src/native/UDSScreenCornerRadiusModule.ts
|
|
3
|
+
const nativeModule = (globalThis.expo?.modules)?.UDSScreenCornerRadius ?? null;
|
|
4
|
+
const loadState = nativeModule ? "loaded" : "failed";
|
|
5
|
+
const loadListeners = [];
|
|
6
|
+
|
|
7
|
+
//#endregion
|
|
8
|
+
export { loadListeners, loadState, nativeModule };
|
|
9
|
+
//# sourceMappingURL=UDSScreenCornerRadiusModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UDSScreenCornerRadiusModule.js","names":[],"sources":["../../src/native/UDSScreenCornerRadiusModule.ts"],"sourcesContent":["interface UDSScreenCornerRadiusModuleType {\n getCornerRadiusSync(): number | null;\n getCornerRadius(): Promise<number | null>;\n}\n\n// Access the native module from globalThis.expo.modules, which is populated\n// synchronously by the native side before any JS runs.\n// See packages/mobile/docs/DYNAMIC_IMPORTS.md for details on this approach.\nconst expoModules = (globalThis as { expo?: { modules?: Record<string, unknown> } }).expo?.modules;\nconst nativeModule =\n (expoModules?.UDSScreenCornerRadius as UDSScreenCornerRadiusModuleType) ?? null;\nconst loadState: 'pending' | 'loaded' | 'failed' = nativeModule ? 'loaded' : 'failed';\n\n// Kept for API compatibility with components that use the listener pattern\nconst loadListeners: (() => void)[] = [];\n\nexport { loadListeners, loadState, nativeModule };\n"],"mappings":";;AASA,MAAM,gBADe,WAAgE,MAAM,UAE3E,yBAA6D;AAC7E,MAAM,YAA6C,eAAe,WAAW;AAG7E,MAAM,gBAAgC,EAAE"}
|
package/dist/portal.cjs
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
3
|
+
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
4
|
+
let react = require("react");
|
|
5
|
+
let react_native = require("react-native");
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
|
|
8
|
+
//#region src/portal.tsx
|
|
9
|
+
function portalReducer(state, action) {
|
|
10
|
+
switch (action.type) {
|
|
11
|
+
case "register": {
|
|
12
|
+
const next = new Map(state);
|
|
13
|
+
next.set(action.id, action.node);
|
|
14
|
+
return next;
|
|
15
|
+
}
|
|
16
|
+
case "unregister": {
|
|
17
|
+
if (!state.has(action.id)) return state;
|
|
18
|
+
const next = new Map(state);
|
|
19
|
+
next.delete(action.id);
|
|
20
|
+
return next;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const PortalContext = (0, react.createContext)(null);
|
|
25
|
+
function usePortalContext() {
|
|
26
|
+
const ctx = (0, react.useContext)(PortalContext);
|
|
27
|
+
if (!ctx) throw new Error("Portal must be used within a UDSProvider.");
|
|
28
|
+
return ctx;
|
|
29
|
+
}
|
|
30
|
+
const PortalHost = (0, react.memo)(function PortalHost({ state }) {
|
|
31
|
+
if (state.size === 0) return null;
|
|
32
|
+
const nodes = [];
|
|
33
|
+
state.forEach((node, id) => {
|
|
34
|
+
nodes.push(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, {
|
|
35
|
+
style: styles.overlay,
|
|
36
|
+
pointerEvents: "box-none",
|
|
37
|
+
children: node
|
|
38
|
+
}, id));
|
|
39
|
+
});
|
|
40
|
+
return nodes;
|
|
41
|
+
});
|
|
42
|
+
function Portal({ children }) {
|
|
43
|
+
const id = (0, react.useId)();
|
|
44
|
+
const { register, unregister } = usePortalContext();
|
|
45
|
+
(0, react.useEffect)(() => {
|
|
46
|
+
register(id, children);
|
|
47
|
+
}, [
|
|
48
|
+
id,
|
|
49
|
+
children,
|
|
50
|
+
register
|
|
51
|
+
]);
|
|
52
|
+
(0, react.useEffect)(() => {
|
|
53
|
+
return () => unregister(id);
|
|
54
|
+
}, [id, unregister]);
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
function PortalProvider({ children }) {
|
|
58
|
+
const [state, dispatch] = (0, react.useReducer)(portalReducer, /* @__PURE__ */ new Map());
|
|
59
|
+
const register = (0, react.useCallback)((id, node) => dispatch({
|
|
60
|
+
type: "register",
|
|
61
|
+
id,
|
|
62
|
+
node
|
|
63
|
+
}), []);
|
|
64
|
+
const unregister = (0, react.useCallback)((id) => dispatch({
|
|
65
|
+
type: "unregister",
|
|
66
|
+
id
|
|
67
|
+
}), []);
|
|
68
|
+
const contextValue = (0, react.useMemo)(() => ({
|
|
69
|
+
register,
|
|
70
|
+
unregister
|
|
71
|
+
}), [register, unregister]);
|
|
72
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(PortalContext.Provider, {
|
|
73
|
+
value: contextValue,
|
|
74
|
+
children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PortalHost, { state })]
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
const styles = react_native.StyleSheet.create({ overlay: { ...react_native.StyleSheet.absoluteFill } });
|
|
78
|
+
|
|
79
|
+
//#endregion
|
|
80
|
+
exports.Portal = Portal;
|
|
81
|
+
exports.PortalProvider = PortalProvider;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
import * as react from "react";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/portal.d.ts
|
|
6
|
+
declare function Portal({
|
|
7
|
+
children
|
|
8
|
+
}: {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}): null;
|
|
11
|
+
declare function PortalProvider({
|
|
12
|
+
children
|
|
13
|
+
}: {
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}): react.JSX.Element;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { Portal, PortalProvider };
|
|
18
|
+
//# sourceMappingURL=portal.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portal.d.cts","names":[],"sources":["../src/portal.tsx"],"mappings":";;;;;iBAoFS,MAAA,CAAA;EAAS;AAAA;EAAc,QAAA,EAAU,SAAA;AAAA;AAAA,iBAmBjC,cAAA,CAAA;EAAiB;AAAA;EAAc,QAAA,EAAU,SAAA;AAAA,IAAW,KAAA,CAAA,GAAA,CAAA,OAAA"}
|
package/dist/portal.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
import * as react from "react";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/portal.d.ts
|
|
6
|
+
declare function Portal({
|
|
7
|
+
children
|
|
8
|
+
}: {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}): null;
|
|
11
|
+
declare function PortalProvider({
|
|
12
|
+
children
|
|
13
|
+
}: {
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}): react.JSX.Element;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { Portal, PortalProvider };
|
|
18
|
+
//# sourceMappingURL=portal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portal.d.ts","names":[],"sources":["../src/portal.tsx"],"mappings":";;;;;iBAoFS,MAAA,CAAA;EAAS;AAAA;EAAc,QAAA,EAAU,SAAA;AAAA;AAAA,iBAmBjC,cAAA,CAAA;EAAiB;AAAA;EAAc,QAAA,EAAU,SAAA;AAAA,IAAW,KAAA,CAAA,GAAA,CAAA,OAAA"}
|