@tamagui/roving-focus 2.7.7 → 3.0.0-beta.1091.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.
@@ -5,36 +5,29 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
12
  };
13
13
  var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: () => from[key],
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
21
21
  };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
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
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
30
25
  }) : target, mod));
31
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
- value: true
33
- }), mod);
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
34
27
  var RovingFocusGroup_exports = {};
35
28
  __export(RovingFocusGroup_exports, {
36
- RovingFocusGroup: () => RovingFocusGroup,
37
- RovingFocusGroupItem: () => RovingFocusGroupItem
29
+ RovingFocusGroup: () => RovingFocusGroup,
30
+ RovingFocusGroupItem: () => RovingFocusGroupItem
38
31
  });
39
32
  module.exports = __toCommonJS(RovingFocusGroup_exports);
40
33
  var import_collection = require("@tamagui/collection");
@@ -46,196 +39,202 @@ var import_use_controllable_state = require("@tamagui/use-controllable-state");
46
39
  var import_use_direction = require("@tamagui/use-direction");
47
40
  var React = __toESM(require("react"), 1);
48
41
  var import_jsx_runtime = require("react/jsx-runtime");
49
- const ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
50
- const EVENT_OPTIONS = {
51
- bubbles: false,
52
- cancelable: true
53
- };
54
- const RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {
55
- const {
56
- __scopeRovingFocusGroup,
57
- orientation,
58
- loop = false,
59
- dir,
60
- currentTabStopId: currentTabStopIdProp,
61
- defaultCurrentTabStopId,
62
- onCurrentTabStopIdChange,
63
- onEntryFocus,
64
- asChild,
65
- ...groupProps
66
- } = props;
67
- const ref = React.useRef(null);
68
- const composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref);
69
- const direction = (0, import_use_direction.useDirection)(dir);
70
- const [currentTabStopId = null, setCurrentTabStopId] = (0, import_use_controllable_state.useControllableState)({
71
- prop: currentTabStopIdProp,
72
- defaultProp: defaultCurrentTabStopId ?? null,
73
- onChange: onCurrentTabStopIdChange
74
- });
75
- const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);
76
- const handleEntryFocus = (0, import_core.useEvent)(onEntryFocus);
77
- const getItems = useCollection(__scopeRovingFocusGroup || ROVING_FOCUS_GROUP_CONTEXT);
78
- const isClickFocusRef = React.useRef(false);
79
- const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);
80
- const Comp = asChild ? import_core.Slot : import_core.View;
81
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)(RovingFocusProvider, {
82
- scope: __scopeRovingFocusGroup,
83
- orientation,
84
- dir: direction,
85
- loop,
86
- currentTabStopId,
87
- onItemFocus: React.useCallback(tabStopId => setCurrentTabStopId(tabStopId), [setCurrentTabStopId]),
88
- onItemShiftTab: React.useCallback(() => setIsTabbingBackOut(true), []),
89
- onFocusableItemAdd: React.useCallback(() => setFocusableItemsCount(prevCount => prevCount + 1), []),
90
- onFocusableItemRemove: React.useCallback(() => setFocusableItemsCount(prevCount => prevCount - 1), []),
91
- children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(Comp, {
92
- tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
93
- "data-orientation": orientation,
94
- ...groupProps,
95
- ref: composedRefs,
96
- outlineStyle: "none",
97
- onMouseDown: (0, import_helpers.composeEventHandlers)(props.onMouseDown, () => {
98
- isClickFocusRef.current = true;
99
- }),
100
- onFocus: (0, import_helpers.composeEventHandlers)(props.onFocus, event => {
101
- const isKeyboardFocus = !isClickFocusRef.current;
102
- if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
103
- const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);
104
- handleEntryFocus(entryFocusEvent);
105
- if (!entryFocusEvent.defaultPrevented) {
106
- const items = getItems().filter(item => item.focusable);
107
- const activeItem = items.find(item => item.active);
108
- const currentItem = items.find(item => item.id === currentTabStopId);
109
- const candidateItems = [activeItem, currentItem, ...items].filter(Boolean);
110
- const candidateNodes = candidateItems.map(item => item.ref.current);
111
- focusFirst(candidateNodes, {
112
- focusVisible: false
113
- });
114
- }
115
- }
116
- isClickFocusRef.current = false;
117
- }),
118
- onBlur: (0, import_helpers.composeEventHandlers)(props.onBlur, () => setIsTabbingBackOut(false))
119
- })
120
- });
42
+ const RovingFocusGroupImpl = (0, import_core.createRefComponent)((props, forwardedRef) => {
43
+ const { __scopeRovingFocusGroup, orientation, loop = false, dir, currentTabStopId: currentTabStopIdProp, defaultCurrentTabStopId, onCurrentTabStopIdChange, onEntryFocus, asChild, ...groupProps } = props;
44
+ const ref = React.useRef(null);
45
+ const composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref);
46
+ const direction = (0, import_use_direction.useDirection)(dir);
47
+ const [currentTabStopId = null, setCurrentTabStopId] = (0, import_use_controllable_state.useControllableState)({
48
+ prop: currentTabStopIdProp,
49
+ defaultProp: defaultCurrentTabStopId ?? null,
50
+ onChange: (tabStopId, details) => {
51
+ if (details) onCurrentTabStopIdChange?.(tabStopId, details);
52
+ }
53
+ });
54
+ const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);
55
+ const [hasMounted, setHasMounted] = 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
+ React.useEffect(() => {
62
+ setHasMounted(true);
63
+ }, []);
64
+ const Comp = asChild ? import_core.Slot : import_core.View;
65
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RovingFocusProvider, {
66
+ scope: __scopeRovingFocusGroup,
67
+ orientation,
68
+ dir: direction,
69
+ loop,
70
+ currentTabStopId,
71
+ onItemFocus: React.useCallback((tabStopId, event) => {
72
+ if (tabStopId === currentTabStopId) return;
73
+ const details = pendingFocusDetailsRef.current ?? (0, import_core.createChangeEventDetails)("trigger-focus", event, event.currentTarget);
74
+ pendingFocusDetailsRef.current = null;
75
+ setCurrentTabStopId(tabStopId, details);
76
+ }, [currentTabStopId, setCurrentTabStopId]),
77
+ setPendingFocusDetails: React.useCallback((details) => {
78
+ pendingFocusDetailsRef.current = details;
79
+ }, []),
80
+ onItemShiftTab: React.useCallback(() => setIsTabbingBackOut(true), []),
81
+ onFocusableItemAdd: React.useCallback(() => setFocusableItemsCount((prevCount) => prevCount + 1), []),
82
+ onFocusableItemRemove: React.useCallback(() => setFocusableItemsCount((prevCount) => prevCount - 1), []),
83
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, {
84
+ tabIndex: isTabbingBackOut || hasMounted && focusableItemsCount === 0 ? -1 : 0,
85
+ "data-orientation": orientation,
86
+ ...groupProps,
87
+ ref: composedRefs,
88
+ outlineStyle: "none",
89
+ onMouseDown: (0, import_helpers.composeEventHandlers)(props.onMouseDown, () => {
90
+ isClickFocusRef.current = true;
91
+ }),
92
+ onFocus: (0, import_helpers.composeEventHandlers)(props.onFocus, (event) => {
93
+ const isKeyboardFocus = !isClickFocusRef.current;
94
+ if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
95
+ const details = (0, import_core.createChangeEventDetails)("trigger-focus", event, event.currentTarget);
96
+ handleEntryFocus(details);
97
+ if (!details.isCanceled) {
98
+ const items = getItems().filter((item) => item.focusable);
99
+ const activeItem = items.find((item) => item.active);
100
+ const currentItem = items.find((item) => item.id === currentTabStopId);
101
+ const candidateItems = [
102
+ activeItem,
103
+ currentItem,
104
+ ...items
105
+ ].filter(Boolean);
106
+ const candidateNodes = candidateItems.map((item) => item.ref.current);
107
+ focusFirst(candidateNodes, { focusVisible: false });
108
+ }
109
+ }
110
+ isClickFocusRef.current = false;
111
+ }),
112
+ onBlur: (0, import_helpers.composeEventHandlers)(props.onBlur, () => setIsTabbingBackOut(false))
113
+ })
114
+ });
121
115
  });
