about summary refs log tree commit diff
path: root/src/components/Menu/types.ts
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2024-03-12 11:23:01 -0500
committerGitHub <noreply@github.com>2024-03-12 11:23:01 -0500
commitb8afb935f4eafbe64e83512ec5a97bb7b38a6ecb (patch)
treeaabbd870c4242ed08ced359fe1e1539db476285e /src/components/Menu/types.ts
parent17d921fd9d885972d72450abbd539946d7078cf9 (diff)
downloadvoidsky-b8afb935f4eafbe64e83512ec5a97bb7b38a6ecb.tar.zst
Unwrap Menu.Trigger on web (#3182)
Diffstat (limited to 'src/components/Menu/types.ts')
-rw-r--r--src/components/Menu/types.ts28
1 files changed, 25 insertions, 3 deletions
diff --git a/src/components/Menu/types.ts b/src/components/Menu/types.ts
index 2f52e6390..7d04a3344 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,19 @@ 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
+  onPointerDown: PressableProps['onPointerDown']
+}
+export type TriggerProps = {
   children(props: TriggerChildProps): React.ReactNode
   label: string
 }
@@ -52,7 +68,13 @@ export type TriggerChildProps =
          */
         pressed: false
       }
-      props: {}
+      props: RadixPassThroughTriggerProps & {
+        onFocus: () => void
+        onBlur: () => void
+        onMouseEnter: () => void
+        onMouseLeave: () => void
+        accessibilityLabel: string
+      }
     }
 
 export type ItemProps = React.PropsWithChildren<