@tamagui/select 2.7.7 → 3.0.0-beta.643.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.
Files changed (248) hide show
  1. package/dist/cjs/Select.cjs +409 -467
  2. package/dist/cjs/Select.native.cjs +495 -0
  3. package/dist/cjs/Select.native.js +445 -492
  4. package/dist/cjs/Select.native.js.map +1 -1
  5. package/dist/cjs/SelectContent.cjs +80 -79
  6. package/dist/cjs/SelectContent.native.cjs +30 -0
  7. package/dist/cjs/SelectContent.native.js +18 -22
  8. package/dist/cjs/SelectContent.native.js.map +1 -1
  9. package/dist/cjs/SelectImpl.cjs +299 -319
  10. package/dist/cjs/SelectImpl.native.cjs +30 -0
  11. package/dist/cjs/SelectImpl.native.js +17 -24
  12. package/dist/cjs/SelectImpl.native.js.map +1 -1
  13. package/dist/cjs/SelectItem.cjs +268 -205
  14. package/dist/cjs/SelectItem.native.cjs +317 -0
  15. package/dist/cjs/SelectItem.native.js +291 -211
  16. package/dist/cjs/SelectItem.native.js.map +1 -1
  17. package/dist/cjs/SelectItemText.cjs +49 -79
  18. package/dist/cjs/SelectItemText.native.cjs +74 -0
  19. package/dist/cjs/SelectItemText.native.js +50 -79
  20. package/dist/cjs/SelectItemText.native.js.map +1 -1
  21. package/dist/cjs/SelectScrollButton.cjs +111 -130
  22. package/dist/cjs/SelectScrollButton.native.cjs +38 -0
  23. package/dist/cjs/SelectScrollButton.native.js +25 -22
  24. package/dist/cjs/SelectScrollButton.native.js.map +1 -1
  25. package/dist/cjs/SelectTrigger.cjs +69 -84
  26. package/dist/cjs/SelectTrigger.native.cjs +91 -0
  27. package/dist/cjs/SelectTrigger.native.js +71 -66
  28. package/dist/cjs/SelectTrigger.native.js.map +1 -1
  29. package/dist/cjs/SelectViewport.cjs +119 -142
  30. package/dist/cjs/SelectViewport.native.cjs +73 -0
  31. package/dist/cjs/SelectViewport.native.js +54 -50
  32. package/dist/cjs/SelectViewport.native.js.map +1 -1
  33. package/dist/cjs/constants.cjs +21 -22
  34. package/dist/cjs/constants.native.cjs +41 -0
  35. package/dist/cjs/constants.native.js +21 -21
  36. package/dist/cjs/constants.native.js.map +1 -1
  37. package/dist/cjs/context.cjs +38 -48
  38. package/dist/cjs/context.native.cjs +58 -0
  39. package/dist/cjs/context.native.js +40 -49
  40. package/dist/cjs/context.native.js.map +1 -1
  41. package/dist/cjs/index.cjs +15 -11
  42. package/dist/cjs/index.native.cjs +27 -0
  43. package/dist/cjs/index.native.js +15 -10
  44. package/dist/cjs/index.native.js.map +1 -1
  45. package/dist/cjs/selectionController.cjs +334 -0
  46. package/dist/cjs/selectionController.native.cjs +403 -0
  47. package/dist/cjs/selectionController.native.js +405 -0
  48. package/dist/cjs/selectionController.native.js.map +1 -0
  49. package/dist/cjs/types.cjs +10 -11
  50. package/dist/cjs/types.native.cjs +19 -0
  51. package/dist/cjs/types.native.js +10 -10
  52. package/dist/cjs/types.native.js.map +1 -1
  53. package/dist/esm/Select.mjs +382 -443
  54. package/dist/esm/Select.mjs.map +1 -1
  55. package/dist/esm/Select.native.js +418 -469
  56. package/dist/esm/Select.native.js.map +1 -1
  57. package/dist/esm/SelectContent.mjs +67 -61
  58. package/dist/esm/SelectContent.mjs.map +1 -1
  59. package/dist/esm/SelectContent.native.js +4 -5
  60. package/dist/esm/SelectContent.native.js.map +1 -1
  61. package/dist/esm/SelectImpl.mjs +284 -294
  62. package/dist/esm/SelectImpl.mjs.map +1 -1
  63. package/dist/esm/SelectImpl.native.js +5 -8
  64. package/dist/esm/SelectImpl.native.js.map +1 -1
  65. package/dist/esm/SelectItem.mjs +252 -182
  66. package/dist/esm/SelectItem.mjs.map +1 -1
  67. package/dist/esm/SelectItem.native.js +276 -190
  68. package/dist/esm/SelectItem.native.js.map +1 -1
  69. package/dist/esm/SelectItemText.mjs +33 -55
  70. package/dist/esm/SelectItemText.mjs.map +1 -1
  71. package/dist/esm/SelectItemText.native.js +34 -56
  72. package/dist/esm/SelectItemText.native.js.map +1 -1
  73. package/dist/esm/SelectScrollButton.mjs +95 -107
  74. package/dist/esm/SelectScrollButton.mjs.map +1 -1
  75. package/dist/esm/SelectScrollButton.native.js +11 -7
  76. package/dist/esm/SelectScrollButton.native.js.map +1 -1
  77. package/dist/esm/SelectTrigger.mjs +56 -58
  78. package/dist/esm/SelectTrigger.mjs.map +1 -1
  79. package/dist/esm/SelectTrigger.native.js +54 -44
  80. package/dist/esm/SelectTrigger.native.js.map +1 -1
  81. package/dist/esm/SelectViewport.mjs +104 -119
  82. package/dist/esm/SelectViewport.mjs.map +1 -1
  83. package/dist/esm/SelectViewport.native.js +44 -39
  84. package/dist/esm/SelectViewport.native.js.map +1 -1
  85. package/dist/esm/constants.mjs +1 -0
  86. package/dist/esm/constants.mjs.map +1 -1
  87. package/dist/esm/constants.native.js +1 -0
  88. package/dist/esm/constants.native.js.map +1 -1
  89. package/dist/esm/context.mjs +20 -28
  90. package/dist/esm/context.mjs.map +1 -1
  91. package/dist/esm/context.native.js +23 -31
  92. package/dist/esm/context.native.js.map +1 -1
  93. package/dist/esm/index.js +13 -3
  94. package/dist/esm/index.mjs +13 -3
  95. package/dist/esm/index.native.js +13 -3
  96. package/dist/esm/selectionController.mjs +305 -0
  97. package/dist/esm/selectionController.mjs.map +1 -0
  98. package/dist/esm/selectionController.native.js +372 -0
  99. package/dist/esm/selectionController.native.js.map +1 -0
  100. package/dist/esm/types.mjs +0 -2
  101. package/dist/esm/types.native.js +0 -2
  102. package/dist/jsx/Select.mjs +382 -443
  103. package/dist/jsx/Select.mjs.map +1 -1
  104. package/dist/jsx/Select.native.cjs +495 -0
  105. package/dist/jsx/Select.native.js +445 -492
  106. package/dist/jsx/Select.native.js.map +1 -1
  107. package/dist/jsx/SelectContent.mjs +67 -61
  108. package/dist/jsx/SelectContent.mjs.map +1 -1
  109. package/dist/jsx/SelectContent.native.cjs +30 -0
  110. package/dist/jsx/SelectContent.native.js +18 -22
  111. package/dist/jsx/SelectContent.native.js.map +1 -1
  112. package/dist/jsx/SelectImpl.mjs +284 -294
  113. package/dist/jsx/SelectImpl.mjs.map +1 -1
  114. package/dist/jsx/SelectImpl.native.cjs +30 -0
  115. package/dist/jsx/SelectImpl.native.js +17 -24
  116. package/dist/jsx/SelectImpl.native.js.map +1 -1
  117. package/dist/jsx/SelectItem.mjs +252 -182
  118. package/dist/jsx/SelectItem.mjs.map +1 -1
  119. package/dist/jsx/SelectItem.native.cjs +317 -0
  120. package/dist/jsx/SelectItem.native.js +291 -211
  121. package/dist/jsx/SelectItem.native.js.map +1 -1
  122. package/dist/jsx/SelectItemText.mjs +33 -55
  123. package/dist/jsx/SelectItemText.mjs.map +1 -1
  124. package/dist/jsx/SelectItemText.native.cjs +74 -0
  125. package/dist/jsx/SelectItemText.native.js +50 -79
  126. package/dist/jsx/SelectItemText.native.js.map +1 -1
  127. package/dist/jsx/SelectScrollButton.mjs +95 -107
  128. package/dist/jsx/SelectScrollButton.mjs.map +1 -1
  129. package/dist/jsx/SelectScrollButton.native.cjs +38 -0
  130. package/dist/jsx/SelectScrollButton.native.js +25 -22
  131. package/dist/jsx/SelectScrollButton.native.js.map +1 -1
  132. package/dist/jsx/SelectTrigger.mjs +56 -58
  133. package/dist/jsx/SelectTrigger.mjs.map +1 -1
  134. package/dist/jsx/SelectTrigger.native.cjs +91 -0
  135. package/dist/jsx/SelectTrigger.native.js +71 -66
  136. package/dist/jsx/SelectTrigger.native.js.map +1 -1
  137. package/dist/jsx/SelectViewport.mjs +104 -119
  138. package/dist/jsx/SelectViewport.mjs.map +1 -1
  139. package/dist/jsx/SelectViewport.native.cjs +73 -0
  140. package/dist/jsx/SelectViewport.native.js +54 -50
  141. package/dist/jsx/SelectViewport.native.js.map +1 -1
  142. package/dist/jsx/constants.mjs +1 -0
  143. package/dist/jsx/constants.mjs.map +1 -1
  144. package/dist/jsx/constants.native.cjs +41 -0
  145. package/dist/jsx/constants.native.js +21 -21
  146. package/dist/jsx/constants.native.js.map +1 -1
  147. package/dist/jsx/context.mjs +20 -28
  148. package/dist/jsx/context.mjs.map +1 -1
  149. package/dist/jsx/context.native.cjs +58 -0
  150. package/dist/jsx/context.native.js +40 -49
  151. package/dist/jsx/context.native.js.map +1 -1
  152. package/dist/jsx/index.js +13 -3
  153. package/dist/jsx/index.mjs +13 -3
  154. package/dist/jsx/index.native.cjs +27 -0
  155. package/dist/jsx/index.native.js +15 -10
  156. package/dist/jsx/index.native.js.map +1 -1
  157. package/dist/jsx/selectionController.mjs +305 -0
  158. package/dist/jsx/selectionController.mjs.map +1 -0
  159. package/dist/jsx/selectionController.native.cjs +403 -0
  160. package/dist/jsx/selectionController.native.js +405 -0
  161. package/dist/jsx/selectionController.native.js.map +1 -0
  162. package/dist/jsx/types.mjs +0 -2
  163. package/dist/jsx/types.native.cjs +19 -0
  164. package/dist/jsx/types.native.js +10 -10
  165. package/dist/jsx/types.native.js.map +1 -1
  166. package/package.json +28 -28
  167. package/src/Select.tsx +457 -357
  168. package/src/SelectContent.tsx +46 -16
  169. package/src/SelectImpl.native.tsx +0 -8
  170. package/src/SelectImpl.tsx +87 -100
  171. package/src/SelectItem.tsx +282 -136
  172. package/src/SelectItemText.tsx +16 -33
  173. package/src/SelectScrollButton.native.tsx +13 -4
  174. package/src/SelectScrollButton.tsx +56 -41
  175. package/src/SelectTrigger.tsx +77 -53
  176. package/src/SelectViewport.native.tsx +42 -25
  177. package/src/SelectViewport.tsx +52 -51
  178. package/src/context.tsx +6 -2
  179. package/src/index.tsx +5 -2
  180. package/src/selectionController.ts +389 -0
  181. package/src/types.tsx +88 -45
  182. package/types/Select.d.ts +139 -201
  183. package/types/Select.d.ts.map +1 -1
  184. package/types/SelectContent.d.ts +1 -1
  185. package/types/SelectContent.d.ts.map +1 -1
  186. package/types/SelectContent.native.d.ts.map +1 -1
  187. package/types/SelectImpl.d.ts +2 -1
  188. package/types/SelectImpl.d.ts.map +1 -1
  189. package/types/SelectImpl.native.d.ts +1 -5
  190. package/types/SelectImpl.native.d.ts.map +1 -1
  191. package/types/SelectItem.d.ts +13 -16
  192. package/types/SelectItem.d.ts.map +1 -1
  193. package/types/SelectItemText.d.ts +9 -13
  194. package/types/SelectItemText.d.ts.map +1 -1
  195. package/types/SelectScrollButton.d.ts +15 -2
  196. package/types/SelectScrollButton.d.ts.map +1 -1
  197. package/types/SelectScrollButton.native.d.ts +16 -3
  198. package/types/SelectScrollButton.native.d.ts.map +1 -1
  199. package/types/SelectTrigger.d.ts +11 -23
  200. package/types/SelectTrigger.d.ts.map +1 -1
  201. package/types/SelectViewport.d.ts +11 -38
  202. package/types/SelectViewport.d.ts.map +1 -1
  203. package/types/SelectViewport.native.d.ts +15 -4
  204. package/types/SelectViewport.native.d.ts.map +1 -1
  205. package/types/context.d.ts +2 -0
  206. package/types/context.d.ts.map +1 -1
  207. package/types/index.d.ts +5 -2
  208. package/types/index.d.ts.map +1 -1
  209. package/types/selectionController.d.ts +88 -0
  210. package/types/selectionController.d.ts.map +1 -0
  211. package/types/types.d.ts +47 -37
  212. package/types/types.d.ts.map +1 -1
  213. package/dist/cjs/BubbleSelect.cjs +0 -50
  214. package/dist/cjs/BubbleSelect.native.js +0 -30
  215. package/dist/cjs/BubbleSelect.native.js.map +0 -1
  216. package/dist/cjs/useSelectBreakpointActive.cjs +0 -32
  217. package/dist/cjs/useSelectBreakpointActive.native.js +0 -35
  218. package/dist/cjs/useSelectBreakpointActive.native.js.map +0 -1
  219. package/dist/esm/BubbleSelect.mjs +0 -27
  220. package/dist/esm/BubbleSelect.mjs.map +0 -1
  221. package/dist/esm/BubbleSelect.native.js +0 -4
  222. package/dist/esm/BubbleSelect.native.js.map +0 -1
  223. package/dist/esm/index.js.map +0 -1
  224. package/dist/esm/index.mjs.map +0 -1
  225. package/dist/esm/index.native.js.map +0 -1
  226. package/dist/esm/types.mjs.map +0 -1
  227. package/dist/esm/types.native.js.map +0 -1
  228. package/dist/esm/useSelectBreakpointActive.mjs +0 -7
  229. package/dist/esm/useSelectBreakpointActive.mjs.map +0 -1
  230. package/dist/esm/useSelectBreakpointActive.native.js +0 -7
  231. package/dist/esm/useSelectBreakpointActive.native.js.map +0 -1
  232. package/dist/jsx/BubbleSelect.mjs +0 -27
  233. package/dist/jsx/BubbleSelect.mjs.map +0 -1
  234. package/dist/jsx/BubbleSelect.native.js +0 -30
  235. package/dist/jsx/BubbleSelect.native.js.map +0 -1
  236. package/dist/jsx/index.js.map +0 -1
  237. package/dist/jsx/index.mjs.map +0 -1
  238. package/dist/jsx/types.mjs.map +0 -1
  239. package/dist/jsx/useSelectBreakpointActive.mjs +0 -7
  240. package/dist/jsx/useSelectBreakpointActive.mjs.map +0 -1
  241. package/dist/jsx/useSelectBreakpointActive.native.js +0 -35
  242. package/dist/jsx/useSelectBreakpointActive.native.js.map +0 -1
  243. package/src/BubbleSelect.tsx +0 -50
  244. package/src/useSelectBreakpointActive.tsx +0 -7
  245. package/types/BubbleSelect.d.ts +0 -2
  246. package/types/BubbleSelect.d.ts.map +0 -1
  247. package/types/useSelectBreakpointActive.d.ts +0 -3
  248. package/types/useSelectBreakpointActive.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["__create","Object","create","__defProp","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__getProtoOf","getPrototypeOf","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toESM","mod","isNodeMode","__esModule","value","__toCommonJS","SelectTrigger_exports","SelectTrigger","module","exports","import_jsx_runtime","require","import_compose_refs","import_list_item","React","import_context","TRIGGER_NAME","forwardRef","SelectTrigger2","props","forwardedRef","_context_floatingContext","scope","disabled","unstyled","triggerProps","context","useSelectContext","itemParentContext","useSelectItemParentContext","composedRefs","useComposedRefs","floatingContext","refs","setReference","shouldRenderWebNative","jsx","ListItem","componentName","render","type","id","focusVisibleStyle","outlineStyle","outlineWidth","outlineColor","borderWidth","size","role"],"sources":["../../src/SelectTrigger.tsx"],"sourcesContent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;IAAuCC,EAAA,EAAAb,iBACzC,CAAAa,EAAA;IAAA,KAAAjB,QACF;MAAAkB,iBAEN;QAAAC,YACE,SAAU;QACRC,YAAA;QAAuCC,YACzC;MAAA;MACFC,WAAA;MAAAC,IACN,EAAAnB,iBAAA,CAAAmB;IAEJ;IACFC,IAAA","ignoreList":[]}
