@octanejs/aria 0.0.40 → 0.0.41

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 (416) hide show
  1. package/LICENSE-APACHE-2.0 +201 -0
  2. package/README.md +20 -7
  3. package/UPSTREAM.md +108 -0
  4. package/package.json +10 -6
  5. package/src/calendar/useCalendar.tsx +36 -0
  6. package/src/calendar/useCalendarBase.tsx +142 -0
  7. package/src/calendar/useCalendarCell.tsx +416 -0
  8. package/src/calendar/useCalendarGrid.tsx +202 -0
  9. package/src/calendar/useCalendarHeading.tsx +85 -0
  10. package/src/calendar/useCalendarMonthPicker.tsx +92 -0
  11. package/src/calendar/useCalendarYearPicker.tsx +127 -0
  12. package/src/calendar/useRangeCalendar.tsx +121 -0
  13. package/src/calendar/utils.tsx +183 -0
  14. package/src/color/useColorArea.tsx +599 -0
  15. package/src/color/useColorAreaGradient.tsx +157 -0
  16. package/src/color/useColorChannelField.tsx +53 -0
  17. package/src/color/useColorField.tsx +170 -0
  18. package/src/color/useColorSlider.tsx +177 -0
  19. package/src/color/useColorSwatch.tsx +83 -0
  20. package/src/color/useColorWheel.tsx +401 -0
  21. package/src/compat/react.ts +111 -0
  22. package/src/components/Calendar.tsx +842 -0
  23. package/src/components/ColorArea.tsx +120 -0
  24. package/src/components/ColorField.tsx +304 -0
  25. package/src/components/ColorPicker.tsx +86 -0
  26. package/src/components/ColorSlider.tsx +144 -0
  27. package/src/components/ColorSwatch.tsx +72 -0
  28. package/src/components/ColorSwatchPicker.tsx +176 -0
  29. package/src/components/ColorThumb.tsx +140 -0
  30. package/src/components/ColorWheel.tsx +163 -0
  31. package/src/components/DateField.tsx +580 -0
  32. package/src/components/DatePicker.tsx +386 -0
  33. package/src/components/DropZone.tsx +181 -0
  34. package/src/components/FileTrigger.tsx +96 -0
  35. package/src/components/GridLayout.tsx +33 -0
  36. package/src/components/HiddenDateInput.tsx +169 -0
  37. package/src/components/TableLayout.tsx +39 -0
  38. package/src/components/Toast.tsx +336 -0
  39. package/src/components/Virtualizer.tsx +219 -0
  40. package/src/components/index.ts +257 -7
  41. package/src/components/useDragAndDrop.tsx +221 -0
  42. package/src/components/utils.ts +12 -89
  43. package/src/datepicker/useDateField.tsx +272 -0
  44. package/src/datepicker/useDatePicker.tsx +229 -0
  45. package/src/datepicker/useDatePickerGroup.tsx +147 -0
  46. package/src/datepicker/useDateRangePicker.tsx +288 -0
  47. package/src/datepicker/useDateSegment.tsx +439 -0
  48. package/src/datepicker/useDisplayNames.tsx +53 -0
  49. package/src/dnd/DragManager.tsx +718 -0
  50. package/src/dnd/DragPreview.tsx +100 -0
  51. package/src/dnd/DropTargetKeyboardNavigation.tsx +317 -0
  52. package/src/dnd/ListDropTargetDelegate.tsx +215 -0
  53. package/src/dnd/constants.tsx +93 -0
  54. package/src/dnd/useAutoScroll.tsx +116 -0
  55. package/src/dnd/useClipboard.tsx +160 -0
  56. package/src/dnd/useDrag.tsx +437 -0
  57. package/src/dnd/useDraggableCollection.tsx +35 -0
  58. package/src/dnd/useDraggableItem.tsx +168 -0
  59. package/src/dnd/useDrop.tsx +518 -0
  60. package/src/dnd/useDropIndicator.tsx +129 -0
  61. package/src/dnd/useDroppableCollection.tsx +808 -0
  62. package/src/dnd/useDroppableItem.tsx +99 -0
  63. package/src/dnd/useVirtualDrop.tsx +52 -0
  64. package/src/dnd/utils.tsx +430 -0
  65. package/src/intl/calendar/ar-AE.json +14 -0
  66. package/src/intl/calendar/bg-BG.json +14 -0
  67. package/src/intl/calendar/cs-CZ.json +14 -0
  68. package/src/intl/calendar/da-DK.json +14 -0
  69. package/src/intl/calendar/de-DE.json +14 -0
  70. package/src/intl/calendar/el-GR.json +14 -0
  71. package/src/intl/calendar/en-US.json +14 -0
  72. package/src/intl/calendar/es-ES.json +14 -0
  73. package/src/intl/calendar/et-EE.json +14 -0
  74. package/src/intl/calendar/fi-FI.json +14 -0
  75. package/src/intl/calendar/fr-FR.json +14 -0
  76. package/src/intl/calendar/he-IL.json +14 -0
  77. package/src/intl/calendar/hr-HR.json +14 -0
  78. package/src/intl/calendar/hu-HU.json +14 -0
  79. package/src/intl/calendar/index.ts +73 -0
  80. package/src/intl/calendar/it-IT.json +14 -0
  81. package/src/intl/calendar/ja-JP.json +14 -0
  82. package/src/intl/calendar/ko-KR.json +14 -0
  83. package/src/intl/calendar/lt-LT.json +14 -0
  84. package/src/intl/calendar/lv-LV.json +14 -0
  85. package/src/intl/calendar/nb-NO.json +14 -0
  86. package/src/intl/calendar/nl-NL.json +14 -0
  87. package/src/intl/calendar/pl-PL.json +14 -0
  88. package/src/intl/calendar/pt-BR.json +14 -0
  89. package/src/intl/calendar/pt-PT.json +14 -0
  90. package/src/intl/calendar/ro-RO.json +14 -0
  91. package/src/intl/calendar/ru-RU.json +14 -0
  92. package/src/intl/calendar/sk-SK.json +14 -0
  93. package/src/intl/calendar/sl-SI.json +14 -0
  94. package/src/intl/calendar/sr-SP.json +14 -0
  95. package/src/intl/calendar/sv-SE.json +14 -0
  96. package/src/intl/calendar/tr-TR.json +14 -0
  97. package/src/intl/calendar/uk-UA.json +14 -0
  98. package/src/intl/calendar/zh-CN.json +14 -0
  99. package/src/intl/calendar/zh-TW.json +14 -0
  100. package/src/intl/color/ar-AE.json +8 -0
  101. package/src/intl/color/bg-BG.json +8 -0
  102. package/src/intl/color/cs-CZ.json +8 -0
  103. package/src/intl/color/da-DK.json +8 -0
  104. package/src/intl/color/de-DE.json +8 -0
  105. package/src/intl/color/el-GR.json +8 -0
  106. package/src/intl/color/en-US.json +8 -0
  107. package/src/intl/color/es-ES.json +8 -0
  108. package/src/intl/color/et-EE.json +8 -0
  109. package/src/intl/color/fi-FI.json +8 -0
  110. package/src/intl/color/fr-FR.json +8 -0
  111. package/src/intl/color/he-IL.json +8 -0
  112. package/src/intl/color/hr-HR.json +8 -0
  113. package/src/intl/color/hu-HU.json +8 -0
  114. package/src/intl/color/index.ts +73 -0
  115. package/src/intl/color/it-IT.json +8 -0
  116. package/src/intl/color/ja-JP.json +8 -0
  117. package/src/intl/color/ko-KR.json +8 -0
  118. package/src/intl/color/lt-LT.json +8 -0
  119. package/src/intl/color/lv-LV.json +8 -0
  120. package/src/intl/color/nb-NO.json +8 -0
  121. package/src/intl/color/nl-NL.json +8 -0
  122. package/src/intl/color/pl-PL.json +8 -0
  123. package/src/intl/color/pt-BR.json +8 -0
  124. package/src/intl/color/pt-PT.json +8 -0
  125. package/src/intl/color/ro-RO.json +8 -0
  126. package/src/intl/color/ru-RU.json +8 -0
  127. package/src/intl/color/sk-SK.json +8 -0
  128. package/src/intl/color/sl-SI.json +8 -0
  129. package/src/intl/color/sr-SP.json +8 -0
  130. package/src/intl/color/sv-SE.json +8 -0
  131. package/src/intl/color/tr-TR.json +8 -0
  132. package/src/intl/color/uk-UA.json +8 -0
  133. package/src/intl/color/zh-CN.json +8 -0
  134. package/src/intl/color/zh-TW.json +8 -0
  135. package/src/intl/datepicker/ar-AE.json +18 -0
  136. package/src/intl/datepicker/bg-BG.json +18 -0
  137. package/src/intl/datepicker/cs-CZ.json +18 -0
  138. package/src/intl/datepicker/da-DK.json +18 -0
  139. package/src/intl/datepicker/de-DE.json +18 -0
  140. package/src/intl/datepicker/el-GR.json +18 -0
  141. package/src/intl/datepicker/en-US.json +18 -0
  142. package/src/intl/datepicker/es-ES.json +18 -0
  143. package/src/intl/datepicker/et-EE.json +18 -0
  144. package/src/intl/datepicker/fi-FI.json +18 -0
  145. package/src/intl/datepicker/fr-FR.json +18 -0
  146. package/src/intl/datepicker/he-IL.json +18 -0
  147. package/src/intl/datepicker/hr-HR.json +18 -0
  148. package/src/intl/datepicker/hu-HU.json +18 -0
  149. package/src/intl/datepicker/index.ts +73 -0
  150. package/src/intl/datepicker/it-IT.json +18 -0
  151. package/src/intl/datepicker/ja-JP.json +18 -0
  152. package/src/intl/datepicker/ko-KR.json +18 -0
  153. package/src/intl/datepicker/lt-LT.json +18 -0
  154. package/src/intl/datepicker/lv-LV.json +18 -0
  155. package/src/intl/datepicker/nb-NO.json +18 -0
  156. package/src/intl/datepicker/nl-NL.json +18 -0
  157. package/src/intl/datepicker/pl-PL.json +18 -0
  158. package/src/intl/datepicker/pt-BR.json +18 -0
  159. package/src/intl/datepicker/pt-PT.json +18 -0
  160. package/src/intl/datepicker/ro-RO.json +18 -0
  161. package/src/intl/datepicker/ru-RU.json +18 -0
  162. package/src/intl/datepicker/sk-SK.json +18 -0
  163. package/src/intl/datepicker/sl-SI.json +18 -0
  164. package/src/intl/datepicker/sr-SP.json +18 -0
  165. package/src/intl/datepicker/sv-SE.json +18 -0
  166. package/src/intl/datepicker/tr-TR.json +18 -0
  167. package/src/intl/datepicker/uk-UA.json +18 -0
  168. package/src/intl/datepicker/zh-CN.json +18 -0
  169. package/src/intl/datepicker/zh-TW.json +18 -0
  170. package/src/intl/dnd/ar-AE.json +29 -0
  171. package/src/intl/dnd/bg-BG.json +29 -0
  172. package/src/intl/dnd/cs-CZ.json +29 -0
  173. package/src/intl/dnd/da-DK.json +29 -0
  174. package/src/intl/dnd/de-DE.json +29 -0
  175. package/src/intl/dnd/el-GR.json +29 -0
  176. package/src/intl/dnd/en-US.json +29 -0
  177. package/src/intl/dnd/es-ES.json +29 -0
  178. package/src/intl/dnd/et-EE.json +29 -0
  179. package/src/intl/dnd/fi-FI.json +29 -0
  180. package/src/intl/dnd/fr-FR.json +29 -0
  181. package/src/intl/dnd/he-IL.json +29 -0
  182. package/src/intl/dnd/hr-HR.json +29 -0
  183. package/src/intl/dnd/hu-HU.json +29 -0
  184. package/src/intl/dnd/index.ts +73 -0
  185. package/src/intl/dnd/it-IT.json +29 -0
  186. package/src/intl/dnd/ja-JP.json +29 -0
  187. package/src/intl/dnd/ko-KR.json +29 -0
  188. package/src/intl/dnd/lt-LT.json +29 -0
  189. package/src/intl/dnd/lv-LV.json +29 -0
  190. package/src/intl/dnd/nb-NO.json +29 -0
  191. package/src/intl/dnd/nl-NL.json +29 -0
  192. package/src/intl/dnd/pl-PL.json +29 -0
  193. package/src/intl/dnd/pt-BR.json +29 -0
  194. package/src/intl/dnd/pt-PT.json +29 -0
  195. package/src/intl/dnd/ro-RO.json +29 -0
  196. package/src/intl/dnd/ru-RU.json +29 -0
  197. package/src/intl/dnd/sk-SK.json +29 -0
  198. package/src/intl/dnd/sl-SI.json +29 -0
  199. package/src/intl/dnd/sr-SP.json +29 -0
  200. package/src/intl/dnd/sv-SE.json +29 -0
  201. package/src/intl/dnd/tr-TR.json +29 -0
  202. package/src/intl/dnd/uk-UA.json +29 -0
  203. package/src/intl/dnd/zh-CN.json +29 -0
  204. package/src/intl/dnd/zh-TW.json +29 -0
  205. package/src/intl/react-aria-components/ar-AE.json +6 -0
  206. package/src/intl/react-aria-components/bg-BG.json +6 -0
  207. package/src/intl/react-aria-components/cs-CZ.json +6 -0
  208. package/src/intl/react-aria-components/da-DK.json +6 -0
  209. package/src/intl/react-aria-components/de-DE.json +6 -0
  210. package/src/intl/react-aria-components/el-GR.json +6 -0
  211. package/src/intl/react-aria-components/en-US.json +6 -0
  212. package/src/intl/react-aria-components/es-ES.json +6 -0
  213. package/src/intl/react-aria-components/et-EE.json +6 -0
  214. package/src/intl/react-aria-components/fi-FI.json +6 -0
  215. package/src/intl/react-aria-components/fr-FR.json +6 -0
  216. package/src/intl/react-aria-components/he-IL.json +6 -0
  217. package/src/intl/react-aria-components/hr-HR.json +6 -0
  218. package/src/intl/react-aria-components/hu-HU.json +6 -0
  219. package/src/intl/react-aria-components/index.ts +73 -0
  220. package/src/intl/react-aria-components/it-IT.json +6 -0
  221. package/src/intl/react-aria-components/ja-JP.json +6 -0
  222. package/src/intl/react-aria-components/ko-KR.json +6 -0
  223. package/src/intl/react-aria-components/lt-LT.json +6 -0
  224. package/src/intl/react-aria-components/lv-LV.json +6 -0
  225. package/src/intl/react-aria-components/nb-NO.json +6 -0
  226. package/src/intl/react-aria-components/nl-NL.json +6 -0
  227. package/src/intl/react-aria-components/pl-PL.json +6 -0
  228. package/src/intl/react-aria-components/pt-BR.json +6 -0
  229. package/src/intl/react-aria-components/pt-PT.json +6 -0
  230. package/src/intl/react-aria-components/ro-RO.json +6 -0
  231. package/src/intl/react-aria-components/ru-RU.json +6 -0
  232. package/src/intl/react-aria-components/sk-SK.json +6 -0
  233. package/src/intl/react-aria-components/sl-SI.json +6 -0
  234. package/src/intl/react-aria-components/sr-SP.json +6 -0
  235. package/src/intl/react-aria-components/sv-SE.json +6 -0
  236. package/src/intl/react-aria-components/tr-TR.json +6 -0
  237. package/src/intl/react-aria-components/uk-UA.json +6 -0
  238. package/src/intl/react-aria-components/zh-CN.json +6 -0
  239. package/src/intl/react-aria-components/zh-TW.json +6 -0
  240. package/src/intl/stately-color/ar-AE.json +39 -0
  241. package/src/intl/stately-color/bg-BG.json +39 -0
  242. package/src/intl/stately-color/cs-CZ.json +39 -0
  243. package/src/intl/stately-color/da-DK.json +39 -0
  244. package/src/intl/stately-color/de-DE.json +39 -0
  245. package/src/intl/stately-color/el-GR.json +39 -0
  246. package/src/intl/stately-color/en-US.json +39 -0
  247. package/src/intl/stately-color/es-ES.json +39 -0
  248. package/src/intl/stately-color/et-EE.json +39 -0
  249. package/src/intl/stately-color/fi-FI.json +39 -0
  250. package/src/intl/stately-color/fr-FR.json +39 -0
  251. package/src/intl/stately-color/he-IL.json +39 -0
  252. package/src/intl/stately-color/hr-HR.json +39 -0
  253. package/src/intl/stately-color/hu-HU.json +39 -0
  254. package/src/intl/stately-color/index.ts +73 -0
  255. package/src/intl/stately-color/it-IT.json +39 -0
  256. package/src/intl/stately-color/ja-JP.json +39 -0
  257. package/src/intl/stately-color/ko-KR.json +39 -0
  258. package/src/intl/stately-color/lt-LT.json +39 -0
  259. package/src/intl/stately-color/lv-LV.json +39 -0
  260. package/src/intl/stately-color/nb-NO.json +39 -0
  261. package/src/intl/stately-color/nl-NL.json +39 -0
  262. package/src/intl/stately-color/pl-PL.json +39 -0
  263. package/src/intl/stately-color/pt-BR.json +39 -0
  264. package/src/intl/stately-color/pt-PT.json +39 -0
  265. package/src/intl/stately-color/ro-RO.json +39 -0
  266. package/src/intl/stately-color/ru-RU.json +39 -0
  267. package/src/intl/stately-color/sk-SK.json +39 -0
  268. package/src/intl/stately-color/sl-SI.json +39 -0
  269. package/src/intl/stately-color/sr-SP.json +39 -0
  270. package/src/intl/stately-color/sv-SE.json +39 -0
  271. package/src/intl/stately-color/tr-TR.json +39 -0
  272. package/src/intl/stately-color/uk-UA.json +39 -0
  273. package/src/intl/stately-color/zh-CN.json +39 -0
  274. package/src/intl/stately-color/zh-TW.json +39 -0
  275. package/src/intl/toast/ar-AE.json +4 -0
  276. package/src/intl/toast/bg-BG.json +4 -0
  277. package/src/intl/toast/cs-CZ.json +4 -0
  278. package/src/intl/toast/da-DK.json +4 -0
  279. package/src/intl/toast/de-DE.json +4 -0
  280. package/src/intl/toast/el-GR.json +4 -0
  281. package/src/intl/toast/en-US.json +4 -0
  282. package/src/intl/toast/es-ES.json +4 -0
  283. package/src/intl/toast/et-EE.json +4 -0
  284. package/src/intl/toast/fi-FI.json +4 -0
  285. package/src/intl/toast/fr-FR.json +4 -0
  286. package/src/intl/toast/he-IL.json +4 -0
  287. package/src/intl/toast/hr-HR.json +4 -0
  288. package/src/intl/toast/hu-HU.json +4 -0
  289. package/src/intl/toast/index.ts +73 -0
  290. package/src/intl/toast/it-IT.json +4 -0
  291. package/src/intl/toast/ja-JP.json +4 -0
  292. package/src/intl/toast/ko-KR.json +4 -0
  293. package/src/intl/toast/lt-LT.json +4 -0
  294. package/src/intl/toast/lv-LV.json +4 -0
  295. package/src/intl/toast/nb-NO.json +4 -0
  296. package/src/intl/toast/nl-NL.json +4 -0
  297. package/src/intl/toast/pl-PL.json +4 -0
  298. package/src/intl/toast/pt-BR.json +4 -0
  299. package/src/intl/toast/pt-PT.json +4 -0
  300. package/src/intl/toast/ro-RO.json +4 -0
  301. package/src/intl/toast/ru-RU.json +4 -0
  302. package/src/intl/toast/sk-SK.json +4 -0
  303. package/src/intl/toast/sl-SI.json +4 -0
  304. package/src/intl/toast/sr-SP.json +4 -0
  305. package/src/intl/toast/sv-SE.json +4 -0
  306. package/src/intl/toast/tr-TR.json +4 -0
  307. package/src/intl/toast/uk-UA.json +4 -0
  308. package/src/intl/toast/zh-CN.json +4 -0
  309. package/src/intl/toast/zh-TW.json +4 -0
  310. package/src/landmark/useLandmark.tsx +569 -0
  311. package/src/stately/calendar/types.tsx +239 -0
  312. package/src/stately/calendar/useCalendarState.tsx +527 -0
  313. package/src/stately/calendar/useRangeCalendarState.tsx +323 -0
  314. package/src/stately/calendar/utils.tsx +175 -0
  315. package/src/stately/color/Color.tsx +889 -0
  316. package/src/stately/color/types.tsx +82 -0
  317. package/src/stately/color/useColor.tsx +30 -0
  318. package/src/stately/color/useColorAreaState.tsx +255 -0
  319. package/src/stately/color/useColorChannelFieldState.tsx +86 -0
  320. package/src/stately/color/useColorFieldState.tsx +220 -0
  321. package/src/stately/color/useColorPickerState.tsx +31 -0
  322. package/src/stately/color/useColorSliderState.tsx +143 -0
  323. package/src/stately/color/useColorWheelState.tsx +225 -0
  324. package/src/stately/data/useAsyncList.tsx +382 -0
  325. package/src/stately/data/useListData.tsx +447 -0
  326. package/src/stately/data/useTreeData.tsx +603 -0
  327. package/src/stately/datepicker/IncompleteDate.tsx +427 -0
  328. package/src/stately/datepicker/placeholders.tsx +116 -0
  329. package/src/stately/datepicker/types.tsx +169 -0
  330. package/src/stately/datepicker/useDateFieldState.tsx +564 -0
  331. package/src/stately/datepicker/useDatePickerState.tsx +244 -0
  332. package/src/stately/datepicker/useDateRangePickerState.tsx +397 -0
  333. package/src/stately/datepicker/useTimeFieldState.tsx +123 -0
  334. package/src/stately/datepicker/utils.tsx +316 -0
  335. package/src/stately/dnd/useDraggableCollectionState.tsx +191 -0
  336. package/src/stately/dnd/useDroppableCollectionState.tsx +288 -0
  337. package/src/stately/layout/GridLayout.tsx +449 -0
  338. package/src/stately/layout/ListLayout.tsx +872 -0
  339. package/src/stately/layout/TableLayout.tsx +793 -0
  340. package/src/stately/layout/WaterfallLayout.tsx +399 -0
  341. package/src/stately/toast/useToastState.tsx +219 -0
  342. package/src/stately/virtualizer/Layout.tsx +105 -0
  343. package/src/stately/virtualizer/LayoutInfo.tsx +127 -0
  344. package/src/stately/virtualizer/OverscanManager.tsx +56 -0
  345. package/src/stately/virtualizer/Point.tsx +47 -0
  346. package/src/stately/virtualizer/Rect.tsx +194 -0
  347. package/src/stately/virtualizer/ReusableView.tsx +101 -0
  348. package/src/stately/virtualizer/Size.tsx +48 -0
  349. package/src/stately/virtualizer/Virtualizer.tsx +408 -0
  350. package/src/stately/virtualizer/types.tsx +48 -0
  351. package/src/stately/virtualizer/useVirtualizerState.tsx +138 -0
  352. package/src/stately/virtualizer/utils.tsx +32 -0
  353. package/src/textfield/useTextField.ts +3 -0
  354. package/src/toast/useToast.tsx +105 -0
  355. package/src/toast/useToastRegion.tsx +223 -0
  356. package/src/upstream-exports/react-aria/I18nProvider.tsx +17 -0
  357. package/src/upstream-exports/react-aria/ListDropTargetDelegate.tsx +15 -0
  358. package/src/upstream-exports/react-aria/PortalProvider.tsx +19 -0
  359. package/src/upstream-exports/react-aria/SSRProvider.tsx +15 -0
  360. package/src/upstream-exports/react-aria/VisuallyHidden.tsx +15 -0
  361. package/src/upstream-exports/react-aria/filterDOMProps.tsx +3 -0
  362. package/src/upstream-exports/react-aria/mergeProps.tsx +14 -0
  363. package/src/upstream-exports/react-aria/private/dnd/DragManager.tsx +3 -0
  364. package/src/upstream-exports/react-aria/private/interactions/PressResponder.tsx +3 -0
  365. package/src/upstream-exports/react-aria/private/utils/isFocusable.tsx +3 -0
  366. package/src/upstream-exports/react-aria/private/utils/shadowdom/DOMFunctions.tsx +8 -0
  367. package/src/upstream-exports/react-aria/private/utils/useId.tsx +3 -0
  368. package/src/upstream-exports/react-aria/private/utils/useLabels.tsx +3 -0
  369. package/src/upstream-exports/react-aria/private/virtualizer/ScrollView.tsx +3 -0
  370. package/src/upstream-exports/react-aria/private/virtualizer/VirtualizerItem.tsx +3 -0
  371. package/src/upstream-exports/react-aria/useButton.tsx +22 -0
  372. package/src/upstream-exports/react-aria/useCalendar.tsx +37 -0
  373. package/src/upstream-exports/react-aria/useClipboard.tsx +23 -0
  374. package/src/upstream-exports/react-aria/useColorArea.tsx +19 -0
  375. package/src/upstream-exports/react-aria/useColorField.tsx +20 -0
  376. package/src/upstream-exports/react-aria/useColorSlider.tsx +19 -0
  377. package/src/upstream-exports/react-aria/useColorSwatch.tsx +15 -0
  378. package/src/upstream-exports/react-aria/useColorWheel.tsx +19 -0
  379. package/src/upstream-exports/react-aria/useDateField.tsx +23 -0
  380. package/src/upstream-exports/react-aria/useDatePicker.tsx +17 -0
  381. package/src/upstream-exports/react-aria/useDateRangePicker.tsx +24 -0
  382. package/src/upstream-exports/react-aria/useDraggableCollection.tsx +31 -0
  383. package/src/upstream-exports/react-aria/useDrop.tsx +33 -0
  384. package/src/upstream-exports/react-aria/useDroppableCollection.tsx +47 -0
  385. package/src/upstream-exports/react-aria/useFocusRing.tsx +16 -0
  386. package/src/upstream-exports/react-aria/useHover.tsx +17 -0
  387. package/src/upstream-exports/react-aria/useLocalizedStringFormatter.tsx +19 -0
  388. package/src/upstream-exports/react-aria/useObjectRef.tsx +14 -0
  389. package/src/upstream-exports/react-aria/useRangeCalendar.tsx +38 -0
  390. package/src/upstream-exports/react-aria/useTimeField.tsx +23 -0
  391. package/src/upstream-exports/react-aria/useToast.tsx +18 -0
  392. package/src/upstream-exports/react-stately/Color.tsx +23 -0
  393. package/src/upstream-exports/react-stately/private/form/useFormValidationState.tsx +11 -0
  394. package/src/upstream-exports/react-stately/useCalendarState.tsx +24 -0
  395. package/src/upstream-exports/react-stately/useColorAreaState.tsx +24 -0
  396. package/src/upstream-exports/react-stately/useColorFieldState.tsx +22 -0
  397. package/src/upstream-exports/react-stately/useColorPickerState.tsx +25 -0
  398. package/src/upstream-exports/react-stately/useColorSliderState.tsx +25 -0
  399. package/src/upstream-exports/react-stately/useColorWheelState.tsx +24 -0
  400. package/src/upstream-exports/react-stately/useDateFieldState.tsx +29 -0
  401. package/src/upstream-exports/react-stately/useDatePickerState.tsx +25 -0
  402. package/src/upstream-exports/react-stately/useDateRangePickerState.tsx +26 -0
  403. package/src/upstream-exports/react-stately/useDraggableCollectionState.tsx +19 -0
  404. package/src/upstream-exports/react-stately/useDroppableCollectionState.tsx +19 -0
  405. package/src/upstream-exports/react-stately/useRangeCalendarState.tsx +27 -0
  406. package/src/upstream-exports/react-stately/useTimeFieldState.tsx +26 -0
  407. package/src/upstream-exports/react-stately/useToastState.tsx +21 -0
  408. package/src/upstream-exports/react-stately/useVirtualizerState.tsx +22 -0
  409. package/src/utils/useLoadMore.tsx +89 -0
  410. package/src/virtualizer/ScrollView.tsx +401 -0
  411. package/src/virtualizer/Virtualizer.tsx +147 -0
  412. package/src/virtualizer/VirtualizerItem.tsx +108 -0
  413. package/src/virtualizer/useVirtualizerItem.tsx +57 -0
  414. package/src/virtualizer/utils.tsx +105 -0
  415. package/LICENSE +0 -21
  416. package/src/components/useDragAndDrop.ts +0 -164
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2019 Adobe
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md CHANGED
@@ -2,20 +2,32 @@
2
2
 
