@lodev09/react-native-true-sheet 2.0.5 → 4.0.0-beta.0
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/README.md +36 -8
- package/RNTrueSheet.podspec +20 -0
- package/android/build.gradle +26 -14
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContainerView.kt +108 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContainerViewManager.kt +21 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContentView.kt +46 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContentViewManager.kt +21 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetFooterView.kt +47 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetFooterViewManager.kt +21 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetModule.kt +165 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetPackage.kt +36 -4
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetView.kt +257 -299
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewController.kt +855 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewManager.kt +104 -82
- package/android/src/main/java/com/lodev09/truesheet/events/DetentChangeEvent.kt +26 -0
- package/android/src/main/java/com/lodev09/truesheet/events/DidDismissEvent.kt +20 -0
- package/android/src/main/java/com/lodev09/truesheet/events/DidPresentEvent.kt +26 -0
- package/android/src/main/java/com/lodev09/truesheet/events/DragBeginEvent.kt +26 -0
- package/android/src/main/java/com/lodev09/truesheet/events/DragChangeEvent.kt +26 -0
- package/android/src/main/java/com/lodev09/truesheet/events/DragEndEvent.kt +26 -0
- package/android/src/main/java/com/lodev09/truesheet/events/MountEvent.kt +20 -0
- package/android/src/main/java/com/lodev09/truesheet/events/PositionChangeEvent.kt +32 -0
- package/android/src/main/java/com/lodev09/truesheet/events/SizeChangeEvent.kt +27 -0
- package/android/src/main/java/com/lodev09/truesheet/events/WillDismissEvent.kt +20 -0
- package/android/src/main/java/com/lodev09/truesheet/events/WillPresentEvent.kt +26 -0
- package/android/src/main/java/com/lodev09/truesheet/{core/Utils.kt → utils/ScreenUtils.kt} +47 -17
- package/android/src/main/res/values/styles.xml +8 -0
- package/ios/TrueSheetComponentDescriptor.h +24 -0
- package/ios/TrueSheetContainerView.h +47 -0
- package/ios/TrueSheetContainerView.mm +117 -0
- package/ios/TrueSheetContentView.h +37 -0
- package/ios/TrueSheetContentView.mm +114 -0
- package/ios/TrueSheetFooterView.h +27 -0
- package/ios/TrueSheetFooterView.mm +101 -0
- package/ios/TrueSheetModule.h +44 -0
- package/ios/TrueSheetModule.mm +133 -0
- package/ios/TrueSheetView.h +53 -0
- package/ios/TrueSheetView.mm +433 -0
- package/ios/TrueSheetViewController.h +53 -0
- package/ios/TrueSheetViewController.mm +649 -0
- package/ios/events/OnDetentChangeEvent.h +28 -0
- package/ios/events/OnDetentChangeEvent.mm +30 -0
- package/ios/events/OnDidDismissEvent.h +26 -0
- package/ios/events/OnDidDismissEvent.mm +25 -0
- package/ios/events/OnDidPresentEvent.h +28 -0
- package/ios/events/OnDidPresentEvent.mm +30 -0
- package/ios/events/OnDragBeginEvent.h +28 -0
- package/ios/events/OnDragBeginEvent.mm +30 -0
- package/ios/events/OnDragChangeEvent.h +28 -0
- package/ios/events/OnDragChangeEvent.mm +30 -0
- package/ios/events/OnDragEndEvent.h +28 -0
- package/ios/events/OnDragEndEvent.mm +30 -0
- package/ios/events/OnMountEvent.h +26 -0
- package/ios/events/OnMountEvent.mm +25 -0
- package/ios/events/OnPositionChangeEvent.h +29 -0
- package/ios/events/OnPositionChangeEvent.mm +32 -0
- package/ios/events/OnSizeChangeEvent.h +28 -0
- package/ios/events/OnSizeChangeEvent.mm +30 -0
- package/ios/events/OnWillDismissEvent.h +26 -0
- package/ios/events/OnWillDismissEvent.mm +25 -0
- package/ios/events/OnWillPresentEvent.h +28 -0
- package/ios/events/OnWillPresentEvent.mm +30 -0
- package/ios/utils/GestureUtil.h +25 -0
- package/ios/utils/GestureUtil.mm +26 -0
- package/ios/utils/LayoutUtil.h +44 -0
- package/ios/utils/LayoutUtil.mm +50 -0
- package/ios/utils/WindowUtil.h +27 -0
- package/ios/utils/WindowUtil.mm +42 -0
- package/lib/module/TrueSheet.js +231 -135
- package/lib/module/TrueSheet.js.map +1 -1
- package/lib/module/TrueSheetGrabber.js +16 -14
- package/lib/module/TrueSheetGrabber.js.map +1 -1
- package/lib/module/fabric/TrueSheetContainerViewNativeComponent.ts +8 -0
- package/lib/module/fabric/TrueSheetContentViewNativeComponent.ts +8 -0
- package/lib/module/fabric/TrueSheetFooterViewNativeComponent.ts +8 -0
- package/lib/module/fabric/TrueSheetViewNativeComponent.ts +63 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/reanimated/ReanimatedTrueSheet.js +87 -0
- package/lib/module/reanimated/ReanimatedTrueSheet.js.map +1 -0
- package/lib/module/reanimated/ReanimatedTrueSheetProvider.js +72 -0
- package/lib/module/reanimated/ReanimatedTrueSheetProvider.js.map +1 -0
- package/lib/module/reanimated/index.js +6 -0
- package/lib/module/reanimated/index.js.map +1 -0
- package/lib/module/reanimated/useReanimatedPositionChangeHandler.js +19 -0
- package/lib/module/reanimated/useReanimatedPositionChangeHandler.js.map +1 -0
- package/lib/module/specs/NativeTrueSheetModule.js +12 -0
- package/lib/module/specs/NativeTrueSheetModule.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/TrueSheet.d.ts +79 -0
- package/lib/typescript/src/TrueSheet.d.ts.map +1 -0
- package/lib/typescript/src/TrueSheet.types.d.ts +260 -0
- package/lib/typescript/src/TrueSheet.types.d.ts.map +1 -0
- package/lib/typescript/{commonjs/src → src}/TrueSheetGrabber.d.ts +1 -1
- package/lib/typescript/src/TrueSheetGrabber.d.ts.map +1 -0
- package/lib/typescript/src/fabric/TrueSheetContainerViewNativeComponent.d.ts +6 -0
- package/lib/typescript/src/fabric/TrueSheetContainerViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/fabric/TrueSheetContentViewNativeComponent.d.ts +6 -0
- package/lib/typescript/src/fabric/TrueSheetContentViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/fabric/TrueSheetFooterViewNativeComponent.d.ts +6 -0
- package/lib/typescript/src/fabric/TrueSheetFooterViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts +44 -0
- package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/{commonjs/src → src}/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/reanimated/ReanimatedTrueSheet.d.ts +43 -0
- package/lib/typescript/src/reanimated/ReanimatedTrueSheet.d.ts.map +1 -0
- package/lib/typescript/src/reanimated/ReanimatedTrueSheetProvider.d.ts +57 -0
- package/lib/typescript/src/reanimated/ReanimatedTrueSheetProvider.d.ts.map +1 -0
- package/lib/typescript/src/reanimated/index.d.ts +4 -0
- package/lib/typescript/src/reanimated/index.d.ts.map +1 -0
- package/lib/typescript/src/reanimated/useReanimatedPositionChangeHandler.d.ts +6 -0
- package/lib/typescript/src/reanimated/useReanimatedPositionChangeHandler.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeTrueSheetModule.d.ts +34 -0
- package/lib/typescript/src/specs/NativeTrueSheetModule.d.ts.map +1 -0
- package/package.json +104 -75
- package/react-native.config.js +17 -0
- package/src/TrueSheet.tsx +285 -188
- package/src/TrueSheet.types.ts +119 -106
- package/src/TrueSheetGrabber.tsx +29 -28
- package/src/__mocks__/index.js +60 -12
- package/src/fabric/TrueSheetContainerViewNativeComponent.ts +8 -0
- package/src/fabric/TrueSheetContentViewNativeComponent.ts +8 -0
- package/src/fabric/TrueSheetFooterViewNativeComponent.ts +8 -0
- package/src/fabric/TrueSheetViewNativeComponent.ts +63 -0
- package/src/index.ts +4 -3
- package/src/reanimated/ReanimatedTrueSheet.tsx +95 -0
- package/src/reanimated/ReanimatedTrueSheetProvider.tsx +92 -0
- package/src/reanimated/index.ts +3 -0
- package/src/reanimated/useReanimatedPositionChangeHandler.ts +26 -0
- package/src/specs/NativeTrueSheetModule.ts +38 -0
- package/TrueSheet.podspec +0 -49
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetDialog.kt +0 -400
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetEvent.kt +0 -22
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewModule.kt +0 -63
- package/android/src/main/java/com/lodev09/truesheet/core/KeyboardManager.kt +0 -58
- package/android/src/main/java/com/lodev09/truesheet/core/RootSheetView.kt +0 -102
- package/ios/Extensions/UIBlurEffect+withTint.swift +0 -62
- package/ios/Extensions/UIView+pinTo.swift +0 -74
- package/ios/Extensions/UIViewController+detentForSize.swift +0 -134
- package/ios/TrueSheet-Bridging-Header.h +0 -14
- package/ios/TrueSheetEvent.swift +0 -48
- package/ios/TrueSheetView.swift +0 -461
- package/ios/TrueSheetViewController.swift +0 -275
- package/ios/TrueSheetViewManager.m +0 -53
- package/ios/TrueSheetViewManager.swift +0 -48
- package/ios/Utils/Logger.swift +0 -39
- package/ios/Utils/Promise.swift +0 -25
- package/lib/commonjs/TrueSheet.js +0 -258
- package/lib/commonjs/TrueSheet.js.map +0 -1
- package/lib/commonjs/TrueSheet.types.js +0 -6
- package/lib/commonjs/TrueSheet.types.js.map +0 -1
- package/lib/commonjs/TrueSheetFooter.js +0 -19
- package/lib/commonjs/TrueSheetFooter.js.map +0 -1
- package/lib/commonjs/TrueSheetGrabber.js +0 -54
- package/lib/commonjs/TrueSheetGrabber.js.map +0 -1
- package/lib/commonjs/TrueSheetModule.js +0 -19
- package/lib/commonjs/TrueSheetModule.js.map +0 -1
- package/lib/commonjs/__mocks__/index.js +0 -52
- package/lib/commonjs/__mocks__/index.js.map +0 -1
- package/lib/commonjs/index.js +0 -39
- package/lib/commonjs/index.js.map +0 -1
- package/lib/module/TrueSheetFooter.js +0 -14
- package/lib/module/TrueSheetFooter.js.map +0 -1
- package/lib/module/TrueSheetModule.js +0 -15
- package/lib/module/TrueSheetModule.js.map +0 -1
- package/lib/module/__mocks__/index.js +0 -21
- package/lib/module/__mocks__/index.js.map +0 -1
- package/lib/typescript/commonjs/package.json +0 -1
- package/lib/typescript/commonjs/src/TrueSheet.d.ts +0 -70
- package/lib/typescript/commonjs/src/TrueSheet.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/TrueSheet.types.d.ts +0 -241
- package/lib/typescript/commonjs/src/TrueSheet.types.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/TrueSheetFooter.d.ts +0 -7
- package/lib/typescript/commonjs/src/TrueSheetFooter.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/TrueSheetGrabber.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/TrueSheetModule.d.ts +0 -2
- package/lib/typescript/commonjs/src/TrueSheetModule.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +0 -1
- package/lib/typescript/module/src/TrueSheet.d.ts +0 -70
- package/lib/typescript/module/src/TrueSheet.d.ts.map +0 -1
- package/lib/typescript/module/src/TrueSheet.types.d.ts +0 -241
- package/lib/typescript/module/src/TrueSheet.types.d.ts.map +0 -1
- package/lib/typescript/module/src/TrueSheetFooter.d.ts +0 -7
- package/lib/typescript/module/src/TrueSheetFooter.d.ts.map +0 -1
- package/lib/typescript/module/src/TrueSheetGrabber.d.ts +0 -39
- package/lib/typescript/module/src/TrueSheetGrabber.d.ts.map +0 -1
- package/lib/typescript/module/src/TrueSheetModule.d.ts +0 -2
- package/lib/typescript/module/src/TrueSheetModule.d.ts.map +0 -1
- package/lib/typescript/module/src/index.d.ts +0 -4
- package/lib/typescript/module/src/index.d.ts.map +0 -1
- package/src/TrueSheetFooter.tsx +0 -17
- package/src/TrueSheetModule.ts +0 -19
- /package/lib/{typescript/module → module}/package.json +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TrueSheetModule.d.ts","sourceRoot":"","sources":["../../../../src/TrueSheetModule.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,eAAe,KASvB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { PureComponent, type ReactNode } from 'react';
|
|
2
|
-
import { type NativeSyntheticEvent } from 'react-native';
|
|
3
|
-
import type { TrueSheetProps } from './TrueSheet.types';
|
|
4
|
-
export type ContainerSizeChangeEvent = NativeSyntheticEvent<{
|
|
5
|
-
width: number;
|
|
6
|
-
height: number;
|
|
7
|
-
}>;
|
|
8
|
-
interface TrueSheetState {
|
|
9
|
-
containerWidth?: number;
|
|
10
|
-
containerHeight?: number;
|
|
11
|
-
contentHeight?: number;
|
|
12
|
-
footerHeight?: number;
|
|
13
|
-
scrollableHandle: number | null;
|
|
14
|
-
}
|
|
15
|
-
export declare class TrueSheet extends PureComponent<TrueSheetProps, TrueSheetState> {
|
|
16
|
-
displayName: string;
|
|
17
|
-
private readonly ref;
|
|
18
|
-
/**
|
|
19
|
-
* Map of sheet names against their handle.
|
|
20
|
-
*/
|
|
21
|
-
private static readonly handles;
|
|
22
|
-
constructor(props: TrueSheetProps);
|
|
23
|
-
private static getHandle;
|
|
24
|
-
/**
|
|
25
|
-
* Present the sheet by given `name`.
|
|
26
|
-
* See `name` prop.
|
|
27
|
-
*/
|
|
28
|
-
static present(name: string, index?: number): Promise<void>;
|
|
29
|
-
/**
|
|
30
|
-
* Dismiss the sheet by given `name`.
|
|
31
|
-
* See `name` prop.
|
|
32
|
-
*/
|
|
33
|
-
static dismiss(name: string): Promise<void>;
|
|
34
|
-
/**
|
|
35
|
-
* Resize the sheet by given `name`.
|
|
36
|
-
* See `name` prop.
|
|
37
|
-
*/
|
|
38
|
-
static resize(name: string, index: number): Promise<void>;
|
|
39
|
-
private get handle();
|
|
40
|
-
private updateState;
|
|
41
|
-
private onSizeChange;
|
|
42
|
-
private onContainerSizeChange;
|
|
43
|
-
private onPresent;
|
|
44
|
-
private onFooterLayout;
|
|
45
|
-
private onContentLayout;
|
|
46
|
-
private onDismiss;
|
|
47
|
-
private onMount;
|
|
48
|
-
private onDragBegin;
|
|
49
|
-
private onDragChange;
|
|
50
|
-
private onDragEnd;
|
|
51
|
-
/**
|
|
52
|
-
* Present the sheet. Optionally accepts a size `index`.
|
|
53
|
-
* See `sizes` prop
|
|
54
|
-
*/
|
|
55
|
-
present(index?: number): Promise<void>;
|
|
56
|
-
/**
|
|
57
|
-
* Resizes the Sheet programmatically by `index`.
|
|
58
|
-
* This is an alias of the `present(index)` method.
|
|
59
|
-
*/
|
|
60
|
-
resize(index: number): Promise<void>;
|
|
61
|
-
/**
|
|
62
|
-
* Dismisses the Sheet
|
|
63
|
-
*/
|
|
64
|
-
dismiss(): Promise<void>;
|
|
65
|
-
componentDidMount(): void;
|
|
66
|
-
componentDidUpdate(): void;
|
|
67
|
-
render(): ReactNode;
|
|
68
|
-
}
|
|
69
|
-
export {};
|
|
70
|
-
//# sourceMappingURL=TrueSheet.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TrueSheet.d.ts","sourceRoot":"","sources":["../../../../src/TrueSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAwC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAC3F,OAAO,EAOL,KAAK,oBAAoB,EAI1B,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,EACV,cAAc,EAMf,MAAM,mBAAmB,CAAA;AAY1B,MAAM,MAAM,wBAAwB,GAAG,oBAAoB,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,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,iBAAiB,IAAI,IAAI;IAUzB,kBAAkB,IAAI,IAAI;IAI1B,MAAM,IAAI,SAAS;CA8EpB"}
|
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
import type { Component, ComponentType, ReactElement, RefObject } from 'react';
|
|
2
|
-
import type { ColorValue, NativeSyntheticEvent, StyleProp, ViewProps, ViewStyle } from 'react-native';
|
|
3
|
-
import type { TrueSheetGrabberProps } from './TrueSheetGrabber';
|
|
4
|
-
export interface SizeInfo {
|
|
5
|
-
index: number;
|
|
6
|
-
value: number;
|
|
7
|
-
}
|
|
8
|
-
export type SizeChangeEvent = NativeSyntheticEvent<SizeInfo>;
|
|
9
|
-
export type PresentEvent = NativeSyntheticEvent<SizeInfo>;
|
|
10
|
-
export type DragBeginEvent = NativeSyntheticEvent<SizeInfo>;
|
|
11
|
-
export type DragChangeEvent = NativeSyntheticEvent<SizeInfo>;
|
|
12
|
-
export type DragEndEvent = NativeSyntheticEvent<SizeInfo>;
|
|
13
|
-
/**
|
|
14
|
-
* Blur style mapped to native values in IOS.
|
|
15
|
-
*
|
|
16
|
-
* @platform ios
|
|
17
|
-
*/
|
|
18
|
-
export type BlurTint = 'light' | 'dark' | 'default' | 'extraLight' | 'regular' | 'prominent' | 'systemUltraThinMaterial' | 'systemThinMaterial' | 'systemMaterial' | 'systemThickMaterial' | 'systemChromeMaterial' | 'systemUltraThinMaterialLight' | 'systemThinMaterialLight' | 'systemMaterialLight' | 'systemThickMaterialLight' | 'systemChromeMaterialLight' | 'systemUltraThinMaterialDark' | 'systemThinMaterialDark' | 'systemMaterialDark' | 'systemThickMaterialDark' | 'systemChromeMaterialDark';
|
|
19
|
-
/**
|
|
20
|
-
* Supported Sheet size.
|
|
21
|
-
*
|
|
22
|
-
* @platform android
|
|
23
|
-
* @platform ios 15+
|
|
24
|
-
*/
|
|
25
|
-
export type SheetSize =
|
|
26
|
-
/**
|
|
27
|
-
* Auto resize based on content height
|
|
28
|
-
*
|
|
29
|
-
* @platform android
|
|
30
|
-
* @platform ios 16+
|
|
31
|
-
*/
|
|
32
|
-
'auto'
|
|
33
|
-
/**
|
|
34
|
-
* Fixed height
|
|
35
|
-
*
|
|
36
|
-
* @platform android
|
|
37
|
-
* @platform ios 16+
|
|
38
|
-
*/
|
|
39
|
-
| number
|
|
40
|
-
/**
|
|
41
|
-
* Fixed height in %
|
|
42
|
-
*
|
|
43
|
-
* @platform android
|
|
44
|
-
* @platform ios 16+
|
|
45
|
-
*/
|
|
46
|
-
| `${number}%`
|
|
47
|
-
/**
|
|
48
|
-
* Translates to 25%
|
|
49
|
-
*
|
|
50
|
-
* @platform android
|
|
51
|
-
* @platform ios 16+
|
|
52
|
-
*/
|
|
53
|
-
| 'small'
|
|
54
|
-
/**
|
|
55
|
-
* Translates to 50%
|
|
56
|
-
*
|
|
57
|
-
* @platform android
|
|
58
|
-
* @platform ios 15+
|
|
59
|
-
*/
|
|
60
|
-
| 'medium'
|
|
61
|
-
/**
|
|
62
|
-
* Translates to 100%
|
|
63
|
-
*
|
|
64
|
-
* @platform android
|
|
65
|
-
* @platform ios 15+
|
|
66
|
-
*/
|
|
67
|
-
| 'large';
|
|
68
|
-
export interface TrueSheetProps extends ViewProps {
|
|
69
|
-
/**
|
|
70
|
-
* The name to reference this sheet. It has to be unique.
|
|
71
|
-
* You can then present this sheet globally using its `name`.
|
|
72
|
-
*
|
|
73
|
-
* Example:
|
|
74
|
-
* ```ts
|
|
75
|
-
* <TrueSheet name="my-awesome-sheet">
|
|
76
|
-
* <MyComponent />
|
|
77
|
-
* </TrueSheet>
|
|
78
|
-
* ```
|
|
79
|
-
* ```ts
|
|
80
|
-
* TrueSheet.present('my-awesome-sheet')
|
|
81
|
-
* ```
|
|
82
|
-
*/
|
|
83
|
-
name?: string;
|
|
84
|
-
/**
|
|
85
|
-
* The sizes you want the Sheet to support.
|
|
86
|
-
* Maximum of 3 sizes only; collapsed, half-expanded, expanded.
|
|
87
|
-
*
|
|
88
|
-
* Example:
|
|
89
|
-
* ```ts
|
|
90
|
-
* size={['auto', '60%', 'large']}
|
|
91
|
-
* ```
|
|
92
|
-
*
|
|
93
|
-
* @default ['medium', 'large']
|
|
94
|
-
*/
|
|
95
|
-
sizes?: SheetSize[];
|
|
96
|
-
/**
|
|
97
|
-
* Specify whether the sheet background is dimmed.
|
|
98
|
-
* Set to `false` to allow interaction with the background components.
|
|
99
|
-
*
|
|
100
|
-
* @platform android
|
|
101
|
-
* @platform ios 15+
|
|
102
|
-
* @default true
|
|
103
|
-
*/
|
|
104
|
-
dimmed?: boolean;
|
|
105
|
-
/**
|
|
106
|
-
* Initially present the sheet, after mounting, at a given size index.
|
|
107
|
-
*
|
|
108
|
-
* @note This property is only used during the initial mount.
|
|
109
|
-
* @default -1
|
|
110
|
-
*/
|
|
111
|
-
initialIndex?: number;
|
|
112
|
-
/**
|
|
113
|
-
* Specify whether the sheet should animate after mounting.
|
|
114
|
-
* Used with `initialIndex`.
|
|
115
|
-
*
|
|
116
|
-
* @default true
|
|
117
|
-
*/
|
|
118
|
-
initialIndexAnimated?: boolean;
|
|
119
|
-
/**
|
|
120
|
-
* The size index that the sheet should start to dim the background.
|
|
121
|
-
* This is ignored if `dimmed` is set to `false`.
|
|
122
|
-
*
|
|
123
|
-
* @default 0
|
|
124
|
-
*/
|
|
125
|
-
dimmedIndex?: number;
|
|
126
|
-
/**
|
|
127
|
-
* Prevents interactive dismissal of the Sheet.
|
|
128
|
-
*
|
|
129
|
-
* @default true
|
|
130
|
-
*/
|
|
131
|
-
dismissible?: boolean;
|
|
132
|
-
/**
|
|
133
|
-
* Main sheet background color.
|
|
134
|
-
|
|
135
|
-
* @default white
|
|
136
|
-
*/
|
|
137
|
-
backgroundColor?: ColorValue;
|
|
138
|
-
/**
|
|
139
|
-
* The sheet corner radius.
|
|
140
|
-
*
|
|
141
|
-
* @platform android
|
|
142
|
-
* @platform ios 15+
|
|
143
|
-
*/
|
|
144
|
-
cornerRadius?: number;
|
|
145
|
-
/**
|
|
146
|
-
* Shows native grabber (or handle) on IOS.
|
|
147
|
-
*
|
|
148
|
-
* @platform ios
|
|
149
|
-
* @default true
|
|
150
|
-
*/
|
|
151
|
-
grabber?: boolean;
|
|
152
|
-
/**
|
|
153
|
-
* Grabber props to be used for android grabber or handle.
|
|
154
|
-
*
|
|
155
|
-
* @platform android
|
|
156
|
-
*/
|
|
157
|
-
grabberProps?: TrueSheetGrabberProps;
|
|
158
|
-
/**
|
|
159
|
-
* The blur effect style on iOS.
|
|
160
|
-
* Overrides `backgroundColor` if set.
|
|
161
|
-
*
|
|
162
|
-
* @platform ios
|
|
163
|
-
*/
|
|
164
|
-
blurTint?: BlurTint;
|
|
165
|
-
/**
|
|
166
|
-
* Optional content container styles.
|
|
167
|
-
*/
|
|
168
|
-
contentContainerStyle?: StyleProp<ViewStyle>;
|
|
169
|
-
/**
|
|
170
|
-
* The main scrollable ref that Sheet should handle on IOS.
|
|
171
|
-
*
|
|
172
|
-
* @platform ios
|
|
173
|
-
*/
|
|
174
|
-
scrollRef?: RefObject<Component<unknown>>;
|
|
175
|
-
/**
|
|
176
|
-
* Overrides `large` or `100%` height.
|
|
177
|
-
*/
|
|
178
|
-
maxHeight?: number;
|
|
179
|
-
/**
|
|
180
|
-
* A component that floats at the bottom of the Sheet.
|
|
181
|
-
*/
|
|
182
|
-
FooterComponent?: ComponentType<unknown> | ReactElement;
|
|
183
|
-
/**
|
|
184
|
-
* Determines how the software keyboard will impact the layout of the sheet.
|
|
185
|
-
* Set to `pan` if you're working with `FlatList` with a `TextInput`.
|
|
186
|
-
*
|
|
187
|
-
* @platform android
|
|
188
|
-
* @default resize
|
|
189
|
-
*/
|
|
190
|
-
keyboardMode?: 'resize' | 'pan';
|
|
191
|
-
/**
|
|
192
|
-
* Supports edge-to-edge on Android.
|
|
193
|
-
* Turn this on if your app has it enabled.
|
|
194
|
-
*
|
|
195
|
-
* @platform android
|
|
196
|
-
*/
|
|
197
|
-
edgeToEdge?: boolean;
|
|
198
|
-
/**
|
|
199
|
-
* This is called when the sheet is ready to present.
|
|
200
|
-
*/
|
|
201
|
-
onMount?: () => void;
|
|
202
|
-
/**
|
|
203
|
-
* Called when the Sheet has been presented.
|
|
204
|
-
* Comes with the size info.
|
|
205
|
-
*/
|
|
206
|
-
onPresent?: (event: PresentEvent) => void;
|
|
207
|
-
/**
|
|
208
|
-
* Called when the Sheet has been dismissed
|
|
209
|
-
*/
|
|
210
|
-
onDismiss?: () => void;
|
|
211
|
-
/**
|
|
212
|
-
* Called when the size of the sheet has changed.
|
|
213
|
-
* Either by dragging or programatically.
|
|
214
|
-
*/
|
|
215
|
-
onSizeChange?: (event: SizeChangeEvent) => void;
|
|
216
|
-
/**
|
|
217
|
-
* Called when the sheet has began dragging.
|
|
218
|
-
* Comes with the size info.
|
|
219
|
-
*
|
|
220
|
-
* @platform android
|
|
221
|
-
* @platform ios 15+
|
|
222
|
-
*/
|
|
223
|
-
onDragBegin?: (event: DragBeginEvent) => void;
|
|
224
|
-
/**
|
|
225
|
-
* Called when the sheet is being dragged.
|
|
226
|
-
* Comes with the size info.
|
|
227
|
-
*
|
|
228
|
-
* @platform android
|
|
229
|
-
* @platform ios 15+
|
|
230
|
-
*/
|
|
231
|
-
onDragChange?: (event: DragChangeEvent) => void;
|
|
232
|
-
/**
|
|
233
|
-
* Called when the sheet dragging has ended.
|
|
234
|
-
* Comes with the size info.
|
|
235
|
-
*
|
|
236
|
-
* @platform android
|
|
237
|
-
* @platform ios 15+
|
|
238
|
-
*/
|
|
239
|
-
onDragEnd?: (event: DragEndEvent) => void;
|
|
240
|
-
}
|
|
241
|
-
//# sourceMappingURL=TrueSheet.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TrueSheet.types.d.ts","sourceRoot":"","sources":["../../../../src/TrueSheet.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC9E,OAAO,KA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,KAAK,IAAI,CAAA;IAE/C;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAA;IAE7C;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAA;IAE/C;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAA;CAC1C"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { TrueSheetProps } from './TrueSheet.types';
|
|
2
|
-
interface TrueSheetFooterProps {
|
|
3
|
-
Component?: TrueSheetProps['FooterComponent'];
|
|
4
|
-
}
|
|
5
|
-
export declare const TrueSheetFooter: (props: TrueSheetFooterProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
6
|
-
export {};
|
|
7
|
-
//# sourceMappingURL=TrueSheetFooter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TrueSheetFooter.d.ts","sourceRoot":"","sources":["../../../../src/TrueSheetFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAEvD,UAAU,oBAAoB;IAC5B,SAAS,CAAC,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAA;CAC9C;AAED,eAAO,MAAM,eAAe,UAAW,oBAAoB,mDAU1D,CAAA"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { type ColorValue, type ViewStyle, type StyleProp } from 'react-native';
|
|
2
|
-
export interface TrueSheetGrabberProps {
|
|
3
|
-
/**
|
|
4
|
-
* Is grabber visible.
|
|
5
|
-
* @default true
|
|
6
|
-
*/
|
|
7
|
-
visible?: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Optional style that overrides the default style.
|
|
10
|
-
*/
|
|
11
|
-
style?: StyleProp<ViewStyle>;
|
|
12
|
-
/**
|
|
13
|
-
* Grabber color according to M3 specs.
|
|
14
|
-
* @default rgba(73,69,79,0.4)
|
|
15
|
-
*/
|
|
16
|
-
color?: ColorValue;
|
|
17
|
-
/**
|
|
18
|
-
* Grabber height according to M3 specs.
|
|
19
|
-
* @default 4
|
|
20
|
-
*/
|
|
21
|
-
height?: number;
|
|
22
|
-
/**
|
|
23
|
-
* Grabber top position offset.
|
|
24
|
-
*
|
|
25
|
-
* @default 6
|
|
26
|
-
*/
|
|
27
|
-
topOffset?: number;
|
|
28
|
-
/**
|
|
29
|
-
* Grabber width according to M3 specs.
|
|
30
|
-
* @default 32
|
|
31
|
-
*/
|
|
32
|
-
width?: number;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Grabber component.
|
|
36
|
-
* Used by defualt for Android but feel free to re-use.
|
|
37
|
-
*/
|
|
38
|
-
export declare const TrueSheetGrabber: (props: TrueSheetGrabberProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
39
|
-
//# sourceMappingURL=TrueSheetGrabber.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TrueSheetGrabber.d.ts","sourceRoot":"","sources":["../../../../src/TrueSheetGrabber.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAQpF,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAE5B;;;OAGG;IACH,KAAK,CAAC,EAAE,UAAU,CAAA;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,UAAW,qBAAqB,mDAiB5D,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TrueSheetModule.d.ts","sourceRoot":"","sources":["../../../../src/TrueSheetModule.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,eAAe,KASvB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA"}
|
package/src/TrueSheetFooter.tsx
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { TrueSheetProps } from './TrueSheet.types'
|
|
2
|
-
|
|
3
|
-
interface TrueSheetFooterProps {
|
|
4
|
-
Component?: TrueSheetProps['FooterComponent']
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export const TrueSheetFooter = (props: TrueSheetFooterProps) => {
|
|
8
|
-
const { Component } = props
|
|
9
|
-
|
|
10
|
-
if (!Component) return null
|
|
11
|
-
|
|
12
|
-
if (typeof Component !== 'function') {
|
|
13
|
-
return Component
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return <Component />
|
|
17
|
-
}
|
package/src/TrueSheetModule.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { NativeModules, Platform } from 'react-native'
|
|
2
|
-
|
|
3
|
-
const LINKING_ERROR =
|
|
4
|
-
`The package '@lodev09/react-native-true-sheet' doesn't seem to be linked. Make sure: \n\n` +
|
|
5
|
-
Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
|
|
6
|
-
'- You rebuilt the app after installing the package\n' +
|
|
7
|
-
'- You are not using Expo Go\n'
|
|
8
|
-
|
|
9
|
-
// NativeModules automatically resolves 'TrueSheetView' to 'TrueSheetViewModule'
|
|
10
|
-
export const TrueSheetModule = NativeModules.TrueSheetView
|
|
11
|
-
? NativeModules.TrueSheetView
|
|
12
|
-
: new Proxy(
|
|
13
|
-
{},
|
|
14
|
-
{
|
|
15
|
-
get() {
|
|
16
|
-
throw new Error(LINKING_ERROR)
|
|
17
|
-
},
|
|
18
|
-
}
|
|
19
|
-
)
|
|
File without changes
|