1
+ {"version":3,"file":"SelectTrigger.native.js","names":[],"sources":["jsx/SelectTrigger.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n\t// If the importer is in node compatibility mode or this is not an ESM\n\t// file that has been converted to a CommonJS file using a Babel-\n\t// compatible transform (i.e. \"__esModule\" has not been set), then set\n\t// \"default\" to the CommonJS \"module.exports\" for node compatibility.\n\tisNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\t\tvalue: mod,\n\t\tenumerable: true\n\t}) : target,\n\tmod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar SelectTrigger_exports = {};\n__export(SelectTrigger_exports, {\n\tSelectTrigger: () => SelectTrigger,\n\tSelectTriggerFrame: () => SelectTriggerFrame\n});\nmodule.exports = __toCommonJS(SelectTrigger_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_core = require(\"@tamagui/core\");\nvar import_helpers = require(\"@tamagui/helpers\");\n__toESM(require(\"react\"), 1);\nvar import_context = require(\"./context\");\nvar SelectTriggerFrame = (0, import_core.styled)(import_core.View, {\n\tdisplayName: \"SelectTrigger\",\n\talignItems: \"center\",\n\tflexDirection: \"row\",\n\trender: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"button\", { type: \"button\" })\n});\nvar SelectTrigger = (0, import_core.createStyledHOC)(SelectTriggerFrame, function SelectTrigger2(props, forwardedRef) {\n\tvar _context_floatingContext;\n\tvar { scope, disabled = false, ...triggerProps } = props;\n\tvar context = (0, import_context.useSelectContext)(scope);\n\tvar itemParentContext = (0, import_context.useSelectItemParentContext)(scope);\n\tvar composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, (_context_floatingContext = context.floatingContext) === null || _context_floatingContext === void 0 ? void 0 : _context_floatingContext.refs.setReference);\n\tif (itemParentContext.shouldRenderWebNative) return null;\n\tvar toggleOpen = function(event) {\n\t\tvar reason = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : \"trigger-press\";\n\t\tif (!disabled) itemParentContext.requestOpenChange(!context.open, (0, import_core.createChangeEventDetails)(reason, (event === null || event === void 0 ? void 0 : event.nativeEvent) || event, event === null || event === void 0 ? void 0 : event.currentTarget));\n\t};\n\tvar interactionProps = {\n\t\t...triggerProps,\n\t\t...import_constants.isWeb ? { onMouseDown: (0, import_helpers.composeEventHandlers)(triggerProps.onMouseDown, function(event) {\n\t\t\tevent.preventDefault();\n\t\t\ttoggleOpen(event);\n\t\t}) } : { onPress: (0, import_helpers.composeEventHandlers)(triggerProps.onPress, toggleOpen) },\n\t\tonKeyDown: (0, import_helpers.composeEventHandlers)(triggerProps.onKeyDown, function(event) {\n\t\t\tif (event.key === \"Enter\" || event.key === \" \") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\ttoggleOpen(event, \"keyboard\");\n\t\t\t}\n\t\t})\n\t};\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectTriggerFrame, {\n\t\ttype: \"button\",\n\t\tid: itemParentContext.id,\n\t\trole: \"combobox\",\n\t\t\"aria-haspopup\": \"listbox\",\n\t\t\"aria-expanded\": context.open,\n\t\t\"aria-autocomplete\": \"none\",\n\t\taccessibilityRole: import_constants.isWeb ? void 0 : \"button\",\n\t\taccessibilityState: import_constants.isWeb ? void 0 : {\n\t\t\texpanded: context.open,\n\t\t\tdisabled\n\t\t},\n\t\tdir: context.dir,\n\t\tdisabled,\n\t\t\"data-disabled\": disabled ? \"\" : void 0,\n\t\t...interactionProps,\n\t\tref: composedRefs\n\t});\n});\n//# sourceMappingURL=SelectTrigger.js.map\n"],"mappings":";;;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC/B,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;CACb,CAAC;AACF;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC7C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EACnE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GAAG,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QAAQ,UAAU,IAAI,KAAK;GAC9G,WAAW,KAAK;GAChB,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAC3D,CAAC;CACF;CACA,OAAO;AACR;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAA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ChC,IAAI,SAAS,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK;EAC9E,IAAI,CAAC,UAAU,kBAAkB,kBAAkB,CAAC,QAAQ,OAAO,GAAG,YAAY,0BAA0B,SAAS,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM,gBAAgB,OAAO,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM,aAAa,CAAC;CACnQ;CACA,IAAI,mBAAmB;EACtB,GAAG;EACH,GAAG,iBAAiB,QAAQ,EAAE,cAAc,GAAG,eAAe,sBAAsB,aAAa,aAAa,SAAS,OAAO;GAC7H,MAAM,eAAe;GACrB,WAAW,KAAK;EACjB,CAAC,EAAE,IAAI,EAAE,UAAU,GAAG,eAAe,sBAAsB,aAAa,SAAS,UAAU,EAAE;EAC7F,YAAY,GAAG,eAAe,sBAAsB,aAAa,WAAW,SAAS,OAAO;GAC3F,IAAI,MAAM,QAAQ,WAAW,MAAM,QAAQ,KAAK;IAC/C,MAAM,eAAe;IACrB,WAAW,OAAO,UAAU;GAC7B;EACD,CAAC;CACF;CACA,OAAuB,iBAAC,GAAG,mBAAmB,KAAK,oBAAoB;EACtE,MAAM;EACN,IAAI,kBAAkB;EACtB,MAAM;EACN,iBAAiB;EACjB,iBAAiB,QAAQ;EACzB,qBAAqB;EACrB,mBAAmB,iBAAiB,QAAQ,KAAK,IAAI;EACrD,oBAAoB,iBAAiB,QAAQ,KAAK,IAAI;GACrD,UAAU,QAAQ;GAClB;EACD;EACA,KAAK,QAAQ;EACb;EACA,iBAAiB,WAAW,KAAK,KAAK;EACtC,GAAG;EACH,KAAK;CACN,CAAC;AACF,CAAC"}
@@ -2,142 +2,127 @@ import { AdaptPortalContents, useAdaptIsActive } from "@tamagui/adapt";
2
2
  import { AnimatePresence } from "@tamagui/animate-presence";
