@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,31 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
import { useBottomSheetStore } from "./useBottomSheetStore.js";
|
|
3
|
+
import { createContext, useContext } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/BottomSheet/BottomSheetProvider.tsx
|
|
7
|
+
const BottomSheetContext = createContext(null);
|
|
8
|
+
/**
|
|
9
|
+
* Provides a BottomSheetController to all descendants via React context.
|
|
10
|
+
*
|
|
11
|
+
* Accepts an optional `controller` prop. If omitted, creates an internal store.
|
|
12
|
+
* All descendants (BottomSheet, BottomSheetTrigger, BottomSheetDismiss) resolve
|
|
13
|
+
* the same store from this context.
|
|
14
|
+
*/
|
|
15
|
+
function BottomSheetProvider({ children, controller }) {
|
|
16
|
+
const fallbackStore = useBottomSheetStore();
|
|
17
|
+
const store = controller ?? fallbackStore;
|
|
18
|
+
return /* @__PURE__ */ jsx(BottomSheetContext.Provider, {
|
|
19
|
+
value: store,
|
|
20
|
+
children
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
BottomSheetProvider.displayName = "BottomSheetProvider";
|
|
24
|
+
/** @internal — read the controller from context. Returns null if no provider. */
|
|
25
|
+
function useBottomSheetContext() {
|
|
26
|
+
return useContext(BottomSheetContext);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
export { BottomSheetProvider, useBottomSheetContext };
|
|
31
|
+
//# sourceMappingURL=BottomSheetProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomSheetProvider.js","names":[],"sources":["../../../src/components/BottomSheet/BottomSheetProvider.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nimport type { BottomSheetController, BottomSheetProviderProps } from './types';\nimport { useBottomSheetStore } from './useBottomSheetStore';\n\nconst BottomSheetContext = createContext<BottomSheetController | null>(null);\n\n/**\n * Provides a BottomSheetController to all descendants via React context.\n *\n * Accepts an optional `controller` prop. If omitted, creates an internal store.\n * All descendants (BottomSheet, BottomSheetTrigger, BottomSheetDismiss) resolve\n * the same store from this context.\n */\nfunction BottomSheetProvider({ children, controller }: BottomSheetProviderProps) {\n const fallbackStore = useBottomSheetStore();\n const store = controller ?? fallbackStore;\n\n return <BottomSheetContext.Provider value={store}>{children}</BottomSheetContext.Provider>;\n}\n\nBottomSheetProvider.displayName = 'BottomSheetProvider';\n\n/** @internal — read the controller from context. Returns null if no provider. */\nfunction useBottomSheetContext(): BottomSheetController | null {\n return useContext(BottomSheetContext);\n}\n\nexport { BottomSheetProvider, useBottomSheetContext };\n"],"mappings":";;;;;;AAKA,MAAM,qBAAqB,cAA4C,KAAK;;;;;;;;AAS5E,SAAS,oBAAoB,EAAE,UAAU,cAAwC;CAC/E,MAAM,gBAAgB,qBAAqB;CAC3C,MAAM,QAAQ,cAAc;AAE5B,QAAO,oBAAC,mBAAmB;EAAS,OAAO;EAAQ;GAAuC;;AAG5F,oBAAoB,cAAc;;AAGlC,SAAS,wBAAsD;AAC7D,QAAO,WAAW,mBAAmB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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_BottomSheet_BottomSheetProvider = require('./BottomSheetProvider.cjs');
|
|
5
|
+
let react = require("react");
|
|
6
|
+
|
|
7
|
+
//#region src/components/BottomSheet/BottomSheetTrigger.tsx
|
|
8
|
+
/**
|
|
9
|
+
* Clones the `render` element and injects an `onPress` handler that opens
|
|
10
|
+
* the nearest bottom sheet.
|
|
11
|
+
*
|
|
12
|
+
* Uses the `render` prop pattern to avoid nested pressable wrappers.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* <BottomSheetTrigger render={<Button>Open Sheet</Button>} />
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
const BottomSheetTrigger = (0, react.memo)(function BottomSheetTrigger({ render }) {
|
|
20
|
+
const controller = require_components_BottomSheet_BottomSheetProvider.useBottomSheetContext();
|
|
21
|
+
if (!controller) throw new Error("BottomSheetTrigger must be used inside a BottomSheetProvider.");
|
|
22
|
+
return (0, react.cloneElement)(render, { onPress: (0, react.useCallback)(() => {
|
|
23
|
+
controller.open();
|
|
24
|
+
}, [controller]) });
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
exports.BottomSheetTrigger = BottomSheetTrigger;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
import * as react from "react";
|
|
3
|
+
import { ReactElement } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/BottomSheet/BottomSheetTrigger.d.ts
|
|
6
|
+
interface Props {
|
|
7
|
+
render: ReactElement<{
|
|
8
|
+
onPress?: () => void;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Clones the `render` element and injects an `onPress` handler that opens
|
|
13
|
+
* the nearest bottom sheet.
|
|
14
|
+
*
|
|
15
|
+
* Uses the `render` prop pattern to avoid nested pressable wrappers.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <BottomSheetTrigger render={<Button>Open Sheet</Button>} />
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
declare const BottomSheetTrigger: react.NamedExoticComponent<Props>;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { BottomSheetTrigger };
|
|
25
|
+
//# sourceMappingURL=BottomSheetTrigger.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomSheetTrigger.d.cts","names":[],"sources":["../../../src/components/BottomSheet/BottomSheetTrigger.tsx"],"mappings":";;;;;UAKU,KAAA;EACR,MAAA,EAAQ,YAAA;IAAe,OAAA;EAAA;AAAA;;;;;;;;AAAO;;;;cAe1B,kBAAA,EAAkB,KAAA,CAAA,oBAAA,CAAA,KAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
import * as react from "react";
|
|
3
|
+
import { ReactElement } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/BottomSheet/BottomSheetTrigger.d.ts
|
|
6
|
+
interface Props {
|
|
7
|
+
render: ReactElement<{
|
|
8
|
+
onPress?: () => void;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Clones the `render` element and injects an `onPress` handler that opens
|
|
13
|
+
* the nearest bottom sheet.
|
|
14
|
+
*
|
|
15
|
+
* Uses the `render` prop pattern to avoid nested pressable wrappers.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <BottomSheetTrigger render={<Button>Open Sheet</Button>} />
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
declare const BottomSheetTrigger: react.NamedExoticComponent<Props>;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { BottomSheetTrigger };
|
|
25
|
+
//# sourceMappingURL=BottomSheetTrigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomSheetTrigger.d.ts","names":[],"sources":["../../../src/components/BottomSheet/BottomSheetTrigger.tsx"],"mappings":";;;;;UAKU,KAAA;EACR,MAAA,EAAQ,YAAA;IAAe,OAAA;EAAA;AAAA;;;;;;;;AAAO;;;;cAe1B,kBAAA,EAAkB,KAAA,CAAA,oBAAA,CAAA,KAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
import { useBottomSheetContext } from "./BottomSheetProvider.js";
|
|
3
|
+
import { cloneElement, memo, useCallback } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/BottomSheet/BottomSheetTrigger.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Clones the `render` element and injects an `onPress` handler that opens
|
|
8
|
+
* the nearest bottom sheet.
|
|
9
|
+
*
|
|
10
|
+
* Uses the `render` prop pattern to avoid nested pressable wrappers.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <BottomSheetTrigger render={<Button>Open Sheet</Button>} />
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
const BottomSheetTrigger = memo(function BottomSheetTrigger({ render }) {
|
|
18
|
+
const controller = useBottomSheetContext();
|
|
19
|
+
if (!controller) throw new Error("BottomSheetTrigger must be used inside a BottomSheetProvider.");
|
|
20
|
+
return cloneElement(render, { onPress: useCallback(() => {
|
|
21
|
+
controller.open();
|
|
22
|
+
}, [controller]) });
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
export { BottomSheetTrigger };
|
|
27
|
+
//# sourceMappingURL=BottomSheetTrigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomSheetTrigger.js","names":[],"sources":["../../../src/components/BottomSheet/BottomSheetTrigger.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport { cloneElement, memo, useCallback } from 'react';\n\nimport { useBottomSheetContext } from './BottomSheetProvider';\n\ninterface Props {\n render: ReactElement<{ onPress?: () => void }>;\n}\n\n/**\n * Clones the `render` element and injects an `onPress` handler that opens\n * the nearest bottom sheet.\n *\n * Uses the `render` prop pattern to avoid nested pressable wrappers.\n *\n * @example\n * ```tsx\n * <BottomSheetTrigger render={<Button>Open Sheet</Button>} />\n * ```\n */\n// eslint-disable-next-line react/prop-types -- TypeScript validates props via Props interface\nconst BottomSheetTrigger = memo(function BottomSheetTrigger({ render }: Props) {\n const controller = useBottomSheetContext();\n\n if (!controller) {\n throw new Error('BottomSheetTrigger must be used inside a BottomSheetProvider.');\n }\n\n const handlePress = useCallback(() => {\n controller.open();\n }, [controller]);\n\n return cloneElement(render, {\n onPress: handlePress,\n });\n});\n\nexport { BottomSheetTrigger };\n"],"mappings":";;;;;;;;;;;;;;;;AAqBA,MAAM,qBAAqB,KAAK,SAAS,mBAAmB,EAAE,UAAiB;CAC7E,MAAM,aAAa,uBAAuB;AAE1C,KAAI,CAAC,WACH,OAAM,IAAI,MAAM,gEAAgE;AAOlF,QAAO,aAAa,QAAQ,EAC1B,SALkB,kBAAkB;AACpC,aAAW,MAAM;IAChB,CAAC,WAAW,CAAC,EAIf,CAAC;EACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
3
|
+
const require_components_BottomSheet_useBottomSheetStore = require('./useBottomSheetStore.cjs');
|
|
4
|
+
const require_components_BottomSheet_BottomSheetProvider = require('./BottomSheetProvider.cjs');
|
|
5
|
+
const require_components_BottomSheet_BottomSheet = require('./BottomSheet.cjs');
|
|
6
|
+
const require_components_BottomSheet_BottomSheetContent = require('./BottomSheetContent.cjs');
|
|
7
|
+
const require_components_BottomSheet_BottomSheetDismiss = require('./BottomSheetDismiss.cjs');
|
|
8
|
+
const require_components_BottomSheet_BottomSheetHeader = require('./BottomSheetHeader.cjs');
|
|
9
|
+
const require_components_BottomSheet_BottomSheetTrigger = require('./BottomSheetTrigger.cjs');
|
|
10
|
+
const require_components_BottomSheet_useBottomSheetScroll = require('./useBottomSheetScroll.cjs');
|
|
11
|
+
|
|
12
|
+
exports.BottomSheet = require_components_BottomSheet_BottomSheet.BottomSheet;
|
|
13
|
+
exports.BottomSheetContent = require_components_BottomSheet_BottomSheetContent.BottomSheetContent;
|
|
14
|
+
exports.BottomSheetDismiss = require_components_BottomSheet_BottomSheetDismiss.BottomSheetDismiss;
|
|
15
|
+
exports.BottomSheetHeader = require_components_BottomSheet_BottomSheetHeader.BottomSheetHeader;
|
|
16
|
+
exports.BottomSheetProvider = require_components_BottomSheet_BottomSheetProvider.BottomSheetProvider;
|
|
17
|
+
exports.BottomSheetTrigger = require_components_BottomSheet_BottomSheetTrigger.BottomSheetTrigger;
|
|
18
|
+
exports.useBottomSheetScroll = require_components_BottomSheet_useBottomSheetScroll.useBottomSheetScroll;
|
|
19
|
+
exports.useBottomSheetStore = require_components_BottomSheet_useBottomSheetStore.useBottomSheetStore;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
import { BottomSheetContentProps, BottomSheetController, BottomSheetDismissProps, BottomSheetHeaderProps, BottomSheetHeight, BottomSheetProps, BottomSheetProviderProps, BottomSheetTriggerProps } from "./types.cjs";
|
|
3
|
+
import { BottomSheet } from "./BottomSheet.cjs";
|
|
4
|
+
import { BottomSheetContent } from "./BottomSheetContent.cjs";
|
|
5
|
+
import { BottomSheetDismiss } from "./BottomSheetDismiss.cjs";
|
|
6
|
+
import { BottomSheetHeader } from "./BottomSheetHeader.cjs";
|
|
7
|
+
import { BottomSheetProvider } from "./BottomSheetProvider.cjs";
|
|
8
|
+
import { BottomSheetTrigger } from "./BottomSheetTrigger.cjs";
|
|
9
|
+
import { useBottomSheetScroll } from "./useBottomSheetScroll.cjs";
|
|
10
|
+
import { useBottomSheetStore } from "./useBottomSheetStore.cjs";
|
|
11
|
+
export { BottomSheet, BottomSheetContent, type BottomSheetContentProps, type BottomSheetController, BottomSheetDismiss, type BottomSheetDismissProps, BottomSheetHeader, type BottomSheetHeaderProps, type BottomSheetHeight, type BottomSheetProps, BottomSheetProvider, type BottomSheetProviderProps, BottomSheetTrigger, type BottomSheetTriggerProps, useBottomSheetScroll, useBottomSheetStore };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
import { BottomSheetContentProps, BottomSheetController, BottomSheetDismissProps, BottomSheetHeaderProps, BottomSheetHeight, BottomSheetProps, BottomSheetProviderProps, BottomSheetTriggerProps } from "./types.js";
|
|
3
|
+
import { BottomSheet } from "./BottomSheet.js";
|
|
4
|
+
import { BottomSheetContent } from "./BottomSheetContent.js";
|
|
5
|
+
import { BottomSheetDismiss } from "./BottomSheetDismiss.js";
|
|
6
|
+
import { BottomSheetHeader } from "./BottomSheetHeader.js";
|
|
7
|
+
import { BottomSheetProvider } from "./BottomSheetProvider.js";
|
|
8
|
+
import { BottomSheetTrigger } from "./BottomSheetTrigger.js";
|
|
9
|
+
import { useBottomSheetScroll } from "./useBottomSheetScroll.js";
|
|
10
|
+
import { useBottomSheetStore } from "./useBottomSheetStore.js";
|
|
11
|
+
export { BottomSheet, BottomSheetContent, type BottomSheetContentProps, type BottomSheetController, BottomSheetDismiss, type BottomSheetDismissProps, BottomSheetHeader, type BottomSheetHeaderProps, type BottomSheetHeight, type BottomSheetProps, BottomSheetProvider, type BottomSheetProviderProps, BottomSheetTrigger, type BottomSheetTriggerProps, useBottomSheetScroll, useBottomSheetStore };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
import { useBottomSheetStore } from "./useBottomSheetStore.js";
|
|
3
|
+
import { BottomSheetProvider } from "./BottomSheetProvider.js";
|
|
4
|
+
import { BottomSheet } from "./BottomSheet.js";
|
|
5
|
+
import { BottomSheetContent } from "./BottomSheetContent.js";
|
|
6
|
+
import { BottomSheetDismiss } from "./BottomSheetDismiss.js";
|
|
7
|
+
import { BottomSheetHeader } from "./BottomSheetHeader.js";
|
|
8
|
+
import { BottomSheetTrigger } from "./BottomSheetTrigger.js";
|
|
9
|
+
import { useBottomSheetScroll } from "./useBottomSheetScroll.js";
|
|
10
|
+
|
|
11
|
+
export { BottomSheet, BottomSheetContent, BottomSheetDismiss, BottomSheetHeader, BottomSheetProvider, BottomSheetTrigger, useBottomSheetScroll, useBottomSheetStore };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
|
|
2
|
+
import { ReactElement, ReactNode, RefObject } from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
import { GestureType } from "react-native-gesture-handler";
|
|
5
|
+
import { SharedValue } from "react-native-reanimated";
|
|
6
|
+
|
|
7
|
+
//#region src/components/BottomSheet/types.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* A height value for bottom sheet snap points.
|
|
10
|
+
*
|
|
11
|
+
* @example '50%' — half the container height
|
|
12
|
+
* @example '300px' — fixed 300 pixels
|
|
13
|
+
*/
|
|
14
|
+
type BottomSheetHeight = `${number}%` | `${number}px`;
|
|
15
|
+
/** Props for {@link useBottomSheetStore}. */
|
|
16
|
+
interface UseBottomSheetStoreProps {
|
|
17
|
+
/** @defaultValue false */
|
|
18
|
+
defaultOpen?: boolean;
|
|
19
|
+
/** Controlled open state. When provided, the store syncs to this value. */
|
|
20
|
+
open?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Imperative handle returned by {@link useBottomSheetStore}.
|
|
24
|
+
* Pass to `<BottomSheetProvider controller={...}>` or `<BottomSheet controller={...}>`.
|
|
25
|
+
*/
|
|
26
|
+
interface BottomSheetController {
|
|
27
|
+
/** Open the sheet. */
|
|
28
|
+
open: () => void;
|
|
29
|
+
/** Close the sheet. */
|
|
30
|
+
close: () => void;
|
|
31
|
+
/** Whether the sheet is currently open. */
|
|
32
|
+
isOpen: boolean;
|
|
33
|
+
}
|
|
34
|
+
/** Props for {@link BottomSheet}. */
|
|
35
|
+
interface BottomSheetProps {
|
|
36
|
+
children: ReactNode;
|
|
37
|
+
/** Explicit controller — overridden by the nearest `BottomSheetProvider` context. */
|
|
38
|
+
controller?: BottomSheetController;
|
|
39
|
+
/** Ordered snap point heights from smallest to largest. */
|
|
40
|
+
snapPoints?: BottomSheetHeight[];
|
|
41
|
+
/** Shorthand for a single snap point. Ignored when `snapPoints` is provided. */
|
|
42
|
+
height?: BottomSheetHeight;
|
|
43
|
+
/**
|
|
44
|
+
* Index into `snapPoints` the sheet opens to.
|
|
45
|
+
* @defaultValue 0
|
|
46
|
+
*/
|
|
47
|
+
defaultSnapPointIndex?: number;
|
|
48
|
+
/** Controlled snap point index. When set, the sheet animates to this index. */
|
|
49
|
+
snapPointIndex?: number;
|
|
50
|
+
/** Fires when the active snap point changes (drag settle or programmatic). */
|
|
51
|
+
onSnapPointChange?: (index: number, height: BottomSheetHeight) => void;
|
|
52
|
+
/** Fires after the close animation completes. */
|
|
53
|
+
onClose?: () => void;
|
|
54
|
+
/**
|
|
55
|
+
* Whether the sheet can be dismissed by dragging down or tapping the scrim.
|
|
56
|
+
* @defaultValue true
|
|
57
|
+
*/
|
|
58
|
+
dismissible?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Whether the sheet can be dragged between snap points.
|
|
61
|
+
* @defaultValue true
|
|
62
|
+
*/
|
|
63
|
+
enableDrag?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Whether to show the handle indicator bar at the top of the sheet.
|
|
66
|
+
* @remarks Ignored when `enableDrag` is `false`.
|
|
67
|
+
* @defaultValue true
|
|
68
|
+
*/
|
|
69
|
+
showHandleIndicator?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Whether the sheet renders as a modal overlay with a scrim.
|
|
72
|
+
* @defaultValue true
|
|
73
|
+
*/
|
|
74
|
+
modal?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* When `true`, margins animate to 0 at the highest snap point, making the sheet edge-to-edge.
|
|
77
|
+
* @defaultValue false
|
|
78
|
+
*/
|
|
79
|
+
fullWidthAtMaxSnap?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Whether dragging past the max snap point shows a rubber-band overstretch effect.
|
|
82
|
+
* @defaultValue true
|
|
83
|
+
*/
|
|
84
|
+
enableOverstretch?: boolean;
|
|
85
|
+
/** Ref to a `BlurTarget` wrapping screen content. Required for Android blur; iOS blurs automatically. */
|
|
86
|
+
blurTarget?: RefObject<View | null>;
|
|
87
|
+
/**
|
|
88
|
+
* Match the bottom corners to the device's screen corner radius.
|
|
89
|
+
* Disable when the sheet has a bottom margin so corners use the token radius instead.
|
|
90
|
+
* @defaultValue true
|
|
91
|
+
*/
|
|
92
|
+
shouldMatchDeviceCornerRadius?: boolean;
|
|
93
|
+
}
|
|
94
|
+
/** Props for {@link BottomSheetProvider}. */
|
|
95
|
+
interface BottomSheetProviderProps {
|
|
96
|
+
children: ReactNode;
|
|
97
|
+
/** Optional controller. If omitted, an internal store is created. */
|
|
98
|
+
controller?: BottomSheetController;
|
|
99
|
+
}
|
|
100
|
+
/** Props for {@link BottomSheetHeader}. */
|
|
101
|
+
interface BottomSheetHeaderProps {
|
|
102
|
+
/** Title content rendered in the center slot. */
|
|
103
|
+
children?: ReactNode;
|
|
104
|
+
/** Leading (left) slot — typically a back or close button. */
|
|
105
|
+
start?: ReactNode;
|
|
106
|
+
/** Trailing (right) slot — typically an action button. */
|
|
107
|
+
end?: ReactNode;
|
|
108
|
+
}
|
|
109
|
+
/** Props for {@link BottomSheetContent}. */
|
|
110
|
+
interface BottomSheetContentProps {
|
|
111
|
+
children?: ReactNode;
|
|
112
|
+
}
|
|
113
|
+
/** Props for {@link BottomSheetTrigger}. */
|
|
114
|
+
interface BottomSheetTriggerProps {
|
|
115
|
+
/** Element to clone with an injected `onPress` that opens the sheet. */
|
|
116
|
+
render: ReactElement<{
|
|
117
|
+
onPress?: () => void;
|
|
118
|
+
}>;
|
|
119
|
+
}
|
|
120
|
+
/** Props for {@link BottomSheetDismiss}. */
|
|
121
|
+
interface BottomSheetDismissProps {
|
|
122
|
+
/** Element to clone with an injected `onPress` that closes the sheet. */
|
|
123
|
+
render: ReactElement<{
|
|
124
|
+
onPress?: () => void;
|
|
125
|
+
}>;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* @internal
|
|
129
|
+
* Shared context value for scroll/gesture coordination between
|
|
130
|
+
* {@link BottomSheet}, {@link BottomSheetContent}, and {@link BottomSheetHandle}.
|
|
131
|
+
*/
|
|
132
|
+
interface BottomSheetInternalContextValue {
|
|
133
|
+
/** Ref to the sheet's pan gesture for `simultaneousWithExternalGesture`. */
|
|
134
|
+
panGestureRef: RefObject<GestureType | undefined>;
|
|
135
|
+
/** Current active snap index (UI-thread shared value). */
|
|
136
|
+
activeSnapIndex: SharedValue<number>;
|
|
137
|
+
/** Total number of resolved snap points. */
|
|
138
|
+
snapCount: number;
|
|
139
|
+
/** Current scroll offset of the content ScrollView (UI-thread shared value). */
|
|
140
|
+
scrollOffsetY: SharedValue<number>;
|
|
141
|
+
/** Whether content scrolling is locked (UI-thread shared value). */
|
|
142
|
+
scrollLocked: SharedValue<boolean>;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* @internal
|
|
146
|
+
* Shape of the flattened `bottomSheetStyles.root` token object.
|
|
147
|
+
*/
|
|
148
|
+
interface BottomSheetRootTokens {
|
|
149
|
+
backgroundColor?: string;
|
|
150
|
+
backgroundBlurRadius?: number;
|
|
151
|
+
backgroundBlurColor?: string;
|
|
152
|
+
borderColor?: string;
|
|
153
|
+
borderWidth?: number;
|
|
154
|
+
borderRadius?: number;
|
|
155
|
+
paddingHorizontal?: number;
|
|
156
|
+
paddingVertical?: number;
|
|
157
|
+
marginHorizontal?: number;
|
|
158
|
+
marginBottom?: number;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* @internal
|
|
162
|
+
* Shape of the flattened `bottomSheetStyles.header` token object.
|
|
163
|
+
*/
|
|
164
|
+
interface BottomSheetHeaderTokens {
|
|
165
|
+
fontFamily?: string;
|
|
166
|
+
fontSize?: number;
|
|
167
|
+
letterSpacing?: number;
|
|
168
|
+
lineHeight?: number;
|
|
169
|
+
color?: string;
|
|
170
|
+
}
|
|
171
|
+
//#endregion
|
|
172
|
+
export { type BottomSheetContentProps, type BottomSheetController, type BottomSheetDismissProps, type BottomSheetHeaderProps, type BottomSheetHeaderTokens, type BottomSheetHeight, type BottomSheetInternalContextValue, type BottomSheetProps, type BottomSheetProviderProps, type BottomSheetRootTokens, type BottomSheetTriggerProps, type UseBottomSheetStoreProps };
|
|
173
|
+
//# sourceMappingURL=types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.cts","names":[],"sources":["../../../src/components/BottomSheet/types.ts"],"mappings":";;;;;;;;;AAG2D;;;;KAQtD,iBAAA;AAAiB;AAAA,UAGZ,wBAAA;;EAER,WAAA;EAEI;EAAJ,IAAA;AAAA;;;;;UAOQ,qBAAA;EAMF;EAJN,IAAA;EAQQ;EANR,KAAA;;EAEA,MAAA;AAAA;;UAIQ,gBAAA;EACR,QAAA,EAAU,SAAA;EAkDa;EAhDvB,UAAA,GAAa,qBAAA;EAgDS;EA9CtB,UAAA,GAAa,iBAAA;EAJb;EAMA,MAAA,GAAS,iBAAA;EAJT;;;;EASA,qBAAA;EALS;EAOT,cAAA;EAAA;EAEA,iBAAA,IAAqB,KAAA,UAAe,MAAA,EAAQ,iBAAA;EAAvB;EAErB,OAAA;EAFoC;;;;EAOpC,WAAA;EAgBA;;;;EAXA,UAAA;EAuBuB;;;;AAMM;EAvB7B,mBAAA;;;;;EAKA,KAAA;EAyBa;;;AAAqB;EApBlC,kBAAA;;;;;EAKA,iBAAA;EAyBe;EAvBf,UAAA,GAAa,SAAA,CAAU,IAAA;EAmBZ;;;;;EAbX,6BAAA;AAAA;AAiBe;AAAA,UAbP,wBAAA;EACR,QAAA,EAAU,SAAA;EAiBV;EAfA,UAAA,GAAa,qBAAA;AAAA;;UAIL,sBAAA;EAiBY;EAfpB,QAAA,GAAW,SAAA;EAeH;EAbR,KAAA,GAAQ,SAAA;EAasB;EAX9B,GAAA,GAAM,SAAA;AAAA;;UAIE,uBAAA;EACR,QAAA,GAAW,SAAA;AAAA;;UAIH,uBAAA;EAQsB;EAN9B,MAAA,EAAQ,YAAA;IAAe,OAAA;EAAA;AAAA;;UAIf,uBAAA;EAcS;EAZjB,MAAA,EAAQ,YAAA;IAAe,OAAA;EAAA;AAAA;;;;;;UAQf,+BAAA;EAQR;EANA,aAAA,EAAe,SAAA,CAAU,WAAA;EAQzB;EANA,eAAA,EAAiB,WAAA;EAMQ;EAJzB,SAAA;EAWQ;EATR,aAAA,EAAe,WAAA;;EAEf,YAAA,EAAc,WAAA;AAAA;;;;;UAON,qBAAA;EACR,eAAA;EACA,oBAAA;EACA,mBAAA;EACA,WAAA;EACA,WAAA;EACA,YAAA;EACA,iBAAA;EACA,eAAA;EACA,gBAAA;EACA,YAAA;AAAA;;;;;UAOQ,uBAAA;EACR,UAAA;EACA,QAAA;EACA,aAAA;EACA,UAAA;EACA,KAAA;AAAA"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
|
|
2
|
+
import { ReactElement, ReactNode, RefObject } from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
import { SharedValue } from "react-native-reanimated";
|
|
5
|
+
import { GestureType } from "react-native-gesture-handler";
|
|
6
|
+
|
|
7
|
+
//#region src/components/BottomSheet/types.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* A height value for bottom sheet snap points.
|
|
10
|
+
*
|
|
11
|
+
* @example '50%' — half the container height
|
|
12
|
+
* @example '300px' — fixed 300 pixels
|
|
13
|
+
*/
|
|
14
|
+
type BottomSheetHeight = `${number}%` | `${number}px`;
|
|
15
|
+
/** Props for {@link useBottomSheetStore}. */
|
|
16
|
+
interface UseBottomSheetStoreProps {
|
|
17
|
+
/** @defaultValue false */
|
|
18
|
+
defaultOpen?: boolean;
|
|
19
|
+
/** Controlled open state. When provided, the store syncs to this value. */
|
|
20
|
+
open?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Imperative handle returned by {@link useBottomSheetStore}.
|
|
24
|
+
* Pass to `<BottomSheetProvider controller={...}>` or `<BottomSheet controller={...}>`.
|
|
25
|
+
*/
|
|
26
|
+
interface BottomSheetController {
|
|
27
|
+
/** Open the sheet. */
|
|
28
|
+
open: () => void;
|
|
29
|
+
/** Close the sheet. */
|
|
30
|
+
close: () => void;
|
|
31
|
+
/** Whether the sheet is currently open. */
|
|
32
|
+
isOpen: boolean;
|
|
33
|
+
}
|
|
34
|
+
/** Props for {@link BottomSheet}. */
|
|
35
|
+
interface BottomSheetProps {
|
|
36
|
+
children: ReactNode;
|
|
37
|
+
/** Explicit controller — overridden by the nearest `BottomSheetProvider` context. */
|
|
38
|
+
controller?: BottomSheetController;
|
|
39
|
+
/** Ordered snap point heights from smallest to largest. */
|
|
40
|
+
snapPoints?: BottomSheetHeight[];
|
|
41
|
+
/** Shorthand for a single snap point. Ignored when `snapPoints` is provided. */
|
|
42
|
+
height?: BottomSheetHeight;
|
|
43
|
+
/**
|
|
44
|
+
* Index into `snapPoints` the sheet opens to.
|
|
45
|
+
* @defaultValue 0
|
|
46
|
+
*/
|
|
47
|
+
defaultSnapPointIndex?: number;
|
|
48
|
+
/** Controlled snap point index. When set, the sheet animates to this index. */
|
|
49
|
+
snapPointIndex?: number;
|
|
50
|
+
/** Fires when the active snap point changes (drag settle or programmatic). */
|
|
51
|
+
onSnapPointChange?: (index: number, height: BottomSheetHeight) => void;
|
|
52
|
+
/** Fires after the close animation completes. */
|
|
53
|
+
onClose?: () => void;
|
|
54
|
+
/**
|
|
55
|
+
* Whether the sheet can be dismissed by dragging down or tapping the scrim.
|
|
56
|
+
* @defaultValue true
|
|
57
|
+
*/
|
|
58
|
+
dismissible?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Whether the sheet can be dragged between snap points.
|
|
61
|
+
* @defaultValue true
|
|
62
|
+
*/
|
|
63
|
+
enableDrag?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Whether to show the handle indicator bar at the top of the sheet.
|
|
66
|
+
* @remarks Ignored when `enableDrag` is `false`.
|
|
67
|
+
* @defaultValue true
|
|
68
|
+
*/
|
|
69
|
+
showHandleIndicator?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Whether the sheet renders as a modal overlay with a scrim.
|
|
72
|
+
* @defaultValue true
|
|
73
|
+
*/
|
|
74
|
+
modal?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* When `true`, margins animate to 0 at the highest snap point, making the sheet edge-to-edge.
|
|
77
|
+
* @defaultValue false
|
|
78
|
+
*/
|
|
79
|
+
fullWidthAtMaxSnap?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Whether dragging past the max snap point shows a rubber-band overstretch effect.
|
|
82
|
+
* @defaultValue true
|
|
83
|
+
*/
|
|
84
|
+
enableOverstretch?: boolean;
|
|
85
|
+
/** Ref to a `BlurTarget` wrapping screen content. Required for Android blur; iOS blurs automatically. */
|
|
86
|
+
blurTarget?: RefObject<View | null>;
|
|
87
|
+
/**
|
|
88
|
+
* Match the bottom corners to the device's screen corner radius.
|
|
89
|
+
* Disable when the sheet has a bottom margin so corners use the token radius instead.
|
|
90
|
+
* @defaultValue true
|
|
91
|
+
*/
|
|
92
|
+
shouldMatchDeviceCornerRadius?: boolean;
|
|
93
|
+
}
|
|
94
|
+
/** Props for {@link BottomSheetProvider}. */
|
|
95
|
+
interface BottomSheetProviderProps {
|
|
96
|
+
children: ReactNode;
|
|
97
|
+
/** Optional controller. If omitted, an internal store is created. */
|
|
98
|
+
controller?: BottomSheetController;
|
|
99
|
+
}
|
|
100
|
+
/** Props for {@link BottomSheetHeader}. */
|
|
101
|
+
interface BottomSheetHeaderProps {
|
|
102
|
+
/** Title content rendered in the center slot. */
|
|
103
|
+
children?: ReactNode;
|
|
104
|
+
/** Leading (left) slot — typically a back or close button. */
|
|
105
|
+
start?: ReactNode;
|
|
106
|
+
/** Trailing (right) slot — typically an action button. */
|
|
107
|
+
end?: ReactNode;
|
|
108
|
+
}
|
|
109
|
+
/** Props for {@link BottomSheetContent}. */
|
|
110
|
+
interface BottomSheetContentProps {
|
|
111
|
+
children?: ReactNode;
|
|
112
|
+
}
|
|
113
|
+
/** Props for {@link BottomSheetTrigger}. */
|
|
114
|
+
interface BottomSheetTriggerProps {
|
|
115
|
+
/** Element to clone with an injected `onPress` that opens the sheet. */
|
|
116
|
+
render: ReactElement<{
|
|
117
|
+
onPress?: () => void;
|
|
118
|
+
}>;
|
|
119
|
+
}
|
|
120
|
+
/** Props for {@link BottomSheetDismiss}. */
|
|
121
|
+
interface BottomSheetDismissProps {
|
|
122
|
+
/** Element to clone with an injected `onPress` that closes the sheet. */
|
|
123
|
+
render: ReactElement<{
|
|
124
|
+
onPress?: () => void;
|
|
125
|
+
}>;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* @internal
|
|
129
|
+
* Shared context value for scroll/gesture coordination between
|
|
130
|
+
* {@link BottomSheet}, {@link BottomSheetContent}, and {@link BottomSheetHandle}.
|
|
131
|
+
*/
|
|
132
|
+
interface BottomSheetInternalContextValue {
|
|
133
|
+
/** Ref to the sheet's pan gesture for `simultaneousWithExternalGesture`. */
|
|
134
|
+
panGestureRef: RefObject<GestureType | undefined>;
|
|
135
|
+
/** Current active snap index (UI-thread shared value). */
|
|
136
|
+
activeSnapIndex: SharedValue<number>;
|
|
137
|
+
/** Total number of resolved snap points. */
|
|
138
|
+
snapCount: number;
|
|
139
|
+
/** Current scroll offset of the content ScrollView (UI-thread shared value). */
|
|
140
|
+
scrollOffsetY: SharedValue<number>;
|
|
141
|
+
/** Whether content scrolling is locked (UI-thread shared value). */
|
|
142
|
+
scrollLocked: SharedValue<boolean>;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* @internal
|
|
146
|
+
* Shape of the flattened `bottomSheetStyles.root` token object.
|
|
147
|
+
*/
|
|
148
|
+
interface BottomSheetRootTokens {
|
|
149
|
+
backgroundColor?: string;
|
|
150
|
+
backgroundBlurRadius?: number;
|
|
151
|
+
backgroundBlurColor?: string;
|
|
152
|
+
borderColor?: string;
|
|
153
|
+
borderWidth?: number;
|
|
154
|
+
borderRadius?: number;
|
|
155
|
+
paddingHorizontal?: number;
|
|
156
|
+
paddingVertical?: number;
|
|
157
|
+
marginHorizontal?: number;
|
|
158
|
+
marginBottom?: number;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* @internal
|
|
162
|
+
* Shape of the flattened `bottomSheetStyles.header` token object.
|
|
163
|
+
*/
|
|
164
|
+
interface BottomSheetHeaderTokens {
|
|
165
|
+
fontFamily?: string;
|
|
166
|
+
fontSize?: number;
|
|
167
|
+
letterSpacing?: number;
|
|
168
|
+
lineHeight?: number;
|
|
169
|
+
color?: string;
|
|
170
|
+
}
|
|
171
|
+
//#endregion
|
|
172
|
+
export { type BottomSheetContentProps, type BottomSheetController, type BottomSheetDismissProps, type BottomSheetHeaderProps, type BottomSheetHeaderTokens, type BottomSheetHeight, type BottomSheetInternalContextValue, type BottomSheetProps, type BottomSheetProviderProps, type BottomSheetRootTokens, type BottomSheetTriggerProps, type UseBottomSheetStoreProps };
|
|
173
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/components/BottomSheet/types.ts"],"mappings":";;;;;;;;;AAG2D;;;;KAQtD,iBAAA;AAAiB;AAAA,UAGZ,wBAAA;;EAER,WAAA;EAEI;EAAJ,IAAA;AAAA;;;;;UAOQ,qBAAA;EAMF;EAJN,IAAA;EAQQ;EANR,KAAA;;EAEA,MAAA;AAAA;;UAIQ,gBAAA;EACR,QAAA,EAAU,SAAA;EAkDa;EAhDvB,UAAA,GAAa,qBAAA;EAgDS;EA9CtB,UAAA,GAAa,iBAAA;EAJb;EAMA,MAAA,GAAS,iBAAA;EAJT;;;;EASA,qBAAA;EALS;EAOT,cAAA;EAAA;EAEA,iBAAA,IAAqB,KAAA,UAAe,MAAA,EAAQ,iBAAA;EAAvB;EAErB,OAAA;EAFoC;;;;EAOpC,WAAA;EAgBA;;;;EAXA,UAAA;EAuBuB;;;;AAMM;EAvB7B,mBAAA;;;;;EAKA,KAAA;EAyBa;;;AAAqB;EApBlC,kBAAA;;;;;EAKA,iBAAA;EAyBe;EAvBf,UAAA,GAAa,SAAA,CAAU,IAAA;EAmBZ;;;;;EAbX,6BAAA;AAAA;AAiBe;AAAA,UAbP,wBAAA;EACR,QAAA,EAAU,SAAA;EAiBV;EAfA,UAAA,GAAa,qBAAA;AAAA;;UAIL,sBAAA;EAiBY;EAfpB,QAAA,GAAW,SAAA;EAeH;EAbR,KAAA,GAAQ,SAAA;EAasB;EAX9B,GAAA,GAAM,SAAA;AAAA;;UAIE,uBAAA;EACR,QAAA,GAAW,SAAA;AAAA;;UAIH,uBAAA;EAQsB;EAN9B,MAAA,EAAQ,YAAA;IAAe,OAAA;EAAA;AAAA;;UAIf,uBAAA;EAcS;EAZjB,MAAA,EAAQ,YAAA;IAAe,OAAA;EAAA;AAAA;;;;;;UAQf,+BAAA;EAQR;EANA,aAAA,EAAe,SAAA,CAAU,WAAA;EAQzB;EANA,eAAA,EAAiB,WAAA;EAMQ;EAJzB,SAAA;EAWQ;EATR,aAAA,EAAe,WAAA;;EAEf,YAAA,EAAc,WAAA;AAAA;;;;;UAON,qBAAA;EACR,eAAA;EACA,oBAAA;EACA,mBAAA;EACA,WAAA;EACA,WAAA;EACA,YAAA;EACA,iBAAA;EACA,eAAA;EACA,gBAAA;EACA,YAAA;AAAA;;;;;UAOQ,uBAAA;EACR,UAAA;EACA,QAAA;EACA,aAAA;EACA,UAAA;EACA,KAAA;AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|