@tamagui/roving-focus 2.0.0-rc.4 → 2.0.0-rc.40

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.
@@ -2,187 +2,197 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf,
6
- __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __getProtoOf = Object.getPrototypeOf;
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: !0
11
- });
12
- },
13
- __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
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, {
15
16
  get: () => from[key],
16
17
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
18
  });
18
- return to;
19
- };
19
+ }
20
+ return to;
21
+ };
20
22
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
- value: mod,
27
- enumerable: !0
28
- }) : target, mod)),
29
- __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
30
- value: !0
31
- }), mod);
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
30
+ }) : target, mod));
31
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
+ value: true
33
+ }), mod);
32
34
  var RovingFocusGroup_exports = {};
33
35
  __export(RovingFocusGroup_exports, {
34
36
  RovingFocusGroup: () => RovingFocusGroup,
35
37
  RovingFocusGroupItem: () => RovingFocusGroupItem
36
38
  });
37
39
  module.exports = __toCommonJS(RovingFocusGroup_exports);
38
- var import_collection = require("@tamagui/collection"),
39
- import_compose_refs = require("@tamagui/compose-refs"),
40
- import_constants = require("@tamagui/constants"),
41
- import_core = require("@tamagui/core"),
42
- import_helpers = require("@tamagui/helpers"),
43
- import_use_controllable_state = require("@tamagui/use-controllable-state"),
44
- import_use_direction = require("@tamagui/use-direction"),
45
- React = __toESM(require("react"), 1),
46
- import_jsx_runtime = require("react/jsx-runtime");
47
- const ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus",
48
- EVENT_OPTIONS = {
49
- bubbles: !1,
50
- cancelable: !0
51
- },
52
- RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {
53
- const {
54
- __scopeRovingFocusGroup,
55
- orientation,
56
- loop = !1,
57
- dir,
58
- currentTabStopId: currentTabStopIdProp,
59
- defaultCurrentTabStopId,
60
- onCurrentTabStopIdChange,
61
- onEntryFocus,
62
- asChild,
63
- ...groupProps
64
- } = props,
65
- ref = React.useRef(null),
66
- composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref),
67
- direction = (0, import_use_direction.useDirection)(dir),
68
- [currentTabStopId = null, setCurrentTabStopId] = (0, import_use_controllable_state.useControllableState)({
69
- prop: currentTabStopIdProp,
70
- defaultProp: defaultCurrentTabStopId ?? null,
71
- onChange: onCurrentTabStopIdChange
40
+ var import_collection = require("@tamagui/collection");
41
+ var import_compose_refs = require("@tamagui/compose-refs");
42
+ var import_constants = require("@tamagui/constants");
43
+ var import_core = require("@tamagui/core");
44
+ var import_helpers = require("@tamagui/helpers");
45
+ var import_use_controllable_state = require("@tamagui/use-controllable-state");
46
+ var import_use_direction = require("@tamagui/use-direction");
47
+ var React = __toESM(require("react"), 1);
48
+ 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;
72
99
  }),