3
3
  import { useComposedRefs } from "@tamagui/compose-refs";
4
4
  import { isWeb, useIsomorphicLayoutEffect } from "@tamagui/constants";
5
- import { styled } from "@tamagui/core";
5
+ import { View, createStyledHOC, styled } from "@tamagui/core";
6
6
  import { needsPortalRepropagation } from "@tamagui/portal";
7
- import { ThemeableStack, YStack } from "@tamagui/stacks";
7
+ import { YStack } from "@tamagui/stacks";
8
8
  import { startTransition } from "@tamagui/start-transition";
9
9
  import * as React from "react";
10
10
  import { VIEWPORT_NAME } from "./constants.mjs";
11
11
  import { ForwardSelectContext, useSelectContext, useSelectItemParentContext } from "./context.mjs";
12
+ import { getSelectListboxProps } from "./selectionController.mjs";
12
13
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
13
- const SelectViewportFrame = styled(ThemeableStack, {
14
- name: VIEWPORT_NAME,
15
- variants: {
16
- unstyled: {
17
- false: {
18
- size: "$2",
19
- backgroundColor: "$background",
20
- elevate: true,
21
- bordered: true,
22
- userSelect: "none",
23
- outlineWidth: 0
24
- }
25
- },
26
- size: {
27
- "...size": (val, {
28
- tokens
29
- }) => {
30
- return {
31
- borderRadius: tokens.radius[val] ?? val
32
- };
33
- }
34
- }
35
- },
36
- defaultVariants: {
37
- unstyled: process.env.TAMAGUI_HEADLESS === "1"
38
- }
14
+
15
+ const SelectViewportFrame = styled(View, {
16
+ displayName: VIEWPORT_NAME,
17
+ position: "relative"
39
18
  });
40
19
  const needsRepropagation = needsPortalRepropagation();
41
- const SelectViewport = SelectViewportFrame.styleable(function SelectViewport2(props, forwardedRef) {
42
- const {
43
- scope,
44
- children,
45
- disableScroll,
46
- ...viewportProps
47
- } = props;
48
- const context = useSelectContext(scope);
49
- const itemContext = useSelectItemParentContext(scope);
50
- const isAdapted = useAdaptIsActive(context.adaptScope);
51
- const [lazyMounted, setLazyMounted] = React.useState(context.lazyMount ? false : true);
52
- React.useEffect(() => {
53
- if (!context.lazyMount) return;
54
- if (!context.open) return;
55
- if (lazyMounted) return;
56
- startTransition(() => {
57
- setLazyMounted(true);
58
- });
59
- }, [context.lazyMount, context.open, lazyMounted]);
60
- const composedRefs = useComposedRefs(
61
- // @ts-ignore TODO react 19 type needs fix
62
- forwardedRef, context.floatingContext?.refs.setFloating);
63
- useIsomorphicLayoutEffect(() => {
64
- if (context.update) {
65
- context.update();
66
- }
67
- }, [isAdapted]);
68
- useIsomorphicLayoutEffect(() => {
69
- if (context.lazyMount && lazyMounted && context.open && context.update) {
70
- context.update();
71
- }
72
- }, [lazyMounted]);
73
- if (itemContext.shouldRenderWebNative) {
74
- return /* @__PURE__ */jsx(YStack, {
75
- position: "relative",
76
- children
77
- });
78
- }
79
- if (isAdapted || !isWeb) {
80
- let content = children;
81
- if (needsRepropagation) {
82
- content = /* @__PURE__ */jsx(ForwardSelectContext, {
83
- itemContext,
84
- context,
85
- children: content
86
- });
87
- }
88
- return /* @__PURE__ */jsx(AdaptPortalContents, {
89
- scope: context.adaptScope,
90
- children: content
91
- });
92
- }
93
- if (!itemContext.interactions) {
94
- if (process.env.NODE_ENV === "development") {
95
- console.warn(`No interactions provided to Select, potentially missing Adapt`);
96
- }
97
- return null;
98
- }
99
- const {
100
- style,
101
- // remove this, it was set to "Select" always
102
- className,
103
- ...floatingProps
104
- } = itemContext.interactions.getFloatingProps();
105
- return /* @__PURE__ */jsxs(Fragment, {
106
- children: [!disableScroll && !props.unstyled && /* @__PURE__ */jsx("style", {
107
- dangerouslySetInnerHTML: {
108
- __html: selectViewportCSS
109
- }
110
- }), /* @__PURE__ */jsx(AnimatePresence, {
111
- children: context.open ? /* @__PURE__ */jsx(SelectViewportFrame, {
112
- size: itemContext.size,
113
- role: "presentation",
114
- ...viewportProps,
115
- ...style,
116
- ...floatingProps,
117
- ...(!props.unstyled && {
118
- overflowY: disableScroll ? void 0 : style.overflow ?? "auto"
119
- }),
120
- ref: composedRefs,
121
- children: lazyMounted ? children : null
122
- }, "select-viewport") : null
123
- }), !context.open && !(context.lazyMount && context.renderValue) && lazyMounted && /* @__PURE__ */jsx("div", {
124
- style: {
125
- display: "none"
126
- },
127
- children
128
- })]
129
- });
20
+ const SelectViewport = createStyledHOC(SelectViewportFrame, function SelectViewport2(props, forwardedRef) {
21
+ const { scope, children, disableScroll, ...viewportProps } = props;
22
+ const context = useSelectContext(scope);
23
+ const itemContext = useSelectItemParentContext(scope);
24
+ const isAdapted = useAdaptIsActive(context.adaptScope);
25
+ const viewportRef = React.useRef(null);
26
+ const registeredItemCount = itemContext.registry.getItems().length;
27
+ const [lazyMounted, setLazyMounted] = React.useState(context.lazyMount ? false : true);
28
+ React.useEffect(() => {
29
+ if (!context.lazyMount) return;
30
+ if (!context.open) return;
31
+ if (lazyMounted) return;
32
+ startTransition(() => {
33
+ setLazyMounted(true);
34
+ });
35
+ }, [
36
+ context.lazyMount,
37
+ context.open,
38
+ lazyMounted
39
+ ]);
40
+ React.useEffect(() => {
41
+ if (!isWeb || !isAdapted || !context.open) return;
42
+ const frame = requestAnimationFrame(() => {
43
+ const index = context.activeIndexRef.current ?? itemContext.registry.firstEnabledIndex();
44
+ const activeItem = viewportRef.current?.querySelector("[role=\"option\"][tabindex=\"0\"]") ?? (index >= 0 ? itemContext.listRef?.current[index] : null);
45
+ activeItem?.focus();
46
+ });
47
+ return () => cancelAnimationFrame(frame);
48
+ }, [
49
+ context.activeIndex,
50
+ context.open,
51
+ isAdapted,
52
+ registeredItemCount
53
+ ]);
54
+ const composedRefs = useComposedRefs(forwardedRef, viewportRef, context.floatingContext?.refs.setFloating);
55
+ useIsomorphicLayoutEffect(() => {
56
+ if (context.update) {
57
+ context.update();
58
+ }
59
+ }, [isAdapted]);
60
+ React.useEffect(() => {
61
+ if (context.lazyMount && lazyMounted && context.open && context.update) {
62
+ const frame = requestAnimationFrame(context.update);
63
+ return () => cancelAnimationFrame(frame);
64
+ }
65
+ }, [lazyMounted, registeredItemCount]);
66
+ if (itemContext.shouldRenderWebNative) {
67
+ return /* @__PURE__ */ jsx(YStack, {
68
+ position: "relative",
69
+ children
70
+ });
71
+ }
72
+ if (isAdapted || !isWeb) {
73
+ let content = /* @__PURE__ */ jsx(SelectViewportFrame, {
74
+ ...viewportProps,
75
+ ...isWeb ? getSelectListboxProps(itemContext.mode) : {},
76
+ "data-select-viewport": "",
77
+ ref: composedRefs,
78
+ children: lazyMounted ? children : null
79
+ });
80
+ if (needsRepropagation) {
81
+ content = /* @__PURE__ */ jsx(ForwardSelectContext, {
82
+ itemContext,
83
+ context,
84
+ children: content
85
+ });
86
+ }
87
+ return /* @__PURE__ */ jsx(AdaptPortalContents, {
88
+ scope: context.adaptScope,
89
+ children: content
90
+ });
91
+ }
92
+ if (!itemContext.interactions) {
93
+ return null;
94
+ }
95
+ const { style, className, ...floatingProps } = itemContext.interactions.getFloatingProps();
96
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
97
+ !disableScroll && /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: selectViewportCSS } }),
98
+ /* @__PURE__ */ jsx(AnimatePresence, { children: context.open ? /* @__PURE__ */ jsx(SelectViewportFrame, {
99
+ "data-select-viewport": "",
100
+ ...isWeb && { "data-state": context.open ? "open" : "closed" },
101
+ ...viewportProps,
102
+ ...style,
103
+ ...floatingProps,
104
+ ...getSelectListboxProps(itemContext.mode),
105
+ overflowY: disableScroll ? void 0 : style.overflow ?? "auto",
106
+ ref: composedRefs,
107
+ children: lazyMounted ? children : null
108
+ }, "select-viewport") : null }),
109
+ !context.open && !(context.lazyMount && context.renderValue) && lazyMounted && /* @__PURE__ */ jsx("div", {
110
+ style: { display: "none" },
111
+ children
112
+ })
113
+ ] });
130
114
  });
