@tamagui/roving-focus 1.63.0 → 1.64.1
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/esm/RovingFocusGroup.mjs +192 -0
- package/dist/esm/RovingFocusGroup.mjs.map +1 -1
- package/dist/esm/RovingFocusGroup.native.js +5 -3
- package/dist/esm/RovingFocusGroup.native.js.map +1 -1
- package/dist/esm/RovingFocusGroup.native.mjs +20 -0
- package/dist/esm/RovingFocusGroup.native.mjs.map +1 -1
- package/dist/esm/index.mjs +2 -0
- package/package.json +9 -9
|
@@ -0,0 +1,192 @@
|
|
|
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 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/RovingFocusGroup.tsx"],
|
|
4
|
-
"mappings": "
|
|
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,kBAAk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AAM,6BAA6B,SAAS;AAC5C,aAAW,aAAa;AAItB,QAFI,cAAc,+BAClB,UAAU,MAAM,GACZ,SAAS,kBAAkB;AAA4B;AAE/D;AAMA,SAAS,UAAa,OAAY,YAAoB;AACpD,SAAO,MAAM,IAAI,CAAC,GAAG,UAAU,OAAO,aAAa,SAAS,MAAM,MAAM,CAAC;AAC3E;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
1
2
|
import { Stack, withStaticProperties } from "@tamagui/core";
|
|
2
3
|
import React from "react";
|
|
3
|
-
|
|
4
|
-
const
|
|
4
|
+
const ITEM_NAME = "RovingFocusGroupItem";
|
|
5
|
+
const RovingFocusGroupItem = React.forwardRef(
|
|
5
6
|
({ children, ...props }, _ref) => /* @__PURE__ */ jsx(Stack, { ...props, children })
|
|
6
7
|
);
|
|
7
8
|
RovingFocusGroupItem.displayName = ITEM_NAME;
|
|
8
|
-
const GROUP_NAME = "RovingFocusGroup"
|
|
9
|
+
const GROUP_NAME = "RovingFocusGroup";
|
|
10
|
+
const RovingFocusGroup = withStaticProperties(
|
|
9
11
|
React.forwardRef(({ children, ...props }, _ref) => /* @__PURE__ */ jsx(Stack, { ...props, children })),
|
|
10
12
|
{
|
|
11
13
|
Item: RovingFocusGroupItem
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/RovingFocusGroup.native.tsx"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAUI;AAVJ,SAAS,OAAO,4BAA4B;AAC5C,OAAO,WAAW;AAMlB,MAAM,YAAY;AAClB,MAAM,uBAAuB,MAAM;AAAA,EACjC,CAAC,EAAE,UAAU,GAAG,MAAM,GAAyB,SAC7C,oBAAC,SAAO,GAAG,OAAQ,UAAS;AAEhC;AACA,qBAAqB,cAAc;AACnC,MAAM,aAAa;AAEnB,MAAM,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
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/RovingFocusGroup.native.tsx"],
|
|
4
|
-
"mappings": "
|
|
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
5
|
"names": []
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/roving-focus",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.64.1",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"*.css"
|
|
6
6
|
],
|
|
@@ -27,19 +27,19 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@tamagui/collection": "1.
|
|
31
|
-
"@tamagui/compose-refs": "1.
|
|
32
|
-
"@tamagui/core": "1.
|
|
33
|
-
"@tamagui/create-context": "1.
|
|
34
|
-
"@tamagui/use-controllable-state": "1.
|
|
35
|
-
"@tamagui/use-direction": "1.
|
|
36
|
-
"@tamagui/use-event": "1.
|
|
30
|
+
"@tamagui/collection": "1.64.1",
|
|
31
|
+
"@tamagui/compose-refs": "1.64.1",
|
|
32
|
+
"@tamagui/core": "1.64.1",
|
|
33
|
+
"@tamagui/create-context": "1.64.1",
|
|
34
|
+
"@tamagui/use-controllable-state": "1.64.1",
|
|
35
|
+
"@tamagui/use-direction": "1.64.1",
|
|
36
|
+
"@tamagui/use-event": "1.64.1"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"react": "*"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@tamagui/build": "1.
|
|
42
|
+
"@tamagui/build": "1.64.1",
|
|
43
43
|
"react": "^18.2.0"
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|