@tamagui/select 1.0.1-beta.113 → 1.0.1-beta.116

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.
Files changed (109) hide show
  1. package/dist/cjs/Select.js +61 -567
  2. package/dist/cjs/Select.js.map +2 -2
  3. package/dist/cjs/SelectContent.js +53 -0
  4. package/dist/cjs/SelectContent.js.map +7 -0
  5. package/dist/cjs/SelectContent.native.js +31 -0
  6. package/dist/cjs/SelectContent.native.js.map +7 -0
  7. package/dist/cjs/SelectImpl.js +393 -0
  8. package/dist/cjs/SelectImpl.js.map +7 -0
  9. package/dist/cjs/SelectScrollButton.js +128 -0
  10. package/dist/cjs/SelectScrollButton.js.map +7 -0
  11. package/dist/cjs/SelectScrollButton.native.js +32 -0
  12. package/dist/cjs/SelectScrollButton.native.js.map +7 -0
  13. package/dist/cjs/SelectViewport.js +96 -0
  14. package/dist/cjs/SelectViewport.js.map +7 -0
  15. package/dist/cjs/SelectViewport.native.js +43 -0
  16. package/dist/cjs/SelectViewport.native.js.map +7 -0
  17. package/dist/cjs/constants.js +47 -0
  18. package/dist/cjs/constants.js.map +7 -0
  19. package/dist/cjs/context.js +38 -0
  20. package/dist/cjs/context.js.map +7 -0
  21. package/dist/cjs/index.js +1 -0
  22. package/dist/cjs/index.js.map +2 -2
  23. package/dist/cjs/types.js +17 -0
  24. package/dist/cjs/types.js.map +7 -0
  25. package/dist/esm/Select.js +44 -574
  26. package/dist/esm/Select.js.map +2 -2
  27. package/dist/esm/SelectContent.js +26 -0
  28. package/dist/esm/SelectContent.js.map +7 -0
  29. package/dist/esm/SelectContent.native.js +7 -0
  30. package/dist/esm/SelectContent.native.js.map +7 -0
  31. package/dist/esm/SelectImpl.js +378 -0
  32. package/dist/esm/SelectImpl.js.map +7 -0
  33. package/dist/esm/SelectScrollButton.js +100 -0
  34. package/dist/esm/SelectScrollButton.js.map +7 -0
  35. package/dist/esm/SelectScrollButton.native.js +7 -0
  36. package/dist/esm/SelectScrollButton.native.js.map +7 -0
  37. package/dist/esm/SelectViewport.js +68 -0
  38. package/dist/esm/SelectViewport.js.map +7 -0
  39. package/dist/esm/SelectViewport.native.js +16 -0
  40. package/dist/esm/SelectViewport.native.js.map +7 -0
  41. package/dist/esm/constants.js +17 -0
  42. package/dist/esm/constants.js.map +7 -0
  43. package/dist/esm/context.js +11 -0
  44. package/dist/esm/context.js.map +7 -0
  45. package/dist/esm/index.js +1 -0
  46. package/dist/esm/index.js.map +2 -2
  47. package/dist/esm/types.js +1 -0
  48. package/dist/esm/types.js.map +7 -0
  49. package/dist/jsx/Select.js +43 -516
  50. package/dist/jsx/Select.js.map +2 -2
  51. package/dist/jsx/SelectContent.js +19 -0
  52. package/dist/jsx/SelectContent.js.map +7 -0
  53. package/dist/jsx/SelectContent.native.js +7 -0
  54. package/dist/jsx/SelectContent.native.js.map +7 -0
  55. package/dist/jsx/SelectImpl.js +366 -0
  56. package/dist/jsx/SelectImpl.js.map +7 -0
  57. package/dist/jsx/SelectScrollButton.js +78 -0
  58. package/dist/jsx/SelectScrollButton.js.map +7 -0
  59. package/dist/jsx/SelectScrollButton.native.js +7 -0
  60. package/dist/jsx/SelectScrollButton.native.js.map +7 -0
  61. package/dist/jsx/SelectViewport.js +57 -0
  62. package/dist/jsx/SelectViewport.js.map +7 -0
  63. package/dist/jsx/SelectViewport.native.js +14 -0
  64. package/dist/jsx/SelectViewport.native.js.map +7 -0
  65. package/dist/jsx/constants.js +17 -0
  66. package/dist/jsx/constants.js.map +7 -0
  67. package/dist/jsx/context.js +11 -0
  68. package/dist/jsx/context.js.map +7 -0
  69. package/dist/jsx/index.js +1 -0
  70. package/dist/jsx/index.js.map +2 -2
  71. package/dist/jsx/types.js +1 -0
  72. package/dist/jsx/types.js.map +7 -0
  73. package/package.json +12 -12
  74. package/src/Select.tsx +69 -890
  75. package/src/SelectContent.native.tsx +5 -0
  76. package/src/SelectContent.tsx +34 -0
  77. package/src/SelectImpl.tsx +511 -0
  78. package/src/SelectScrollButton.native.tsx +7 -0
  79. package/src/SelectScrollButton.tsx +150 -0
  80. package/src/SelectViewport.native.tsx +17 -0
  81. package/src/SelectViewport.tsx +86 -0
  82. package/src/constants.tsx +7 -0
  83. package/src/context.tsx +9 -0
  84. package/src/index.tsx +7 -0
  85. package/src/types.tsx +83 -0
  86. package/types/Select.d.ts +83 -241
  87. package/types/Select.d.ts.map +1 -1
  88. package/types/SelectContent.d.ts +4 -0
  89. package/types/SelectContent.d.ts.map +1 -0
  90. package/types/SelectContent.native.d.ts +4 -0
  91. package/types/SelectContent.native.d.ts.map +1 -0
  92. package/types/SelectImpl.d.ts +9 -0
  93. package/types/SelectImpl.d.ts.map +1 -0
  94. package/types/SelectScrollButton.d.ts +6 -0
  95. package/types/SelectScrollButton.d.ts.map +1 -0
  96. package/types/SelectScrollButton.native.d.ts +4 -0
  97. package/types/SelectScrollButton.native.d.ts.map +1 -0
  98. package/types/SelectViewport.d.ts +127 -0
  99. package/types/SelectViewport.d.ts.map +1 -0
  100. package/types/SelectViewport.native.d.ts +54 -0
  101. package/types/SelectViewport.native.d.ts.map +1 -0
  102. package/types/constants.d.ts +8 -0
  103. package/types/constants.d.ts.map +1 -0
  104. package/types/context.d.ts +17 -0
  105. package/types/context.d.ts.map +1 -0
  106. package/types/index.d.ts +2 -0
  107. package/types/index.d.ts.map +1 -1
  108. package/types/types.d.ts +74 -0
  109. package/types/types.d.ts.map +1 -0