131
115
  const selectViewportCSS = `
132
- .is_SelectViewport {
116
+ [data-select-viewport] {
133
117
  scrollbar-width: none;
134
118
  -webkit-overflow-scrolling: touch;
135
119
  overscroll-behavior: contain;
136
120
  }
137
121
 
138
- .is_SelectViewport::-webkit-scrollbar{
122
+ [data-select-viewport]::-webkit-scrollbar{
139
123
  display:none
140
124
  }
141
125
  `;
126
+
142
127
  export { SelectViewport, SelectViewportFrame };
143
128
  //# sourceMappingURL=SelectViewport.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["AdaptPortalContents","useAdaptIsActive","AnimatePresence","useComposedRefs","isWeb","useIsomorphicLayoutEffect","styled","needsPortalRepropagation","ThemeableStack","YStack","startTransition","React","VIEWPORT_NAME","ForwardSelectContext","useSelectContext","useSelectItemParentContext","Fragment","jsx","jsxs","SelectViewportFrame","name","variants","unstyled","false","size","backgroundColor","elevate","bordered","userSelect","outlineWidth","...size","val","tokens","borderRadius","radius","defaultVariants","process","env","TAMAGUI_HEADLESS","needsRepropagation","SelectViewport","styleable","props","forwardedRef","scope","children","disableScroll","viewportProps","context","itemContext","isAdapted","adaptScope","lazyMounted","setLazyMounted","useState","lazyMount","useEffect","open","composedRefs","floatingContext","refs","setFloating","update","shouldRenderWebNative","position","content","interactions","NODE_ENV","console","warn","style","className","floatingProps","getFloatingProps","dangerouslySetInnerHTML","__html","selectViewportCSS","role","overflowY","overflow","ref","renderValue","display"],"sources":["../../src/SelectViewport.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,mBAAA,EAAqBC,gBAAA,QAAwB;AACtD,SAASC,eAAA,QAAuB;AAChC,SAASC,eAAA,QAAuB;AAChC,SAASC,KAAA,EAAOC,yBAAA,QAAiC;AACjD,SAASC,MAAA,QAAc;AACvB,SAASC,wBAAA,QAAgC;AACzC,SAASC,cAAA,EAAgBC,MAAA,QAAc;AACvC,SAASC,eAAA,QAAuB;AAChC,YAAYC,KAAA,MAAW;AACvB,SAASC,aAAA,QAAqB;AAC9B,SACEC,oBAAA,EACAC,gBAAA,EACAC,0BAAA,QACK;AAgFM,SAqCPC,QAAA,EArCOC,GAAA,EAqCPC,IAAA,QArCO;AAvEN,MAAMC,mBAAA,GAAsBb,MAAA,CAAOE,cAAA,EAAgB;EACxDY,IAAA,EAAMR,aAAA;EAENS,QAAA,EAAU;IACRC,QAAA,EAAU;MACRC,KAAA,EAAO;QACLC,IAAA,EAAM;QACNC,eAAA,EAAiB;QACjBC,OAAA,EAAS;QACTC,QAAA,EAAU;QACVC,UAAA,EAAY;Q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MAAA,EAAQC;MACV;IAAA,CACF,GAEF,eAAA3D,GAAA,CAACf,eAAA;MACE2C,QAAA,EAAAG,OAAA,CAAQS,IAAA,GACP,eAAAxC,GAAA,CAACE,mBAAA;QAECK,IAAA,EAAMyB,WAAA,CAAYzB,IAAA;QAClBqD,IAAA,EAAK;QACJ,GAAG9B,aAAA;QACH,GAAGuB,KAAA;QACH,GAAGE,aAAA;QACH,IAAI,CAAC9B,KAAA,CAAMpB,QAAA,IAAY;UACtBwD,SAAA,EAAWhC,aAAA,GAAgB,SAAawB,KAAA,CAAMS,QAAA,IAAY;QAC5D;QACAC,GAAA,EAAKtB,YAAA;QAEJb,QAAA,EAAAO,WAAA,GAAcP,QAAA,GAAW;MAAA,GAXtB,iBAYN,IACE;IAAA,CACN,GAIC,CAACG,OAAA,CAAQS,IAAA,IAAQ,EAAET,OAAA,CAAQO,SAAA,IAAaP,OAAA,CAAQiC,WAAA,KAAgB7B,WAAA,IAC/D,eAAAnC,GAAA,CAAC;MAAIqD,KAAA,EAAO;QAAEY,OAAA,EAAS;MAAO;MAAIrC;IAAA,CAAS;EAAA,CAE/C;AAEJ,CACF;AAEA,MAAM+B,iBAAA,GAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"SelectViewport.js","names":[],"sources":["jsx/SelectViewport.js"],"sourcesContent":["import { AdaptPortalContents, useAdaptIsActive } from \"@tamagui/adapt\";\nimport { AnimatePresence } from \"@tamagui/animate-presence\";\nimport { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { createStyledHOC, styled, View } from \"@tamagui/core\";\nimport { needsPortalRepropagation } from \"@tamagui/portal\";\nimport { YStack } from \"@tamagui/stacks\";\nimport { startTransition } from \"@tamagui/start-transition\";\nimport * as React from \"react\";\nimport { VIEWPORT_NAME } from \"./constants\";\nimport {\n ForwardSelectContext,\n useSelectContext,\n useSelectItemParentContext\n} from \"./context\";\nimport { getSelectListboxProps } from \"./selectionController\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nconst SelectViewportFrame = styled(View, {\n displayName: VIEWPORT_NAME,\n position: \"relative\"\n});\nconst needsRepropagation = needsPortalRepropagation();\nconst SelectViewport = createStyledHOC(\n SelectViewportFrame,\n function SelectViewport2(props, forwardedRef) {\n const { scope, children, disableScroll, ...viewportProps } = props;\n const context = useSelectContext(scope);\n const itemContext = useSelectItemParentContext(scope);\n const isAdapted = useAdaptIsActive(context.adaptScope);\n const viewportRef = React.useRef(null);\n const registeredItemCount = itemContext.registry.getItems().length;\n const [lazyMounted, setLazyMounted] = React.useState(context.lazyMount ? false : true);\n React.useEffect(() => {\n if (!context.lazyMount) return;\n if (!context.open) return;\n if (lazyMounted) return;\n startTransition(() => {\n setLazyMounted(true);\n });\n }, [context.lazyMount, context.open, lazyMounted]);\n React.useEffect(() => {\n if (!isWeb || !isAdapted || !context.open) return;\n const frame = requestAnimationFrame(() => {\n const index = context.activeIndexRef.current ?? itemContext.registry.firstEnabledIndex();\n const activeItem = viewportRef.current?.querySelector(\n '[role=\"option\"][tabindex=\"0\"]'\n ) ?? (index >= 0 ? itemContext.listRef?.current[index] : null);\n activeItem?.focus();\n });\n return () => cancelAnimationFrame(frame);\n }, [context.activeIndex, context.open, isAdapted, registeredItemCount]);\n const composedRefs = useComposedRefs(\n // @ts-ignore react 19 ref type mismatch\n forwardedRef,\n viewportRef,\n context.floatingContext?.refs.setFloating\n );\n useIsomorphicLayoutEffect(() => {\n if (context.update) {\n context.update();\n }\n }, [isAdapted]);\n React.useEffect(() => {\n if (context.lazyMount && lazyMounted && context.open && context.update) {\n const frame = requestAnimationFrame(context.update);\n return () => cancelAnimationFrame(frame);\n }\n }, [lazyMounted, registeredItemCount]);\n if (itemContext.shouldRenderWebNative) {\n return /* @__PURE__ */ jsx(YStack, { position: \"relative\", children });\n }\n if (isAdapted || !isWeb) {\n let content = /* @__PURE__ */ jsx(\n SelectViewportFrame,\n {\n ...viewportProps,\n ...isWeb ? getSelectListboxProps(itemContext.mode) : {},\n \"data-select-viewport\": \"\",\n ref: composedRefs,\n children: lazyMounted ? children : null\n }\n );\n if (needsRepropagation) {\n content = /* @__PURE__ */ jsx(ForwardSelectContext, { itemContext, context, children: content });\n }\n return /* @__PURE__ */ jsx(AdaptPortalContents, { scope: context.adaptScope, children: content });\n }\n if (!itemContext.interactions) {\n return null;\n }\n const {\n style,\n // remove this, it was set to \"Select\" always\n className,\n ...floatingProps\n } = itemContext.interactions.getFloatingProps();\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n !disableScroll && /* @__PURE__ */ jsx(\n \"style\",\n {\n dangerouslySetInnerHTML: {\n __html: selectViewportCSS\n }\n }\n ),\n /* @__PURE__ */ jsx(AnimatePresence, { children: context.open ? /* @__PURE__ */ jsx(\n SelectViewportFrame,\n {\n \"data-select-viewport\": \"\",\n ...isWeb && {\n \"data-state\": context.open ? \"open\" : \"closed\"\n },\n ...viewportProps,\n ...style,\n ...floatingProps,\n ...getSelectListboxProps(itemContext.mode),\n overflowY: disableScroll ? void 0 : style.overflow ?? \"auto\",\n ref: composedRefs,\n children: lazyMounted ? children : null\n },\n \"select-viewport\"\n ) : null }),\n !context.open && !(context.lazyMount && context.renderValue) && lazyMounted && /* @__PURE__ */ jsx(\"div\", { style: { display: \"none\" }, children })\n ] });\n }\n);\nconst selectViewportCSS = `\n[data-select-viewport] {\n scrollbar-width: none;\n -webkit-overflow-scrolling: touch;\n overscroll-behavior: contain;\n}\n\n[data-select-viewport]::-webkit-scrollbar{\n display:none\n}\n`;\nexport {\n SelectViewport,\n SelectViewportFrame\n};\n//# sourceMappingURL=SelectViewport.js.map\n"],"mappings":";;;;;;;;;;;;;;;AAiBA,MAAM,sBAAsB,OAAO,MAAM;CACvC,aAAa;CACb,UAAU;AACZ,CAAC;AACD,MAAM,qBAAqB,yBAAyB;AACpD,MAAM,iBAAiB,gB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var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all) __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true