73
- [isTabbingBackOut, setIsTabbingBackOut] = React.useState(!1),
74
- handleEntryFocus = (0, import_core.useEvent)(onEntryFocus),
75
- getItems = useCollection(__scopeRovingFocusGroup || ROVING_FOCUS_GROUP_CONTEXT),
76
- isClickFocusRef = React.useRef(!1),
77
- [focusableItemsCount, setFocusableItemsCount] = React.useState(0),
78
- Comp = asChild ? import_core.Slot : import_core.View;
79
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)(RovingFocusProvider, {
80
- scope: __scopeRovingFocusGroup,
81
- orientation,
82
- dir: direction,
83
- loop,
84
- currentTabStopId,
85
- onItemFocus: React.useCallback(tabStopId => setCurrentTabStopId(tabStopId), [setCurrentTabStopId]),
86
- onItemShiftTab: React.useCallback(() => setIsTabbingBackOut(!0), []),
87
- onFocusableItemAdd: React.useCallback(() => setFocusableItemsCount(prevCount => prevCount + 1), []),
88
- onFocusableItemRemove: React.useCallback(() => setFocusableItemsCount(prevCount => prevCount - 1), []),
89
- children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(Comp, {
90
- tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
91
- "data-orientation": orientation,
92
- ...groupProps,
93
- ref: composedRefs,
94
- outlineStyle: "none",
95
- onMouseDown: (0, import_helpers.composeEventHandlers)(props.onMouseDown, () => {
96
- isClickFocusRef.current = !0;
97
- }),
98
- onFocus: (0, import_helpers.composeEventHandlers)(props.onFocus, event => {
99
- const isKeyboardFocus = !isClickFocusRef.current;
100
- if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
101
- const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);
102
- if (handleEntryFocus(entryFocusEvent), !entryFocusEvent.defaultPrevented) {
103
- const items = getItems().filter(item => item.focusable),
104
- activeItem = items.find(item => item.active),
105
- currentItem = items.find(item => item.id === currentTabStopId),
106
- candidateNodes = [activeItem, currentItem, ...items].filter(Boolean).map(item => item.ref.current);
107
- focusFirst(candidateNodes, {
108
- focusVisible: !1
109
- });
110
- }
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
+ });
111
114
  }
112
- isClickFocusRef.current = !1;
113
- }),
114
- onBlur: (0, import_helpers.composeEventHandlers)(props.onBlur, () => setIsTabbingBackOut(!1))
115
- })
116
- });
117
- }),
118
- ITEM_NAME = "RovingFocusGroupItem",
119
- RovingFocusGroupItem = React.forwardRef((props, forwardedRef) => {
120
- const {
121
- __scopeRovingFocusGroup,
122
- focusable = !0,
123
- active = !1,
124
- tabStopId,
125
- ...itemProps
126
- } = props,
127
- autoId = React.useId(),
128
- id = tabStopId || autoId,
129
- context = useRovingFocusContext(__scopeRovingFocusGroup),
130
- isCurrentTabStop = context.currentTabStopId === id,
131
- getItems = useCollection(__scopeRovingFocusGroup || ROVING_FOCUS_GROUP_CONTEXT),
132
- {
133
- onFocusableItemAdd,
134
- onFocusableItemRemove
135
- } = context;
136
- return React.useEffect(() => {
137
- if (focusable) return onFocusableItemAdd(), () => onFocusableItemRemove();
138
- }, [focusable, onFocusableItemAdd, onFocusableItemRemove]), /* @__PURE__ */(0, import_jsx_runtime.jsx)(Collection.ItemSlot, {
139
- scope: __scopeRovingFocusGroup || ROVING_FOCUS_GROUP_CONTEXT,
140
- id,
141
- focusable,
142
- active,
143
- children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_core.View, {
144
- tabIndex: focusable ? 0 : -1,
145
- "data-orientation": context.orientation,
146
- ...itemProps,
147
- ref: forwardedRef,
148
- onMouseDown: (0, import_helpers.composeEventHandlers)(props.onMouseDown, event => {
149
- focusable ? context.onItemFocus(id) : event.preventDefault();
150
- }),
151
- onFocus: (0, import_helpers.composeEventHandlers)(props.onFocus, () => context.onItemFocus(id)),
152
- ...(import_constants.isWeb && {
153
- onKeyDown: (0, import_helpers.composeEventHandlers)(props.onKeyDown, event => {
154
- if (event.key === "Tab" && event.shiftKey) {
155
- context.onItemShiftTab();
156
- return;
157
- }
158
- if (event.target !== event.currentTarget) return;
159
- const focusIntent = getFocusIntent(event, context.orientation, context.dir);
160
- if (focusIntent !== void 0) {
161
- event.preventDefault();
162
- let candidateNodes = getItems().filter(item => item.focusable).map(item => item.ref.current);
163
- if (focusIntent === "last") candidateNodes.reverse();else if (focusIntent === "prev" || focusIntent === "next") {
164
- focusIntent === "prev" && candidateNodes.reverse();
165
- const currentIndex = candidateNodes.indexOf(event.currentTarget);
166
- candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);
167
- }
168
- setTimeout(() => focusFirst(candidateNodes, {
169
- focusVisible: !0
170
- }));
115
+ }
116
+ isClickFocusRef.current = false;
117
+ }),
118
+ onBlur: (0, import_helpers.composeEventHandlers)(props.onBlur, () => setIsTabbingBackOut(false))
119
+ })
120
+ });
121
+ });
122
+ 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);
171
176
  }
172
- })
177
+ setTimeout(() => focusFirst(candidateNodes, {
178
+ focusVisible: true
179
+ }));
180
+ }
173
181
  })
174
182
  })
175
- });
183
+ })
176
184
  });
185
+ });
177
186
  RovingFocusGroupItem.displayName = ITEM_NAME;
