@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,427 @@
1
+ /** @jsxImportSource octane */
2
+ // Ported from adobe/react-spectrum@1c84a49a1faf50b571c84e00bcf9c60b22ddd03e (packages/react-stately/src/datepicker/IncompleteDate.ts).
3
+ /*
4
+ * Copyright 2026 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 { AnyDateTime, Calendar, CalendarDate, ZonedDateTime } from '@internationalized/date';
16
+ import { DateSegmentType } from './useDateFieldState';
17
+ import { DateValue } from './types';
18
+
19
+ type HourCycle = 'h12' | 'h11' | 'h23' | 'h24';
20
+
21
+ export interface IncompleteDate {
22
+ [key: string]: any;
23
+ }
24
+
25
+ /**
26
+ * This class represents a date that is incomplete or otherwise invalid as a result of user editing.
27
+ * For example, it can represent temporary dates such as February 31st if the user edits the day
28
+ * before the month. Times are represented according to an hour cycle rather than always in 24 hour
29
+ * time. This enables the user to adjust the day period (e.g. am/pm) independently from the hour.
30
+ */
31
+ export class IncompleteDate {
32
+ calendar: Calendar;
33
+ era: string | null;
34
+ year: number | null;
35
+ month: number | null;
36
+ day: number | null;
37
+ hour: number | null;
38
+ hourCycle: HourCycle;
39
+ dayPeriod: number | null;
40
+ minute: number | null;
41
+ second: number | null;
42
+ millisecond: number | null;
43
+ offset: number | null;
44
+
45
+ constructor(
46
+ calendar: Calendar,
47
+ hourCycle: HourCycle,
48
+ dateValue?: Partial<Omit<AnyDateTime, 'copy'>> | null,
49
+ ) {
50
+ this.era = dateValue?.era ?? null;
51
+ this.calendar = calendar;
52
+ this.year = dateValue?.year ?? null;
53
+ this.month = dateValue?.month ?? null;
54
+ this.day = dateValue?.day ?? null;
55
+ this.hour = dateValue?.hour ?? null;
56
+ this.hourCycle = hourCycle;
57
+ this.dayPeriod = null;
58
+ this.minute = dateValue?.minute ?? null;
59
+ this.second = dateValue?.second ?? null;
60
+ this.millisecond = dateValue?.millisecond ?? null;
61
+ this.offset = 'offset' in (dateValue ?? {}) ? (dateValue as any).offset : null;
62
+
63
+ // Convert the hour from 24 hour time to the given hour cycle.
64
+ if (this.hour != null) {
65
+ let [dayPeriod, hour] = toHourCycle(this.hour, hourCycle);
66
+ this.dayPeriod = dayPeriod;
67
+ this.hour = hour;
68
+ }
69
+ }
70
+
71
+ copy(): IncompleteDate {
72
+ let res = new IncompleteDate(this.calendar, this.hourCycle);
73
+ res.era = this.era;
74
+ res.year = this.year;
75
+ res.month = this.month;
76
+ res.day = this.day;
77
+ res.hour = this.hour;
78
+ res.dayPeriod = this.dayPeriod;
79
+ res.minute = this.minute;
80
+ res.second = this.second;
81
+ res.millisecond = this.millisecond;
82
+ res.offset = this.offset;
83
+ return res;
84
+ }
85
+
86
+ /** Checks whether all the specified segments have a value. */
87
+ isComplete(segments: DateSegmentType[]) {
88
+ return segments.every((segment) => (this as any)[segment] != null);
89
+ }
90
+
91
+ /** Checks whether the given date value matches this value for the specified segments. */
92
+ validate(dt: DateValue, segments: DateSegmentType[]) {
93
+ return segments.every((segment) => {
94
+ if ((segment === 'hour' || segment === 'dayPeriod') && 'hour' in dt) {
95
+ let [dayPeriod, hour] = toHourCycle(dt.hour, this.hourCycle);
96
+ return this.dayPeriod === dayPeriod && this.hour === hour;
97
+ }
98
+ return (this as any)[segment] === (dt as any)[segment];
99
+ });
100
+ }
101
+
102
+ /** Checks if the date is empty (i.e. all specified segments are null). */
103
+ isCleared(segments: DateSegmentType[]): boolean {
104
+ return segments.every((segment) => (this as any)[segment] === null);
105
+ }
106
+
107
+ /** Sets the given field. */
108
+ set(field: DateSegmentType, value: number | string, placeholder: DateValue): IncompleteDate {
109
+ let result = this.copy();
110
+ (result as any)[field] = value;
111
+ if (field === 'hour' && result.dayPeriod == null && 'hour' in placeholder) {
112
+ result.dayPeriod = toHourCycle(placeholder.hour, this.hourCycle)[0];
113
+ }
114
+ if (field === 'year' && result.era == null) {
115
+ result.era = placeholder.era;
116
+ }
117
+
118
+ // clear offset when a date/time field changes since it may no longer be valid
119
+ if (field !== 'second' && field !== 'literal' && field !== 'timeZoneName') {
120
+ result.offset = null;
121
+ }
122
+ return result;
123
+ }
124
+
125
+ /** Sets the given field to null. */
126
+ clear(field: DateSegmentType): IncompleteDate {
127
+ let result = this.copy();
128
+ // @ts-ignore
129
+ (result as any)[field] = null;
130
+ if (field === 'year') {
131
+ result.era = null;
132
+ }
133
+
134
+ // clear offset when a field is cleared since it may no longer be valid
135
+ result.offset = null;
136
+ return result;
137
+ }
138
+
139
+ /**
140
+ * Increments or decrements the given field. If it is null, then it is set to the placeholder
141
+ * value.
142
+ */
143
+ cycle(
144
+ field: DateSegmentType,
145
+ amount: number,
146
+ placeholder: DateValue,
147
+ displaySegments: DateSegmentType[],
148
+ ): IncompleteDate {
149
+ let res = this.copy();
150
+
151
+ // If field is null, default to placeholder.
152
+ if ((res as any)[field] == null && field !== 'dayPeriod' && field !== 'era') {
153
+ if (field === 'hour' && 'hour' in placeholder) {
154
+ let [dayPeriod, hour] = toHourCycle(placeholder.hour, this.hourCycle);
155
+ res.dayPeriod = dayPeriod;
156
+ res.hour = hour;
157
+ } else {
158
+ (res as any)[field] = (placeholder as any)[field];
159
+ }
160
+ if (field === 'year' && res.era == null) {
161
+ res.era = placeholder.era;
162
+ }
163
+
164
+ return res;
165
+ }
166
+
167
+ switch (field) {
168
+ case 'era': {
169
+ let eras = this.calendar.getEras();
170
+ let index = eras.indexOf(res.era!);
171
+ index = cycleValue(index, amount, 0, eras.length - 1);
172
+ res.era = eras[index];
173
+ break;
174
+ }
175
+ case 'year': {
176
+ // Use CalendarDate to cycle so that we update the era when going between 1 AD and 1 BC.
177
+ let date = new CalendarDate(
178
+ this.calendar,
179
+ this.era ?? placeholder.era,
180
+ this.year ?? placeholder.year,
181
+ this.month ?? 1,
182
+ this.day ?? 1,
183
+ );
184
+ date = date.cycle(field, amount, { round: field === 'year' });
185
+ res.era = date.era;
186
+ res.year = date.year;
187
+ break;
188
+ }
189
+ case 'month':
190
+ res.month = cycleValue(res.month ?? 1, amount, 1, this.calendar.getMaximumMonthsInYear());
191
+ break;
192
+ case 'day':
193
+ // Allow incrementing up to the maximum number of days in any month.
194
+ res.day = cycleValue(res.day ?? 1, amount, 1, this.calendar.getMaximumDaysInMonth());
195
+ break;
196
+ case 'hour': {
197
+ // if date is fully defined or it is just a time field, and we have a time zone, use toValue to get a ZonedDateTime to cycle
198
+ // so DST fallback is properly handled
199
+ let hasDateSegements = displaySegments.some((s) => ['year', 'month', 'day'].includes(s));
200
+ if (
201
+ 'timeZone' in placeholder &&
202
+ (!hasDateSegements || (res.year != null && res.month != null && res.day != null))
203
+ ) {
204
+ let date = this.toValue(placeholder) as ZonedDateTime;
205
+ date = date.cycle('hour', amount, {
206
+ hourCycle: this.hourCycle === 'h12' ? 12 : 24,
207
+ round: false,
208
+ });
209
+ let [dayPeriod, adjustedHour] = toHourCycle(date.hour, this.hourCycle);
210
+ res.hour = adjustedHour;
211
+ res.dayPeriod = dayPeriod;
212
+ res.offset = date.offset;
213
+ } else {
214
+ let hours = res.hour ?? 0;
215
+ let limits = this.getSegmentLimits('hour')!;
216
+ res.hour = cycleValue(hours, amount, limits.minValue, limits.maxValue);
217
+ if (res.dayPeriod == null && 'hour' in placeholder) {
218
+ res.dayPeriod = toHourCycle(placeholder.hour, this.hourCycle)[0];
219
+ }
220
+ }
221
+ break;
222
+ }
223
+ case 'dayPeriod':
224
+ res.dayPeriod = cycleValue(res.dayPeriod ?? 0, amount, 0, 1);
225
+ break;
226
+ case 'minute':
227
+ res.minute = cycleValue(res.minute ?? 0, amount, 0, 59, true);
228
+ break;
229
+ case 'second':
230
+ res.second = cycleValue(res.second ?? 0, amount, 0, 59, true);
231
+ break;
232
+ }
233
+
234
+ return res;
235
+ }
236
+
237
+ /**
238
+ * Converts the incomplete date to a full date value, using the provided value for any unset
239
+ * fields.
240
+ */
241
+ toValue(value: DateValue): DateValue {
242
+ if ('hour' in value) {
243
+ let hour = this.hour;
244
+ if (hour != null) {
245
+ hour = fromHourCycle(hour, this.dayPeriod ?? 0, this.hourCycle);
246
+ } else if (this.hourCycle === 'h12' || this.hourCycle === 'h11') {
247
+ hour = this.dayPeriod === 1 ? 12 : 0;
248
+ }
249
+
250
+ let res = value.set({
251
+ era: this.era ?? value.era,
252
+ year: this.year ?? value.year,
253
+ month: this.month ?? value.month,
254
+ day: this.day ?? value.day,
255
+ hour: hour ?? value.hour,
256
+ minute: this.minute ?? value.minute,
257
+ second: this.second ?? value.second,
258
+ millisecond: this.millisecond ?? value.millisecond,
259
+ });
260
+
261
+ if ('offset' in res && this.offset != null && res.offset !== this.offset) {
262
+ res = res.add({ milliseconds: res.offset - this.offset });
263
+ }
264
+
265
+ return res;
266
+ } else {
267
+ return value.set({
268
+ era: this.era ?? value.era,
269
+ year: this.year ?? value.year,
270
+ month: this.month ?? value.month,
271
+ day: this.day ?? value.day,
272
+ });
273
+ }
274
+ }
275
+
276
+ getSegmentLimits(
277
+ type: string,
278
+ ): { value: number | null; minValue: number; maxValue: number } | undefined {
279
+ switch (type) {
280
+ case 'era': {
281
+ let eras = this.calendar.getEras();
282
+ return {
283
+ value: this.era != null ? eras.indexOf(this.era) : eras.length - 1,
284
+ minValue: 0,
285
+ maxValue: eras.length - 1,
286
+ };
287
+ }
288
+ case 'year':
289
+ return {
290
+ value: this.year,
291
+ minValue: 1,
292
+ maxValue: 9999,
293
+ };
294
+ case 'month':
295
+ return {
296
+ value: this.month,
297
+ minValue: 1,
298
+ maxValue: this.calendar.getMaximumMonthsInYear(),
299
+ };
300
+ case 'day':
301
+ return {
302
+ value: this.day,
303
+ minValue: 1,
304
+ maxValue: this.calendar.getMaximumDaysInMonth(),
305
+ };
306
+ case 'dayPeriod': {
307
+ return {
308
+ value: this.dayPeriod,
309
+ minValue: 0,
310
+ maxValue: 1,
311
+ };
312
+ }
313
+ case 'hour': {
314
+ let minValue = 0;
315
+ let maxValue = 23;
316
+ if (this.hourCycle === 'h12') {
317
+ minValue = 1;
318
+ maxValue = 12;
319
+ } else if (this.hourCycle === 'h11') {
320
+ minValue = 0;
321
+ maxValue = 11;
322
+ }
323
+
324
+ return {
325
+ value: this.hour,
326
+ minValue,
327
+ maxValue,
328
+ };
329
+ }
330
+ case 'minute':
331
+ return {
332
+ value: this.minute,
333
+ minValue: 0,
334
+ maxValue: 59,
335
+ };
336
+ case 'second':
337
+ return {
338
+ value: this.second,
339
+ minValue: 0,
340
+ maxValue: 59,
341
+ };
342
+ }
343
+ }
344
+ }
345
+
346
+ function cycleValue(value: number, amount: number, min: number, max: number, round = false) {
347
+ if (round) {
348
+ value += Math.sign(amount);
349
+
350
+ if (value < min) {
351
+ value = max;
352
+ }
353
+
354
+ let div = Math.abs(amount);
355
+ if (amount > 0) {
356
+ value = Math.ceil(value / div) * div;
357
+ } else {
358
+ value = Math.floor(value / div) * div;
359
+ }
360
+
361
+ if (value > max) {
362
+ value = min;
363
+ }
364
+ } else {
365
+ value += amount;
366
+ if (value < min) {
367
+ value = max - (min - value - 1);
368
+ } else if (value > max) {
369
+ value = min + (value - max - 1);
370
+ }
371
+ }
372
+
373
+ return value;
374
+ }
375
+
376
+ function toHourCycle(hour: number, hourCycle: HourCycle): [number | null, number] {
377
+ let dayPeriod: number | null = hour >= 12 ? 1 : 0;
378
+ switch (hourCycle) {
379
+ case 'h11':
380
+ // Hours are numbered from 0 to 11. Used in Japan.
381
+ if (hour >= 12) {
382
+ hour -= 12;
383
+ }
384
+ break;
385
+ case 'h12':
386
+ // Hours are numbered from 12 (representing 0) to 11.
387
+ if (hour === 0) {
388
+ hour = 12;
389
+ } else if (hour > 12) {
390
+ hour -= 12;
391
+ }
392
+ break;
393
+ case 'h23':
394
+ // 24 hour time, numbered 0 to 23.
395
+ dayPeriod = null;
396
+ break;
397
+ case 'h24':
398
+ // 24 hour time numbered 24 to 23. Unused but supported by Intl.DateTimeFormat.
399
+ hour += 1;
400
+ dayPeriod = null;
401
+ }
402
+
403
+ return [dayPeriod, hour];
404
+ }
405
+
406
+ function fromHourCycle(hour: number, dayPeriod: number, hourCycle: HourCycle): number {
407
+ switch (hourCycle) {
408
+ case 'h11':
409
+ if (dayPeriod === 1) {
410
+ hour += 12;
411
+ }
412
+ break;
413
+ case 'h12':
414
+ if (hour === 12) {
415
+ hour = 0;
416
+ }
417
+ if (dayPeriod === 1) {
418
+ hour += 12;
419
+ }
420
+ break;
421
+ case 'h24':
422
+ hour -= 1;
423
+ break;
424
+ }
425
+
426
+ return hour;
427
+ }
@@ -0,0 +1,116 @@
1
+ /** @jsxImportSource octane */
2
+ // Ported from adobe/react-spectrum@1c84a49a1faf50b571c84e00bcf9c60b22ddd03e (packages/react-stately/src/datepicker/placeholders.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 { LocalizedStringDictionary } from '@internationalized/string';
16
+
17
+ // These placeholders are based on the strings used by the <input type="date">
18
+ // implementations in Chrome and Firefox. Additional languages are supported
19
+ // here than React Spectrum's typical translations.
20
+ const placeholders = new LocalizedStringDictionary(
21
+ {
22
+ ach: { year: 'mwaka', month: 'dwe', day: 'nino' },
23
+ af: { year: 'jjjj', month: 'mm', day: 'dd' },
24
+ am: { year: 'ዓዓዓዓ', month: 'ሚሜ', day: 'ቀቀ' },
25
+ an: { year: 'aaaa', month: 'mm', day: 'dd' },
26
+ ar: { year: 'سنة', month: 'شهر', day: 'يوم' },
27
+ ast: { year: 'aaaa', month: 'mm', day: 'dd' },
28
+ az: { year: 'iiii', month: 'aa', day: 'gg' },
29
+ be: { year: 'гггг', month: 'мм', day: 'дд' },
30
+ bg: { year: 'гггг', month: 'мм', day: 'дд' },
31
+ bn: { year: 'yyyy', month: 'মিমি', day: 'dd' },
32
+ br: { year: 'bbbb', month: 'mm', day: 'dd' },
33
+ bs: { year: 'gggg', month: 'mm', day: 'dd' },
34
+ ca: { year: 'aaaa', month: 'mm', day: 'dd' },
35
+ cak: { year: 'jjjj', month: 'ii', day: "q'q'" },
36
+ ckb: { year: 'ساڵ', month: 'مانگ', day: 'ڕۆژ' },
37
+ cs: { year: 'rrrr', month: 'mm', day: 'dd' },
38
+ cy: { year: 'bbbb', month: 'mm', day: 'dd' },
39
+ da: { year: 'åååå', month: 'mm', day: 'dd' },
40
+ de: { year: 'jjjj', month: 'mm', day: 'tt' },
41
+ dsb: { year: 'llll', month: 'mm', day: 'źź' },
42
+ el: { year: 'εεεε', month: 'μμ', day: 'ηη' },
43
+ en: { year: 'yyyy', month: 'mm', day: 'dd' },
44
+ eo: { year: 'jjjj', month: 'mm', day: 'tt' },
45
+ es: { year: 'aaaa', month: 'mm', day: 'dd' },
46
+ et: { year: 'aaaa', month: 'kk', day: 'pp' },
47
+ eu: { year: 'uuuu', month: 'hh', day: 'ee' },
48
+ fa: { year: 'سال', month: 'ماه', day: 'روز' },
49
+ ff: { year: 'hhhh', month: 'll', day: 'ññ' },
50
+ fi: { year: 'vvvv', month: 'kk', day: 'pp' },
51
+ fr: { year: 'aaaa', month: 'mm', day: 'jj' },
52
+ fy: { year: 'jjjj', month: 'mm', day: 'dd' },
53
+ ga: { year: 'bbbb', month: 'mm', day: 'll' },
54
+ gd: { year: 'bbbb', month: 'mm', day: 'll' },
55
+ gl: { year: 'aaaa', month: 'mm', day: 'dd' },
56
+ he: { year: 'שנה', month: 'חודש', day: 'יום' },
57
+ hr: { year: 'gggg', month: 'mm', day: 'dd' },
58
+ hsb: { year: 'llll', month: 'mm', day: 'dd' },
59
+ hu: { year: 'éééé', month: 'hh', day: 'nn' },
60
+ ia: { year: 'aaaa', month: 'mm', day: 'dd' },
61
+ id: { year: 'tttt', month: 'bb', day: 'hh' },
62
+ is: { year: 'áááá', month: 'mm', day: 'dd' },
63
+ it: { year: 'aaaa', month: 'mm', day: 'gg' },
64
+ ja: { year: '年', month: '月', day: '日' },
65
+ ka: { year: 'წწწწ', month: 'თთ', day: 'რრ' },
66
+ kk: { year: 'жжжж', month: 'аа', day: 'кк' },
67
+ kn: { year: 'ವವವವ', month: 'ಮಿಮೀ', day: 'ದಿದಿ' },
68
+ ko: { year: '연도', month: '월', day: '일' },
69
+ lb: { year: 'jjjj', month: 'mm', day: 'dd' },
70
+ lo: { year: 'ປປປປ', month: 'ດດ', day: 'ວວ' },
71
+ lt: { year: 'mmmm', month: 'mm', day: 'dd' },
72
+ lv: { year: 'gggg', month: 'mm', day: 'dd' },
73
+ meh: { year: 'aaaa', month: 'mm', day: 'dd' },
74
+ ml: { year: 'വർഷം', month: 'മാസം', day: 'തീയതി' },
75
+ ms: { year: 'tttt', month: 'mm', day: 'hh' },
76
+ nb: { year: 'åååå', month: 'mm', day: 'dd' },
77
+ nl: { year: 'jjjj', month: 'mm', day: 'dd' },
78
+ nn: { year: 'åååå', month: 'mm', day: 'dd' },
79
+ no: { year: 'åååå', month: 'mm', day: 'dd' },
80
+ oc: { year: 'aaaa', month: 'mm', day: 'jj' },
81
+ pl: { year: 'rrrr', month: 'mm', day: 'dd' },
82
+ pt: { year: 'aaaa', month: 'mm', day: 'dd' },
83
+ rm: { year: 'oooo', month: 'mm', day: 'dd' },
84
+ ro: { year: 'aaaa', month: 'll', day: 'zz' },
85
+ ru: { year: 'гггг', month: 'мм', day: 'дд' },
86
+ sc: { year: 'aaaa', month: 'mm', day: 'dd' },
87
+ scn: { year: 'aaaa', month: 'mm', day: 'jj' },
88
+ sk: { year: 'rrrr', month: 'mm', day: 'dd' },
89
+ sl: { year: 'llll', month: 'mm', day: 'dd' },
90
+ sr: { year: 'гггг', month: 'мм', day: 'дд' },
91
+ 'sr-Latn': { year: 'gggg', month: 'mm', day: 'dd' },
92
+ sv: { year: 'åååå', month: 'mm', day: 'dd' },
93
+ szl: { year: 'rrrr', month: 'mm', day: 'dd' },
94
+ tg: { year: 'сссс', month: 'мм', day: 'рр' },
95
+ th: { year: 'ปปปป', month: 'ดด', day: 'วว' },
96
+ tr: { year: 'yyyy', month: 'aa', day: 'gg' },
97
+ uk: { year: 'рррр', month: 'мм', day: 'дд' },
98
+ 'zh-CN': { year: '年', month: '月', day: '日' },
99
+ 'zh-TW': { year: '年', month: '月', day: '日' },
100
+ },
101
+ 'en',
102
+ );
103
+
104
+ export function getPlaceholder(field: string, value: string, locale: string): string {
105
+ // Use the actual placeholder value for the era and day period fields.
106
+ if (field === 'era' || field === 'dayPeriod') {
107
+ return value;
108
+ }
109
+
110
+ if (field === 'year' || field === 'month' || field === 'day') {
111
+ return placeholders.getStringForLocale(field, locale);
112
+ }
113
+
114
+ // For time fields (e.g. hour, minute, etc.), use two dashes as the placeholder.
115
+ return '––';
116
+ }