12
+ });
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: () => from[key],
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
22
+ };
23
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
+ var SelectViewport_native_exports = {};
25
+ __export(SelectViewport_native_exports, {
26
+ SelectViewport: () => SelectViewport,
27
+ SelectViewportFrame: () => SelectViewportFrame
28
+ });
29
+ module.exports = __toCommonJS(SelectViewport_native_exports);
30
+ var import_jsx_runtime = require("react/jsx-runtime");
31
+ var import_adapt = require("@tamagui/adapt");
32
+ var import_core = require("@tamagui/core");
33
+ var import_constants = require("./constants.native.js");
34
+ var import_context = require("./context.native.js");
35
+ var SelectViewportFrame = (0, import_core.styled)(import_core.View, {
36
+ displayName: import_constants.VIEWPORT_NAME,
37
+ position: "relative"
38
+ });
39
+ var SelectViewport = (0, import_core.createStyledHOC)(SelectViewportFrame, function SelectViewport2(props, forwardedRef) {
40
+ var { scope, children, disableScroll: _disableScroll, ...viewportProps } = props;
41
+ var context = (0, import_context.useSelectContext)(scope);
42
+ var itemParentContext = (0, import_context.useSelectItemParentContext)(scope);
43
+ var themeName = (0, import_core.useThemeName)();
44
+ var adaptContext = (0, import_adapt.useAdaptContext)();
45
+ var isAdapted = (0, import_adapt.useAdaptIsActive)(context.adaptScope);
46
+ var contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Theme, {
47
+ name: themeName,
48
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_context.ForwardSelectContext, {
49
+ itemContext: itemParentContext,
50
+ context,
51
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_adapt.AdaptContext.Provider, {
52
+ ...adaptContext,
53
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectViewportFrame, {
54
+ ...viewportProps,
55
+ ref: forwardedRef,
56
+ children
57
+ })
58
+ })
59
+ })
60
+ });
61
+ if (!context.open) {
62
+ if (context.lazyMount && context.renderValue) return null;
63
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectViewportFrame, {
64
+ display: "none",
65
+ children: contents
66
+ });
67
+ }
68
+ return isAdapted ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_adapt.AdaptPortalContents, {
69
+ scope: context.adaptScope,
70
+ children: contents
71
+ }) : contents;
72
+ });
73
+ SelectViewport.displayName = import_constants.VIEWPORT_NAME;
@@ -1,71 +1,75 @@
1
1
  "use strict";
