@lodev09/react-native-true-sheet 0.12.4 → 1.0.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/android/build.gradle +6 -1
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetDialog.kt +27 -4
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetView.kt +10 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewManager.kt +7 -0
- package/android/src/main/java/com/lodev09/truesheet/core/RootSheetView.kt +11 -31
- package/android/src/main/java/com/lodev09/truesheet/core/Utils.kt +11 -2
- package/android/src/main/java/com/lodev09/truesheet/events/ContainerSizeChangeEvent.kt +23 -0
- package/ios/TrueSheet-Bridging-Header.h +1 -0
- package/ios/TrueSheetView.swift +39 -40
- package/ios/TrueSheetViewManager.m +1 -0
- package/ios/TrueSheetViewManager.swift +6 -4
- package/lib/commonjs/TrueSheet.js +56 -36
- package/lib/commonjs/TrueSheet.js.map +1 -1
- package/lib/commonjs/TrueSheetFooter.js +2 -3
- package/lib/commonjs/TrueSheetFooter.js.map +1 -1
- package/lib/commonjs/TrueSheetGrabber.js +11 -11
- package/lib/commonjs/TrueSheetGrabber.js.map +1 -1
- package/lib/commonjs/TrueSheetModule.js.map +1 -1
- package/lib/commonjs/index.js +6 -6
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/TrueSheet.js +58 -34
- package/lib/module/TrueSheet.js.map +1 -1
- package/lib/module/TrueSheet.types.js +2 -0
- package/lib/module/TrueSheetFooter.js +4 -2
- package/lib/module/TrueSheetFooter.js.map +1 -1
- package/lib/module/TrueSheetGrabber.js +13 -10
- package/lib/module/TrueSheetGrabber.js.map +1 -1
- package/lib/module/TrueSheetModule.js +2 -0
- package/lib/module/TrueSheetModule.js.map +1 -1
- package/lib/module/index.js +5 -3
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/{src → commonjs/src}/TrueSheet.d.ts +3 -0
- package/lib/typescript/commonjs/src/TrueSheet.d.ts.map +1 -0
- package/lib/typescript/{src → commonjs/src}/TrueSheet.types.d.ts +7 -0
- package/lib/typescript/commonjs/src/TrueSheet.types.d.ts.map +1 -0
- package/lib/typescript/{src → commonjs/src}/TrueSheetFooter.d.ts +1 -2
- package/lib/typescript/commonjs/src/TrueSheetFooter.d.ts.map +1 -0
- package/lib/typescript/{src → commonjs/src}/TrueSheetGrabber.d.ts +1 -2
- package/lib/typescript/commonjs/src/TrueSheetGrabber.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/TrueSheetModule.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/TrueSheet.d.ts +62 -0
- package/lib/typescript/module/src/TrueSheet.d.ts.map +1 -0
- package/lib/typescript/module/src/TrueSheet.types.d.ts +212 -0
- package/lib/typescript/module/src/TrueSheet.types.d.ts.map +1 -0
- package/lib/typescript/module/src/TrueSheetFooter.d.ts +7 -0
- package/lib/typescript/module/src/TrueSheetFooter.d.ts.map +1 -0
- package/lib/typescript/module/src/TrueSheetGrabber.d.ts +39 -0
- package/lib/typescript/module/src/TrueSheetGrabber.d.ts.map +1 -0
- package/lib/typescript/module/src/TrueSheetModule.d.ts +2 -0
- package/lib/typescript/module/src/TrueSheetModule.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +4 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/package.json +76 -62
- package/{TrueSheet.podspec → react-native-true-sheet.podspec} +19 -18
- package/src/TrueSheet.tsx +29 -5
- package/src/TrueSheet.types.ts +8 -0
- package/src/TrueSheetFooter.tsx +0 -1
- package/src/TrueSheetGrabber.tsx +0 -1
- package/lib/commonjs/__mocks__/index.js +0 -37
- package/lib/commonjs/__mocks__/index.js.map +0 -1
- package/lib/module/__mocks__/index.js +0 -15
- package/lib/module/__mocks__/index.js.map +0 -1
- package/lib/typescript/src/TrueSheet.d.ts.map +0 -1
- package/lib/typescript/src/TrueSheet.types.d.ts.map +0 -1
- package/lib/typescript/src/TrueSheetFooter.d.ts.map +0 -1
- package/lib/typescript/src/TrueSheetGrabber.d.ts.map +0 -1
- package/lib/typescript/src/TrueSheetModule.d.ts.map +0 -1
- package/lib/typescript/src/index.d.ts.map +0 -1
- package/src/__mocks__/index.js +0 -18
- /package/lib/typescript/{src → commonjs/src}/TrueSheetModule.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/index.d.ts +0 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { PureComponent, type ReactNode } from 'react';
|
|
2
|
+
import type { TrueSheetProps } from './TrueSheet.types';
|
|
3
|
+
interface TrueSheetState {
|
|
4
|
+
containerWidth?: number;
|
|
5
|
+
containerHeight?: number;
|
|
6
|
+
contentHeight?: number;
|
|
7
|
+
footerHeight?: number;
|
|
8
|
+
scrollableHandle: number | null;
|
|
9
|
+
}
|
|
10
|
+
export declare class TrueSheet extends PureComponent<TrueSheetProps, TrueSheetState> {
|
|
11
|
+
displayName: string;
|
|
12
|
+
private readonly ref;
|
|
13
|
+
/**
|
|
14
|
+
* Map of sheet names against their handle.
|
|
15
|
+
*/
|
|
16
|
+
private static readonly handles;
|
|
17
|
+
constructor(props: TrueSheetProps);
|
|
18
|
+
private static getHandle;
|
|
19
|
+
/**
|
|
20
|
+
* Present the sheet by given `name`.
|
|
21
|
+
* See `name` prop.
|
|
22
|
+
*/
|
|
23
|
+
static present(name: string, index?: number): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Dismiss the sheet by given `name`.
|
|
26
|
+
* See `name` prop.
|
|
27
|
+
*/
|
|
28
|
+
static dismiss(name: string): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Resize the sheet by given `name`.
|
|
31
|
+
* See `name` prop.
|
|
32
|
+
*/
|
|
33
|
+
static resize(name: string, index: number): Promise<void>;
|
|
34
|
+
private get handle();
|
|
35
|
+
private updateState;
|
|
36
|
+
private onSizeChange;
|
|
37
|
+
private onContainerSizeChange;
|
|
38
|
+
private onPresent;
|
|
39
|
+
private onFooterLayout;
|
|
40
|
+
private onContentLayout;
|
|
41
|
+
private onDismiss;
|
|
42
|
+
private onMount;
|
|
43
|
+
/**
|
|
44
|
+
* Present the sheet. Optionally accepts a size `index`.
|
|
45
|
+
* See `sizes` prop
|
|
46
|
+
*/
|
|
47
|
+
present(index?: number): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Resizes the Sheet programmatically by `index`.
|
|
50
|
+
* This is an alias of the `present(index)` method.
|
|
51
|
+
*/
|
|
52
|
+
resize(index: number): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Dismisses the Sheet
|
|
55
|
+
*/
|
|
56
|
+
dismiss(): Promise<void>;
|
|
57
|
+
componentDidMount(): void;
|
|
58
|
+
componentDidUpdate(): void;
|
|
59
|
+
render(): ReactNode;
|
|
60
|
+
}
|
|
61
|
+
export {};
|
|
62
|
+
//# sourceMappingURL=TrueSheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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;AAY3F,OAAO,KAAK,EAAE,cAAc,EAAY,MAAM,mBAAmB,CAAA;AA0BjE,UAAU,cAAc;IACtB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;CAChC;AAQD,qBAAa,SAAU,SAAQ,aAAa,CAAC,cAAc,EAAE,cAAc,CAAC;IAC1E,WAAW,SAAc;IAEzB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAsB;IAE1C;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAiC;gBAEpD,KAAK,EAAE,cAAc;IAsBjC,OAAO,CAAC,MAAM,CAAC,SAAS;IAUxB;;;OAGG;WACiB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,MAAU;IAO3D;;;OAGG;WACiB,OAAO,CAAC,IAAI,EAAE,MAAM;IAOxC;;;OAGG;WACiB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAItD,OAAO,KAAK,MAAM,GAOjB;IAED,OAAO,CAAC,WAAW;IAcnB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,OAAO;IAIf;;;OAGG;IACU,OAAO,CAAC,KAAK,GAAE,MAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAItD;;;OAGG;IACU,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjD;;OAEG;IACU,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrC,iBAAiB,IAAI,IAAI;IAUzB,kBAAkB,IAAI,IAAI;IAI1B,MAAM,IAAI,SAAS;CAkFpB"}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import type { Component, ComponentType, ReactElement, RefObject } from 'react';
|
|
2
|
+
import type { ColorValue, StyleProp, ViewProps, ViewStyle } from 'react-native';
|
|
3
|
+
import type { TrueSheetGrabberProps } from './TrueSheetGrabber';
|
|
4
|
+
export interface SizeInfo {
|
|
5
|
+
index: number;
|
|
6
|
+
value: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Blur style mapped to native values in IOS.
|
|
10
|
+
*
|
|
11
|
+
* @platform ios
|
|
12
|
+
*/
|
|
13
|
+
export type BlurTint = 'light' | 'dark' | 'default' | 'extraLight' | 'regular' | 'prominent' | 'systemUltraThinMaterial' | 'systemThinMaterial' | 'systemMaterial' | 'systemThickMaterial' | 'systemChromeMaterial' | 'systemUltraThinMaterialLight' | 'systemThinMaterialLight' | 'systemMaterialLight' | 'systemThickMaterialLight' | 'systemChromeMaterialLight' | 'systemUltraThinMaterialDark' | 'systemThinMaterialDark' | 'systemMaterialDark' | 'systemThickMaterialDark' | 'systemChromeMaterialDark';
|
|
14
|
+
/**
|
|
15
|
+
* Supported Sheet size.
|
|
16
|
+
*
|
|
17
|
+
* @platform android
|
|
18
|
+
* @platform ios 15+
|
|
19
|
+
*/
|
|
20
|
+
export type SheetSize =
|
|
21
|
+
/**
|
|
22
|
+
* Auto resize based on content height
|
|
23
|
+
*
|
|
24
|
+
* @platform android
|
|
25
|
+
* @platform ios 16+
|
|
26
|
+
*/
|
|
27
|
+
'auto'
|
|
28
|
+
/**
|
|
29
|
+
* Fixed height
|
|
30
|
+
*
|
|
31
|
+
* @platform android
|
|
32
|
+
* @platform ios 16+
|
|
33
|
+
*/
|
|
34
|
+
| number
|
|
35
|
+
/**
|
|
36
|
+
* Fixed height in %
|
|
37
|
+
*
|
|
38
|
+
* @platform android
|
|
39
|
+
* @platform ios 16+
|
|
40
|
+
*/
|
|
41
|
+
| `${number}%`
|
|
42
|
+
/**
|
|
43
|
+
* Translates to 25%
|
|
44
|
+
*
|
|
45
|
+
* @platform android
|
|
46
|
+
* @platform ios 16+
|
|
47
|
+
*/
|
|
48
|
+
| 'small'
|
|
49
|
+
/**
|
|
50
|
+
* Translates to 50%
|
|
51
|
+
*
|
|
52
|
+
* @platform android
|
|
53
|
+
* @platform ios 15+
|
|
54
|
+
*/
|
|
55
|
+
| 'medium'
|
|
56
|
+
/**
|
|
57
|
+
* Translates to 100%
|
|
58
|
+
*
|
|
59
|
+
* @platform android
|
|
60
|
+
* @platform ios 15+
|
|
61
|
+
*/
|
|
62
|
+
| 'large';
|
|
63
|
+
export interface TrueSheetProps extends ViewProps {
|
|
64
|
+
/**
|
|
65
|
+
* The name to reference this sheet. It has to be unique.
|
|
66
|
+
* You can then present this sheet globally using its `name`.
|
|
67
|
+
*
|
|
68
|
+
* Example:
|
|
69
|
+
* ```ts
|
|
70
|
+
* <TrueSheet name="my-awesome-sheet">
|
|
71
|
+
* <MyComponent />
|
|
72
|
+
* </TrueSheet>
|
|
73
|
+
* ```
|
|
74
|
+
* ```ts
|
|
75
|
+
* TrueSheet.present('my-awesome-sheet')
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
name?: string;
|
|
79
|
+
/**
|
|
80
|
+
* The sizes you want the Sheet to support.
|
|
81
|
+
* Maximum of 3 sizes only; collapsed, half-expanded, expanded.
|
|
82
|
+
*
|
|
83
|
+
* Example:
|
|
84
|
+
* ```ts
|
|
85
|
+
* size={['auto', '60%', 'large']}
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* @default ['medium', 'large']
|
|
89
|
+
*/
|
|
90
|
+
sizes?: SheetSize[];
|
|
91
|
+
/**
|
|
92
|
+
* Specify whether the sheet background is dimmed.
|
|
93
|
+
* Set to `false` to allow interaction with the background components.
|
|
94
|
+
*
|
|
95
|
+
* @platform android
|
|
96
|
+
* @platform ios 15+
|
|
97
|
+
* @default true
|
|
98
|
+
*/
|
|
99
|
+
dimmed?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Initially present the sheet, after mounting, at a given size index.
|
|
102
|
+
*
|
|
103
|
+
* @note This property is only used during the initial mount.
|
|
104
|
+
* @default -1
|
|
105
|
+
*/
|
|
106
|
+
initialIndex?: number;
|
|
107
|
+
/**
|
|
108
|
+
* Specify whether the sheet should animate after mounting.
|
|
109
|
+
* Used with `initialIndex`.
|
|
110
|
+
*
|
|
111
|
+
* @default true
|
|
112
|
+
*/
|
|
113
|
+
initialIndexAnimated?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* The size index that the sheet should start to dim the background.
|
|
116
|
+
* This is ignored if `dimmed` is set to `false`.
|
|
117
|
+
*
|
|
118
|
+
* @default 0
|
|
119
|
+
*/
|
|
120
|
+
dimmedIndex?: number;
|
|
121
|
+
/**
|
|
122
|
+
* Prevents interactive dismissal of the Sheet.
|
|
123
|
+
*
|
|
124
|
+
* @default true
|
|
125
|
+
*/
|
|
126
|
+
dismissible?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Main sheet background color
|
|
129
|
+
*
|
|
130
|
+
* @default white
|
|
131
|
+
*/
|
|
132
|
+
backgroundColor?: ColorValue;
|
|
133
|
+
/**
|
|
134
|
+
* The sheet corner radius.
|
|
135
|
+
*
|
|
136
|
+
* @platform android
|
|
137
|
+
* @platform ios 15+
|
|
138
|
+
*/
|
|
139
|
+
cornerRadius?: number;
|
|
140
|
+
/**
|
|
141
|
+
* Shows native grabber (or handle) on IOS.
|
|
142
|
+
*
|
|
143
|
+
* @platform ios
|
|
144
|
+
* @default true
|
|
145
|
+
*/
|
|
146
|
+
grabber?: boolean;
|
|
147
|
+
/**
|
|
148
|
+
* Grabber props to be used for android grabber or handle.
|
|
149
|
+
*
|
|
150
|
+
* @platform android
|
|
151
|
+
*/
|
|
152
|
+
grabberProps?: TrueSheetGrabberProps;
|
|
153
|
+
/**
|
|
154
|
+
* The blur effect style on iOS.
|
|
155
|
+
* Overrides `backgroundColor` if set.
|
|
156
|
+
*
|
|
157
|
+
* @platform ios
|
|
158
|
+
*/
|
|
159
|
+
blurTint?: BlurTint;
|
|
160
|
+
/**
|
|
161
|
+
* Optional content container styles.
|
|
162
|
+
*/
|
|
163
|
+
contentContainerStyle?: StyleProp<ViewStyle>;
|
|
164
|
+
/**
|
|
165
|
+
* The main scrollable ref that Sheet should handle on IOS.
|
|
166
|
+
*
|
|
167
|
+
* @platform ios
|
|
168
|
+
*/
|
|
169
|
+
scrollRef?: RefObject<Component<unknown>>;
|
|
170
|
+
/**
|
|
171
|
+
* Overrides `large` or `100%` height.
|
|
172
|
+
*/
|
|
173
|
+
maxHeight?: number;
|
|
174
|
+
/**
|
|
175
|
+
* A component that floats at the bottom of the Sheet.
|
|
176
|
+
*/
|
|
177
|
+
FooterComponent?: ComponentType<unknown> | ReactElement;
|
|
178
|
+
/**
|
|
179
|
+
* Determines how the software keyboard will impact the layout of the sheet.
|
|
180
|
+
* Set to `pan` if you're working with `FlatList` with a `TextInput`.
|
|
181
|
+
*
|
|
182
|
+
* @platform android
|
|
183
|
+
* @default resize
|
|
184
|
+
*/
|
|
185
|
+
keyboardMode?: 'resize' | 'pan';
|
|
186
|
+
/**
|
|
187
|
+
* Supports edge-to-edge on Android.
|
|
188
|
+
* Turn this on if your app has it enabled.
|
|
189
|
+
*
|
|
190
|
+
* @platform android
|
|
191
|
+
*/
|
|
192
|
+
edgeToEdge?: boolean;
|
|
193
|
+
/**
|
|
194
|
+
* This is called when the sheet is ready to present.
|
|
195
|
+
*/
|
|
196
|
+
onMount?: () => void;
|
|
197
|
+
/**
|
|
198
|
+
* Called when the Sheet has been presented.
|
|
199
|
+
* Comes with the size info.
|
|
200
|
+
*/
|
|
201
|
+
onPresent?: (info: SizeInfo) => void;
|
|
202
|
+
/**
|
|
203
|
+
* Called when the Sheet has been dismissed
|
|
204
|
+
*/
|
|
205
|
+
onDismiss?: () => void;
|
|
206
|
+
/**
|
|
207
|
+
* Called when the size of the sheet has changed.
|
|
208
|
+
* Either by dragging or programatically.
|
|
209
|
+
*/
|
|
210
|
+
onSizeChange?: (info: SizeInfo) => void;
|
|
211
|
+
}
|
|
212
|
+
//# sourceMappingURL=TrueSheet.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAE/D,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAChB,OAAO,GACP,MAAM,GACN,SAAS,GACT,YAAY,GACZ,SAAS,GACT,WAAW,GACX,yBAAyB,GACzB,oBAAoB,GACpB,gBAAgB,GAChB,qBAAqB,GACrB,sBAAsB,GACtB,8BAA8B,GAC9B,yBAAyB,GACzB,qBAAqB,GACrB,0BAA0B,GAC1B,2BAA2B,GAC3B,6BAA6B,GAC7B,wBAAwB,GACxB,oBAAoB,GACpB,yBAAyB,GACzB,0BAA0B,CAAA;AAE9B;;;;;GAKG;AACH,MAAM,MAAM,SAAS;AACnB;;;;;GAKG;AACD,MAAM;AAER;;;;;GAKG;GACD,MAAM;AAER;;;;;GAKG;GACD,GAAG,MAAM,GAAG;AAEd;;;;;GAKG;GACD,OAAO;AAET;;;;;GAKG;GACD,QAAQ;AAEV;;;;;GAKG;GACD,OAAO,CAAA;AAEX,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC/C;;;;;;;;;;;;;OAaG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;;;;;;;OAUG;IACH,KAAK,CAAC,EAAE,SAAS,EAAE,CAAA;IAEnB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAE9B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB;;;;OAIG;IACH,eAAe,CAAC,EAAE,UAAU,CAAA;IAE5B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;;;OAIG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAA;IAEpC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAA;IAEnB;;OAEG;IACH,qBAAqB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAE5C;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IAEzC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;OAEG;IACH,eAAe,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,YAAY,CAAA;IAEvD;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAA;IAE/B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAEpB;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAA;IAEpC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IAEtB;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAA;CACxC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrueSheetModule.d.ts","sourceRoot":"","sources":["../../../../src/TrueSheetModule.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,eAAe,KASvB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
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/package.json
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lodev09/react-native-true-sheet",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "The true native bottom sheet experience for your React Native Apps.",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
5
|
+
"source": "./src/index.ts",
|
|
6
|
+
"main": "./lib/commonjs/index.js",
|
|
7
|
+
"module": "./lib/module/index.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": {
|
|
11
|
+
"types": "./lib/typescript/module/src/index.d.ts",
|
|
12
|
+
"default": "./lib/module/index.js"
|
|
13
|
+
},
|
|
14
|
+
"require": {
|
|
15
|
+
"types": "./lib/typescript/commonjs/src/index.d.ts",
|
|
16
|
+
"default": "./lib/commonjs/index.js"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
10
20
|
"files": [
|
|
11
21
|
"src",
|
|
12
22
|
"lib",
|
|
@@ -14,6 +24,7 @@
|
|
|
14
24
|
"ios",
|
|
15
25
|
"cpp",
|
|
16
26
|
"*.podspec",
|
|
27
|
+
"react-native.config.js",
|
|
17
28
|
"!ios/build",
|
|
18
29
|
"!android/build",
|
|
19
30
|
"!android/gradle",
|
|
@@ -22,17 +33,18 @@
|
|
|
22
33
|
"!android/local.properties",
|
|
23
34
|
"!**/__tests__",
|
|
24
35
|
"!**/__fixtures__",
|
|
36
|
+
"!**/__mocks__",
|
|
25
37
|
"!**/.*"
|
|
26
38
|
],
|
|
27
39
|
"scripts": {
|
|
28
|
-
"example": "yarn workspace true-sheet-example",
|
|
40
|
+
"example": "yarn workspace react-native-true-sheet-example",
|
|
29
41
|
"docs": "yarn workspace docs",
|
|
30
42
|
"test": "jest",
|
|
31
|
-
"typecheck": "tsc
|
|
43
|
+
"typecheck": "tsc",
|
|
32
44
|
"lint": "eslint --fix \"**/*.{js,ts,tsx}\"",
|
|
33
45
|
"format": "prettier --write \"**/*.{js,ts,tsx}\"",
|
|
34
46
|
"tidy": "yarn typecheck && yarn lint && yarn format && scripts/swiftlint.sh && scripts/ktlint.sh",
|
|
35
|
-
"clean": "del-cli android/build
|
|
47
|
+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
36
48
|
"prepare": "bob build",
|
|
37
49
|
"release": "yarn tidy && release-it"
|
|
38
50
|
},
|
|
@@ -58,30 +70,27 @@
|
|
|
58
70
|
"registry": "https://registry.npmjs.org/"
|
|
59
71
|
},
|
|
60
72
|
"devDependencies": {
|
|
61
|
-
"@commitlint/config-conventional": "^
|
|
62
|
-
"@evilmartians/lefthook": "^1.
|
|
63
|
-
"@react-native/
|
|
64
|
-
"@
|
|
65
|
-
"@types/jest": "^29.5.
|
|
66
|
-
"@types/react": "^18.2.
|
|
67
|
-
"
|
|
68
|
-
"@typescript-eslint/parser": "^7.1.1",
|
|
69
|
-
"commitlint": "^19.0.3",
|
|
73
|
+
"@commitlint/config-conventional": "^17.0.2",
|
|
74
|
+
"@evilmartians/lefthook": "^1.5.0",
|
|
75
|
+
"@react-native-community/cli": "15.0.1",
|
|
76
|
+
"@react-native/eslint-config": "^0.73.1",
|
|
77
|
+
"@types/jest": "^29.5.5",
|
|
78
|
+
"@types/react": "^18.2.44",
|
|
79
|
+
"commitlint": "^17.0.2",
|
|
70
80
|
"del-cli": "^5.1.0",
|
|
71
|
-
"eslint": "^8.
|
|
72
|
-
"eslint-config-prettier": "^9.
|
|
73
|
-
"eslint-
|
|
74
|
-
"eslint-plugin-import": "^2.29.1",
|
|
75
|
-
"eslint-plugin-n": "^16.6.2",
|
|
76
|
-
"eslint-plugin-prettier": "^5.1.3",
|
|
77
|
-
"eslint-plugin-promise": "^6.1.1",
|
|
81
|
+
"eslint": "^8.51.0",
|
|
82
|
+
"eslint-config-prettier": "^9.0.0",
|
|
83
|
+
"eslint-plugin-prettier": "^5.0.1",
|
|
78
84
|
"jest": "^29.7.0",
|
|
79
|
-
"prettier": "^3.
|
|
80
|
-
"react": "
|
|
81
|
-
"react-native": "
|
|
82
|
-
"react-native-builder-bob": "^0.
|
|
83
|
-
"release-it": "^17.
|
|
84
|
-
"typescript": "
|
|
85
|
+
"prettier": "^3.0.3",
|
|
86
|
+
"react": "18.3.1",
|
|
87
|
+
"react-native": "0.76.3",
|
|
88
|
+
"react-native-builder-bob": "^0.33.3",
|
|
89
|
+
"release-it": "^17.10.0",
|
|
90
|
+
"typescript": "^5.2.2"
|
|
91
|
+
},
|
|
92
|
+
"resolutions": {
|
|
93
|
+
"@types/react": "^18.2.44"
|
|
85
94
|
},
|
|
86
95
|
"peerDependencies": {
|
|
87
96
|
"react": "*",
|
|
@@ -91,13 +100,13 @@
|
|
|
91
100
|
"example",
|
|
92
101
|
"docs"
|
|
93
102
|
],
|
|
94
|
-
"packageManager": "yarn@
|
|
103
|
+
"packageManager": "yarn@3.6.1",
|
|
95
104
|
"jest": {
|
|
96
105
|
"preset": "react-native",
|
|
97
106
|
"modulePathIgnorePatterns": [
|
|
98
107
|
"<rootDir>/example/node_modules",
|
|
99
|
-
"<rootDir>/docs/node_modules",
|
|
100
108
|
"<rootDir>/lib/",
|
|
109
|
+
"<rootDir>/docs/node_modules",
|
|
101
110
|
"<rootDir>/docs/build"
|
|
102
111
|
]
|
|
103
112
|
},
|
|
@@ -121,44 +130,34 @@
|
|
|
121
130
|
"issue": ":rocket: _This issue has been resolved in v${version}. See [${releaseName}](${releaseUrl}) for release notes._",
|
|
122
131
|
"pr": ":rocket: _This pull request is included in v${version}. See [${releaseName}](${releaseUrl}) for release notes._"
|
|
123
132
|
}
|
|
124
|
-
},
|
|
125
|
-
"plugins": {
|
|
126
|
-
"@release-it/conventional-changelog": {
|
|
127
|
-
"preset": "angular"
|
|
128
|
-
}
|
|
129
133
|
}
|
|
130
134
|
},
|
|
131
135
|
"eslintConfig": {
|
|
132
136
|
"root": true,
|
|
133
137
|
"extends": [
|
|
134
|
-
"
|
|
135
|
-
"eslint:recommended",
|
|
136
|
-
"plugin:react/recommended",
|
|
137
|
-
"plugin:react-native/all",
|
|
138
|
-
"standard",
|
|
138
|
+
"@react-native",
|
|
139
139
|
"prettier"
|
|
140
140
|
],
|
|
141
|
-
"globals": {
|
|
142
|
-
"it": false
|
|
143
|
-
},
|
|
144
141
|
"rules": {
|
|
145
|
-
"
|
|
146
|
-
"
|
|
142
|
+
"react/react-in-jsx-scope": "off",
|
|
143
|
+
"prettier/prettier": [
|
|
147
144
|
"error",
|
|
148
145
|
{
|
|
149
|
-
"
|
|
150
|
-
"
|
|
146
|
+
"quoteProps": "consistent",
|
|
147
|
+
"singleQuote": true,
|
|
148
|
+
"tabWidth": 2,
|
|
149
|
+
"trailingComma": "es5",
|
|
150
|
+
"useTabs": false,
|
|
151
|
+
"printWidth": 100,
|
|
152
|
+
"semi": false
|
|
151
153
|
}
|
|
152
|
-
]
|
|
153
|
-
"no-unused-vars": 0
|
|
154
|
-
},
|
|
155
|
-
"settings": {
|
|
156
|
-
"react": {
|
|
157
|
-
"pragma": "React",
|
|
158
|
-
"version": "detect"
|
|
159
|
-
}
|
|
154
|
+
]
|
|
160
155
|
}
|
|
161
156
|
},
|
|
157
|
+
"eslintIgnore": [
|
|
158
|
+
"node_modules/",
|
|
159
|
+
"lib/"
|
|
160
|
+
],
|
|
162
161
|
"prettier": {
|
|
163
162
|
"quoteProps": "consistent",
|
|
164
163
|
"singleQuote": true,
|
|
@@ -169,18 +168,33 @@
|
|
|
169
168
|
"semi": false
|
|
170
169
|
},
|
|
171
170
|
"react-native-builder-bob": {
|
|
172
|
-
"exclude": "**/{__tests__,__fixtures__}/**",
|
|
173
171
|
"source": "src",
|
|
174
172
|
"output": "lib",
|
|
175
173
|
"targets": [
|
|
176
|
-
|
|
177
|
-
|
|
174
|
+
[
|
|
175
|
+
"commonjs",
|
|
176
|
+
{
|
|
177
|
+
"esm": true
|
|
178
|
+
}
|
|
179
|
+
],
|
|
180
|
+
[
|
|
181
|
+
"module",
|
|
182
|
+
{
|
|
183
|
+
"esm": true
|
|
184
|
+
}
|
|
185
|
+
],
|
|
178
186
|
[
|
|
179
187
|
"typescript",
|
|
180
188
|
{
|
|
181
|
-
"project": "tsconfig.build.json"
|
|
189
|
+
"project": "tsconfig.build.json",
|
|
190
|
+
"esm": true
|
|
182
191
|
}
|
|
183
192
|
]
|
|
184
193
|
]
|
|
194
|
+
},
|
|
195
|
+
"create-react-native-library": {
|
|
196
|
+
"type": "view-legacy",
|
|
197
|
+
"languages": "kotlin-swift",
|
|
198
|
+
"version": "0.44.3"
|
|
185
199
|
}
|
|
186
200
|
}
|
|
@@ -4,14 +4,14 @@ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
|
4
4
|
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
|
|
5
5
|
|
|
6
6
|
Pod::Spec.new do |s|
|
|
7
|
-
s.name = "
|
|
7
|
+
s.name = "react-native-true-sheet"
|
|
8
8
|
s.version = package["version"]
|
|
9
9
|
s.summary = package["description"]
|
|
10
10
|
s.homepage = package["homepage"]
|
|
11
11
|
s.license = package["license"]
|
|
12
12
|
s.authors = package["author"]
|
|
13
13
|
|
|
14
|
-
s.platforms = { :ios =>
|
|
14
|
+
s.platforms = { :ios => min_ios_version_supported }
|
|
15
15
|
s.source = { :git => "https://github.com/lodev09/react-native-true-sheet.git", :tag => "#{s.version}" }
|
|
16
16
|
|
|
17
17
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
@@ -21,21 +21,22 @@ Pod::Spec.new do |s|
|
|
|
21
21
|
if respond_to?(:install_modules_dependencies, true)
|
|
22
22
|
install_modules_dependencies(s)
|
|
23
23
|
else
|
|
24
|
-
|
|
24
|
+
s.dependency "React-Core"
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
26
|
+
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
27
|
+
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
|
28
|
+
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
|
|
29
|
+
s.pod_target_xcconfig = {
|
|
30
|
+
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
31
|
+
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
|
32
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
33
|
+
}
|
|
34
|
+
s.dependency "React-RCTFabric"
|
|
35
|
+
s.dependency "React-Codegen"
|
|
36
|
+
s.dependency "RCT-Folly"
|
|
37
|
+
s.dependency "RCTRequired"
|
|
38
|
+
s.dependency "RCTTypeSafety"
|
|
39
|
+
s.dependency "ReactCommon/turbomodule/core"
|
|
40
|
+
end
|
|
41
|
+
end
|
|
41
42
|
end
|