@react-aria/interactions 3.0.0-nightly.1663 → 3.0.0-nightly.1675
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/main.js.map +1 -1
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +44 -43
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +12 -5
- package/src/useFocus.ts +2 -2
- package/src/useFocusVisible.ts +3 -3
- package/src/useFocusWithin.ts +2 -2
- package/src/useHover.ts +1 -1
- package/src/useInteractOutside.ts +1 -1
- package/src/useKeyboard.ts +1 -1
- package/src/useLongPress.ts +2 -2
- package/src/useMove.ts +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -1,31 +1,5 @@
|
|
|
1
|
-
import { DOMAttributes,
|
|
1
|
+
import { DOMAttributes, PressEvents, FocusableElement, FocusEvents, HoverEvents, KeyboardEvents, MoveEvents, ScrollEvents, LongPressEvent } from "@react-types/shared";
|
|
2
2
|
import React, { RefObject, ReactElement, ReactNode, FocusEvent, SyntheticEvent } from "react";
|
|
3
|
-
export interface HoverProps extends HoverEvents {
|
|
4
|
-
/** Whether the hover events should be disabled. */
|
|
5
|
-
isDisabled?: boolean;
|
|
6
|
-
}
|
|
7
|
-
interface HoverResult {
|
|
8
|
-
/** Props to spread on the target element. */
|
|
9
|
-
hoverProps: DOMAttributes;
|
|
10
|
-
isHovered: boolean;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Handles pointer hover interactions for an element. Normalizes behavior
|
|
14
|
-
* across browsers and platforms, and ignores emulated mouse events on touch devices.
|
|
15
|
-
*/
|
|
16
|
-
export function useHover(props: HoverProps): HoverResult;
|
|
17
|
-
export interface KeyboardProps extends KeyboardEvents {
|
|
18
|
-
/** Whether the keyboard events should be disabled. */
|
|
19
|
-
isDisabled?: boolean;
|
|
20
|
-
}
|
|
21
|
-
interface KeyboardResult {
|
|
22
|
-
/** Props to spread onto the target element. */
|
|
23
|
-
keyboardProps: DOMAttributes;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Handles keyboard interactions for a focusable element.
|
|
27
|
-
*/
|
|
28
|
-
export function useKeyboard(props: KeyboardProps): KeyboardResult;
|
|
29
3
|
export interface PressProps extends PressEvents {
|
|
30
4
|
/** Whether the target is in a controlled press state (e.g. an overlay it triggers is open). */
|
|
31
5
|
isPressed?: boolean;
|
|
@@ -59,11 +33,6 @@ export interface PressResult {
|
|
|
59
33
|
* of dealing with pointer and keyboard events.
|
|
60
34
|
*/
|
|
61
35
|
export function usePress(props: PressHookProps): PressResult;
|
|
62
|
-
export interface ScrollWheelProps extends ScrollEvents {
|
|
63
|
-
/** Whether the scroll listener should be disabled. */
|
|
64
|
-
isDisabled?: boolean;
|
|
65
|
-
}
|
|
66
|
-
export function useScrollWheel(props: ScrollWheelProps, ref: RefObject<HTMLElement>): void;
|
|
67
36
|
interface PressableProps extends PressProps {
|
|
68
37
|
children: ReactElement<DOMAttributes, string>;
|
|
69
38
|
}
|
|
@@ -72,11 +41,11 @@ interface PressResponderProps extends PressProps {
|
|
|
72
41
|
children: ReactNode;
|
|
73
42
|
}
|
|
74
43
|
export const PressResponder: React.ForwardRefExoticComponent<PressResponderProps & React.RefAttributes<FocusableElement>>;
|
|
75
|
-
interface FocusProps extends FocusEvents {
|
|
44
|
+
export interface FocusProps extends FocusEvents {
|
|
76
45
|
/** Whether the focus events should be disabled. */
|
|
77
46
|
isDisabled?: boolean;
|
|
78
47
|
}
|
|
79
|
-
interface FocusResult {
|
|
48
|
+
export interface FocusResult {
|
|
80
49
|
/** Props to spread onto the target element. */
|
|
81
50
|
focusProps: DOMAttributes;
|
|
82
51
|
}
|
|
@@ -85,15 +54,15 @@ interface FocusResult {
|
|
|
85
54
|
* Focus events on child elements will be ignored.
|
|
86
55
|
*/
|
|
87
56
|
export function useFocus(props: FocusProps): FocusResult;
|
|
88
|
-
type Modality = 'keyboard' | 'pointer' | 'virtual';
|
|
89
|
-
type FocusVisibleHandler = (isFocusVisible: boolean) => void;
|
|
57
|
+
export type Modality = 'keyboard' | 'pointer' | 'virtual';
|
|
58
|
+
export type FocusVisibleHandler = (isFocusVisible: boolean) => void;
|
|
90
59
|
interface FocusVisibleProps {
|
|
91
60
|
/** Whether the element is a text input. */
|
|
92
61
|
isTextInput?: boolean;
|
|
93
62
|
/** Whether the element will be auto focused. */
|
|
94
63
|
autoFocus?: boolean;
|
|
95
64
|
}
|
|
96
|
-
interface FocusVisibleResult {
|
|
65
|
+
export interface FocusVisibleResult {
|
|
97
66
|
/** Whether keyboard focus is visible globally. */
|
|
98
67
|
isFocusVisible: boolean;
|
|
99
68
|
}
|
|
@@ -117,7 +86,7 @@ export function useFocusVisible(props?: FocusVisibleProps): FocusVisibleResult;
|
|
|
117
86
|
export function useFocusVisibleListener(fn: FocusVisibleHandler, deps: ReadonlyArray<any>, opts?: {
|
|
118
87
|
isTextInput?: boolean;
|
|
119
88
|
}): void;
|
|
120
|
-
interface FocusWithinProps {
|
|
89
|
+
export interface FocusWithinProps {
|
|
121
90
|
/** Whether the focus within events should be disabled. */
|
|
122
91
|
isDisabled?: boolean;
|
|
123
92
|
/** Handler that is called when the target element or a descendant receives focus. */
|
|
@@ -127,7 +96,7 @@ interface FocusWithinProps {
|
|
|
127
96
|
/** Handler that is called when the the focus within state changes. */
|
|
128
97
|
onFocusWithinChange?: (isFocusWithin: boolean) => void;
|
|
129
98
|
}
|
|
130
|
-
interface FocusWithinResult {
|
|
99
|
+
export interface FocusWithinResult {
|
|
131
100
|
/** Props to spread onto the target element. */
|
|
132
101
|
focusWithinProps: DOMAttributes;
|
|
133
102
|
}
|
|
@@ -135,7 +104,21 @@ interface FocusWithinResult {
|
|
|
135
104
|
* Handles focus events for the target and its descendants.
|
|
136
105
|
*/
|
|
137
106
|
export function useFocusWithin(props: FocusWithinProps): FocusWithinResult;
|
|
138
|
-
interface
|
|
107
|
+
export interface HoverProps extends HoverEvents {
|
|
108
|
+
/** Whether the hover events should be disabled. */
|
|
109
|
+
isDisabled?: boolean;
|
|
110
|
+
}
|
|
111
|
+
export interface HoverResult {
|
|
112
|
+
/** Props to spread on the target element. */
|
|
113
|
+
hoverProps: DOMAttributes;
|
|
114
|
+
isHovered: boolean;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Handles pointer hover interactions for an element. Normalizes behavior
|
|
118
|
+
* across browsers and platforms, and ignores emulated mouse events on touch devices.
|
|
119
|
+
*/
|
|
120
|
+
export function useHover(props: HoverProps): HoverResult;
|
|
121
|
+
export interface InteractOutsideProps {
|
|
139
122
|
ref: RefObject<Element>;
|
|
140
123
|
onInteractOutside?: (e: SyntheticEvent) => void;
|
|
141
124
|
onInteractOutsideStart?: (e: SyntheticEvent) => void;
|
|
@@ -147,7 +130,19 @@ interface InteractOutsideProps {
|
|
|
147
130
|
* when a user clicks outside them.
|
|
148
131
|
*/
|
|
149
132
|
export function useInteractOutside(props: InteractOutsideProps): void;
|
|
150
|
-
interface
|
|
133
|
+
export interface KeyboardProps extends KeyboardEvents {
|
|
134
|
+
/** Whether the keyboard events should be disabled. */
|
|
135
|
+
isDisabled?: boolean;
|
|
136
|
+
}
|
|
137
|
+
export interface KeyboardResult {
|
|
138
|
+
/** Props to spread onto the target element. */
|
|
139
|
+
keyboardProps: DOMAttributes;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Handles keyboard interactions for a focusable element.
|
|
143
|
+
*/
|
|
144
|
+
export function useKeyboard(props: KeyboardProps): KeyboardResult;
|
|
145
|
+
export interface MoveResult {
|
|
151
146
|
/** Props to spread on the target element. */
|
|
152
147
|
moveProps: DOMAttributes;
|
|
153
148
|
}
|
|
@@ -157,7 +152,12 @@ interface MoveResult {
|
|
|
157
152
|
* platforms, and ignores emulated mouse events on touch devices.
|
|
158
153
|
*/
|
|
159
154
|
export function useMove(props: MoveEvents): MoveResult;
|
|
160
|
-
interface
|
|
155
|
+
export interface ScrollWheelProps extends ScrollEvents {
|
|
156
|
+
/** Whether the scroll listener should be disabled. */
|
|
157
|
+
isDisabled?: boolean;
|
|
158
|
+
}
|
|
159
|
+
export function useScrollWheel(props: ScrollWheelProps, ref: RefObject<HTMLElement>): void;
|
|
160
|
+
export interface LongPressProps {
|
|
161
161
|
/** Whether long press events should be disabled. */
|
|
162
162
|
isDisabled?: boolean;
|
|
163
163
|
/** Handler that is called when a long press interaction starts. */
|
|
@@ -183,7 +183,7 @@ interface LongPressProps {
|
|
|
183
183
|
*/
|
|
184
184
|
accessibilityDescription?: string;
|
|
185
185
|
}
|
|
186
|
-
interface LongPressResult {
|
|
186
|
+
export interface LongPressResult {
|
|
187
187
|
/** Props to spread on the target element. */
|
|
188
188
|
longPressProps: DOMAttributes;
|
|
189
189
|
}
|
|
@@ -192,5 +192,6 @@ interface LongPressResult {
|
|
|
192
192
|
* accessibility description, and normalizes behavior across browsers and devices.
|
|
193
193
|
*/
|
|
194
194
|
export function useLongPress(props: LongPressProps): LongPressResult;
|
|
195
|
+
export type { MoveEvents } from '@react-types/shared';
|
|
195
196
|
|
|
196
197
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;
|
|
1
|
+
{"mappings":";;AGwBA,2BAA4B,SAAQ,WAAW;IAC7C,+FAA+F;IAC/F,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mDAAmD;IACnD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4DAA4D;IAC5D,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;;OAKG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,yEAAyE;IACzE,yBAAyB,CAAC,EAAE,OAAO,CAAA;CACpC;AAED,+BAAgC,SAAQ,UAAU;IAChD,mCAAmC;IACnC,GAAG,CAAC,EAAE,UAAU,OAAO,CAAC,CAAA;CACzB;AAsBD;IACE,+CAA+C;IAC/C,SAAS,EAAE,OAAO,C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H,wBAAwB,KAAK,EAAE,UAAU,GAAG,UAAU,CAkMrD;ACpND,iCAAkC,SAAQ,YAAY;IACpD,sDAAsD;IACtD,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAGD,+BAA+B,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,UAAU,WAAW,CAAC,GAAG,IAAI,CAkBzF;ACvBD;IACE,oDAAoD;IACpD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mEAAmE;IACnE,gBAAgB,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAC/C;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7C;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAC1C;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAA;CAClC;AAED;IACE,6CAA6C;IAC7C,cAAc,EAAE,aAAa,CAAA;CAC9B;AAID;;;GAGG;AACH,6BAA6B,KAAK,EAAE,cAAc,GAAG,eAAe,CAwEnE;ACxFD,YAAY,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC","sources":["packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/textSelection.ts","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/utils.ts","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/context.ts","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/usePress.ts","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/Pressable.tsx","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/PressResponder.tsx","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/useFocus.ts","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/useFocusVisible.ts","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/useFocusWithin.ts","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/useHover.ts","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/useInteractOutside.ts","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/createEventHandler.ts","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/useKeyboard.ts","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/useMove.ts","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/useScrollWheel.ts","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/useLongPress.ts","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/index.ts","packages/@react-aria/interactions/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {Pressable} from './Pressable';\nexport {PressResponder} from './PressResponder';\nexport {useFocus} from './useFocus';\nexport {\n isFocusVisible,\n getInteractionModality,\n setInteractionModality,\n useInteractionModality,\n useFocusVisible,\n useFocusVisibleListener\n} from './useFocusVisible';\nexport {useFocusWithin} from './useFocusWithin';\nexport {useHover} from './useHover';\nexport {useInteractOutside} from './useInteractOutside';\nexport {useKeyboard} from './useKeyboard';\nexport {useMove} from './useMove';\nexport {usePress} from './usePress';\nexport {useScrollWheel} from './useScrollWheel';\nexport {useLongPress} from './useLongPress';\n\nexport type {FocusProps, FocusResult} from './useFocus';\nexport type {FocusVisibleHandler, FocusVisibleResult, Modality} from './useFocusVisible';\nexport type {FocusWithinProps, FocusWithinResult} from './useFocusWithin';\nexport type {HoverProps, HoverResult} from './useHover';\nexport type {InteractOutsideProps} from './useInteractOutside';\nexport type {KeyboardProps, KeyboardResult} from './useKeyboard';\nexport type {PressProps, PressHookProps, PressResult} from './usePress';\nexport type {MoveEvents} from '@react-types/shared';\nexport type {MoveResult} from './useMove';\nexport type {LongPressProps, LongPressResult} from './useLongPress';\nexport type {ScrollWheelProps} from './useScrollWheel';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/interactions",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.1675+7cebb4eea",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@babel/runtime": "^7.6.2",
|
|
21
|
-
"@react-aria/utils": "3.0.0-nightly.
|
|
22
|
-
"@react-types/shared": "3.0.0-nightly.
|
|
21
|
+
"@react-aria/utils": "3.0.0-nightly.1675+7cebb4eea",
|
|
22
|
+
"@react-types/shared": "3.0.0-nightly.1675+7cebb4eea"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0"
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "7cebb4eea31f383f1eec06cc53a7909f8736f66a"
|
|
31
31
|
}
|
package/src/index.ts
CHANGED
|
@@ -10,11 +10,6 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
export type {HoverProps} from './useHover';
|
|
14
|
-
export type {KeyboardProps} from './useKeyboard';
|
|
15
|
-
export type {PressProps, PressHookProps, PressResult} from './usePress';
|
|
16
|
-
export type {ScrollWheelProps} from './useScrollWheel';
|
|
17
|
-
|
|
18
13
|
export {Pressable} from './Pressable';
|
|
19
14
|
export {PressResponder} from './PressResponder';
|
|
20
15
|
export {useFocus} from './useFocus';
|
|
@@ -34,3 +29,15 @@ export {useMove} from './useMove';
|
|
|
34
29
|
export {usePress} from './usePress';
|
|
35
30
|
export {useScrollWheel} from './useScrollWheel';
|
|
36
31
|
export {useLongPress} from './useLongPress';
|
|
32
|
+
|
|
33
|
+
export type {FocusProps, FocusResult} from './useFocus';
|
|
34
|
+
export type {FocusVisibleHandler, FocusVisibleResult, Modality} from './useFocusVisible';
|
|
35
|
+
export type {FocusWithinProps, FocusWithinResult} from './useFocusWithin';
|
|
36
|
+
export type {HoverProps, HoverResult} from './useHover';
|
|
37
|
+
export type {InteractOutsideProps} from './useInteractOutside';
|
|
38
|
+
export type {KeyboardProps, KeyboardResult} from './useKeyboard';
|
|
39
|
+
export type {PressProps, PressHookProps, PressResult} from './usePress';
|
|
40
|
+
export type {MoveEvents} from '@react-types/shared';
|
|
41
|
+
export type {MoveResult} from './useMove';
|
|
42
|
+
export type {LongPressProps, LongPressResult} from './useLongPress';
|
|
43
|
+
export type {ScrollWheelProps} from './useScrollWheel';
|
package/src/useFocus.ts
CHANGED
|
@@ -19,12 +19,12 @@ import {DOMAttributes, FocusEvents} from '@react-types/shared';
|
|
|
19
19
|
import {FocusEvent, useCallback} from 'react';
|
|
20
20
|
import {useSyntheticBlurEvent} from './utils';
|
|
21
21
|
|
|
22
|
-
interface FocusProps extends FocusEvents {
|
|
22
|
+
export interface FocusProps extends FocusEvents {
|
|
23
23
|
/** Whether the focus events should be disabled. */
|
|
24
24
|
isDisabled?: boolean
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
interface FocusResult {
|
|
27
|
+
export interface FocusResult {
|
|
28
28
|
/** Props to spread onto the target element. */
|
|
29
29
|
focusProps: DOMAttributes
|
|
30
30
|
}
|
package/src/useFocusVisible.ts
CHANGED
|
@@ -19,10 +19,10 @@ import {isMac} from '@react-aria/utils';
|
|
|
19
19
|
import {isVirtualClick} from './utils';
|
|
20
20
|
import {useEffect, useState} from 'react';
|
|
21
21
|
|
|
22
|
-
type Modality = 'keyboard' | 'pointer' | 'virtual';
|
|
22
|
+
export type Modality = 'keyboard' | 'pointer' | 'virtual';
|
|
23
23
|
type HandlerEvent = PointerEvent | MouseEvent | KeyboardEvent | FocusEvent;
|
|
24
24
|
type Handler = (modality: Modality, e: HandlerEvent) => void;
|
|
25
|
-
type FocusVisibleHandler = (isFocusVisible: boolean) => void;
|
|
25
|
+
export type FocusVisibleHandler = (isFocusVisible: boolean) => void;
|
|
26
26
|
interface FocusVisibleProps {
|
|
27
27
|
/** Whether the element is a text input. */
|
|
28
28
|
isTextInput?: boolean,
|
|
@@ -30,7 +30,7 @@ interface FocusVisibleProps {
|
|
|
30
30
|
autoFocus?: boolean
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
interface FocusVisibleResult {
|
|
33
|
+
export interface FocusVisibleResult {
|
|
34
34
|
/** Whether keyboard focus is visible globally. */
|
|
35
35
|
isFocusVisible: boolean
|
|
36
36
|
}
|
package/src/useFocusWithin.ts
CHANGED
|
@@ -19,7 +19,7 @@ import {DOMAttributes} from '@react-types/shared';
|
|
|
19
19
|
import {FocusEvent, useCallback, useRef} from 'react';
|
|
20
20
|
import {useSyntheticBlurEvent} from './utils';
|
|
21
21
|
|
|
22
|
-
interface FocusWithinProps {
|
|
22
|
+
export interface FocusWithinProps {
|
|
23
23
|
/** Whether the focus within events should be disabled. */
|
|
24
24
|
isDisabled?: boolean,
|
|
25
25
|
/** Handler that is called when the target element or a descendant receives focus. */
|
|
@@ -30,7 +30,7 @@ interface FocusWithinProps {
|
|
|
30
30
|
onFocusWithinChange?: (isFocusWithin: boolean) => void
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
interface FocusWithinResult {
|
|
33
|
+
export interface FocusWithinResult {
|
|
34
34
|
/** Props to spread onto the target element. */
|
|
35
35
|
focusWithinProps: DOMAttributes
|
|
36
36
|
}
|
package/src/useHover.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
import {RefObject, SyntheticEvent, useEffect, useRef} from 'react';
|
|
19
19
|
|
|
20
|
-
interface InteractOutsideProps {
|
|
20
|
+
export interface InteractOutsideProps {
|
|
21
21
|
ref: RefObject<Element>,
|
|
22
22
|
onInteractOutside?: (e: SyntheticEvent) => void,
|
|
23
23
|
onInteractOutsideStart?: (e: SyntheticEvent) => void,
|
package/src/useKeyboard.ts
CHANGED
package/src/useLongPress.ts
CHANGED
|
@@ -15,7 +15,7 @@ import {mergeProps, useDescription, useGlobalListeners} from '@react-aria/utils'
|
|
|
15
15
|
import {usePress} from './usePress';
|
|
16
16
|
import {useRef} from 'react';
|
|
17
17
|
|
|
18
|
-
interface LongPressProps {
|
|
18
|
+
export interface LongPressProps {
|
|
19
19
|
/** Whether long press events should be disabled. */
|
|
20
20
|
isDisabled?: boolean,
|
|
21
21
|
/** Handler that is called when a long press interaction starts. */
|
|
@@ -42,7 +42,7 @@ interface LongPressProps {
|
|
|
42
42
|
accessibilityDescription?: string
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
interface LongPressResult {
|
|
45
|
+
export interface LongPressResult {
|
|
46
46
|
/** Props to spread on the target element. */
|
|
47
47
|
longPressProps: DOMAttributes
|
|
48
48
|
}
|
package/src/useMove.ts
CHANGED
|
@@ -15,7 +15,7 @@ import {DOMAttributes, MoveEvents, PointerType} from '@react-types/shared';
|
|
|
15
15
|
import React, {useMemo, useRef} from 'react';
|
|
16
16
|
import {useGlobalListeners} from '@react-aria/utils';
|
|
17
17
|
|
|
18
|
-
interface MoveResult {
|
|
18
|
+
export interface MoveResult {
|
|
19
19
|
/** Props to spread on the target element. */
|
|
20
20
|
moveProps: DOMAttributes
|
|
21
21
|
}
|