122
116
  const ITEM_NAME = "RovingFocusGroupItem";
123
- const RovingFocusGroupItem = React.forwardRef((props, forwardedRef) => {
124
- const {
125
- __scopeRovingFocusGroup,
126
- focusable = true,
127
- active = false,
128
- tabStopId,
129
- ...itemProps
130
- } = props;
131
- const autoId = React.useId();
132
- const id = tabStopId || autoId;
133
- const context = useRovingFocusContext(__scopeRovingFocusGroup);
134
- const isCurrentTabStop = context.currentTabStopId === id;
135
- const getItems = useCollection(__scopeRovingFocusGroup || ROVING_FOCUS_GROUP_CONTEXT);
136
- const {
137
- onFocusableItemAdd,
138
- onFocusableItemRemove
139
- } = context;
140
- React.useEffect(() => {
141
- if (focusable) {
142
- onFocusableItemAdd();
143
- return () => onFocusableItemRemove();
144
- }
145
- }, [focusable, onFocusableItemAdd, onFocusableItemRemove]);
146
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)(Collection.ItemSlot, {
147
- scope: __scopeRovingFocusGroup || ROVING_FOCUS_GROUP_CONTEXT,
148
- id,
149
- focusable,
150
- active,
151
- children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_core.View, {
152
- tabIndex: focusable ? 0 : -1,
153
- "data-orientation": context.orientation,
154
- ...itemProps,
155
- ref: forwardedRef,
156
- onMouseDown: (0, import_helpers.composeEventHandlers)(props.onMouseDown, event => {
157
- if (!focusable) event.preventDefault();else context.onItemFocus(id);
158
- }),
159
- onFocus: (0, import_helpers.composeEventHandlers)(props.onFocus, () => context.onItemFocus(id)),
160
- ...(import_constants.isWeb && {
161
- onKeyDown: (0, import_helpers.composeEventHandlers)(props.onKeyDown, event => {
162
- if (event.key === "Tab" && event.shiftKey) {
163
- context.onItemShiftTab();
164
- return;
165
- }
166
- if (event.target !== event.currentTarget) return;
167
- const focusIntent = getFocusIntent(event, context.orientation, context.dir);
168
- if (focusIntent !== void 0) {
169
- event.preventDefault();
170
- const items = getItems().filter(item => item.focusable);
171
- let candidateNodes = items.map(item => item.ref.current);
172
- if (focusIntent === "last") candidateNodes.reverse();else if (focusIntent === "prev" || focusIntent === "next") {
173
- if (focusIntent === "prev") candidateNodes.reverse();
174
- const currentIndex = candidateNodes.indexOf(event.currentTarget);
175
- candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);
176
- }
177
- setTimeout(() => focusFirst(candidateNodes, {
178
- focusVisible: true
179
- }));
180
- }
181
- })
182
- })
183
- })
184
- });
117
+ const RovingFocusGroupItem = (0, import_core.createRefComponent)((props, forwardedRef) => {
118
+ const { __scopeRovingFocusGroup, active = false, tabStopId, tabIndex: tabIndexProp, ...itemProps } = props;
119
+ const focusable = Number(tabIndexProp ?? 0) >= 0;
120
+ const autoId = React.useId();
121
+ const id = tabStopId || autoId;
122
+ const context = useRovingFocusContext(__scopeRovingFocusGroup);
123
+ const isCurrentTabStop = context.currentTabStopId === id;
124
+ const getItems = useCollection(__scopeRovingFocusGroup || ROVING_FOCUS_GROUP_CONTEXT);
125
+ const skipNextFocusRequestRef = React.useRef(false);
126
+ const { onFocusableItemAdd, onFocusableItemRemove } = context;
127
+ React.useEffect(() => {
128
+ if (focusable) {
129
+ onFocusableItemAdd();
130
+ return () => onFocusableItemRemove();
131
+ }
132
+ }, [
133
+ focusable,
134
+ onFocusableItemAdd,
135
+ onFocusableItemRemove
136
+ ]);
137
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.ItemSlot, {
138
+ scope: __scopeRovingFocusGroup || ROVING_FOCUS_GROUP_CONTEXT,
139
+ id,
140
+ focusable,
141
+ active,
142
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.View, {
143
+ tabIndex: focusable && isCurrentTabStop ? 0 : -1,
144
+ "data-orientation": context.orientation,
145
+ ...itemProps,
146
+ ref: forwardedRef,
147
+ onMouseDown: (0, import_helpers.composeEventHandlers)(props.onMouseDown, (event) => {
148
+ if (!focusable) event.preventDefault();
149
+ else {
150
+ skipNextFocusRequestRef.current = true;
151
+ queueMicrotask(() => {
152
+ skipNextFocusRequestRef.current = false;
153
+ });
154
+ context.onItemFocus(id, event);
155
+ }
156
+ }),
157
+ onFocus: (0, import_helpers.composeEventHandlers)(props.onFocus, (event) => {
158
+ if (skipNextFocusRequestRef.current) {
159
+ skipNextFocusRequestRef.current = false;
160
+ return;
161
+ }
162
+ context.onItemFocus(id, event);
163
+ }),
164
+ ...import_constants.isWeb && { onKeyDown: (0, import_helpers.composeEventHandlers)(props.onKeyDown, (event) => {
165
+ if (event.key === "Tab" && event.shiftKey) {
166
+ context.onItemShiftTab();
167
+ return;
168
+ }
169
+ if (event.target !== event.currentTarget) return;
170
+ const focusIntent = getFocusIntent(event, context.orientation, context.dir);
171
+ if (focusIntent !== void 0) {
172
+ event.preventDefault();
173
+ const items = getItems().filter((item) => item.focusable);
174
+ let candidateNodes = items.map((item) => item.ref.current);
175
+ if (focusIntent === "last") candidateNodes.reverse();
176
+ else if (focusIntent === "prev" || focusIntent === "next") {
177
+ if (focusIntent === "prev") candidateNodes.reverse();
178
+ const currentIndex = candidateNodes.indexOf(event.currentTarget);
179
+ candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);
180
+ }
181
+ const details = (0, import_core.createChangeEventDetails)("keyboard", event, event.currentTarget);
182
+ setTimeout(() => {
183
+ context.setPendingFocusDetails(details);
184
+ focusFirst(candidateNodes, { focusVisible: true });
185
+ context.setPendingFocusDetails(null);
186
+ });
187
+ }
188
+ }) }
189
+ })
190
+ });
185
191
  });
