@tamagui/sheet 1.0.1-beta.100
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/dist/cjs/Drawer.js +284 -0
- package/dist/cjs/Drawer.js.map +7 -0
- package/dist/cjs/Sheet.js +284 -0
- package/dist/cjs/Sheet.js.map +7 -0
- package/dist/cjs/index.js +18 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/esm/Drawer.js +264 -0
- package/dist/esm/Drawer.js.map +7 -0
- package/dist/esm/Sheet.js +264 -0
- package/dist/esm/Sheet.js.map +7 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/jsx/Drawer.js +220 -0
- package/dist/jsx/Drawer.js.map +7 -0
- package/dist/jsx/Sheet.js +220 -0
- package/dist/jsx/Sheet.js.map +7 -0
- package/dist/jsx/index.js +2 -0
- package/dist/jsx/index.js.map +7 -0
- package/package.json +42 -0
- package/src/Sheet.tsx +308 -0
- package/src/index.ts +1 -0
- package/types/Drawer.d.ts +184 -0
- package/types/Drawer.d.ts.map +1 -0
- package/types/Sheet.d.ts +184 -0
- package/types/Sheet.d.ts.map +1 -0
- package/types/index.d.ts +2 -0
- package/types/index.d.ts.map +1 -0
package/src/Sheet.tsx
ADDED
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import { isSSR, isWeb, styled, themeable, withStaticProperties } from '@tamagui/core'
|
|
2
|
+
import { ScopedProps, createContextScope } from '@tamagui/create-context'
|
|
3
|
+
import { XStack, XStackProps, YStack } from '@tamagui/stacks'
|
|
4
|
+
import { useControllableState } from '@tamagui/use-controllable-state'
|
|
5
|
+
import React, {
|
|
6
|
+
ReactNode,
|
|
7
|
+
forwardRef,
|
|
8
|
+
isValidElement,
|
|
9
|
+
useCallback,
|
|
10
|
+
useEffect,
|
|
11
|
+
useLayoutEffect,
|
|
12
|
+
useMemo,
|
|
13
|
+
useRef,
|
|
14
|
+
useState,
|
|
15
|
+
} from 'react'
|
|
16
|
+
import { Animated, LayoutRectangle, PanResponder, View } from 'react-native'
|
|
17
|
+
|
|
18
|
+
type PositionChangeHandler =
|
|
19
|
+
| ((position: number) => void)
|
|
20
|
+
| React.Dispatch<React.SetStateAction<number>>
|
|
21
|
+
|
|
22
|
+
const DRAWER_NAME = 'Drawer'
|
|
23
|
+
const DRAWER_HANDLE_NAME = 'DrawerHandle'
|
|
24
|
+
|
|
25
|
+
export const DrawerHandleFrame = styled(XStack, {
|
|
26
|
+
name: DRAWER_HANDLE_NAME,
|
|
27
|
+
height: 10,
|
|
28
|
+
borderRadius: 100,
|
|
29
|
+
backgroundColor: '$background',
|
|
30
|
+
position: 'absolute',
|
|
31
|
+
pointerEvents: 'auto',
|
|
32
|
+
zIndex: 10,
|
|
33
|
+
y: -18,
|
|
34
|
+
top: 0,
|
|
35
|
+
left: '35%',
|
|
36
|
+
right: '35%',
|
|
37
|
+
opacity: 0.5,
|
|
38
|
+
|
|
39
|
+
hoverStyle: {
|
|
40
|
+
opacity: 0.7,
|
|
41
|
+
},
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
export const DrawerHandle = DrawerHandleFrame.extractable(
|
|
45
|
+
({ __scopeDrawer, ...props }: ScopedProps<XStackProps, 'Drawer'>) => {
|
|
46
|
+
const context = useDrawerContext(DRAWER_HANDLE_NAME, __scopeDrawer)
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<DrawerHandleFrame
|
|
50
|
+
onPress={() => {
|
|
51
|
+
const nextPos = (context.position + 1) % context.snapPoints.length
|
|
52
|
+
context.setPosition(nextPos)
|
|
53
|
+
}}
|
|
54
|
+
{...props}
|
|
55
|
+
/>
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
type DrawerContextValue = {
|
|
61
|
+
position: number
|
|
62
|
+
snapPoints: number[]
|
|
63
|
+
setPosition: React.Dispatch<React.SetStateAction<number>>
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const [createDrawerContext, createDrawerScope] = createContextScope(DRAWER_NAME)
|
|
67
|
+
const [DrawerProvider, useDrawerContext] = createDrawerContext<DrawerContextValue>(
|
|
68
|
+
DRAWER_NAME,
|
|
69
|
+
{} as any
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
export const DrawerBackdrop = styled(YStack, {
|
|
73
|
+
name: 'DrawerBackdrop',
|
|
74
|
+
backgroundColor: '$color',
|
|
75
|
+
fullscreen: true,
|
|
76
|
+
opacity: 0.2,
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
export const DrawerFrame = styled(YStack, {
|
|
80
|
+
name: 'DrawerFrame',
|
|
81
|
+
flex: 1,
|
|
82
|
+
backgroundColor: '$background',
|
|
83
|
+
borderTopLeftRadius: '$4',
|
|
84
|
+
borderTopRightRadius: '$4',
|
|
85
|
+
padding: '$4',
|
|
86
|
+
width: '100%',
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
export type DrawerProps = ScopedProps<
|
|
90
|
+
{
|
|
91
|
+
open?: boolean
|
|
92
|
+
defaultOpen?: boolean
|
|
93
|
+
defaultPosition?: number
|
|
94
|
+
snapPoints?: number[]
|
|
95
|
+
position?: number
|
|
96
|
+
onChangePosition?: PositionChangeHandler
|
|
97
|
+
children?: ReactNode
|
|
98
|
+
},
|
|
99
|
+
'Drawer'
|
|
100
|
+
>
|
|
101
|
+
|
|
102
|
+
const useIsSSR = () => {
|
|
103
|
+
const [val, setVal] = useState(isWeb ? isSSR : false)
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
if (isWeb && !isSSR) {
|
|
106
|
+
setVal(false)
|
|
107
|
+
}
|
|
108
|
+
}, [])
|
|
109
|
+
return val
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export const Drawer = withStaticProperties(
|
|
113
|
+
themeable(
|
|
114
|
+
forwardRef<View, DrawerProps>((props, ref) => {
|
|
115
|
+
const {
|
|
116
|
+
__scopeDrawer,
|
|
117
|
+
snapPoints: snapPointsProp = [80, 10],
|
|
118
|
+
children: childrenProp,
|
|
119
|
+
position: positionProp,
|
|
120
|
+
onChangePosition,
|
|
121
|
+
defaultPosition,
|
|
122
|
+
...rest
|
|
123
|
+
} = props
|
|
124
|
+
const isServerSide = useIsSSR()
|
|
125
|
+
|
|
126
|
+
const [position, setPosition] = useControllableState({
|
|
127
|
+
prop: positionProp,
|
|
128
|
+
defaultProp: defaultPosition || 0,
|
|
129
|
+
onChange: onChangePosition,
|
|
130
|
+
strategy: 'most-recent-wins',
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
const [layout, setLayout] = useState<LayoutRectangle>()
|
|
134
|
+
|
|
135
|
+
const positionValue = useRef<Animated.Value>()
|
|
136
|
+
if (!positionValue.current) {
|
|
137
|
+
positionValue.current = new Animated.Value(position)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
141
|
+
const snapPoints = useMemo(() => snapPointsProp, [JSON.stringify(snapPointsProp)])
|
|
142
|
+
|
|
143
|
+
// we can put non-server side hooks after conditional because based on env
|
|
144
|
+
if (isServerSide) {
|
|
145
|
+
return null
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
149
|
+
const spring = useRef<Animated.CompositeAnimation | null>(null)
|
|
150
|
+
|
|
151
|
+
function stopSpring() {
|
|
152
|
+
spring.current?.stop()
|
|
153
|
+
spring.current = null
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
157
|
+
const positions = useMemo(
|
|
158
|
+
() => snapPoints.map((point) => getYForPosition(point, layout)),
|
|
159
|
+
[layout, snapPoints]
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
163
|
+
const animateTo = useCallback(
|
|
164
|
+
(position: number) => {
|
|
165
|
+
if (!positionValue.current) return
|
|
166
|
+
const toValue = positions[position]
|
|
167
|
+
stopSpring()
|
|
168
|
+
spring.current = Animated.spring(positionValue.current, {
|
|
169
|
+
useNativeDriver: !isWeb,
|
|
170
|
+
toValue,
|
|
171
|
+
})
|
|
172
|
+
spring.current.start(({ finished }) => finished && stopSpring())
|
|
173
|
+
},
|
|
174
|
+
[positions]
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
178
|
+
useLayoutEffect(() => {
|
|
179
|
+
animateTo(position)
|
|
180
|
+
}, [position, animateTo])
|
|
181
|
+
|
|
182
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
183
|
+
const panResponder = useMemo(() => {
|
|
184
|
+
if (!layout) return
|
|
185
|
+
console.log('setup pan')
|
|
186
|
+
|
|
187
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
188
|
+
const pos = positionValue.current!
|
|
189
|
+
const minY = positions[0]
|
|
190
|
+
let startY = pos['_value']
|
|
191
|
+
|
|
192
|
+
return PanResponder.create({
|
|
193
|
+
onMoveShouldSetPanResponder: (_e, { dy }) => {
|
|
194
|
+
// we could do some detection of other touchables and cancel here..
|
|
195
|
+
// console.log('wut is', _e)
|
|
196
|
+
return Math.abs(dy) > 6
|
|
197
|
+
},
|
|
198
|
+
onPanResponderGrant: () => {
|
|
199
|
+
stopSpring()
|
|
200
|
+
startY = pos['_value']
|
|
201
|
+
},
|
|
202
|
+
onPanResponderMove: (_e, { dy }) => {
|
|
203
|
+
const to = dy + startY
|
|
204
|
+
pos.setValue(resisted(to, minY))
|
|
205
|
+
},
|
|
206
|
+
onPanResponderRelease: (_e, { vy, dy }) => {
|
|
207
|
+
const at = dy + startY
|
|
208
|
+
// seems liky vy goes up to about 4 at the very most (+ is down, - is up)
|
|
209
|
+
// lets base our multiplier on the total layout height
|
|
210
|
+
const end = at + layout.height * vy * 0.33
|
|
211
|
+
let closestPoint = 0
|
|
212
|
+
let dist = Infinity
|
|
213
|
+
for (let i = 0; i < positions.length; i++) {
|
|
214
|
+
const position = positions[i]
|
|
215
|
+
const curDist = end > position ? end - position : position - end
|
|
216
|
+
if (curDist < dist) {
|
|
217
|
+
dist = curDist
|
|
218
|
+
closestPoint = i
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
// have to call both because state may not change but need to snap back
|
|
222
|
+
setPosition(closestPoint)
|
|
223
|
+
animateTo(closestPoint)
|
|
224
|
+
},
|
|
225
|
+
})
|
|
226
|
+
}, [layout, positions, setPosition])
|
|
227
|
+
|
|
228
|
+
let handleComponent: React.ReactElement | null = null
|
|
229
|
+
let backdropComponent: React.ReactElement | null = null
|
|
230
|
+
let frameComponent: React.ReactElement | null = null
|
|
231
|
+
|
|
232
|
+
React.Children.forEach(childrenProp, (child) => {
|
|
233
|
+
if (isValidElement(child)) {
|
|
234
|
+
switch (child.type?.['staticConfig'].componentName) {
|
|
235
|
+
case 'DrawerHandle':
|
|
236
|
+
handleComponent = child
|
|
237
|
+
break
|
|
238
|
+
case 'DrawerFrame':
|
|
239
|
+
frameComponent = child
|
|
240
|
+
break
|
|
241
|
+
case 'DrawerBackdrop':
|
|
242
|
+
backdropComponent = child
|
|
243
|
+
break
|
|
244
|
+
default:
|
|
245
|
+
console.warn('Warning: passed invalid child to Drawer', child)
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
})
|
|
249
|
+
|
|
250
|
+
return (
|
|
251
|
+
<DrawerProvider
|
|
252
|
+
scope={__scopeDrawer}
|
|
253
|
+
position={position}
|
|
254
|
+
snapPoints={snapPoints}
|
|
255
|
+
setPosition={setPosition}
|
|
256
|
+
>
|
|
257
|
+
{backdropComponent}
|
|
258
|
+
{handleComponent}
|
|
259
|
+
<Animated.View
|
|
260
|
+
{...panResponder?.panHandlers}
|
|
261
|
+
onLayout={(e) => {
|
|
262
|
+
setLayout(e.nativeEvent.layout)
|
|
263
|
+
}}
|
|
264
|
+
style={{
|
|
265
|
+
width: '100%',
|
|
266
|
+
height: '100%',
|
|
267
|
+
transform: [{ translateY: positionValue.current }],
|
|
268
|
+
}}
|
|
269
|
+
>
|
|
270
|
+
{frameComponent}
|
|
271
|
+
</Animated.View>
|
|
272
|
+
</DrawerProvider>
|
|
273
|
+
)
|
|
274
|
+
}),
|
|
275
|
+
{
|
|
276
|
+
componentName: 'Drawer',
|
|
277
|
+
}
|
|
278
|
+
),
|
|
279
|
+
{
|
|
280
|
+
Handle: DrawerHandle,
|
|
281
|
+
Frame: DrawerFrame,
|
|
282
|
+
Backdrop: DrawerBackdrop,
|
|
283
|
+
}
|
|
284
|
+
)
|
|
285
|
+
|
|
286
|
+
function getYForPosition(point?: number, layout?: LayoutRectangle) {
|
|
287
|
+
if (!layout) return 0
|
|
288
|
+
if (point === undefined) {
|
|
289
|
+
console.warn(`No snapPoint`)
|
|
290
|
+
return 0
|
|
291
|
+
}
|
|
292
|
+
const pct = point / 100
|
|
293
|
+
const next = layout.height - pct * layout.height
|
|
294
|
+
return next
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
function resisted(y: number, minY: number, maxOverflow = 25) {
|
|
298
|
+
if (y < minY) {
|
|
299
|
+
const past = minY - y
|
|
300
|
+
const pctPast = Math.min(maxOverflow, past) / maxOverflow
|
|
301
|
+
const diminishBy = 1.1 - Math.pow(0.1, pctPast)
|
|
302
|
+
const extra = -diminishBy * maxOverflow
|
|
303
|
+
return minY + extra
|
|
304
|
+
}
|
|
305
|
+
return y
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export { createDrawerScope }
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Sheet'
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { ScopedProps } from '@tamagui/create-context';
|
|
2
|
+
import { XStackProps } from '@tamagui/stacks';
|
|
3
|
+
import React, { ReactNode } from 'react';
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
declare type PositionChangeHandler = ((position: number) => void) | React.Dispatch<React.SetStateAction<number>>;
|
|
6
|
+
export declare const DrawerHandleFrame: import("@tamagui/core").TamaguiComponent<(Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
|
|
7
|
+
readonly fullscreen?: boolean | undefined;
|
|
8
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
9
|
+
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
|
|
10
|
+
readonly fullscreen?: boolean | undefined;
|
|
11
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
12
|
+
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
|
|
13
|
+
readonly fullscreen?: boolean | undefined;
|
|
14
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
15
|
+
}>>) | (Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
|
|
16
|
+
readonly fullscreen?: boolean | undefined;
|
|
17
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
18
|
+
}, string | number> & {
|
|
19
|
+
[x: string]: undefined;
|
|
20
|
+
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
|
|
21
|
+
readonly fullscreen?: boolean | undefined;
|
|
22
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
23
|
+
}, string | number> & {
|
|
24
|
+
[x: string]: undefined;
|
|
25
|
+
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
|
|
26
|
+
readonly fullscreen?: boolean | undefined;
|
|
27
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
28
|
+
}, string | number> & {
|
|
29
|
+
[x: string]: undefined;
|
|
30
|
+
}>>), any, import("@tamagui/core").StackPropsBase, {
|
|
31
|
+
readonly fullscreen?: boolean | undefined;
|
|
32
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
33
|
+
} & ({} | {
|
|
34
|
+
[x: string]: undefined;
|
|
35
|
+
})>;
|
|
36
|
+
export declare const DrawerHandle: ({ __scopeDrawer, ...props }: ScopedProps<XStackProps, 'Drawer'>) => JSX.Element;
|
|
37
|
+
declare const createDrawerScope: import("@tamagui/create-context").CreateScope;
|
|
38
|
+
export declare const DrawerBackdrop: import("@tamagui/core").TamaguiComponent<(Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
|
|
39
|
+
readonly fullscreen?: boolean | undefined;
|
|
40
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
41
|
+
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
|
|
42
|
+
readonly fullscreen?: boolean | undefined;
|
|
43
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
44
|
+
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
|
|
45
|
+
readonly fullscreen?: boolean | undefined;
|
|
46
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
47
|
+
}>>) | (Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
|
|
48
|
+
readonly fullscreen?: boolean | undefined;
|
|
49
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
50
|
+
}, string | number> & {
|
|
51
|
+
[x: string]: undefined;
|
|
52
|
+
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
|
|
53
|
+
readonly fullscreen?: boolean | undefined;
|
|
54
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
55
|
+
}, string | number> & {
|
|
56
|
+
[x: string]: undefined;
|
|
57
|
+
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
|
|
58
|
+
readonly fullscreen?: boolean | undefined;
|
|
59
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
60
|
+
}, string | number> & {
|
|
61
|
+
[x: string]: undefined;
|
|
62
|
+
}>>), any, import("@tamagui/core").StackPropsBase, {
|
|
63
|
+
readonly fullscreen?: boolean | undefined;
|
|
64
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
65
|
+
} & ({} | {
|
|
66
|
+
[x: string]: undefined;
|
|
67
|
+
})>;
|
|
68
|
+
export declare const DrawerFrame: import("@tamagui/core").TamaguiComponent<(Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
|
|
69
|
+
readonly fullscreen?: boolean | undefined;
|
|
70
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
71
|
+
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
|
|
72
|
+
readonly fullscreen?: boolean | undefined;
|
|
73
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
74
|
+
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
|
|
75
|
+
readonly fullscreen?: boolean | undefined;
|
|
76
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
77
|
+
}>>) | (Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
|
|
78
|
+
readonly fullscreen?: boolean | undefined;
|
|
79
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
80
|
+
}, string | number> & {
|
|
81
|
+
[x: string]: undefined;
|
|
82
|
+
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
|
|
83
|
+
readonly fullscreen?: boolean | undefined;
|
|
84
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
85
|
+
}, string | number> & {
|
|
86
|
+
[x: string]: undefined;
|
|
87
|
+
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
|
|
88
|
+
readonly fullscreen?: boolean | undefined;
|
|
89
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
90
|
+
}, string | number> & {
|
|
91
|
+
[x: string]: undefined;
|
|
92
|
+
}>>), any, import("@tamagui/core").StackPropsBase, {
|
|
93
|
+
readonly fullscreen?: boolean | undefined;
|
|
94
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
95
|
+
} & ({} | {
|
|
96
|
+
[x: string]: undefined;
|
|
97
|
+
})>;
|
|
98
|
+
export declare type DrawerProps = ScopedProps<{
|
|
99
|
+
open?: boolean;
|
|
100
|
+
defaultOpen?: boolean;
|
|
101
|
+
defaultPosition?: number;
|
|
102
|
+
snapPoints?: number[];
|
|
103
|
+
position?: number;
|
|
104
|
+
onChangePosition?: PositionChangeHandler;
|
|
105
|
+
children?: ReactNode;
|
|
106
|
+
}, 'Drawer'>;
|
|
107
|
+
export declare const Drawer: ((props: Omit<{
|
|
108
|
+
open?: boolean | undefined;
|
|
109
|
+
defaultOpen?: boolean | undefined;
|
|
110
|
+
defaultPosition?: number | undefined;
|
|
111
|
+
snapPoints?: number[] | undefined;
|
|
112
|
+
position?: number | undefined;
|
|
113
|
+
onChangePosition?: PositionChangeHandler | undefined;
|
|
114
|
+
children?: ReactNode;
|
|
115
|
+
} & {
|
|
116
|
+
__scopeDrawer?: import("@tamagui/create-context").Scope<any>;
|
|
117
|
+
} & React.RefAttributes<View>, "theme" | "themeInverse"> & {
|
|
118
|
+
theme?: import("@tamagui/core").ThemeName | null | undefined;
|
|
119
|
+
themeInverse?: boolean | undefined;
|
|
120
|
+
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & {
|
|
121
|
+
Handle: ({ __scopeDrawer, ...props }: ScopedProps<XStackProps, 'Drawer'>) => JSX.Element;
|
|
122
|
+
Frame: import("@tamagui/core").TamaguiComponent<(Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
|
|
123
|
+
readonly fullscreen?: boolean | undefined;
|
|
124
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
125
|
+
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
|
|
126
|
+
readonly fullscreen?: boolean | undefined;
|
|
127
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
128
|
+
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
|
|
129
|
+
readonly fullscreen?: boolean | undefined;
|
|
130
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
131
|
+
}>>) | (Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
|
|
132
|
+
readonly fullscreen?: boolean | undefined;
|
|
133
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
134
|
+
}, string | number> & {
|
|
135
|
+
[x: string]: undefined;
|
|
136
|
+
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
|
|
137
|
+
readonly fullscreen?: boolean | undefined;
|
|
138
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
139
|
+
}, string | number> & {
|
|
140
|
+
[x: string]: undefined;
|
|
141
|
+
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
|
|
142
|
+
readonly fullscreen?: boolean | undefined;
|
|
143
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
144
|
+
}, string | number> & {
|
|
145
|
+
[x: string]: undefined;
|
|
146
|
+
}>>), any, import("@tamagui/core").StackPropsBase, {
|
|
147
|
+
readonly fullscreen?: boolean | undefined;
|
|
148
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
149
|
+
} & ({} | {
|
|
150
|
+
[x: string]: undefined;
|
|
151
|
+
})>;
|
|
152
|
+
Backdrop: import("@tamagui/core").TamaguiComponent<(Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
|
|
153
|
+
readonly fullscreen?: boolean | undefined;
|
|
154
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
155
|
+
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
|
|
156
|
+
readonly fullscreen?: boolean | undefined;
|
|
157
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
158
|
+
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
|
|
159
|
+
readonly fullscreen?: boolean | undefined;
|
|
160
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
161
|
+
}>>) | (Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
|
|
162
|
+
readonly fullscreen?: boolean | undefined;
|
|
163
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
164
|
+
}, string | number> & {
|
|
165
|
+
[x: string]: undefined;
|
|
166
|
+
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
|
|
167
|
+
readonly fullscreen?: boolean | undefined;
|
|
168
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
169
|
+
}, string | number> & {
|
|
170
|
+
[x: string]: undefined;
|
|
171
|
+
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
|
|
172
|
+
readonly fullscreen?: boolean | undefined;
|
|
173
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
174
|
+
}, string | number> & {
|
|
175
|
+
[x: string]: undefined;
|
|
176
|
+
}>>), any, import("@tamagui/core").StackPropsBase, {
|
|
177
|
+
readonly fullscreen?: boolean | undefined;
|
|
178
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
179
|
+
} & ({} | {
|
|
180
|
+
[x: string]: undefined;
|
|
181
|
+
})>;
|
|
182
|
+
};
|
|
183
|
+
export { createDrawerScope };
|
|
184
|
+
//# sourceMappingURL=Drawer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../src/Drawer.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAsB,MAAM,yBAAyB,CAAA;AACzE,OAAO,EAAU,WAAW,EAAU,MAAM,iBAAiB,CAAA;AAE7D,OAAO,KAAK,EAAE,EACZ,SAAS,EASV,MAAM,OAAO,CAAA;AACd,OAAO,EAA2C,IAAI,EAAE,MAAM,cAAc,CAAA;AAE5E,aAAK,qBAAqB,GACtB,CAAC,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC,GAC5B,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAA;AAKhD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiB5B,CAAA;AAEF,eAAO,MAAM,YAAY,gCACO,YAAY,WAAW,EAAE,QAAQ,CAAC,gBAajE,CAAA;AAQD,QAAA,MAA4B,iBAAiB,+CAAmC,CAAA;AAMhF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAKzB,CAAA;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQtB,CAAA;AAEF,oBAAY,WAAW,GAAG,WAAW,CACnC;IACE,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,gBAAgB,CAAC,EAAE,qBAAqB,CAAA;IACxC,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB,EACD,QAAQ,CACT,CAAA;AAYD,eAAO,MAAM,MAAM;;;;;;;eAfJ,SAAS;;;;;;;0CApDQ,YAAY,WAAW,EAAE,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+OjE,CAAA;AAwBD,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
|