3
3
  React Aria for the [octane](https://github.com/octanejs/octane) renderer — a
4
4
  faithful port of Adobe's [React Aria](https://react-spectrum.adobe.com/react-aria/)
5
- (`react-aria`, `react-stately`, and eventually `react-aria-components`) onto
5
+ (`react-aria`, `react-stately`, and `react-aria-components`) onto
6
6
  octane's hooks and native event system.
7
7
 
8
8
  - `@octanejs/aria` — the `react-aria` behavior-hook surface.
9
9
  - `@octanejs/aria/stately` — the `react-stately` state-hook surface.
10
- - `@octanejs/aria/components` — the `react-aria-components` surface (planned).
10
+ - `@octanejs/aria/components` — the complete public export surface of
11
+ `react-aria-components@1.19.0`.
11
12
 
12
- Ported from the pinned `adobe/react-spectrum` checkout at the commit publishing
13
- `react-aria@3.50.0` / `react-stately@3.48.0` / `react-aria-components@1.19.0`,
14
- and proven by differential parity: the same fixture runs through
15
- `@octanejs/aria` and the real React packages, asserting byte-identical DOM.
13
+ Ported from the pinned `adobe/react-spectrum` checkout at commit
14
+ `1c84a49a1faf50b571c84e00bcf9c60b22ddd03e`, which publishes
15
+ `react-aria@3.50.0`, `react-stately@3.48.0`, and
16
+ `react-aria-components@1.19.0`. The components entry point has an exact checked
17
+ crosswalk: all 280 runtime exports and all 313 type exports match the pinned
18
+ package, with no missing or extra names. Existing families retain differential
19
+ tests against React; calendar/date, color, drag and drop, file, data, toast, and
20
+ layout additions have focused public-behavior coverage.
16
21
 
17
22
  Status, supported surface, and known divergences: `status.json` (rendered into
18
- `docs/bindings-status.md`). Plan and progress: `docs/aria-migration-plan.md`.
23
+ `docs/bindings-status.md`). Source provenance and refresh instructions:
24
+ `UPSTREAM.md`.
25
+
26
+ Verify the pinned public surface with:
27
+
28
+ ```bash
29
+ pnpm --filter @octanejs/aria exports:check
30
+ ```
19
31
 