2
2
 
3
+
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
8
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
9
+ for (var name in all) __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true
12
+ });
12
13
  };
13
14
  var __copyProps = (to, from, except, desc) => {
14
- 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;
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: () => from[key],
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
21
22
  };
22
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
23
- value: true
24
- }), mod);
23
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
24
  var SelectViewport_native_exports = {};
26
25
  __export(SelectViewport_native_exports, {
27
- SelectViewport: () => SelectViewport
26
+ SelectViewport: () => SelectViewport,
27
+ SelectViewportFrame: () => SelectViewportFrame
28
28
  });
29
29
  module.exports = __toCommonJS(SelectViewport_native_exports);
30
30
  var import_jsx_runtime = require("react/jsx-runtime");
31
31
  var import_adapt = require("@tamagui/adapt");
32
32
  var import_core = require("@tamagui/core");
33
- var import_stacks = require("@tamagui/stacks");
34
33
  var import_constants = require("./constants.native.js");
35
34
  var import_context = require("./context.native.js");
36
- var SelectViewport = function (props) {
37
- var {
38
- scope,
39
- children
40
- } = props;
41
- var context = (0, import_context.useSelectContext)(scope);
42
- var itemParentContext = (0, import_context.useSelectItemParentContext)(scope);
43
- var themeName = (0, import_core.useThemeName)();
44
- var adaptContext = (0, import_adapt.useAdaptContext)();
45
- var contents = /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_core.Theme, {
46
- name: themeName,
47
- children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_context.ForwardSelectContext, {
48
- itemContext: itemParentContext,
49
- context,
50
- children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_adapt.AdaptContext.Provider, {
51
- ...adaptContext,
52
- children
53
- })
54
- })
55
- });
56
- if (!context.open) {
57
- if (context.lazyMount && context.renderValue) {
58
- return null;
59
- }
60
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_stacks.YStack, {
61
- display: "none",
62
- children: contents
63
- });
64
- }
65
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_adapt.AdaptPortalContents, {
66
- scope: context.adaptScope,
67
- children: contents
68
- });
69
- };
35
+ var SelectViewportFrame = (0, import_core.styled)(import_core.View, {
36
+ displayName: import_constants.VIEWPORT_NAME,
37
+ position: "relative"
38
+ });
39
+ var SelectViewport = (0, import_core.createStyledHOC)(SelectViewportFrame, function SelectViewport2(props, forwardedRef) {
40
+ var { scope, children, disableScroll: _disableScroll, ...viewportProps } = props;
41
+ var context = (0, import_context.useSelectContext)(scope);
42
+ var itemParentContext = (0, import_context.useSelectItemParentContext)(scope);
43
+ var themeName = (0, import_core.useThemeName)();
44
+ var adaptContext = (0, import_adapt.useAdaptContext)();
45
+ var isAdapted = (0, import_adapt.useAdaptIsActive)(context.adaptScope);
46
+ var contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Theme, {
47
+ name: themeName,
48
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_context.ForwardSelectContext, {
49
+ itemContext: itemParentContext,
50
+ context,
51
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_adapt.AdaptContext.Provider, {
52
+ ...adaptContext,
53
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectViewportFrame, {
54
+ ...viewportProps,
55
+ ref: forwardedRef,
56
+ children
57
+ })
58
+ })
59
+ })
60
+ });
61
+ if (!context.open) {
62
+ if (context.lazyMount && context.renderValue) return null;
63
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectViewportFrame, {
64
+ display: "none",
65
+ children: contents
66
+ });
67
+ }
68
+ return isAdapted ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_adapt.AdaptPortalContents, {
69
+ scope: context.adaptScope,
70
+ children: contents
71
+ }) : contents;
72
+ });
70
73
  SelectViewport.displayName = import_constants.VIEWPORT_NAME;