186
192
  RovingFocusGroupItem.displayName = ITEM_NAME;
187
193
  const GROUP_NAME = "RovingFocusGroup";
188
194
  const [Collection, useCollection] = (0, import_collection.createCollection)(GROUP_NAME);
189
- const {
190
- Provider: RovingFocusProvider,
191
- useStyledContext: useRovingFocusContext
192
- } = (0, import_core.createStyledContext)();
195
+ const { Provider: RovingFocusProvider, useStyledContext: useRovingFocusContext } = (0, import_core.createStyledContext)();
193
196
  const ROVING_FOCUS_GROUP_CONTEXT = "RovingFocusGroupContext";
194
- const RovingFocusGroup = (0, import_helpers.withStaticProperties)(React.forwardRef((props, forwardedRef) => {
195
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)(Collection.Provider, {
196
- scope: props.__scopeRovingFocusGroup || ROVING_FOCUS_GROUP_CONTEXT,
197
- children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(Collection.Slot, {
198
- scope: props.__scopeRovingFocusGroup || ROVING_FOCUS_GROUP_CONTEXT,
199
- children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(RovingFocusGroupImpl, {
200
- ...props,
201
- ref: forwardedRef
202
- })
203
- })
204
- });
205
- }), {
206
- Item: RovingFocusGroupItem
207
- });
197
+ const RovingFocusGroup = (0, import_helpers.withStaticProperties)((0, import_core.createRefComponent)((props, forwardedRef) => {
198
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Provider, {
199
+ scope: props.__scopeRovingFocusGroup || ROVING_FOCUS_GROUP_CONTEXT,
200
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Slot, {
201
+ scope: props.__scopeRovingFocusGroup || ROVING_FOCUS_GROUP_CONTEXT,
202
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RovingFocusGroupImpl, {
203
+ ...props,
204
+ ref: forwardedRef
205
+ })
206
+ })
207
+ });
208
+ }), { Item: RovingFocusGroupItem });
208
209
  RovingFocusGroup.displayName = GROUP_NAME;