20
32
  ## Notable divergences
21
33
 
@@ -24,3 +36,4 @@ Status, supported surface, and known divergences: `status.json` (rendered into
24
36
  inputs). React Aria's public value-level `onChange(value)` callbacks are
25
37
  unchanged.
26
38
  - `forwardRef` becomes octane's ref-as-prop (React 19 style).
39
+ - React Server Components are not part of the Octane binding.
package/UPSTREAM.md ADDED
@@ -0,0 +1,108 @@
1
+ # React Aria upstream ledger
2
+
3
+ `@octanejs/aria` targets the coordinated React Spectrum release at commit
4
+ `1c84a49a1faf50b571c84e00bcf9c60b22ddd03e`:
5
+
6
+ | Package | Version | Verified tag | npm SHA-256 | npm integrity |
7
+ | --- | --- | --- | --- | --- |
8
+ | `react-aria` | `3.50.0` | `react-aria@3.50.0` | `bcab487177dba271a36f247531043c3c940579cacc201e31bbdbba29ef2d2a7c` | `sha512-S0Os6QZk33fzUAKu1QLT9afoUaCBt1ZNdoiq0n2YMVgKIdNIQS8zxiZ8O9hYE6QyDkHKjD6q39LQZ+qaSAIgjw==` |
9
+ | `react-aria-components` | `1.19.0` | `react-aria-components@1.19.0` | `d63da4e2ab794d3a86a16ba17b719f22a256d9c0c5fd22c057d228e0f05932a1` | `sha512-2smSS5nqJ8cGYMQezuUXveZm7eMyHCqTN6mDpylQBYLYbdF5dxCCuW1DHn1VKLe1DybSfPvX/cZtJlDmvFfn8A==` |
10
+ | `react-stately` | `3.48.0` | `react-stately@3.48.0` | `55f38303d09112619b9adc754032ba3caadc7e5a0b7fbc74bfc5636369674dd4` | `sha512-ImicSAG+lTotAe5izcs1fz49Zk48w7pDusqYg04WaPhCoej8BJ24soMu3iLXIrsi273s4P1gZrYGrqReMfgEEA==` |
11
+
12
+ All three signed registry artifacts record the same `gitHead`, and all three tags resolve to
13
+ that commit. The ordered composite SHA-256 of the three npm tarballs is
14
+ `dcad3293f0f7438705f72cdd7df03351476aeaba7d0d2743c7ad6d8130aff56f`.
15
+ The supported range is these exact coordinated versions; upgrades require a new crosswalk.
16
+
17
+ ## Source and test boundary
18
+
19
+ - Canonical repository: `https://github.com/adobe/react-spectrum.git`
20
+ - Source roots: `packages/react-aria/src`, `packages/react-aria-components/src`, and
21
+ `packages/react-stately/src`
22
+ - Public entry points: each package's `exports/index.ts`
23
+ - Test roots: each package's `test` directory
24
+ - License: Apache-2.0; the pinned root `LICENSE` SHA-256 is
25
+ `7dfe6526888bac51759c99f9a51262ba2711a8c12a067f2181609dd9a4066b84`
26
+ - React oracle: `react@19.2.7` and `react-dom@19.2.7`
27
+
28
+ The monorepo source and suites are not vendored in this retrofit because the three package
29
+ trees contain more than two thousand source/support files. The immutable external checkout
30
+ can be reproduced with:
31
+
32
+ ```sh
33
+ git clone --depth 1 --branch react-aria@3.50.0 --filter=blob:none --sparse \
34
+ https://github.com/adobe/react-spectrum.git react-spectrum-aria-3.50.0
35
+ git -C react-spectrum-aria-3.50.0 sparse-checkout set --skip-checks \
36
+ packages/react-aria packages/react-aria-components packages/react-stately LICENSE
37
+ ```
38
+
39
+ `audit/upstream-crosswalk.json` records all 1,294 public entry-point exports and all 185
40
+ test-root artifacts from that checkout. It currently classifies 998 exports as
41
+ `surface-present-unverified`, with per-symbol entry-point evidence, and 296 as explicit gaps.
42
+ Surface presence is not a behavioral parity claim. The upstream suites contain 177 runtime
43
+ test files, one type test, and seven support artifacts. They are present but have not been
44
+ adapted case-by-case, so this binding remains `recorded-unverified`.
45
+
46
+ ## React Aria Components public surface
47
+
48
+ The `@octanejs/aria/components` entry point separately claims complete named-export parity
49
+ with the pinned `react-aria-components@1.19.0` package. The completed inventory is 280 runtime
50
+ exports and 313 type exports, including calendar/date/time, color, drag-and-drop,
51
+ DropZone/FileTrigger, toast, data hooks, Virtualizer, and layout classes.
52
+
53
+ `scripts/check-react-aria-components-exports.mjs` parses the installed pinned declaration
54
+ barrel and `src/components/index.ts`, keeps runtime and type-only exports in separate lanes,
55
+ and rejects missing or extra names in either direction:
56
+
57
+ ```sh
58
+ pnpm --filter @octanejs/aria exports:check
59
+ ```
60
+
61
+ This components-entry claim does not convert the broader `react-aria` and `react-stately`
62
+ crosswalk into a full-export or full-upstream-suite claim.
63
+
64
+ ## Refreshing the advanced source staging tree
65
+
66
+ The sparse `.react-spectrum` checkout must point at the exact coordinated commit above.
67
+ `scripts/port-advanced-source.mjs` creates a reviewable staging tree, rewrites package
68
+ boundaries to the local Octane adapters, copies locale dictionaries, and records provenance.
69
+ It must not target `packages/aria`, because reviewed Octane adaptations must not be
70
+ overwritten mechanically.
71
+
72
+ ```sh
73
+ node packages/aria/scripts/port-advanced-source.mjs \
74
+ --output-root /tmp/octane-aria-upstream
75
+ ```
76
+
77
+ Review the staged diff against `packages/aria`, preserve native-event, ref-as-prop,
78
+ hook-slot, and compiler adaptations, then run the export audit, `tsrx-tsc`, and the Aria
79
+ test projects. Updating the pin requires reviewing the upstream source and export diffs
80
+ together. Newly adapted Adobe source retains its Apache-2.0 header; the required license
81
+ text is shipped as `LICENSE-APACHE-2.0`.
82
+
83
+ ## Executable evidence
84
+
85
+ The only React-parity-owned executable lane today is the bounded differential project. It
86
+ compiles the same `.tsrx` fixtures once for Octane and once for the pinned React packages,
87
+ covering interaction hooks, form-field event wiring, collections, Select, ComboBox, React Aria
88
+ Components render props, keyed collection updates, and Tree/Table state.
89
+
90
+ That lane is representative evidence only. Declaring the upstream runtime and type suites
91
+ `present` records that the coordinated checkout contains those suites; it is not a claim that
92
+ this binding has completed pristine full-suite, one-for-one adapted, or type-lane execution.
93
+ The export/test crosswalk and Octane-only divergence/framework contracts remain ordinary-shard
94
+ coverage until those required lanes and inventories exist.
95
+
96
+ ## Intentional divergences
97
+
98
+ - Native text editing uses Octane `onInput` wiring while public value callbacks retain their
99
+ upstream `onChange(value)` names.
100
+ - React `forwardRef` wrappers become Octane ref-as-prop components.
101
+ - The i18n server serializer keeps generated identifiers valid after 26 hoisted strings,
102
+ correcting invalid JavaScript emitted by the pinned upstream algorithm.
103
+ - Server locale direction is derived from the injected locale, including RTL locales, rather
104
+ than being hard-coded to `ltr`.
105
+
106
+ `native-input-event-wiring` is linked to the differential case in `audit/react-parity.json`.
107
+ The other divergences above remain documented package contracts with ordinary-shard tests; they
108
+ are not counted as completed React-parity suite evidence until adapted upstream lanes exist.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@octanejs/aria",
3
- "version": "0.0.40",
4
- "license": "MIT",
3
+ "version": "0.0.41",
4
+ "license": "MIT AND Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": [
7
7
  "./src/index.ts",
@@ -36,7 +36,9 @@
36
36
  "types": "src/index.ts",
37
37
  "files": [
38
38
  "src",
39
- "README.md"
39
+ "README.md",
40
+ "UPSTREAM.md",
41
+ "LICENSE-APACHE-2.0"
40
42
  ],
41
43
  "exports": {
42
44
  ".": "./src/index.ts",
@@ -51,20 +53,22 @@
51
53
  "clsx": "^2.1.1"
52
54
  },
53
55
  "peerDependencies": {
54
- "octane": "0.1.46"
56
+ "octane": "0.1.47"
55
57
  },
56
58
  "devDependencies": {
57
- "@tsrx/react": "^0.2.58",
59
+ "@tsrx/react": "^0.2.61",
58
60
  "esbuild": "^0.28.1",
59
61
  "react": "^19.2.7",
60
62
  "react-aria": "3.50.0",
61
63
  "react-aria-components": "1.19.0",
62
64
  "react-dom": "^19.2.7",
63
65
  "react-stately": "3.48.0",
66
+ "typescript": "^5.9.3",
64
67
  "vitest": "^4.1.10",
65
- "octane": "0.1.46"
68
+ "octane": "0.1.47"
66
69
  },
67
70
  "scripts": {
71
+ "exports:check": "node scripts/check-react-aria-components-exports.mjs",
68
72
  "test": "vitest run"
69
73
  }
70
74
  }
