@lodev09/react-native-true-sheet 3.11.4 → 3.11.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.
Files changed (49) hide show
  1. package/android/src/main/java/com/lodev09/truesheet/TrueSheetContainerView.kt +69 -1
  2. package/android/src/main/java/com/lodev09/truesheet/TrueSheetPackage.kt +2 -1
  3. package/android/src/main/java/com/lodev09/truesheet/TrueSheetPeekView.kt +72 -0
  4. package/android/src/main/java/com/lodev09/truesheet/TrueSheetPeekViewManager.kt +33 -0
  5. package/android/src/main/java/com/lodev09/truesheet/TrueSheetView.kt +5 -0
  6. package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewController.kt +5 -0
  7. package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetDetentCalculator.kt +5 -3
  8. package/ios/TrueSheetContainerView.h +13 -0
  9. package/ios/TrueSheetContainerView.mm +72 -1
  10. package/ios/TrueSheetPeekView.h +32 -0
  11. package/ios/TrueSheetPeekView.mm +99 -0
  12. package/ios/TrueSheetView.mm +12 -0
  13. package/ios/TrueSheetViewController.h +1 -0
  14. package/ios/TrueSheetViewController.mm +28 -15
  15. package/ios/core/TrueSheetDetentCalculator.h +3 -2
  16. package/ios/core/TrueSheetDetentCalculator.mm +2 -1
  17. package/ios/tvos/TrueSheetStubs.mm +11 -0
  18. package/lib/module/TrueSheet.web.js +85 -70
  19. package/lib/module/TrueSheet.web.js.map +1 -1
  20. package/lib/module/TrueSheetPeek.js +15 -0
  21. package/lib/module/TrueSheetPeek.js.map +1 -0
  22. package/lib/module/TrueSheetPeek.web.js +46 -0
  23. package/lib/module/TrueSheetPeek.web.js.map +1 -0
  24. package/lib/module/fabric/TrueSheetPeekViewNativeComponent.ts +8 -0
  25. package/lib/module/index.js +1 -0
  26. package/lib/module/index.js.map +1 -1
  27. package/lib/module/mocks/index.js +10 -0
  28. package/lib/module/mocks/index.js.map +1 -1
  29. package/lib/typescript/src/TrueSheet.types.d.ts +3 -1
  30. package/lib/typescript/src/TrueSheet.types.d.ts.map +1 -1
  31. package/lib/typescript/src/TrueSheet.web.d.ts.map +1 -1
  32. package/lib/typescript/src/TrueSheetPeek.d.ts +9 -0
  33. package/lib/typescript/src/TrueSheetPeek.d.ts.map +1 -0
  34. package/lib/typescript/src/TrueSheetPeek.web.d.ts +19 -0
  35. package/lib/typescript/src/TrueSheetPeek.web.d.ts.map +1 -0
  36. package/lib/typescript/src/fabric/TrueSheetPeekViewNativeComponent.d.ts +6 -0
  37. package/lib/typescript/src/fabric/TrueSheetPeekViewNativeComponent.d.ts.map +1 -0
  38. package/lib/typescript/src/index.d.ts +1 -0
  39. package/lib/typescript/src/index.d.ts.map +1 -1
  40. package/lib/typescript/src/mocks/index.d.ts +6 -2
  41. package/lib/typescript/src/mocks/index.d.ts.map +1 -1
  42. package/package.json +4 -1
  43. package/src/TrueSheet.types.ts +3 -1
  44. package/src/TrueSheet.web.tsx +83 -69
  45. package/src/TrueSheetPeek.tsx +11 -0
  46. package/src/TrueSheetPeek.web.tsx +48 -0
  47. package/src/fabric/TrueSheetPeekViewNativeComponent.ts +8 -0
  48. package/src/index.ts +1 -0
  49. package/src/mocks/index.ts +8 -1
@@ -184,7 +184,9 @@ export type SheetDetent =
184
184
  'auto'
