react-aria-components 1.12.2 → 1.14.0

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 (370) hide show
  1. package/dist/Autocomplete.main.js +3 -3
  2. package/dist/Autocomplete.main.js.map +1 -1
  3. package/dist/Autocomplete.mjs +3 -3
  4. package/dist/Autocomplete.module.js +3 -3
  5. package/dist/Autocomplete.module.js.map +1 -1
  6. package/dist/Breadcrumbs.main.js +5 -3
  7. package/dist/Breadcrumbs.main.js.map +1 -1
  8. package/dist/Breadcrumbs.mjs +5 -3
  9. package/dist/Breadcrumbs.module.js +5 -3
  10. package/dist/Breadcrumbs.module.js.map +1 -1
  11. package/dist/Button.main.js +5 -11
  12. package/dist/Button.main.js.map +1 -1
  13. package/dist/Button.mjs +5 -11
  14. package/dist/Button.module.js +5 -11
  15. package/dist/Button.module.js.map +1 -1
  16. package/dist/Calendar.main.js +2 -2
  17. package/dist/Calendar.main.js.map +1 -1
  18. package/dist/Calendar.mjs +2 -2
  19. package/dist/Calendar.module.js +2 -2
  20. package/dist/Calendar.module.js.map +1 -1
  21. package/dist/Checkbox.main.js.map +1 -1
  22. package/dist/Checkbox.module.js.map +1 -1
  23. package/dist/Collection.main.js +1 -1
  24. package/dist/Collection.main.js.map +1 -1
  25. package/dist/Collection.mjs +1 -1
  26. package/dist/Collection.module.js +1 -1
  27. package/dist/Collection.module.js.map +1 -1
  28. package/dist/ColorArea.main.js +1 -1
  29. package/dist/ColorArea.main.js.map +1 -1
  30. package/dist/ColorArea.mjs +1 -1
  31. package/dist/ColorArea.module.js +1 -1
  32. package/dist/ColorArea.module.js.map +1 -1
  33. package/dist/ColorField.main.js +1 -1
  34. package/dist/ColorField.main.js.map +1 -1
  35. package/dist/ColorField.mjs +1 -1
  36. package/dist/ColorField.module.js +1 -1
  37. package/dist/ColorField.module.js.map +1 -1
  38. package/dist/ColorPicker.main.js +1 -1
  39. package/dist/ColorPicker.main.js.map +1 -1
  40. package/dist/ColorPicker.mjs +1 -1
  41. package/dist/ColorPicker.module.js +1 -1
  42. package/dist/ColorPicker.module.js.map +1 -1
  43. package/dist/ColorSlider.main.js +1 -1
  44. package/dist/ColorSlider.main.js.map +1 -1
  45. package/dist/ColorSlider.mjs +1 -1
  46. package/dist/ColorSlider.module.js +1 -1
  47. package/dist/ColorSlider.module.js.map +1 -1
  48. package/dist/ColorSwatch.main.js.map +1 -1
  49. package/dist/ColorSwatch.module.js.map +1 -1
  50. package/dist/ColorSwatchPicker.main.js +1 -1
  51. package/dist/ColorSwatchPicker.main.js.map +1 -1
  52. package/dist/ColorSwatchPicker.mjs +1 -1
  53. package/dist/ColorSwatchPicker.module.js +1 -1
  54. package/dist/ColorSwatchPicker.module.js.map +1 -1
  55. package/dist/ColorThumb.main.js.map +1 -1
  56. package/dist/ColorThumb.module.js.map +1 -1
  57. package/dist/ColorWheel.main.js +1 -1
  58. package/dist/ColorWheel.main.js.map +1 -1
  59. package/dist/ColorWheel.mjs +1 -1
  60. package/dist/ColorWheel.module.js +1 -1
  61. package/dist/ColorWheel.module.js.map +1 -1
  62. package/dist/ComboBox.main.js.map +1 -1
  63. package/dist/ComboBox.module.js.map +1 -1
  64. package/dist/DateField.main.js +15 -9
  65. package/dist/DateField.main.js.map +1 -1
  66. package/dist/DateField.mjs +15 -9
  67. package/dist/DateField.module.js +15 -9
  68. package/dist/DateField.module.js.map +1 -1
  69. package/dist/DatePicker.main.js +6 -2
  70. package/dist/DatePicker.main.js.map +1 -1
  71. package/dist/DatePicker.mjs +6 -2
  72. package/dist/DatePicker.module.js +6 -2
  73. package/dist/DatePicker.module.js.map +1 -1
  74. package/dist/Dialog.main.js.map +1 -1
  75. package/dist/Dialog.module.js.map +1 -1
  76. package/dist/Disclosure.main.js +2 -1
  77. package/dist/Disclosure.main.js.map +1 -1
  78. package/dist/Disclosure.mjs +2 -1
  79. package/dist/Disclosure.module.js +2 -1
  80. package/dist/Disclosure.module.js.map +1 -1
  81. package/dist/DragAndDrop.main.js.map +1 -1
  82. package/dist/DragAndDrop.module.js.map +1 -1
  83. package/dist/DropZone.main.js.map +1 -1
  84. package/dist/DropZone.module.js.map +1 -1
  85. package/dist/FieldError.main.js.map +1 -1
  86. package/dist/FieldError.module.js.map +1 -1
  87. package/dist/FileTrigger.main.js +1 -0
  88. package/dist/FileTrigger.main.js.map +1 -1
  89. package/dist/FileTrigger.mjs +1 -0
  90. package/dist/FileTrigger.module.js +1 -0
  91. package/dist/FileTrigger.module.js.map +1 -1
  92. package/dist/Form.main.js.map +1 -1
  93. package/dist/Form.module.js.map +1 -1
  94. package/dist/GridList.main.js +25 -22
  95. package/dist/GridList.main.js.map +1 -1
  96. package/dist/GridList.mjs +26 -24
  97. package/dist/GridList.module.js +26 -24
  98. package/dist/GridList.module.js.map +1 -1
  99. package/dist/Group.main.js +5 -4
  100. package/dist/Group.main.js.map +1 -1
  101. package/dist/Group.mjs +5 -4
  102. package/dist/Group.module.js +5 -4
  103. package/dist/Group.module.js.map +1 -1
  104. package/dist/HiddenDateInput.main.js +5 -3
  105. package/dist/HiddenDateInput.main.js.map +1 -1
  106. package/dist/HiddenDateInput.mjs +5 -3
  107. package/dist/HiddenDateInput.module.js +5 -3
  108. package/dist/HiddenDateInput.module.js.map +1 -1
  109. package/dist/Input.main.js +4 -1
  110. package/dist/Input.main.js.map +1 -1
  111. package/dist/Input.mjs +4 -1
  112. package/dist/Input.module.js +4 -1
  113. package/dist/Input.module.js.map +1 -1
  114. package/dist/Link.main.js.map +1 -1
  115. package/dist/Link.module.js.map +1 -1
  116. package/dist/ListBox.main.js +20 -7
  117. package/dist/ListBox.main.js.map +1 -1
  118. package/dist/ListBox.mjs +21 -8
  119. package/dist/ListBox.module.js +21 -8
  120. package/dist/ListBox.module.js.map +1 -1
  121. package/dist/Menu.main.js +17 -7
  122. package/dist/Menu.main.js.map +1 -1
  123. package/dist/Menu.mjs +17 -7
  124. package/dist/Menu.module.js +17 -7
  125. package/dist/Menu.module.js.map +1 -1
  126. package/dist/Meter.main.js.map +1 -1
  127. package/dist/Meter.module.js.map +1 -1
  128. package/dist/Modal.main.js +9 -1
  129. package/dist/Modal.main.js.map +1 -1
  130. package/dist/Modal.mjs +10 -2
  131. package/dist/Modal.module.js +10 -2
  132. package/dist/Modal.module.js.map +1 -1
  133. package/dist/NumberField.main.js +2 -1
  134. package/dist/NumberField.main.js.map +1 -1
  135. package/dist/NumberField.mjs +2 -1
  136. package/dist/NumberField.module.js +2 -1
  137. package/dist/NumberField.module.js.map +1 -1
  138. package/dist/OverlayArrow.main.js.map +1 -1
  139. package/dist/OverlayArrow.module.js.map +1 -1
  140. package/dist/Popover.main.js.map +1 -1
  141. package/dist/Popover.module.js.map +1 -1
  142. package/dist/ProgressBar.main.js.map +1 -1
  143. package/dist/ProgressBar.module.js.map +1 -1
  144. package/dist/RSPContexts.main.js +4 -0
  145. package/dist/RSPContexts.main.js.map +1 -1
  146. package/dist/RSPContexts.mjs +3 -1
  147. package/dist/RSPContexts.module.js +3 -1
  148. package/dist/RSPContexts.module.js.map +1 -1
  149. package/dist/RadioGroup.main.js +10 -2
  150. package/dist/RadioGroup.main.js.map +1 -1
  151. package/dist/RadioGroup.mjs +10 -2
  152. package/dist/RadioGroup.module.js +10 -2
  153. package/dist/RadioGroup.module.js.map +1 -1
  154. package/dist/SearchField.main.js +7 -3
  155. package/dist/SearchField.main.js.map +1 -1
  156. package/dist/SearchField.mjs +7 -3
  157. package/dist/SearchField.module.js +7 -3
  158. package/dist/SearchField.module.js.map +1 -1
  159. package/dist/Select.main.js +62 -22
  160. package/dist/Select.main.js.map +1 -1
  161. package/dist/Select.mjs +65 -25
  162. package/dist/Select.module.js +65 -25
  163. package/dist/Select.module.js.map +1 -1
  164. package/dist/SelectionIndicator.main.js +45 -0
  165. package/dist/SelectionIndicator.main.js.map +1 -0
  166. package/dist/SelectionIndicator.mjs +35 -0
  167. package/dist/SelectionIndicator.module.js +35 -0
  168. package/dist/SelectionIndicator.module.js.map +1 -0
  169. package/dist/Separator.main.js.map +1 -1
  170. package/dist/Separator.module.js.map +1 -1
  171. package/dist/SharedElementTransition.main.js +139 -0
  172. package/dist/SharedElementTransition.main.js.map +1 -0
  173. package/dist/SharedElementTransition.mjs +129 -0
  174. package/dist/SharedElementTransition.module.js +129 -0
  175. package/dist/SharedElementTransition.module.js.map +1 -0
  176. package/dist/Slider.main.js.map +1 -1
  177. package/dist/Slider.module.js.map +1 -1
  178. package/dist/Switch.main.js.map +1 -1
  179. package/dist/Switch.module.js.map +1 -1
  180. package/dist/Table.main.js +142 -53
  181. package/dist/Table.main.js.map +1 -1
  182. package/dist/Table.mjs +143 -54
  183. package/dist/Table.module.js +143 -54
  184. package/dist/Table.module.js.map +1 -1
  185. package/dist/Tabs.main.js +86 -9
  186. package/dist/Tabs.main.js.map +1 -1
  187. package/dist/Tabs.mjs +88 -12
  188. package/dist/Tabs.module.js +88 -12
  189. package/dist/Tabs.module.js.map +1 -1
  190. package/dist/TagGroup.main.js +29 -17
  191. package/dist/TagGroup.main.js.map +1 -1
  192. package/dist/TagGroup.mjs +29 -17
  193. package/dist/TagGroup.module.js +29 -17
  194. package/dist/TagGroup.module.js.map +1 -1
  195. package/dist/TextArea.main.js.map +1 -1
  196. package/dist/TextArea.module.js.map +1 -1
  197. package/dist/TextField.main.js +2 -2
  198. package/dist/TextField.main.js.map +1 -1
  199. package/dist/TextField.mjs +2 -2
  200. package/dist/TextField.module.js +2 -2
  201. package/dist/TextField.module.js.map +1 -1
  202. package/dist/Toast.main.js.map +1 -1
  203. package/dist/Toast.module.js.map +1 -1
  204. package/dist/ToggleButton.main.js +7 -1
  205. package/dist/ToggleButton.main.js.map +1 -1
  206. package/dist/ToggleButton.mjs +7 -1
  207. package/dist/ToggleButton.module.js +7 -1
  208. package/dist/ToggleButton.module.js.map +1 -1
  209. package/dist/ToggleButtonGroup.main.js +4 -1
  210. package/dist/ToggleButtonGroup.main.js.map +1 -1
  211. package/dist/ToggleButtonGroup.mjs +4 -1
  212. package/dist/ToggleButtonGroup.module.js +4 -1
  213. package/dist/ToggleButtonGroup.module.js.map +1 -1
  214. package/dist/Toolbar.main.js.map +1 -1
  215. package/dist/Toolbar.module.js.map +1 -1
  216. package/dist/Tooltip.main.js.map +1 -1
  217. package/dist/Tooltip.module.js.map +1 -1
  218. package/dist/Tree.main.js +16 -4
  219. package/dist/Tree.main.js.map +1 -1
  220. package/dist/Tree.mjs +16 -4
  221. package/dist/Tree.module.js +16 -4
  222. package/dist/Tree.module.js.map +1 -1
  223. package/dist/import.mjs +13 -7
  224. package/dist/main.js +23 -3
  225. package/dist/main.js.map +1 -1
  226. package/dist/module.js +13 -7
  227. package/dist/module.js.map +1 -1
  228. package/dist/types.d.ts +663 -58
  229. package/dist/types.d.ts.map +1 -1
  230. package/dist/utils.main.js +0 -1
  231. package/dist/utils.main.js.map +1 -1
  232. package/dist/utils.mjs +0 -1
  233. package/dist/utils.module.js +0 -1
  234. package/dist/utils.module.js.map +1 -1
  235. package/i18n/ar-AE.js +1 -1
  236. package/i18n/ar-AE.mjs +1 -1
  237. package/i18n/bg-BG.js +1 -1
  238. package/i18n/bg-BG.mjs +1 -1
  239. package/i18n/cs-CZ.js +1 -1
  240. package/i18n/cs-CZ.mjs +1 -1
  241. package/i18n/da-DK.js +1 -1
  242. package/i18n/da-DK.mjs +1 -1
  243. package/i18n/de-DE.js +1 -1
  244. package/i18n/de-DE.mjs +1 -1
  245. package/i18n/el-GR.js +1 -1
  246. package/i18n/el-GR.mjs +1 -1
  247. package/i18n/en-US.js +1 -1
  248. package/i18n/en-US.mjs +1 -1
  249. package/i18n/es-ES.js +1 -1
  250. package/i18n/es-ES.mjs +1 -1
  251. package/i18n/et-EE.js +1 -1
  252. package/i18n/et-EE.mjs +1 -1
  253. package/i18n/fi-FI.js +1 -1
  254. package/i18n/fi-FI.mjs +1 -1
  255. package/i18n/fr-FR.js +1 -1
  256. package/i18n/fr-FR.mjs +1 -1
  257. package/i18n/he-IL.js +1 -1
  258. package/i18n/he-IL.mjs +1 -1
  259. package/i18n/hr-HR.js +1 -1
  260. package/i18n/hr-HR.mjs +1 -1
  261. package/i18n/hu-HU.js +1 -1
  262. package/i18n/hu-HU.mjs +1 -1
  263. package/i18n/index.js +67 -67
  264. package/i18n/index.mjs +67 -67
  265. package/i18n/it-IT.js +1 -1
  266. package/i18n/it-IT.mjs +1 -1
  267. package/i18n/ja-JP.js +1 -1
  268. package/i18n/ja-JP.mjs +1 -1
  269. package/i18n/ko-KR.js +1 -1
  270. package/i18n/ko-KR.mjs +1 -1
  271. package/i18n/lt-LT.js +1 -1
  272. package/i18n/lt-LT.mjs +1 -1
  273. package/i18n/lv-LV.js +1 -1
  274. package/i18n/lv-LV.mjs +1 -1
  275. package/i18n/nb-NO.js +1 -1
  276. package/i18n/nb-NO.mjs +1 -1
  277. package/i18n/nl-NL.js +1 -1
  278. package/i18n/nl-NL.mjs +1 -1
  279. package/i18n/pl-PL.js +1 -1
  280. package/i18n/pl-PL.mjs +1 -1
  281. package/i18n/pt-BR.js +1 -1
  282. package/i18n/pt-BR.mjs +1 -1
  283. package/i18n/pt-PT.js +1 -1
  284. package/i18n/pt-PT.mjs +1 -1
  285. package/i18n/ro-RO.js +1 -1
  286. package/i18n/ro-RO.mjs +1 -1
  287. package/i18n/ru-RU.js +1 -1
  288. package/i18n/ru-RU.mjs +1 -1
  289. package/i18n/sk-SK.js +1 -1
  290. package/i18n/sk-SK.mjs +1 -1
  291. package/i18n/sl-SI.js +1 -1
  292. package/i18n/sl-SI.mjs +1 -1
  293. package/i18n/sr-SP.js +1 -1
  294. package/i18n/sr-SP.mjs +1 -1
  295. package/i18n/sv-SE.js +1 -1
  296. package/i18n/sv-SE.mjs +1 -1
  297. package/i18n/tr-TR.js +1 -1
  298. package/i18n/tr-TR.mjs +1 -1
  299. package/i18n/uk-UA.js +1 -1
  300. package/i18n/uk-UA.mjs +1 -1
  301. package/i18n/zh-CN.js +1 -1
  302. package/i18n/zh-CN.mjs +1 -1
  303. package/i18n/zh-TW.js +1 -1
  304. package/i18n/zh-TW.mjs +1 -1
  305. package/package.json +25 -25
  306. package/src/Autocomplete.tsx +2 -2
  307. package/src/Breadcrumbs.tsx +25 -6
  308. package/src/Button.tsx +15 -11
  309. package/src/Calendar.tsx +51 -6
  310. package/src/Checkbox.tsx +25 -2
  311. package/src/Collection.tsx +1 -1
  312. package/src/ColorArea.tsx +15 -2
  313. package/src/ColorField.tsx +16 -1
  314. package/src/ColorPicker.tsx +5 -2
  315. package/src/ColorSlider.tsx +16 -2
  316. package/src/ColorSwatch.tsx +15 -2
  317. package/src/ColorSwatchPicker.tsx +18 -1
  318. package/src/ColorThumb.tsx +8 -2
  319. package/src/ColorWheel.tsx +24 -3
  320. package/src/ComboBox.tsx +18 -1
  321. package/src/DateField.tsx +60 -16
  322. package/src/DatePicker.tsx +38 -5
  323. package/src/Dialog.tsx +5 -0
  324. package/src/Disclosure.tsx +30 -5
  325. package/src/DragAndDrop.tsx +8 -2
  326. package/src/DropZone.tsx +16 -2
  327. package/src/FieldError.tsx +8 -2
  328. package/src/FileTrigger.tsx +1 -0
  329. package/src/Form.tsx +5 -0
  330. package/src/GridList.tsx +66 -35
  331. package/src/Group.tsx +32 -18
  332. package/src/HiddenDateInput.tsx +6 -4
  333. package/src/Input.tsx +23 -3
  334. package/src/Link.tsx +15 -2
  335. package/src/ListBox.tsx +58 -14
  336. package/src/Menu.tsx +41 -8
  337. package/src/Meter.tsx +16 -2
  338. package/src/Modal.tsx +30 -3
  339. package/src/NumberField.tsx +21 -3
  340. package/src/OverlayArrow.tsx +14 -2
  341. package/src/Popover.tsx +13 -1
  342. package/src/ProgressBar.tsx +17 -3
  343. package/src/RSPContexts.ts +19 -0
  344. package/src/RadioGroup.tsx +33 -4
  345. package/src/SearchField.tsx +36 -4
  346. package/src/Select.tsx +100 -36
  347. package/src/SelectionIndicator.tsx +46 -0
  348. package/src/Separator.tsx +10 -1
  349. package/src/SharedElementTransition.tsx +185 -0
  350. package/src/Slider.tsx +35 -3
  351. package/src/Switch.tsx +18 -5
  352. package/src/Table.tsx +204 -83
  353. package/src/Tabs.tsx +158 -15
  354. package/src/TagGroup.tsx +60 -26
  355. package/src/TextArea.tsx +14 -2
  356. package/src/TextField.tsx +20 -2
  357. package/src/Toast.tsx +22 -2
  358. package/src/ToggleButton.tsx +19 -2
  359. package/src/ToggleButtonGroup.tsx +26 -4
  360. package/src/Toolbar.tsx +13 -1
  361. package/src/Tooltip.tsx +13 -1
  362. package/src/Tree.tsx +76 -40
  363. package/src/index.ts +17 -10
  364. package/src/utils.tsx +2 -3
  365. package/dist/context.main.js +0 -25
  366. package/dist/context.main.js.map +0 -1
  367. package/dist/context.mjs +0 -19
  368. package/dist/context.module.js +0 -19
  369. package/dist/context.module.js.map +0 -1
  370. package/src/context.tsx +0 -34
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AA+EM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAAoD;AACxF,MAAM,0DAAuB,CAAA,GAAA,0BAAY,EAAyD;AAClG,MAAM,0DAAuB,CAAA,GAAA,0BAAY,EAAwB;AACjE,MAAM,0DAA4B,CAAA,GAAA,0BAAY,EAA6B;AAK3E,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,SAA8B,KAAuB,EAAE,GAAiC;IACpK,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,0BAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,oCAAe,EAAE;QAC3B,GAAG,KAAK;gBACR;QACA,gBAAgB,MAAM,cAAc,IAAI,CAAA,GAAA,2CAAa;IACvD;IAEA,IAAI,iBAAC,aAAa,mBAAE,eAAe,mBAAE,eAAe,qBAAE,iBAAiB,SAAE,KAAK,EAAC,GAAG,CAAA,GA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,GAAA,2BAAS,EAAE,UAAU,aAAa,YAAY,YAAY,WAAW,YAAY;QAAE,KAAK;;AAGvG","sources":["packages/react-aria-components/src/Calendar.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {\n AriaCalendarProps,\n AriaRangeCalendarProps,\n DateValue,\n mergeProps,\n useCalendar,\n useCalendarCell,\n useCalendarGrid,\n useFocusRing,\n useHover,\n useLocale,\n useRangeCalendar,\n VisuallyHidden\n} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {CalendarDate, CalendarIdentifier, createCalendar, DateDuration, endOfMonth, Calendar as ICalendar, isSameDay, isSameMonth, isToday} from '@internationalized/date';\nimport {CalendarState, RangeCalendarState, useCalendarState, useRangeCalendarState} from 'react-stately';\nimport {ContextValue, DOMProps, Provider, RenderProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {DOMAttributes, FocusableElement, forwardRefType, GlobalDOMAttributes, HoverEvents} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {HeadingContext} from './RSPContexts';\nimport React, {createContext, ForwardedRef, forwardRef, ReactElement, useContext, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface CalendarRenderProps {\n /**\n * Whether the calendar is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the calendar.\n */\n state: CalendarState,\n /**\n * Whether the calendar is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface RangeCalendarRenderProps extends Omit<CalendarRenderProps, 'state'> {\n /**\n * State of the range calendar.\n */\n state: RangeCalendarState\n}\n\nexport interface CalendarProps<T extends DateValue> extends Omit<AriaCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<CalendarRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The amount of days that will be displayed at once. This affects how pagination works.\n * @default {months: 1}\n */\n visibleDuration?: DateDuration,\n\n /**\n * A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html)\n * object for a given calendar identifier. If not provided, the `createCalendar` function\n * from `@internationalized/date` will be used.\n */\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar\n}\n\nexport interface RangeCalendarProps<T extends DateValue> extends Omit<AriaRangeCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<RangeCalendarRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The amount of days that will be displayed at once. This affects how pagination works.\n * @default {months: 1}\n */\n visibleDuration?: DateDuration,\n\n /**\n * A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html)\n * object for a given calendar identifier. If not provided, the `createCalendar` function\n * from `@internationalized/date` will be used.\n */\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar\n}\n\nexport const CalendarContext = createContext<ContextValue<CalendarProps<any>, HTMLDivElement>>(null);\nexport const RangeCalendarContext = createContext<ContextValue<RangeCalendarProps<any>, HTMLDivElement>>(null);\nexport const CalendarStateContext = createContext<CalendarState | null>(null);\nexport const RangeCalendarStateContext = createContext<RangeCalendarState | null>(null);\n\n/**\n * A calendar displays one or more date grids and allows users to select a single date.\n */\nexport const Calendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function Calendar<T extends DateValue>(props: CalendarProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, CalendarContext);\n let {locale} = useLocale();\n let state = useCalendarState({\n ...props,\n locale,\n createCalendar: props.createCalendar || createCalendar\n });\n\n let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title} = useCalendar(props, state);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isValueInvalid\n },\n defaultClassName: 'react-aria-Calendar'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div\n {...mergeProps(DOMProps, renderProps, calendarProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={state.isValueInvalid || undefined}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n previous: prevButtonProps,\n next: nextButtonProps\n }\n }],\n [HeadingContext, {'aria-hidden': true, level: 2, children: title}],\n [CalendarStateContext, state],\n [CalendarContext, props as CalendarProps<any>],\n [TextContext, {\n slots: {\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {/* Add a screen reader only description of the entire visible range rather than\n * a separate heading above each month grid. This is placed first in the DOM order\n * so that it is the first thing a touch screen reader user encounters.\n * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n * elements, so the aria-label of the Calendar is included here as well. */}\n <VisuallyHidden>\n <h2>{calendarProps['aria-label']}</h2>\n </VisuallyHidden>\n {renderProps.children}\n {/* For touch screen readers, add a visually hidden next button after the month grid\n * so it's easy to navigate after reaching the end without going all the way\n * back to the start of the month. */}\n <VisuallyHidden>\n <button\n aria-label={nextButtonProps['aria-label']}\n disabled={nextButtonProps.isDisabled}\n onClick={() => state.focusNextPage()}\n tabIndex={-1} />\n </VisuallyHidden>\n </Provider>\n </div>\n );\n});\n\n/**\n * A range calendar displays one or more date grids and allows users to select a contiguous range of dates.\n */\nexport const RangeCalendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function RangeCalendar<T extends DateValue>(props: RangeCalendarProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, RangeCalendarContext);\n let {locale} = useLocale();\n let state = useRangeCalendarState({\n ...props,\n locale,\n createCalendar: props.createCalendar || createCalendar\n });\n\n let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title} = useRangeCalendar(\n props,\n state,\n ref\n );\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isValueInvalid\n },\n defaultClassName: 'react-aria-RangeCalendar'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div\n {...mergeProps(renderProps, DOMProps, calendarProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={state.isValueInvalid || undefined}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n previous: prevButtonProps,\n next: nextButtonProps\n }\n }],\n [HeadingContext, {'aria-hidden': true, level: 2, children: title}],\n [RangeCalendarStateContext, state],\n [RangeCalendarContext, props as RangeCalendarProps<any>],\n [TextContext, {\n slots: {\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {/* Add a screen reader only description of the entire visible range rather than\n * a separate heading above each month grid. This is placed first in the DOM order\n * so that it is the first thing a touch screen reader user encounters.\n * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n * elements, so the aria-label of the Calendar is included here as well. */}\n <VisuallyHidden>\n <h2>{calendarProps['aria-label']}</h2>\n </VisuallyHidden>\n {renderProps.children}\n {/* For touch screen readers, add a visually hidden next button after the month grid\n * so it's easy to navigate after reaching the end without going all the way\n * back to the start of the month. */}\n <VisuallyHidden>\n <button\n aria-label={nextButtonProps['aria-label']}\n disabled={nextButtonProps.isDisabled}\n onClick={() => state.focusNextPage()}\n tabIndex={-1} />\n </VisuallyHidden>\n </Provider>\n </div>\n );\n});\n\nexport interface CalendarCellRenderProps {\n /** The date that the cell represents. */\n date: CalendarDate,\n /** The day number formatted according to the current locale. */\n formattedDate: string,\n /**\n * Whether the cell is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the cell is currently being pressed.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the cell is selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the cell is the first date in a range selection.\n * @selector [data-selection-start]\n */\n isSelectionStart: boolean,\n /**\n * Whether the cell is the last date in a range selection.\n * @selector [data-selection-end]\n */\n isSelectionEnd: boolean,\n /**\n * Whether the cell is focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the cell is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the cell is disabled, according to the calendar's `minValue`, `maxValue`, and `isDisabled` props.\n * Disabled dates are not focusable, and cannot be selected by the user. They are typically\n * displayed with a dimmed appearance.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the cell is outside the visible range of the calendar.\n * For example, dates before the first day of a month in the same week.\n * @selector [data-outside-visible-range]\n */\n isOutsideVisibleRange: boolean,\n /**\n * Whether the cell is outside the current month.\n * @selector [data-outside-month]\n */\n isOutsideMonth: boolean,\n /**\n * Whether the cell is unavailable, according to the calendar's `isDateUnavailable` prop. Unavailable dates remain\n * focusable, but cannot be selected by the user. They should be displayed with a visual affordance to indicate they\n * are unavailable, such as a different color or a strikethrough.\n *\n * Note that because they are focusable, unavailable dates must meet a 4.5:1 color contrast ratio,\n * [as defined by WCAG](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html).\n *\n * @selector [data-unavailable]\n */\n isUnavailable: boolean,\n /**\n * Whether the cell is part of an invalid selection.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the cell is today.\n * @selector [data-today]\n */\n isToday: boolean\n}\n\nexport interface CalendarGridProps extends StyleProps, GlobalDOMAttributes<HTMLTableElement> {\n /**\n * Either a function to render calendar cells for each date in the month,\n * or children containing a `<CalendarGridHeader>`` and `<CalendarGridBody>`\n * when additional customization is needed.\n */\n children?: ReactElement | ReactElement[] | ((date: CalendarDate) => ReactElement),\n /**\n * An offset from the beginning of the visible date range that this\n * CalendarGrid should display. Useful when displaying more than one\n * month at a time.\n */\n offset?: DateDuration,\n /**\n * The style of weekday names to display in the calendar grid header,\n * e.g. single letter, abbreviation, or full day name.\n * @default \"narrow\"\n */\n weekdayStyle?: 'narrow' | 'short' | 'long'\n}\n\ninterface InternalCalendarGridContextValue {\n headerProps: DOMAttributes<FocusableElement>,\n weekDays: string[],\n startDate: CalendarDate,\n weeksInMonth: number\n}\n\nconst InternalCalendarGridContext = createContext<InternalCalendarGridContextValue | null>(null);\n\n/**\n * A calendar grid displays a single grid of days within a calendar or range calendar which\n * can be keyboard navigated and selected by the user.\n */\nexport const CalendarGrid = /*#__PURE__*/ (forwardRef as forwardRefType)(function CalendarGrid(props: CalendarGridProps, ref: ForwardedRef<HTMLTableElement>) {\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let calenderProps = useSlottedContext(CalendarContext)!;\n let rangeCalenderProps = useSlottedContext(RangeCalendarContext)!;\n let state = calendarState ?? rangeCalendarState!;\n let startDate = state.visibleRange.start;\n if (props.offset) {\n startDate = startDate.add(props.offset);\n }\n\n let firstDayOfWeek = calenderProps?.firstDayOfWeek ?? rangeCalenderProps?.firstDayOfWeek;\n\n let {gridProps, headerProps, weekDays, weeksInMonth} = useCalendarGrid({\n startDate,\n endDate: endOfMonth(startDate),\n weekdayStyle: props.weekdayStyle,\n firstDayOfWeek\n }, state);\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <InternalCalendarGridContext.Provider value={{headerProps, weekDays, startDate, weeksInMonth}}>\n <table\n {...mergeProps(DOMProps, gridProps)}\n ref={ref}\n style={props.style}\n cellPadding={0}\n className={props.className ?? 'react-aria-CalendarGrid'}>\n {typeof props.children !== 'function'\n ? props.children\n : (<>\n <CalendarGridHeaderForwardRef>\n {day => <CalendarHeaderCellForwardRef>{day}</CalendarHeaderCellForwardRef>}\n </CalendarGridHeaderForwardRef>\n <CalendarGridBodyForwardRef>\n {props.children}\n </CalendarGridBodyForwardRef>\n </>)\n }\n </table>\n </InternalCalendarGridContext.Provider>\n );\n});\n\nexport interface CalendarGridHeaderProps extends StyleProps, GlobalDOMAttributes<HTMLTableSectionElement> {\n /** A function to render a `<CalendarHeaderCell>` for a weekday name. */\n children: (day: string) => ReactElement\n}\n\nfunction CalendarGridHeader(props: CalendarGridHeaderProps, ref: ForwardedRef<HTMLTableSectionElement>) {\n let {children, style, className} = props;\n let {headerProps, weekDays} = useContext(InternalCalendarGridContext)!;\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <thead\n {...mergeProps(DOMProps, headerProps)}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarGridHeader'}>\n <tr>\n {weekDays.map((day, key) => React.cloneElement(children(day), {key}))}\n </tr>\n </thead>\n );\n}\n\n/**\n * A calendar grid header displays a row of week day names at the top of a month.\n */\nconst CalendarGridHeaderForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridHeader);\nexport {CalendarGridHeaderForwardRef as CalendarGridHeader};\n\nexport interface CalendarHeaderCellProps extends DOMProps, GlobalDOMAttributes<HTMLTableHeaderCellElement> {}\n\nfunction CalendarHeaderCell(props: CalendarHeaderCellProps, ref: ForwardedRef<HTMLTableCellElement>) {\n let {children, style, className} = props;\n let DOMProps = filterDOMProps(props, {global: true});\n return (\n <th\n {...DOMProps}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarHeaderCell'}>\n {children}\n </th>\n );\n}\n\n/**\n * A calendar header cell displays a week day name at the top of a column within a calendar.\n */\nconst CalendarHeaderCellForwardRef = forwardRef(CalendarHeaderCell);\nexport {CalendarHeaderCellForwardRef as CalendarHeaderCell};\n\nexport interface CalendarGridBodyProps extends StyleProps, GlobalDOMAttributes<HTMLTableSectionElement> {\n /** A function to render a `<CalendarCell>` for a given date. */\n children: (date: CalendarDate) => ReactElement\n}\n\nfunction CalendarGridBody(props: CalendarGridBodyProps, ref: ForwardedRef<HTMLTableSectionElement>) {\n let {children, style, className} = props;\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let state = calendarState ?? rangeCalendarState!;\n let {startDate, weeksInMonth} = useContext(InternalCalendarGridContext)!;\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <tbody\n {...DOMProps}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarGridBody'}>\n {[...new Array(weeksInMonth).keys()].map((weekIndex) => (\n <tr key={weekIndex}>\n {state.getDatesInWeek(weekIndex, startDate).map((date, i) => (\n date\n ? React.cloneElement(children(date), {key: i})\n : <td key={i} />\n ))}\n </tr>\n ))}\n </tbody>\n );\n}\n\n/**\n * A calendar grid body displays a grid of calendar cells within a month.\n */\nconst CalendarGridBodyForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridBody);\nexport {CalendarGridBodyForwardRef as CalendarGridBody};\n\nexport interface CalendarCellProps extends RenderProps<CalendarCellRenderProps>, HoverEvents, GlobalDOMAttributes<HTMLTableCellElement> {\n /** The date to render in the cell. */\n date: CalendarDate\n}\n\n/**\n * A calendar cell displays a date cell within a calendar grid which can be selected by the user.\n */\nexport const CalendarCell = /*#__PURE__*/ (forwardRef as forwardRefType)(function CalendarCell({date, ...otherProps}: CalendarCellProps, ref: ForwardedRef<HTMLTableCellElement>) {\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let state = calendarState ?? rangeCalendarState!;\n let {startDate: currentMonth} = useContext(InternalCalendarGridContext) ?? {startDate: state.visibleRange.start};\n let isOutsideMonth = !isSameMonth(currentMonth, date);\n let istoday = isToday(date, state.timeZone);\n\n let buttonRef = useRef<HTMLDivElement>(null);\n let {cellProps, buttonProps, ...states} = useCalendarCell(\n {date, isOutsideMonth},\n state,\n buttonRef\n );\n\n let {hoverProps, isHovered} = useHover({...otherProps, isDisabled: states.isDisabled});\n let {focusProps, isFocusVisible} = useFocusRing();\n isFocusVisible &&= states.isFocused;\n let isSelectionStart = false;\n let isSelectionEnd = false;\n if ('highlightedRange' in state && state.highlightedRange) {\n isSelectionStart = isSameDay(date, state.highlightedRange.start);\n isSelectionEnd = isSameDay(date, state.highlightedRange.end);\n }\n\n let renderProps = useRenderProps({\n ...otherProps,\n defaultChildren: states.formattedDate,\n defaultClassName: 'react-aria-CalendarCell',\n values: {\n date,\n isHovered,\n isOutsideMonth,\n isFocusVisible,\n isSelectionStart,\n isSelectionEnd,\n isToday: istoday,\n ...states\n }\n });\n\n let dataAttrs = {\n 'data-focused': states.isFocused || undefined,\n 'data-hovered': isHovered || undefined,\n 'data-pressed': states.isPressed || undefined,\n 'data-unavailable': states.isUnavailable || undefined,\n 'data-disabled': states.isDisabled || undefined,\n 'data-focus-visible': isFocusVisible || undefined,\n 'data-outside-visible-range': states.isOutsideVisibleRange || undefined,\n 'data-outside-month': isOutsideMonth || undefined,\n 'data-selected': states.isSelected || undefined,\n 'data-selection-start': isSelectionStart || undefined,\n 'data-selection-end': isSelectionEnd || undefined,\n 'data-invalid': states.isInvalid || undefined,\n 'data-today': istoday || undefined\n };\n\n let DOMProps = filterDOMProps(otherProps, {global: true});\n\n return (\n <td {...cellProps} ref={ref}>\n <div {...mergeProps(DOMProps, buttonProps, focusProps, hoverProps, dataAttrs, renderProps)} ref={buttonRef} />\n </td>\n );\n});\n"],"names":[],"version":3,"file":"Calendar.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAkGM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAAoD;AACxF,MAAM,0DAAuB,CAAA,GAAA,0BAAY,EAAyD;AAClG,MAAM,0DAAuB,CAAA,GAAA,0BAAY,EAAwB;AACjE,MAAM,0DAA4B,CAAA,GAAA,0BAAY,EAA6B;AAK3E,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,SAA8B,KAAuB,EAAE,GAAiC;IACpK,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,UAAC,M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AkB;QACxC,iBAAiB,OAAO,UAAU,IAAI;QACtC,wBAAwB,oBAAoB;QAC5C,sBAAsB,kBAAkB;QACxC,gBAAgB,OAAO,SAAS,IAAI;QACpC,cAAc,WAAW;IAC3B;IAEA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,YAAY;QAAC,QAAQ;IAAI;IAEvD,qBACE,0DAAC;QAAI,GAAG,SAAS;QAAE,KAAK;qBACtB,0DAAC;QAAK,GAAG,CAAA,GAAA,2BAAS,EAAE,UAAU,aAAa,YAAY,YAAY,WAAW,YAAY;QAAE,KAAK;;AAGvG","sources":["packages/react-aria-components/src/Calendar.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {\n AriaCalendarProps,\n AriaRangeCalendarProps,\n DateValue,\n mergeProps,\n useCalendar,\n useCalendarCell,\n useCalendarGrid,\n useFocusRing,\n useHover,\n useLocale,\n useRangeCalendar,\n VisuallyHidden\n} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {CalendarDate, CalendarIdentifier, createCalendar, DateDuration, endOfMonth, Calendar as ICalendar, isSameDay, isSameMonth, isToday} from '@internationalized/date';\nimport {CalendarState, RangeCalendarState, useCalendarState, useRangeCalendarState} from 'react-stately';\nimport {\n ClassNameOrFunction,\n ContextValue,\n DOMProps,\n Provider,\n RenderProps,\n SlotProps,\n StyleProps,\n useContextProps,\n useRenderProps,\n useSlottedContext\n} from './utils';\nimport {DOMAttributes, FocusableElement, forwardRefType, GlobalDOMAttributes, HoverEvents} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {HeadingContext} from './RSPContexts';\nimport React, {createContext, ForwardedRef, forwardRef, ReactElement, useContext, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface CalendarRenderProps {\n /**\n * Whether the calendar is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the calendar.\n */\n state: CalendarState,\n /**\n * Whether the calendar is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface RangeCalendarRenderProps extends Omit<CalendarRenderProps, 'state'> {\n /**\n * State of the range calendar.\n */\n state: RangeCalendarState\n}\n\nexport interface CalendarProps<T extends DateValue> extends Omit<AriaCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<CalendarRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-Calendar'\n */\n className?: ClassNameOrFunction<CalendarRenderProps>,\n /**\n * The amount of days that will be displayed at once. This affects how pagination works.\n * @default {months: 1}\n */\n visibleDuration?: DateDuration,\n /**\n * A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html)\n * object for a given calendar identifier. If not provided, the `createCalendar` function\n * from `@internationalized/date` will be used.\n */\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar\n}\n\nexport interface RangeCalendarProps<T extends DateValue> extends Omit<AriaRangeCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<RangeCalendarRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-RangeCalendar'\n */\n className?: ClassNameOrFunction<RangeCalendarRenderProps>,\n /**\n * The amount of days that will be displayed at once. This affects how pagination works.\n * @default {months: 1}\n */\n visibleDuration?: DateDuration,\n /**\n * A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html)\n * object for a given calendar identifier. If not provided, the `createCalendar` function\n * from `@internationalized/date` will be used.\n */\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar\n}\n\nexport const CalendarContext = createContext<ContextValue<CalendarProps<any>, HTMLDivElement>>(null);\nexport const RangeCalendarContext = createContext<ContextValue<RangeCalendarProps<any>, HTMLDivElement>>(null);\nexport const CalendarStateContext = createContext<CalendarState | null>(null);\nexport const RangeCalendarStateContext = createContext<RangeCalendarState | null>(null);\n\n/**\n * A calendar displays one or more date grids and allows users to select a single date.\n */\nexport const Calendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function Calendar<T extends DateValue>(props: CalendarProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, CalendarContext);\n let {locale} = useLocale();\n let state = useCalendarState({\n ...props,\n locale,\n createCalendar: props.createCalendar || createCalendar\n });\n\n let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title} = useCalendar(props, state);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isValueInvalid\n },\n defaultClassName: 'react-aria-Calendar'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div\n {...mergeProps(DOMProps, renderProps, calendarProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={state.isValueInvalid || undefined}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n previous: prevButtonProps,\n next: nextButtonProps\n }\n }],\n [HeadingContext, {'aria-hidden': true, level: 2, children: title}],\n [CalendarStateContext, state],\n [CalendarContext, props as CalendarProps<any>],\n [TextContext, {\n slots: {\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {/* Add a screen reader only description of the entire visible range rather than\n * a separate heading above each month grid. This is placed first in the DOM order\n * so that it is the first thing a touch screen reader user encounters.\n * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n * elements, so the aria-label of the Calendar is included here as well. */}\n <VisuallyHidden>\n <h2>{calendarProps['aria-label']}</h2>\n </VisuallyHidden>\n {renderProps.children}\n {/* For touch screen readers, add a visually hidden next button after the month grid\n * so it's easy to navigate after reaching the end without going all the way\n * back to the start of the month. */}\n <VisuallyHidden>\n <button\n aria-label={nextButtonProps['aria-label']}\n disabled={nextButtonProps.isDisabled}\n onClick={() => state.focusNextPage()}\n tabIndex={-1} />\n </VisuallyHidden>\n </Provider>\n </div>\n );\n});\n\n/**\n * A range calendar displays one or more date grids and allows users to select a contiguous range of dates.\n */\nexport const RangeCalendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function RangeCalendar<T extends DateValue>(props: RangeCalendarProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, RangeCalendarContext);\n let {locale} = useLocale();\n let state = useRangeCalendarState({\n ...props,\n locale,\n createCalendar: props.createCalendar || createCalendar\n });\n\n let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title} = useRangeCalendar(\n props,\n state,\n ref\n );\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isValueInvalid\n },\n defaultClassName: 'react-aria-RangeCalendar'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div\n {...mergeProps(renderProps, DOMProps, calendarProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={state.isValueInvalid || undefined}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n previous: prevButtonProps,\n next: nextButtonProps\n }\n }],\n [HeadingContext, {'aria-hidden': true, level: 2, children: title}],\n [RangeCalendarStateContext, state],\n [RangeCalendarContext, props as RangeCalendarProps<any>],\n [TextContext, {\n slots: {\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {/* Add a screen reader only description of the entire visible range rather than\n * a separate heading above each month grid. This is placed first in the DOM order\n * so that it is the first thing a touch screen reader user encounters.\n * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n * elements, so the aria-label of the Calendar is included here as well. */}\n <VisuallyHidden>\n <h2>{calendarProps['aria-label']}</h2>\n </VisuallyHidden>\n {renderProps.children}\n {/* For touch screen readers, add a visually hidden next button after the month grid\n * so it's easy to navigate after reaching the end without going all the way\n * back to the start of the month. */}\n <VisuallyHidden>\n <button\n aria-label={nextButtonProps['aria-label']}\n disabled={nextButtonProps.isDisabled}\n onClick={() => state.focusNextPage()}\n tabIndex={-1} />\n </VisuallyHidden>\n </Provider>\n </div>\n );\n});\n\nexport interface CalendarCellRenderProps {\n /** The date that the cell represents. */\n date: CalendarDate,\n /** The day number formatted according to the current locale. */\n formattedDate: string,\n /**\n * Whether the cell is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the cell is currently being pressed.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the cell is selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the cell is the first date in a range selection.\n * @selector [data-selection-start]\n */\n isSelectionStart: boolean,\n /**\n * Whether the cell is the last date in a range selection.\n * @selector [data-selection-end]\n */\n isSelectionEnd: boolean,\n /**\n * Whether the cell is focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the cell is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the cell is disabled, according to the calendar's `minValue`, `maxValue`, and `isDisabled` props.\n * Disabled dates are not focusable, and cannot be selected by the user. They are typically\n * displayed with a dimmed appearance.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the cell is outside the visible range of the calendar.\n * For example, dates before the first day of a month in the same week.\n * @selector [data-outside-visible-range]\n */\n isOutsideVisibleRange: boolean,\n /**\n * Whether the cell is outside the current month.\n * @selector [data-outside-month]\n */\n isOutsideMonth: boolean,\n /**\n * Whether the cell is unavailable, according to the calendar's `isDateUnavailable` prop. Unavailable dates remain\n * focusable, but cannot be selected by the user. They should be displayed with a visual affordance to indicate they\n * are unavailable, such as a different color or a strikethrough.\n *\n * Note that because they are focusable, unavailable dates must meet a 4.5:1 color contrast ratio,\n * [as defined by WCAG](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html).\n *\n * @selector [data-unavailable]\n */\n isUnavailable: boolean,\n /**\n * Whether the cell is part of an invalid selection.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the cell is today.\n * @selector [data-today]\n */\n isToday: boolean\n}\n\nexport interface CalendarGridProps extends StyleProps, GlobalDOMAttributes<HTMLTableElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.\n * @default 'react-aria-CalendarGrid'\n */\n className?: string,\n /**\n * Either a function to render calendar cells for each date in the month,\n * or children containing a `<CalendarGridHeader>`` and `<CalendarGridBody>`\n * when additional customization is needed.\n */\n children?: ReactElement | ReactElement[] | ((date: CalendarDate) => ReactElement),\n /**\n * An offset from the beginning of the visible date range that this\n * CalendarGrid should display. Useful when displaying more than one\n * month at a time.\n */\n offset?: DateDuration,\n /**\n * The style of weekday names to display in the calendar grid header,\n * e.g. single letter, abbreviation, or full day name.\n * @default \"narrow\"\n */\n weekdayStyle?: 'narrow' | 'short' | 'long'\n}\n\ninterface InternalCalendarGridContextValue {\n headerProps: DOMAttributes<FocusableElement>,\n weekDays: string[],\n startDate: CalendarDate,\n weeksInMonth: number\n}\n\nconst InternalCalendarGridContext = createContext<InternalCalendarGridContextValue | null>(null);\n\n/**\n * A calendar grid displays a single grid of days within a calendar or range calendar which\n * can be keyboard navigated and selected by the user.\n */\nexport const CalendarGrid = /*#__PURE__*/ (forwardRef as forwardRefType)(function CalendarGrid(props: CalendarGridProps, ref: ForwardedRef<HTMLTableElement>) {\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let calenderProps = useSlottedContext(CalendarContext)!;\n let rangeCalenderProps = useSlottedContext(RangeCalendarContext)!;\n let state = calendarState ?? rangeCalendarState!;\n let startDate = state.visibleRange.start;\n if (props.offset) {\n startDate = startDate.add(props.offset);\n }\n\n let firstDayOfWeek = calenderProps?.firstDayOfWeek ?? rangeCalenderProps?.firstDayOfWeek;\n\n let {gridProps, headerProps, weekDays, weeksInMonth} = useCalendarGrid({\n startDate,\n endDate: endOfMonth(startDate),\n weekdayStyle: props.weekdayStyle,\n firstDayOfWeek\n }, state);\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <InternalCalendarGridContext.Provider value={{headerProps, weekDays, startDate, weeksInMonth}}>\n <table\n {...mergeProps(DOMProps, gridProps)}\n ref={ref}\n style={props.style}\n cellPadding={0}\n className={props.className ?? 'react-aria-CalendarGrid'}>\n {typeof props.children !== 'function'\n ? props.children\n : (<>\n <CalendarGridHeaderForwardRef>\n {day => <CalendarHeaderCellForwardRef>{day}</CalendarHeaderCellForwardRef>}\n </CalendarGridHeaderForwardRef>\n <CalendarGridBodyForwardRef>\n {props.children}\n </CalendarGridBodyForwardRef>\n </>)\n }\n </table>\n </InternalCalendarGridContext.Provider>\n );\n});\n\nexport interface CalendarGridHeaderProps extends StyleProps, GlobalDOMAttributes<HTMLTableSectionElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.\n * @default 'react-aria-CalendarGridHeader'\n */\n className?: string,\n /** A function to render a `<CalendarHeaderCell>` for a weekday name. */\n children: (day: string) => ReactElement\n}\n\nfunction CalendarGridHeader(props: CalendarGridHeaderProps, ref: ForwardedRef<HTMLTableSectionElement>) {\n let {children, style, className} = props;\n let {headerProps, weekDays} = useContext(InternalCalendarGridContext)!;\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <thead\n {...mergeProps(DOMProps, headerProps)}\n ref={ref}\n style={style}\n className={className ?? 'react-aria-CalendarGridHeader'}>\n <tr>\n {weekDays.map((day, key) => React.cloneElement(children(day), {key}))}\n </tr>\n </thead>\n );\n}\n\n/**\n * A calendar grid header displays a row of week day names at the top of a month.\n */\nconst CalendarGridHeaderForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridHeader);\nexport {CalendarGridHeaderForwardRef as CalendarGridHeader};\n\nexport interface CalendarHeaderCellProps extends DOMProps, GlobalDOMAttributes<HTMLTableHeaderCellElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.\n * @default 'react-aria-CalendarHeaderCell'\n */\n className?: string\n}\n\nfunction CalendarHeaderCell(props: CalendarHeaderCellProps, ref: ForwardedRef<HTMLTableCellElement>) {\n let {children, style, className} = props;\n let DOMProps = filterDOMProps(props, {global: true});\n return (\n <th\n {...DOMProps}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarHeaderCell'}>\n {children}\n </th>\n );\n}\n\n/**\n * A calendar header cell displays a week day name at the top of a column within a calendar.\n */\nconst CalendarHeaderCellForwardRef = forwardRef(CalendarHeaderCell);\nexport {CalendarHeaderCellForwardRef as CalendarHeaderCell};\n\nexport interface CalendarGridBodyProps extends StyleProps, GlobalDOMAttributes<HTMLTableSectionElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.\n * @default 'react-aria-CalendarGridBody'\n */\n className?: string,\n /** A function to render a `<CalendarCell>` for a given date. */\n children: (date: CalendarDate) => ReactElement\n}\n\nfunction CalendarGridBody(props: CalendarGridBodyProps, ref: ForwardedRef<HTMLTableSectionElement>) {\n let {children, style, className} = props;\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let state = calendarState ?? rangeCalendarState!;\n let {startDate, weeksInMonth} = useContext(InternalCalendarGridContext)!;\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <tbody\n {...DOMProps}\n ref={ref}\n style={style}\n className={className ?? 'react-aria-CalendarGridBody'}>\n {[...new Array(weeksInMonth).keys()].map((weekIndex) => (\n <tr key={weekIndex}>\n {state.getDatesInWeek(weekIndex, startDate).map((date, i) => (\n date\n ? React.cloneElement(children(date), {key: i})\n : <td key={i} />\n ))}\n </tr>\n ))}\n </tbody>\n );\n}\n\n/**\n * A calendar grid body displays a grid of calendar cells within a month.\n */\nconst CalendarGridBodyForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridBody);\nexport {CalendarGridBodyForwardRef as CalendarGridBody};\n\nexport interface CalendarCellProps extends RenderProps<CalendarCellRenderProps>, HoverEvents, GlobalDOMAttributes<HTMLTableCellElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-CalendarCell'\n */\n className?: ClassNameOrFunction<CalendarCellRenderProps>,\n /** The date to render in the cell. */\n date: CalendarDate\n}\n\n/**\n * A calendar cell displays a date cell within a calendar grid which can be selected by the user.\n */\nexport const CalendarCell = /*#__PURE__*/ (forwardRef as forwardRefType)(function CalendarCell({date, ...otherProps}: CalendarCellProps, ref: ForwardedRef<HTMLTableCellElement>) {\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let state = calendarState ?? rangeCalendarState!;\n let {startDate: currentMonth} = useContext(InternalCalendarGridContext) ?? {startDate: state.visibleRange.start};\n let isOutsideMonth = !isSameMonth(currentMonth, date);\n let istoday = isToday(date, state.timeZone);\n\n let buttonRef = useRef<HTMLDivElement>(null);\n let {cellProps, buttonProps, ...states} = useCalendarCell(\n {date, isOutsideMonth},\n state,\n buttonRef\n );\n\n let {hoverProps, isHovered} = useHover({...otherProps, isDisabled: states.isDisabled});\n let {focusProps, isFocusVisible} = useFocusRing();\n isFocusVisible &&= states.isFocused;\n let isSelectionStart = false;\n let isSelectionEnd = false;\n if ('highlightedRange' in state && state.highlightedRange) {\n isSelectionStart = isSameDay(date, state.highlightedRange.start);\n isSelectionEnd = isSameDay(date, state.highlightedRange.end);\n }\n\n let renderProps = useRenderProps({\n ...otherProps,\n defaultChildren: states.formattedDate,\n defaultClassName: 'react-aria-CalendarCell',\n values: {\n date,\n isHovered,\n isOutsideMonth,\n isFocusVisible,\n isSelectionStart,\n isSelectionEnd,\n isToday: istoday,\n ...states\n }\n });\n\n let dataAttrs = {\n 'data-focused': states.isFocused || undefined,\n 'data-hovered': isHovered || undefined,\n 'data-pressed': states.isPressed || undefined,\n 'data-unavailable': states.isUnavailable || undefined,\n 'data-disabled': states.isDisabled || undefined,\n 'data-focus-visible': isFocusVisible || undefined,\n 'data-outside-visible-range': states.isOutsideVisibleRange || undefined,\n 'data-outside-month': isOutsideMonth || undefined,\n 'data-selected': states.isSelected || undefined,\n 'data-selection-start': isSelectionStart || undefined,\n 'data-selection-end': isSelectionEnd || undefined,\n 'data-invalid': states.isInvalid || undefined,\n 'data-today': istoday || undefined\n };\n\n let DOMProps = filterDOMProps(otherProps, {global: true});\n\n return (\n <td {...cellProps} ref={ref}>\n <div {...mergeProps(DOMProps, buttonProps, focusProps, hoverProps, dataAttrs, renderProps)} ref={buttonRef} />\n </td>\n );\n});\n"],"names":[],"version":3,"file":"Calendar.main.js.map"}
package/dist/Calendar.mjs CHANGED
@@ -217,7 +217,7 @@ function $dfd62f934fc76fed$var$CalendarGridHeader(props, ref) {
217
217
  ...(0, $dCiKx$mergeProps)(DOMProps, headerProps),
218
218
  ref: ref,
219
219
  style: style,
220
- className: className || 'react-aria-CalendarGridHeader'
220
+ className: className !== null && className !== void 0 ? className : 'react-aria-CalendarGridHeader'
221
221
  }, /*#__PURE__*/ (0, $dCiKx$react).createElement("tr", null, weekDays.map((day, key)=>/*#__PURE__*/ (0, $dCiKx$react).cloneElement(children(day), {
222
222
  key: key
223
223
  }))));