@@ -0,0 +1,36 @@
1
+ /** @jsxImportSource octane */
2
+ // Ported from adobe/react-spectrum@1c84a49a1faf50b571c84e00bcf9c60b22ddd03e (packages/react-aria/src/calendar/useCalendar.ts).
3
+ /*
4
+ * Copyright 2020 Adobe. All rights reserved.
5
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License. You may obtain a copy
7
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software distributed under
10
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
+ * OF ANY KIND, either express or implied. See the License for the specific language
12
+ * governing permissions and limitations under the License.
13
+ */
14
+
15
+ import { AriaLabelingProps, DOMProps } from '@react-types/shared';
16
+ import { CalendarAria, useCalendarBase } from './useCalendarBase';
17
+ import {
18
+ CalendarProps,
19
+ CalendarSelectionMode,
20
+ CalendarState,
21
+ DateValue,
22
+ } from '../upstream-exports/react-stately/useCalendarState';
23
+
24
+ export interface AriaCalendarProps<T extends DateValue, M extends CalendarSelectionMode = 'single'>
25
+ extends CalendarProps<T, M>, DOMProps, AriaLabelingProps {}
26
+
27
+ /**
28
+ * Provides the behavior and accessibility implementation for a calendar component.
29
+ * A calendar displays one or more date grids and allows users to select a single date.
30
+ */
31
+ export function useCalendar<T extends DateValue, M extends CalendarSelectionMode = 'single'>(
32
+ props: AriaCalendarProps<T, M>,
33
+ state: CalendarState<M>,
34
+ ): CalendarAria {
35
+ return useCalendarBase(props, state);
36
+ }
@@ -0,0 +1,142 @@
1
+ /** @jsxImportSource octane */
2
+ // Ported from adobe/react-spectrum@1c84a49a1faf50b571c84e00bcf9c60b22ddd03e (packages/react-aria/src/calendar/useCalendarBase.ts).
3
+ /*
4
+ * Copyright 2020 Adobe. All rights reserved.
5
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License. You may obtain a copy
7
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software distributed under
10
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
+ * OF ANY KIND, either express or implied. See the License for the specific language
12
+ * governing permissions and limitations under the License.
13
+ */
14
+
15
+ import { announce } from '../live-announcer/LiveAnnouncer';
16
+ import { AriaButtonProps } from '../button/useButton';
17
+ import { AriaLabelingProps, DOMAttributes, DOMProps } from '@react-types/shared';
18
+ import {
19
+ CalendarPropsBase,
20
+ CalendarSelectionMode,
21
+ CalendarState,
22
+ } from '../upstream-exports/react-stately/useCalendarState';
23
+ import { filterDOMProps } from '../utils/filterDOMProps';
24
+ import { hookData, useSelectedDateDescription, useVisibleRangeDescription } from './utils';
25
+ import intlMessages from '../intl/calendar/index';
26
+ import { mergeProps } from '../utils/mergeProps';
27
+ import { RangeCalendarState } from '../upstream-exports/react-stately/useRangeCalendarState';
28
+ import { useLabels } from '../utils/useLabels';
29
+ import { useLocalizedStringFormatter } from '../i18n/useLocalizedStringFormatter';
30
+ import { useSlotId } from '../utils/useId';
31
+ import { useState } from '../compat/react';
32
+ import { useUpdateEffect } from '../utils/useUpdateEffect';
33
+
34
+ export interface CalendarAria {
35
+ /** Props for the calendar grouping element. */
36
+ calendarProps: DOMAttributes;
37
+ /** Props for the next button. */
38
+ nextButtonProps: AriaButtonProps;
39
+ /** Props for the previous button. */
40
+ prevButtonProps: AriaButtonProps;
41
+ /** Props for the error message element, if any. */
42
+ errorMessageProps: DOMAttributes;
43
+ /** A description of the visible date range, for use in the calendar title. */
44
+ title: string;
45
+ }
46
+
47
+ export function useCalendarBase(
48
+ props: CalendarPropsBase & DOMProps & AriaLabelingProps,
49
+ state: CalendarState<CalendarSelectionMode> | RangeCalendarState,
50
+ ): CalendarAria {
51
+ let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/calendar');
52
+ let domProps = filterDOMProps(props);
53
+
54
+ let title = useVisibleRangeDescription(
55
+ state.visibleRange.start,
56
+ state.visibleRange.end,
57
+ state.timeZone,
58
+ false,
59
+ );
60
+ let visibleRangeDescription = useVisibleRangeDescription(
61
+ state.visibleRange.start,
62
+ state.visibleRange.end,
63
+ state.timeZone,
64
+ true,
65
+ );
66
+
67
+ // Announce when the visible date range changes
68
+ useUpdateEffect(() => {
69
+ // only when pressing the Previous or Next button
70
+ if (!state.isFocused) {
71
+ announce(visibleRangeDescription);
72
+ }
73
+ }, [visibleRangeDescription]);
74
+
75
+ // Announce when the selected value changes
76
+ let selectedDateDescription = useSelectedDateDescription(state);
77
+ useUpdateEffect(() => {
78
+ if (selectedDateDescription) {
79
+ announce(selectedDateDescription, 'polite', 4000);
80
+ }
81
+ // handle an update to the caption that describes the currently selected range, to announce the new value
82
+ }, [selectedDateDescription]);
83
+
84
+ let errorMessageId = useSlotId([
85
+ Boolean(props.errorMessage),
86
+ props.isInvalid,
87
+ props.validationState,
88
+ ]);
89
+
90
+ // Pass the label to the child grid elements.
91
+ hookData.set(state, {
92
+ ariaLabel: props['aria-label'],
93
+ ariaLabelledBy: props['aria-labelledby'],
94
+ errorMessageId,
95
+ selectedDateDescription,
96
+ });
97
+
98
+ // If the next or previous buttons become disabled while they are focused, move focus to the calendar body.
99
+ let [nextFocused, setNextFocused] = useState(false);
100
+ let nextDisabled = props.isDisabled || state.isNextVisibleRangeInvalid();
101
+ if (nextDisabled && nextFocused) {
102
+ setNextFocused(false);
103
+ state.setFocused(true);
104
+ }
105
+
106
+ let [previousFocused, setPreviousFocused] = useState(false);
107
+ let previousDisabled = props.isDisabled || state.isPreviousVisibleRangeInvalid();
108
+ if (previousDisabled && previousFocused) {
109
+ setPreviousFocused(false);
110
+ state.setFocused(true);
111
+ }
112
+
113
+ let labelProps = useLabels({
114
+ id: props['id'],
115
+ 'aria-label': [props['aria-label'], visibleRangeDescription].filter(Boolean).join(', '),
116
+ 'aria-labelledby': props['aria-labelledby'],
117
+ });
118
+
119
+ return {
120
+ calendarProps: mergeProps(domProps, labelProps, {
121
+ role: 'application',
122
+ 'aria-details': props['aria-details'] || undefined,
123
+ 'aria-describedby': props['aria-describedby'] || undefined,
124
+ }),
125
+ nextButtonProps: {
126
+ onPress: () => state.focusNextPage(),
127
+ 'aria-label': stringFormatter.format('next'),
128
+ isDisabled: nextDisabled,
129
+ onFocusChange: setNextFocused,
130
+ },
131
+ prevButtonProps: {
132
+ onPress: () => state.focusPreviousPage(),
133
+ 'aria-label': stringFormatter.format('previous'),
134
+ isDisabled: previousDisabled,
135
+ onFocusChange: setPreviousFocused,
136
+ },
137
+ errorMessageProps: {
138
+ id: errorMessageId,
139
+ },
140
+ title,
141
+ };
142
+ }