@lodev09/react-native-true-sheet 0.4.5 → 0.5.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 +141 -4
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetView.kt +57 -53
- package/android/src/main/java/com/lodev09/truesheet/core/Events.kt +8 -2
- package/android/src/main/java/com/lodev09/truesheet/core/{SheetBehavior.kt → TrueSheetBehavior.kt} +35 -29
- package/ios/Extensions/UIBlurEffect+withStyle.swift +62 -0
- package/ios/TrueSheetView.swift +48 -13
- package/ios/TrueSheetViewController.swift +51 -6
- package/ios/TrueSheetViewManager.m +3 -0
- package/lib/commonjs/TrueSheet.js +41 -14
- package/lib/commonjs/TrueSheet.js.map +1 -1
- package/lib/module/TrueSheet.js +41 -14
- package/lib/module/TrueSheet.js.map +1 -1
- package/lib/typescript/src/TrueSheet.d.ts +1 -1
- package/lib/typescript/src/TrueSheet.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +44 -14
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/package.json +5 -2
- package/src/TrueSheet.tsx +48 -20
- package/src/types.ts +70 -15
package/src/types.ts
CHANGED
|
@@ -1,14 +1,44 @@
|
|
|
1
1
|
import type { Component, ComponentType, RefObject } from 'react'
|
|
2
2
|
import type { ColorValue, ViewProps } from 'react-native'
|
|
3
3
|
|
|
4
|
-
export interface
|
|
4
|
+
export interface SizeInfo {
|
|
5
5
|
index: number
|
|
6
6
|
value: number
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Blur style mapped to native values in IOS.
|
|
11
|
+
*
|
|
12
|
+
* @platform ios
|
|
13
|
+
*/
|
|
14
|
+
export type BlurStyle =
|
|
15
|
+
| 'light'
|
|
16
|
+
| 'dark'
|
|
17
|
+
| 'default'
|
|
18
|
+
| 'extraLight'
|
|
19
|
+
| 'regular'
|
|
20
|
+
| 'prominent'
|
|
21
|
+
| 'systemUltraThinMaterial'
|
|
22
|
+
| 'systemThinMaterial'
|
|
23
|
+
| 'systemMaterial'
|
|
24
|
+
| 'systemThickMaterial'
|
|
25
|
+
| 'systemChromeMaterial'
|
|
26
|
+
| 'systemUltraThinMaterialLight'
|
|
27
|
+
| 'systemThinMaterialLight'
|
|
28
|
+
| 'systemMaterialLight'
|
|
29
|
+
| 'systemThickMaterialLight'
|
|
30
|
+
| 'systemChromeMaterialLight'
|
|
31
|
+
| 'systemUltraThinMaterialDark'
|
|
32
|
+
| 'systemThinMaterialDark'
|
|
33
|
+
| 'systemMaterialDark'
|
|
34
|
+
| 'systemThickMaterialDark'
|
|
35
|
+
| 'systemChromeMaterialDark'
|
|
36
|
+
|
|
9
37
|
/**
|
|
10
38
|
* Supported Sheet size.
|
|
11
|
-
*
|
|
39
|
+
*
|
|
40
|
+
* @platform android
|
|
41
|
+
* @platform ios 15+
|
|
12
42
|
*/
|
|
13
43
|
export type SheetSize =
|
|
14
44
|
/**
|
|
@@ -60,29 +90,54 @@ export type SheetSize =
|
|
|
60
90
|
| 'large'
|
|
61
91
|
|
|
62
92
|
export interface TrueSheetProps extends ViewProps {
|
|
93
|
+
/**
|
|
94
|
+
* The sizes you want the Sheet to support.
|
|
95
|
+
* Maximum of 3 sizes only; collapsed, half-expanded, expanded.
|
|
96
|
+
*
|
|
97
|
+
* Example:
|
|
98
|
+
* ```ts
|
|
99
|
+
* size={['auto', '60%', 'large']}
|
|
100
|
+
* ```
|
|
101
|
+
*
|
|
102
|
+
* @default ['medium', 'large']
|
|
103
|
+
*/
|
|
104
|
+
sizes?: SheetSize[]
|
|
105
|
+
|
|
63
106
|
/**
|
|
64
107
|
* Main sheet background color
|
|
65
108
|
*/
|
|
66
109
|
backgroundColor?: ColorValue
|
|
67
110
|
|
|
68
111
|
/**
|
|
69
|
-
* The
|
|
112
|
+
* The sheet corner radius.
|
|
113
|
+
*
|
|
114
|
+
* @platform android
|
|
115
|
+
* @platform ios 15+
|
|
116
|
+
*/
|
|
117
|
+
cornerRadius?: number
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Shows native grabber (or handle) on IOS
|
|
121
|
+
*
|
|
70
122
|
* @platform ios
|
|
123
|
+
* @default true
|
|
71
124
|
*/
|
|
72
|
-
|
|
125
|
+
grabber?: boolean
|
|
73
126
|
|
|
74
127
|
/**
|
|
75
|
-
* The
|
|
76
|
-
*
|
|
128
|
+
* The blur effect style on iOS.
|
|
129
|
+
* Overrides `backgroundColor` if set.
|
|
77
130
|
*
|
|
78
|
-
*
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
131
|
+
* @platform ios
|
|
132
|
+
*/
|
|
133
|
+
blurStyle?: BlurStyle
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* The main scrollable ref that Sheet should handle on IOS.
|
|
82
137
|
*
|
|
83
|
-
* @
|
|
138
|
+
* @platform ios
|
|
84
139
|
*/
|
|
85
|
-
|
|
140
|
+
scrollRef?: RefObject<Component<unknown>>
|
|
86
141
|
|
|
87
142
|
/**
|
|
88
143
|
* Overrides `large` or `100%` height.
|
|
@@ -96,9 +151,9 @@ export interface TrueSheetProps extends ViewProps {
|
|
|
96
151
|
|
|
97
152
|
/**
|
|
98
153
|
* Called when the Sheet has been presented.
|
|
99
|
-
* Comes with the size
|
|
154
|
+
* Comes with the size info.
|
|
100
155
|
*/
|
|
101
|
-
onPresent?: () => void
|
|
156
|
+
onPresent?: (info: SizeInfo) => void
|
|
102
157
|
|
|
103
158
|
/**
|
|
104
159
|
* Called when the Sheet has been dismissed
|
|
@@ -109,5 +164,5 @@ export interface TrueSheetProps extends ViewProps {
|
|
|
109
164
|
* Called when the size of the sheet has changed.
|
|
110
165
|
* Either by dragging or programatically.
|
|
111
166
|
*/
|
|
112
|
-
onSizeChange?: (
|
|
167
|
+
onSizeChange?: (info: SizeInfo) => void
|
|
113
168
|
}
|