@@ -253,7 +253,7 @@ function $dfd62f934fc76fed$var$CalendarGridBody(props, ref) {
253
253
  ...DOMProps,
254
254
  ref: ref,
255
255
  style: style,
256
- className: className || 'react-aria-CalendarGridBody'
256
+ className: className !== null && className !== void 0 ? className : 'react-aria-CalendarGridBody'
257
257
  }, [
258
258
  ...new Array(weeksInMonth).keys()
259
259
  ].map((weekIndex)=>/*#__PURE__*/ (0, $dCiKx$react).createElement("tr", {
@@ -217,7 +217,7 @@ function $dfd62f934fc76fed$var$CalendarGridHeader(props, ref) {
217
217
  ...(0, $dCiKx$mergeProps)(DOMProps, headerProps),
218
218
  ref: ref,
219
219
  style: style,
220
- className: className || 'react-aria-CalendarGridHeader'
220
+ className: className !== null && className !== void 0 ? className : 'react-aria-CalendarGridHeader'
221
221
  }, /*#__PURE__*/ (0, $dCiKx$react).createElement("tr", null, weekDays.map((day, key)=>/*#__PURE__*/ (0, $dCiKx$react).cloneElement(children(day), {
222
222
  key: key
223
223
  }))));
@@ -253,7 +253,7 @@ function $dfd62f934fc76fed$var$CalendarGridBody(props, ref) {
253
253
  ...DOMProps,
254
254
  ref: ref,
255
255
  style: style,
256
- className: className || 'react-aria-CalendarGridBody'
256
+ className: className !== null && className !== void 0 ? className : 'react-aria-CalendarGridBody'
257
257
  }, [
258
258
  ...new Array(weeksInMonth).keys()
259
259
  ].map((weekIndex)=>/*#__PURE__*/ (0, $dCiKx$react).createElement("tr", {
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AA+EM,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAAoD;AACxF,MAAM,0DAAuB,CAAA,GAAA,oBAAY,EAAyD;AAClG,MAAM,0DAAuB,CAAA,GAAA,oBAAY,EAAwB;AACjE,MAAM,0DAA4B,CAAA,GAAA,oBAAY,EAA6B;AAK3E,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,SAA8B,KAAuB,EAAE,GAAiC;IACpK,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,gBAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,uBAAe,EAAE;QAC3B,GAAG,KAAK;gBACR;QACA,gBAA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I,WAAW,CAAA,GAAA,qBAAa,EAAE,YAAY;QAAC,QAAQ;IAAI;IAEvD,qBACE,gCAAC;QAAI,GAAG,SAAS;QAAE,KAAK;qBACtB,gCAAC;QAAK,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,aAAa,YAAY,YAAY,WAAW,YAAY;QAAE,KAAK;;AAGvG","sources":["packages/react-aria-components/src/Calendar.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {\n AriaCalendarProps,\n AriaRangeCalendarProps,\n DateValue,\n mergeProps,\n useCalendar,\n useCalendarCell,\n useCalendarGrid,\n useFocusRing,\n useHover,\n useLocale,\n useRangeCalendar,\n VisuallyHidden\n} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {CalendarDate, CalendarIdentifier, createCalendar, DateDuration, endOfMonth, Calendar as ICalendar, isSameDay, isSameMonth, isToday} from '@internationalized/date';\nimport {CalendarState, RangeCalendarState, useCalendarState, useRangeCalendarState} from 'react-stately';\nimport {ContextValue, DOMProps, Provider, RenderProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {DOMAttributes, FocusableElement, forwardRefType, GlobalDOMAttributes, HoverEvents} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {HeadingContext} from './RSPContexts';\nimport React, {createContext, ForwardedRef, forwardRef, ReactElement, useContext, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface CalendarRenderProps {\n /**\n * Whether the calendar is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the calendar.\n */\n state: CalendarState,\n /**\n * Whether the calendar is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface RangeCalendarRenderProps extends Omit<CalendarRenderProps, 'state'> {\n /**\n * State of the range calendar.\n */\n state: RangeCalendarState\n}\n\nexport interface CalendarProps<T extends DateValue> extends Omit<AriaCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<CalendarRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The amount of days that will be displayed at once. This affects how pagination works.\n * @default {months: 1}\n */\n visibleDuration?: DateDuration,\n\n /**\n * A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html)\n * object for a given calendar identifier. If not provided, the `createCalendar` function\n * from `@internationalized/date` will be used.\n */\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar\n}\n\nexport interface RangeCalendarProps<T extends DateValue> extends Omit<AriaRangeCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<RangeCalendarRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The amount of days that will be displayed at once. This affects how pagination works.\n * @default {months: 1}\n */\n visibleDuration?: DateDuration,\n\n /**\n * A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html)\n * object for a given calendar identifier. If not provided, the `createCalendar` function\n * from `@internationalized/date` will be used.\n */\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar\n}\n\nexport const CalendarContext = createContext<ContextValue<CalendarProps<any>, HTMLDivElement>>(null);\nexport const RangeCalendarContext = createContext<ContextValue<RangeCalendarProps<any>, HTMLDivElement>>(null);\nexport const CalendarStateContext = createContext<CalendarState | null>(null);\nexport const RangeCalendarStateContext = createContext<RangeCalendarState | null>(null);\n\n/**\n * A calendar displays one or more date grids and allows users to select a single date.\n */\nexport const Calendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function Calendar<T extends DateValue>(props: CalendarProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, CalendarContext);\n let {locale} = useLocale();\n let state = useCalendarState({\n ...props,\n locale,\n createCalendar: props.createCalendar || createCalendar\n });\n\n let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title} = useCalendar(props, state);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isValueInvalid\n },\n defaultClassName: 'react-aria-Calendar'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div\n {...mergeProps(DOMProps, renderProps, calendarProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={state.isValueInvalid || undefined}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n previous: prevButtonProps,\n next: nextButtonProps\n }\n }],\n [HeadingContext, {'aria-hidden': true, level: 2, children: title}],\n [CalendarStateContext, state],\n [CalendarContext, props as CalendarProps<any>],\n [TextContext, {\n slots: {\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {/* Add a screen reader only description of the entire visible range rather than\n * a separate heading above each month grid. This is placed first in the DOM order\n * so that it is the first thing a touch screen reader user encounters.\n * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n * elements, so the aria-label of the Calendar is included here as well. */}\n <VisuallyHidden>\n <h2>{calendarProps['aria-label']}</h2>\n </VisuallyHidden>\n {renderProps.children}\n {/* For touch screen readers, add a visually hidden next button after the month grid\n * so it's easy to navigate after reaching the end without going all the way\n * back to the start of the month. */}\n <VisuallyHidden>\n <button\n aria-label={nextButtonProps['aria-label']}\n disabled={nextButtonProps.isDisabled}\n onClick={() => state.focusNextPage()}\n tabIndex={-1} />\n </VisuallyHidden>\n </Provider>\n </div>\n );\n});\n\n/**\n * A range calendar displays one or more date grids and allows users to select a contiguous range of dates.\n */\nexport const RangeCalendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function RangeCalendar<T extends DateValue>(props: RangeCalendarProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, RangeCalendarContext);\n let {locale} = useLocale();\n let state = useRangeCalendarState({\n ...props,\n locale,\n createCalendar: props.createCalendar || createCalendar\n });\n\n let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title} = useRangeCalendar(\n props,\n state,\n ref\n );\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isValueInvalid\n },\n defaultClassName: 'react-aria-RangeCalendar'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div\n {...mergeProps(renderProps, DOMProps, calendarProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={state.isValueInvalid || undefined}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n previous: prevButtonProps,\n next: nextButtonProps\n }\n }],\n [HeadingContext, {'aria-hidden': true, level: 2, children: title}],\n [RangeCalendarStateContext, state],\n [RangeCalendarContext, props as RangeCalendarProps<any>],\n [TextContext, {\n slots: {\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {/* Add a screen reader only description of the entire visible range rather than\n * a separate heading above each month grid. This is placed first in the DOM order\n * so that it is the first thing a touch screen reader user encounters.\n * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n * elements, so the aria-label of the Calendar is included here as well. */}\n <VisuallyHidden>\n <h2>{calendarProps['aria-label']}</h2>\n </VisuallyHidden>\n {renderProps.children}\n {/* For touch screen readers, add a visually hidden next button after the month grid\n * so it's easy to navigate after reaching the end without going all the way\n * back to the start of the month. */}\n <VisuallyHidden>\n <button\n aria-label={nextButtonProps['aria-label']}\n disabled={nextButtonProps.isDisabled}\n onClick={() => state.focusNextPage()}\n tabIndex={-1} />\n </VisuallyHidden>\n </Provider>\n </div>\n );\n});\n\nexport interface CalendarCellRenderProps {\n /** The date that the cell represents. */\n date: CalendarDate,\n /** The day number formatted according to the current locale. */\n formattedDate: string,\n /**\n * Whether the cell is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the cell is currently being pressed.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the cell is selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the cell is the first date in a range selection.\n * @selector [data-selection-start]\n */\n isSelectionStart: boolean,\n /**\n * Whether the cell is the last date in a range selection.\n * @selector [data-selection-end]\n */\n isSelectionEnd: boolean,\n /**\n * Whether the cell is focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the cell is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the cell is disabled, according to the calendar's `minValue`, `maxValue`, and `isDisabled` props.\n * Disabled dates are not focusable, and cannot be selected by the user. They are typically\n * displayed with a dimmed appearance.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the cell is outside the visible range of the calendar.\n * For example, dates before the first day of a month in the same week.\n * @selector [data-outside-visible-range]\n */\n isOutsideVisibleRange: boolean,\n /**\n * Whether the cell is outside the current month.\n * @selector [data-outside-month]\n */\n isOutsideMonth: boolean,\n /**\n * Whether the cell is unavailable, according to the calendar's `isDateUnavailable` prop. Unavailable dates remain\n * focusable, but cannot be selected by the user. They should be displayed with a visual affordance to indicate they\n * are unavailable, such as a different color or a strikethrough.\n *\n * Note that because they are focusable, unavailable dates must meet a 4.5:1 color contrast ratio,\n * [as defined by WCAG](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html).\n *\n * @selector [data-unavailable]\n */\n isUnavailable: boolean,\n /**\n * Whether the cell is part of an invalid selection.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the cell is today.\n * @selector [data-today]\n */\n isToday: boolean\n}\n\nexport interface CalendarGridProps extends StyleProps, GlobalDOMAttributes<HTMLTableElement> {\n /**\n * Either a function to render calendar cells for each date in the month,\n * or children containing a `<CalendarGridHeader>`` and `<CalendarGridBody>`\n * when additional customization is needed.\n */\n children?: ReactElement | ReactElement[] | ((date: CalendarDate) => ReactElement),\n /**\n * An offset from the beginning of the visible date range that this\n * CalendarGrid should display. Useful when displaying more than one\n * month at a time.\n */\n offset?: DateDuration,\n /**\n * The style of weekday names to display in the calendar grid header,\n * e.g. single letter, abbreviation, or full day name.\n * @default \"narrow\"\n */\n weekdayStyle?: 'narrow' | 'short' | 'long'\n}\n\ninterface InternalCalendarGridContextValue {\n headerProps: DOMAttributes<FocusableElement>,\n weekDays: string[],\n startDate: CalendarDate,\n weeksInMonth: number\n}\n\nconst InternalCalendarGridContext = createContext<InternalCalendarGridContextValue | null>(null);\n\n/**\n * A calendar grid displays a single grid of days within a calendar or range calendar which\n * can be keyboard navigated and selected by the user.\n */\nexport const CalendarGrid = /*#__PURE__*/ (forwardRef as forwardRefType)(function CalendarGrid(props: CalendarGridProps, ref: ForwardedRef<HTMLTableElement>) {\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let calenderProps = useSlottedContext(CalendarContext)!;\n let rangeCalenderProps = useSlottedContext(RangeCalendarContext)!;\n let state = calendarState ?? rangeCalendarState!;\n let startDate = state.visibleRange.start;\n if (props.offset) {\n startDate = startDate.add(props.offset);\n }\n\n let firstDayOfWeek = calenderProps?.firstDayOfWeek ?? rangeCalenderProps?.firstDayOfWeek;\n\n let {gridProps, headerProps, weekDays, weeksInMonth} = useCalendarGrid({\n startDate,\n endDate: endOfMonth(startDate),\n weekdayStyle: props.weekdayStyle,\n firstDayOfWeek\n }, state);\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <InternalCalendarGridContext.Provider value={{headerProps, weekDays, startDate, weeksInMonth}}>\n <table\n {...mergeProps(DOMProps, gridProps)}\n ref={ref}\n style={props.style}\n cellPadding={0}\n className={props.className ?? 'react-aria-CalendarGrid'}>\n {typeof props.children !== 'function'\n ? props.children\n : (<>\n <CalendarGridHeaderForwardRef>\n {day => <CalendarHeaderCellForwardRef>{day}</CalendarHeaderCellForwardRef>}\n </CalendarGridHeaderForwardRef>\n <CalendarGridBodyForwardRef>\n {props.children}\n </CalendarGridBodyForwardRef>\n </>)\n }\n </table>\n </InternalCalendarGridContext.Provider>\n );\n});\n\nexport interface CalendarGridHeaderProps extends StyleProps, GlobalDOMAttributes<HTMLTableSectionElement> {\n /** A function to render a `<CalendarHeaderCell>` for a weekday name. */\n children: (day: string) => ReactElement\n}\n\nfunction CalendarGridHeader(props: CalendarGridHeaderProps, ref: ForwardedRef<HTMLTableSectionElement>) {\n let {children, style, className} = props;\n let {headerProps, weekDays} = useContext(InternalCalendarGridContext)!;\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <thead\n {...mergeProps(DOMProps, headerProps)}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarGridHeader'}>\n <tr>\n {weekDays.map((day, key) => React.cloneElement(children(day), {key}))}\n </tr>\n </thead>\n );\n}\n\n/**\n * A calendar grid header displays a row of week day names at the top of a month.\n */\nconst CalendarGridHeaderForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridHeader);\nexport {CalendarGridHeaderForwardRef as CalendarGridHeader};\n\nexport interface CalendarHeaderCellProps extends DOMProps, GlobalDOMAttributes<HTMLTableHeaderCellElement> {}\n\nfunction CalendarHeaderCell(props: CalendarHeaderCellProps, ref: ForwardedRef<HTMLTableCellElement>) {\n let {children, style, className} = props;\n let DOMProps = filterDOMProps(props, {global: true});\n return (\n <th\n {...DOMProps}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarHeaderCell'}>\n {children}\n </th>\n );\n}\n\n/**\n * A calendar header cell displays a week day name at the top of a column within a calendar.\n */\nconst CalendarHeaderCellForwardRef = forwardRef(CalendarHeaderCell);\nexport {CalendarHeaderCellForwardRef as CalendarHeaderCell};\n\nexport interface CalendarGridBodyProps extends StyleProps, GlobalDOMAttributes<HTMLTableSectionElement> {\n /** A function to render a `<CalendarCell>` for a given date. */\n children: (date: CalendarDate) => ReactElement\n}\n\nfunction CalendarGridBody(props: CalendarGridBodyProps, ref: ForwardedRef<HTMLTableSectionElement>) {\n let {children, style, className} = props;\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let state = calendarState ?? rangeCalendarState!;\n let {startDate, weeksInMonth} = useContext(InternalCalendarGridContext)!;\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <tbody\n {...DOMProps}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarGridBody'}>\n {[...new Array(weeksInMonth).keys()].map((weekIndex) => (\n <tr key={weekIndex}>\n {state.getDatesInWeek(weekIndex, startDate).map((date, i) => (\n date\n ? React.cloneElement(children(date), {key: i})\n : <td key={i} />\n ))}\n </tr>\n ))}\n </tbody>\n );\n}\n\n/**\n * A calendar grid body displays a grid of calendar cells within a month.\n */\nconst CalendarGridBodyForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridBody);\nexport {CalendarGridBodyForwardRef as CalendarGridBody};\n\nexport interface CalendarCellProps extends RenderProps<CalendarCellRenderProps>, HoverEvents, GlobalDOMAttributes<HTMLTableCellElement> {\n /** The date to render in the cell. */\n date: CalendarDate\n}\n\n/**\n * A calendar cell displays a date cell within a calendar grid which can be selected by the user.\n */\nexport const CalendarCell = /*#__PURE__*/ (forwardRef as forwardRefType)(function CalendarCell({date, ...otherProps}: CalendarCellProps, ref: ForwardedRef<HTMLTableCellElement>) {\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let state = calendarState ?? rangeCalendarState!;\n let {startDate: currentMonth} = useContext(InternalCalendarGridContext) ?? {startDate: state.visibleRange.start};\n let isOutsideMonth = !isSameMonth(currentMonth, date);\n let istoday = isToday(date, state.timeZone);\n\n let buttonRef = useRef<HTMLDivElement>(null);\n let {cellProps, buttonProps, ...states} = useCalendarCell(\n {date, isOutsideMonth},\n state,\n buttonRef\n );\n\n let {hoverProps, isHovered} = useHover({...otherProps, isDisabled: states.isDisabled});\n let {focusProps, isFocusVisible} = useFocusRing();\n isFocusVisible &&= states.isFocused;\n let isSelectionStart = false;\n let isSelectionEnd = false;\n if ('highlightedRange' in state && state.highlightedRange) {\n isSelectionStart = isSameDay(date, state.highlightedRange.start);\n isSelectionEnd = isSameDay(date, state.highlightedRange.end);\n }\n\n let renderProps = useRenderProps({\n ...otherProps,\n defaultChildren: states.formattedDate,\n defaultClassName: 'react-aria-CalendarCell',\n values: {\n date,\n isHovered,\n isOutsideMonth,\n isFocusVisible,\n isSelectionStart,\n isSelectionEnd,\n isToday: istoday,\n ...states\n }\n });\n\n let dataAttrs = {\n 'data-focused': states.isFocused || undefined,\n 'data-hovered': isHovered || undefined,\n 'data-pressed': states.isPressed || undefined,\n 'data-unavailable': states.isUnavailable || undefined,\n 'data-disabled': states.isDisabled || undefined,\n 'data-focus-visible': isFocusVisible || undefined,\n 'data-outside-visible-range': states.isOutsideVisibleRange || undefined,\n 'data-outside-month': isOutsideMonth || undefined,\n 'data-selected': states.isSelected || undefined,\n 'data-selection-start': isSelectionStart || undefined,\n 'data-selection-end': isSelectionEnd || undefined,\n 'data-invalid': states.isInvalid || undefined,\n 'data-today': istoday || undefined\n };\n\n let DOMProps = filterDOMProps(otherProps, {global: true});\n\n return (\n <td {...cellProps} ref={ref}>\n <div {...mergeProps(DOMProps, buttonProps, focusProps, hoverProps, dataAttrs, renderProps)} ref={buttonRef} />\n </td>\n );\n});\n"],"names":[],"version":3,"file":"Calendar.module.js.map"}
1
+ {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAkGM,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAAoD;AACxF,MAAM,0DAAuB,CAAA,GAAA,oBAAY,EAAyD;AAClG,MAAM,0DAAuB,CAAA,GAAA,oBAAY,EAAwB;AACjE,MAAM,0DAA4B,CAAA,GAAA,oBAAY,EAA6B;AAK3E,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS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QAC5C,iBAAiB,OAAO,UAAU,IAAI;QACtC,sBAAsB,kBAAkB;QACxC,8BAA8B,OAAO,qBAAqB,IAAI;QAC9D,sBAAsB,kBAAkB;QACxC,iBAAiB,OAAO,UAAU,IAAI;QACtC,wBAAwB,oBAAoB;QAC5C,sBAAsB,kBAAkB;QACxC,gBAAgB,OAAO,SAAS,IAAI;QACpC,cAAc,WAAW;IAC3B;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,YAAY;QAAC,QAAQ;IAAI;IAEvD,qBACE,gCAAC;QAAI,GAAG,SAAS;QAAE,KAAK;qBACtB,gCAAC;QAAK,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,aAAa,YAAY,YAAY,WAAW,YAAY;QAAE,KAAK;;AAGvG","sources":["packages/react-aria-components/src/Calendar.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {\n AriaCalendarProps,\n AriaRangeCalendarProps,\n DateValue,\n mergeProps,\n useCalendar,\n useCalendarCell,\n useCalendarGrid,\n useFocusRing,\n useHover,\n useLocale,\n useRangeCalendar,\n VisuallyHidden\n} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {CalendarDate, CalendarIdentifier, createCalendar, DateDuration, endOfMonth, Calendar as ICalendar, isSameDay, isSameMonth, isToday} from '@internationalized/date';\nimport {CalendarState, RangeCalendarState, useCalendarState, useRangeCalendarState} from 'react-stately';\nimport {\n ClassNameOrFunction,\n ContextValue,\n DOMProps,\n Provider,\n RenderProps,\n SlotProps,\n StyleProps,\n useContextProps,\n useRenderProps,\n useSlottedContext\n} from './utils';\nimport {DOMAttributes, FocusableElement, forwardRefType, GlobalDOMAttributes, HoverEvents} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {HeadingContext} from './RSPContexts';\nimport React, {createContext, ForwardedRef, forwardRef, ReactElement, useContext, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface CalendarRenderProps {\n /**\n * Whether the calendar is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the calendar.\n */\n state: CalendarState,\n /**\n * Whether the calendar is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface RangeCalendarRenderProps extends Omit<CalendarRenderProps, 'state'> {\n /**\n * State of the range calendar.\n */\n state: RangeCalendarState\n}\n\nexport interface CalendarProps<T extends DateValue> extends Omit<AriaCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<CalendarRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-Calendar'\n */\n className?: ClassNameOrFunction<CalendarRenderProps>,\n /**\n * The amount of days that will be displayed at once. This affects how pagination works.\n * @default {months: 1}\n */\n visibleDuration?: DateDuration,\n /**\n * A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html)\n * object for a given calendar identifier. If not provided, the `createCalendar` function\n * from `@internationalized/date` will be used.\n */\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar\n}\n\nexport interface RangeCalendarProps<T extends DateValue> extends Omit<AriaRangeCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<RangeCalendarRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-RangeCalendar'\n */\n className?: ClassNameOrFunction<RangeCalendarRenderProps>,\n /**\n * The amount of days that will be displayed at once. This affects how pagination works.\n * @default {months: 1}\n */\n visibleDuration?: DateDuration,\n /**\n * A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html)\n * object for a given calendar identifier. If not provided, the `createCalendar` function\n * from `@internationalized/date` will be used.\n */\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar\n}\n\nexport const CalendarContext = createContext<ContextValue<CalendarProps<any>, HTMLDivElement>>(null);\nexport const RangeCalendarContext = createContext<ContextValue<RangeCalendarProps<any>, HTMLDivElement>>(null);\nexport const CalendarStateContext = createContext<CalendarState | null>(null);\nexport const RangeCalendarStateContext = createContext<RangeCalendarState | null>(null);\n\n/**\n * A calendar displays one or more date grids and allows users to select a single date.\n */\nexport const Calendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function Calendar<T extends DateValue>(props: CalendarProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, CalendarContext);\n let {locale} = useLocale();\n let state = useCalendarState({\n ...props,\n locale,\n createCalendar: props.createCalendar || createCalendar\n });\n\n let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title} = useCalendar(props, state);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isValueInvalid\n },\n defaultClassName: 'react-aria-Calendar'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div\n {...mergeProps(DOMProps, renderProps, calendarProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={state.isValueInvalid || undefined}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n previous: prevButtonProps,\n next: nextButtonProps\n }\n }],\n [HeadingContext, {'aria-hidden': true, level: 2, children: title}],\n [CalendarStateContext, state],\n [CalendarContext, props as CalendarProps<any>],\n [TextContext, {\n slots: {\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {/* Add a screen reader only description of the entire visible range rather than\n * a separate heading above each month grid. This is placed first in the DOM order\n * so that it is the first thing a touch screen reader user encounters.\n * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n * elements, so the aria-label of the Calendar is included here as well. */}\n <VisuallyHidden>\n <h2>{calendarProps['aria-label']}</h2>\n </VisuallyHidden>\n {renderProps.children}\n {/* For touch screen readers, add a visually hidden next button after the month grid\n * so it's easy to navigate after reaching the end without going all the way\n * back to the start of the month. */}\n <VisuallyHidden>\n <button\n aria-label={nextButtonProps['aria-label']}\n disabled={nextButtonProps.isDisabled}\n onClick={() => state.focusNextPage()}\n tabIndex={-1} />\n </VisuallyHidden>\n </Provider>\n </div>\n );\n});\n\n/**\n * A range calendar displays one or more date grids and allows users to select a contiguous range of dates.\n */\nexport const RangeCalendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function RangeCalendar<T extends DateValue>(props: RangeCalendarProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, RangeCalendarContext);\n let {locale} = useLocale();\n let state = useRangeCalendarState({\n ...props,\n locale,\n createCalendar: props.createCalendar || createCalendar\n });\n\n let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title} = useRangeCalendar(\n props,\n state,\n ref\n );\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isValueInvalid\n },\n defaultClassName: 'react-aria-RangeCalendar'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div\n {...mergeProps(renderProps, DOMProps, calendarProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={state.isValueInvalid || undefined}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n previous: prevButtonProps,\n next: nextButtonProps\n }\n }],\n [HeadingContext, {'aria-hidden': true, level: 2, children: title}],\n [RangeCalendarStateContext, state],\n [RangeCalendarContext, props as RangeCalendarProps<any>],\n [TextContext, {\n slots: {\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {/* Add a screen reader only description of the entire visible range rather than\n * a separate heading above each month grid. This is placed first in the DOM order\n * so that it is the first thing a touch screen reader user encounters.\n * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n * elements, so the aria-label of the Calendar is included here as well. */}\n <VisuallyHidden>\n <h2>{calendarProps['aria-label']}</h2>\n </VisuallyHidden>\n {renderProps.children}\n {/* For touch screen readers, add a visually hidden next button after the month grid\n * so it's easy to navigate after reaching the end without going all the way\n * back to the start of the month. */}\n <VisuallyHidden>\n <button\n aria-label={nextButtonProps['aria-label']}\n disabled={nextButtonProps.isDisabled}\n onClick={() => state.focusNextPage()}\n tabIndex={-1} />\n </VisuallyHidden>\n </Provider>\n </div>\n );\n});\n\nexport interface CalendarCellRenderProps {\n /** The date that the cell represents. */\n date: CalendarDate,\n /** The day number formatted according to the current locale. */\n formattedDate: string,\n /**\n * Whether the cell is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the cell is currently being pressed.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the cell is selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the cell is the first date in a range selection.\n * @selector [data-selection-start]\n */\n isSelectionStart: boolean,\n /**\n * Whether the cell is the last date in a range selection.\n * @selector [data-selection-end]\n */\n isSelectionEnd: boolean,\n /**\n * Whether the cell is focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the cell is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the cell is disabled, according to the calendar's `minValue`, `maxValue`, and `isDisabled` props.\n * Disabled dates are not focusable, and cannot be selected by the user. They are typically\n * displayed with a dimmed appearance.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the cell is outside the visible range of the calendar.\n * For example, dates before the first day of a month in the same week.\n * @selector [data-outside-visible-range]\n */\n isOutsideVisibleRange: boolean,\n /**\n * Whether the cell is outside the current month.\n * @selector [data-outside-month]\n */\n isOutsideMonth: boolean,\n /**\n * Whether the cell is unavailable, according to the calendar's `isDateUnavailable` prop. Unavailable dates remain\n * focusable, but cannot be selected by the user. They should be displayed with a visual affordance to indicate they\n * are unavailable, such as a different color or a strikethrough.\n *\n * Note that because they are focusable, unavailable dates must meet a 4.5:1 color contrast ratio,\n * [as defined by WCAG](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html).\n *\n * @selector [data-unavailable]\n */\n isUnavailable: boolean,\n /**\n * Whether the cell is part of an invalid selection.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the cell is today.\n * @selector [data-today]\n */\n isToday: boolean\n}\n\nexport interface CalendarGridProps extends StyleProps, GlobalDOMAttributes<HTMLTableElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.\n * @default 'react-aria-CalendarGrid'\n */\n className?: string,\n /**\n * Either a function to render calendar cells for each date in the month,\n * or children containing a `<CalendarGridHeader>`` and `<CalendarGridBody>`\n * when additional customization is needed.\n */\n children?: ReactElement | ReactElement[] | ((date: CalendarDate) => ReactElement),\n /**\n * An offset from the beginning of the visible date range that this\n * CalendarGrid should display. Useful when displaying more than one\n * month at a time.\n */\n offset?: DateDuration,\n /**\n * The style of weekday names to display in the calendar grid header,\n * e.g. single letter, abbreviation, or full day name.\n * @default \"narrow\"\n */\n weekdayStyle?: 'narrow' | 'short' | 'long'\n}\n\ninterface InternalCalendarGridContextValue {\n headerProps: DOMAttributes<FocusableElement>,\n weekDays: string[],\n startDate: CalendarDate,\n weeksInMonth: number\n}\n\nconst InternalCalendarGridContext = createContext<InternalCalendarGridContextValue | null>(null);\n\n/**\n * A calendar grid displays a single grid of days within a calendar or range calendar which\n * can be keyboard navigated and selected by the user.\n */\nexport const CalendarGrid = /*#__PURE__*/ (forwardRef as forwardRefType)(function CalendarGrid(props: CalendarGridProps, ref: ForwardedRef<HTMLTableElement>) {\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let calenderProps = useSlottedContext(CalendarContext)!;\n let rangeCalenderProps = useSlottedContext(RangeCalendarContext)!;\n let state = calendarState ?? rangeCalendarState!;\n let startDate = state.visibleRange.start;\n if (props.offset) {\n startDate = startDate.add(props.offset);\n }\n\n let firstDayOfWeek = calenderProps?.firstDayOfWeek ?? rangeCalenderProps?.firstDayOfWeek;\n\n let {gridProps, headerProps, weekDays, weeksInMonth} = useCalendarGrid({\n startDate,\n endDate: endOfMonth(startDate),\n weekdayStyle: props.weekdayStyle,\n firstDayOfWeek\n }, state);\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <InternalCalendarGridContext.Provider value={{headerProps, weekDays, startDate, weeksInMonth}}>\n <table\n {...mergeProps(DOMProps, gridProps)}\n ref={ref}\n style={props.style}\n cellPadding={0}\n className={props.className ?? 'react-aria-CalendarGrid'}>\n {typeof props.children !== 'function'\n ? props.children\n : (<>\n <CalendarGridHeaderForwardRef>\n {day => <CalendarHeaderCellForwardRef>{day}</CalendarHeaderCellForwardRef>}\n </CalendarGridHeaderForwardRef>\n <CalendarGridBodyForwardRef>\n {props.children}\n </CalendarGridBodyForwardRef>\n </>)\n }\n </table>\n </InternalCalendarGridContext.Provider>\n );\n});\n\nexport interface CalendarGridHeaderProps extends StyleProps, GlobalDOMAttributes<HTMLTableSectionElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.\n * @default 'react-aria-CalendarGridHeader'\n */\n className?: string,\n /** A function to render a `<CalendarHeaderCell>` for a weekday name. */\n children: (day: string) => ReactElement\n}\n\nfunction CalendarGridHeader(props: CalendarGridHeaderProps, ref: ForwardedRef<HTMLTableSectionElement>) {\n let {children, style, className} = props;\n let {headerProps, weekDays} = useContext(InternalCalendarGridContext)!;\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <thead\n {...mergeProps(DOMProps, headerProps)}\n ref={ref}\n style={style}\n className={className ?? 'react-aria-CalendarGridHeader'}>\n <tr>\n {weekDays.map((day, key) => React.cloneElement(children(day), {key}))}\n </tr>\n </thead>\n );\n}\n\n/**\n * A calendar grid header displays a row of week day names at the top of a month.\n */\nconst CalendarGridHeaderForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridHeader);\nexport {CalendarGridHeaderForwardRef as CalendarGridHeader};\n\nexport interface CalendarHeaderCellProps extends DOMProps, GlobalDOMAttributes<HTMLTableHeaderCellElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.\n * @default 'react-aria-CalendarHeaderCell'\n */\n className?: string\n}\n\nfunction CalendarHeaderCell(props: CalendarHeaderCellProps, ref: ForwardedRef<HTMLTableCellElement>) {\n let {children, style, className} = props;\n let DOMProps = filterDOMProps(props, {global: true});\n return (\n <th\n {...DOMProps}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarHeaderCell'}>\n {children}\n </th>\n );\n}\n\n/**\n * A calendar header cell displays a week day name at the top of a column within a calendar.\n */\nconst CalendarHeaderCellForwardRef = forwardRef(CalendarHeaderCell);\nexport {CalendarHeaderCellForwardRef as CalendarHeaderCell};\n\nexport interface CalendarGridBodyProps extends StyleProps, GlobalDOMAttributes<HTMLTableSectionElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.\n * @default 'react-aria-CalendarGridBody'\n */\n className?: string,\n /** A function to render a `<CalendarCell>` for a given date. */\n children: (date: CalendarDate) => ReactElement\n}\n\nfunction CalendarGridBody(props: CalendarGridBodyProps, ref: ForwardedRef<HTMLTableSectionElement>) {\n let {children, style, className} = props;\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let state = calendarState ?? rangeCalendarState!;\n let {startDate, weeksInMonth} = useContext(InternalCalendarGridContext)!;\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <tbody\n {...DOMProps}\n ref={ref}\n style={style}\n className={className ?? 'react-aria-CalendarGridBody'}>\n {[...new Array(weeksInMonth).keys()].map((weekIndex) => (\n <tr key={weekIndex}>\n {state.getDatesInWeek(weekIndex, startDate).map((date, i) => (\n date\n ? React.cloneElement(children(date), {key: i})\n : <td key={i} />\n ))}\n </tr>\n ))}\n </tbody>\n );\n}\n\n/**\n * A calendar grid body displays a grid of calendar cells within a month.\n */\nconst CalendarGridBodyForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridBody);\nexport {CalendarGridBodyForwardRef as CalendarGridBody};\n\nexport interface CalendarCellProps extends RenderProps<CalendarCellRenderProps>, HoverEvents, GlobalDOMAttributes<HTMLTableCellElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-CalendarCell'\n */\n className?: ClassNameOrFunction<CalendarCellRenderProps>,\n /** The date to render in the cell. */\n date: CalendarDate\n}\n\n/**\n * A calendar cell displays a date cell within a calendar grid which can be selected by the user.\n */\nexport const CalendarCell = /*#__PURE__*/ (forwardRef as forwardRefType)(function CalendarCell({date, ...otherProps}: CalendarCellProps, ref: ForwardedRef<HTMLTableCellElement>) {\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let state = calendarState ?? rangeCalendarState!;\n let {startDate: currentMonth} = useContext(InternalCalendarGridContext) ?? {startDate: state.visibleRange.start};\n let isOutsideMonth = !isSameMonth(currentMonth, date);\n let istoday = isToday(date, state.timeZone);\n\n let buttonRef = useRef<HTMLDivElement>(null);\n let {cellProps, buttonProps, ...states} = useCalendarCell(\n {date, isOutsideMonth},\n state,\n buttonRef\n );\n\n let {hoverProps, isHovered} = useHover({...otherProps, isDisabled: states.isDisabled});\n let {focusProps, isFocusVisible} = useFocusRing();\n isFocusVisible &&= states.isFocused;\n let isSelectionStart = false;\n let isSelectionEnd = false;\n if ('highlightedRange' in state && state.highlightedRange) {\n isSelectionStart = isSameDay(date, state.highlightedRange.start);\n isSelectionEnd = isSameDay(date, state.highlightedRange.end);\n }\n\n let renderProps = useRenderProps({\n ...otherProps,\n defaultChildren: states.formattedDate,\n defaultClassName: 'react-aria-CalendarCell',\n values: {\n date,\n isHovered,\n isOutsideMonth,\n isFocusVisible,\n isSelectionStart,\n isSelectionEnd,\n isToday: istoday,\n ...states\n }\n });\n\n let dataAttrs = {\n 'data-focused': states.isFocused || undefined,\n 'data-hovered': isHovered || undefined,\n 'data-pressed': states.isPressed || undefined,\n 'data-unavailable': states.isUnavailable || undefined,\n 'data-disabled': states.isDisabled || undefined,\n 'data-focus-visible': isFocusVisible || undefined,\n 'data-outside-visible-range': states.isOutsideVisibleRange || undefined,\n 'data-outside-month': isOutsideMonth || undefined,\n 'data-selected': states.isSelected || undefined,\n 'data-selection-start': isSelectionStart || undefined,\n 'data-selection-end': isSelectionEnd || undefined,\n 'data-invalid': states.isInvalid || undefined,\n 'data-today': istoday || undefined\n };\n\n let DOMProps = filterDOMProps(otherProps, {global: true});\n\n return (\n <td {...cellProps} ref={ref}>\n <div {...mergeProps(DOMProps, buttonProps, focusProps, hoverProps, dataAttrs, renderProps)} ref={buttonRef} />\n </td>\n );\n});\n"],"names":[],"version":3,"file":"Calendar.module.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AAqGM,MAAM,0DAAuB,CAAA,GAAA,0BAAY,EAAoD;AAC7F,MAAM,0DAA4B,CAAA,GAAA,0BAAY,EAA6B;AAK3E,MAAM,4CAA8B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,cAAc,KAAyB,EAAE,GAAiC;IAC3J,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,EAAC,oBAAoB,sBAAsB,EAAC,GAAG,CAAA,GAAA,2CAAgB,EAAE,CAAA,GAAA,qCAAU,MAAM,CAAC;Q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All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {AriaCheckboxGroupProps, AriaCheckboxProps, HoverEvents, mergeProps, useCheckbox, useCheckboxGroup, useCheckboxGroupItem, useFocusRing, useHover, VisuallyHidden} from 'react-aria';\nimport {CheckboxContext} from './RSPContexts';\nimport {CheckboxGroupState, useCheckboxGroupState, useToggleState} from 'react-stately';\nimport {ContextValue, Provider, RACValidation, removeDataAttributes, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps, mergeRefs, useObjectRef} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport React, {createContext, ForwardedRef, forwardRef, useContext, useMemo} from 'react';\nimport {TextContext} from './Text';\n\nexport interface CheckboxGroupProps extends Omit<AriaCheckboxGroupProps, 'children' | 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<CheckboxGroupRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {}\nexport interface CheckboxProps extends Omit<AriaCheckboxProps, 'children' | 'validationState' | 'validationBehavior'>, HoverEvents, RACValidation, RenderProps<CheckboxRenderProps>, SlotProps, Omit<GlobalDOMAttributes<HTMLLabelElement>, 'onClick'> {\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>\n}\n\nexport interface CheckboxGroupRenderProps {\n /**\n * Whether the checkbox group is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the checkbox group is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the checkbox group is required.\n * @selector [data-required]\n */\n isRequired: boolean,\n /**\n * Whether the checkbox group is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * State of the checkbox group.\n */\n state: CheckboxGroupState\n}\n\nexport interface CheckboxRenderProps {\n /**\n * Whether the checkbox is selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the checkbox is indeterminate.\n * @selector [data-indeterminate]\n */\n isIndeterminate: boolean,\n /**\n * Whether the checkbox is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the checkbox is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the checkbox is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the checkbox is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the checkbox is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the checkbox is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the checkbox invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the checkbox is required.\n * @selector [data-required]\n */\n isRequired: boolean\n}\n\nexport const CheckboxGroupContext = createContext<ContextValue<CheckboxGroupProps, HTMLDivElement>>(null);\nexport const CheckboxGroupStateContext = createContext<CheckboxGroupState | null>(null);\n\n/**\n * A checkbox group allows a user to select multiple items from a list of options.\n */\nexport const CheckboxGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function CheckboxGroup(props: CheckboxGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, CheckboxGroupContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useCheckboxGroupState({\n ...props,\n validationBehavior\n });\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {groupProps, labelProps, descriptionProps, errorMessageProps, ...validation} = useCheckboxGroup({\n ...props,\n label,\n validationBehavior\n }, state);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n isDisabled: state.isDisabled,\n isReadOnly: state.isReadOnly,\n isRequired: props.isRequired || false,\n isInvalid: state.isInvalid,\n state\n },\n defaultClassName: 'react-aria-CheckboxGroup'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div\n {...mergeProps(DOMProps, renderProps, groupProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-required={props.isRequired || undefined}\n data-invalid={state.isInvalid || undefined}\n data-disabled={props.isDisabled || undefined}>\n <Provider\n values={[\n [CheckboxGroupStateContext, state],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n});\n\n/**\n * A checkbox allows a user to select multiple items from a list of individual items, or\n * to mark one individual item as selected.\n */\nexport const Checkbox = /*#__PURE__*/ (forwardRef as forwardRefType)(function Checkbox(props: CheckboxProps, ref: ForwardedRef<HTMLLabelElement>) {\n let {\n inputRef: userProvidedInputRef = null,\n ...otherProps\n } = props;\n [props, ref] = useContextProps(otherProps, ref, CheckboxContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let groupState = useContext(CheckboxGroupStateContext);\n let inputRef = useObjectRef(useMemo(() => mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null), [userProvidedInputRef, props.inputRef]));\n let {labelProps, inputProps, isSelected, isDisabled, isReadOnly, isPressed, isInvalid} = groupState\n // eslint-disable-next-line react-hooks/rules-of-hooks\n ? useCheckboxGroupItem({\n ...removeDataAttributes(props),\n // Value is optional for standalone checkboxes, but required for CheckboxGroup items;\n // it's passed explicitly here to avoid typescript error (requires ignore).\n // @ts-ignore\n value: props.value,\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n }, groupState, inputRef)\n // eslint-disable-next-line react-hooks/rules-of-hooks\n : useCheckbox({\n ...removeDataAttributes(props),\n children: typeof props.children === 'function' ? true : props.children,\n validationBehavior\n // eslint-disable-next-line react-hooks/rules-of-hooks\n }, useToggleState(props), inputRef);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing();\n let isInteractionDisabled = isDisabled || isReadOnly;\n\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: isInteractionDisabled\n });\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Checkbox',\n values: {\n isSelected,\n isIndeterminate: props.isIndeterminate || false,\n isPressed,\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled,\n isReadOnly,\n isInvalid,\n isRequired: props.isRequired || false\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <label\n {...mergeProps(DOMProps, labelProps, hoverProps, renderProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-selected={isSelected || undefined}\n data-indeterminate={props.isIndeterminate || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={isReadOnly || undefined}\n data-invalid={isInvalid || undefined}\n data-required={props.isRequired || undefined}>\n <VisuallyHidden elementType=\"span\">\n <input {...mergeProps(inputProps, focusProps)} ref={inputRef} />\n </VisuallyHidden>\n {renderProps.children}\n </label>\n );\n});\n"],"names":[],"version":3,"file":"Checkbox.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;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a;QAC3B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,iBAAe,cAAc;QAC7B,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,iBAAe,MAAM,UAAU,IAAI;qBACnC,0DAAC,CAAA,GAAA,+BAAa;QAAE,aAAY;qBAC1B,0DAAC;QAAO,GAAG,CAAA,GAAA,2BAAS,EAAE,YAAY,WAAW;QAAE,KAAK;SAErD,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/Checkbox.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {AriaCheckboxGroupProps, AriaCheckboxProps, HoverEvents, mergeProps, useCheckbox, useCheckboxGroup, useCheckboxGroupItem, useFocusRing, useHover, VisuallyHidden} from 'react-aria';\nimport {CheckboxContext} from './RSPContexts';\nimport {CheckboxGroupState, useCheckboxGroupState, useToggleState} from 'react-stately';\nimport {\n ClassNameOrFunction,\n ContextValue,\n Provider,\n RACValidation,\n removeDataAttributes,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps,\n useSlot,\n useSlottedContext\n} from './utils';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps, mergeRefs, useObjectRef} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport React, {createContext, ForwardedRef, forwardRef, useContext, useMemo} from 'react';\nimport {TextContext} from './Text';\n\nexport interface CheckboxGroupProps extends Omit<AriaCheckboxGroupProps, 'children' | 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<CheckboxGroupRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-CheckboxGroup'\n */\n className?: ClassNameOrFunction<CheckboxGroupRenderProps>\n}\nexport interface CheckboxProps extends Omit<AriaCheckboxProps, 'children' | 'validationState' | 'validationBehavior'>, HoverEvents, RACValidation, RenderProps<CheckboxRenderProps>, SlotProps, Omit<GlobalDOMAttributes<HTMLLabelElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-Checkbox'\n */\n className?: ClassNameOrFunction<CheckboxRenderProps>,\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>\n}\n\nexport interface CheckboxGroupRenderProps {\n /**\n * Whether the checkbox group is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the checkbox group is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the checkbox group is required.\n * @selector [data-required]\n */\n isRequired: boolean,\n /**\n * Whether the checkbox group is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * State of the checkbox group.\n */\n state: CheckboxGroupState\n}\n\nexport interface CheckboxRenderProps {\n /**\n * Whether the checkbox is selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the checkbox is indeterminate.\n * @selector [data-indeterminate]\n */\n isIndeterminate: boolean,\n /**\n * Whether the checkbox is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the checkbox is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the checkbox is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the checkbox is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the checkbox is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the checkbox is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the checkbox invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the checkbox is required.\n * @selector [data-required]\n */\n isRequired: boolean\n}\n\nexport const CheckboxGroupContext = createContext<ContextValue<CheckboxGroupProps, HTMLDivElement>>(null);\nexport const CheckboxGroupStateContext = createContext<CheckboxGroupState | null>(null);\n\n/**\n * A checkbox group allows a user to select multiple items from a list of options.\n */\nexport const CheckboxGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function CheckboxGroup(props: CheckboxGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, CheckboxGroupContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useCheckboxGroupState({\n ...props,\n validationBehavior\n });\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {groupProps, labelProps, descriptionProps, errorMessageProps, ...validation} = useCheckboxGroup({\n ...props,\n label,\n validationBehavior\n }, state);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n isDisabled: state.isDisabled,\n isReadOnly: state.isReadOnly,\n isRequired: props.isRequired || false,\n isInvalid: state.isInvalid,\n state\n },\n defaultClassName: 'react-aria-CheckboxGroup'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div\n {...mergeProps(DOMProps, renderProps, groupProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-required={props.isRequired || undefined}\n data-invalid={state.isInvalid || undefined}\n data-disabled={props.isDisabled || undefined}>\n <Provider\n values={[\n [CheckboxGroupStateContext, state],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n});\n\n/**\n * A checkbox allows a user to select multiple items from a list of individual items, or\n * to mark one individual item as selected.\n */\nexport const Checkbox = /*#__PURE__*/ (forwardRef as forwardRefType)(function Checkbox(props: CheckboxProps, ref: ForwardedRef<HTMLLabelElement>) {\n let {\n inputRef: userProvidedInputRef = null,\n ...otherProps\n } = props;\n [props, ref] = useContextProps(otherProps, ref, CheckboxContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let groupState = useContext(CheckboxGroupStateContext);\n let inputRef = useObjectRef(useMemo(() => mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null), [userProvidedInputRef, props.inputRef]));\n let {labelProps, inputProps, isSelected, isDisabled, isReadOnly, isPressed, isInvalid} = groupState\n // eslint-disable-next-line react-hooks/rules-of-hooks\n ? useCheckboxGroupItem({\n ...removeDataAttributes(props),\n // Value is optional for standalone checkboxes, but required for CheckboxGroup items;\n // it's passed explicitly here to avoid typescript error (requires ignore).\n // @ts-ignore\n value: props.value,\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n }, groupState, inputRef)\n // eslint-disable-next-line react-hooks/rules-of-hooks\n : useCheckbox({\n ...removeDataAttributes(props),\n children: typeof props.children === 'function' ? true : props.children,\n validationBehavior\n // eslint-disable-next-line react-hooks/rules-of-hooks\n }, useToggleState(props), inputRef);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing();\n let isInteractionDisabled = isDisabled || isReadOnly;\n\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: isInteractionDisabled\n });\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Checkbox',\n values: {\n isSelected,\n isIndeterminate: props.isIndeterminate || false,\n isPressed,\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled,\n isReadOnly,\n isInvalid,\n isRequired: props.isRequired || false\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <label\n {...mergeProps(DOMProps, labelProps, hoverProps, renderProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-selected={isSelected || undefined}\n data-indeterminate={props.isIndeterminate || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={isReadOnly || undefined}\n data-invalid={isInvalid || undefined}\n data-required={props.isRequired || undefined}>\n <VisuallyHidden elementType=\"span\">\n <input {...mergeProps(inputProps, focusProps)} ref={inputRef} />\n </VisuallyHidden>\n {renderProps.children}\n </label>\n );\n});\n"],"names":[],"version":3,"file":"Checkbox.main.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AAqGM,MAAM,0DAAuB,CAAA,GAAA,oBAAY,EAAoD;AAC7F,MAAM,0DAA4B,CAAA,GAAA,oBAAY,EAA6B;AAK3E,MAAM,4CAA8B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,cAAc,KAAyB,EAAE,GAAiC;IAC3J,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,EAAC,oBAAoB,sBAAsB,EAAC,GAAG,CAAA,GAAA,yCAAgB,EAAE,CAAA,GAAA,yCAAU,MAAM,CAAC;QAC7D,2BAAA;IAAzB,IAAI,qBAAqB,CAAA,OAAA,CAAA,4BAAA,MAAM,kBAAkB,cAAxB,uCAAA,4BAA4B,oCAA5B,kBAAA,OAAsD;IAC/E,IAAI,QAAQ,CAAA,GAAA,4BAAoB,EAAE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AU,EAAC,GAAG,CAAA,GAAA,mBAAW;IACzD,IAAI,wBAAwB,cAAc;IAE1C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;QACrC,GAAG,KAAK;QACR,YAAY;IACd;IAEA,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;wBACN;YACA,iBAAiB,MAAM,eAAe,IAAI;uBAC1C;uBACA;uBACA;4BACA;wBACA;wBACA;uBACA;YACA,YAAY,MAAM,UAAU,IAAI;QAClC;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAClD,OAAO,SAAS,EAAE;IAClB,OAAO,SAAS,OAAO;IAEvB,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,YAAY,YAAY,YAAY;QAC7D,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,iBAAe,cAAc;QAC7B,sBAAoB,MAAM,eAAe,IAAI;QAC7C,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,iBAAe,cAAc;QAC7B,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,iBAAe,MAAM,UAAU,IAAI;qBACnC,gCAAC,CAAA,GAAA,qBAAa;QAAE,aAAY;qBAC1B,gCAAC;QAAO,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,WAAW;QAAE,KAAK;SAErD,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/Checkbox.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {AriaCheckboxGroupProps, AriaCheckboxProps, HoverEvents, mergeProps, useCheckbox, useCheckboxGroup, useCheckboxGroupItem, useFocusRing, useHover, VisuallyHidden} from 'react-aria';\nimport {CheckboxContext} from './RSPContexts';\nimport {CheckboxGroupState, useCheckboxGroupState, useToggleState} from 'react-stately';\nimport {ContextValue, Provider, RACValidation, removeDataAttributes, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps, mergeRefs, useObjectRef} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport React, {createContext, ForwardedRef, forwardRef, useContext, useMemo} from 'react';\nimport {TextContext} from './Text';\n\nexport interface CheckboxGroupProps extends Omit<AriaCheckboxGroupProps, 'children' | 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<CheckboxGroupRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {}\nexport interface CheckboxProps extends Omit<AriaCheckboxProps, 'children' | 'validationState' | 'validationBehavior'>, HoverEvents, RACValidation, RenderProps<CheckboxRenderProps>, SlotProps, Omit<GlobalDOMAttributes<HTMLLabelElement>, 'onClick'> {\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>\n}\n\nexport interface CheckboxGroupRenderProps {\n /**\n * Whether the checkbox group is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the checkbox group is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the checkbox group is required.\n * @selector [data-required]\n */\n isRequired: boolean,\n /**\n * Whether the checkbox group is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * State of the checkbox group.\n */\n state: CheckboxGroupState\n}\n\nexport interface CheckboxRenderProps {\n /**\n * Whether the checkbox is selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the checkbox is indeterminate.\n * @selector [data-indeterminate]\n */\n isIndeterminate: boolean,\n /**\n * Whether the checkbox is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the checkbox is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the checkbox is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the checkbox is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the checkbox is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the checkbox is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the checkbox invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the checkbox is required.\n * @selector [data-required]\n */\n isRequired: boolean\n}\n\nexport const CheckboxGroupContext = createContext<ContextValue<CheckboxGroupProps, HTMLDivElement>>(null);\nexport const CheckboxGroupStateContext = createContext<CheckboxGroupState | null>(null);\n\n/**\n * A checkbox group allows a user to select multiple items from a list of options.\n */\nexport const CheckboxGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function CheckboxGroup(props: CheckboxGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, CheckboxGroupContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useCheckboxGroupState({\n ...props,\n validationBehavior\n });\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {groupProps, labelProps, descriptionProps, errorMessageProps, ...validation} = useCheckboxGroup({\n ...props,\n label,\n validationBehavior\n }, state);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n isDisabled: state.isDisabled,\n isReadOnly: state.isReadOnly,\n isRequired: props.isRequired || false,\n isInvalid: state.isInvalid,\n state\n },\n defaultClassName: 'react-aria-CheckboxGroup'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div\n {...mergeProps(DOMProps, renderProps, groupProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-required={props.isRequired || undefined}\n data-invalid={state.isInvalid || undefined}\n data-disabled={props.isDisabled || undefined}>\n <Provider\n values={[\n [CheckboxGroupStateContext, state],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n});\n\n/**\n * A checkbox allows a user to select multiple items from a list of individual items, or\n * to mark one individual item as selected.\n */\nexport const Checkbox = /*#__PURE__*/ (forwardRef as forwardRefType)(function Checkbox(props: CheckboxProps, ref: ForwardedRef<HTMLLabelElement>) {\n let {\n inputRef: userProvidedInputRef = null,\n ...otherProps\n } = props;\n [props, ref] = useContextProps(otherProps, ref, CheckboxContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let groupState = useContext(CheckboxGroupStateContext);\n let inputRef = useObjectRef(useMemo(() => mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null), [userProvidedInputRef, props.inputRef]));\n let {labelProps, inputProps, isSelected, isDisabled, isReadOnly, isPressed, isInvalid} = groupState\n // eslint-disable-next-line react-hooks/rules-of-hooks\n ? useCheckboxGroupItem({\n ...removeDataAttributes(props),\n // Value is optional for standalone checkboxes, but required for CheckboxGroup items;\n // it's passed explicitly here to avoid typescript error (requires ignore).\n // @ts-ignore\n value: props.value,\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n }, groupState, inputRef)\n // eslint-disable-next-line react-hooks/rules-of-hooks\n : useCheckbox({\n ...removeDataAttributes(props),\n children: typeof props.children === 'function' ? true : props.children,\n validationBehavior\n // eslint-disable-next-line react-hooks/rules-of-hooks\n }, useToggleState(props), inputRef);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing();\n let isInteractionDisabled = isDisabled || isReadOnly;\n\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: isInteractionDisabled\n });\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Checkbox',\n values: {\n isSelected,\n isIndeterminate: props.isIndeterminate || false,\n isPressed,\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled,\n isReadOnly,\n isInvalid,\n isRequired: props.isRequired || false\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <label\n {...mergeProps(DOMProps, labelProps, hoverProps, renderProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-selected={isSelected || undefined}\n data-indeterminate={props.isIndeterminate || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={isReadOnly || undefined}\n data-invalid={isInvalid || undefined}\n data-required={props.isRequired || undefined}>\n <VisuallyHidden elementType=\"span\">\n <input {...mergeProps(inputProps, focusProps)} ref={inputRef} />\n </VisuallyHidden>\n {renderProps.children}\n </label>\n );\n});\n"],"names":[],"version":3,"file":"Checkbox.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AA4HM,MAAM,0DAAuB,CAAA,GAAA,oBAAY,EAAoD;AAC7F,MAAM,0DAA4B,CAAA,GAAA,oBAAY,EAA6B;AAK3E,MAAM,4CAA8B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,cAAc,KAAyB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qBAAa;QAAE,aAAY;qBAC1B,gCAAC;QAAO,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,WAAW;QAAE,KAAK;SAErD,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/Checkbox.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {AriaCheckboxGroupProps, AriaCheckboxProps, HoverEvents, mergeProps, useCheckbox, useCheckboxGroup, useCheckboxGroupItem, useFocusRing, useHover, VisuallyHidden} from 'react-aria';\nimport {CheckboxContext} from './RSPContexts';\nimport {CheckboxGroupState, useCheckboxGroupState, useToggleState} from 'react-stately';\nimport {\n ClassNameOrFunction,\n ContextValue,\n Provider,\n RACValidation,\n removeDataAttributes,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps,\n useSlot,\n useSlottedContext\n} from './utils';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps, mergeRefs, useObjectRef} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport React, {createContext, ForwardedRef, forwardRef, useContext, useMemo} from 'react';\nimport {TextContext} from './Text';\n\nexport interface CheckboxGroupProps extends Omit<AriaCheckboxGroupProps, 'children' | 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<CheckboxGroupRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-CheckboxGroup'\n */\n className?: ClassNameOrFunction<CheckboxGroupRenderProps>\n}\nexport interface CheckboxProps extends Omit<AriaCheckboxProps, 'children' | 'validationState' | 'validationBehavior'>, HoverEvents, RACValidation, RenderProps<CheckboxRenderProps>, SlotProps, Omit<GlobalDOMAttributes<HTMLLabelElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-Checkbox'\n */\n className?: ClassNameOrFunction<CheckboxRenderProps>,\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>\n}\n\nexport interface CheckboxGroupRenderProps {\n /**\n * Whether the checkbox group is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the checkbox group is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the checkbox group is required.\n * @selector [data-required]\n */\n isRequired: boolean,\n /**\n * Whether the checkbox group is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * State of the checkbox group.\n */\n state: CheckboxGroupState\n}\n\nexport interface CheckboxRenderProps {\n /**\n * Whether the checkbox is selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the checkbox is indeterminate.\n * @selector [data-indeterminate]\n */\n isIndeterminate: boolean,\n /**\n * Whether the checkbox is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the checkbox is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the checkbox is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the checkbox is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the checkbox is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the checkbox is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the checkbox invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the checkbox is required.\n * @selector [data-required]\n */\n isRequired: boolean\n}\n\nexport const CheckboxGroupContext = createContext<ContextValue<CheckboxGroupProps, HTMLDivElement>>(null);\nexport const CheckboxGroupStateContext = createContext<CheckboxGroupState | null>(null);\n\n/**\n * A checkbox group allows a user to select multiple items from a list of options.\n */\nexport const CheckboxGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function CheckboxGroup(props: CheckboxGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, CheckboxGroupContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useCheckboxGroupState({\n ...props,\n validationBehavior\n });\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {groupProps, labelProps, descriptionProps, errorMessageProps, ...validation} = useCheckboxGroup({\n ...props,\n label,\n validationBehavior\n }, state);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n isDisabled: state.isDisabled,\n isReadOnly: state.isReadOnly,\n isRequired: props.isRequired || false,\n isInvalid: state.isInvalid,\n state\n },\n defaultClassName: 'react-aria-CheckboxGroup'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div\n {...mergeProps(DOMProps, renderProps, groupProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-required={props.isRequired || undefined}\n data-invalid={state.isInvalid || undefined}\n data-disabled={props.isDisabled || undefined}>\n <Provider\n values={[\n [CheckboxGroupStateContext, state],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n});\n\n/**\n * A checkbox allows a user to select multiple items from a list of individual items, or\n * to mark one individual item as selected.\n */\nexport const Checkbox = /*#__PURE__*/ (forwardRef as forwardRefType)(function Checkbox(props: CheckboxProps, ref: ForwardedRef<HTMLLabelElement>) {\n let {\n inputRef: userProvidedInputRef = null,\n ...otherProps\n } = props;\n [props, ref] = useContextProps(otherProps, ref, CheckboxContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let groupState = useContext(CheckboxGroupStateContext);\n let inputRef = useObjectRef(useMemo(() => mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null), [userProvidedInputRef, props.inputRef]));\n let {labelProps, inputProps, isSelected, isDisabled, isReadOnly, isPressed, isInvalid} = groupState\n // eslint-disable-next-line react-hooks/rules-of-hooks\n ? useCheckboxGroupItem({\n ...removeDataAttributes(props),\n // Value is optional for standalone checkboxes, but required for CheckboxGroup items;\n // it's passed explicitly here to avoid typescript error (requires ignore).\n // @ts-ignore\n value: props.value,\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n }, groupState, inputRef)\n // eslint-disable-next-line react-hooks/rules-of-hooks\n : useCheckbox({\n ...removeDataAttributes(props),\n children: typeof props.children === 'function' ? true : props.children,\n validationBehavior\n // eslint-disable-next-line react-hooks/rules-of-hooks\n }, useToggleState(props), inputRef);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing();\n let isInteractionDisabled = isDisabled || isReadOnly;\n\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: isInteractionDisabled\n });\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Checkbox',\n values: {\n isSelected,\n isIndeterminate: props.isIndeterminate || false,\n isPressed,\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled,\n isReadOnly,\n isInvalid,\n isRequired: props.isRequired || false\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <label\n {...mergeProps(DOMProps, labelProps, hoverProps, renderProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-selected={isSelected || undefined}\n data-indeterminate={props.isIndeterminate || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={isReadOnly || undefined}\n data-invalid={isInvalid || undefined}\n data-required={props.isRequired || undefined}>\n <VisuallyHidden elementType=\"span\">\n <input {...mergeProps(inputProps, focusProps)} ref={inputRef} />\n </VisuallyHidden>\n {renderProps.children}\n </label>\n );\n});\n"],"names":[],"version":3,"file":"Checkbox.module.js.map"}
@@ -75,7 +75,7 @@ function $3114c2382242bdc0$export$2dbbd341daed716d(collection, node, renderDropI
75
75
  let afterIndicators = [];
76
76
  if (nextItemInSameLevel == null) {
77
77
  let current = node;
78
- while(current && (!nextItemInFlattenedCollection || current.parentKey !== nextItemInFlattenedCollection.parentKey && nextItemInFlattenedCollection.level < current.level)){
78
+ while((current === null || current === void 0 ? void 0 : current.type) === 'item' && (!nextItemInFlattenedCollection || current.parentKey !== nextItemInFlattenedCollection.parentKey && nextItemInFlattenedCollection.level < current.level)){
79
79
  let indicator = renderDropIndicator({
80
80
  type: 'item',
81
81
  key: current.key,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAyFM,MAAM,0DAAiB,CAAA,GAAA,0BAAY,EAA8B;AAGjE,MAAM,4CAAU,WAAW,GAAG,CAAA,GAAA,iDAAoB,EAAE,WAAW,CAAmB,OAAwB,KAAgC;IAC/I,IAAI,QAAC,IAAI,UAAE,MAAM,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE;IAChC,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAC3B,QAAQ,IAAI,CAAC,CAAC,qCAAqC,EAAE,KAAK,UAAU,CAAC;IAEvE,OAAO,OAAO,OAAO,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,sFAAsF;IACtF,IAAI,kBAA+B,EAAE;IACrC,IAAI,uBAAuB,MAAM;QAC/B,IAAI,UAAgC;QACpC,MAAO,WAAY,CAAA,CAAC,iCAAkC,QAAQ,SAAS,KAAK,8BAA8B,SAAS,IAAI,8BAA8B,KAAK,GAAG,QAAQ,KAAK,EAAI;YAC5K,IAAI,YAAY,oBAAoB;gBAClC,MAAM;gBACN,KAAK,QAAQ,GAAG;gBAChB,cAAc;YAChB;YACA,kBAAI,CAAA,GAAA,2BAAa,EAAE,YACjB,gBAAgB,IAAI,eAAC,CAAA,GAAA,yBAAW,EAAE,WAAW;gBAAC,KAAK,GAAG,QAAQ,GAAG,CAAC,MAAM,CAAC;YAAA;YAE3E,UAAU,QAAQ,SAAS,IAAI,OAAO,WAAW,OAAO,CAAC,QAAQ,SAAS,IAAI;QAChF;IACF;IAEA,OAAO;AACT;AAEO,MAAM,0DAA4B,CAAA,GAAA,0BAAY,EAAsB;AAGpE,SAAS,0CAAiB,UAAsB;IACrD,OAAO,CAAA,GAAA,oBAAM,EAAE,IAAM,cAAc,OAAO,IAAI,IAAI;YAAC;SAAW,IAAI,MAAM;QAAC;KAAW;AACtF","sources":["packages/react-aria-components/src/Collection.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {CollectionBase, DropTargetDelegate, GlobalDOMAttributes, ItemDropTarget, Key, LayoutDelegate, RefObject} from '@react-types/shared';\nimport {createBranchComponent, useCachedChildren} from '@react-aria/collections';\nimport {Collection as ICollection, Node, SelectionBehavior, SelectionMode, SectionProps as SharedSectionProps} from 'react-stately';\nimport React, {cloneElement, createContext, ForwardedRef, HTMLAttributes, isValidElement, JSX, ReactElement, ReactNode, useContext, useMemo} from 'react';\nimport {StyleProps} from './utils';\n\nexport interface CollectionProps<T> extends Omit<CollectionBase<T>, 'children'> {\n /** The contents of the collection. */\n children?: ReactNode | ((item: T) => ReactNode),\n /** Values that should invalidate the item cache when using dynamic collections. */\n dependencies?: ReadonlyArray<any>\n}\n\nexport interface ItemRenderProps {\n /**\n * Whether the item is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the item is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the item is currently selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the item is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the item is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the item is non-interactive, i.e. both selection and actions are disabled and the item may\n * not be focused. Dependent on `disabledKeys` and `disabledBehavior`.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * The type of selection that is allowed in the collection.\n * @selector [data-selection-mode=\"single | multiple\"]\n */\n selectionMode: SelectionMode,\n /** The selection behavior for the collection. */\n selectionBehavior: SelectionBehavior,\n /**\n * Whether the item allows dragging.\n * @note This property is only available in collection components that support drag and drop.\n * @selector [data-allows-dragging]\n */\n allowsDragging?: boolean,\n /**\n * Whether the item is currently being dragged.\n * @note This property is only available in collection components that support drag and drop.\n * @selector [data-dragging]\n */\n isDragging?: boolean,\n /**\n * Whether the item is currently an active drop target.\n * @note This property is only available in collection components that support drag and drop.\n * @selector [data-drop-target]\n */\n isDropTarget?: boolean\n}\n\nexport interface SectionProps<T> extends Omit<SharedSectionProps<T>, 'children' | 'title'>, StyleProps, GlobalDOMAttributes<HTMLElement> {\n /** The unique id of the section. */\n id?: Key,\n /** The object value that this section represents. When using dynamic collections, this is set automatically. */\n value?: T,\n /** Static child items or a function to render children. */\n children?: ReactNode | ((item: T) => ReactElement),\n /** Values that should invalidate the item cache when using dynamic collections. */\n dependencies?: ReadonlyArray<any>\n}\n\ninterface SectionContextValue {\n name: string,\n render: (props: SectionProps<any>, ref: ForwardedRef<HTMLElement>, section: Node<any>, className?: string) => ReactElement\n}\n\nexport const SectionContext = createContext<SectionContextValue | null>(null);\n\n/** @deprecated */\nexport const Section = /*#__PURE__*/ createBranchComponent('section', <T extends object>(props: SectionProps<T>, ref: ForwardedRef<HTMLElement>, section: Node<T>): JSX.Element => {\n let {name, render} = useContext(SectionContext)!;\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`<Section> is deprecated. Please use <${name}> instead.`);\n }\n return render(props, ref, section, 'react-aria-Section');\n});\n\nexport interface CollectionBranchProps {\n /** The collection of items to render. */\n collection: ICollection<Node<unknown>>,\n /** The parent node of the items to render. */\n parent: Node<unknown>,\n /** A function that renders a drop indicator between items. */\n renderDropIndicator?: (target: ItemDropTarget) => ReactNode\n}\n\nexport interface CollectionRootProps extends HTMLAttributes<HTMLElement> {\n /** The collection of items to render. */\n collection: ICollection<Node<unknown>>,\n /** A set of keys for items that should always be persisted in the DOM. */\n persistedKeys?: Set<Key> | null,\n /** A ref to the scroll container for the collection. */\n scrollRef?: RefObject<HTMLElement | null>,\n /** A function that renders a drop indicator between items. */\n renderDropIndicator?: (target: ItemDropTarget) => ReactNode\n}\n\nexport interface CollectionRenderer {\n /** Whether this is a virtualized collection. */\n isVirtualized?: boolean,\n /** A delegate object that provides layout information for items in the collection. */\n layoutDelegate?: LayoutDelegate,\n /** A delegate object that provides drop targets for pointer coordinates within the collection. */\n dropTargetDelegate?: DropTargetDelegate,\n /** A component that renders the root collection items. */\n CollectionRoot: React.ComponentType<CollectionRootProps>,\n /** A component that renders the child collection items. */\n CollectionBranch: React.ComponentType<CollectionBranchProps>\n}\n\nexport const DefaultCollectionRenderer: CollectionRenderer = {\n CollectionRoot({collection, renderDropIndicator}) {\n return useCollectionRender(collection, null, renderDropIndicator);\n },\n CollectionBranch({collection, parent, renderDropIndicator}) {\n return useCollectionRender(collection, parent, renderDropIndicator);\n }\n};\n\nfunction useCollectionRender(\n collection: ICollection<Node<unknown>>,\n parent: Node<unknown> | null,\n renderDropIndicator?: (target: ItemDropTarget) => ReactNode\n) {\n return useCachedChildren({\n items: parent ? collection.getChildren!(parent.key) : collection,\n dependencies: [renderDropIndicator],\n children(node) {\n let rendered = node.render!(node);\n if (!renderDropIndicator || node.type !== 'item') {\n return rendered;\n }\n\n return (\n <>\n {renderDropIndicator({type: 'item', key: node.key, dropPosition: 'before'})}\n {rendered}\n {renderAfterDropIndicators(collection, node, renderDropIndicator)}\n </>\n );\n }\n });\n}\n\nexport function renderAfterDropIndicators(collection: ICollection<Node<unknown>>, node: Node<unknown>, renderDropIndicator: (target: ItemDropTarget) => ReactNode): ReactNode {\n let key = node.key;\n let keyAfter = collection.getKeyAfter(key);\n let nextItemInFlattenedCollection = keyAfter != null ? collection.getItem(keyAfter) : null;\n while (nextItemInFlattenedCollection != null && nextItemInFlattenedCollection.type !== 'item') {\n keyAfter = collection.getKeyAfter(nextItemInFlattenedCollection.key);\n nextItemInFlattenedCollection = keyAfter != null ? collection.getItem(keyAfter) : null;\n }\n\n let nextItemInSameLevel = node.nextKey != null ? collection.getItem(node.nextKey) : null;\n while (nextItemInSameLevel != null && nextItemInSameLevel.type !== 'item') {\n nextItemInSameLevel = nextItemInSameLevel.nextKey != null ? collection.getItem(nextItemInSameLevel.nextKey) : null;\n }\n\n // Render one or more \"after\" drop indicators when the next item in the flattened collection\n // has a smaller level, is not an item, or there are no more items in the collection.\n // Otherwise, the \"after\" position is equivalent to the next item's \"before\" position.\n let afterIndicators: ReactNode[] = [];\n if (nextItemInSameLevel == null) {\n let current: Node<unknown> | null = node;\n while (current && (!nextItemInFlattenedCollection || (current.parentKey !== nextItemInFlattenedCollection.parentKey && nextItemInFlattenedCollection.level < current.level))) {\n let indicator = renderDropIndicator({\n type: 'item',\n key: current.key,\n dropPosition: 'after'\n });\n if (isValidElement(indicator)) {\n afterIndicators.push(cloneElement(indicator, {key: `${current.key}-after`}));\n }\n current = current.parentKey != null ? collection.getItem(current.parentKey) : null;\n }\n }\n\n return afterIndicators;\n}\n\nexport const CollectionRendererContext = createContext<CollectionRenderer>(DefaultCollectionRenderer);\n\ntype PersistedKeysReturnValue = Set<Key> | null;\nexport function usePersistedKeys(focusedKey: Key | null): PersistedKeysReturnValue {\n return useMemo(() => focusedKey != null ? new Set([focusedKey]) : null, [focusedKey]);\n}\n"],"names":[],"version":3,"file":"Collection.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAyFM,MAAM,0DAAiB,CAAA,GAAA,0BAAY,EAA8B;AAGjE,MAAM,4CAAU,WAAW,GAAG,CAAA,GAAA,iDAAoB,EAAE,WAAW,CAAmB,OAAwB,KAAgC;IAC/I,IAAI,QAAC,IAAI,UAAE,MAAM,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE;IAChC,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAC3B,QAAQ,IAAI,CAAC,CAAC,qCAAqC,EAAE,KAAK,UAAU,CAAC;IAEvE,OAAO,OAAO,OAAO,KAAK,SAAS;AACrC;AAmCO,MAAM,4CAAgD;IAC3D,gBAAe,cAAC,UAAU,uBAAE,mBAAmB,EAAC;QAC9C,OAAO,0CAAoB,YAAY,MAAM;IAC/C;IACA,kBAAiB,cAAC,UAAU,UAAE,MAAM,uBAAE,mBAAmB,EAAC;QACxD,OAAO,0CAAoB,YAAY,QAAQ;IACjD;AACF;AAEA,SAAS,0CACP,UAAsC,EACtC,MAA4B,EAC5B,mBAA2D;IAE3D,OAAO,CAAA,GAAA,6CAAgB,EAAE;QACvB,OAAO,SAAS,WAAW,WAAW,CAAE,OAAO,GAAG,IAAI;QACtD,cAAc;YAAC;SAAoB;QACnC,UAAS,IAAI;YACX,IAAI,WAAW,KAAK,MAAM,C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AAC,MAAM,CAAC;YAAA;YAE3E,UAAU,QAAQ,SAAS,IAAI,OAAO,WAAW,OAAO,CAAC,QAAQ,SAAS,IAAI;QAChF;IACF;IAEA,OAAO;AACT;AAEO,MAAM,0DAA4B,CAAA,GAAA,0BAAY,EAAsB;AAGpE,SAAS,0CAAiB,UAAsB;IACrD,OAAO,CAAA,GAAA,oBAAM,EAAE,IAAM,cAAc,OAAO,IAAI,IAAI;YAAC;SAAW,IAAI,MAAM;QAAC;KAAW;AACtF","sources":["packages/react-aria-components/src/Collection.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {CollectionBase, DropTargetDelegate, GlobalDOMAttributes, ItemDropTarget, Key, LayoutDelegate, RefObject} from '@react-types/shared';\nimport {createBranchComponent, useCachedChildren} from '@react-aria/collections';\nimport {Collection as ICollection, Node, SelectionBehavior, SelectionMode, SectionProps as SharedSectionProps} from 'react-stately';\nimport React, {cloneElement, createContext, ForwardedRef, HTMLAttributes, isValidElement, JSX, ReactElement, ReactNode, useContext, useMemo} from 'react';\nimport {StyleProps} from './utils';\n\nexport interface CollectionProps<T> extends Omit<CollectionBase<T>, 'children'> {\n /** The contents of the collection. */\n children?: ReactNode | ((item: T) => ReactNode),\n /** Values that should invalidate the item cache when using dynamic collections. */\n dependencies?: ReadonlyArray<any>\n}\n\nexport interface ItemRenderProps {\n /**\n * Whether the item is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the item is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the item is currently selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the item is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the item is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the item is non-interactive, i.e. both selection and actions are disabled and the item may\n * not be focused. Dependent on `disabledKeys` and `disabledBehavior`.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * The type of selection that is allowed in the collection.\n * @selector [data-selection-mode=\"single | multiple\"]\n */\n selectionMode: SelectionMode,\n /** The selection behavior for the collection. */\n selectionBehavior: SelectionBehavior,\n /**\n * Whether the item allows dragging.\n * @note This property is only available in collection components that support drag and drop.\n * @selector [data-allows-dragging]\n */\n allowsDragging?: boolean,\n /**\n * Whether the item is currently being dragged.\n * @note This property is only available in collection components that support drag and drop.\n * @selector [data-dragging]\n */\n isDragging?: boolean,\n /**\n * Whether the item is currently an active drop target.\n * @note This property is only available in collection components that support drag and drop.\n * @selector [data-drop-target]\n */\n isDropTarget?: boolean\n}\n\nexport interface SectionProps<T> extends Omit<SharedSectionProps<T>, 'children' | 'title'>, StyleProps, GlobalDOMAttributes<HTMLElement> {\n /** The unique id of the section. */\n id?: Key,\n /** The object value that this section represents. When using dynamic collections, this is set automatically. */\n value?: T,\n /** Static child items or a function to render children. */\n children?: ReactNode | ((item: T) => ReactElement),\n /** Values that should invalidate the item cache when using dynamic collections. */\n dependencies?: ReadonlyArray<any>\n}\n\ninterface SectionContextValue {\n name: string,\n render: (props: SectionProps<any>, ref: ForwardedRef<HTMLElement>, section: Node<any>, className?: string) => ReactElement\n}\n\nexport const SectionContext = createContext<SectionContextValue | null>(null);\n\n/** @deprecated */\nexport const Section = /*#__PURE__*/ createBranchComponent('section', <T extends object>(props: SectionProps<T>, ref: ForwardedRef<HTMLElement>, section: Node<T>): JSX.Element => {\n let {name, render} = useContext(SectionContext)!;\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`<Section> is deprecated. Please use <${name}> instead.`);\n }\n return render(props, ref, section, 'react-aria-Section');\n});\n\nexport interface CollectionBranchProps {\n /** The collection of items to render. */\n collection: ICollection<Node<unknown>>,\n /** The parent node of the items to render. */\n parent: Node<unknown>,\n /** A function that renders a drop indicator between items. */\n renderDropIndicator?: (target: ItemDropTarget) => ReactNode\n}\n\nexport interface CollectionRootProps extends HTMLAttributes<HTMLElement> {\n /** The collection of items to render. */\n collection: ICollection<Node<unknown>>,\n /** A set of keys for items that should always be persisted in the DOM. */\n persistedKeys?: Set<Key> | null,\n /** A ref to the scroll container for the collection. */\n scrollRef?: RefObject<HTMLElement | null>,\n /** A function that renders a drop indicator between items. */\n renderDropIndicator?: (target: ItemDropTarget) => ReactNode\n}\n\nexport interface CollectionRenderer {\n /** Whether this is a virtualized collection. */\n isVirtualized?: boolean,\n /** A delegate object that provides layout information for items in the collection. */\n layoutDelegate?: LayoutDelegate,\n /** A delegate object that provides drop targets for pointer coordinates within the collection. */\n dropTargetDelegate?: DropTargetDelegate,\n /** A component that renders the root collection items. */\n CollectionRoot: React.ComponentType<CollectionRootProps>,\n /** A component that renders the child collection items. */\n CollectionBranch: React.ComponentType<CollectionBranchProps>\n}\n\nexport const DefaultCollectionRenderer: CollectionRenderer = {\n CollectionRoot({collection, renderDropIndicator}) {\n return useCollectionRender(collection, null, renderDropIndicator);\n },\n CollectionBranch({collection, parent, renderDropIndicator}) {\n return useCollectionRender(collection, parent, renderDropIndicator);\n }\n};\n\nfunction useCollectionRender(\n collection: ICollection<Node<unknown>>,\n parent: Node<unknown> | null,\n renderDropIndicator?: (target: ItemDropTarget) => ReactNode\n) {\n return useCachedChildren({\n items: parent ? collection.getChildren!(parent.key) : collection,\n dependencies: [renderDropIndicator],\n children(node) {\n let rendered = node.render!(node);\n if (!renderDropIndicator || node.type !== 'item') {\n return rendered;\n }\n\n return (\n <>\n {renderDropIndicator({type: 'item', key: node.key, dropPosition: 'before'})}\n {rendered}\n {renderAfterDropIndicators(collection, node, renderDropIndicator)}\n </>\n );\n }\n });\n}\n\nexport function renderAfterDropIndicators(collection: ICollection<Node<unknown>>, node: Node<unknown>, renderDropIndicator: (target: ItemDropTarget) => ReactNode): ReactNode {\n let key = node.key;\n let keyAfter = collection.getKeyAfter(key);\n let nextItemInFlattenedCollection = keyAfter != null ? collection.getItem(keyAfter) : null;\n while (nextItemInFlattenedCollection != null && nextItemInFlattenedCollection.type !== 'item') {\n keyAfter = collection.getKeyAfter(nextItemInFlattenedCollection.key);\n nextItemInFlattenedCollection = keyAfter != null ? collection.getItem(keyAfter) : null;\n }\n\n let nextItemInSameLevel = node.nextKey != null ? collection.getItem(node.nextKey) : null;\n while (nextItemInSameLevel != null && nextItemInSameLevel.type !== 'item') {\n nextItemInSameLevel = nextItemInSameLevel.nextKey != null ? collection.getItem(nextItemInSameLevel.nextKey) : null;\n }\n\n // Render one or more \"after\" drop indicators when the next item in the flattened collection\n // has a smaller level, is not an item, or there are no more items in the collection.\n // Otherwise, the \"after\" position is equivalent to the next item's \"before\" position.\n let afterIndicators: ReactNode[] = [];\n if (nextItemInSameLevel == null) {\n let current: Node<unknown> | null = node;\n while (current?.type === 'item' && (!nextItemInFlattenedCollection || (current.parentKey !== nextItemInFlattenedCollection.parentKey && nextItemInFlattenedCollection.level < current.level))) {\n let indicator = renderDropIndicator({\n type: 'item',\n key: current.key,\n dropPosition: 'after'\n });\n if (isValidElement(indicator)) {\n afterIndicators.push(cloneElement(indicator, {key: `${current.key}-after`}));\n }\n current = current.parentKey != null ? collection.getItem(current.parentKey) : null;\n }\n }\n\n return afterIndicators;\n}\n\nexport const CollectionRendererContext = createContext<CollectionRenderer>(DefaultCollectionRenderer);\n\ntype PersistedKeysReturnValue = Set<Key> | null;\nexport function usePersistedKeys(focusedKey: Key | null): PersistedKeysReturnValue {\n return useMemo(() => focusedKey != null ? new Set([focusedKey]) : null, [focusedKey]);\n}\n"],"names":[],"version":3,"file":"Collection.main.js.map"}
@@ -60,7 +60,7 @@ function $7135fc7d473fd974$export$2dbbd341daed716d(collection, node, renderDropI
60
60
  let afterIndicators = [];
61
61
  if (nextItemInSameLevel == null) {
62
62
  let current = node;
63
- while(current && (!nextItemInFlattenedCollection || current.parentKey !== nextItemInFlattenedCollection.parentKey && nextItemInFlattenedCollection.level < current.level)){
63
+ while((current === null || current === void 0 ? void 0 : current.type) === 'item' && (!nextItemInFlattenedCollection || current.parentKey !== nextItemInFlattenedCollection.parentKey && nextItemInFlattenedCollection.level < current.level)){
64
64
  let indicator = renderDropIndicator({
65
65
  type: 'item',
66
66
  key: current.key,
@@ -60,7 +60,7 @@ function $7135fc7d473fd974$export$2dbbd341daed716d(collection, node, renderDropI
60
60
  let afterIndicators = [];
61
61
  if (nextItemInSameLevel == null) {
62
62
  let current = node;
63
- while(current && (!nextItemInFlattenedCollection || current.parentKey !== nextItemInFlattenedCollection.parentKey && nextItemInFlattenedCollection.level < current.level)){
63
+ while((current === null || current === void 0 ? void 0 : current.type) === 'item' && (!nextItemInFlattenedCollection || current.parentKey !== nextItemInFlattenedCollection.parentKey && nextItemInFlattenedCollection.level < current.level)){
64
64
  let indicator = renderDropIndicator({
65
65
  type: 'item',
66
66
  key: current.key,