about summary refs log tree commit diff
path: root/src/components/Menu/types.ts
diff options
context:
space:
mode:
authorMinseo Lee <itoupluk427@gmail.com>2024-03-13 10:30:07 +0900
committerGitHub <noreply@github.com>2024-03-13 10:30:07 +0900
commit3ead08ab2649533583c300904bbd85c250292014 (patch)
tree48366b4d1d847eb59f0187520d2c5fb4150bba3c /src/components/Menu/types.ts
parent2456ca828fc4ba05a085fa03c6f7c37b3edcd45e (diff)
parent653240bc056236489e8a7882b7b6f902ed0885c2 (diff)
downloadvoidsky-3ead08ab2649533583c300904bbd85c250292014.tar.zst
Merge branch 'bluesky-social:main' into patch-3
Diffstat (limited to 'src/components/Menu/types.ts')
-rw-r--r--src/components/Menu/types.ts33
1 files changed, 30 insertions, 3 deletions
diff --git a/src/components/Menu/types.ts b/src/components/Menu/types.ts
index 2f52e6390..e710971ee 100644
--- a/src/components/Menu/types.ts
+++ b/src/components/Menu/types.ts
@@ -1,5 +1,9 @@
 import React from 'react'
-import {GestureResponderEvent, PressableProps} from 'react-native'
+import {
+  GestureResponderEvent,
+  PressableProps,
+  AccessibilityProps,
+} from 'react-native'
 
 import {Props as SVGIconProps} from '#/components/icons/common'
 import * as Dialog from '#/components/Dialog'
@@ -9,7 +13,23 @@ export type ContextType = {
   control: Dialog.DialogOuterProps['control']
 }
 
-export type TriggerProps = ViewStyleProp & {
+export type RadixPassThroughTriggerProps = {
+  id: string
+  type: 'button'
+  disabled: boolean
+  ['data-disabled']: boolean
+  ['data-state']: string
+  ['aria-controls']?: string
+  ['aria-haspopup']?: boolean
+  ['aria-expanded']?: AccessibilityProps['aria-expanded']
+  onKeyDown: (e: React.KeyboardEvent) => void
+  /**
+   * Radix provides this, but we override on web to use `onPress` instead,
+   * which is less sensitive while scrolling.
+   */
+  onPointerDown: PressableProps['onPointerDown']
+}
+export type TriggerProps = {
   children(props: TriggerChildProps): React.ReactNode
   label: string
 }
@@ -52,7 +72,14 @@ export type TriggerChildProps =
          */
         pressed: false
       }
-      props: {}
+      props: RadixPassThroughTriggerProps & {
+        onPress: () => void
+        onFocus: () => void
+        onBlur: () => void
+        onMouseEnter: () => void
+        onMouseLeave: () => void
+        accessibilityLabel: string
+      }
     }
 
 export type ItemProps = React.PropsWithChildren<