mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
1import React from 'react'
2import {GestureResponderEvent, PressableProps} from 'react-native'
3
4import {Props as SVGIconProps} from '#/components/icons/common'
5import * as Dialog from '#/components/Dialog'
6import {TextStyleProp, ViewStyleProp} from '#/alf'
7
8export type ContextType = {
9 control: Dialog.DialogOuterProps['control']
10}
11
12export type TriggerProps = ViewStyleProp & {
13 children(props: TriggerChildProps): React.ReactNode
14 label: string
15}
16export type TriggerChildProps =
17 | {
18 isNative: true
19 control: Dialog.DialogOuterProps['control']
20 state: {
21 /**
22 * Web only, `false` on native
23 */
24 hovered: false
25 focused: boolean
26 pressed: boolean
27 }
28 /**
29 * We don't necessarily know what these will be spread on to, so we
30 * should add props one-by-one.
31 *
32 * On web, these properties are applied to a parent `Pressable`, so this
33 * object is empty.
34 */
35 props: {
36 onPress: () => void
37 onFocus: () => void
38 onBlur: () => void
39 onPressIn: () => void
40 onPressOut: () => void
41 accessibilityLabel: string
42 }
43 }
44 | {
45 isNative: false
46 control: Dialog.DialogOuterProps['control']
47 state: {
48 hovered: boolean
49 focused: boolean
50 /**
51 * Native only, `false` on web
52 */
53 pressed: false
54 }
55 props: {}
56 }
57
58export type ItemProps = React.PropsWithChildren<
59 Omit<PressableProps, 'style'> &
60 ViewStyleProp & {
61 label: string
62 onPress: (e: GestureResponderEvent) => void
63 }
64>
65
66export type ItemTextProps = React.PropsWithChildren<TextStyleProp & {}>
67export type ItemIconProps = React.PropsWithChildren<{
68 icon: React.ComponentType<SVGIconProps>
69 position?: 'left' | 'right'
70}>
71
72export type GroupProps = React.PropsWithChildren<ViewStyleProp & {}>