209
210
  const MAP_KEY_TO_FOCUS_INTENT = {
210
- ArrowLeft: "prev",
211
- ArrowUp: "prev",
212
- ArrowRight: "next",
213
- ArrowDown: "next",
214
- PageUp: "first",
215
- Home: "first",
216
- PageDown: "last",
217
- End: "last"
211
+ ArrowLeft: "prev",
212
+ ArrowUp: "prev",
213
+ ArrowRight: "next",
214
+ ArrowDown: "next",
215
+ PageUp: "first",
216
+ Home: "first",
217
+ PageDown: "last",
218
+ End: "last"
218
219
  };
219
220
  function getDirectionAwareKey(key, dir) {
220
- if (dir !== "rtl") return key;
221
- return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
221
+ if (dir !== "rtl") return key;
222
+ return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
222
223
  }
223
224
  function getFocusIntent(event, orientation, dir) {
224
- const key = getDirectionAwareKey(event.key, dir);
225
- if (orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0;
226
- if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0;
227
- return MAP_KEY_TO_FOCUS_INTENT[key];
225
+ const key = getDirectionAwareKey(event.key, dir);
226
+ if (orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0;
227
+ if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0;
228
+ return MAP_KEY_TO_FOCUS_INTENT[key];
228
229
  }
229
230
  function focusFirst(candidates, options) {
230
- const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
231
- for (const candidate of candidates) {
232
- if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
233
- candidate.focus({
234
- focusVisible: options?.focusVisible
235
- });
236
- if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
237
- }
231
+ const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
232
+ for (const candidate of candidates) {
233
+ if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
234
+ candidate.focus({ focusVisible: options?.focusVisible });
235
+ if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
236
+ }
238
237
  }
239
238
  function wrapArray(array, startIndex) {
240
- return array.map((_, index) => array[(startIndex + index) % array.length]);
241
- }
239
+ return array.map((_, index) => array[(startIndex + index) % array.length]);
240
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: () => from[key],
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
21
+ };
22
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
+ var RovingFocusGroup_native_exports = {};
24
+ __export(RovingFocusGroup_native_exports, {
25
+ RovingFocusGroup: () => RovingFocusGroup,
26
+ createRovingFocusGroupScope: () => createRovingFocusGroupScope
27
+ });
28
+ module.exports = __toCommonJS(RovingFocusGroup_native_exports);
29
+ var import_core = require("@tamagui/core");
30
+ var import_helpers = require("@tamagui/helpers");
31
+ var ITEM_NAME = "RovingFocusGroupItem";
32
+ var RovingFocusGroupItem = (0, import_core.styled)(import_core.View, { displayName: ITEM_NAME });
33
+ var GROUP_NAME = "RovingFocusGroup";
34
+ var RovingFocusGroupFrame = (0, import_core.styled)(import_core.View, { displayName: GROUP_NAME });
35
+ var RovingFocusGroup = (0, import_helpers.withStaticProperties)(RovingFocusGroupFrame, { Item: RovingFocusGroupItem });
36
+ RovingFocusGroup.displayName = GROUP_NAME;
37
+ var createRovingFocusGroupScope = function() {
38
+ return function() {
39
+ return {};
40
+ };
41
+ };
@@ -5,46 +5,39 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
12
  };