185
185
  /**
186
186
  * Collapsed height based on the combined `header` and `footer` heights.
187
- * Falls back to a fixed height of `150` when neither is provided.
187
+ * Render a `TrueSheetPeek` component within the content to also include
188
+ * the content up to its bottom edge.
189
+ * Falls back to a fixed height of `150` when none is provided.
188
190
  *
189
191
  * @platform android
190
192
  * @platform ios 16+
@@ -1 +1 @@
1
- {"version":3,"file":"TrueSheet.types.d.ts","sourceRoot":"","sources":["../../../src/TrueSheet.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EACV,UAAU,EACV,oBAAoB,EACpB,SAAS,EACT,SAAS,EACT,SAAS,EACV,M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AI,CAAC,CAAC;IAEzD;;;;OAIG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9D;;OAEG;IACH,UAAU,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/C"}
@@ -1 +1 @@
1
- {"version":3,"file":"TrueSheet.web.d.ts","sourceRoot":"","sources":["../../../src/TrueSheet.web.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAaV,gBAAgB,EAChB,cAAc,EACd,sBAAsB,EAKvB,MAAM,mBAAmB,CAAC;AAkB3B,QAAA,MAAM,kBAAkB,6GAs3BtB,CAAC;AAyCH,eAAO,MAAM,SAAS,EAAyB,OAAO,kBAAkB,GAAG,sBAAsB,CAAC"}
1
+ {"version":3,"file":"TrueSheet.web.d.ts","sourceRoot":"","sources":["../../../src/TrueSheet.web.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAaV,gBAAgB,EAChB,cAAc,EACd,sBAAsB,EAKvB,MAAM,mBAAmB,CAAC;AAkB3B,QAAA,MAAM,kBAAkB,6GAm4BtB,CAAC;AAyCH,eAAO,MAAM,SAAS,EAAyB,OAAO,kBAAkB,GAAG,sBAAsB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { ViewProps } from 'react-native';
2
+ /**
3
+ * Wrapper component that marks its children as the sheet's peek content.
4
+ * When rendered within a `TrueSheet`, the `"peek"` detent reveals everything
5
+ * from the top of the sheet through the bottom of this component — content
6
+ * below it stays hidden until the sheet is expanded.
7
+ */
8
+ export declare const TrueSheetPeek: (props: ViewProps) => import("react/jsx-runtime").JSX.Element;
9
+ //# sourceMappingURL=TrueSheetPeek.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrueSheetPeek.d.ts","sourceRoot":"","sources":["../../../src/TrueSheetPeek.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9C;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,SAAS,4CAAoD,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { type RefObject } from 'react';
2
+ import { View, type ViewProps } from 'react-native';
3
+ /**
4
+ * Reports the measured peek content height to the owning TrueSheet.
5
+ * @internal
6
+ */
7
+ export interface TrueSheetPeekContextValue {
8
+ contentRef: RefObject<View | null>;
9
+ setPeekContentHeight: (height: number) => void;
10
+ }
11
+ export declare const TrueSheetPeekContext: import("react").Context<TrueSheetPeekContextValue | null>;
12
+ /**
13
+ * Wrapper component that marks its children as the sheet's peek content.
14
+ * When rendered within a `TrueSheet`, the `"peek"` detent reveals everything
15
+ * from the top of the sheet through the bottom of this component — content
16
+ * below it stays hidden until the sheet is expanded.
17
+ */
18
+ export declare const TrueSheetPeek: ({ onLayout, ...rest }: ViewProps) => import("react/jsx-runtime").JSX.Element;
19
+ //# sourceMappingURL=TrueSheetPeek.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrueSheetPeek.web.d.ts","sourceRoot":"","sources":["../../../src/TrueSheetPeek.web.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACrF,OAAO,EAAE,IAAI,EAA0B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE5E;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IACnC,oBAAoB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAChD;AAED,eAAO,MAAM,oBAAoB,2DAAwD,CAAC;AAE1F;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,uBAAuB,SAAS,4CA2B7D,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { ViewProps } from 'react-native';
2
+ export interface NativeProps extends ViewProps {
3
+ }
4
+ declare const _default: import("react-native").HostComponent<NativeProps>;
5
+ export default _default;
6
+ //# sourceMappingURL=TrueSheetPeekViewNativeComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrueSheetPeekViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/TrueSheetPeekViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C,MAAM,WAAW,WAAY,SAAQ,SAAS;CAE7C;;AAED,wBAA4E"}
@@ -1,4 +1,5 @@
1
1
  export * from './TrueSheet';