74
+
71
75
  //# sourceMappingURL=SelectViewport.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["SelectViewport_native_exports","__export","SelectViewport","module","exports","__toCommonJS","import_jsx_runtime","require","import_adapt","import_core","import_stacks","import_constants","import_context","props","scope","children","context","useSelectContext","itemParentContext","useSelectItemParentContext","themeName","useThemeName","adaptContext","useAdaptContext","contents","jsx","Theme","name","ForwardSelectContext","itemContext","AdaptContext","Provider","open","lazyMount","renderValue","YStack","display","AdaptPortalContents","adaptScope","displayName","VIEWPORT_NAME"],"sources":["../../src/SelectViewport.native.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,6BAAA;AAAAC,QAAA,CAAAD,6BAAA;EAAAE,cAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAL,6BAAA;AAAA,IAAAM,kBAAA,GAA4BC,OAAA;AAC5B,IAAAC,YAAA,GAAmED,OAAA;AACnE,IAAAE,WAAA,GAAoCF,OAAA;AACpC,IAAAG,aAAA,GAAuBH,OAAA;AACvB,IAAAI,gBAAA,GAA8BJ,OAAA;AAC9B,IAAAK,cAAA,GAAmFL,OAAA;AAC5E,IAAIL,cAAA,GAAiB,SAAAA,CAASW,KAAA,EAAO;EACxC,IAAI;IAAEC,KAAA;IAAOC;EAAS,IAAIF,KAAA;EAC1B,IAAIG,OAAA,OAAUJ,cAAA,CAAAK,gBAAA,EAAiBH,KAAK;EACpC,IAAII,iBAAA,OAAoBN,cAAA,CAAAO,0BAAA,EAA2BL,KAAK;EACxD,IAAIM,SAAA,OAAYX,WAAA,CAAAY,YAAA,EAAa;EAE7B,IAAIC,YAAA,OAAed,YAAA,CAAAe,eAAA,EAAgB;EACnC,IAAIC,QAAA,GAAyB,mBAAAlB,kBAAA,CAAAmB,GAAA,EAAKhB,WAAA,CAAAiB,KAAA,EAAO;IACrCC,IAAA,EAAMP,SAAA;IACNL,QAAA,EAAwB,mBAAAT,kBAAA,CAAAmB,GAAA,EAAKb,cAAA,CAAAgB,oBAAA,EAAsB;MAC/CC,WAAA,EAAaX,iBAAA;MACbF,OAAA;MACAD,QAAA,EAAwB,mBAAAT,kBAAA,CAAAmB,GAAA,EAAKjB,YAAA,CAAAsB,YAAA,CAAaC,QAAA,EAAU;QAChD,GAAGT,YAAA;QACHP;MACJ,CAAC;IACL,CAAC;EACL,CAAC;EACD,IAAI,CAACC,OAAA,CAAQgB,IAAA,EAAM;IACf,IAAIhB,OAAA,CAAQiB,SAAA,IAAajB,OAAA,CAAQkB,WAAA,EAAa;MAC1C,OAAO;IACX;IACA,OAAqB,mBAAA5B,kBAAA,CAAAmB,GAAA,EAAKf,aAAA,CAAAyB,MAAA,EAAQ;MAC9BC,OAAA,EAAS;MACTrB,QAAA,EAAUS;IACd,CAAC;EACL;EACA,OAAqB,mBAAAlB,kBAAA,CAAAmB,GAAA,EAAKjB,YAAA,CAAA6B,mBAAA,EAAqB;IAC3CvB,KAAA,EAAOE,OAAA,CAAQsB,UAAA;IACfvB,QAAA,EAAUS;EACd,CAAC;AACL;AACAtB,cAAA,CAAeqC,WAAA,GAAc5B,gBAAA,CAAA6B,aAAA","ignoreList":[]}