13
13
  var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: () => from[key],
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
21
21
  };
22
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
23
- value: true
24
- }), mod);
22
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
23
  var RovingFocusGroup_native_exports = {};
26
24
  __export(RovingFocusGroup_native_exports, {
27
- RovingFocusGroup: () => RovingFocusGroup,
28
- createRovingFocusGroupScope: () => createRovingFocusGroupScope
25
+ RovingFocusGroup: () => RovingFocusGroup,
26
+ createRovingFocusGroupScope: () => createRovingFocusGroupScope
29
27
  });
30
28
  module.exports = __toCommonJS(RovingFocusGroup_native_exports);
31
29
  var import_core = require("@tamagui/core");
32
30
  var import_helpers = require("@tamagui/helpers");
33
31
  var ITEM_NAME = "RovingFocusGroupItem";
34
- var RovingFocusGroupItem = (0, import_core.styled)(import_core.View, {
35
- name: ITEM_NAME
36
- });
32
+ var RovingFocusGroupItem = (0, import_core.styled)(import_core.View, { displayName: ITEM_NAME });
37
33
  var GROUP_NAME = "RovingFocusGroup";
38
- var RovingFocusGroupFrame = (0, import_core.styled)(import_core.View, {
39
- name: GROUP_NAME
40
- });
41
- var RovingFocusGroup = (0, import_helpers.withStaticProperties)(RovingFocusGroupFrame, {
42
- Item: RovingFocusGroupItem
43
- });
34
+ var RovingFocusGroupFrame = (0, import_core.styled)(import_core.View, { displayName: GROUP_NAME });
35
+ var RovingFocusGroup = (0, import_helpers.withStaticProperties)(RovingFocusGroupFrame, { Item: RovingFocusGroupItem });
44
36
  RovingFocusGroup.displayName = GROUP_NAME;
