@lodev09/react-native-true-sheet 4.0.0-beta.19 → 4.0.0-beta.20

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 (45) hide show
  1. package/android/src/main/java/com/lodev09/truesheet/TrueSheetView.kt +6 -2
  2. package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewController.kt +43 -0
  3. package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewManager.kt +17 -10
  4. package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetBottomSheetView.kt +8 -1
  5. package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetDetentCalculator.kt +16 -0
  6. package/ios/TrueSheetView.mm +20 -7
  7. package/ios/TrueSheetViewController.h +1 -3
  8. package/ios/TrueSheetViewController.mm +98 -22
  9. package/ios/core/TrueSheetBlurView.h +0 -2
  10. package/ios/core/TrueSheetBlurView.mm +3 -36
  11. package/ios/core/TrueSheetDetentCalculator.h +1 -0
  12. package/ios/core/TrueSheetDetentCalculator.mm +18 -0
  13. package/lib/module/TrueSheet.js +16 -5
  14. package/lib/module/TrueSheet.js.map +1 -1
  15. package/lib/module/TrueSheet.web.js +39 -6
  16. package/lib/module/TrueSheet.web.js.map +1 -1
  17. package/lib/module/TrueSheetBackground.js +15 -0
  18. package/lib/module/TrueSheetBackground.js.map +1 -0
  19. package/lib/module/detentBackgrounds.js +21 -0
  20. package/lib/module/detentBackgrounds.js.map +1 -0
  21. package/lib/module/fabric/TrueSheetViewNativeComponent.ts +6 -9
  22. package/lib/module/mocks/index.js +8 -2
  23. package/lib/module/mocks/index.js.map +1 -1
  24. package/lib/typescript/src/TrueSheet.d.ts.map +1 -1
  25. package/lib/typescript/src/TrueSheet.types.d.ts +30 -39
  26. package/lib/typescript/src/TrueSheet.types.d.ts.map +1 -1
  27. package/lib/typescript/src/TrueSheet.web.d.ts.map +1 -1
  28. package/lib/typescript/src/TrueSheetBackground.d.ts +3 -0
  29. package/lib/typescript/src/TrueSheetBackground.d.ts.map +1 -0
  30. package/lib/typescript/src/detentBackgrounds.d.ts +10 -0
  31. package/lib/typescript/src/detentBackgrounds.d.ts.map +1 -0
  32. package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts +4 -6
  33. package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts.map +1 -1
  34. package/lib/typescript/src/mocks/index.d.ts.map +1 -1
  35. package/lib/typescript/src/navigation/types.d.ts +1 -1
  36. package/lib/typescript/src/navigation/types.d.ts.map +1 -1
  37. package/package.json +1 -1
  38. package/src/TrueSheet.tsx +13 -4
  39. package/src/TrueSheet.types.ts +30 -41
  40. package/src/TrueSheet.web.tsx +42 -6
  41. package/src/TrueSheetBackground.tsx +17 -0
  42. package/src/detentBackgrounds.ts +24 -0
  43. package/src/fabric/TrueSheetViewNativeComponent.ts +6 -9
  44. package/src/mocks/index.ts +10 -2
  45. package/src/navigation/types.ts +3 -2
@@ -27,11 +27,6 @@ type AccessibilityOptionsType = Readonly<{
27
27
  paneTitle?: WithDefault<string, 'Bottom sheet'>;
28
28
  }>;
29
29
 
30
- type BlurOptionsType = Readonly<{
31
- intensity?: WithDefault<Double, -1>;
32
- interaction?: WithDefault<boolean, true>;
33
- }>;
34
-
35
30
  type ScrollEdgeEffect = 'automatic' | 'hard' | 'soft' | 'hidden';
36
31
 
37
32
  type ScrollableOptionsType = Readonly<{
@@ -71,6 +66,12 @@ export interface PositionChangeEventPayload {
71
66
  export interface NativeProps extends ViewProps {
72
67
  // Array properties
73
68
  detents?: ReadonlyArray<Double>;
69
+ detentBackgrounds?: ReadonlyArray<
70
+ Readonly<{
71
+ color?: ProcessedColorValue | null;
72
+ blur?: string;
73
+ }>
74
+ >;
74
75
 
75
76
  // Number properties - use 0 as default to avoid nil insertion
76
77
  maxContentHeight?: WithDefault<Double, 0>;
@@ -114,11 +115,7 @@ export interface NativeProps extends ViewProps {
114
115
  placementOffset?: WithDefault<Double, 16>;
115
116
  insetAdjustment?: WithDefault<'automatic' | 'never', 'automatic'>;
116
117
 
117
- // Blur options
118
- blurOptions?: BlurOptionsType;
119
-
120
118
  // Boolean properties - match defaults from TrueSheet.types.ts
121
- glass?: WithDefault<boolean, true>;
122
119
  grabber?: WithDefault<boolean, true>;
123
120
  grabberOptions?: GrabberOptionsType;
124
121
  accessibilityOptions?: AccessibilityOptionsType;
@@ -2,6 +2,7 @@ import React, { createElement, isValidElement, type ReactNode } from 'react';
2
2
  import { View, type ViewProps } from 'react-native';
3
3
 
4
4
  import type { TrueSheetProps, TrueSheetStaticMethods } from '../TrueSheet.types';
5
+ import { TrueSheetBackground } from '../TrueSheetBackground';
5
6
 
6
7
  interface TrueSheetState {
7
8
  shouldRenderNativeView: boolean;
@@ -54,8 +55,15 @@ export class TrueSheet extends React.Component<TrueSheetProps, TrueSheetState> {
54
55
  }
55
56
 
56
57
  render() {
57
- const { children, style } = this.props;
58
- return React.createElement(View, { style }, this.renderHeader(), children, this.renderFooter());
58
+ const { children, style, background, backgroundStyle } = this.props;
59
+ return React.createElement(
60
+ View,
61
+ { style },
62
+ React.createElement(TrueSheetBackground, { background, backgroundStyle }),
63
+ this.renderHeader(),
64
+ children,
65
+ this.renderFooter()
66
+ );
59
67
  }
60
68
  }
61
69
 
@@ -206,6 +206,9 @@ export type TrueSheetNavigationSheetProps = Pick<
206
206
  TrueSheetProps,
207
207
  | 'detents'
208
208
  | 'backgroundColor'
209
+ | 'detentBackgrounds'
210
+ | 'background'
211
+ | 'backgroundStyle'
209
212
  | 'cornerRadius'
210
213
  | 'dismissible'
211
214
  | 'draggable'
@@ -215,8 +218,6 @@ export type TrueSheetNavigationSheetProps = Pick<
215
218
  | 'dimmed'
216
219
  | 'dimmedDetentIndex'
217
220
  | 'backgroundBlur'
218
- | 'blurOptions'
219
- | 'glass'
220
221
  | 'maxContentHeight'
221
222
  | 'maxContentWidth'
222
223
  | 'presentation'