@tamagui/roving-focus 2.7.7 → 3.0.0-beta.637.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/cjs/RovingFocusGroup.cjs +197 -200
- package/dist/cjs/RovingFocusGroup.native.cjs +42 -0
- package/dist/cjs/RovingFocusGroup.native.js +23 -29
- package/dist/cjs/RovingFocusGroup.native.js.map +1 -1
- package/dist/cjs/index.cjs +10 -11
- package/dist/cjs/index.native.cjs +21 -0
- package/dist/cjs/index.native.js +10 -10
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/esm/RovingFocusGroup.mjs +181 -176
- package/dist/esm/RovingFocusGroup.mjs.map +1 -1
- package/dist/esm/RovingFocusGroup.native.js +10 -14
- package/dist/esm/RovingFocusGroup.native.js.map +1 -1
- package/dist/esm/index.js +1 -2
- package/dist/esm/index.mjs +1 -2
- package/dist/esm/index.native.js +1 -2
- package/package.json +11 -11
- package/src/RovingFocusGroup.native.tsx +2 -2
- package/src/RovingFocusGroup.tsx +89 -28
- package/types/RovingFocusGroup.d.ts +14 -11
- package/types/RovingFocusGroup.d.ts.map +1 -1
- package/types/RovingFocusGroup.native.d.ts +8 -2
- package/types/RovingFocusGroup.native.d.ts.map +1 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -5,36 +6,29 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
5
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
8
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
12
13
|
};
|
|
13
14
|
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
21
22
|
};
|
|
22
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
-
value: mod,
|
|
29
|
-
enumerable: true
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
+
value: mod,
|
|
25
|
+
enumerable: true
|
|
30
26
|
}) : target, mod));
|
|
31
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
-
value: true
|
|
33
|
-
}), mod);
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
34
28
|
var RovingFocusGroup_exports = {};
|
|
35
29
|
__export(RovingFocusGroup_exports, {
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
RovingFocusGroup: () => RovingFocusGroup,
|
|
31
|
+
RovingFocusGroupItem: () => RovingFocusGroupItem
|
|
38
32
|
});
|
|
39
33
|
module.exports = __toCommonJS(RovingFocusGroup_exports);
|
|
40
34
|
var import_collection = require("@tamagui/collection");
|
|
@@ -46,196 +40,199 @@ var import_use_controllable_state = require("@tamagui/use-controllable-state");
|
|
|
46
40
|
var import_use_direction = require("@tamagui/use-direction");
|
|
47
41
|
var React = __toESM(require("react"), 1);
|
|
48
42
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
onBlur: (0, import_helpers.composeEventHandlers)(props.onBlur, () => setIsTabbingBackOut(false))
|
|
119
|
-
})
|
|
120
|
-
});
|
|
43
|
+
const RovingFocusGroupImpl = (0, import_core.createRefComponent)((props, forwardedRef) => {
|
|
44
|
+
const { __scopeRovingFocusGroup, orientation, loop = false, dir, currentTabStopId: currentTabStopIdProp, defaultCurrentTabStopId, onCurrentTabStopIdChange, onEntryFocus, asChild, ...groupProps } = props;
|
|
45
|
+
const ref = React.useRef(null);
|
|
46
|
+
const composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref);
|
|
47
|
+
const direction = (0, import_use_direction.useDirection)(dir);
|
|
48
|
+
const [currentTabStopId = null, setCurrentTabStopId] = (0, import_use_controllable_state.useControllableState)({
|
|
49
|
+
prop: currentTabStopIdProp,
|
|
50
|
+
defaultProp: defaultCurrentTabStopId ?? null,
|
|
51
|
+
onChange: (tabStopId, details) => {
|
|
52
|
+
if (details) onCurrentTabStopIdChange?.(tabStopId, details);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);
|
|
56
|
+
const handleEntryFocus = (0, import_core.useEvent)(onEntryFocus);
|
|
57
|
+
const getItems = useCollection(__scopeRovingFocusGroup || ROVING_FOCUS_GROUP_CONTEXT);
|
|
58
|
+
const isClickFocusRef = React.useRef(false);
|
|
59
|
+
const pendingFocusDetailsRef = React.useRef(null);
|
|
60
|
+
const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);
|
|
61
|
+
const Comp = asChild ? import_core.Slot : import_core.View;
|
|
62
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RovingFocusProvider, {
|
|
63
|
+
scope: __scopeRovingFocusGroup,
|
|
64
|
+
orientation,
|
|
65
|
+
dir: direction,
|
|
66
|
+
loop,
|
|
67
|
+
currentTabStopId,
|
|
68
|
+
onItemFocus: React.useCallback((tabStopId, event) => {
|
|
69
|
+
if (tabStopId === currentTabStopId) return;
|
|
70
|
+
const details = pendingFocusDetailsRef.current ?? (0, import_core.createChangeEventDetails)("trigger-focus", event, event.currentTarget);
|
|
71
|
+
pendingFocusDetailsRef.current = null;
|
|
72
|
+
setCurrentTabStopId(tabStopId, details);
|
|
73
|
+
}, [currentTabStopId, setCurrentTabStopId]),
|
|
74
|
+
setPendingFocusDetails: React.useCallback((details) => {
|
|
75
|
+
pendingFocusDetailsRef.current = details;
|
|
76
|
+
}, []),
|
|
77
|
+
onItemShiftTab: React.useCallback(() => setIsTabbingBackOut(true), []),
|
|
78
|
+
onFocusableItemAdd: React.useCallback(() => setFocusableItemsCount((prevCount) => prevCount + 1), []),
|
|
79
|
+
onFocusableItemRemove: React.useCallback(() => setFocusableItemsCount((prevCount) => prevCount - 1), []),
|
|
80
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, {
|
|
81
|
+
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
82
|
+
"data-orientation": orientation,
|
|
83
|
+
...groupProps,
|
|
84
|
+
ref: composedRefs,
|
|
85
|
+
outlineStyle: "none",
|
|
86
|
+
onMouseDown: (0, import_helpers.composeEventHandlers)(props.onMouseDown, () => {
|
|
87
|
+
isClickFocusRef.current = true;
|
|
88
|
+
}),
|
|
89
|
+
onFocus: (0, import_helpers.composeEventHandlers)(props.onFocus, (event) => {
|
|
90
|
+
const isKeyboardFocus = !isClickFocusRef.current;
|
|
91
|
+
if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
|
|
92
|
+
const details = (0, import_core.createChangeEventDetails)("trigger-focus", event, event.currentTarget);
|
|
93
|
+
handleEntryFocus(details);
|
|
94
|
+
if (!details.isCanceled) {
|
|
95
|
+
const items = getItems().filter((item) => item.focusable);
|
|
96
|
+
const activeItem = items.find((item) => item.active);
|
|
97
|
+
const currentItem = items.find((item) => item.id === currentTabStopId);
|
|
98
|
+
const candidateItems = [
|
|
99
|
+
activeItem,
|
|
100
|
+
currentItem,
|
|
101
|
+
...items
|
|
102
|
+
].filter(Boolean);
|
|
103
|
+
const candidateNodes = candidateItems.map((item) => item.ref.current);
|
|
104
|
+
focusFirst(candidateNodes, { focusVisible: false });
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
isClickFocusRef.current = false;
|
|
108
|
+
}),
|
|
109
|
+
onBlur: (0, import_helpers.composeEventHandlers)(props.onBlur, () => setIsTabbingBackOut(false))
|
|
110
|
+
})
|
|
111
|
+
});
|
|
121
112
|
});
|
|
122
113
|
const ITEM_NAME = "RovingFocusGroupItem";
|
|
123
|
-
const RovingFocusGroupItem =
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
114
|
+
const RovingFocusGroupItem = (0, import_core.createRefComponent)((props, forwardedRef) => {
|
|
115
|
+
const { __scopeRovingFocusGroup, active = false, tabStopId, tabIndex: tabIndexProp, ...itemProps } = props;
|
|
116
|
+
const tabIndex = tabIndexProp ?? 0;
|
|
117
|
+
const focusable = Number(tabIndex) >= 0;
|
|
118
|
+
const autoId = React.useId();
|
|
119
|
+
const id = tabStopId || autoId;
|
|
120
|
+
const context = useRovingFocusContext(__scopeRovingFocusGroup);
|
|
121
|
+
const isCurrentTabStop = context.currentTabStopId === id;
|
|
122
|
+
const getItems = useCollection(__scopeRovingFocusGroup || ROVING_FOCUS_GROUP_CONTEXT);
|
|
123
|
+
const skipNextFocusRequestRef = React.useRef(false);
|
|
124
|
+
const { onFocusableItemAdd, onFocusableItemRemove } = context;
|
|
125
|
+
React.useEffect(() => {
|
|
126
|
+
if (focusable) {
|
|
127
|
+
onFocusableItemAdd();
|
|
128
|
+
return () => onFocusableItemRemove();
|
|
129
|
+
}
|
|
130
|
+
}, [
|
|
131
|
+
focusable,
|
|
132
|
+
onFocusableItemAdd,
|
|
133
|
+
onFocusableItemRemove
|
|
134
|
+
]);
|
|
135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.ItemSlot, {
|
|
136
|
+
scope: __scopeRovingFocusGroup || ROVING_FOCUS_GROUP_CONTEXT,
|
|
137
|
+
id,
|
|
138
|
+
focusable,
|
|
139
|
+
active,
|
|
140
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.View, {
|
|
141
|
+
tabIndex,
|
|
142
|
+
"data-orientation": context.orientation,
|
|
143
|
+
...itemProps,
|
|
144
|
+
ref: forwardedRef,
|
|
145
|
+
onMouseDown: (0, import_helpers.composeEventHandlers)(props.onMouseDown, (event) => {
|
|
146
|
+
if (!focusable) event.preventDefault();
|
|
147
|
+
else {
|
|
148
|
+
skipNextFocusRequestRef.current = true;
|
|
149
|
+
queueMicrotask(() => {
|
|
150
|
+
skipNextFocusRequestRef.current = false;
|
|
151
|
+
});
|
|
152
|
+
context.onItemFocus(id, event);
|
|
153
|
+
}
|
|
154
|
+
}),
|
|
155
|
+
onFocus: (0, import_helpers.composeEventHandlers)(props.onFocus, (event) => {
|
|
156
|
+
if (skipNextFocusRequestRef.current) {
|
|
157
|
+
skipNextFocusRequestRef.current = false;
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
context.onItemFocus(id, event);
|
|
161
|
+
}),
|
|
162
|
+
...import_constants.isWeb && { onKeyDown: (0, import_helpers.composeEventHandlers)(props.onKeyDown, (event) => {
|
|
163
|
+
if (event.key === "Tab" && event.shiftKey) {
|
|
164
|
+
context.onItemShiftTab();
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
if (event.target !== event.currentTarget) return;
|
|
168
|
+
const focusIntent = getFocusIntent(event, context.orientation, context.dir);
|
|
169
|
+
if (focusIntent !== void 0) {
|
|
170
|
+
event.preventDefault();
|
|
171
|
+
const items = getItems().filter((item) => item.focusable);
|
|
172
|
+
let candidateNodes = items.map((item) => item.ref.current);
|
|
173
|
+
if (focusIntent === "last") candidateNodes.reverse();
|
|
174
|
+
else if (focusIntent === "prev" || focusIntent === "next") {
|
|
175
|
+
if (focusIntent === "prev") candidateNodes.reverse();
|
|
176
|
+
const currentIndex = candidateNodes.indexOf(event.currentTarget);
|
|
177
|
+
candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);
|
|
178
|
+
}
|
|
179
|
+
const details = (0, import_core.createChangeEventDetails)("keyboard", event, event.currentTarget);
|
|
180
|
+
setTimeout(() => {
|
|
181
|
+
context.setPendingFocusDetails(details);
|
|
182
|
+
focusFirst(candidateNodes, { focusVisible: true });
|
|
183
|
+
context.setPendingFocusDetails(null);
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}) }
|
|
187
|
+
})
|
|
188
|
+
});
|
|
185
189
|
});
|
|
186
190
|
RovingFocusGroupItem.displayName = ITEM_NAME;
|
|
187
191
|
const GROUP_NAME = "RovingFocusGroup";
|
|
188
192
|
const [Collection, useCollection] = (0, import_collection.createCollection)(GROUP_NAME);
|
|
189
|
-
const {
|
|
190
|
-
Provider: RovingFocusProvider,
|
|
191
|
-
useStyledContext: useRovingFocusContext
|
|
192
|
-
} = (0, import_core.createStyledContext)();
|
|
193
|
+
const { Provider: RovingFocusProvider, useStyledContext: useRovingFocusContext } = (0, import_core.createStyledContext)();
|
|
193
194
|
const ROVING_FOCUS_GROUP_CONTEXT = "RovingFocusGroupContext";
|
|
194
|
-
const RovingFocusGroup = (0, import_helpers.withStaticProperties)(
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
}), {
|
|
206
|
-
Item: RovingFocusGroupItem
|
|
207
|
-
});
|
|
195
|
+
const RovingFocusGroup = (0, import_helpers.withStaticProperties)((0, import_core.createRefComponent)((props, forwardedRef) => {
|
|
196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Provider, {
|
|
197
|
+
scope: props.__scopeRovingFocusGroup || ROVING_FOCUS_GROUP_CONTEXT,
|
|
198
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Slot, {
|
|
199
|
+
scope: props.__scopeRovingFocusGroup || ROVING_FOCUS_GROUP_CONTEXT,
|
|
200
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RovingFocusGroupImpl, {
|
|
201
|
+
...props,
|
|
202
|
+
ref: forwardedRef
|
|
203
|
+
})
|
|
204
|
+
})
|
|
205
|
+
});
|
|
206
|
+
}), { Item: RovingFocusGroupItem });
|
|
208
207
|
RovingFocusGroup.displayName = GROUP_NAME;
|
|
209
208
|
const MAP_KEY_TO_FOCUS_INTENT = {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
209
|
+
ArrowLeft: "prev",
|
|
210
|
+
ArrowUp: "prev",
|
|
211
|
+
ArrowRight: "next",
|
|
212
|
+
ArrowDown: "next",
|
|
213
|
+
PageUp: "first",
|
|
214
|
+
Home: "first",
|
|
215
|
+
PageDown: "last",
|
|
216
|
+
End: "last"
|
|
218
217
|
};
|
|
219
218
|
function getDirectionAwareKey(key, dir) {
|
|
220
|
-
|
|
221
|
-
|
|
219
|
+
if (dir !== "rtl") return key;
|
|
220
|
+
return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
|
|
222
221
|
}
|
|
223
222
|
function getFocusIntent(event, orientation, dir) {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
223
|
+
const key = getDirectionAwareKey(event.key, dir);
|
|
224
|
+
if (orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0;
|
|
225
|
+
if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0;
|
|
226
|
+
return MAP_KEY_TO_FOCUS_INTENT[key];
|
|
228
227
|
}
|
|
229
228
|
function focusFirst(candidates, options) {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
237
|
-
}
|
|
229
|
+
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
230
|
+
for (const candidate of candidates) {
|
|
231
|
+
if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
232
|
+
candidate.focus({ focusVisible: options?.focusVisible });
|
|
233
|
+
if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
234
|
+
}
|
|
238
235
|
}
|
|
239
236
|
function wrapArray(array, startIndex) {
|
|
240
|
-
|
|
241
|
-
}
|
|
237
|
+
return array.map((_, index) => array[(startIndex + index) % array.length]);
|
|
238
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
+
var RovingFocusGroup_native_exports = {};
|
|
25
|
+
__export(RovingFocusGroup_native_exports, {
|
|
26
|
+
RovingFocusGroup: () => RovingFocusGroup,
|
|
27
|
+
createRovingFocusGroupScope: () => createRovingFocusGroupScope
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(RovingFocusGroup_native_exports);
|
|
30
|
+
var import_core = require("@tamagui/core");
|
|
31
|
+
var import_helpers = require("@tamagui/helpers");
|
|
32
|
+
var ITEM_NAME = "RovingFocusGroupItem";
|
|
33
|
+
var RovingFocusGroupItem = (0, import_core.styled)(import_core.View, { displayName: ITEM_NAME });
|
|
34
|
+
var GROUP_NAME = "RovingFocusGroup";
|
|
35
|
+
var RovingFocusGroupFrame = (0, import_core.styled)(import_core.View, { displayName: GROUP_NAME });
|
|
36
|
+
var RovingFocusGroup = (0, import_helpers.withStaticProperties)(RovingFocusGroupFrame, { Item: RovingFocusGroupItem });
|
|
37
|
+
RovingFocusGroup.displayName = GROUP_NAME;
|
|
38
|
+
var createRovingFocusGroupScope = function() {
|
|
39
|
+
return function() {
|
|
40
|
+
return {};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -1,50 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
8
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
12
13
|
};
|
|
13
14
|
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
21
22
|
};
|
|
22
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
-
value: true
|
|
24
|
-
}), mod);
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
24
|
var RovingFocusGroup_native_exports = {};
|
|
26
25
|
__export(RovingFocusGroup_native_exports, {
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
RovingFocusGroup: () => RovingFocusGroup,
|
|
27
|
+
createRovingFocusGroupScope: () => createRovingFocusGroupScope
|
|
29
28
|
});
|
|
30
29
|
module.exports = __toCommonJS(RovingFocusGroup_native_exports);
|
|
31
30
|
var import_core = require("@tamagui/core");
|
|
32
31
|
var import_helpers = require("@tamagui/helpers");
|
|
33
32
|
var ITEM_NAME = "RovingFocusGroupItem";
|
|
34
|
-
var RovingFocusGroupItem = (0, import_core.styled)(import_core.View, {
|
|
35
|
-
name: ITEM_NAME
|
|
36
|
-
});
|
|
33
|
+
var RovingFocusGroupItem = (0, import_core.styled)(import_core.View, { displayName: ITEM_NAME });
|
|
37
34
|
var GROUP_NAME = "RovingFocusGroup";
|
|
38
|
-
var RovingFocusGroupFrame = (0, import_core.styled)(import_core.View, {
|
|
39
|
-
|
|
40
|
-
});
|
|
41
|
-
var RovingFocusGroup = (0, import_helpers.withStaticProperties)(RovingFocusGroupFrame, {
|
|
42
|
-
Item: RovingFocusGroupItem
|
|
43
|
-
});
|
|
35
|
+
var RovingFocusGroupFrame = (0, import_core.styled)(import_core.View, { displayName: GROUP_NAME });
|
|
36
|
+
var RovingFocusGroup = (0, import_helpers.withStaticProperties)(RovingFocusGroupFrame, { Item: RovingFocusGroupItem });
|
|
44
37
|
RovingFocusGroup.displayName = GROUP_NAME;
|
|
45
|
-
var createRovingFocusGroupScope = function
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
var createRovingFocusGroupScope = function() {
|
|
39
|
+
return function() {
|
|
40
|
+
return {};
|
|
41
|
+
};
|
|
49
42
|
};
|
|
43
|
+
|
|
50
44
|
//# sourceMappingURL=RovingFocusGroup.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"RovingFocusGroup.native.js","names":[],"sources":["cjs/RovingFocusGroup.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar RovingFocusGroup_native_exports = {};\n__export(RovingFocusGroup_native_exports, {\n RovingFocusGroup: () => RovingFocusGroup,\n createRovingFocusGroupScope: () => createRovingFocusGroupScope\n});\nmodule.exports = __toCommonJS(RovingFocusGroup_native_exports);\nvar import_core = require(\"@tamagui/core\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar ITEM_NAME = \"RovingFocusGroupItem\";\nvar RovingFocusGroupItem = (0, import_core.styled)(import_core.View, {\n displayName: ITEM_NAME\n});\nvar GROUP_NAME = \"RovingFocusGroup\";\nvar RovingFocusGroupFrame = (0, import_core.styled)(import_core.View, {\n displayName: GROUP_NAME\n});\nvar RovingFocusGroup = (0, import_helpers.withStaticProperties)(RovingFocusGroupFrame, {\n Item: RovingFocusGroupItem\n});\nRovingFocusGroup.displayName = GROUP_NAME;\nvar createRovingFocusGroupScope = function() {\n return function() {\n return {};\n };\n};\n//# sourceMappingURL=RovingFocusGroup.native.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,kCAAkC,CAAC;AACvC,SAAS,iCAAiC;CACxC,wBAAwB;CACxB,mCAAmC;AACrC,CAAC;AACD,OAAO,UAAU,aAAa,+BAA+B;AAC7D,IAAI,cAAc,QAAQ,eAAe;AACzC,IAAI,iBAAiB,QAAQ,kBAAkB;AAC/C,IAAI,YAAY;AAChB,IAAI,wBAAwB,GAAG,YAAY,QAAQ,YAAY,MAAM,EACnE,aAAa,UACf,CAAC;AACD,IAAI,aAAa;AACjB,IAAI,yBAAyB,GAAG,YAAY,QAAQ,YAAY,MAAM,EACpE,aAAa,WACf,CAAC;AACD,IAAI,oBAAoB,GAAG,eAAe,sBAAsB,uBAAuB,EACrF,MAAM,qBACR,CAAC;AACD,iBAAiB,cAAc;AAC/B,IAAI,8BAA8B,WAAW;CAC3C,OAAO,WAAW;EAChB,OAAO,CAAC;CACV;AACF"}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
+
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
6
|
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
9
|
+
get: () => from[key],
|
|
10
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
return to;
|
|
13
14
|
};
|
|
14
15
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
16
|
-
value: true
|
|
17
|
-
}), mod);
|
|
16
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
17
|
var index_exports = {};
|
|
19
18
|
module.exports = __toCommonJS(index_exports);
|
|
20
|
-
__reExport(index_exports, require("./RovingFocusGroup.cjs"), module.exports);
|
|
19
|
+
__reExport(index_exports, require("./RovingFocusGroup.cjs"), module.exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
11
|
+
get: () => from[key],
|
|
12
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var index_exports = {};
|
|
20
|
+
module.exports = __toCommonJS(index_exports);
|
|
21
|
+
__reExport(index_exports, require("./RovingFocusGroup.native.js"), module.exports);
|