45
- var createRovingFocusGroupScope = function () {
46
- return function () {
47
- return {};
48
- };
37
+ var createRovingFocusGroupScope = function() {
38
+ return function() {
39
+ return {};
40
+ };
49
41
  };
42
+
50
43
  //# sourceMappingURL=RovingFocusGroup.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["RovingFocusGroup_native_exports","__export","RovingFocusGroup","createRovingFocusGroupScope","module","exports","__toCommonJS","import_core","require","import_helpers","ITEM_NAME","RovingFocusGroupItem","styled","View","name","GROUP_NAME","RovingFocusGroupFrame","withStaticProperties","Item","displayName"],"sources":["../../src/RovingFocusGroup.native.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,+BAAA;AAAAC,QAAA,CAAAD,+BAAA;EAAAE,gBAAA,EAAAA,CAAA,KAAAA,gBAAA;EAAAC,2BAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAN,+BAAA;AAAA,IAAAO,WAAA,GAA6BC,OAAA;AAC7B,IAAAC,cAAA,GAAqCD,OAAA;AAErC,IAAIE,SAAA,GAAY;AAChB,IAAIC,oBAAA,OAAuBJ,WAAA,CAAAK,MAAA,EAAOL,WAAA,CAAAM,IAAA,EAAM;EACpCC,IAAA,EAAMJ;AACV,CAAC;AACD,IAAIK,UAAA,GAAa;AACjB,IAAIC,qBAAA,OAAwBT,WAAA,CAAAK,MAAA,EAAOL,WAAA,CAAAM,IAAA,EAAM;EACrCC,IAAA,EAAMC;AACV,CAAC;AACD,IAAIb,gBAAA,OAAmBO,cAAA,CAAAQ,oBAAA,EAAqBD,qBAAA,EAAuB;EAC/DE,IAAA,EAAMP;AACV,CAAC;AACDT,gBAAA,CAAiBiB,WAAA,GAAcJ,UAAA;AAC/B,IAAIZ,2BAAA,GAA8B,SAAAA,CAAA,EAAW;EACzC,OAAO,YAAW;IACd,OAAO,CAAC;EACZ;AACJ","ignoreList":[]}
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,OAAM,CAAE,YAAY,MAAM,EACnE,aAAa,UACf,CAAC;AACD,IAAI,aAAa;AACjB,IAAI,yBAAyB,GAAG,YAAY,OAAM,CAAE,YAAY,MAAM,EACpE,aAAa,WACf,CAAC;AACD,IAAI,oBAAoB,GAAG,eAAe,qBAAoB,CAAE,uBAAuB,EACrF,MAAM,qBACR,CAAC;AACD,iBAAiB,cAAc;AAC/B,IAAI,8BAA8B,WAAW;CAC3C,OAAO,WAAW;EAChB,OAAO,CAAC;CACV;AACF"}
@@ -3,18 +3,16 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
8
- get: () => from[key],
9
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
10
- });
11
- }
12
- return to;
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
8
+ get: () => from[key],
9
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
10
+ });
11
+ }
12
+ return to;
13
13
  };
14
14
  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);
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
16
  var index_exports = {};
19
17
  module.exports = __toCommonJS(index_exports);
20
- __reExport(index_exports, require("./RovingFocusGroup.cjs"), module.exports);
18
+ __reExport(index_exports, require("./RovingFocusGroup.cjs"), module.exports);
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __copyProps = (to, from, except, desc) => {
8
+ if (from && typeof from === "object" || typeof from === "function") {
9
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
10
+ get: () => from[key],
11
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
12
+ });
13
+ }
14
+ return to;
15
+ };
16
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var index_exports = {};
19
+ module.exports = __toCommonJS(index_exports);
20
+ __reExport(index_exports, require("./RovingFocusGroup.native.js"), module.exports);