178
- const GROUP_NAME = "RovingFocusGroup",
179
- [Collection, useCollection] = (0, import_collection.createCollection)(GROUP_NAME),
180
- {
181
- Provider: RovingFocusProvider,
182
- useStyledContext: useRovingFocusContext
183
- } = (0, import_core.createStyledContext)(),
184
- ROVING_FOCUS_GROUP_CONTEXT = "RovingFocusGroupContext",
185
- RovingFocusGroup = (0, import_helpers.withStaticProperties)(React.forwardRef((props, forwardedRef) => /* @__PURE__ */(0, import_jsx_runtime.jsx)(Collection.Provider, {
187
+ const GROUP_NAME = "RovingFocusGroup";
188
+ const [Collection, useCollection] = (0, import_collection.createCollection)(GROUP_NAME);
189
+ const {
190
+ Provider: RovingFocusProvider,
191
+ useStyledContext: useRovingFocusContext
192
+ } = (0, import_core.createStyledContext)();
193
+ 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, {
186
196
  scope: props.__scopeRovingFocusGroup || ROVING_FOCUS_GROUP_CONTEXT,
187
197
  children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(Collection.Slot, {
188
198
  scope: props.__scopeRovingFocusGroup || ROVING_FOCUS_GROUP_CONTEXT,
@@ -191,9 +201,10 @@ const GROUP_NAME = "RovingFocusGroup",
191
201
  ref: forwardedRef
192
202
  })
193
203
  })
194
- })), {
195
- Item: RovingFocusGroupItem
196
204
  });
205
+ }), {
206
+ Item: RovingFocusGroupItem
207
+ });
197
208
  RovingFocusGroup.displayName = GROUP_NAME;
198
209
  const MAP_KEY_TO_FOCUS_INTENT = {
199
210
  ArrowLeft: "prev",
@@ -206,17 +217,24 @@ const MAP_KEY_TO_FOCUS_INTENT = {
206
217
  End: "last"
207
218
  };
208
219
  function getDirectionAwareKey(key, dir) {
209
- return dir !== "rtl" ? key : key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
220
+ if (dir !== "rtl") return key;
221
+ return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
210
222
  }
211
223
  function getFocusIntent(event, orientation, dir) {
212
224
  const key = getDirectionAwareKey(event.key, dir);
213
- if (!(orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) && !(orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key))) return MAP_KEY_TO_FOCUS_INTENT[key];
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];
214
228
  }
215
229
  function focusFirst(candidates, options) {
216
230
  const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
217
- for (const candidate of candidates) if (candidate === PREVIOUSLY_FOCUSED_ELEMENT || (candidate.focus({
218
- focusVisible: options?.focusVisible
219
- }), document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT)) return;
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
+ }
220
238
  }
221
239
  function wrapArray(array, startIndex) {
222
240
  return array.map((_, index) => array[(startIndex + index) % array.length]);
@@ -1,71 +1,46 @@
1
1
  "use strict";
2
2
 
3
- var __create = Object.create;
4
3
  var __defProp = Object.defineProperty;
5
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf,
8
- __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
7
  var __export = (target, all) => {
10
- for (var name in all) __defProp(target, name, {
11
- get: all[name],
12
- enumerable: !0
13
- });
14
- },
15
- __copyProps = (to, from, except, desc) => {
16
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
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, {
17
16
  get: () => from[key],
18
17
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
18
  });
20
- return to;
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: !0
30
- }) : target, mod)),
31
- __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
- value: !0
33
- }), mod);
19
+ }
20
+ return to;
21
+ };
22
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
23
+ value: true
24
+ }), mod);
34
25
  var RovingFocusGroup_native_exports = {};
35
26
  __export(RovingFocusGroup_native_exports, {
36
27
  RovingFocusGroup: () => RovingFocusGroup,
37
28
  createRovingFocusGroupScope: () => createRovingFocusGroupScope
38
29
  });
39
30
  module.exports = __toCommonJS(RovingFocusGroup_native_exports);
