@oxyhq/bloom 0.30.4 → 0.30.6
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/avatar/Avatar.js +4 -2
- package/lib/commonjs/avatar/Avatar.js.map +1 -1
- package/lib/commonjs/bottom-sheet/BottomSheetBase.js +744 -0
- package/lib/commonjs/bottom-sheet/BottomSheetBase.js.map +1 -0
- package/lib/commonjs/bottom-sheet/index.js +24 -694
- package/lib/commonjs/bottom-sheet/index.js.map +1 -1
- package/lib/commonjs/bottom-sheet/index.web.js +64 -0
- package/lib/commonjs/bottom-sheet/index.web.js.map +1 -0
- package/lib/commonjs/dialog/Dialog.js +2 -2
- package/lib/commonjs/dialog/Dialog.js.map +1 -1
- package/lib/commonjs/dialog/DialogBottomSheet.js +2 -2
- package/lib/commonjs/dialog/DialogBottomSheet.js.map +1 -1
- package/lib/commonjs/dialog/SheetShell.js +2 -2
- package/lib/commonjs/dialog/SheetShell.js.map +1 -1
- package/lib/commonjs/index.js +44 -44
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +66 -66
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/module/avatar/Avatar.js +4 -2
- package/lib/module/avatar/Avatar.js.map +1 -1
- package/lib/module/bottom-sheet/BottomSheetBase.js +741 -0
- package/lib/module/bottom-sheet/BottomSheetBase.js.map +1 -0
- package/lib/module/bottom-sheet/index.js +27 -696
- package/lib/module/bottom-sheet/index.js.map +1 -1
- package/lib/module/bottom-sheet/index.web.js +63 -0
- package/lib/module/bottom-sheet/index.web.js.map +1 -0
- package/lib/module/dialog/Dialog.js +1 -1
- package/lib/module/dialog/Dialog.js.map +1 -1
- package/lib/module/dialog/DialogBottomSheet.js +1 -1
- package/lib/module/dialog/DialogBottomSheet.js.map +1 -1
- package/lib/module/dialog/SheetShell.js +1 -1
- package/lib/module/dialog/SheetShell.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +1 -1
- package/lib/module/index.web.js.map +1 -1
- package/lib/typescript/commonjs/avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/commonjs/avatar/types.d.ts +4 -3
- package/lib/typescript/commonjs/avatar/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/bottom-sheet/BottomSheetBase.d.ts +127 -0
- package/lib/typescript/commonjs/bottom-sheet/BottomSheetBase.d.ts.map +1 -0
- package/lib/typescript/commonjs/bottom-sheet/index.d.ts +2 -90
- package/lib/typescript/commonjs/bottom-sheet/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/bottom-sheet/index.web.d.ts +7 -0
- package/lib/typescript/commonjs/bottom-sheet/index.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.web.d.ts +2 -2
- package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
- package/lib/typescript/module/avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/module/avatar/types.d.ts +4 -3
- package/lib/typescript/module/avatar/types.d.ts.map +1 -1
- package/lib/typescript/module/bottom-sheet/BottomSheetBase.d.ts +127 -0
- package/lib/typescript/module/bottom-sheet/BottomSheetBase.d.ts.map +1 -0
- package/lib/typescript/module/bottom-sheet/index.d.ts +2 -90
- package/lib/typescript/module/bottom-sheet/index.d.ts.map +1 -1
- package/lib/typescript/module/bottom-sheet/index.web.d.ts +7 -0
- package/lib/typescript/module/bottom-sheet/index.web.d.ts.map +1 -0
- package/lib/typescript/module/index.web.d.ts +2 -2
- package/lib/typescript/module/index.web.d.ts.map +1 -1
- package/package.json +6 -1
- package/src/__tests__/BottomSheetWebFork.test.ts +66 -0
- package/src/avatar/Avatar.tsx +4 -2
- package/src/avatar/types.ts +4 -3
- package/src/bottom-sheet/BottomSheetBase.tsx +866 -0
- package/src/bottom-sheet/index.tsx +26 -821
- package/src/bottom-sheet/index.web.tsx +66 -0
- package/src/index.web.ts +2 -2
|
@@ -1,95 +1,7 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import { type
|
|
3
|
-
export interface BottomSheetRef {
|
|
4
|
-
present: () => void;
|
|
5
|
-
dismiss: () => void;
|
|
6
|
-
close: () => void;
|
|
7
|
-
expand: () => void;
|
|
8
|
-
collapse: () => void;
|
|
9
|
-
scrollTo: (y: number, animated?: boolean) => void;
|
|
10
|
-
}
|
|
11
|
-
export interface BottomSheetProps {
|
|
12
|
-
children: React.ReactNode;
|
|
13
|
-
onDismiss?: () => void;
|
|
14
|
-
enablePanDownToClose?: boolean;
|
|
15
|
-
backgroundComponent?: (props: {
|
|
16
|
-
style?: StyleProp<ViewStyle>;
|
|
17
|
-
}) => React.ReactElement | null;
|
|
18
|
-
backdropComponent?: (props: {
|
|
19
|
-
style?: StyleProp<ViewStyle>;
|
|
20
|
-
onPress?: () => void;
|
|
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
|
-
*/
|
|
28
|
-
style?: StyleProp<ViewStyle>;
|
|
29
|
-
enableHandlePanningGesture?: boolean;
|
|
30
|
-
onDismissAttempt?: () => boolean;
|
|
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;
|
|
38
|
-
/**
|
|
39
|
-
* Opacity of the dimming backdrop behind the sheet (0–1). Defaults to `0.5`.
|
|
40
|
-
* Set to a higher value (e.g. `0.7`) when the sheet is presented over another
|
|
41
|
-
* bottom sheet (Dialog cases) so the underlying handle/content does not
|
|
42
|
-
* bleed through.
|
|
43
|
-
*/
|
|
44
|
-
backdropOpacity?: number;
|
|
45
|
-
/**
|
|
46
|
-
* When `true` (default), children are wrapped in an internal scrollable
|
|
47
|
-
* container — convenient for vertical content that can overflow.
|
|
48
|
-
*
|
|
49
|
-
* Set to `false` when the screen owns its own scrolling primitive
|
|
50
|
-
* (e.g. a `FlatList`, `SectionList`, or any other VirtualizedList).
|
|
51
|
-
* Nesting a VirtualizedList inside the internal ScrollView would break
|
|
52
|
-
* windowing/keyboard handling and trigger a React Native warning. In
|
|
53
|
-
* non-scrollable mode the screen receives the full available height
|
|
54
|
-
* (minus the drag handle) and must manage its own overflow.
|
|
55
|
-
*/
|
|
56
|
-
scrollable?: boolean;
|
|
57
|
-
/**
|
|
58
|
-
* When `true`, the body pan uses RNGH's `manualActivation` and only
|
|
59
|
-
* activates when (a) the inner ScrollView is at the top AND (b) the user
|
|
60
|
-
* has moved their finger downward by > 8dp. This is the @gorhom/bottom-sheet
|
|
61
|
-
* coordination model — recommended for sheets containing scrollable content
|
|
62
|
-
* on Android (avoids stealing vertical events from the inner scroller).
|
|
63
|
-
*
|
|
64
|
-
* When `false` (default), the body pan is always active and gates on the
|
|
65
|
-
* scroll offset at `onStart` time. This is the legacy behavior, preserved
|
|
66
|
-
* for backwards compatibility with current bloom consumers.
|
|
67
|
-
*
|
|
68
|
-
* Enabling this also splits the drag handle into its own dedicated,
|
|
69
|
-
* unconditional pan so users can always grab the handle to drag — even
|
|
70
|
-
* when the inner ScrollView is mid-scroll.
|
|
71
|
-
*/
|
|
72
|
-
manualActivation?: boolean;
|
|
73
|
-
/**
|
|
74
|
-
* When `true`, the backdrop dims proportionally with drag distance — the
|
|
75
|
-
* overlay fades from full opacity (sheet at rest) to 30% as the sheet is
|
|
76
|
-
* pulled down 40% of the screen height. iOS Photos style. The base
|
|
77
|
-
* `backdropOpacity` still controls the resting dim level.
|
|
78
|
-
*
|
|
79
|
-
* Defaults to `false` (constant opacity during drag).
|
|
80
|
-
*/
|
|
81
|
-
dynamicBackdrop?: boolean;
|
|
82
|
-
/**
|
|
83
|
-
* Custom handle slot. When provided, replaces the default drag handle
|
|
84
|
-
* (the 36×5 pill). The rendered handle is wrapped in the dedicated handle
|
|
85
|
-
* gesture detector (when `manualActivation` is `true`) so it remains
|
|
86
|
-
* unconditionally draggable. `showHandle={false}` still suppresses any
|
|
87
|
-
* handle rendering — `handleComponent` is only consulted when
|
|
88
|
-
* `showHandle` is `true`.
|
|
89
|
-
*/
|
|
90
|
-
handleComponent?: () => React.ReactNode;
|
|
91
|
-
}
|
|
2
|
+
import { type BottomSheetProps, type BottomSheetRef } from './BottomSheetBase';
|
|
92
3
|
declare const BottomSheet: React.ForwardRefExoticComponent<BottomSheetProps & React.RefAttributes<BottomSheetRef>>;
|
|
4
|
+
export type { BottomSheetProps, BottomSheetRef };
|
|
93
5
|
export default BottomSheet;
|
|
94
6
|
export { BottomSheet };
|
|
95
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/bottom-sheet/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAEH,KAAK,gBAAgB,EACrB,KAAK,cAAc,EAEtB,MAAM,mBAAmB,CAAC;AA8E3B,QAAA,MAAM,WAAW,yFAEf,CAAC;AAUH,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,CAAC;AACjD,eAAe,WAAW,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { type BottomSheetProps, type BottomSheetRef } from './BottomSheetBase';
|
|
3
|
+
declare const BottomSheet: React.ForwardRefExoticComponent<BottomSheetProps & React.RefAttributes<BottomSheetRef>>;
|
|
4
|
+
export type { BottomSheetProps, BottomSheetRef };
|
|
5
|
+
export default BottomSheet;
|
|
6
|
+
export { BottomSheet };
|
|
7
|
+
//# sourceMappingURL=index.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/bottom-sheet/index.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAEH,KAAK,gBAAgB,EACrB,KAAK,cAAc,EAEtB,MAAM,mBAAmB,CAAC;AA8B3B,QAAA,MAAM,WAAW,yFAEf,CAAC;AAoBH,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,CAAC;AACjD,eAAe,WAAW,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -69,8 +69,8 @@ export { Slider } from './slider';
|
|
|
69
69
|
export type { SliderProps } from './slider';
|
|
70
70
|
export { Combobox } from './combobox/index.web';
|
|
71
71
|
export type { ComboboxProps, ComboboxOption } from './combobox/index.web';
|
|
72
|
-
export { BottomSheet } from './bottom-sheet';
|
|
73
|
-
export type { BottomSheetRef, BottomSheetProps } from './bottom-sheet';
|
|
72
|
+
export { BottomSheet } from './bottom-sheet/index.web';
|
|
73
|
+
export type { BottomSheetRef, BottomSheetProps } from './bottom-sheet/index.web';
|
|
74
74
|
export * from './card';
|
|
75
75
|
export * from './badge';
|
|
76
76
|
export * from './chip';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../src/index.web.ts"],"names":[],"mappings":"AAMA,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAC3D,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC7D,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C;AAGrE,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAG/B,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../src/avatar/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAY/D,OAAO,KAAK,EAAE,WAAW,EAAoB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../src/avatar/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAY/D,OAAO,KAAK,EAAE,WAAW,EAAoB,MAAM,SAAS,CAAC;AA8X7D,eAAO,MAAM,MAAM,yCAAwB,CAAC"}
|
|
@@ -25,9 +25,10 @@ export interface AvatarProps {
|
|
|
25
25
|
/**
|
|
26
26
|
* Rendition variant forwarded to the {@link ImageResolver} when `source` is a
|
|
27
27
|
* bare file ID (a non-URL string). Selects a server-side rendition such as
|
|
28
|
-
* `'thumb'`, `'small'`, or `'medium'
|
|
29
|
-
*
|
|
30
|
-
*
|
|
28
|
+
* `'thumb'`, `'small'`, or `'medium'`. Defaults to `'thumb'` so an avatar
|
|
29
|
+
* never accidentally requests the full-size original; pass an explicit
|
|
30
|
+
* variant (e.g. a larger rendition) when you need a bigger image. Ignored when
|
|
31
|
+
* `source` is already a full URL/`{uri}` or when no resolver is registered.
|
|
31
32
|
*/
|
|
32
33
|
variant?: string;
|
|
33
34
|
/** Fallback image source when source/uri is missing or errors (defaults to colored circle) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/avatar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,SAAS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AAW,WAAW;IAC1B;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,mBAAmB,GAAG,IAAI,CAAC;IAC7C,+DAA+D;IAC/D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8FAA8F;IAC9F,cAAc,CAAC,EAAE,mBAAmB,CAAC;IACrC,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4DAA4D;IAC5D,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,wFAAwF;IACxF,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,sBAAsB;IACtB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,sCAAsC;IACtC,UAAU,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IACnC,mFAAmF;IACnF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oFAAoF;IACpF,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,8EAA8E;IAC9E,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { type ViewStyle, type StyleProp } from 'react-native';
|
|
3
|
+
import { type SharedValue } from 'react-native-reanimated';
|
|
4
|
+
export interface BottomSheetRef {
|
|
5
|
+
present: () => void;
|
|
6
|
+
dismiss: () => void;
|
|
7
|
+
close: () => void;
|
|
8
|
+
expand: () => void;
|
|
9
|
+
collapse: () => void;
|
|
10
|
+
scrollTo: (y: number, animated?: boolean) => void;
|
|
11
|
+
}
|
|
12
|
+
export interface BottomSheetProps {
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
onDismiss?: () => void;
|
|
15
|
+
enablePanDownToClose?: boolean;
|
|
16
|
+
backgroundComponent?: (props: {
|
|
17
|
+
style?: StyleProp<ViewStyle>;
|
|
18
|
+
}) => React.ReactElement | null;
|
|
19
|
+
backdropComponent?: (props: {
|
|
20
|
+
style?: StyleProp<ViewStyle>;
|
|
21
|
+
onPress?: () => void;
|
|
22
|
+
}) => React.ReactElement | null;
|
|
23
|
+
/**
|
|
24
|
+
* Style applied to the sheet container (the outer Animated.View positioned at
|
|
25
|
+
* the bottom of the screen). Use this to override `maxWidth`, `height`,
|
|
26
|
+
* background color, border radius, etc. Composed AFTER the internal sheet
|
|
27
|
+
* styles so it can override them.
|
|
28
|
+
*/
|
|
29
|
+
style?: StyleProp<ViewStyle>;
|
|
30
|
+
enableHandlePanningGesture?: boolean;
|
|
31
|
+
onDismissAttempt?: () => boolean;
|
|
32
|
+
detached?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Whether to render the built-in (non-interactive) drag handle bar at the top
|
|
35
|
+
* of the sheet. Defaults to `true`. Set to `false` when the consumer renders
|
|
36
|
+
* its own handle (e.g. an interactive close affordance) inside `children`.
|
|
37
|
+
*/
|
|
38
|
+
showHandle?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Opacity of the dimming backdrop behind the sheet (0–1). Defaults to `0.5`.
|
|
41
|
+
* Set to a higher value (e.g. `0.7`) when the sheet is presented over another
|
|
42
|
+
* bottom sheet (Dialog cases) so the underlying handle/content does not
|
|
43
|
+
* bleed through.
|
|
44
|
+
*/
|
|
45
|
+
backdropOpacity?: number;
|
|
46
|
+
/**
|
|
47
|
+
* When `true` (default), children are wrapped in an internal scrollable
|
|
48
|
+
* container — convenient for vertical content that can overflow.
|
|
49
|
+
*
|
|
50
|
+
* Set to `false` when the screen owns its own scrolling primitive
|
|
51
|
+
* (e.g. a `FlatList`, `SectionList`, or any other VirtualizedList).
|
|
52
|
+
* Nesting a VirtualizedList inside the internal ScrollView would break
|
|
53
|
+
* windowing/keyboard handling and trigger a React Native warning. In
|
|
54
|
+
* non-scrollable mode the screen receives the full available height
|
|
55
|
+
* (minus the drag handle) and must manage its own overflow.
|
|
56
|
+
*/
|
|
57
|
+
scrollable?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* When `true`, the body pan uses RNGH's `manualActivation` and only
|
|
60
|
+
* activates when (a) the inner ScrollView is at the top AND (b) the user
|
|
61
|
+
* has moved their finger downward by > 8dp. This is the @gorhom/bottom-sheet
|
|
62
|
+
* coordination model — recommended for sheets containing scrollable content
|
|
63
|
+
* on Android (avoids stealing vertical events from the inner scroller).
|
|
64
|
+
*
|
|
65
|
+
* When `false` (default), the body pan is always active and gates on the
|
|
66
|
+
* scroll offset at `onStart` time. This is the legacy behavior, preserved
|
|
67
|
+
* for backwards compatibility with current bloom consumers.
|
|
68
|
+
*
|
|
69
|
+
* Enabling this also splits the drag handle into its own dedicated,
|
|
70
|
+
* unconditional pan so users can always grab the handle to drag — even
|
|
71
|
+
* when the inner ScrollView is mid-scroll.
|
|
72
|
+
*/
|
|
73
|
+
manualActivation?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* When `true`, the backdrop dims proportionally with drag distance — the
|
|
76
|
+
* overlay fades from full opacity (sheet at rest) to 30% as the sheet is
|
|
77
|
+
* pulled down 40% of the screen height. iOS Photos style. The base
|
|
78
|
+
* `backdropOpacity` still controls the resting dim level.
|
|
79
|
+
*
|
|
80
|
+
* Defaults to `false` (constant opacity during drag).
|
|
81
|
+
*/
|
|
82
|
+
dynamicBackdrop?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Custom handle slot. When provided, replaces the default drag handle
|
|
85
|
+
* (the 36×5 pill). The rendered handle is wrapped in the dedicated handle
|
|
86
|
+
* gesture detector (when `manualActivation` is `true`) so it remains
|
|
87
|
+
* unconditionally draggable. `showHandle={false}` still suppresses any
|
|
88
|
+
* handle rendering — `handleComponent` is only consulted when
|
|
89
|
+
* `showHandle` is `true`.
|
|
90
|
+
*/
|
|
91
|
+
handleComponent?: () => React.ReactNode;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Props consumed by a platform Shell — the outermost wrapper that hosts the
|
|
95
|
+
* sheet body in a full-screen overlay. Native wraps it in RN's `<Modal>` +
|
|
96
|
+
* `<KeyboardProvider>` + `<GestureHandlerRootView>`; web wraps it in bloom's
|
|
97
|
+
* stable DOM `<Portal>` + a fixed `<GestureHandlerRootView>`. Splitting the
|
|
98
|
+
* shell is what lets web avoid RN-Web's `<Modal>`/`ModalPortal`, whose host
|
|
99
|
+
* node is orphaned under React 19 concurrent/StrictMode so the sheet mounts
|
|
100
|
+
* but never paints.
|
|
101
|
+
*/
|
|
102
|
+
export interface BottomSheetShellProps {
|
|
103
|
+
/** True while the sheet is mounted (open or animating closed). */
|
|
104
|
+
visible: boolean;
|
|
105
|
+
/** Hardware/back-button dismissal request (native `<Modal onRequestClose>`). */
|
|
106
|
+
onRequestClose: () => void;
|
|
107
|
+
/**
|
|
108
|
+
* Live keyboard height, driven by the native shell's keyboard tracker. Web
|
|
109
|
+
* shells ignore it (the browser owns keyboard layout) and it stays `0`.
|
|
110
|
+
*/
|
|
111
|
+
keyboardHeight: SharedValue<number>;
|
|
112
|
+
children: React.ReactNode;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Platform-agnostic bottom-sheet core: all gesture, animation, scroll, and
|
|
116
|
+
* dismissal logic lives here so native and web share ONE implementation. The
|
|
117
|
+
* only thing that differs per platform is the `Shell` (see
|
|
118
|
+
* `BottomSheetShellProps`) — injected by `index.tsx` (native) and
|
|
119
|
+
* `index.web.tsx` (web). This module imports nothing platform-specific
|
|
120
|
+
* (no RN `<Modal>`, no `react-native-keyboard-controller`) so it is safe to
|
|
121
|
+
* bundle on web.
|
|
122
|
+
*/
|
|
123
|
+
export interface BottomSheetBaseProps extends BottomSheetProps {
|
|
124
|
+
Shell: React.ComponentType<BottomSheetShellProps>;
|
|
125
|
+
}
|
|
126
|
+
export declare const BottomSheetBase: React.ForwardRefExoticComponent<BottomSheetBaseProps & React.RefAttributes<BottomSheetRef>>;
|
|
127
|
+
//# sourceMappingURL=BottomSheetBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomSheetBase.d.ts","sourceRoot":"","sources":["../../../../src/bottom-sheet/BottomSheetBase.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAMH,KAAK,SAAS,EACd,KAAK,SAAS,EACjB,MAAM,cAAc,CAAC;AAGtB,OAAiB,EAGb,KAAK,WAAW,EAMnB,MAAM,yBAAyB,CAAC;AAwBjC,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,CAAC,EAAE,SAAS,CAAC,S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|
|
@@ -1,95 +1,7 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import { type
|
|
3
|
-
export interface BottomSheetRef {
|
|
4
|
-
present: () => void;
|
|
5
|
-
dismiss: () => void;
|
|
6
|
-
close: () => void;
|
|
7
|
-
expand: () => void;
|
|
8
|
-
collapse: () => void;
|
|
9
|
-
scrollTo: (y: number, animated?: boolean) => void;
|
|
10
|
-
}
|
|
11
|
-
export interface BottomSheetProps {
|
|
12
|
-
children: React.ReactNode;
|
|
13
|
-
onDismiss?: () => void;
|
|
14
|
-
enablePanDownToClose?: boolean;
|
|
15
|
-
backgroundComponent?: (props: {
|
|
16
|
-
style?: StyleProp<ViewStyle>;
|
|
17
|
-
}) => React.ReactElement | null;
|
|
18
|
-
backdropComponent?: (props: {
|
|
19
|
-
style?: StyleProp<ViewStyle>;
|
|
20
|
-
onPress?: () => void;
|
|
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
|
-
*/
|
|
28
|
-
style?: StyleProp<ViewStyle>;
|
|
29
|
-
enableHandlePanningGesture?: boolean;
|
|
30
|
-
onDismissAttempt?: () => boolean;
|
|
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;
|
|
38
|
-
/**
|
|
39
|
-
* Opacity of the dimming backdrop behind the sheet (0–1). Defaults to `0.5`.
|
|
40
|
-
* Set to a higher value (e.g. `0.7`) when the sheet is presented over another
|
|
41
|
-
* bottom sheet (Dialog cases) so the underlying handle/content does not
|
|
42
|
-
* bleed through.
|
|
43
|
-
*/
|
|
44
|
-
backdropOpacity?: number;
|
|
45
|
-
/**
|
|
46
|
-
* When `true` (default), children are wrapped in an internal scrollable
|
|
47
|
-
* container — convenient for vertical content that can overflow.
|
|
48
|
-
*
|
|
49
|
-
* Set to `false` when the screen owns its own scrolling primitive
|
|
50
|
-
* (e.g. a `FlatList`, `SectionList`, or any other VirtualizedList).
|
|
51
|
-
* Nesting a VirtualizedList inside the internal ScrollView would break
|
|
52
|
-
* windowing/keyboard handling and trigger a React Native warning. In
|
|
53
|
-
* non-scrollable mode the screen receives the full available height
|
|
54
|
-
* (minus the drag handle) and must manage its own overflow.
|
|
55
|
-
*/
|
|
56
|
-
scrollable?: boolean;
|
|
57
|
-
/**
|
|
58
|
-
* When `true`, the body pan uses RNGH's `manualActivation` and only
|
|
59
|
-
* activates when (a) the inner ScrollView is at the top AND (b) the user
|
|
60
|
-
* has moved their finger downward by > 8dp. This is the @gorhom/bottom-sheet
|
|
61
|
-
* coordination model — recommended for sheets containing scrollable content
|
|
62
|
-
* on Android (avoids stealing vertical events from the inner scroller).
|
|
63
|
-
*
|
|
64
|
-
* When `false` (default), the body pan is always active and gates on the
|
|
65
|
-
* scroll offset at `onStart` time. This is the legacy behavior, preserved
|
|
66
|
-
* for backwards compatibility with current bloom consumers.
|
|
67
|
-
*
|
|
68
|
-
* Enabling this also splits the drag handle into its own dedicated,
|
|
69
|
-
* unconditional pan so users can always grab the handle to drag — even
|
|
70
|
-
* when the inner ScrollView is mid-scroll.
|
|
71
|
-
*/
|
|
72
|
-
manualActivation?: boolean;
|
|
73
|
-
/**
|
|
74
|
-
* When `true`, the backdrop dims proportionally with drag distance — the
|
|
75
|
-
* overlay fades from full opacity (sheet at rest) to 30% as the sheet is
|
|
76
|
-
* pulled down 40% of the screen height. iOS Photos style. The base
|
|
77
|
-
* `backdropOpacity` still controls the resting dim level.
|
|
78
|
-
*
|
|
79
|
-
* Defaults to `false` (constant opacity during drag).
|
|
80
|
-
*/
|
|
81
|
-
dynamicBackdrop?: boolean;
|
|
82
|
-
/**
|
|
83
|
-
* Custom handle slot. When provided, replaces the default drag handle
|
|
84
|
-
* (the 36×5 pill). The rendered handle is wrapped in the dedicated handle
|
|
85
|
-
* gesture detector (when `manualActivation` is `true`) so it remains
|
|
86
|
-
* unconditionally draggable. `showHandle={false}` still suppresses any
|
|
87
|
-
* handle rendering — `handleComponent` is only consulted when
|
|
88
|
-
* `showHandle` is `true`.
|
|
89
|
-
*/
|
|
90
|
-
handleComponent?: () => React.ReactNode;
|
|
91
|
-
}
|
|
2
|
+
import { type BottomSheetProps, type BottomSheetRef } from './BottomSheetBase';
|
|
92
3
|
declare const BottomSheet: React.ForwardRefExoticComponent<BottomSheetProps & React.RefAttributes<BottomSheetRef>>;
|
|
4
|
+
export type { BottomSheetProps, BottomSheetRef };
|
|
93
5
|
export default BottomSheet;
|
|
94
6
|
export { BottomSheet };
|
|
95
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/bottom-sheet/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAEH,KAAK,gBAAgB,EACrB,KAAK,cAAc,EAEtB,MAAM,mBAAmB,CAAC;AA8E3B,QAAA,MAAM,WAAW,yFAEf,CAAC;AAUH,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,CAAC;AACjD,eAAe,WAAW,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { type BottomSheetProps, type BottomSheetRef } from './BottomSheetBase';
|
|
3
|
+
declare const BottomSheet: React.ForwardRefExoticComponent<BottomSheetProps & React.RefAttributes<BottomSheetRef>>;
|
|
4
|
+
export type { BottomSheetProps, BottomSheetRef };
|
|
5
|
+
export default BottomSheet;
|
|
6
|
+
export { BottomSheet };
|
|
7
|
+
//# sourceMappingURL=index.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/bottom-sheet/index.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAEH,KAAK,gBAAgB,EACrB,KAAK,cAAc,EAEtB,MAAM,mBAAmB,CAAC;AA8B3B,QAAA,MAAM,WAAW,yFAEf,CAAC;AAoBH,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,CAAC;AACjD,eAAe,WAAW,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -69,8 +69,8 @@ export { Slider } from './slider';
|
|
|
69
69
|
export type { SliderProps } from './slider';
|
|
70
70
|
export { Combobox } from './combobox/index.web';
|
|
71
71
|
export type { ComboboxProps, ComboboxOption } from './combobox/index.web';
|
|
72
|
-
export { BottomSheet } from './bottom-sheet';
|
|
73
|
-
export type { BottomSheetRef, BottomSheetProps } from './bottom-sheet';
|
|
72
|
+
export { BottomSheet } from './bottom-sheet/index.web';
|
|
73
|
+
export type { BottomSheetRef, BottomSheetProps } from './bottom-sheet/index.web';
|
|
74
74
|
export * from './card';
|
|
75
75
|
export * from './badge';
|
|
76
76
|
export * from './chip';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../src/index.web.ts"],"names":[],"mappings":"AAMA,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAC3D,YAAY,EAAE,a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EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGrE,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAG/B,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxyhq/bloom",
|
|
3
|
-
"version": "0.30.
|
|
3
|
+
"version": "0.30.6",
|
|
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",
|
|
@@ -624,6 +624,11 @@
|
|
|
624
624
|
},
|
|
625
625
|
"./bottom-sheet": {
|
|
626
626
|
"react-native": "./src/bottom-sheet/index.tsx",
|
|
627
|
+
"browser": {
|
|
628
|
+
"types": "./lib/typescript/module/bottom-sheet/index.web.d.ts",
|
|
629
|
+
"import": "./lib/module/bottom-sheet/index.web.js",
|
|
630
|
+
"require": "./lib/commonjs/bottom-sheet/index.web.js"
|
|
631
|
+
},
|
|
627
632
|
"import": {
|
|
628
633
|
"types": "./lib/typescript/module/bottom-sheet/index.d.ts",
|
|
629
634
|
"default": "./lib/module/bottom-sheet/index.js"
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Regression guard for the BottomSheet RN-Web fix.
|
|
6
|
+
*
|
|
7
|
+
* On React-Native-Web, RN's `<Modal>` renders through `ModalPortal`, which
|
|
8
|
+
* appends its host `<div>` DURING RENDER and removes it in an unmount effect
|
|
9
|
+
* that nulls its ref. Under React 19 concurrent/StrictMode that host node is
|
|
10
|
+
* orphaned, so the sheet mounts but its DOM lands in a detached node and never
|
|
11
|
+
* paints — breaking the responsive `Dialog` bottom placement on narrow web.
|
|
12
|
+
*
|
|
13
|
+
* The fix splits the component: a shared, platform-agnostic `BottomSheetBase`
|
|
14
|
+
* (no `<Modal>`, no keyboard-controller) plus two shells — native `index.tsx`
|
|
15
|
+
* (RN `<Modal>` + keyboard-controller, unchanged) and web `index.web.tsx`
|
|
16
|
+
* (bloom's stable DOM `<Portal>`). These source/contract assertions fail loudly
|
|
17
|
+
* if any leg regresses. (The actual paint is verified in a real browser — jest
|
|
18
|
+
* cannot reproduce the RN-Web render race.)
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
const SRC = join(__dirname, '..');
|
|
22
|
+
const REPO_ROOT = join(SRC, '..');
|
|
23
|
+
|
|
24
|
+
const read = (rel: string) => readFileSync(join(SRC, rel), 'utf8');
|
|
25
|
+
|
|
26
|
+
describe('BottomSheet web fork (RN-Web Modal-orphan fix)', () => {
|
|
27
|
+
it('web shell renders through bloom DOM Portal, never RN <Modal>/keyboard-controller', () => {
|
|
28
|
+
const web = read('bottom-sheet/index.web.tsx');
|
|
29
|
+
expect(web).toMatch(/from '\.\.\/portal\/index\.web'/);
|
|
30
|
+
expect(web).toMatch(/BottomSheetBase/);
|
|
31
|
+
// The whole point: no RN Modal *import* (orphaned ModalPortal) on web.
|
|
32
|
+
// Doc comments may still reference Modal to explain why it's avoided.
|
|
33
|
+
expect(web).not.toMatch(/import \{[^}]*\bModal\b[^}]*\} from 'react-native'/);
|
|
34
|
+
expect(web).not.toMatch(/require\(\s*['"]react-native-keyboard-controller['"]/);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('native shell keeps RN <Modal> + keyboard-controller', () => {
|
|
38
|
+
const native = read('bottom-sheet/index.tsx');
|
|
39
|
+
expect(native).toMatch(/import \{ Modal[^}]*\} from 'react-native'/);
|
|
40
|
+
expect(native).toContain('react-native-keyboard-controller');
|
|
41
|
+
expect(native).toMatch(/BottomSheetBase/);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('shared base is a clean default: no <Modal>, no keyboard-controller import', () => {
|
|
45
|
+
const base = read('bottom-sheet/BottomSheetBase.tsx');
|
|
46
|
+
// Comments may MENTION Modal; assert there is no Modal *import*.
|
|
47
|
+
expect(base).not.toMatch(/import \{[^}]*\bModal\b[^}]*\} from 'react-native'/);
|
|
48
|
+
expect(base).not.toContain("require('react-native-keyboard-controller')");
|
|
49
|
+
// Base injects the platform Shell rather than hard-coding a container.
|
|
50
|
+
expect(base).toContain('Shell');
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('package.json exports ./bottom-sheet with a browser condition → index.web.js', () => {
|
|
54
|
+
const pkg = JSON.parse(readFileSync(join(REPO_ROOT, 'package.json'), 'utf8')) as {
|
|
55
|
+
exports: Record<string, { browser?: { import?: string } }>;
|
|
56
|
+
};
|
|
57
|
+
const entry = pkg.exports['./bottom-sheet'];
|
|
58
|
+
expect(entry).toBeDefined();
|
|
59
|
+
expect(entry?.browser?.import).toBe('./lib/module/bottom-sheet/index.web.js');
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('generator lists ./bottom-sheet as a web-forked subpath', () => {
|
|
63
|
+
const gen = readFileSync(join(REPO_ROOT, 'scripts/generate-platform-exports.mjs'), 'utf8');
|
|
64
|
+
expect(gen).toMatch(/WEB_FORKED_SUBPATHS[\s\S]*'\.\/bottom-sheet'/);
|
|
65
|
+
});
|
|
66
|
+
});
|
package/src/avatar/Avatar.tsx
CHANGED
|
@@ -165,7 +165,7 @@ function CircleFallback({
|
|
|
165
165
|
const AvatarComponent: React.FC<AvatarProps> = ({
|
|
166
166
|
source,
|
|
167
167
|
uri,
|
|
168
|
-
variant,
|
|
168
|
+
variant = 'thumb',
|
|
169
169
|
fallbackSource,
|
|
170
170
|
size = 40,
|
|
171
171
|
verified = false,
|
|
@@ -223,7 +223,9 @@ const AvatarComponent: React.FC<AvatarProps> = ({
|
|
|
223
223
|
// HTTP/data URLs pass through directly. Non-URL strings (e.g. Oxy file
|
|
224
224
|
// IDs) are resolved via the app-provided ImageResolver if available, with the
|
|
225
225
|
// requested `variant` forwarded so the resolver (the single URL chokepoint)
|
|
226
|
-
// can build the right rendition.
|
|
226
|
+
// can build the right rendition. `variant` defaults to `'thumb'` (see prop
|
|
227
|
+
// default) so a bare-id avatar never accidentally requests the full-size
|
|
228
|
+
// original; callers wanting the full image pass an explicit variant.
|
|
227
229
|
const resolvedUri = useMemo(() => {
|
|
228
230
|
if (typeof source === 'string') {
|
|
229
231
|
if (source.startsWith('http://') || source.startsWith('https://') || source.startsWith('data:')) {
|
package/src/avatar/types.ts
CHANGED
|
@@ -31,9 +31,10 @@ export interface AvatarProps {
|
|
|
31
31
|
/**
|
|
32
32
|
* Rendition variant forwarded to the {@link ImageResolver} when `source` is a
|
|
33
33
|
* bare file ID (a non-URL string). Selects a server-side rendition such as
|
|
34
|
-
* `'thumb'`, `'small'`, or `'medium'
|
|
35
|
-
*
|
|
36
|
-
*
|
|
34
|
+
* `'thumb'`, `'small'`, or `'medium'`. Defaults to `'thumb'` so an avatar
|
|
35
|
+
* never accidentally requests the full-size original; pass an explicit
|
|
36
|
+
* variant (e.g. a larger rendition) when you need a bigger image. Ignored when
|
|
37
|
+
* `source` is already a full URL/`{uri}` or when no resolver is registered.
|
|
37
38
|
*/
|
|
38
39
|
variant?: string;
|
|
39
40
|
/** Fallback image source when source/uri is missing or errors (defaults to colored circle) */
|