2
2
  export * from './TrueSheet.types';
3
+ export { TrueSheetPeek } from './TrueSheetPeek';
3
4
  export { TrueSheetProvider, useTrueSheet } from './TrueSheetProvider';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { View } from 'react-native';
2
+ import { View, type ViewProps } from 'react-native';
3
3
  import type { TrueSheetProps, TrueSheetStaticMethods } from '../TrueSheet.types';
4
4
  interface TrueSheetState {
5
5
  shouldRenderNativeView: boolean;
@@ -23,8 +23,12 @@ export declare class TrueSheet extends React.Component<TrueSheetProps, TrueSheet
23
23
  componentWillUnmount(): void;
24
24
  private renderHeader;
25
25
  private renderFooter;
26
- render(): React.CElement<import("react-native").ViewProps, View>;
26
+ render(): React.CElement<ViewProps, View>;
27
27
  }
28
+ /**
29
+ * Mock TrueSheetPeek component for testing.
30
+ */
31
+ export declare function TrueSheetPeek({ children, ...rest }: ViewProps): React.CElement<ViewProps, View>;
28
32
  /**
29
33
  * Mock TrueSheetProvider for testing.
30
34
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mocks/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAwD,MAAM,OAAO,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjF,UAAU,cAAc;IACtB,sBAAsB,EAAE,OAAO,CAAC;CACjC;AAED;;;GAGG;AACH,qBAAa,SAAU,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,EAAE,cAAc,CAAC;IAC5E,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAM;IAEjD,MAAM,CAAC,OAAO,kFAAsE;IACpF,MAAM,CAAC,YAAY,kFAAsE;IACzF,MAAM,CAAC,OAAO,+GAEZ;IACF,MAAM,CAAC,MAAM,iEAAiE;IAC9E,MAAM,CAAC,UAAU,mEAAuD;IAExE,OAAO,mEAAuD;IAC9D,YAAY,mEAAuD;IACnE,OAAO,gGAAwE;IAC/E,MAAM,kDAAkD;IAExD,iBAAiB;IAOjB,oBAAoB;IAOpB,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,YAAY;IAMpB,MAAM;CAIP;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,mBAE5E;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,sBAAsB,CAQrD;AAED,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mocks/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAwD,MAAM,OAAO,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjF,UAAU,cAAc;IACtB,sBAAsB,EAAE,OAAO,CAAC;CACjC;AAED;;;GAGG;AACH,qBAAa,SAAU,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,EAAE,cAAc,CAAC;IAC5E,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAM;IAEjD,MAAM,CAAC,OAAO,kFAAsE;IACpF,MAAM,CAAC,YAAY,kFAAsE;IACzF,MAAM,CAAC,OAAO,+GAEZ;IACF,MAAM,CAAC,MAAM,iEAAiE;IAC9E,MAAM,CAAC,UAAU,mEAAuD;IAExE,OAAO,mEAAuD;IAC9D,YAAY,mEAAuD;IACnE,OAAO,gGAAwE;IAC/E,MAAM,kDAAkD;IAExD,iBAAiB;IAOjB,oBAAoB;IAOpB,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,YAAY;IAMpB,MAAM;CAIP;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,SAAS,mCAE7D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,mBAE5E;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,sBAAsB,CAQrD;AAED,cAAc,oBAAoB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lodev09/react-native-true-sheet",
3
- "version": "3.11.4",
3
+ "version": "3.11.6",
4
4
  "description": "The true native bottom sheet experience for your React Native Apps.",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./lib/module/index.js",
@@ -265,6 +265,9 @@
265
265
  },
266
266
  "TrueSheetFooterView": {
267
267
  "className": "TrueSheetFooterView"
268
+ },
269
+ "TrueSheetPeekView": {
270
+ "className": "TrueSheetPeekView"
268
271
  }
269
272
  }
270
273
  }
@@ -226,7 +226,9 @@ export type SheetDetent =
226
226
 
227
227
  /**
228
228
  * Collapsed height based on the combined `header` and `footer` heights.
229
- * Falls back to a fixed height of `150` when neither is provided.
229
+ * Render a `TrueSheetPeek` component within the content to also include
230
+ * the content up to its bottom edge.
231
+ * Falls back to a fixed height of `150` when none is provided.
230
232
  *
231
233
  * @platform android
232
234
  * @platform ios 16+
@@ -15,6 +15,7 @@ import type { LayoutChangeEvent } from 'react-native';
15
15
 
16
16
  import { Drawer } from './web/vaul';
17
17
  import { DEFAULT_PEEK_HEIGHT, TRANSITIONS } from './web/vaul/constants';
18
+ import { TrueSheetPeekContext } from './TrueSheetPeek.web';
18
19
  import type {
19
20
  DetentChangeEvent,
20
21
  DetentInfoEventPayload,
@@ -244,8 +245,15 @@ const TrueSheetComponent = forwardRef<TrueSheetMethods, TrueSheetProps>((props,
244
245
  setFooterHeight(e.nativeEvent.layout.height);
245
246
  }, []);
246
247
 
248
+ // Distance from the content top to the bottom of a `TrueSheetPeek` rendered
249
+ // within the content — measured by the peek against `contentRef`.
250
+ const [peekContentHeight, setPeekContentHeight] = useState(0);
251
+ const contentRef = useRef<View>(null);
252
+ const peekContext = useMemo(() => ({ contentRef, setPeekContentHeight }), []);
253
+
247
254
  const peekHeight =
248
- (header ? headerHeight : 0) + (footer ? footerHeight : 0) || DEFAULT_PEEK_HEIGHT;
255
+ (header ? headerHeight : 0) + (footer ? footerHeight : 0) + peekContentHeight ||
256
+ DEFAULT_PEEK_HEIGHT;
249
257
 
250
258
  // Present/dismiss events. The sheet settles via a CSS `transform` transition
251
259
  // on either the drawer (snap-points on autopresent) or the wrapper (whole-
@@ -868,76 +876,82 @@ const TrueSheetComponent = forwardRef<TrueSheetMethods, TrueSheetProps>((props,
868
876
  );
869
877
 
870
878
  return (
871
- <Drawer.Root
872
- open={isOpen}
873
- onOpenChange={handleOpenChange}
874
- onPositionChange={handlePositionChange}
875
- onDrag={handleDrag}
876
- onRelease={handleRelease}
877
- dismissible={dismissible}
878
- draggable={draggable}
879
- repositionInputs={false}
880
- modal={dimmed}
881
- nested={isNested}
882
- detached={effectiveDetached}
883
- detachedOffset={effectiveDetachedOffset}
884
- detachedRadius={effectiveCornerRadius}
885
- maxContentHeight={effectiveMaxContentHeight}
886
- peekHeight={peekHeight}
887
- initialAnimated={initialDetentAnimated}
888
- detachedWrapperStyle={wrapperStyle}
889
- onContentHeightChange={setMeasuredContentHeight}
890
- activeSnapPoint={activeSnapPoint}
891
- setActiveSnapPoint={handleSetActiveSnapPoint}
892
- {...snapPointsProps}
893
- >
894
- <Drawer.Portal container={portalContainer ?? undefined}>
895
- <Drawer.Overlay style={overlayStyle} />
896
- <Drawer.Content
897
- ref={drawerContentRef}
898
- style={mergedContentStyle}
899
- onPointerDownOutside={handlePointerDownOutside}
900
- detachedSiblings={
901
- footer ? (
902
- <div style={footerFloatStyle}>
903
- <View style={footerStyle} onLayout={handleFooterLayout}>
904
- {isValidElement(footer) ? footer : createElement(footer)}
905
- </View>
906
- </div>
907
- ) : undefined
908
- }
909
- >
910
- <Drawer.Title style={visuallyHiddenStyle}>Sheet</Drawer.Title>
911
- {grabber && <Drawer.Handle style={handleStyle} />}
912
- {scrollable ? (
913
- // vaul wraps children in `[data-vaul-auto-size-wrapper]` (display:
914
- // flow-root) which doesn't honor descendant flex layout. Use an
915
- // absolute fill sized to the visible portion (via vaul's
916
- // `--snap-point-height` var) so the inner flex column has a
917
- // definite height for the scroll container's flex:1 to fill.
918
- <div style={scrollableLayoutStyle}>
919
- {header && (
920
- <View style={headerStyle} onLayout={handleHeaderLayout}>
921
- {isValidElement(header) ? header : createElement(header)}
922
- </View>
923
- )}
924
- <div style={scrollableContainerStyle}>
925
- <View style={style}>{children}</View>
879
+ <TrueSheetPeekContext.Provider value={peekContext}>
880
+ <Drawer.Root
881
+ open={isOpen}
882
+ onOpenChange={handleOpenChange}
883
+ onPositionChange={handlePositionChange}
884
+ onDrag={handleDrag}
885
+ onRelease={handleRelease}
886
+ dismissible={dismissible}
887
+ draggable={draggable}
888
+ repositionInputs={false}
889
+ modal={dimmed}
890
+ nested={isNested}
891
+ detached={effectiveDetached}
892
+ detachedOffset={effectiveDetachedOffset}
893
+ detachedRadius={effectiveCornerRadius}
894
+ maxContentHeight={effectiveMaxContentHeight}
895
+ peekHeight={peekHeight}
896
+ initialAnimated={initialDetentAnimated}
897
+ detachedWrapperStyle={wrapperStyle}
898
+ onContentHeightChange={setMeasuredContentHeight}
899
+ activeSnapPoint={activeSnapPoint}
900
+ setActiveSnapPoint={handleSetActiveSnapPoint}
901
+ {...snapPointsProps}
902
+ >
903
+ <Drawer.Portal container={portalContainer ?? undefined}>
904
+ <Drawer.Overlay style={overlayStyle} />
905
+ <Drawer.Content
906
+ ref={drawerContentRef}
907
+ style={mergedContentStyle}
908
+ onPointerDownOutside={handlePointerDownOutside}
909
+ detachedSiblings={
910
+ footer ? (
911
+ <div style={footerFloatStyle}>
912
+ <View style={footerStyle} onLayout={handleFooterLayout}>
913
+ {isValidElement(footer) ? footer : createElement(footer)}
914
+ </View>
915
+ </div>
916
+ ) : undefined
917
+ }
918
+ >
919
+ <Drawer.Title style={visuallyHiddenStyle}>Sheet</Drawer.Title>
920
+ {grabber && <Drawer.Handle style={handleStyle} />}
921
+ {scrollable ? (
922
+ // vaul wraps children in `[data-vaul-auto-size-wrapper]` (display:
923
+ // flow-root) which doesn't honor descendant flex layout. Use an
924
+ // absolute fill sized to the visible portion (via vaul's
925
+ // `--snap-point-height` var) so the inner flex column has a
926
+ // definite height for the scroll container's flex:1 to fill.
927
+ <div style={scrollableLayoutStyle}>
928
+ {header && (
929
+ <View style={headerStyle} onLayout={handleHeaderLayout}>
930
+ {isValidElement(header) ? header : createElement(header)}
931
+ </View>
932
+ )}
933
+ <div style={scrollableContainerStyle}>
934
+ <View ref={contentRef} style={style}>
935
+ {children}
936
+ </View>
937
+ </div>
926
938
  </div>
927
- </div>
928
- ) : (
929
- <>
930
- {header && (
931
- <View style={headerStyle} onLayout={handleHeaderLayout}>
932
- {isValidElement(header) ? header : createElement(header)}
939
+ ) : (
940
+ <>
941
+ {header && (
942
+ <View style={headerStyle} onLayout={handleHeaderLayout}>
943
+ {isValidElement(header) ? header : createElement(header)}
944
+ </View>
945
+ )}
946
+ <View ref={contentRef} style={style}>
947
+ {children}
933
948
  </View>
934
- )}
935
- <View style={style}>{children}</View>
936
- </>
937
- )}
938
- </Drawer.Content>
939
- </Drawer.Portal>
940
- </Drawer.Root>
949
+ </>
950
+ )}
951
+ </Drawer.Content>
952
+ </Drawer.Portal>
953
+ </Drawer.Root>
954
+ </TrueSheetPeekContext.Provider>
941
955
  );
942
956
  });
943
957
 
@@ -0,0 +1,11 @@
1
+ import type { ViewProps } from 'react-native';
2
+
3
+ import TrueSheetPeekViewNativeComponent from './fabric/TrueSheetPeekViewNativeComponent';
4
+
5
+ /**
6
+ * Wrapper component that marks its children as the sheet's peek content.
7
+ * When rendered within a `TrueSheet`, the `"peek"` detent reveals everything
8
+ * from the top of the sheet through the bottom of this component — content
9
+ * below it stays hidden until the sheet is expanded.
10
+ */
11
+ export const TrueSheetPeek = (props: ViewProps) => <TrueSheetPeekViewNativeComponent {...props} />;
@@ -0,0 +1,48 @@
1
+ import { createContext, useContext, useEffect, useRef, type RefObject } from 'react';
2
+ import { View, type LayoutChangeEvent, type ViewProps } from 'react-native';
3
+
4
+ /**
5
+ * Reports the measured peek content height to the owning TrueSheet.
6
+ * @internal
7
+ */
8
+ export interface TrueSheetPeekContextValue {
9
+ contentRef: RefObject<View | null>;
10
+ setPeekContentHeight: (height: number) => void;
11
+ }
12
+
13
+ export const TrueSheetPeekContext = createContext<TrueSheetPeekContextValue | null>(null);
14
+
15
+ /**
16
+ * Wrapper component that marks its children as the sheet's peek content.
17
+ * When rendered within a `TrueSheet`, the `"peek"` detent reveals everything
18
+ * from the top of the sheet through the bottom of this component — content
19
+ * below it stays hidden until the sheet is expanded.
20
+ */
21
+ export const TrueSheetPeek = ({ onLayout, ...rest }: ViewProps) => {
22
+ const context = useContext(TrueSheetPeekContext);
23
+ const viewRef = useRef<View>(null);
24
+
25
+ useEffect(() => () => context?.setPeekContentHeight(0), [context]);
26
+
27
+ const handleLayout = (event: LayoutChangeEvent) => {
28
+ if (context) {
29
+ // On web, View refs resolve to the underlying DOM elements.
30
+ const peekElement = viewRef.current as unknown as HTMLElement | null;
31
+ const contentElement = context.contentRef.current as unknown as HTMLElement | null;
32
+
33
+ // Distance from the top of the content view to the bottom of the peek view,
34
+ // so the peek view's offset within the content (padding, views above it)
35
+ // counts toward the peek detent.
36
+ const bottom =
37
+ peekElement && contentElement
38
+ ? peekElement.getBoundingClientRect().bottom - contentElement.getBoundingClientRect().top
39
+ : event.nativeEvent.layout.height;
40
+
41
+ context.setPeekContentHeight(bottom);
42
+ }
43
+
44
+ onLayout?.(event);
45
+ };
46
+
47
+ return <View {...rest} ref={viewRef} onLayout={handleLayout} />;
48
+ };
@@ -0,0 +1,8 @@
1
+ import type { ViewProps } from 'react-native';
2
+ import { codegenNativeComponent } from 'react-native';
3
+
4
+ export interface NativeProps extends ViewProps {
5
+ // Peek-specific props can be added here if needed
6
+ }
7
+
8
+ export default codegenNativeComponent<NativeProps>('TrueSheetPeekView', {});
package/src/index.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './TrueSheet';
2
2
  export * from './TrueSheet.types';
3
+ export { TrueSheetPeek } from './TrueSheetPeek';
3
4
  export { TrueSheetProvider, useTrueSheet } from './TrueSheetProvider';
@@ -1,5 +1,5 @@
1
1
  import React, { createElement, isValidElement, type ReactNode } from 'react';
2
- import { View } from 'react-native';
2
+ import { View, type ViewProps } from 'react-native';
3
3
 
4
4
  import type { TrueSheetProps, TrueSheetStaticMethods } from '../TrueSheet.types';
5
5
 
@@ -59,6 +59,13 @@ export class TrueSheet extends React.Component<TrueSheetProps, TrueSheetState> {
59
59
  }
60
60
  }
61
61
 
62
+ /**
63
+ * Mock TrueSheetPeek component for testing.
64
+ */
65
+ export function TrueSheetPeek({ children, ...rest }: ViewProps) {
66
+ return React.createElement(View, rest, children);
67
+ }
68
+
62
69
  /**
63
70
  * Mock TrueSheetProvider for testing.
64
71
  */