1
+ {"version":3,"file":"SelectViewport.native.js","names":[],"sources":["jsx/SelectViewport.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 SelectViewport_native_exports = {};\n__export(SelectViewport_native_exports, {\n SelectViewport: () => SelectViewport,\n SelectViewportFrame: () => SelectViewportFrame\n});\nmodule.exports = __toCommonJS(SelectViewport_native_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_adapt = require(\"@tamagui/adapt\");\nvar import_core = require(\"@tamagui/core\");\nvar import_constants = require(\"./constants\");\nvar import_context = require(\"./context\");\nvar SelectViewportFrame = (0, import_core.styled)(import_core.View, {\n displayName: import_constants.VIEWPORT_NAME,\n position: \"relative\"\n});\nvar SelectViewport = (0, import_core.createStyledHOC)(SelectViewportFrame, function SelectViewport2(props, forwardedRef) {\n var { scope, children, disableScroll: _disableScroll, ...viewportProps } = props;\n var context = (0, import_context.useSelectContext)(scope);\n var itemParentContext = (0, import_context.useSelectItemParentContext)(scope);\n var themeName = (0, import_core.useThemeName)();\n var adaptContext = (0, import_adapt.useAdaptContext)();\n var isAdapted = (0, import_adapt.useAdaptIsActive)(context.adaptScope);\n var contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Theme, {\n name: themeName,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_context.ForwardSelectContext, {\n itemContext: itemParentContext,\n context,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_adapt.AdaptContext.Provider, {\n ...adaptContext,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectViewportFrame, {\n ...viewportProps,\n ref: forwardedRef,\n children\n })\n })\n })\n });\n if (!context.open) {\n if (context.lazyMount && context.renderValue) return null;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectViewportFrame, {\n display: \"none\",\n children: contents\n });\n }\n return isAdapted ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_adapt.AdaptPortalContents, {\n scope: context.adaptScope,\n children: contents\n }) : contents;\n});\nSelectViewport.displayName = import_constants.VIEWPORT_NAME;\n//# sourceMappingURL=SelectViewport.native.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,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AAgB,GAAG,aAAa,iBAAiB;CACrD,IAAI,aAAa,GAAG,aAAa,kBAAkB,QAAQ,UAAU;CACrE,IAAI,WAA2B,iBAAC,GAAG,mBAAmB,KAAK,YAAY,OAAO;EAC5E,MAAM;EACN,UAA0B,iBAAC,GAAG,mBAAmB,KAAK,eAAe,sBAAsB;GACzF,aAAa;GACb;GACA,UAA0B,iBAAC,GAAG,mBAAmB,KAAK,aAAa,aAAa,UAAU;IACxF,GAAG;IACH,UAA0B,iBAAC,GAAG,mBAAmB,KAAK,qBAAqB;KACzE,GAAG;KACH,KAAK;KACL;IACF,CAAC;GACH,CAAC;EACH,CAAC;CACH,CAAC;CACD,IAAI,CAAC,QAAQ,MAAM;EACjB,IAAI,QAAQ,aAAa,QAAQ,aAAa,OAAO;EACrD,OAAuB,iBAAC,GAAG,mBAAmB,KAAK,qBAAqB;GACtE,SAAS;GACT,UAAU;EACZ,CAAC;CACH;CACA,OAAO,YAA4B,iBAAC,GAAG,mBAAmB,KAAK,aAAa,qBAAqB;EAC/F,OAAO,QAAQ;EACf,UAAU;CACZ,CAAC,IAAI;AACP,CAAC;AACD,eAAe,cAAc,iBAAiB"}
@@ -5,5 +5,6 @@ const SCROLL_ARROW_THRESHOLD = 8;
5
5
  const MIN_HEIGHT = 80;
6
6
  const FALLBACK_THRESHOLD = 16;
7
7
  const VIEWPORT_NAME = "SelectViewport";
8
+
8
9
  export { FALLBACK_THRESHOLD, MIN_HEIGHT, SCROLL_ARROW_THRESHOLD, SCROLL_ARROW_VELOCITY, SELECT_NAME, VIEWPORT_NAME, WINDOW_PADDING };
9
10
  //# sourceMappingURL=constants.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["SELECT_NAME","WINDOW_PADDING","SCROLL_ARROW_VELOCITY","SCROLL_ARROW_THRESHOLD","MIN_HEIGHT","FALLBACK_THRESHOLD","VIEWPORT_NAME"],"sources":["../../src/constants.tsx"],"sourcesContent":[null],"mappings":"AAAO,MAAMA,WAAA,GAAc;AACpB,MAAMC,cAAA,GAAiB;AACvB,MAAMC,qBAAA,GAAwB;AAC9B,MAAMC,sBAAA,GAAyB;AAC/B,MAAMC,UAAA,GAAa;AACnB,MAAMC,kBAAA,GAAqB;AAC3B,MAAMC,aAAA,GAAgB","ignoreList":[]}
1
+ {"version":3,"file":"constants.js","names":[],"sources":["jsx/constants.js"],"sourcesContent":["const SELECT_NAME = \"Select\";\nconst WINDOW_PADDING = 8;\nconst SCROLL_ARROW_VELOCITY = 8;\nconst SCROLL_ARROW_THRESHOLD = 8;\nconst MIN_HEIGHT = 80;\nconst FALLBACK_THRESHOLD = 16;\nconst VIEWPORT_NAME = \"SelectViewport\";\nexport {\n FALLBACK_THRESHOLD,\n MIN_HEIGHT,\n SCROLL_ARROW_THRESHOLD,\n SCROLL_ARROW_VELOCITY,\n SELECT_NAME,\n VIEWPORT_NAME,\n WINDOW_PADDING\n};\n//# sourceMappingURL=constants.js.map\n"],"mappings":";AAAA,MAAM,cAAc;AACpB,MAAM,iBAAiB;AACvB,MAAM,wBAAwB;AAC9B,MAAM,yBAAyB;AAC/B,MAAM,aAAa;AACnB,MAAM,qBAAqB;AAC3B,MAAM,gBAAgB"}