40
- var import_jsx_runtime = require("react/jsx-runtime"),
41
- import_core = require("@tamagui/core"),
42
- import_helpers = require("@tamagui/helpers"),
43
- import_react = __toESM(require("react"), 1),
44
- ITEM_NAME = "RovingFocusGroupItem",
45
- RovingFocusGroupItem = /* @__PURE__ */import_react.default.forwardRef(function (param, _ref) {
46
- var {
47
- children,
48
- ...props
49
- } = param;
50
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_core.View, {
51
- ...props,
52
- children
53
- });
54
- });
55
- RovingFocusGroupItem.displayName = ITEM_NAME;
56
- var GROUP_NAME = "RovingFocusGroup",
57
- RovingFocusGroup = (0, import_helpers.withStaticProperties)(/* @__PURE__ */import_react.default.forwardRef(function (param, _ref) {
58
- var {
59
- children,
60
- ...props
61
- } = param;
62
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_core.View, {
63
- ...props,
64
- children
65
- });
66
- }), {
67
- Item: RovingFocusGroupItem
68
- });
31
+ var import_core = require("@tamagui/core");
32
+ var import_helpers = require("@tamagui/helpers");
33
+ var ITEM_NAME = "RovingFocusGroupItem";
34
+ var RovingFocusGroupItem = (0, import_core.styled)(import_core.View, {
35
+ name: ITEM_NAME
36
+ });
37
+ 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
+ });
69
44
  RovingFocusGroup.displayName = GROUP_NAME;
70
45
  var createRovingFocusGroupScope = function () {
71
46
  return function () {
@@ -1 +1 @@
1
- {"version":3,"names":["RovingFocusGroup_native_exports","__export","RovingFocusGroup","createRovingFocusGroupScope","module","exports","__toCommonJS","import_jsx_runtime","require","import_core","import_helpers","import_react","__toESM","ITEM_NAME","RovingFocusGroupItem","default","forwardRef","param","_ref","children","props","jsx","View","displayName","GROUP_NAME","withStaticProperties","Item"],"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,kBAAA,GAA4BC,OAAA;EAC5BC,WAAA,GAAqBD,OAAA;EACrBE,cAAA,GAAqCF,OAAA;EACrCG,YAAA,GAAkBC,OAAA,CAAAJ,OAAA;EAEdK,SAAA,GAAY;EACZC,oBAAA,GAAqC,eAAAH,YAAA,CAAAI,OAAA,CAAMC,UAAA,CAAW,UAASC,KAAA,EAAOC,IAAA,EAAM;IAC5E,IAAI;MAAEC,QAAA;MAAU,GAAGC;IAAM,IAAIH,KAAA;IAC7B,OAAqB,mBAAAV,kBAAA,CAAAc,GAAA,EAAKZ,WAAA,CAAAa,IAAA,EAAM;MAC5B,GAAGF,KAAA;MACHD;IACJ,CAAC;EACL,CAAC;AACDL,oBAAA,CAAqBS,WAAA,GAAcV,SAAA;AACnC,IAAIW,UAAA,GAAa;EACbtB,gBAAA,OAAmBQ,cAAA,CAAAe,oBAAA,EAAmC,eAAAd,YAAA,CAAAI,OAAA,CAAMC,UAAA,CAAW,UAASC,KAAA,EAAOC,IAAA,EAAM;IAC7F,IAAI;MAAEC,QAAA;MAAU,GAAGC;IAAM,IAAIH,KAAA;IAC7B,OAAqB,mBAAAV,kBAAA,CAAAc,GAAA,EAAKZ,WAAA,CAAAa,IAAA,EAAM;MAC5B,GAAGF,KAAA;MACHD;IACJ,CAAC;EACL,CAAC,GAAG;IACAO,IAAA,EAAMZ;EACV,CAAC;AACDZ,gBAAA,CAAiBqB,WAAA,GAAcC,UAAA;AAC/B,IAAIrB,2BAAA,GAA8B,SAAAA,CAAA,EAAW;EACzC,OAAO,YAAW;IACd,OAAO,CAAC;EACZ;AACJ","ignoreList":[]}
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":[]}
@@ -3,15 +3,17 @@ 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") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
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, {
7
8
  get: () => from[key],
8
9
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
9
10
  });
10
- return to;
11
- },
12
- __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
13
15
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
14
- value: !0
16
+ value: true
15
17
  }), mod);
16
18
  var index_exports = {};
17
19
  module.exports = __toCommonJS(index_exports);
@@ -5,15 +5,17 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __copyProps = (to, from, except, desc) => {
8
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
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, {
9
10
  get: () => from[key],
10
11
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
11
12
  });
12
- return to;
13
- },
14
- __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
13
+ }
14
+ return to;
15
+ };
16
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
17
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
16
- value: !0
18
+ value: true
17
19
  }), mod);
18
20
  var index_exports = {};
19
21
  module.exports = __toCommonJS(index_exports);
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA","ignoreList":[]}
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA","ignoreList":[]}