@oxyhq/bloom 0.3.7 → 0.3.9
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/lib/commonjs/bottom-sheet/index.js +54 -47
- package/lib/commonjs/bottom-sheet/index.js.map +1 -1
- package/lib/commonjs/dialog/Dialog.js +22 -60
- package/lib/commonjs/dialog/Dialog.js.map +1 -1
- package/lib/commonjs/dialog/index.web.js.map +1 -1
- package/lib/module/bottom-sheet/index.js +55 -48
- package/lib/module/bottom-sheet/index.js.map +1 -1
- package/lib/module/dialog/Dialog.js +22 -61
- package/lib/module/dialog/Dialog.js.map +1 -1
- package/lib/module/dialog/index.web.js +3 -4
- package/lib/module/dialog/index.web.js.map +1 -1
- package/lib/typescript/commonjs/bottom-sheet/index.d.ts +12 -0
- package/lib/typescript/commonjs/bottom-sheet/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/Dialog.d.ts +1 -1
- package/lib/typescript/commonjs/dialog/Dialog.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/index.web.d.ts.map +1 -1
- package/lib/typescript/module/bottom-sheet/index.d.ts +12 -0
- package/lib/typescript/module/bottom-sheet/index.d.ts.map +1 -1
- package/lib/typescript/module/dialog/Dialog.d.ts +1 -1
- package/lib/typescript/module/dialog/Dialog.d.ts.map +1 -1
- package/lib/typescript/module/dialog/index.web.d.ts.map +1 -1
- package/package.json +1 -6
- package/src/bottom-sheet/index.tsx +66 -45
- package/src/dialog/Dialog.tsx +27 -112
- package/src/dialog/index.web.ts +3 -4
|
@@ -3,28 +3,11 @@
|
|
|
3
3
|
import React, { useCallback, useImperativeHandle, useMemo, useRef } from 'react';
|
|
4
4
|
import { Pressable, StyleSheet, View } from 'react-native';
|
|
5
5
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
|
+
import { BottomSheet } from "../bottom-sheet/index.js";
|
|
6
7
|
import { useTheme } from "../theme/use-theme.js";
|
|
7
|
-
import { lazyRequire } from "../utils/lazy-require.js";
|
|
8
8
|
import { Context, useDialogContext } from "./context.js";
|
|
9
9
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
10
|
export { useDialogContext, useDialogControl } from "./context.js";
|
|
11
|
-
|
|
12
|
-
// ---------------------------------------------------------------------------
|
|
13
|
-
// Local types for @gorhom/bottom-sheet — declared here instead of imported so
|
|
14
|
-
// that Bloom type-checks cleanly in downstream projects that do not install
|
|
15
|
-
// this optional peer dependency. The module is still consumed at runtime via
|
|
16
|
-
// `lazyRequire`, which returns `null` if the package is missing. In that case
|
|
17
|
-
// Dialog.Outer renders nothing with a console warning, so consumers on native
|
|
18
|
-
// MUST install @gorhom/bottom-sheet to use Bloom's Dialog on native.
|
|
19
|
-
// ---------------------------------------------------------------------------
|
|
20
|
-
|
|
21
|
-
const getBottomSheetModule = lazyRequire('@gorhom/bottom-sheet');
|
|
22
|
-
let warnedAboutMissingBottomSheet = false;
|
|
23
|
-
function warnMissingBottomSheet() {
|
|
24
|
-
if (warnedAboutMissingBottomSheet) return;
|
|
25
|
-
warnedAboutMissingBottomSheet = true;
|
|
26
|
-
console.warn("[bloom] @gorhom/bottom-sheet is not installed. Bloom's native Dialog will not render. " + 'Install it as a peer dependency to enable Dialog on native, or rely on the web Dialog implementation on web.');
|
|
27
|
-
}
|
|
28
11
|
export function Outer({
|
|
29
12
|
children,
|
|
30
13
|
control,
|
|
@@ -54,6 +37,11 @@ export function Outer({
|
|
|
54
37
|
}
|
|
55
38
|
ref.current?.dismiss();
|
|
56
39
|
}, []);
|
|
40
|
+
|
|
41
|
+
// onDismiss fires after the BottomSheet's close animation finishes — this is
|
|
42
|
+
// the integration point for the closeCallbacks queue. Consumers (e.g.
|
|
43
|
+
// Prompt.Action) rely on the queued callback running AFTER the sheet has
|
|
44
|
+
// visually closed so the screen transition feels natural.
|
|
57
45
|
const handleDismiss = useCallback(() => {
|
|
58
46
|
callQueuedCallbacks();
|
|
59
47
|
onClose?.();
|
|
@@ -66,53 +54,26 @@ export function Outer({
|
|
|
66
54
|
close,
|
|
67
55
|
isWithinDialog: true
|
|
68
56
|
}), [close]);
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}, [bottomSheet]);
|
|
83
|
-
const renderHandle = useCallback(() => null, []);
|
|
84
|
-
if (!bottomSheet) {
|
|
85
|
-
// Optional peer `@gorhom/bottom-sheet` is not installed.
|
|
86
|
-
// Dialog.Outer is a no-op in this environment; consumers on native must
|
|
87
|
-
// install the peer to use Bloom's native Dialog implementation.
|
|
88
|
-
warnMissingBottomSheet();
|
|
89
|
-
return null;
|
|
90
|
-
}
|
|
91
|
-
const {
|
|
92
|
-
BottomSheetModal,
|
|
93
|
-
BottomSheetView
|
|
94
|
-
} = bottomSheet;
|
|
95
|
-
return /*#__PURE__*/_jsx(BottomSheetModal, {
|
|
57
|
+
const sheetStyle = useMemo(() => [{
|
|
58
|
+
maxWidth: 500,
|
|
59
|
+
backgroundColor: theme.colors.background,
|
|
60
|
+
borderTopLeftRadius: 20,
|
|
61
|
+
borderTopRightRadius: 20
|
|
62
|
+
},
|
|
63
|
+
// When the dialog should not be expandable to fill the screen, clamp the
|
|
64
|
+
// sheet to a comfortable fixed height. Mirrors the historical gorhom
|
|
65
|
+
// behaviour where `preventExpansion` locked the sheet to a 40% snap point.
|
|
66
|
+
preventExpansion ? {
|
|
67
|
+
height: '40%'
|
|
68
|
+
} : null], [theme.colors.background, preventExpansion]);
|
|
69
|
+
return /*#__PURE__*/_jsx(BottomSheet, {
|
|
96
70
|
ref: ref,
|
|
97
|
-
enablePanDownToClose: true,
|
|
98
|
-
enableDismissOnClose: true,
|
|
99
|
-
enableDynamicSizing: !preventExpansion,
|
|
100
|
-
snapPoints: preventExpansion ? ['40%'] : undefined,
|
|
101
|
-
backgroundStyle: {
|
|
102
|
-
backgroundColor: theme.colors.background,
|
|
103
|
-
borderTopLeftRadius: 20,
|
|
104
|
-
borderTopRightRadius: 20
|
|
105
|
-
},
|
|
106
|
-
handleComponent: renderHandle,
|
|
107
|
-
backdropComponent: renderBackdrop,
|
|
108
71
|
onDismiss: handleDismiss,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
margin: 'auto'
|
|
112
|
-
},
|
|
72
|
+
enablePanDownToClose: true,
|
|
73
|
+
style: sheetStyle,
|
|
113
74
|
children: /*#__PURE__*/_jsx(Context.Provider, {
|
|
114
75
|
value: context,
|
|
115
|
-
children: /*#__PURE__*/_jsx(
|
|
76
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
116
77
|
testID: testID,
|
|
117
78
|
style: {
|
|
118
79
|
backgroundColor: theme.colors.background
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useImperativeHandle","useMemo","useRef","Pressable","StyleSheet","View","useSafeAreaInsets","
|
|
1
|
+
{"version":3,"names":["React","useCallback","useImperativeHandle","useMemo","useRef","Pressable","StyleSheet","View","useSafeAreaInsets","BottomSheet","useTheme","Context","useDialogContext","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","useDialogControl","Outer","children","control","onClose","testID","preventExpansion","theme","ref","closeCallbacks","callQueuedCallbacks","cb","current","e","console","error","open","present","close","push","dismiss","handleDismiss","context","isWithinDialog","sheetStyle","maxWidth","backgroundColor","colors","background","borderTopLeftRadius","borderTopRightRadius","height","onDismiss","enablePanDownToClose","style","Provider","value","Inner","header","contentContainerStyle","insets","paddingTop","paddingHorizontal","paddingBottom","bottom","top","ScrollableInner","props","handleStyles","create","container","position","width","alignItems","zIndex","bar","borderRadius","alignSelf","opacity","Handle","onPress","accessibilityLabel","accessibilityHint","hitSlop","left","right","text","Close","Backdrop"],"sourceRoot":"../../../src","sources":["dialog/Dialog.tsx"],"mappings":";;AAAA,OAAOA,KA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,CAAC,GAAGzB,gBAAgB,CAAC,CAAC;EAEpC,oBACEE,IAAA,CAACP,IAAI;IAAC8C,KAAK,EAAEc,YAAY,CAACE,SAAU;IAAAhD,QAAA,eAClCP,IAAA,CAACT,SAAS;MACR0E,OAAO,EAAEA,CAAA,KAAM1C,KAAK,CAAC,CAAE;MACvB2C,kBAAkB,EAAC,SAAS;MAC5BC,iBAAiB,EAAC,yBAAyB;MAC3CC,OAAO,EAAE;QAAElB,GAAG,EAAE,EAAE;QAAED,MAAM,EAAE,EAAE;QAAEoB,IAAI,EAAE,EAAE;QAAEC,KAAK,EAAE;MAAG,CAAE;MAAA/D,QAAA,eAEtDP,IAAA,CAACP,IAAI;QAAC8C,KAAK,EAAE,CAACc,YAAY,CAACO,GAAG,EAAE;UAAE7B,eAAe,EAAEnB,KAAK,CAACoB,MAAM,CAACuC;QAAK,CAAC;MAAE,CAAE;IAAC,CAClE;EAAC,CACR,CAAC;AAEX;AAEA,OAAO,SAASC,KAAKA,CAAA,EAAG;EACtB,OAAO,IAAI;AACb;AAEA,OAAO,SAASC,QAAQA,CAAA,EAAG;EACzB,OAAO,IAAI;AACb","ignoreList":[]}
|
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
// Web variant of the `./dialog` barrel.
|
|
4
4
|
//
|
|
5
5
|
// The default barrel (`./index.ts`) re-exports from `./Dialog`, which on
|
|
6
|
-
// native uses `react-native-safe-area-context` and
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
// and the in-package `Portal`.
|
|
6
|
+
// native uses `react-native-safe-area-context` and Bloom's own `BottomSheet`
|
|
7
|
+
// primitive. The web fork (`./Dialog.web`) is a pure-DOM modal overlay that
|
|
8
|
+
// depends only on `react-remove-scroll-bar` and the in-package `Portal`.
|
|
10
9
|
//
|
|
11
10
|
// Web bundlers select this file via the `"browser"` condition in
|
|
12
11
|
// `package.json`'s `exports['./dialog']`; native bundlers fall through to
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Outer","Inner","ScrollableInner","Handle","Close","Backdrop","useDialogContext","useDialogControl"],"sourceRoot":"../../../src","sources":["dialog/index.web.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"names":["Outer","Inner","ScrollableInner","Handle","Close","Backdrop","useDialogContext","useDialogControl"],"sourceRoot":"../../../src","sources":["dialog/index.web.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,KAAK,EAAEC,KAAK,EAAEC,eAAe,EAAEC,MAAM,EAAEC,KAAK,EAAEC,QAAQ,QAAQ,iBAAc;AACrF,SAASC,gBAAgB,EAAEC,gBAAgB,QAAQ,cAAW","ignoreList":[]}
|
|
@@ -19,10 +19,22 @@ export interface BottomSheetProps {
|
|
|
19
19
|
style?: StyleProp<ViewStyle>;
|
|
20
20
|
onPress?: () => void;
|
|
21
21
|
}) => React.ReactElement | null;
|
|
22
|
+
/**
|
|
23
|
+
* Style applied to the sheet container (the outer Animated.View positioned at
|
|
24
|
+
* the bottom of the screen). Use this to override `maxWidth`, `height`,
|
|
25
|
+
* background color, border radius, etc. Composed AFTER the internal sheet
|
|
26
|
+
* styles so it can override them.
|
|
27
|
+
*/
|
|
22
28
|
style?: StyleProp<ViewStyle>;
|
|
23
29
|
enableHandlePanningGesture?: boolean;
|
|
24
30
|
onDismissAttempt?: () => boolean;
|
|
25
31
|
detached?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Whether to render the built-in (non-interactive) drag handle bar at the top
|
|
34
|
+
* of the sheet. Defaults to `true`. Set to `false` when the consumer renders
|
|
35
|
+
* its own handle (e.g. an interactive close affordance) inside `children`.
|
|
36
|
+
*/
|
|
37
|
+
showHandle?: boolean;
|
|
26
38
|
}
|
|
27
39
|
declare const BottomSheet: React.ForwardRefExoticComponent<BottomSheetProps & React.RefAttributes<BottomSheetRef>>;
|
|
28
40
|
export default BottomSheet;
|
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yFAqUf,CAAC;AAmGH,eAAe,WAAW,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { DialogInnerProps, DialogOuterProps } from './types';
|
|
3
3
|
export { useDialogContext, useDialogControl } from './context';
|
|
4
4
|
export type { DialogControlProps, DialogOuterProps, DialogInnerProps } from './types';
|
|
5
|
-
export declare function Outer({ children, control, onClose, testID, preventExpansion, }: React.PropsWithChildren<DialogOuterProps>): import("react/jsx-runtime").JSX.Element
|
|
5
|
+
export declare function Outer({ children, control, onClose, testID, preventExpansion, }: React.PropsWithChildren<DialogOuterProps>): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare function Inner({ children, style, header, contentContainerStyle }: DialogInnerProps): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export declare function ScrollableInner(props: DialogInnerProps): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export declare function Handle(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../../src/dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAOjF,OAAO,KAAK,EAAsB,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEtF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC/D,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../../src/dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAOjF,OAAO,KAAK,EAAsB,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEtF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC/D,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEtF,wBAAgB,KAAK,CAAC,EACpB,QAAQ,EACR,OAAO,EACP,OAAO,EACP,MAAM,EACN,gBAAgB,GACjB,EAAE,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,2CAgF3C;AAED,wBAAgB,KAAK,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,EAAE,gBAAgB,2CAgBzF;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,gBAAgB,2CAEtD;AAOD,wBAAgB,MAAM,4CAgBrB;AAED,wBAAgB,KAAK,SAEpB;AAED,wBAAgB,QAAQ,SAEvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/dialog/index.web.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/dialog/index.web.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC/D,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -19,10 +19,22 @@ export interface BottomSheetProps {
|
|
|
19
19
|
style?: StyleProp<ViewStyle>;
|
|
20
20
|
onPress?: () => void;
|
|
21
21
|
}) => React.ReactElement | null;
|
|
22
|
+
/**
|
|
23
|
+
* Style applied to the sheet container (the outer Animated.View positioned at
|
|
24
|
+
* the bottom of the screen). Use this to override `maxWidth`, `height`,
|
|
25
|
+
* background color, border radius, etc. Composed AFTER the internal sheet
|
|
26
|
+
* styles so it can override them.
|
|
27
|
+
*/
|
|
22
28
|
style?: StyleProp<ViewStyle>;
|
|
23
29
|
enableHandlePanningGesture?: boolean;
|
|
24
30
|
onDismissAttempt?: () => boolean;
|
|
25
31
|
detached?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Whether to render the built-in (non-interactive) drag handle bar at the top
|
|
34
|
+
* of the sheet. Defaults to `true`. Set to `false` when the consumer renders
|
|
35
|
+
* its own handle (e.g. an interactive close affordance) inside `children`.
|
|
36
|
+
*/
|
|
37
|
+
showHandle?: boolean;
|
|
26
38
|
}
|
|
27
39
|
declare const BottomSheet: React.ForwardRefExoticComponent<BottomSheetProps & React.RefAttributes<BottomSheetRef>>;
|
|
28
40
|
export default BottomSheet;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/bottom-sheet/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAOH,KAAK,SAAS,EACd,KAAK,SAAS,EACjB,MAAM,cAAc,CAAC;AA8CtB,MAAM,WAAW,cAAc;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACrD;AAED,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,CAA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CAAC,YAAY,GAAG,IAAI,CAAC;IAC7F,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;KAAE,KAAK,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;IACjH;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,gBAAgB,CAAC,EAAE,MAAM,OAAO,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,QAAA,MAAM,WAAW,yFAqUf,CAAC;AAmGH,eAAe,WAAW,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { DialogInnerProps, DialogOuterProps } from './types';
|
|
3
3
|
export { useDialogContext, useDialogControl } from './context';
|
|
4
4
|
export type { DialogControlProps, DialogOuterProps, DialogInnerProps } from './types';
|
|
5
|
-
export declare function Outer({ children, control, onClose, testID, preventExpansion, }: React.PropsWithChildren<DialogOuterProps>): import("react/jsx-runtime").JSX.Element
|
|
5
|
+
export declare function Outer({ children, control, onClose, testID, preventExpansion, }: React.PropsWithChildren<DialogOuterProps>): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare function Inner({ children, style, header, contentContainerStyle }: DialogInnerProps): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export declare function ScrollableInner(props: DialogInnerProps): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export declare function Handle(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../../src/dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAOjF,OAAO,KAAK,EAAsB,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEtF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC/D,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../../src/dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAOjF,OAAO,KAAK,EAAsB,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEtF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC/D,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEtF,wBAAgB,KAAK,CAAC,EACpB,QAAQ,EACR,OAAO,EACP,OAAO,EACP,MAAM,EACN,gBAAgB,GACjB,EAAE,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,2CAgF3C;AAED,wBAAgB,KAAK,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,EAAE,gBAAgB,2CAgBzF;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,gBAAgB,2CAEtD;AAOD,wBAAgB,MAAM,4CAgBrB;AAED,wBAAgB,KAAK,SAEpB;AAED,wBAAgB,QAAQ,SAEvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/dialog/index.web.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/dialog/index.web.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC/D,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxyhq/bloom",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.9",
|
|
4
4
|
"description": "Bloom UI — Oxy ecosystem component library for React Native + Expo + Web",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -602,7 +602,6 @@
|
|
|
602
602
|
"release": "rm -rf lib && npm run build && release-it"
|
|
603
603
|
},
|
|
604
604
|
"devDependencies": {
|
|
605
|
-
"@gorhom/bottom-sheet": "^5.2.8",
|
|
606
605
|
"@testing-library/react-native": "^13.3.3",
|
|
607
606
|
"@types/jest": "^30.0.0",
|
|
608
607
|
"@types/react": "~19.1.0",
|
|
@@ -627,7 +626,6 @@
|
|
|
627
626
|
"typescript": "~5.9.2"
|
|
628
627
|
},
|
|
629
628
|
"peerDependencies": {
|
|
630
|
-
"@gorhom/bottom-sheet": ">=5.0.0",
|
|
631
629
|
"expo": "*",
|
|
632
630
|
"expo-font": "*",
|
|
633
631
|
"react": ">=18.0.0",
|
|
@@ -641,9 +639,6 @@
|
|
|
641
639
|
"sonner-native": ">=0.17.0"
|
|
642
640
|
},
|
|
643
641
|
"peerDependenciesMeta": {
|
|
644
|
-
"@gorhom/bottom-sheet": {
|
|
645
|
-
"optional": true
|
|
646
|
-
},
|
|
647
642
|
"expo": {
|
|
648
643
|
"optional": true
|
|
649
644
|
},
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
type ViewStyle,
|
|
11
11
|
type StyleProp,
|
|
12
12
|
} from 'react-native';
|
|
13
|
-
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
13
|
+
import { Gesture, GestureDetector, GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
14
14
|
import Animated, {
|
|
15
15
|
interpolate,
|
|
16
16
|
runOnJS,
|
|
@@ -70,10 +70,22 @@ export interface BottomSheetProps {
|
|
|
70
70
|
enablePanDownToClose?: boolean;
|
|
71
71
|
backgroundComponent?: (props: { style?: StyleProp<ViewStyle> }) => React.ReactElement | null;
|
|
72
72
|
backdropComponent?: (props: { style?: StyleProp<ViewStyle>; onPress?: () => void }) => React.ReactElement | null;
|
|
73
|
+
/**
|
|
74
|
+
* Style applied to the sheet container (the outer Animated.View positioned at
|
|
75
|
+
* the bottom of the screen). Use this to override `maxWidth`, `height`,
|
|
76
|
+
* background color, border radius, etc. Composed AFTER the internal sheet
|
|
77
|
+
* styles so it can override them.
|
|
78
|
+
*/
|
|
73
79
|
style?: StyleProp<ViewStyle>;
|
|
74
80
|
enableHandlePanningGesture?: boolean;
|
|
75
81
|
onDismissAttempt?: () => boolean;
|
|
76
82
|
detached?: boolean; // If true, shows with margins and rounded corners. If false, full width with rounded top only.
|
|
83
|
+
/**
|
|
84
|
+
* Whether to render the built-in (non-interactive) drag handle bar at the top
|
|
85
|
+
* of the sheet. Defaults to `true`. Set to `false` when the consumer renders
|
|
86
|
+
* its own handle (e.g. an interactive close affordance) inside `children`.
|
|
87
|
+
*/
|
|
88
|
+
showHandle?: boolean;
|
|
77
89
|
}
|
|
78
90
|
|
|
79
91
|
const BottomSheet = forwardRef((props: BottomSheetProps, ref: React.ForwardedRef<BottomSheetRef>) => {
|
|
@@ -87,6 +99,7 @@ const BottomSheet = forwardRef((props: BottomSheetProps, ref: React.ForwardedRef
|
|
|
87
99
|
enableHandlePanningGesture = true,
|
|
88
100
|
onDismissAttempt,
|
|
89
101
|
detached = false,
|
|
102
|
+
showHandle = true,
|
|
90
103
|
} = props;
|
|
91
104
|
|
|
92
105
|
const insets = useSafeAreaInsets();
|
|
@@ -348,51 +361,56 @@ const BottomSheet = forwardRef((props: BottomSheetProps, ref: React.ForwardedRef
|
|
|
348
361
|
|
|
349
362
|
return (
|
|
350
363
|
<Modal visible={rendered} transparent animationType="none" statusBarTranslucent onRequestClose={dismiss}>
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
{backgroundComponent?.({ style: styles.background })}
|
|
365
|
-
|
|
366
|
-
<View style={dynamicStyles.handle} />
|
|
367
|
-
|
|
368
|
-
<GestureDetector gesture={nativeGesture}>
|
|
369
|
-
<Animated.ScrollView
|
|
370
|
-
ref={scrollViewRef}
|
|
371
|
-
style={[
|
|
372
|
-
styles.scrollView,
|
|
373
|
-
Platform.OS === 'web' && ({
|
|
374
|
-
scrollbarWidth: 'thin',
|
|
375
|
-
scrollbarColor: `${colors.border} transparent`,
|
|
376
|
-
} as ViewStyle),
|
|
377
|
-
]}
|
|
378
|
-
contentContainerStyle={dynamicStyles.scrollContent}
|
|
379
|
-
showsVerticalScrollIndicator={false}
|
|
380
|
-
keyboardShouldPersistTaps="handled"
|
|
381
|
-
onScroll={scrollHandler}
|
|
382
|
-
scrollEventThrottle={16}
|
|
383
|
-
{...(Platform.OS === 'web' ? { className: 'bottom-sheet-scrollview' } : undefined)}
|
|
384
|
-
onLayout={() => {
|
|
385
|
-
if (Platform.OS === 'web') {
|
|
386
|
-
createWebScrollbarStyle(colors.border);
|
|
387
|
-
}
|
|
388
|
-
}}
|
|
389
|
-
>
|
|
390
|
-
{children}
|
|
391
|
-
</Animated.ScrollView>
|
|
392
|
-
</GestureDetector>
|
|
364
|
+
{/* RN's Modal renders into its own native window. The app-root
|
|
365
|
+
GestureHandlerRootView does NOT extend into it, so pan gestures
|
|
366
|
+
silently no-op without this wrapper. */}
|
|
367
|
+
<GestureHandlerRootView style={styles.rootView}>
|
|
368
|
+
<View style={StyleSheet.absoluteFill}>
|
|
369
|
+
<Animated.View style={[styles.backdrop, backdropStyle]}>
|
|
370
|
+
{backdropComponent ? (
|
|
371
|
+
backdropComponent({ onPress: handleBackdropPress })
|
|
372
|
+
) : (
|
|
373
|
+
<Pressable style={styles.backdropTouchable} onPress={handleBackdropPress}>
|
|
374
|
+
<View style={StyleSheet.absoluteFill} />
|
|
375
|
+
</Pressable>
|
|
376
|
+
)}
|
|
393
377
|
</Animated.View>
|
|
394
|
-
|
|
395
|
-
|
|
378
|
+
|
|
379
|
+
<GestureDetector gesture={panGesture}>
|
|
380
|
+
<Animated.View style={[dynamicStyles.sheet, sheetMarginStyle, sheetStyle, sheetHeightStyle, style]}>
|
|
381
|
+
{backgroundComponent?.({ style: styles.background })}
|
|
382
|
+
|
|
383
|
+
{showHandle && <View style={dynamicStyles.handle} />}
|
|
384
|
+
|
|
385
|
+
<GestureDetector gesture={nativeGesture}>
|
|
386
|
+
<Animated.ScrollView
|
|
387
|
+
ref={scrollViewRef}
|
|
388
|
+
style={[
|
|
389
|
+
styles.scrollView,
|
|
390
|
+
Platform.OS === 'web' && ({
|
|
391
|
+
scrollbarWidth: 'thin',
|
|
392
|
+
scrollbarColor: `${colors.border} transparent`,
|
|
393
|
+
} as ViewStyle),
|
|
394
|
+
]}
|
|
395
|
+
contentContainerStyle={dynamicStyles.scrollContent}
|
|
396
|
+
showsVerticalScrollIndicator={false}
|
|
397
|
+
keyboardShouldPersistTaps="handled"
|
|
398
|
+
onScroll={scrollHandler}
|
|
399
|
+
scrollEventThrottle={16}
|
|
400
|
+
{...(Platform.OS === 'web' ? { className: 'bottom-sheet-scrollview' } : undefined)}
|
|
401
|
+
onLayout={() => {
|
|
402
|
+
if (Platform.OS === 'web') {
|
|
403
|
+
createWebScrollbarStyle(colors.border);
|
|
404
|
+
}
|
|
405
|
+
}}
|
|
406
|
+
>
|
|
407
|
+
{children}
|
|
408
|
+
</Animated.ScrollView>
|
|
409
|
+
</GestureDetector>
|
|
410
|
+
</Animated.View>
|
|
411
|
+
</GestureDetector>
|
|
412
|
+
</View>
|
|
413
|
+
</GestureHandlerRootView>
|
|
396
414
|
</Modal>
|
|
397
415
|
);
|
|
398
416
|
});
|
|
@@ -400,6 +418,9 @@ const BottomSheet = forwardRef((props: BottomSheetProps, ref: React.ForwardedRef
|
|
|
400
418
|
BottomSheet.displayName = 'BottomSheet';
|
|
401
419
|
|
|
402
420
|
const styles = StyleSheet.create({
|
|
421
|
+
rootView: {
|
|
422
|
+
flex: 1,
|
|
423
|
+
},
|
|
403
424
|
backdrop: {
|
|
404
425
|
flex: 1,
|
|
405
426
|
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|