@@ -0,0 +1,393 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
21
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
+ var SelectImpl_exports = {};
23
+ __export(SelectImpl_exports, {
24
+ SelectInlineImpl: () => SelectInlineImpl
25
+ });
26
+ module.exports = __toCommonJS(SelectImpl_exports);
27
+ var import_react_dom_interactions = require("@floating-ui/react-dom-interactions");
28
+ var import_react_use_previous = require("@radix-ui/react-use-previous");
29
+ var React = __toESM(require("react"));
30
+ var import_constants = require("./constants");
31
+ var import_context = require("./context");
32
+ var import_Select = require("./Select");
33
+ const SelectInlineImpl = (props) => {
34
+ const {
35
+ __scopeSelect,
36
+ children,
37
+ open = false,
38
+ activeIndexRef,
39
+ selectedIndexRef,
40
+ listContentRef
41
+ } = props;
42
+ const selectContext = (0, import_context.useSelectContext)("SelectSheetImpl", __scopeSelect);
43
+ const { setActiveIndex, setOpen, setSelectedIndex, selectedIndex, activeIndex, forceUpdate } = selectContext;
44
+ const [showArrows, setShowArrows] = React.useState(false);
45
+ const [scrollTop, setScrollTop] = React.useState(0);
46
+ const prevActiveIndex = (0, import_react_use_previous.usePrevious)(activeIndex);
47
+ const listItemsRef = React.useRef([]);
48
+ const [controlledScrolling, setControlledScrolling] = React.useState(false);
49
+ const [middlewareType, setMiddlewareType] = React.useState("align");
50
+ React.useEffect(() => {
51
+ const frame = requestAnimationFrame(() => {
52
+ setShowArrows(open);
53
+ if (!open) {
54
+ setScrollTop(0);
55
+ setMiddlewareType("align");
56
+ setActiveIndex(null);
57
+ setControlledScrolling(false);
58
+ }
59
+ });
60
+ return () => {
61
+ cancelAnimationFrame(frame);
62
+ };
63
+ }, [open, setActiveIndex]);
64
+ function getFloatingPadding(floating2) {
65
+ var _a;
66
+ if (!floating2) {
67
+ return 0;
68
+ }
69
+ return Number((_a = getComputedStyle(floating2).paddingLeft) == null ? void 0 : _a.replace("px", ""));
70
+ }
71
+ const { x, y, reference, floating, strategy, context, refs, middlewareData, update } = (0, import_react_dom_interactions.useFloating)({
72
+ open,
73
+ onOpenChange: setOpen,
74
+ placement: "bottom",
75
+ middleware: middlewareType === "align" ? [
76
+ (0, import_react_dom_interactions.offset)(({ rects }) => {
77
+ const index = activeIndexRef.current ?? selectedIndexRef.current;
78
+ if (index == null) {
79
+ return 0;
80
+ }
81
+ const item = listItemsRef.current[index];
82
+ if (item == null) {
83
+ return 0;
84
+ }
85
+ const offsetTop = item.offsetTop;
86
+ const itemHeight = item.offsetHeight;
87
+ const height = rects.reference.height;
88
+ return -offsetTop - height - (itemHeight - height) / 2;
89
+ }),
90
+ {
91
+ name: "size",
92
+ async fn(args) {
93
+ var _a;
94
+ const {
95
+ elements: { floating: floating2 },
96
+ rects: { reference: reference2 },
97
+ middlewareData: middlewareData2
98
+ } = args;
99
+ const overflow = await (0, import_react_dom_interactions.detectOverflow)(args, {
100
+ padding: import_constants.WINDOW_PADDING
101
+ });
102
+ const top = Math.max(0, overflow.top);
103
+ const bottom = Math.max(0, overflow.bottom);
104
+ const nextY = args.y + top;
105
+ if ((_a = middlewareData2.size) == null ? void 0 : _a.skip) {
106
+ return {
107
+ y: nextY,
108
+ data: {
109
+ y: middlewareData2.size.y
110
+ }
111
+ };
112
+ }
113
+ Object.assign(floating2.style, {
114
+ maxHeight: `${floating2.scrollHeight - Math.abs(top + bottom)}px`,
115
+ minWidth: `${reference2.width + getFloatingPadding(floating2) * 2}px`
116
+ });
117
+ return {
118
+ y: nextY,
119
+ data: {
120
+ y: top,
121
+ skip: true
122
+ },
123
+ reset: {
124
+ rects: true
125
+ }
126
+ };
127
+ }
128
+ }
129
+ ] : [
130
+ (0, import_react_dom_interactions.offset)(5),
131
+ (0, import_react_dom_interactions.flip)(),
132
+ (0, import_react_dom_interactions.size)({
133
+ apply({ rects, availableHeight, elements }) {
134
+ Object.assign(elements.floating.style, {
135
+ width: `${rects.reference.width}px`,
136
+ maxHeight: `${availableHeight}px`
137
+ });
138
+ },
139
+ padding: import_constants.WINDOW_PADDING
140
+ })
141
+ ]
142
+ });
143
+ const floatingRef = refs.floating;
144
+ const showUpArrow = showArrows && scrollTop > import_constants.SCROLL_ARROW_THRESHOLD;
145
+ const showDownArrow = showArrows && floatingRef.current && scrollTop < floatingRef.current.scrollHeight - floatingRef.current.clientHeight - import_constants.SCROLL_ARROW_THRESHOLD;
146
+ const interactions = (0, import_react_dom_interactions.useInteractions)([
147
+ (0, import_react_dom_interactions.useClick)(context, { pointerDown: true }),
148
+ (0, import_react_dom_interactions.useRole)(context, { role: "listbox" }),
149
+ (0, import_react_dom_interactions.useDismiss)(context),
150
+ (0, import_react_dom_interactions.useListNavigation)(context, {
151
+ listRef: listItemsRef,
152
+ activeIndex,
153
+ selectedIndex,
154
+ onNavigate: setActiveIndex
155
+ }),
156
+ (0, import_react_dom_interactions.useTypeahead)(context, {
157
+ listRef: listContentRef,
158
+ onMatch: open ? setActiveIndex : setSelectedIndex,
159
+ selectedIndex,
160
+ activeIndex
161
+ })
162
+ ]);
163
+ const increaseHeight = React.useCallback((floating2, amount = 0) => {
164
+ if (middlewareType === "fallback") {
165
+ return;
166
+ }
167
+ const currentMaxHeight = Number(floating2.style.maxHeight.replace("px", ""));
168
+ const currentTop = Number(floating2.style.top.replace("px", ""));
169
+ const rect = floating2.getBoundingClientRect();
170
+ const rectTop = rect.top;
171
+ const rectBottom = rect.bottom;
172
+ const viewportHeight = (visualViewport == null ? void 0 : visualViewport.height) ?? 0;
173
+ const visualMaxHeight = viewportHeight - import_constants.WINDOW_PADDING * 2;
174
+ if (amount < 0 && selectedIndexRef.current != null && Math.round(rectBottom) < Math.round(viewportHeight + (0, import_Select.getVisualOffsetTop)() - import_constants.WINDOW_PADDING)) {
175
+ floating2.style.maxHeight = `${Math.min(visualMaxHeight, currentMaxHeight - amount)}px`;
176
+ }
177
+ if (amount > 0 && Math.round(rectTop) > Math.round(import_constants.WINDOW_PADDING - (0, import_Select.getVisualOffsetTop)()) && floating2.scrollHeight > floating2.offsetHeight) {
178
+ const nextTop = Math.max(import_constants.WINDOW_PADDING + (0, import_Select.getVisualOffsetTop)(), currentTop - amount);
179
+ const nextMaxHeight = Math.min(visualMaxHeight, currentMaxHeight + amount);
180
+ Object.assign(floating2.style, {
181
+ maxHeight: `${nextMaxHeight}px`,
182
+ top: `${nextTop}px`
183
+ });
184
+ if (nextTop - import_constants.WINDOW_PADDING > (0, import_Select.getVisualOffsetTop)()) {
185
+ floating2.scrollTop -= nextMaxHeight - currentMaxHeight + getFloatingPadding(floating2);
186
+ }
187
+ return currentTop - nextTop;
188
+ }
189
+ }, [middlewareType, selectedIndexRef]);
190
+ const touchPageYRef = React.useRef(null);
191
+ const handleWheel = React.useCallback((event) => {
192
+ var _a;
193
+ const pinching = event.ctrlKey;
194
+ const currentTarget = event.currentTarget;
195
+ function isWheelEvent(event2) {
196
+ return typeof event2.deltaY === "number";
197
+ }
198
+ function isTouchEvent(event2) {
199
+ return event2.touches != null;
200
+ }
201
+ if (Math.abs(((currentTarget == null ? void 0 : currentTarget.offsetHeight) ?? 0) - (((visualViewport == null ? void 0 : visualViewport.height) ?? 0) - import_constants.WINDOW_PADDING * 2)) > 1 && !pinching) {
202
+ event.preventDefault();
203
+ } else if (isWheelEvent(event) && import_Select.isFirefox) {
204
+ currentTarget.scrollTop += event.deltaY;
205
+ }
206
+ if (!pinching) {
207
+ let delta = 5;
208
+ if (isTouchEvent(event)) {
209
+ const currentPageY = touchPageYRef.current;
210
+ const pageY = (_a = event.touches[0]) == null ? void 0 : _a.pageY;
211
+ if (pageY != null) {
212
+ touchPageYRef.current = pageY;
213
+ if (currentPageY != null) {
214
+ delta = currentPageY - pageY;
215
+ }
216
+ }
217
+ }
218
+ increaseHeight(currentTarget, isWheelEvent(event) ? event.deltaY : delta);
219
+ setScrollTop(currentTarget.scrollTop);
220
+ forceUpdate();
221
+ }
222
+ }, [forceUpdate, increaseHeight]);
223
+ React.useEffect(() => {
224
+ function onTouchEnd() {
225
+ touchPageYRef.current = null;
226
+ }
227
+ const floating2 = floatingRef.current;
228
+ if (open && floating2 && middlewareType === "align") {
229
+ floating2.addEventListener("wheel", handleWheel);
230
+ floating2.addEventListener("touchmove", handleWheel);
231
+ floating2.addEventListener("touchend", onTouchEnd, { passive: true });
232
+ return () => {
233
+ floating2.removeEventListener("wheel", handleWheel);
234
+ floating2.removeEventListener("touchmove", handleWheel);
235
+ floating2.removeEventListener("touchend", onTouchEnd);
236
+ };
237
+ }
238
+ }, [open, floatingRef, handleWheel, middlewareType]);
239
+ React.useEffect(() => {
240
+ window.addEventListener("resize", update);
241
+ return () => {
242
+ window.removeEventListener("resize", update);
243
+ };
244
+ }, [update]);
245
+ React.useLayoutEffect(() => {
246
+ var _a;
247
+ const floating2 = floatingRef.current;
248
+ if (open && controlledScrolling && floating2) {
249
+ const item = activeIndex != null ? listItemsRef.current[activeIndex] : selectedIndex != null ? listItemsRef.current[selectedIndex] : null;
250
+ if (item && prevActiveIndex != null) {
251
+ const itemHeight = ((_a = listItemsRef.current[prevActiveIndex]) == null ? void 0 : _a.offsetHeight) ?? 0;
252
+ const floatingHeight = floating2.offsetHeight;
253
+ const top = item.offsetTop;
254
+ const bottom = top + itemHeight;
255
+ if (top < floating2.scrollTop + 20) {
256
+ const diff = floating2.scrollTop - top + 20;
257
+ floating2.scrollTop -= diff;
258
+ if (activeIndex != selectedIndex && activeIndex != null) {
259
+ increaseHeight(floating2, -diff);
260
+ }
261
+ } else if (bottom > floatingHeight + floating2.scrollTop - 20) {
262
+ const diff = bottom - floatingHeight - floating2.scrollTop + 20;
263
+ floating2.scrollTop += diff;
264
+ if (activeIndex != selectedIndex && activeIndex != null) {
265
+ floating2.scrollTop -= increaseHeight(floating2, diff) ?? 0;
266
+ }
267
+ }
268
+ }
269
+ }
270
+ }, [
271
+ open,
272
+ controlledScrolling,
273
+ prevActiveIndex,
274
+ activeIndex,
275
+ selectedIndex,
276
+ floatingRef,
277
+ increaseHeight
278
+ ]);
279
+ React.useLayoutEffect(() => {
280
+ var _a;
281
+ const floating2 = refs.floating.current;
282
+ const reference2 = refs.reference.current;
283
+ if (open && floating2 && reference2 && floating2.offsetHeight < floating2.scrollHeight) {
284
+ const referenceRect = reference2.getBoundingClientRect();
285
+ if (middlewareType === "fallback") {
286
+ const item = listItemsRef.current[selectedIndex];
287
+ if (item) {
288
+ floating2.scrollTop = item.offsetTop - floating2.clientHeight + referenceRect.height;
289
+ }
290
+ return;
291
+ }
292
+ floating2.scrollTop = (_a = middlewareData.size) == null ? void 0 : _a.y;
293
+ const closeToBottom = ((visualViewport == null ? void 0 : visualViewport.height) ?? 0) + (0, import_Select.getVisualOffsetTop)() - referenceRect.bottom < import_constants.FALLBACK_THRESHOLD;
294
+ const closeToTop = referenceRect.top < import_constants.FALLBACK_THRESHOLD;
295
+ if (floating2.offsetHeight < import_constants.MIN_HEIGHT || closeToTop || closeToBottom) {
296
+ setMiddlewareType("fallback");
297
+ }
298
+ }
299
+ }, [
300
+ open,
301
+ increaseHeight,
302
+ selectedIndex,
303
+ middlewareType,
304
+ refs.floating,
305
+ refs.reference,
306
+ middlewareData
307
+ ]);
308
+ React.useLayoutEffect(() => {
309
+ if (open && selectedIndex != null) {
310
+ requestAnimationFrame(() => {
311
+ var _a;
312
+ (_a = listItemsRef.current[selectedIndex]) == null ? void 0 : _a.focus({ preventScroll: true });
313
+ });
314
+ }
315
+ }, [listItemsRef, selectedIndex, open]);
316
+ React.useEffect(() => {
317
+ const frame = requestAnimationFrame(() => {
318
+ setShowArrows(open);
319
+ if (!open) {
320
+ setScrollTop(0);
321
+ setMiddlewareType("align");
322
+ setActiveIndex(null);
323
+ setControlledScrolling(false);
324
+ }
325
+ });
326
+ return () => cancelAnimationFrame(frame);
327
+ }, [open, setActiveIndex]);
328
+ return /* @__PURE__ */ React.createElement(import_context.SelectProvider, {
329
+ scope: __scopeSelect,
330
+ ...selectContext,
331
+ increaseHeight,
332
+ floatingRef,
333
+ setValueAtIndex: (index, value) => {
334
+ listContentRef.current[index] = value;
335
+ },
336
+ interactions: {
337
+ ...interactions,
338
+ getReferenceProps() {
339
+ return interactions.getReferenceProps({
340
+ ref: reference,
341
+ className: "SelectTrigger",
342
+ onKeyDown(event) {
343
+ if (event.key === "Enter" || event.key === " " && !context.dataRef.current.typing) {
344
+ event.preventDefault();
345
+ setOpen(true);
346
+ }
347
+ }
348
+ });
349
+ },
350
+ getFloatingProps(props2) {
351
+ return interactions.getFloatingProps({
352
+ ref: floating,
353
+ className: "Select",
354
+ ...props2,
355
+ style: {
356
+ position: strategy,
357
+ top: y ?? "",
358
+ left: x ?? "",
359
+ outline: 0,
360
+ listStyleType: "none",
361
+ scrollbarWidth: "none",
362
+ userSelect: "none",
363
+ ...props2 == null ? void 0 : props2.style
364
+ },
365
+ onPointerEnter() {
366
+ setControlledScrolling(false);
367
+ },
368
+ onPointerMove() {
369
+ setControlledScrolling(false);
370
+ },
371
+ onKeyDown() {
372
+ setControlledScrolling(true);
373
+ },
374
+ onScroll(event) {
375
+ setScrollTop(event.currentTarget.scrollTop);
376
+ }
377
+ });
378
+ }
379
+ },
380
+ floatingContext: context,
381
+ activeIndex,
382
+ canScrollDown: !!showDownArrow,
383
+ canScrollUp: !!showUpArrow,
384
+ controlledScrolling: true,
385
+ dataRef: context.dataRef,
386
+ listRef: listItemsRef
387
+ }, children);
388
+ };
389
+ // Annotate the CommonJS export names for ESM import in node:
390
+ 0 && (module.exports = {
391
+ SelectInlineImpl
392
+ });
393
+ //# sourceMappingURL=SelectImpl.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/SelectImpl.tsx"],
4
+ "sourcesContent": ["import {\n detectOverflow,\n flip,\n offset,\n size,\n useClick,\n useDismiss,\n useFloating,\n useInteractions,\n useListNavigation,\n useRole,\n useTypeahead,\n} from '@floating-ui/react-dom-interactions'\nimport { usePrevious } from '@radix-ui/react-use-previous'\nimport * as React from 'react'\n\nimport { FALLBACK_THRESHOLD, MIN_HEIGHT, SCROLL_ARROW_THRESHOLD, WINDOW_PADDING } from './constants'\nimport { SelectProvider, useSelectContext } from './context'\nimport { getVisualOffsetTop, isFirefox } from './Select'\nimport { ScopedProps, SelectProps } from './types'\n\nexport type SelectImplProps = ScopedProps<SelectProps> & {\n activeIndexRef: any\n selectedIndexRef: any\n listContentRef: any\n}\n\n// TODO use id for focusing from label\nexport const SelectInlineImpl = (props: SelectImplProps) => {\n const {\n __scopeSelect,\n children,\n open = false,\n activeIndexRef,\n selectedIndexRef,\n listContentRef,\n } = props\n\n const selectContext = useSelectContext('SelectSheetImpl', __scopeSelect)\n const { setActiveIndex, setOpen, setSelectedIndex, selectedIndex, activeIndex, forceUpdate } =\n selectContext\n const [showArrows, setShowArrows] = React.useState(false)\n const [scrollTop, setScrollTop] = React.useState(0)\n const prevActiveIndex = usePrevious<number | null>(activeIndex)\n\n const listItemsRef = React.useRef<Array<HTMLElement | null>>([])\n\n const [controlledScrolling, setControlledScrolling] = React.useState(false)\n const [middlewareType, setMiddlewareType] = React.useState<'align' | 'fallback'>('align')\n\n // Wait for scroll position to settle before showing arrows to prevent\n // interference with pointer events.\n React.useEffect(() => {\n const frame = requestAnimationFrame(() => {\n setShowArrows(open)\n\n if (!open) {\n setScrollTop(0)\n setMiddlewareType('align')\n setActiveIndex(null)\n setControlledScrolling(false)\n }\n })\n return () => {\n cancelAnimationFrame(frame)\n }\n }, [open, setActiveIndex])\n\n function getFloatingPadding(floating: HTMLElement | null) {\n if (!floating) {\n return 0\n }\n return Number(getComputedStyle(floating).paddingLeft?.replace('px', ''))\n }\n\n const { x, y, reference, floating, strategy, context, refs, middlewareData, update } =\n useFloating({\n open,\n onOpenChange: setOpen,\n placement: 'bottom',\n middleware:\n middlewareType === 'align'\n ? [\n offset(({ rects }) => {\n const index = activeIndexRef.current ?? selectedIndexRef.current\n\n if (index == null) {\n return 0\n }\n\n const item = listItemsRef.current[index]\n\n if (item == null) {\n return 0\n }\n\n const offsetTop = item.offsetTop\n const itemHeight = item.offsetHeight\n const height = rects.reference.height\n\n return -offsetTop - height - (itemHeight - height) / 2\n }),\n // Custom `size` that can handle the opposite direction of the placement\n {\n name: 'size',\n async fn(args) {\n const {\n elements: { floating },\n rects: { reference },\n middlewareData,\n } = args\n\n const overflow = await detectOverflow(args, {\n padding: WINDOW_PADDING,\n })\n\n const top = Math.max(0, overflow.top)\n const bottom = Math.max(0, overflow.bottom)\n const nextY = args.y + top\n\n if (middlewareData.size?.skip) {\n return {\n y: nextY,\n data: {\n y: middlewareData.size.y,\n },\n }\n }\n\n Object.assign(floating.style, {\n maxHeight: `${floating.scrollHeight - Math.abs(top + bottom)}px`,\n minWidth: `${reference.width + getFloatingPadding(floating) * 2}px`,\n })\n\n return {\n y: nextY,\n data: {\n y: top,\n skip: true,\n },\n reset: {\n rects: true,\n },\n }\n },\n },\n ]\n : [\n offset(5),\n flip(),\n size({\n apply({ rects, availableHeight, elements }) {\n Object.assign(elements.floating.style, {\n width: `${rects.reference.width}px`,\n maxHeight: `${availableHeight}px`,\n })\n },\n padding: WINDOW_PADDING,\n }),\n ],\n })\n\n const floatingRef = refs.floating\n\n const showUpArrow = showArrows && scrollTop > SCROLL_ARROW_THRESHOLD\n const showDownArrow =\n showArrows &&\n floatingRef.current &&\n scrollTop <\n floatingRef.current.scrollHeight - floatingRef.current.clientHeight - SCROLL_ARROW_THRESHOLD\n\n const interactions = useInteractions([\n useClick(context, { pointerDown: true }),\n useRole(context, { role: 'listbox' }),\n useDismiss(context),\n useListNavigation(context, {\n listRef: listItemsRef,\n activeIndex,\n selectedIndex,\n onNavigate: setActiveIndex,\n }),\n useTypeahead(context, {\n listRef: listContentRef,\n onMatch: open ? setActiveIndex : setSelectedIndex,\n selectedIndex,\n activeIndex,\n }),\n ])\n\n const increaseHeight = React.useCallback(\n (floating: HTMLElement, amount = 0) => {\n if (middlewareType === 'fallback') {\n return\n }\n\n const currentMaxHeight = Number(floating.style.maxHeight.replace('px', ''))\n const currentTop = Number(floating.style.top.replace('px', ''))\n const rect = floating.getBoundingClientRect()\n const rectTop = rect.top\n const rectBottom = rect.bottom\n const viewportHeight = visualViewport?.height ?? 0\n const visualMaxHeight = viewportHeight - WINDOW_PADDING * 2\n\n if (\n amount < 0 &&\n selectedIndexRef.current != null &&\n Math.round(rectBottom) < Math.round(viewportHeight + getVisualOffsetTop() - WINDOW_PADDING)\n ) {\n floating.style.maxHeight = `${Math.min(visualMaxHeight, currentMaxHeight - amount)}px`\n }\n\n if (\n amount > 0 &&\n Math.round(rectTop) > Math.round(WINDOW_PADDING - getVisualOffsetTop()) &&\n floating.scrollHeight > floating.offsetHeight\n ) {\n const nextTop = Math.max(WINDOW_PADDING + getVisualOffsetTop(), currentTop - amount)\n\n const nextMaxHeight = Math.min(visualMaxHeight, currentMaxHeight + amount)\n\n Object.assign(floating.style, {\n maxHeight: `${nextMaxHeight}px`,\n top: `${nextTop}px`,\n })\n\n if (nextTop - WINDOW_PADDING > getVisualOffsetTop()) {\n floating.scrollTop -= nextMaxHeight - currentMaxHeight + getFloatingPadding(floating)\n }\n\n return currentTop - nextTop\n }\n },\n [middlewareType, selectedIndexRef]\n )\n\n const touchPageYRef = React.useRef<number | null>(null)\n\n const handleWheel = React.useCallback(\n (event: WheelEvent | TouchEvent) => {\n const pinching = event.ctrlKey\n\n const currentTarget = event.currentTarget as HTMLElement\n\n function isWheelEvent(event: any): event is WheelEvent {\n return typeof event.deltaY === 'number'\n }\n\n function isTouchEvent(event: any): event is TouchEvent {\n return event.touches != null\n }\n\n if (\n Math.abs(\n (currentTarget?.offsetHeight ?? 0) - ((visualViewport?.height ?? 0) - WINDOW_PADDING * 2)\n ) > 1 &&\n !pinching\n ) {\n event.preventDefault()\n } else if (isWheelEvent(event) && isFirefox) {\n // Firefox needs this to propagate scrolling\n // during momentum scrolling phase if the\n // height reached its maximum (at boundaries)\n currentTarget.scrollTop += event.deltaY\n }\n\n if (!pinching) {\n let delta = 5\n\n if (isTouchEvent(event)) {\n const currentPageY = touchPageYRef.current\n const pageY = event.touches[0]?.pageY\n\n if (pageY != null) {\n touchPageYRef.current = pageY\n\n if (currentPageY != null) {\n delta = currentPageY - pageY\n }\n }\n }\n\n increaseHeight(currentTarget, isWheelEvent(event) ? event.deltaY : delta)\n setScrollTop(currentTarget.scrollTop)\n // Ensure derived data (scroll arrows) is fresh\n forceUpdate()\n }\n },\n [forceUpdate, increaseHeight]\n )\n\n // Handle `onWheel` event in an effect to remove the `passive` option so we\n // can .preventDefault() it\n React.useEffect(() => {\n function onTouchEnd() {\n touchPageYRef.current = null\n }\n\n const floating = floatingRef.current\n if (open && floating && middlewareType === 'align') {\n floating.addEventListener('wheel', handleWheel)\n floating.addEventListener('touchmove', handleWheel)\n floating.addEventListener('touchend', onTouchEnd, { passive: true })\n return () => {\n floating.removeEventListener('wheel', handleWheel)\n floating.removeEventListener('touchmove', handleWheel)\n floating.removeEventListener('touchend', onTouchEnd)\n }\n }\n }, [open, floatingRef, handleWheel, middlewareType])\n\n // Ensure the menu remains attached to the reference element when resizing.\n React.useEffect(() => {\n window.addEventListener('resize', update)\n return () => {\n window.removeEventListener('resize', update)\n }\n }, [update])\n\n // Scroll the active or selected item into view when in `controlledScrolling`\n // mode (i.e. arrow key nav).\n React.useLayoutEffect(() => {\n const floating = floatingRef.current\n\n if (open && controlledScrolling && floating) {\n const item =\n activeIndex != null\n ? listItemsRef.current[activeIndex]\n : selectedIndex != null\n ? listItemsRef.current[selectedIndex]\n : null\n\n if (item && prevActiveIndex != null) {\n const itemHeight = listItemsRef.current[prevActiveIndex]?.offsetHeight ?? 0\n\n const floatingHeight = floating.offsetHeight\n const top = item.offsetTop\n const bottom = top + itemHeight\n\n if (top < floating.scrollTop + 20) {\n const diff = floating.scrollTop - top + 20\n floating.scrollTop -= diff\n\n if (activeIndex != selectedIndex && activeIndex != null) {\n increaseHeight(floating, -diff)\n }\n } else if (bottom > floatingHeight + floating.scrollTop - 20) {\n const diff = bottom - floatingHeight - floating.scrollTop + 20\n\n floating.scrollTop += diff\n\n if (activeIndex != selectedIndex && activeIndex != null) {\n floating.scrollTop -= increaseHeight(floating, diff) ?? 0\n }\n }\n }\n }\n }, [\n open,\n controlledScrolling,\n prevActiveIndex,\n activeIndex,\n selectedIndex,\n floatingRef,\n increaseHeight,\n ])\n\n // Sync the height and the scrollTop values and device whether to use fallback\n // positioning.\n React.useLayoutEffect(() => {\n const floating = refs.floating.current\n const reference = refs.reference.current\n\n if (open && floating && reference && floating.offsetHeight < floating.scrollHeight) {\n const referenceRect = reference.getBoundingClientRect()\n\n if (middlewareType === 'fallback') {\n const item = listItemsRef.current[selectedIndex]\n if (item) {\n floating.scrollTop = item.offsetTop - floating.clientHeight + referenceRect.height\n }\n return\n }\n\n floating.scrollTop = middlewareData.size?.y\n\n const closeToBottom =\n (visualViewport?.height ?? 0) + getVisualOffsetTop() - referenceRect.bottom <\n FALLBACK_THRESHOLD\n const closeToTop = referenceRect.top < FALLBACK_THRESHOLD\n\n if (floating.offsetHeight < MIN_HEIGHT || closeToTop || closeToBottom) {\n setMiddlewareType('fallback')\n }\n }\n }, [\n open,\n increaseHeight,\n selectedIndex,\n middlewareType,\n refs.floating,\n refs.reference,\n // Always re-run this effect when the position has been computed so the\n // .scrollTop change works with fresh sizing.\n middlewareData,\n ])\n\n React.useLayoutEffect(() => {\n if (open && selectedIndex != null) {\n requestAnimationFrame(() => {\n listItemsRef.current[selectedIndex]?.focus({ preventScroll: true })\n })\n }\n }, [listItemsRef, selectedIndex, open])\n\n // Wait for scroll position to settle before showing arrows to prevent\n // interference with pointer events.\n React.useEffect(() => {\n const frame = requestAnimationFrame(() => {\n setShowArrows(open)\n\n if (!open) {\n setScrollTop(0)\n setMiddlewareType('align')\n setActiveIndex(null)\n setControlledScrolling(false)\n }\n })\n return () => cancelAnimationFrame(frame)\n }, [open, setActiveIndex])\n\n // We set this to true by default so that events bubble to forms without JS (SSR)\n // const isFormControl = trigger ? Boolean(trigger.closest('form')) : true\n // const [bubbleSelect, setBubbleSelect] = React.useState<HTMLSelectElement | null>(null)\n // const triggerPointerDownPosRef = React.useRef<{ x: number; y: number } | null>(null)\n return (\n <SelectProvider\n scope={__scopeSelect}\n {...(selectContext as Required<typeof selectContext>)}\n increaseHeight={increaseHeight}\n floatingRef={floatingRef}\n setValueAtIndex={(index, value) => {\n listContentRef.current[index] = value\n }}\n interactions={{\n ...interactions,\n getReferenceProps() {\n return interactions.getReferenceProps({\n ref: reference,\n className: 'SelectTrigger',\n onKeyDown(event) {\n if (event.key === 'Enter' || (event.key === ' ' && !context.dataRef.current.typing)) {\n event.preventDefault()\n setOpen(true)\n }\n },\n })\n },\n getFloatingProps(props) {\n return interactions.getFloatingProps({\n ref: floating,\n className: 'Select',\n ...props,\n style: {\n position: strategy,\n top: y ?? '',\n left: x ?? '',\n outline: 0,\n listStyleType: 'none',\n scrollbarWidth: 'none',\n userSelect: 'none',\n ...props?.style,\n },\n onPointerEnter() {\n setControlledScrolling(false)\n },\n onPointerMove() {\n setControlledScrolling(false)\n },\n onKeyDown() {\n setControlledScrolling(true)\n },\n onScroll(event) {\n setScrollTop(event.currentTarget.scrollTop)\n },\n })\n },\n }}\n floatingContext={context}\n activeIndex={activeIndex}\n canScrollDown={!!showDownArrow}\n canScrollUp={!!showUpArrow}\n controlledScrolling\n dataRef={context.dataRef}\n listRef={listItemsRef}\n >\n {children}\n {/* {isFormControl ? (\n <BubbleSelect\n ref={setBubbleSelect}\n aria-hidden\n tabIndex={-1}\n name={name}\n autoComplete={autoComplete}\n value={value}\n // enable form autofill\n onChange={(event) => setValue(event.target.value)}\n />\n ) : null} */}\n </SelectProvider>\n )\n}\n"],
5
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,KAAK;AAAA,YACX,SAAS;AAAA,YACT,eAAe;AAAA,YACf,gBAAgB;AAAA,YAChB,YAAY;AAAA,YACZ,GAAG,iCAAO;AAAA,UACZ;AAAA,UACA,iBAAiB;AACf,mCAAuB,KAAK;AAAA,UAC9B;AAAA,UACA,gBAAgB;AACd,mCAAuB,KAAK;AAAA,UAC9B;AAAA,UACA,YAAY;AACV,mCAAuB,IAAI;AAAA,UAC7B;AAAA,UACA,SAAS,OAAO;AACd,yBAAa,MAAM,cAAc,SAAS;AAAA,UAC5C;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,IACjB;AAAA,IACA,eAAe,CAAC,CAAC;AAAA,IACjB,aAAa,CAAC,CAAC;AAAA,IACf,qBAAmB;AAAA,IACnB,SAAS,QAAQ;AAAA,IACjB,SAAS;AAAA,KAER,QAaH;AAEJ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
21
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
+ var SelectScrollButton_exports = {};
23
+ __export(SelectScrollButton_exports, {
24
+ SelectScrollDownButton: () => SelectScrollDownButton,
25
+ SelectScrollUpButton: () => SelectScrollUpButton
26
+ });
27
+ module.exports = __toCommonJS(SelectScrollButton_exports);
28
+ var import_react_dom_interactions = require("@floating-ui/react-dom-interactions");
29
+ var import_compose_refs = require("@tamagui/compose-refs");
30
+ var import_stacks = require("@tamagui/stacks");
31
+ var React = __toESM(require("react"));
32
+ var import_constants = require("./constants");
33
+ var import_context = require("./context");
34
+ const SCROLL_UP_BUTTON_NAME = "SelectScrollUpButton";
35
+ const SelectScrollUpButton = React.forwardRef((props, forwardedRef) => {
36
+ return /* @__PURE__ */ React.createElement(SelectScrollButtonImpl, {
37
+ componentName: SCROLL_UP_BUTTON_NAME,
38
+ ...props,
39
+ dir: "up",
40
+ ref: forwardedRef
41
+ });
42
+ });
43
+ SelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME;
44
+ const SCROLL_DOWN_BUTTON_NAME = "SelectScrollDownButton";
45
+ const SelectScrollDownButton = React.forwardRef((props, forwardedRef) => {
46
+ return /* @__PURE__ */ React.createElement(SelectScrollButtonImpl, {
47
+ componentName: SCROLL_DOWN_BUTTON_NAME,
48
+ ...props,
49
+ dir: "down",
50
+ ref: forwardedRef
51
+ });
52
+ });
53
+ SelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;
54
+ const SelectScrollButtonImpl = React.memo(React.forwardRef((props, forwardedRef) => {
55
+ var _a;
56
+ const { __scopeSelect, dir, componentName, ...scrollIndicatorProps } = props;
57
+ const { floatingRef, increaseHeight, forceUpdate, ...context } = (0, import_context.useSelectContext)(componentName, __scopeSelect);
58
+ const intervalRef = React.useRef();
59
+ const loopingRef = React.useRef(false);
60
+ const isVisible = context[dir === "down" ? "canScrollDown" : "canScrollUp"];
61
+ const { x, y, reference, floating, strategy, update, refs } = (0, import_react_dom_interactions.useFloating)({
62
+ strategy: "fixed",
63
+ placement: dir === "up" ? "top" : "bottom",
64
+ middleware: [(0, import_react_dom_interactions.offset)(({ rects }) => -rects.floating.height)]
65
+ });
66
+ const composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, floating);
67
+ React.useLayoutEffect(() => {
68
+ if (!floatingRef)
69
+ return;
70
+ reference(floatingRef.current);
71
+ }, [reference, floatingRef == null ? void 0 : floatingRef.current]);
72
+ React.useEffect(() => {
73
+ if (!refs.reference.current || !refs.floating.current || !isVisible) {
74
+ return;
75
+ }
76
+ const cleanup = (0, import_react_dom_interactions.autoUpdate)(refs.reference.current, refs.floating.current, update, {
77
+ animationFrame: true
78
+ });
79
+ return () => {
80
+ clearInterval(intervalRef.current);
81
+ loopingRef.current = false;
82
+ cleanup();
83
+ };
84
+ }, [isVisible, update, refs.floating, refs.reference]);
85
+ if (!isVisible) {
86
+ return null;
87
+ }
88
+ const handleScrollArrowChange = () => {
89
+ if (!floatingRef)
90
+ return;
91
+ const floating2 = floatingRef.current;
92
+ const isUp = dir === "up";
93
+ if (floating2) {
94
+ const value = isUp ? -import_constants.SCROLL_ARROW_VELOCITY : import_constants.SCROLL_ARROW_VELOCITY;
95
+ const multi = isUp && floating2.scrollTop <= import_constants.SCROLL_ARROW_THRESHOLD * 2 || !isUp && floating2.scrollTop >= floating2.scrollHeight - floating2.clientHeight - import_constants.SCROLL_ARROW_THRESHOLD * 2 ? 2 : 1;
96
+ floating2.scrollTop += multi * (isUp ? -import_constants.SCROLL_ARROW_VELOCITY : import_constants.SCROLL_ARROW_VELOCITY);
97
+ increaseHeight == null ? void 0 : increaseHeight(floating2, multi === 2 ? value * 2 : value);
98
+ forceUpdate();
99
+ }
100
+ };
101
+ return /* @__PURE__ */ React.createElement(import_stacks.YStack, {
102
+ ref: composedRefs,
103
+ componentName,
104
+ "aria-hidden": true,
105
+ ...scrollIndicatorProps,
106
+ zIndex: 1e3,
107
+ position: strategy,
108
+ left: x || 0,
109
+ top: y || 0,
110
+ width: `calc(${(((_a = floatingRef == null ? void 0 : floatingRef.current) == null ? void 0 : _a.offsetWidth) ?? 0) - 2}px)`,
111
+ onPointerMove: () => {
112
+ if (!loopingRef.current) {
113
+ intervalRef.current = setInterval(handleScrollArrowChange, 1e3 / 60);
114
+ loopingRef.current = true;
115
+ }
116
+ },
117
+ onPointerLeave: () => {
118
+ loopingRef.current = false;
119
+ clearInterval(intervalRef.current);
120
+ }
121
+ });
122
+ }));
123
+ // Annotate the CommonJS export names for ESM import in node:
124
+ 0 && (module.exports = {
125
+ SelectScrollDownButton,
126
+ SelectScrollUpButton
127
+ });
128
+ //# sourceMappingURL=SelectScrollButton.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/SelectScrollButton.tsx"],
4
+ "sourcesContent": ["import { autoUpdate, offset, useFloating } from '@floating-ui/react-dom-interactions'\nimport { useComposedRefs } from '@tamagui/compose-refs'\nimport { TamaguiElement } from '@tamagui/core'\nimport { YStack } from '@tamagui/stacks'\nimport * as React from 'react'\n\nimport { SCROLL_ARROW_THRESHOLD, SCROLL_ARROW_VELOCITY } from './constants'\nimport { useSelectContext } from './context'\nimport { ScopedProps, SelectScrollButtonImplProps, SelectScrollButtonProps } from './types'\n\n/* -------------------------------------------------------------------------------------------------\n * SelectScrollUpButton\n * -----------------------------------------------------------------------------------------------*/\n\nconst SCROLL_UP_BUTTON_NAME = 'SelectScrollUpButton'\n\nexport const SelectScrollUpButton = React.forwardRef<TamaguiElement, SelectScrollButtonProps>(\n (props: ScopedProps<SelectScrollButtonProps>, forwardedRef) => {\n return (\n <SelectScrollButtonImpl\n componentName={SCROLL_UP_BUTTON_NAME}\n {...props}\n dir=\"up\"\n ref={forwardedRef}\n />\n )\n }\n)\n\nSelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SelectScrollDownButton\n * -----------------------------------------------------------------------------------------------*/\n\nconst SCROLL_DOWN_BUTTON_NAME = 'SelectScrollDownButton'\n\nexport const SelectScrollDownButton = React.forwardRef<TamaguiElement, SelectScrollButtonProps>(\n (props: ScopedProps<SelectScrollButtonProps>, forwardedRef) => {\n return (\n <SelectScrollButtonImpl\n componentName={SCROLL_DOWN_BUTTON_NAME}\n {...props}\n dir=\"down\"\n ref={forwardedRef}\n />\n )\n }\n)\n\nSelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME\n\ntype SelectScrollButtonImplElement = TamaguiElement\n\nconst SelectScrollButtonImpl = React.memo(\n React.forwardRef<SelectScrollButtonImplElement, SelectScrollButtonImplProps>(\n (props: ScopedProps<SelectScrollButtonImplProps>, forwardedRef) => {\n const { __scopeSelect, dir, componentName, ...scrollIndicatorProps } = props\n const { floatingRef, increaseHeight, forceUpdate, ...context } = useSelectContext(\n componentName,\n __scopeSelect\n )\n const intervalRef = React.useRef<any>()\n const loopingRef = React.useRef(false)\n const isVisible = context[dir === 'down' ? 'canScrollDown' : 'canScrollUp']\n\n const { x, y, reference, floating, strategy, update, refs } = useFloating({\n strategy: 'fixed',\n placement: dir === 'up' ? 'top' : 'bottom',\n middleware: [offset(({ rects }) => -rects.floating.height)],\n })\n\n const composedRefs = useComposedRefs(forwardedRef, floating)\n\n React.useLayoutEffect(() => {\n if (!floatingRef) return\n reference(floatingRef.current)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [reference, floatingRef?.current])\n\n React.useEffect(() => {\n if (!refs.reference.current || !refs.floating.current || !isVisible) {\n return\n }\n\n const cleanup = autoUpdate(refs.reference.current, refs.floating.current, update, {\n animationFrame: true,\n })\n\n return () => {\n clearInterval(intervalRef.current)\n loopingRef.current = false\n cleanup()\n }\n }, [isVisible, update, refs.floating, refs.reference])\n\n if (!isVisible) {\n return null\n }\n\n const handleScrollArrowChange = () => {\n if (!floatingRef) return\n const floating = floatingRef.current\n const isUp = dir === 'up'\n\n if (floating) {\n const value = isUp ? -SCROLL_ARROW_VELOCITY : SCROLL_ARROW_VELOCITY\n const multi =\n (isUp && floating.scrollTop <= SCROLL_ARROW_THRESHOLD * 2) ||\n (!isUp &&\n floating.scrollTop >=\n floating.scrollHeight - floating.clientHeight - SCROLL_ARROW_THRESHOLD * 2)\n ? 2\n : 1\n\n floating.scrollTop += multi * (isUp ? -SCROLL_ARROW_VELOCITY : SCROLL_ARROW_VELOCITY)\n\n increaseHeight?.(floating, multi === 2 ? value * 2 : value)\n // Ensure derived data (scroll arrows) is fresh\n forceUpdate()\n }\n }\n\n return (\n <YStack\n ref={composedRefs}\n componentName={componentName}\n aria-hidden\n {...scrollIndicatorProps}\n zIndex={1000}\n // @ts-expect-error\n position={strategy}\n left={x || 0}\n top={y || 0}\n width={`calc(${(floatingRef?.current?.offsetWidth ?? 0) - 2}px)`}\n onPointerMove={() => {\n if (!loopingRef.current) {\n intervalRef.current = setInterval(handleScrollArrowChange, 1000 / 60)\n loopingRef.current = true\n }\n }}\n onPointerLeave={() => {\n loopingRef.current = false\n clearInterval(intervalRef.current)\n }}\n />\n )\n }\n )\n)\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oCAAgD;AAChD,0BAAgC;AAEhC,oBAAuB;AACvB,YAAuB;AAEvB,uBAA8D;AAC9D,qBAAiC;AAOjC,MAAM,wBAAwB;AAEvB,MAAM,uBAAuB,MAAM,WACxC,CAAC,OAA6C,iBAAiB;AAC7D,SACE,oCAAC;AAAA,IACC,eAAe;AAAA,IACd,GAAG;AAAA,IACJ,KAAI;AAAA,IACJ,KAAK;AAAA,GACP;AAEJ,CACF;AAEA,qBAAqB,cAAc;AAMnC,MAAM,0BAA0B;AAEzB,MAAM,yBAAyB,MAAM,WAC1C,CAAC,OAA6C,iBAAiB;AAC7D,SACE,oCAAC;AAAA,IACC,eAAe;AAAA,IACd,GAAG;AAAA,IACJ,KAAI;AAAA,IACJ,KAAK;AAAA,GACP;AAEJ,CACF;AAEA,uBAAuB,cAAc;AAI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AM,QAAQ,OAAO,CAAC,yCAAwB;AAC9C,YAAM,QACH,QAAQ,UAAS,aAAa,0CAAyB,KACvD,CAAC,QACA,UAAS,aACP,UAAS,eAAe,UAAS,eAAe,0CAAyB,IACzE,IACA;AAEN,gBAAS,aAAa,QAAS,QAAO,CAAC,yCAAwB;AAE/D,uDAAiB,WAAU,UAAU,IAAI,QAAQ,IAAI;AAErD,kBAAY;AAAA,IACd;AAAA,EACF;AAEA,SACE,oCAAC;AAAA,IACC,KAAK;AAAA,IACL;AAAA,IACA,eAAW;AAAA,IACV,GAAG;AAAA,IACJ,QAAQ;AAAA,IAER,UAAU;AAAA,IACV,MAAM,KAAK;AAAA,IACX,KAAK,KAAK;AAAA,IACV,OAAO,QAAS,mDAAa,YAAb,mBAAsB,gBAAe,KAAK;AAAA,IAC1D,eAAe,MAAM;AACnB,UAAI,CAAC,WAAW,SAAS;AACvB,oBAAY,UAAU,YAAY,yBAAyB,MAAO,EAAE;AACpE,mBAAW,UAAU;AAAA,MACvB;AAAA,IACF;AAAA,IACA,gBAAgB,MAAM;AACpB,iBAAW,UAAU;AACrB,oBAAc,YAAY,OAAO;AAAA,IACnC;AAAA,GACF;AAEJ,CACF,CACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var SelectScrollButton_native_exports = {};
20
+ __export(SelectScrollButton_native_exports, {
21
+ SelectScrollDownButton: () => SelectScrollDownButton,
22
+ SelectScrollUpButton: () => SelectScrollUpButton
23
+ });
24
+ module.exports = __toCommonJS(SelectScrollButton_native_exports);
25
+ const SelectScrollUpButton = (_) => null;
26
+ const SelectScrollDownButton = (_) => null;
27
+ // Annotate the CommonJS export names for ESM import in node:
28
+ 0 && (module.exports = {
29
+ SelectScrollDownButton,
30
+ SelectScrollUpButton
31
+ });
32
+ //# sourceMappingURL=SelectScrollButton.native.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/SelectScrollButton.native.tsx"],
4
+ "sourcesContent": ["import { ScopedProps, SelectScrollButtonProps } from './types'\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport const SelectScrollUpButton = (_: ScopedProps<SelectScrollButtonProps>) => null\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport const SelectScrollDownButton = (_: ScopedProps<SelectScrollButtonProps>) => null\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,uBAAuB,CAAC,MAA4C;AAG1E,MAAM,yBAAyB,CAAC,MAA4C;",
6
+ "names": []
7
+ }