@tamagui/roving-focus 1.74.8 → 1.74.9
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/package.json +9 -9
- package/dist/esm/RovingFocusGroup.mjs +0 -192
- package/dist/esm/RovingFocusGroup.mjs.map +0 -6
- package/dist/esm/RovingFocusGroup.native.mjs +0 -20
- package/dist/esm/RovingFocusGroup.native.mjs.map +0 -6
- package/dist/esm/index.mjs +0 -2
- package/dist/esm/index.mjs.map +0 -6
- package/dist/jsx/RovingFocusGroup.mjs +0 -227
- package/dist/jsx/RovingFocusGroup.mjs.map +0 -6
- package/dist/jsx/RovingFocusGroup.native.mjs +0 -19
- package/dist/jsx/RovingFocusGroup.native.mjs.map +0 -6
- package/dist/jsx/index.mjs +0 -2
- package/dist/jsx/index.mjs.map +0 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/roving-focus",
|
|
3
|
-
"version": "1.74.
|
|
3
|
+
"version": "1.74.9",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"*.css"
|
|
6
6
|
],
|
|
@@ -31,19 +31,19 @@
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@tamagui/collection": "1.74.
|
|
35
|
-
"@tamagui/compose-refs": "1.74.
|
|
36
|
-
"@tamagui/core": "1.74.
|
|
37
|
-
"@tamagui/create-context": "1.74.
|
|
38
|
-
"@tamagui/use-controllable-state": "1.74.
|
|
39
|
-
"@tamagui/use-direction": "1.74.
|
|
40
|
-
"@tamagui/use-event": "1.74.
|
|
34
|
+
"@tamagui/collection": "1.74.9",
|
|
35
|
+
"@tamagui/compose-refs": "1.74.9",
|
|
36
|
+
"@tamagui/core": "1.74.9",
|
|
37
|
+
"@tamagui/create-context": "1.74.9",
|
|
38
|
+
"@tamagui/use-controllable-state": "1.74.9",
|
|
39
|
+
"@tamagui/use-direction": "1.74.9",
|
|
40
|
+
"@tamagui/use-event": "1.74.9"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"react": "*"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@tamagui/build": "1.74.
|
|
46
|
+
"@tamagui/build": "1.74.9",
|
|
47
47
|
"react": "^18.2.0"
|
|
48
48
|
},
|
|
49
49
|
"publishConfig": {
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import { createCollection } from "@tamagui/collection";
|
|
2
|
-
import { useComposedRefs } from "@tamagui/compose-refs";
|
|
3
|
-
import {
|
|
4
|
-
Stack,
|
|
5
|
-
composeEventHandlers,
|
|
6
|
-
isWeb,
|
|
7
|
-
useEvent,
|
|
8
|
-
withStaticProperties
|
|
9
|
-
} from "@tamagui/core";
|
|
10
|
-
import { createContextScope } from "@tamagui/create-context";
|
|
11
|
-
import { useControllableState } from "@tamagui/use-controllable-state";
|
|
12
|
-
import { useDirection } from "@tamagui/use-direction";
|
|
13
|
-
import * as React from "react";
|
|
14
|
-
import { jsx } from "react/jsx-runtime";
|
|
15
|
-
const ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus", EVENT_OPTIONS = { bubbles: !1, cancelable: !0 }, RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {
|
|
16
|
-
const {
|
|
17
|
-
__scopeRovingFocusGroup,
|
|
18
|
-
orientation,
|
|
19
|
-
loop = !1,
|
|
20
|
-
dir,
|
|
21
|
-
currentTabStopId: currentTabStopIdProp,
|
|
22
|
-
defaultCurrentTabStopId,
|
|
23
|
-
onCurrentTabStopIdChange,
|
|
24
|
-
onEntryFocus,
|
|
25
|
-
...groupProps
|
|
26
|
-
} = props, ref = React.useRef(null), composedRefs = useComposedRefs(forwardedRef, ref), direction = useDirection(dir), [currentTabStopId = null, setCurrentTabStopId] = useControllableState({
|
|
27
|
-
prop: currentTabStopIdProp,
|
|
28
|
-
defaultProp: defaultCurrentTabStopId ?? null,
|
|
29
|
-
onChange: onCurrentTabStopIdChange
|
|
30
|
-
}), [isTabbingBackOut, setIsTabbingBackOut] = React.useState(!1), handleEntryFocus = useEvent(onEntryFocus), getItems = useCollection(__scopeRovingFocusGroup), isClickFocusRef = React.useRef(!1), [focusableItemsCount, setFocusableItemsCount] = React.useState(0);
|
|
31
|
-
return React.useEffect(() => {
|
|
32
|
-
const node = ref.current;
|
|
33
|
-
if (node)
|
|
34
|
-
return node.addEventListener(ENTRY_FOCUS, handleEntryFocus), () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
35
|
-
}, [handleEntryFocus]), /* @__PURE__ */ jsx(
|
|
36
|
-
RovingFocusProvider,
|
|
37
|
-
{
|
|
38
|
-
scope: __scopeRovingFocusGroup,
|
|
39
|
-
orientation,
|
|
40
|
-
dir: direction,
|
|
41
|
-
loop,
|
|
42
|
-
currentTabStopId,
|
|
43
|
-
onItemFocus: React.useCallback(
|
|
44
|
-
(tabStopId) => setCurrentTabStopId(tabStopId),
|
|
45
|
-
[setCurrentTabStopId]
|
|
46
|
-
),
|
|
47
|
-
onItemShiftTab: React.useCallback(() => setIsTabbingBackOut(!0), []),
|
|
48
|
-
onFocusableItemAdd: React.useCallback(
|
|
49
|
-
() => setFocusableItemsCount((prevCount) => prevCount + 1),
|
|
50
|
-
[]
|
|
51
|
-
),
|
|
52
|
-
onFocusableItemRemove: React.useCallback(
|
|
53
|
-
() => setFocusableItemsCount((prevCount) => prevCount - 1),
|
|
54
|
-
[]
|
|
55
|
-
),
|
|
56
|
-
children: /* @__PURE__ */ jsx(
|
|
57
|
-
Stack,
|
|
58
|
-
{
|
|
59
|
-
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
60
|
-
"data-orientation": orientation,
|
|
61
|
-
...groupProps,
|
|
62
|
-
ref: composedRefs,
|
|
63
|
-
style: [{ outline: "none" }, props.style],
|
|
64
|
-
onMouseDown: composeEventHandlers(props.onMouseDown, () => {
|
|
65
|
-
isClickFocusRef.current = !0;
|
|
66
|
-
}),
|
|
67
|
-
onFocus: composeEventHandlers(props.onFocus, (event) => {
|
|
68
|
-
const isKeyboardFocus = !isClickFocusRef.current;
|
|
69
|
-
if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
|
|
70
|
-
const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);
|
|
71
|
-
if (event.currentTarget.dispatchEvent(entryFocusEvent), !entryFocusEvent.defaultPrevented) {
|
|
72
|
-
const items = getItems().filter((item) => item.focusable), activeItem = items.find((item) => item.active), currentItem = items.find((item) => item.id === currentTabStopId), candidateNodes = [activeItem, currentItem, ...items].filter(
|
|
73
|
-
Boolean
|
|
74
|
-
).map((item) => item.ref.current);
|
|
75
|
-
focusFirst(candidateNodes);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
isClickFocusRef.current = !1;
|
|
79
|
-
}),
|
|
80
|
-
onBlur: composeEventHandlers(
|
|
81
|
-
props.onBlur,
|
|
82
|
-
() => setIsTabbingBackOut(!1)
|
|
83
|
-
)
|
|
84
|
-
}
|
|
85
|
-
)
|
|
86
|
-
}
|
|
87
|
-
);
|
|
88
|
-
}), ITEM_NAME = "RovingFocusGroupItem", RovingFocusGroupItem = React.forwardRef((props, forwardedRef) => {
|
|
89
|
-
const {
|
|
90
|
-
__scopeRovingFocusGroup,
|
|
91
|
-
focusable = !0,
|
|
92
|
-
active = !1,
|
|
93
|
-
tabStopId,
|
|
94
|
-
...itemProps
|
|
95
|
-
} = props, autoId = React.useId(), id = tabStopId || autoId, context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup), isCurrentTabStop = context.currentTabStopId === id, getItems = useCollection(__scopeRovingFocusGroup), { onFocusableItemAdd, onFocusableItemRemove } = context;
|
|
96
|
-
return React.useEffect(() => {
|
|
97
|
-
if (focusable)
|
|
98
|
-
return onFocusableItemAdd(), () => onFocusableItemRemove();
|
|
99
|
-
}, [focusable, onFocusableItemAdd, onFocusableItemRemove]), /* @__PURE__ */ jsx(
|
|
100
|
-
Collection.ItemSlot,
|
|
101
|
-
{
|
|
102
|
-
scope: __scopeRovingFocusGroup,
|
|
103
|
-
id,
|
|
104
|
-
focusable,
|
|
105
|
-
active,
|
|
106
|
-
children: /* @__PURE__ */ jsx(
|
|
107
|
-
Stack,
|
|
108
|
-
{
|
|
109
|
-
tabIndex: isCurrentTabStop ? 0 : -1,
|
|
110
|
-
"data-orientation": context.orientation,
|
|
111
|
-
...itemProps,
|
|
112
|
-
ref: forwardedRef,
|
|
113
|
-
onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {
|
|
114
|
-
focusable ? context.onItemFocus(id) : event.preventDefault();
|
|
115
|
-
}),
|
|
116
|
-
onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),
|
|
117
|
-
...isWeb && {
|
|
118
|
-
onKeyDown: composeEventHandlers(
|
|
119
|
-
props.onKeyDown,
|
|
120
|
-
(event) => {
|
|
121
|
-
if (event.key === "Tab" && event.shiftKey) {
|
|
122
|
-
context.onItemShiftTab();
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
if (event.target !== event.currentTarget)
|
|
126
|
-
return;
|
|
127
|
-
const focusIntent = getFocusIntent(event, context.orientation, context.dir);
|
|
128
|
-
if (focusIntent !== void 0) {
|
|
129
|
-
event.preventDefault();
|
|
130
|
-
let candidateNodes = getItems().filter((item) => item.focusable).map((item) => item.ref.current);
|
|
131
|
-
if (focusIntent === "last")
|
|
132
|
-
candidateNodes.reverse();
|
|
133
|
-
else if (focusIntent === "prev" || focusIntent === "next") {
|
|
134
|
-
focusIntent === "prev" && candidateNodes.reverse();
|
|
135
|
-
const currentIndex = candidateNodes.indexOf(event.currentTarget);
|
|
136
|
-
candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);
|
|
137
|
-
}
|
|
138
|
-
setTimeout(() => focusFirst(candidateNodes));
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
)
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
)
|
|
145
|
-
}
|
|
146
|
-
);
|
|
147
|
-
});
|
|
148
|
-
RovingFocusGroupItem.displayName = ITEM_NAME;
|
|
149
|
-
const GROUP_NAME = "RovingFocusGroup", [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME), [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(
|
|
150
|
-
GROUP_NAME,
|
|
151
|
-
[createCollectionScope]
|
|
152
|
-
), [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME), RovingFocusGroup = withStaticProperties(
|
|
153
|
-
React.forwardRef(
|
|
154
|
-
(props, forwardedRef) => /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) })
|
|
155
|
-
),
|
|
156
|
-
{
|
|
157
|
-
Item: RovingFocusGroupItem
|
|
158
|
-
}
|
|
159
|
-
);
|
|
160
|
-
RovingFocusGroup.displayName = GROUP_NAME;
|
|
161
|
-
const MAP_KEY_TO_FOCUS_INTENT = {
|
|
162
|
-
ArrowLeft: "prev",
|
|
163
|
-
ArrowUp: "prev",
|
|
164
|
-
ArrowRight: "next",
|
|
165
|
-
ArrowDown: "next",
|
|
166
|
-
PageUp: "first",
|
|
167
|
-
Home: "first",
|
|
168
|
-
PageDown: "last",
|
|
169
|
-
End: "last"
|
|
170
|
-
};
|
|
171
|
-
function getDirectionAwareKey(key, dir) {
|
|
172
|
-
return dir !== "rtl" ? key : key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
|
|
173
|
-
}
|
|
174
|
-
function getFocusIntent(event, orientation, dir) {
|
|
175
|
-
const key = getDirectionAwareKey(event.key, dir);
|
|
176
|
-
if (!(orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) && !(orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)))
|
|
177
|
-
return MAP_KEY_TO_FOCUS_INTENT[key];
|
|
178
|
-
}
|
|
179
|
-
function focusFirst(candidates) {
|
|
180
|
-
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
181
|
-
for (const candidate of candidates)
|
|
182
|
-
if (candidate === PREVIOUSLY_FOCUSED_ELEMENT || (candidate.focus(), document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT))
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
function wrapArray(array, startIndex) {
|
|
186
|
-
return array.map((_, index) => array[(startIndex + index) % array.length]);
|
|
187
|
-
}
|
|
188
|
-
export {
|
|
189
|
-
RovingFocusGroup,
|
|
190
|
-
createRovingFocusGroupScope
|
|
191
|
-
};
|
|
192
|
-
//# sourceMappingURL=RovingFocusGroup.mjs.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/RovingFocusGroup.tsx"],
|
|
4
|
-
"mappings": "AAAA,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0BAA0B;AAEnC,SAAS,4BAA4B;AACrC,SAAS,oBAAoB;AAC7B,YAAY,WAAW;AA4EjB;AA1EN,MAAM,cAAc,iCACd,gBAAgB,EAAE,SAAS,IAAO,YAAY,GAAK,GAenD,uBAAuB,MAAM,WAGjC,CAAC,OAA+C,iBAAiB;AACjE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP;AAAA,IACA,kBAAkB;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI,OACE,MAAM,MAAM,OAAoC,IAAI,GACpD,eAAe,gBAAgB,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S,UAAa,OAAY,YAAoB;AACpD,SAAO,MAAM,IAAI,CAAC,GAAG,UAAU,OAAO,aAAa,SAAS,MAAM,MAAM,CAAC;AAC3E;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Stack, withStaticProperties } from "@tamagui/core";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
const ITEM_NAME = "RovingFocusGroupItem", RovingFocusGroupItem = React.forwardRef(
|
|
5
|
-
({ children, ...props }, _ref) => /* @__PURE__ */ jsx(Stack, { ...props, children })
|
|
6
|
-
);
|
|
7
|
-
RovingFocusGroupItem.displayName = ITEM_NAME;
|
|
8
|
-
const GROUP_NAME = "RovingFocusGroup", RovingFocusGroup = withStaticProperties(
|
|
9
|
-
React.forwardRef(({ children, ...props }, _ref) => /* @__PURE__ */ jsx(Stack, { ...props, children })),
|
|
10
|
-
{
|
|
11
|
-
Item: RovingFocusGroupItem
|
|
12
|
-
}
|
|
13
|
-
);
|
|
14
|
-
RovingFocusGroup.displayName = GROUP_NAME;
|
|
15
|
-
const createRovingFocusGroupScope = () => () => ({});
|
|
16
|
-
export {
|
|
17
|
-
RovingFocusGroup,
|
|
18
|
-
createRovingFocusGroupScope
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=RovingFocusGroup.native.mjs.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/RovingFocusGroup.native.tsx"],
|
|
4
|
-
"mappings": "AAAA,SAAS,OAAO,4BAA4B;AAC5C,OAAO,WAAW;AASd;AAHJ,MAAM,YAAY,wBACZ,uBAAuB,MAAM;AAAA,EACjC,CAAC,EAAE,UAAU,GAAG,MAAM,GAAyB,SAC7C,oBAAC,SAAO,GAAG,OAAQ,UAAS;AAEhC;AACA,qBAAqB,cAAc;AACnC,MAAM,aAAa,oBAEb,mBAAmB;AAAA,EACvB,MAAM,WAAW,CAAC,EAAE,UAAU,GAAG,MAAM,GAA0B,SAC/D,oBAAC,SAAO,GAAG,OAAQ,UAAS,CAC7B;AAAA,EACD;AAAA,IACE,MAAM;AAAA,EACR;AACF;AAEA,iBAAiB,cAAc;AAE/B,MAAM,8BAA8B,MAAM,OAAO,CAAC;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
package/dist/esm/index.mjs
DELETED
package/dist/esm/index.mjs.map
DELETED
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
import { createCollection } from "@tamagui/collection";
|
|
2
|
-
import { useComposedRefs } from "@tamagui/compose-refs";
|
|
3
|
-
import {
|
|
4
|
-
Stack,
|
|
5
|
-
composeEventHandlers,
|
|
6
|
-
isWeb,
|
|
7
|
-
useEvent,
|
|
8
|
-
withStaticProperties
|
|
9
|
-
} from "@tamagui/core";
|
|
10
|
-
import { createContextScope } from "@tamagui/create-context";
|
|
11
|
-
import { useControllableState } from "@tamagui/use-controllable-state";
|
|
12
|
-
import { useDirection } from "@tamagui/use-direction";
|
|
13
|
-
import * as React from "react";
|
|
14
|
-
const ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
|
|
15
|
-
const EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
16
|
-
const RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {
|
|
17
|
-
const {
|
|
18
|
-
__scopeRovingFocusGroup,
|
|
19
|
-
orientation,
|
|
20
|
-
loop = false,
|
|
21
|
-
dir,
|
|
22
|
-
currentTabStopId: currentTabStopIdProp,
|
|
23
|
-
defaultCurrentTabStopId,
|
|
24
|
-
onCurrentTabStopIdChange,
|
|
25
|
-
onEntryFocus,
|
|
26
|
-
...groupProps
|
|
27
|
-
} = props;
|
|
28
|
-
const ref = React.useRef(null);
|
|
29
|
-
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
30
|
-
const direction = useDirection(dir);
|
|
31
|
-
const [currentTabStopId = null, setCurrentTabStopId] = useControllableState({
|
|
32
|
-
prop: currentTabStopIdProp,
|
|
33
|
-
defaultProp: defaultCurrentTabStopId ?? null,
|
|
34
|
-
onChange: onCurrentTabStopIdChange
|
|
35
|
-
});
|
|
36
|
-
const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);
|
|
37
|
-
const handleEntryFocus = useEvent(onEntryFocus);
|
|
38
|
-
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
39
|
-
const isClickFocusRef = React.useRef(false);
|
|
40
|
-
const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);
|
|
41
|
-
React.useEffect(() => {
|
|
42
|
-
const node = ref.current;
|
|
43
|
-
if (node) {
|
|
44
|
-
node.addEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
45
|
-
return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
46
|
-
}
|
|
47
|
-
}, [handleEntryFocus]);
|
|
48
|
-
return <RovingFocusProvider
|
|
49
|
-
scope={__scopeRovingFocusGroup}
|
|
50
|
-
orientation={orientation}
|
|
51
|
-
dir={direction}
|
|
52
|
-
loop={loop}
|
|
53
|
-
currentTabStopId={currentTabStopId}
|
|
54
|
-
onItemFocus={React.useCallback(
|
|
55
|
-
(tabStopId) => setCurrentTabStopId(tabStopId),
|
|
56
|
-
[setCurrentTabStopId]
|
|
57
|
-
)}
|
|
58
|
-
onItemShiftTab={React.useCallback(() => setIsTabbingBackOut(true), [])}
|
|
59
|
-
onFocusableItemAdd={React.useCallback(
|
|
60
|
-
() => setFocusableItemsCount((prevCount) => prevCount + 1),
|
|
61
|
-
[]
|
|
62
|
-
)}
|
|
63
|
-
onFocusableItemRemove={React.useCallback(
|
|
64
|
-
() => setFocusableItemsCount((prevCount) => prevCount - 1),
|
|
65
|
-
[]
|
|
66
|
-
)}
|
|
67
|
-
><Stack
|
|
68
|
-
tabIndex={isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0}
|
|
69
|
-
data-orientation={orientation}
|
|
70
|
-
{...groupProps}
|
|
71
|
-
ref={composedRefs}
|
|
72
|
-
style={[{ outline: "none" }, props.style]}
|
|
73
|
-
onMouseDown={composeEventHandlers(props.onMouseDown, () => {
|
|
74
|
-
isClickFocusRef.current = true;
|
|
75
|
-
})}
|
|
76
|
-
onFocus={composeEventHandlers(props.onFocus, (event) => {
|
|
77
|
-
const isKeyboardFocus = !isClickFocusRef.current;
|
|
78
|
-
if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
|
|
79
|
-
const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);
|
|
80
|
-
event.currentTarget.dispatchEvent(entryFocusEvent);
|
|
81
|
-
if (!entryFocusEvent.defaultPrevented) {
|
|
82
|
-
const items = getItems().filter((item) => item.focusable);
|
|
83
|
-
const activeItem = items.find((item) => item.active);
|
|
84
|
-
const currentItem = items.find((item) => item.id === currentTabStopId);
|
|
85
|
-
const candidateItems = [activeItem, currentItem, ...items].filter(
|
|
86
|
-
Boolean
|
|
87
|
-
);
|
|
88
|
-
const candidateNodes = candidateItems.map((item) => item.ref.current);
|
|
89
|
-
focusFirst(candidateNodes);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
isClickFocusRef.current = false;
|
|
93
|
-
})}
|
|
94
|
-
onBlur={composeEventHandlers(
|
|
95
|
-
props.onBlur,
|
|
96
|
-
() => setIsTabbingBackOut(false)
|
|
97
|
-
)}
|
|
98
|
-
/></RovingFocusProvider>;
|
|
99
|
-
});
|
|
100
|
-
const ITEM_NAME = "RovingFocusGroupItem";
|
|
101
|
-
const RovingFocusGroupItem = React.forwardRef((props, forwardedRef) => {
|
|
102
|
-
const {
|
|
103
|
-
__scopeRovingFocusGroup,
|
|
104
|
-
focusable = true,
|
|
105
|
-
active = false,
|
|
106
|
-
tabStopId,
|
|
107
|
-
...itemProps
|
|
108
|
-
} = props;
|
|
109
|
-
const autoId = React.useId();
|
|
110
|
-
const id = tabStopId || autoId;
|
|
111
|
-
const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);
|
|
112
|
-
const isCurrentTabStop = context.currentTabStopId === id;
|
|
113
|
-
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
114
|
-
const { onFocusableItemAdd, onFocusableItemRemove } = context;
|
|
115
|
-
React.useEffect(() => {
|
|
116
|
-
if (focusable) {
|
|
117
|
-
onFocusableItemAdd();
|
|
118
|
-
return () => onFocusableItemRemove();
|
|
119
|
-
}
|
|
120
|
-
}, [focusable, onFocusableItemAdd, onFocusableItemRemove]);
|
|
121
|
-
return <Collection.ItemSlot
|
|
122
|
-
scope={__scopeRovingFocusGroup}
|
|
123
|
-
id={id}
|
|
124
|
-
focusable={focusable}
|
|
125
|
-
active={active}
|
|
126
|
-
><Stack
|
|
127
|
-
tabIndex={isCurrentTabStop ? 0 : -1}
|
|
128
|
-
data-orientation={context.orientation}
|
|
129
|
-
{...itemProps}
|
|
130
|
-
ref={forwardedRef}
|
|
131
|
-
onMouseDown={composeEventHandlers(props.onMouseDown, (event) => {
|
|
132
|
-
if (!focusable)
|
|
133
|
-
event.preventDefault();
|
|
134
|
-
else
|
|
135
|
-
context.onItemFocus(id);
|
|
136
|
-
})}
|
|
137
|
-
onFocus={composeEventHandlers(props.onFocus, () => context.onItemFocus(id))}
|
|
138
|
-
{...isWeb && {
|
|
139
|
-
onKeyDown: composeEventHandlers(
|
|
140
|
-
props.onKeyDown,
|
|
141
|
-
(event) => {
|
|
142
|
-
if (event.key === "Tab" && event.shiftKey) {
|
|
143
|
-
context.onItemShiftTab();
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
if (event.target !== event.currentTarget)
|
|
147
|
-
return;
|
|
148
|
-
const focusIntent = getFocusIntent(event, context.orientation, context.dir);
|
|
149
|
-
if (focusIntent !== void 0) {
|
|
150
|
-
event.preventDefault();
|
|
151
|
-
const items = getItems().filter((item) => item.focusable);
|
|
152
|
-
let candidateNodes = items.map((item) => item.ref.current);
|
|
153
|
-
if (focusIntent === "last")
|
|
154
|
-
candidateNodes.reverse();
|
|
155
|
-
else if (focusIntent === "prev" || focusIntent === "next") {
|
|
156
|
-
if (focusIntent === "prev")
|
|
157
|
-
candidateNodes.reverse();
|
|
158
|
-
const currentIndex = candidateNodes.indexOf(event.currentTarget);
|
|
159
|
-
candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);
|
|
160
|
-
}
|
|
161
|
-
setTimeout(() => focusFirst(candidateNodes));
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
)
|
|
165
|
-
}}
|
|
166
|
-
/></Collection.ItemSlot>;
|
|
167
|
-
});
|
|
168
|
-
RovingFocusGroupItem.displayName = ITEM_NAME;
|
|
169
|
-
const GROUP_NAME = "RovingFocusGroup";
|
|
170
|
-
const [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME);
|
|
171
|
-
const [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(
|
|
172
|
-
GROUP_NAME,
|
|
173
|
-
[createCollectionScope]
|
|
174
|
-
);
|
|
175
|
-
const [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);
|
|
176
|
-
const RovingFocusGroup = withStaticProperties(
|
|
177
|
-
React.forwardRef(
|
|
178
|
-
(props, forwardedRef) => {
|
|
179
|
-
return <Collection.Provider scope={props.__scopeRovingFocusGroup}><Collection.Slot scope={props.__scopeRovingFocusGroup}><RovingFocusGroupImpl {...props} ref={forwardedRef} /></Collection.Slot></Collection.Provider>;
|
|
180
|
-
}
|
|
181
|
-
),
|
|
182
|
-
{
|
|
183
|
-
Item: RovingFocusGroupItem
|
|
184
|
-
}
|
|
185
|
-
);
|
|
186
|
-
RovingFocusGroup.displayName = GROUP_NAME;
|
|
187
|
-
const MAP_KEY_TO_FOCUS_INTENT = {
|
|
188
|
-
ArrowLeft: "prev",
|
|
189
|
-
ArrowUp: "prev",
|
|
190
|
-
ArrowRight: "next",
|
|
191
|
-
ArrowDown: "next",
|
|
192
|
-
PageUp: "first",
|
|
193
|
-
Home: "first",
|
|
194
|
-
PageDown: "last",
|
|
195
|
-
End: "last"
|
|
196
|
-
};
|
|
197
|
-
function getDirectionAwareKey(key, dir) {
|
|
198
|
-
if (dir !== "rtl")
|
|
199
|
-
return key;
|
|
200
|
-
return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
|
|
201
|
-
}
|
|
202
|
-
function getFocusIntent(event, orientation, dir) {
|
|
203
|
-
const key = getDirectionAwareKey(event.key, dir);
|
|
204
|
-
if (orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key))
|
|
205
|
-
return void 0;
|
|
206
|
-
if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key))
|
|
207
|
-
return void 0;
|
|
208
|
-
return MAP_KEY_TO_FOCUS_INTENT[key];
|
|
209
|
-
}
|
|
210
|
-
function focusFirst(candidates) {
|
|
211
|
-
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
212
|
-
for (const candidate of candidates) {
|
|
213
|
-
if (candidate === PREVIOUSLY_FOCUSED_ELEMENT)
|
|
214
|
-
return;
|
|
215
|
-
candidate.focus();
|
|
216
|
-
if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT)
|
|
217
|
-
return;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
function wrapArray(array, startIndex) {
|
|
221
|
-
return array.map((_, index) => array[(startIndex + index) % array.length]);
|
|
222
|
-
}
|
|
223
|
-
export {
|
|
224
|
-
RovingFocusGroup,
|
|
225
|
-
createRovingFocusGroupScope
|
|
226
|
-
};
|
|
227
|
-
//# sourceMappingURL=RovingFocusGroup.mjs.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/RovingFocusGroup.tsx"],
|
|
4
|
-
"mappings": "AAAA,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAChC;AAAA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iB,cAAc;AAK/B,MAAM,0BAAuD;AAAA,EAC3D,WAAW;AAAA,EAAQ,SAAS;AAAA,EAC5B,YAAY;AAAA,EAAQ,WAAW;AAAA,EAC/B,QAAQ;AAAA,EAAS,MAAM;AAAA,EACvB,UAAU;AAAA,EAAQ,KAAK;AACzB;AAEA,SAAS,qBAAqB,KAAa,KAAiB;AAC1D,MAAI,QAAQ;AAAO,WAAO;AAC1B,SAAO,QAAQ,cAAc,eAAe,QAAQ,eAAe,cAAc;AACnF;AAIA,SAAS,eACP,OACA,aACA,KACA;AACA,QAAM,MAAM,qBAAqB,MAAM,KAAK,GAAG;AAC/C,MAAI,gBAAgB,cAAc,CAAC,aAAa,YAAY,EAAE,SAAS,GAAG;AACxE,WAAO;AACT,MAAI,gBAAgB,gBAAgB,CAAC,WAAW,WAAW,EAAE,SAAS,GAAG;AACvE,WAAO;AACT,SAAO,wBAAwB,GAAG;AACpC;AAEA,SAAS,WAAW,YAA2B;AAC7C,QAAM,6BAA6B,SAAS;AAC5C,aAAW,aAAa,YAAY;AAElC,QAAI,cAAc;AAA4B;AAC9C,cAAU,MAAM;AAChB,QAAI,SAAS,kBAAkB;AAA4B;AAAA,EAC7D;AACF;AAMA,SAAS,UAAa,OAAY,YAAoB;AACpD,SAAO,MAAM,IAAI,CAAC,GAAG,UAAU,OAAO,aAAa,SAAS,MAAM,MAAM,CAAC;AAC3E;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Stack, withStaticProperties } from "@tamagui/core";
|
|
2
|
-
import React from "react";
|
|
3
|
-
const ITEM_NAME = "RovingFocusGroupItem";
|
|
4
|
-
const RovingFocusGroupItem = React.forwardRef(({ children, ...props }, _ref) => <Stack {...props}>{children}</Stack>);
|
|
5
|
-
RovingFocusGroupItem.displayName = ITEM_NAME;
|
|
6
|
-
const GROUP_NAME = "RovingFocusGroup";
|
|
7
|
-
const RovingFocusGroup = withStaticProperties(
|
|
8
|
-
React.forwardRef(({ children, ...props }, _ref) => <Stack {...props}>{children}</Stack>),
|
|
9
|
-
{
|
|
10
|
-
Item: RovingFocusGroupItem
|
|
11
|
-
}
|
|
12
|
-
);
|
|
13
|
-
RovingFocusGroup.displayName = GROUP_NAME;
|
|
14
|
-
const createRovingFocusGroupScope = () => () => ({});
|
|
15
|
-
export {
|
|
16
|
-
RovingFocusGroup,
|
|
17
|
-
createRovingFocusGroupScope
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=RovingFocusGroup.native.mjs.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/RovingFocusGroup.native.tsx"],
|
|
4
|
-
"mappings": "AAAA,SAAS,OAAO,4BAA4B;AAC5C,OAAO,WAAW;AAMlB,MAAM,YAAY;AAClB,MAAM,uBAAuB,MAAM,WAAW,CAAC,EAAC,UAAS,GAAG,MAAK,GAAyB,SACxF,CAAC,UAAU,QAAQ,SAAS,EAA3B,MACF;AACD,qBAAqB,cAAc;AACnC,MAAM,aAAa;AAEnB,MAAM,mBAAmB;AAAA,EACvB,MAAM,WAAW,CAAC,EAAC,UAAS,GAAG,MAAK,GAA0B,SAC5D,CAAC,UAAU,QAAQ,SAAS,EAA3B,MACF;AAAA,EACD;AAAA,IACE,MAAM;AAAA,EACR;AACF;AAEA,iBAAiB,cAAc;AAE/B,MAAM,8BAA8B,MAAM,OAAO,CAAC;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
package/dist/jsx/index.mjs
DELETED