react-aria-components 1.4.1 → 1.6.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 (413) hide show
  1. package/README.md +1 -1
  2. package/dist/Autocomplete.main.js +80 -0
  3. package/dist/Autocomplete.main.js.map +1 -0
  4. package/dist/Autocomplete.mjs +68 -0
  5. package/dist/Autocomplete.module.js +68 -0
  6. package/dist/Autocomplete.module.js.map +1 -0
  7. package/dist/Breadcrumbs.main.js +4 -7
  8. package/dist/Breadcrumbs.main.js.map +1 -1
  9. package/dist/Breadcrumbs.mjs +5 -8
  10. package/dist/Breadcrumbs.module.js +5 -8
  11. package/dist/Breadcrumbs.module.js.map +1 -1
  12. package/dist/Button.main.js +5 -5
  13. package/dist/Button.main.js.map +1 -1
  14. package/dist/Button.mjs +5 -5
  15. package/dist/Button.module.js +5 -5
  16. package/dist/Button.module.js.map +1 -1
  17. package/dist/Calendar.main.js +29 -28
  18. package/dist/Calendar.main.js.map +1 -1
  19. package/dist/Calendar.mjs +30 -29
  20. package/dist/Calendar.module.js +30 -29
  21. package/dist/Calendar.module.js.map +1 -1
  22. package/dist/Checkbox.main.js +5 -12
  23. package/dist/Checkbox.main.js.map +1 -1
  24. package/dist/Checkbox.mjs +6 -13
  25. package/dist/Checkbox.module.js +6 -13
  26. package/dist/Checkbox.module.js.map +1 -1
  27. package/dist/Collection.main.js +3 -2
  28. package/dist/Collection.main.js.map +1 -1
  29. package/dist/Collection.mjs +3 -2
  30. package/dist/Collection.module.js +3 -2
  31. package/dist/Collection.module.js.map +1 -1
  32. package/dist/ColorArea.main.js +2 -5
  33. package/dist/ColorArea.main.js.map +1 -1
  34. package/dist/ColorArea.mjs +3 -6
  35. package/dist/ColorArea.module.js +3 -6
  36. package/dist/ColorArea.module.js.map +1 -1
  37. package/dist/ColorField.main.js +2 -5
  38. package/dist/ColorField.main.js.map +1 -1
  39. package/dist/ColorField.mjs +2 -5
  40. package/dist/ColorField.module.js +2 -5
  41. package/dist/ColorField.module.js.map +1 -1
  42. package/dist/ColorSlider.main.js +2 -5
  43. package/dist/ColorSlider.main.js.map +1 -1
  44. package/dist/ColorSlider.mjs +2 -5
  45. package/dist/ColorSlider.module.js +2 -5
  46. package/dist/ColorSlider.module.js.map +1 -1
  47. package/dist/ColorSwatch.main.js +2 -5
  48. package/dist/ColorSwatch.main.js.map +1 -1
  49. package/dist/ColorSwatch.mjs +2 -5
  50. package/dist/ColorSwatch.module.js +2 -5
  51. package/dist/ColorSwatch.module.js.map +1 -1
  52. package/dist/ColorSwatchPicker.main.js +4 -8
  53. package/dist/ColorSwatchPicker.main.js.map +1 -1
  54. package/dist/ColorSwatchPicker.mjs +5 -9
  55. package/dist/ColorSwatchPicker.module.js +5 -9
  56. package/dist/ColorSwatchPicker.module.js.map +1 -1
  57. package/dist/ColorThumb.main.js +2 -5
  58. package/dist/ColorThumb.main.js.map +1 -1
  59. package/dist/ColorThumb.mjs +3 -6
  60. package/dist/ColorThumb.module.js +3 -6
  61. package/dist/ColorThumb.module.js.map +1 -1
  62. package/dist/ColorWheel.main.js +5 -11
  63. package/dist/ColorWheel.main.js.map +1 -1
  64. package/dist/ColorWheel.mjs +6 -12
  65. package/dist/ColorWheel.module.js +6 -12
  66. package/dist/ColorWheel.module.js.map +1 -1
  67. package/dist/ComboBox.main.js +4 -7
  68. package/dist/ComboBox.main.js.map +1 -1
  69. package/dist/ComboBox.mjs +5 -8
  70. package/dist/ComboBox.module.js +5 -8
  71. package/dist/ComboBox.module.js.map +1 -1
  72. package/dist/DateField.main.js +8 -23
  73. package/dist/DateField.main.js.map +1 -1
  74. package/dist/DateField.mjs +9 -24
  75. package/dist/DateField.module.js +9 -24
  76. package/dist/DateField.module.js.map +1 -1
  77. package/dist/DatePicker.main.js +4 -11
  78. package/dist/DatePicker.main.js.map +1 -1
  79. package/dist/DatePicker.mjs +5 -12
  80. package/dist/DatePicker.module.js +5 -12
  81. package/dist/DatePicker.module.js.map +1 -1
  82. package/dist/Dialog.main.js +36 -15
  83. package/dist/Dialog.main.js.map +1 -1
  84. package/dist/Dialog.mjs +39 -18
  85. package/dist/Dialog.module.js +39 -18
  86. package/dist/Dialog.module.js.map +1 -1
  87. package/dist/Disclosure.main.js +8 -16
  88. package/dist/Disclosure.main.js.map +1 -1
  89. package/dist/Disclosure.mjs +8 -16
  90. package/dist/Disclosure.module.js +8 -16
  91. package/dist/Disclosure.module.js.map +1 -1
  92. package/dist/DragAndDrop.main.js +3 -6
  93. package/dist/DragAndDrop.main.js.map +1 -1
  94. package/dist/DragAndDrop.mjs +4 -7
  95. package/dist/DragAndDrop.module.js +4 -7
  96. package/dist/DragAndDrop.module.js.map +1 -1
  97. package/dist/DropZone.main.js +2 -5
  98. package/dist/DropZone.main.js.map +1 -1
  99. package/dist/DropZone.mjs +3 -6
  100. package/dist/DropZone.module.js +3 -6
  101. package/dist/DropZone.module.js.map +1 -1
  102. package/dist/FieldError.main.js +2 -5
  103. package/dist/FieldError.main.js.map +1 -1
  104. package/dist/FieldError.mjs +3 -6
  105. package/dist/FieldError.module.js +3 -6
  106. package/dist/FieldError.module.js.map +1 -1
  107. package/dist/FileTrigger.main.js +2 -5
  108. package/dist/FileTrigger.main.js.map +1 -1
  109. package/dist/FileTrigger.mjs +2 -5
  110. package/dist/FileTrigger.module.js +2 -5
  111. package/dist/FileTrigger.module.js.map +1 -1
  112. package/dist/Form.main.js +2 -6
  113. package/dist/Form.main.js.map +1 -1
  114. package/dist/Form.mjs +2 -6
  115. package/dist/Form.module.js +2 -6
  116. package/dist/Form.module.js.map +1 -1
  117. package/dist/GridList.main.js +3 -6
  118. package/dist/GridList.main.js.map +1 -1
  119. package/dist/GridList.mjs +4 -7
  120. package/dist/GridList.module.js +4 -7
  121. package/dist/GridList.module.js.map +1 -1
  122. package/dist/Group.main.js +2 -5
  123. package/dist/Group.main.js.map +1 -1
  124. package/dist/Group.mjs +2 -5
  125. package/dist/Group.module.js +2 -5
  126. package/dist/Group.module.js.map +1 -1
  127. package/dist/Heading.main.js +2 -3
  128. package/dist/Heading.main.js.map +1 -1
  129. package/dist/Heading.mjs +2 -3
  130. package/dist/Heading.module.js +2 -3
  131. package/dist/Heading.module.js.map +1 -1
  132. package/dist/Input.main.js +2 -5
  133. package/dist/Input.main.js.map +1 -1
  134. package/dist/Input.mjs +2 -5
  135. package/dist/Input.module.js +2 -5
  136. package/dist/Input.module.js.map +1 -1
  137. package/dist/Keyboard.main.js +2 -3
  138. package/dist/Keyboard.main.js.map +1 -1
  139. package/dist/Keyboard.mjs +2 -3
  140. package/dist/Keyboard.module.js +2 -3
  141. package/dist/Keyboard.module.js.map +1 -1
  142. package/dist/Label.main.js +2 -3
  143. package/dist/Label.main.js.map +1 -1
  144. package/dist/Label.mjs +2 -3
  145. package/dist/Label.module.js +2 -3
  146. package/dist/Label.module.js.map +1 -1
  147. package/dist/Link.main.js +2 -6
  148. package/dist/Link.main.js.map +1 -1
  149. package/dist/Link.mjs +2 -6
  150. package/dist/Link.module.js +2 -6
  151. package/dist/Link.module.js.map +1 -1
  152. package/dist/ListBox.main.js +25 -9
  153. package/dist/ListBox.main.js.map +1 -1
  154. package/dist/ListBox.mjs +28 -13
  155. package/dist/ListBox.module.js +28 -13
  156. package/dist/ListBox.module.js.map +1 -1
  157. package/dist/Menu.main.js +84 -65
  158. package/dist/Menu.main.js.map +1 -1
  159. package/dist/Menu.mjs +87 -69
  160. package/dist/Menu.module.js +87 -69
  161. package/dist/Menu.module.js.map +1 -1
  162. package/dist/Meter.main.js +2 -5
  163. package/dist/Meter.main.js.map +1 -1
  164. package/dist/Meter.mjs +2 -5
  165. package/dist/Meter.module.js +2 -5
  166. package/dist/Meter.module.js.map +1 -1
  167. package/dist/Modal.main.js +7 -10
  168. package/dist/Modal.main.js.map +1 -1
  169. package/dist/Modal.mjs +10 -13
  170. package/dist/Modal.module.js +10 -13
  171. package/dist/Modal.module.js.map +1 -1
  172. package/dist/NumberField.main.js +2 -5
  173. package/dist/NumberField.main.js.map +1 -1
  174. package/dist/NumberField.mjs +3 -6
  175. package/dist/NumberField.module.js +3 -6
  176. package/dist/NumberField.module.js.map +1 -1
  177. package/dist/OverlayArrow.main.js +3 -7
  178. package/dist/OverlayArrow.main.js.map +1 -1
  179. package/dist/OverlayArrow.mjs +3 -7
  180. package/dist/OverlayArrow.module.js +3 -7
  181. package/dist/OverlayArrow.module.js.map +1 -1
  182. package/dist/Popover.main.js +5 -7
  183. package/dist/Popover.main.js.map +1 -1
  184. package/dist/Popover.mjs +8 -10
  185. package/dist/Popover.module.js +8 -10
  186. package/dist/Popover.module.js.map +1 -1
  187. package/dist/ProgressBar.main.js +2 -6
  188. package/dist/ProgressBar.main.js.map +1 -1
  189. package/dist/ProgressBar.mjs +2 -6
  190. package/dist/ProgressBar.module.js +2 -6
  191. package/dist/ProgressBar.module.js.map +1 -1
  192. package/dist/RadioGroup.main.js +4 -10
  193. package/dist/RadioGroup.main.js.map +1 -1
  194. package/dist/RadioGroup.mjs +4 -10
  195. package/dist/RadioGroup.module.js +4 -10
  196. package/dist/RadioGroup.module.js.map +1 -1
  197. package/dist/SearchField.main.js +6 -8
  198. package/dist/SearchField.main.js.map +1 -1
  199. package/dist/SearchField.mjs +8 -10
  200. package/dist/SearchField.module.js +8 -10
  201. package/dist/SearchField.module.js.map +1 -1
  202. package/dist/Select.main.js +6 -12
  203. package/dist/Select.main.js.map +1 -1
  204. package/dist/Select.mjs +7 -13
  205. package/dist/Select.module.js +7 -13
  206. package/dist/Select.module.js.map +1 -1
  207. package/dist/Slider.main.js +8 -20
  208. package/dist/Slider.main.js.map +1 -1
  209. package/dist/Slider.mjs +9 -21
  210. package/dist/Slider.module.js +9 -21
  211. package/dist/Slider.module.js.map +1 -1
  212. package/dist/Switch.main.js +2 -5
  213. package/dist/Switch.main.js.map +1 -1
  214. package/dist/Switch.mjs +2 -5
  215. package/dist/Switch.module.js +2 -5
  216. package/dist/Switch.module.js.map +1 -1
  217. package/dist/Table.main.js +9 -22
  218. package/dist/Table.main.js.map +1 -1
  219. package/dist/Table.mjs +10 -23
  220. package/dist/Table.module.js +10 -23
  221. package/dist/Table.module.js.map +1 -1
  222. package/dist/Tabs.main.js +9 -17
  223. package/dist/Tabs.main.js.map +1 -1
  224. package/dist/Tabs.mjs +11 -19
  225. package/dist/Tabs.module.js +11 -19
  226. package/dist/Tabs.module.js.map +1 -1
  227. package/dist/TagGroup.main.js +4 -10
  228. package/dist/TagGroup.main.js.map +1 -1
  229. package/dist/TagGroup.mjs +5 -11
  230. package/dist/TagGroup.module.js +5 -11
  231. package/dist/TagGroup.module.js.map +1 -1
  232. package/dist/Text.main.js +2 -3
  233. package/dist/Text.main.js.map +1 -1
  234. package/dist/Text.mjs +2 -3
  235. package/dist/Text.module.js +2 -3
  236. package/dist/Text.module.js.map +1 -1
  237. package/dist/TextArea.main.js +2 -5
  238. package/dist/TextArea.main.js.map +1 -1
  239. package/dist/TextArea.mjs +2 -5
  240. package/dist/TextArea.module.js +2 -5
  241. package/dist/TextArea.module.js.map +1 -1
  242. package/dist/TextField.main.js +9 -9
  243. package/dist/TextField.main.js.map +1 -1
  244. package/dist/TextField.mjs +11 -11
  245. package/dist/TextField.module.js +11 -11
  246. package/dist/TextField.module.js.map +1 -1
  247. package/dist/ToggleButton.main.js +22 -10
  248. package/dist/ToggleButton.main.js.map +1 -1
  249. package/dist/ToggleButton.mjs +24 -12
  250. package/dist/ToggleButton.module.js +24 -12
  251. package/dist/ToggleButton.module.js.map +1 -1
  252. package/dist/ToggleButtonGroup.main.js +59 -0
  253. package/dist/ToggleButtonGroup.main.js.map +1 -0
  254. package/dist/ToggleButtonGroup.mjs +48 -0
  255. package/dist/ToggleButtonGroup.module.js +48 -0
  256. package/dist/ToggleButtonGroup.module.js.map +1 -0
  257. package/dist/Toolbar.main.js +2 -6
  258. package/dist/Toolbar.main.js.map +1 -1
  259. package/dist/Toolbar.mjs +2 -6
  260. package/dist/Toolbar.module.js +2 -6
  261. package/dist/Toolbar.module.js.map +1 -1
  262. package/dist/Tooltip.main.js +7 -9
  263. package/dist/Tooltip.main.js.map +1 -1
  264. package/dist/Tooltip.mjs +10 -12
  265. package/dist/Tooltip.module.js +10 -12
  266. package/dist/Tooltip.module.js.map +1 -1
  267. package/dist/Tree.main.js +2 -6
  268. package/dist/Tree.main.js.map +1 -1
  269. package/dist/Tree.mjs +3 -7
  270. package/dist/Tree.module.js +3 -7
  271. package/dist/Tree.module.js.map +1 -1
  272. package/dist/Virtualizer.main.js.map +1 -1
  273. package/dist/Virtualizer.module.js.map +1 -1
  274. package/dist/import.mjs +8 -4
  275. package/dist/main.js +16 -3
  276. package/dist/main.js.map +1 -1
  277. package/dist/module.js +8 -4
  278. package/dist/module.js.map +1 -1
  279. package/dist/types.d.ts +371 -324
  280. package/dist/types.d.ts.map +1 -1
  281. package/dist/utils.main.js +0 -61
  282. package/dist/utils.main.js.map +1 -1
  283. package/dist/utils.mjs +1 -60
  284. package/dist/utils.module.js +1 -60
  285. package/dist/utils.module.js.map +1 -1
  286. package/i18n/ar-AE.js +1 -1
  287. package/i18n/ar-AE.mjs +1 -1
  288. package/i18n/bg-BG.js +1 -1
  289. package/i18n/bg-BG.mjs +1 -1
  290. package/i18n/cs-CZ.js +1 -1
  291. package/i18n/cs-CZ.mjs +1 -1
  292. package/i18n/da-DK.js +1 -1
  293. package/i18n/da-DK.mjs +1 -1
  294. package/i18n/de-DE.js +1 -1
  295. package/i18n/de-DE.mjs +1 -1
  296. package/i18n/el-GR.js +1 -1
  297. package/i18n/el-GR.mjs +1 -1
  298. package/i18n/en-US.js +1 -1
  299. package/i18n/en-US.mjs +1 -1
  300. package/i18n/es-ES.js +1 -1
  301. package/i18n/es-ES.mjs +1 -1
  302. package/i18n/et-EE.js +1 -1
  303. package/i18n/et-EE.mjs +1 -1
  304. package/i18n/fi-FI.js +1 -1
  305. package/i18n/fi-FI.mjs +1 -1
  306. package/i18n/fr-FR.js +1 -1
  307. package/i18n/fr-FR.mjs +1 -1
  308. package/i18n/he-IL.js +1 -1
  309. package/i18n/he-IL.mjs +1 -1
  310. package/i18n/hr-HR.js +1 -1
  311. package/i18n/hr-HR.mjs +1 -1
  312. package/i18n/hu-HU.js +1 -1
  313. package/i18n/hu-HU.mjs +1 -1
  314. package/i18n/index.js +1 -1
  315. package/i18n/index.mjs +1 -1
  316. package/i18n/it-IT.js +1 -1
  317. package/i18n/it-IT.mjs +1 -1
  318. package/i18n/ja-JP.js +1 -1
  319. package/i18n/ja-JP.mjs +1 -1
  320. package/i18n/ko-KR.js +1 -1
  321. package/i18n/ko-KR.mjs +1 -1
  322. package/i18n/lt-LT.js +1 -1
  323. package/i18n/lt-LT.mjs +1 -1
  324. package/i18n/lv-LV.js +1 -1
  325. package/i18n/lv-LV.mjs +1 -1
  326. package/i18n/nb-NO.js +1 -1
  327. package/i18n/nb-NO.mjs +1 -1
  328. package/i18n/nl-NL.js +1 -1
  329. package/i18n/nl-NL.mjs +1 -1
  330. package/i18n/pl-PL.js +1 -1
  331. package/i18n/pl-PL.mjs +1 -1
  332. package/i18n/pt-BR.js +1 -1
  333. package/i18n/pt-BR.mjs +1 -1
  334. package/i18n/pt-PT.js +1 -1
  335. package/i18n/pt-PT.mjs +1 -1
  336. package/i18n/ro-RO.js +1 -1
  337. package/i18n/ro-RO.mjs +1 -1
  338. package/i18n/ru-RU.js +1 -1
  339. package/i18n/ru-RU.mjs +1 -1
  340. package/i18n/sk-SK.js +1 -1
  341. package/i18n/sk-SK.mjs +1 -1
  342. package/i18n/sl-SI.js +1 -1
  343. package/i18n/sl-SI.mjs +1 -1
  344. package/i18n/sr-SP.js +1 -1
  345. package/i18n/sr-SP.mjs +1 -1
  346. package/i18n/sv-SE.js +1 -1
  347. package/i18n/sv-SE.mjs +1 -1
  348. package/i18n/tr-TR.js +1 -1
  349. package/i18n/tr-TR.mjs +1 -1
  350. package/i18n/uk-UA.js +1 -1
  351. package/i18n/uk-UA.mjs +1 -1
  352. package/i18n/zh-CN.js +1 -1
  353. package/i18n/zh-CN.mjs +1 -1
  354. package/i18n/zh-TW.js +1 -1
  355. package/i18n/zh-TW.mjs +1 -1
  356. package/package.json +35 -33
  357. package/src/Autocomplete.tsx +71 -0
  358. package/src/Breadcrumbs.tsx +5 -8
  359. package/src/Button.tsx +8 -8
  360. package/src/Calendar.tsx +35 -39
  361. package/src/Checkbox.tsx +11 -17
  362. package/src/Collection.tsx +7 -4
  363. package/src/ColorArea.tsx +5 -8
  364. package/src/ColorField.tsx +5 -8
  365. package/src/ColorSlider.tsx +5 -8
  366. package/src/ColorSwatch.tsx +5 -8
  367. package/src/ColorSwatchPicker.tsx +7 -13
  368. package/src/ColorThumb.tsx +5 -8
  369. package/src/ColorWheel.tsx +10 -16
  370. package/src/ComboBox.tsx +5 -8
  371. package/src/DateField.tsx +21 -33
  372. package/src/DatePicker.tsx +9 -15
  373. package/src/Dialog.tsx +34 -22
  374. package/src/Disclosure.tsx +28 -29
  375. package/src/DragAndDrop.tsx +7 -10
  376. package/src/DropZone.tsx +5 -8
  377. package/src/FieldError.tsx +5 -8
  378. package/src/FileTrigger.tsx +5 -8
  379. package/src/Form.tsx +6 -9
  380. package/src/GridList.tsx +7 -9
  381. package/src/Group.tsx +5 -8
  382. package/src/Heading.tsx +2 -5
  383. package/src/Input.tsx +5 -8
  384. package/src/Keyboard.tsx +2 -5
  385. package/src/Label.tsx +2 -5
  386. package/src/Link.tsx +6 -9
  387. package/src/ListBox.tsx +24 -15
  388. package/src/Menu.tsx +88 -58
  389. package/src/Meter.tsx +5 -8
  390. package/src/Modal.tsx +7 -10
  391. package/src/NumberField.tsx +5 -8
  392. package/src/OverlayArrow.tsx +11 -12
  393. package/src/Popover.tsx +9 -12
  394. package/src/ProgressBar.tsx +6 -9
  395. package/src/RadioGroup.tsx +10 -16
  396. package/src/SearchField.tsx +9 -11
  397. package/src/Select.tsx +13 -18
  398. package/src/Slider.tsx +20 -32
  399. package/src/Switch.tsx +5 -8
  400. package/src/Table.tsx +12 -21
  401. package/src/Tabs.tsx +18 -25
  402. package/src/TagGroup.tsx +8 -14
  403. package/src/Text.tsx +2 -5
  404. package/src/TextArea.tsx +5 -7
  405. package/src/TextField.tsx +11 -13
  406. package/src/ToggleButton.tsx +31 -17
  407. package/src/ToggleButtonGroup.tsx +65 -0
  408. package/src/Toolbar.tsx +6 -9
  409. package/src/Tooltip.tsx +11 -13
  410. package/src/Tree.tsx +6 -9
  411. package/src/Virtualizer.tsx +2 -2
  412. package/src/index.ts +11 -7
  413. package/src/utils.tsx +0 -71
package/README.md CHANGED
@@ -7,7 +7,7 @@ Over 40 components with built-in behavior, adaptive interactions, top-tier acces
7
7
  * 🎨 **Styleable** – React Aria is style-free out of the box, allowing you to build custom designs to fit your application or design system using any styling and animation solution. Each component is broken down into individual parts with built-in states, render props, and slots that make styling a breeze.
8
8
  * 📱 **Adaptive** – React Aria ensures a great experience for users, no matter their device. All components are optimized for mouse, touch, keyboard, and screen reader interactions, with a meticulous attention to detail that makes your app feel responsive and natural on every platform.
9
9
  * ♿️ **Accessible** – React Aria is designed with accessibility as a top priority, and battle tested in production applications. All components are built to work across a wide variety of devices and assistive technologies to ensure the best experience possible for all users.
10
- * 🌍 **International** – React Aria is engineered for internationalization out of the box, including translations in over 30 languages, localized date and number formatting and parsing, support for 13 calendar systems, 3 numbering systems, right-to-left layout, and more.
10
+ * 🌍 **International** – React Aria is engineered for internationalization out of the box, including translations in over 30 languages, localized date and number formatting and parsing, support for 13 calendar systems, 5 numbering systems, right-to-left layout, and more.
11
11
  * ⚙️ **Customizable** – React Aria offers a flexible and scalable API that lets you dive as deep into the details as you like. Start with high-level components with a built-in DOM structure and simple styling API, compose custom patterns with contexts, and for the ultimate control, drop down to the low-level Hook-based API. Mix and match as needed.
12
12
 
13
13
  ## Documentation
@@ -0,0 +1,80 @@
1
+ var $c5ccf687772c0422$exports = require("./utils.main.js");
2
+ var $a83c69b310385d53$exports = require("./SearchField.main.js");
3
+ var $3f2c5af9d7d8905b$exports = require("./TextField.main.js");
4
+ var $5lGAV$reactariaautocomplete = require("@react-aria/autocomplete");
5
+ var $5lGAV$reactstatelyautocomplete = require("@react-stately/autocomplete");
6
+ var $5lGAV$reactariautils = require("@react-aria/utils");
7
+ var $5lGAV$react = require("react");
8
+
9
+
10
+ function $parcel$interopDefault(a) {
11
+ return a && a.__esModule ? a.default : a;
12
+ }
13
+
14
+ function $parcel$export(e, n, v, s) {
15
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
16
+ }
17
+
18
+ $parcel$export(module.exports, "UNSTABLE_AutocompleteContext", () => $33f48720060787fa$export$4581e569cc48eb6b);
19
+ $parcel$export(module.exports, "UNSTABLE_AutocompleteStateContext", () => $33f48720060787fa$export$879ad50d6ce9688);
20
+ $parcel$export(module.exports, "UNSTABLE_InternalAutocompleteContext", () => $33f48720060787fa$export$65d2a03b8800d6e3);
21
+ $parcel$export(module.exports, "UNSTABLE_Autocomplete", () => $33f48720060787fa$export$d834fde4e1147cd8);
22
+ /*
23
+ * Copyright 2024 Adobe. All rights reserved.
24
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
25
+ * you may not use this file except in compliance with the License. You may obtain a copy
26
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
27
+ *
28
+ * Unless required by applicable law or agreed to in writing, software distributed under
29
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
30
+ * OF ANY KIND, either express or implied. See the License for the specific language
31
+ * governing permissions and limitations under the License.
32
+ */
33
+
34
+
35
+
36
+
37
+
38
+
39
+ const $33f48720060787fa$export$4581e569cc48eb6b = /*#__PURE__*/ (0, $5lGAV$react.createContext)(null);
40
+ const $33f48720060787fa$export$879ad50d6ce9688 = /*#__PURE__*/ (0, $5lGAV$react.createContext)(null);
41
+ const $33f48720060787fa$export$65d2a03b8800d6e3 = /*#__PURE__*/ (0, $5lGAV$react.createContext)(null);
42
+ function $33f48720060787fa$export$d834fde4e1147cd8(props) {
43
+ let ctx = (0, $c5ccf687772c0422$exports.useSlottedContext)($33f48720060787fa$export$4581e569cc48eb6b, props.slot);
44
+ props = (0, $5lGAV$reactariautils.mergeProps)(ctx, props);
45
+ let { filter: filter } = props;
46
+ let state = (0, $5lGAV$reactstatelyautocomplete.UNSTABLE_useAutocompleteState)(props);
47
+ let collectionRef = (0, $5lGAV$react.useRef)(null);
48
+ let { textFieldProps: textFieldProps, collectionProps: collectionProps, collectionRef: mergedCollectionRef, filterFn: filterFn } = (0, $5lGAV$reactariaautocomplete.UNSTABLE_useAutocomplete)({
49
+ ...(0, $c5ccf687772c0422$exports.removeDataAttributes)(props),
50
+ filter: filter,
51
+ collectionRef: collectionRef
52
+ }, state);
53
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($5lGAV$react))).createElement((0, $c5ccf687772c0422$exports.Provider), {
54
+ values: [
55
+ [
56
+ $33f48720060787fa$export$879ad50d6ce9688,
57
+ state
58
+ ],
59
+ [
60
+ (0, $a83c69b310385d53$exports.SearchFieldContext),
61
+ textFieldProps
62
+ ],
63
+ [
64
+ (0, $3f2c5af9d7d8905b$exports.TextFieldContext),
65
+ textFieldProps
66
+ ],
67
+ [
68
+ $33f48720060787fa$export$65d2a03b8800d6e3,
69
+ {
70
+ filterFn: filterFn,
71
+ collectionProps: collectionProps,
72
+ collectionRef: mergedCollectionRef
73
+ }
74
+ ]
75
+ ]
76
+ }, props.children);
77
+ }
78
+
79
+
80
+ //# sourceMappingURL=Autocomplete.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAkBM,MAAM,0DAA+B,CAAA,GAAA,0BAAY,EAA0C;AAC3F,MAAM,yDAAoC,CAAA,GAAA,0BAAY,EAA4B;AAGlF,MAAM,0DAAuC,CAAA,GAAA,0BAAY,EAA2C;AAKpG,SAAS,0CAAsB,KAAwB;IAC5D,IAAI,MAAM,CAAA,GAAA,2CAAgB,EAAE,2CAA8B,MAAM,IAAI;IACpE,QAAQ,CAAA,GAAA,gCAAS,EAAE,KAAK;IACxB,IAAI,UAAC,MAAM,EAAC,GAAG;IACf,IAAI,QAAQ,CAAA,GAAA,6DAA4B,EAAE;IAC1C,IAAI,gBAAgB,CAAA,GAAA,mBAAK,EAAe;IAExC,IAAI,kBACF,cAAc,mBACd,eAAe,EACf,eAAe,mBAAmB,YAClC,QAAQ,EACT,GAAG,CAAA,GAAA,qDAAuB,EAAE;QAC3B,GAAG,CAAA,GAAA,8CAAmB,EAAE,MAAM;gBAC9B;uBACA;IACF,GAAG;IAEH,qBACE,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC;gBAAmC;aAAM;YAC1C;gBAAC,CAAA,GAAA,4CAAiB;gBAAG;aAAe;YACpC;gBAAC,CAAA,GAAA,0CAAe;gBAAG;aAAe;YAClC;gBAAC;gBAAsC;8BACrC;qCACA;oBACA,eAAe;gBACjB;aAAE;SACH;OACA,MAAM,QAAQ;AAGrB","sources":["packages/react-aria-components/src/Autocomplete.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 */\n\nimport {AriaAutocompleteProps, CollectionOptions, UNSTABLE_useAutocomplete} from '@react-aria/autocomplete';\nimport {AutocompleteState, UNSTABLE_useAutocompleteState} from '@react-stately/autocomplete';\nimport {mergeProps} from '@react-aria/utils';\nimport {Provider, removeDataAttributes, SlotProps, SlottedContextValue, useSlottedContext} from './utils';\nimport React, {createContext, RefObject, useRef} from 'react';\nimport {SearchFieldContext} from './SearchField';\nimport {TextFieldContext} from './TextField';\n\nexport interface AutocompleteProps extends AriaAutocompleteProps, SlotProps {}\n\ninterface InternalAutocompleteContextValue {\n filterFn?: (nodeTextValue: string) => boolean,\n collectionProps: CollectionOptions,\n collectionRef: RefObject<HTMLElement | null>\n}\n\nexport const UNSTABLE_AutocompleteContext = createContext<SlottedContextValue<AutocompleteProps>>(null);\nexport const UNSTABLE_AutocompleteStateContext = createContext<AutocompleteState | null>(null);\n// This context is to pass the register and filter down to whatever collection component is wrapped by the Autocomplete\n// TODO: export from RAC, but rename to something more appropriate\nexport const UNSTABLE_InternalAutocompleteContext = createContext<InternalAutocompleteContextValue | null>(null);\n\n/**\n * A autocomplete combines a text input with a menu, allowing users to filter a list of options to items matching a query.\n */\nexport function UNSTABLE_Autocomplete(props: AutocompleteProps) {\n let ctx = useSlottedContext(UNSTABLE_AutocompleteContext, props.slot);\n props = mergeProps(ctx, props);\n let {filter} = props;\n let state = UNSTABLE_useAutocompleteState(props);\n let collectionRef = useRef<HTMLElement>(null);\n\n let {\n textFieldProps,\n collectionProps,\n collectionRef: mergedCollectionRef,\n filterFn\n } = UNSTABLE_useAutocomplete({\n ...removeDataAttributes(props),\n filter,\n collectionRef\n }, state);\n\n return (\n <Provider\n values={[\n [UNSTABLE_AutocompleteStateContext, state],\n [SearchFieldContext, textFieldProps],\n [TextFieldContext, textFieldProps],\n [UNSTABLE_InternalAutocompleteContext, {\n filterFn,\n collectionProps,\n collectionRef: mergedCollectionRef\n }]\n ]}>\n {props.children}\n </Provider>\n );\n};\n"],"names":[],"version":3,"file":"Autocomplete.main.js.map"}
@@ -0,0 +1,68 @@
1
+ import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, removeDataAttributes as $64fa3d84918910a7$export$ef03459518577ad4, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.mjs";
2
+ import {SearchFieldContext as $440f4836bcb56932$export$d1c4e4c63cb03a11} from "./SearchField.mjs";
3
+ import {TextFieldContext as $bcdf0525bf22703d$export$2129e27b3ef0d483} from "./TextField.mjs";
4
+ import {UNSTABLE_useAutocomplete as $llkzs$UNSTABLE_useAutocomplete} from "@react-aria/autocomplete";
5
+ import {UNSTABLE_useAutocompleteState as $llkzs$UNSTABLE_useAutocompleteState} from "@react-stately/autocomplete";
6
+ import {mergeProps as $llkzs$mergeProps} from "@react-aria/utils";
7
+ import $llkzs$react, {createContext as $llkzs$createContext, useRef as $llkzs$useRef} from "react";
8
+
9
+ /*
10
+ * Copyright 2024 Adobe. All rights reserved.
11
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
12
+ * you may not use this file except in compliance with the License. You may obtain a copy
13
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software distributed under
16
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
17
+ * OF ANY KIND, either express or implied. See the License for the specific language
18
+ * governing permissions and limitations under the License.
19
+ */
20
+
21
+
22
+
23
+
24
+
25
+
26
+ const $d2f53cda644affe3$export$4581e569cc48eb6b = /*#__PURE__*/ (0, $llkzs$createContext)(null);
27
+ const $d2f53cda644affe3$export$879ad50d6ce9688 = /*#__PURE__*/ (0, $llkzs$createContext)(null);
28
+ const $d2f53cda644affe3$export$65d2a03b8800d6e3 = /*#__PURE__*/ (0, $llkzs$createContext)(null);
29
+ function $d2f53cda644affe3$export$d834fde4e1147cd8(props) {
30
+ let ctx = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)($d2f53cda644affe3$export$4581e569cc48eb6b, props.slot);
31
+ props = (0, $llkzs$mergeProps)(ctx, props);
32
+ let { filter: filter } = props;
33
+ let state = (0, $llkzs$UNSTABLE_useAutocompleteState)(props);
34
+ let collectionRef = (0, $llkzs$useRef)(null);
35
+ let { textFieldProps: textFieldProps, collectionProps: collectionProps, collectionRef: mergedCollectionRef, filterFn: filterFn } = (0, $llkzs$UNSTABLE_useAutocomplete)({
36
+ ...(0, $64fa3d84918910a7$export$ef03459518577ad4)(props),
37
+ filter: filter,
38
+ collectionRef: collectionRef
39
+ }, state);
40
+ return /*#__PURE__*/ (0, $llkzs$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {
41
+ values: [
42
+ [
43
+ $d2f53cda644affe3$export$879ad50d6ce9688,
44
+ state
45
+ ],
46
+ [
47
+ (0, $440f4836bcb56932$export$d1c4e4c63cb03a11),
48
+ textFieldProps
49
+ ],
50
+ [
51
+ (0, $bcdf0525bf22703d$export$2129e27b3ef0d483),
52
+ textFieldProps
53
+ ],
54
+ [
55
+ $d2f53cda644affe3$export$65d2a03b8800d6e3,
56
+ {
57
+ filterFn: filterFn,
58
+ collectionProps: collectionProps,
59
+ collectionRef: mergedCollectionRef
60
+ }
61
+ ]
62
+ ]
63
+ }, props.children);
64
+ }
65
+
66
+
67
+ export {$d2f53cda644affe3$export$4581e569cc48eb6b as UNSTABLE_AutocompleteContext, $d2f53cda644affe3$export$879ad50d6ce9688 as UNSTABLE_AutocompleteStateContext, $d2f53cda644affe3$export$65d2a03b8800d6e3 as UNSTABLE_InternalAutocompleteContext, $d2f53cda644affe3$export$d834fde4e1147cd8 as UNSTABLE_Autocomplete};
68
+ //# sourceMappingURL=Autocomplete.module.js.map
@@ -0,0 +1,68 @@
1
+ import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, removeDataAttributes as $64fa3d84918910a7$export$ef03459518577ad4, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.module.js";
2
+ import {SearchFieldContext as $440f4836bcb56932$export$d1c4e4c63cb03a11} from "./SearchField.module.js";
3
+ import {TextFieldContext as $bcdf0525bf22703d$export$2129e27b3ef0d483} from "./TextField.module.js";
4
+ import {UNSTABLE_useAutocomplete as $llkzs$UNSTABLE_useAutocomplete} from "@react-aria/autocomplete";
5
+ import {UNSTABLE_useAutocompleteState as $llkzs$UNSTABLE_useAutocompleteState} from "@react-stately/autocomplete";
6
+ import {mergeProps as $llkzs$mergeProps} from "@react-aria/utils";
7
+ import $llkzs$react, {createContext as $llkzs$createContext, useRef as $llkzs$useRef} from "react";
8
+
9
+ /*
10
+ * Copyright 2024 Adobe. All rights reserved.
11
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
12
+ * you may not use this file except in compliance with the License. You may obtain a copy
13
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software distributed under
16
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
17
+ * OF ANY KIND, either express or implied. See the License for the specific language
18
+ * governing permissions and limitations under the License.
19
+ */
20
+
21
+
22
+
23
+
24
+
25
+
26
+ const $d2f53cda644affe3$export$4581e569cc48eb6b = /*#__PURE__*/ (0, $llkzs$createContext)(null);
27
+ const $d2f53cda644affe3$export$879ad50d6ce9688 = /*#__PURE__*/ (0, $llkzs$createContext)(null);
28
+ const $d2f53cda644affe3$export$65d2a03b8800d6e3 = /*#__PURE__*/ (0, $llkzs$createContext)(null);
29
+ function $d2f53cda644affe3$export$d834fde4e1147cd8(props) {
30
+ let ctx = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)($d2f53cda644affe3$export$4581e569cc48eb6b, props.slot);
31
+ props = (0, $llkzs$mergeProps)(ctx, props);
32
+ let { filter: filter } = props;
33
+ let state = (0, $llkzs$UNSTABLE_useAutocompleteState)(props);
34
+ let collectionRef = (0, $llkzs$useRef)(null);
35
+ let { textFieldProps: textFieldProps, collectionProps: collectionProps, collectionRef: mergedCollectionRef, filterFn: filterFn } = (0, $llkzs$UNSTABLE_useAutocomplete)({
36
+ ...(0, $64fa3d84918910a7$export$ef03459518577ad4)(props),
37
+ filter: filter,
38
+ collectionRef: collectionRef
39
+ }, state);
40
+ return /*#__PURE__*/ (0, $llkzs$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {
41
+ values: [
42
+ [
43
+ $d2f53cda644affe3$export$879ad50d6ce9688,
44
+ state
45
+ ],
46
+ [
47
+ (0, $440f4836bcb56932$export$d1c4e4c63cb03a11),
48
+ textFieldProps
49
+ ],
50
+ [
51
+ (0, $bcdf0525bf22703d$export$2129e27b3ef0d483),
52
+ textFieldProps
53
+ ],
54
+ [
55
+ $d2f53cda644affe3$export$65d2a03b8800d6e3,
56
+ {
57
+ filterFn: filterFn,
58
+ collectionProps: collectionProps,
59
+ collectionRef: mergedCollectionRef
60
+ }
61
+ ]
62
+ ]
63
+ }, props.children);
64
+ }
65
+
66
+
67
+ export {$d2f53cda644affe3$export$4581e569cc48eb6b as UNSTABLE_AutocompleteContext, $d2f53cda644affe3$export$879ad50d6ce9688 as UNSTABLE_AutocompleteStateContext, $d2f53cda644affe3$export$65d2a03b8800d6e3 as UNSTABLE_InternalAutocompleteContext, $d2f53cda644affe3$export$d834fde4e1147cd8 as UNSTABLE_Autocomplete};
68
+ //# sourceMappingURL=Autocomplete.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAkBM,MAAM,0DAA+B,CAAA,GAAA,oBAAY,EAA0C;AAC3F,MAAM,yDAAoC,CAAA,GAAA,oBAAY,EAA4B;AAGlF,MAAM,0DAAuC,CAAA,GAAA,oBAAY,EAA2C;AAKpG,SAAS,0CAAsB,KAAwB;IAC5D,IAAI,MAAM,CAAA,GAAA,yCAAgB,EAAE,2CAA8B,MAAM,IAAI;IACpE,QAAQ,CAAA,GAAA,iBAAS,EAAE,KAAK;IACxB,IAAI,UAAC,MAAM,EAAC,GAAG;IACf,IAAI,QAAQ,CAAA,GAAA,oCAA4B,EAAE;IAC1C,IAAI,gBAAgB,CAAA,GAAA,aAAK,EAAe;IAExC,IAAI,kBACF,cAAc,mBACd,eAAe,EACf,eAAe,mBAAmB,YAClC,QAAQ,EACT,GAAG,CAAA,GAAA,+BAAuB,EAAE;QAC3B,GAAG,CAAA,GAAA,yCAAmB,EAAE,MAAM;gBAC9B;uBACA;IACF,GAAG;IAEH,qBACE,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC;gBAAmC;aAAM;YAC1C;gBAAC,CAAA,GAAA,yCAAiB;gBAAG;aAAe;YACpC;gBAAC,CAAA,GAAA,yCAAe;gBAAG;aAAe;YAClC;gBAAC;gBAAsC;8BACrC;qCACA;oBACA,eAAe;gBACjB;aAAE;SACH;OACA,MAAM,QAAQ;AAGrB","sources":["packages/react-aria-components/src/Autocomplete.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 */\n\nimport {AriaAutocompleteProps, CollectionOptions, UNSTABLE_useAutocomplete} from '@react-aria/autocomplete';\nimport {AutocompleteState, UNSTABLE_useAutocompleteState} from '@react-stately/autocomplete';\nimport {mergeProps} from '@react-aria/utils';\nimport {Provider, removeDataAttributes, SlotProps, SlottedContextValue, useSlottedContext} from './utils';\nimport React, {createContext, RefObject, useRef} from 'react';\nimport {SearchFieldContext} from './SearchField';\nimport {TextFieldContext} from './TextField';\n\nexport interface AutocompleteProps extends AriaAutocompleteProps, SlotProps {}\n\ninterface InternalAutocompleteContextValue {\n filterFn?: (nodeTextValue: string) => boolean,\n collectionProps: CollectionOptions,\n collectionRef: RefObject<HTMLElement | null>\n}\n\nexport const UNSTABLE_AutocompleteContext = createContext<SlottedContextValue<AutocompleteProps>>(null);\nexport const UNSTABLE_AutocompleteStateContext = createContext<AutocompleteState | null>(null);\n// This context is to pass the register and filter down to whatever collection component is wrapped by the Autocomplete\n// TODO: export from RAC, but rename to something more appropriate\nexport const UNSTABLE_InternalAutocompleteContext = createContext<InternalAutocompleteContextValue | null>(null);\n\n/**\n * A autocomplete combines a text input with a menu, allowing users to filter a list of options to items matching a query.\n */\nexport function UNSTABLE_Autocomplete(props: AutocompleteProps) {\n let ctx = useSlottedContext(UNSTABLE_AutocompleteContext, props.slot);\n props = mergeProps(ctx, props);\n let {filter} = props;\n let state = UNSTABLE_useAutocompleteState(props);\n let collectionRef = useRef<HTMLElement>(null);\n\n let {\n textFieldProps,\n collectionProps,\n collectionRef: mergedCollectionRef,\n filterFn\n } = UNSTABLE_useAutocomplete({\n ...removeDataAttributes(props),\n filter,\n collectionRef\n }, state);\n\n return (\n <Provider\n values={[\n [UNSTABLE_AutocompleteStateContext, state],\n [SearchFieldContext, textFieldProps],\n [TextFieldContext, textFieldProps],\n [UNSTABLE_InternalAutocompleteContext, {\n filterFn,\n collectionProps,\n collectionRef: mergedCollectionRef\n }]\n ]}>\n {props.children}\n </Provider>\n );\n};\n"],"names":[],"version":3,"file":"Autocomplete.module.js.map"}
@@ -36,15 +36,15 @@ $parcel$export(module.exports, "Breadcrumb", () => $afa44b644f65ed30$export$dabc
36
36
 
37
37
 
38
38
  const $afa44b644f65ed30$export$65596d3621b0a4a0 = /*#__PURE__*/ (0, $l7mU3$react.createContext)(null);
39
- function $afa44b644f65ed30$var$Breadcrumbs(props, ref) {
39
+ const $afa44b644f65ed30$export$2dc68d50d56fbbd = /*#__PURE__*/ (0, $l7mU3$react.forwardRef)(function Breadcrumbs(props, ref) {
40
40
  [props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $afa44b644f65ed30$export$65596d3621b0a4a0);
41
41
  let { CollectionRoot: CollectionRoot } = (0, $l7mU3$react.useContext)((0, $3114c2382242bdc0$exports.CollectionRendererContext));
42
42
  let { navProps: navProps } = (0, $l7mU3$reactaria.useBreadcrumbs)(props);
43
43
  return /*#__PURE__*/ (0, ($parcel$interopDefault($l7mU3$react))).createElement((0, $l7mU3$reactariacollections.CollectionBuilder), {
44
44
  content: /*#__PURE__*/ (0, ($parcel$interopDefault($l7mU3$react))).createElement((0, $l7mU3$reactariacollections.Collection), props)
45
- }, (collection)=>/*#__PURE__*/ {
45
+ }, (collection)=>{
46
46
  var _props_className;
47
- return (0, ($parcel$interopDefault($l7mU3$react))).createElement("ol", {
47
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($l7mU3$react))).createElement("ol", {
48
48
  ref: ref,
49
49
  ...navProps,
50
50
  slot: props.slot || undefined,
@@ -56,10 +56,7 @@ function $afa44b644f65ed30$var$Breadcrumbs(props, ref) {
56
56
  collection: collection
57
57
  })));
58
58
  });
59
- }
60
- /**
61
- * Breadcrumbs display a hierarchy of links to the current page or resource in an application.
62
- */ const $afa44b644f65ed30$export$2dc68d50d56fbbd = /*#__PURE__*/ (0, $l7mU3$react.forwardRef)($afa44b644f65ed30$var$Breadcrumbs);
59
+ });
63
60
  const $afa44b644f65ed30$export$dabcc1ec9dd9d1cc = /*#__PURE__*/ (0, $l7mU3$reactariacollections.createLeafComponent)('item', function Breadcrumb(props, ref, node) {
64
61
  // Recreating useBreadcrumbItem because we want to use composition instead of having the link builtin.
65
62
  let isCurrent = node.nextKey == null;
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAkBM,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAAyD;AAEvG,SAAS,kCAA8B,KAA0B,EAAE,GAAmC;IACpG,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,mDAAwB;IAC1D,IAAI,YAAC,QAAQ,EAAC,GAAG,CAAA,GAAA,+BAAa,EAAE;IAEhC,qBACE,0DAAC,CAAA,GAAA,6CAAgB;QAAE,uBAAS,0DAAC,CAAA,GAAA,sCAAS,GAAM;OACzC,CAAA;YAMc;eALb,0DAAC;YACC,KAAK;YACJ,GAAG,QAAQ;YACZ,MAAM,MAAM,IAAI,IAAI;YACpB,OAAO,MAAM,KAAK;YAClB,WAAW,CAAA,mBAAA,MAAM,SAAS,cAAf,8BAAA,mBAAmB;yBAC9B,0DAAC,0CAAmB,QAAQ;YAAC,OAAO;yBAClC,0DAAC;YAAe,YAAY;;IAE5B;AAIZ;AAEA;;CAEC,GACD,MAAM,2CAA6B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB;AAwB3D,MAAM,4CAAa,WAAW,GAAG,CAAA,GAAA,+CAAkB,EAAE,QAAQ,SAAS,WAAW,KAAsB,EAAE,GAAgC,EAAE,IAAmB;IACnK,sGAAsG;IACtG,IAAI,YAAY,KAAK,OAAO,IAAI;IAChC,IAAI,cAAC,UAAU,YAAE,QAAQ,EAAC,GAAG,CAAA,GAAA,2CAAgB,EAAE;IAC/C,IAAI,YAAY;QACd,gBAAgB,YAAY,SAAS;QACrC,YAAY,cAAc;QAC1B,SAAS,IAAM,qBAAA,+BAAA,SAAW,KAAK,GAAG;IACpC;IAEA,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK,KAAK;QACb,UAAU,KAAK,QAAQ;QACvB,QAAQ;YAAC,YAAY,cAAc;uBAAW;QAAS;QACvD,kBAAkB;IACpB;IAEA,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,oCAAa,EAAE,MAAa;QAC/B,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,cAAc,aAAa;QAC1C,gBAAc,aAAa;qBAC3B,0DAAC,CAAA,GAAA,qCAAU,EAAE,QAAQ;QAAC,OAAO;OAC1B,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Breadcrumbs.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 {AriaBreadcrumbsProps, useBreadcrumbs} from 'react-aria';\nimport {Collection, CollectionBuilder, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext} from './Collection';\nimport {ContextValue, RenderProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType, Key} from '@react-types/shared';\nimport {LinkContext} from './Link';\nimport {Node} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\n\nexport interface BreadcrumbsProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'>, AriaBreadcrumbsProps, StyleProps, SlotProps {\n /** Whether the breadcrumbs are disabled. */\n isDisabled?: boolean,\n /** Handler that is called when a breadcrumb is clicked. */\n onAction?: (key: Key) => void\n}\n\nexport const BreadcrumbsContext = createContext<ContextValue<BreadcrumbsProps<any>, HTMLOListElement>>(null);\n\nfunction Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: ForwardedRef<HTMLOListElement>) {\n [props, ref] = useContextProps(props, ref, BreadcrumbsContext);\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let {navProps} = useBreadcrumbs(props);\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => (\n <ol\n ref={ref}\n {...navProps}\n slot={props.slot || undefined}\n style={props.style}\n className={props.className ?? 'react-aria-Breadcrumbs'}>\n <BreadcrumbsContext.Provider value={props}>\n <CollectionRoot collection={collection} />\n </BreadcrumbsContext.Provider>\n </ol>\n )}\n </CollectionBuilder>\n );\n}\n\n/**\n * Breadcrumbs display a hierarchy of links to the current page or resource in an application.\n */\nconst _Breadcrumbs = /*#__PURE__*/ (forwardRef as forwardRefType)(Breadcrumbs);\nexport {_Breadcrumbs as Breadcrumbs};\n\nexport interface BreadcrumbRenderProps {\n /**\n * Whether the breadcrumb is for the current page.\n * @selector [data-current]\n */\n isCurrent: boolean,\n /**\n * Whether the breadcrumb is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface BreadcrumbProps extends RenderProps<BreadcrumbRenderProps> {\n /** A unique id for the breadcrumb, which will be passed to `onAction` when the breadcrumb is pressed. */\n id?: Key\n}\n\n/**\n * A Breadcrumb represents an individual item in a `<Breadcrumbs>` list.\n */\nexport const Breadcrumb = /*#__PURE__*/ createLeafComponent('item', function Breadcrumb(props: BreadcrumbProps, ref: ForwardedRef<HTMLLIElement>, node: Node<unknown>) {\n // Recreating useBreadcrumbItem because we want to use composition instead of having the link builtin.\n let isCurrent = node.nextKey == null;\n let {isDisabled, onAction} = useSlottedContext(BreadcrumbsContext)!;\n let linkProps = {\n 'aria-current': isCurrent ? 'page' : null,\n isDisabled: isDisabled || isCurrent,\n onPress: () => onAction?.(node.key)\n };\n\n let renderProps = useRenderProps({\n ...node.props,\n children: node.rendered,\n values: {isDisabled: isDisabled || isCurrent, isCurrent},\n defaultClassName: 'react-aria-Breadcrumb'\n });\n\n return (\n <li\n {...filterDOMProps(props as any)}\n {...renderProps}\n ref={ref}\n data-disabled={isDisabled || isCurrent || undefined}\n data-current={isCurrent || undefined}>\n <LinkContext.Provider value={linkProps}>\n {renderProps.children}\n </LinkContext.Provider>\n </li>\n );\n});\n"],"names":[],"version":3,"file":"Breadcrumbs.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAkBM,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAAyD;AAKhG,MAAM,2CAA4B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,YAA8B,KAA0B,EAAE,GAAmC;IAC5K,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GAA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\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 {AriaBreadcrumbsProps, useBreadcrumbs} from 'react-aria';\nimport {Collection, CollectionBuilder, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext} from './Collection';\nimport {ContextValue, RenderProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType, Key} from '@react-types/shared';\nimport {LinkContext} from './Link';\nimport {Node} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\n\nexport interface BreadcrumbsProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'>, AriaBreadcrumbsProps, StyleProps, SlotProps {\n /** Whether the breadcrumbs are disabled. */\n isDisabled?: boolean,\n /** Handler that is called when a breadcrumb is clicked. */\n onAction?: (key: Key) => void\n}\n\nexport const BreadcrumbsContext = createContext<ContextValue<BreadcrumbsProps<any>, HTMLOListElement>>(null);\n\n/**\n * Breadcrumbs display a hierarchy of links to the current page or resource in an application.\n */\nexport const Breadcrumbs = /*#__PURE__*/ (forwardRef as forwardRefType)(function Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: ForwardedRef<HTMLOListElement>) {\n [props, ref] = useContextProps(props, ref, BreadcrumbsContext);\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let {navProps} = useBreadcrumbs(props);\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => (\n <ol\n ref={ref}\n {...navProps}\n slot={props.slot || undefined}\n style={props.style}\n className={props.className ?? 'react-aria-Breadcrumbs'}>\n <BreadcrumbsContext.Provider value={props}>\n <CollectionRoot collection={collection} />\n </BreadcrumbsContext.Provider>\n </ol>\n )}\n </CollectionBuilder>\n );\n});\n\nexport interface BreadcrumbRenderProps {\n /**\n * Whether the breadcrumb is for the current page.\n * @selector [data-current]\n */\n isCurrent: boolean,\n /**\n * Whether the breadcrumb is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface BreadcrumbProps extends RenderProps<BreadcrumbRenderProps> {\n /** A unique id for the breadcrumb, which will be passed to `onAction` when the breadcrumb is pressed. */\n id?: Key\n}\n\n/**\n * A Breadcrumb represents an individual item in a `<Breadcrumbs>` list.\n */\nexport const Breadcrumb = /*#__PURE__*/ createLeafComponent('item', function Breadcrumb(props: BreadcrumbProps, ref: ForwardedRef<HTMLLIElement>, node: Node<unknown>) {\n // Recreating useBreadcrumbItem because we want to use composition instead of having the link builtin.\n let isCurrent = node.nextKey == null;\n let {isDisabled, onAction} = useSlottedContext(BreadcrumbsContext)!;\n let linkProps = {\n 'aria-current': isCurrent ? 'page' : null,\n isDisabled: isDisabled || isCurrent,\n onPress: () => onAction?.(node.key)\n };\n\n let renderProps = useRenderProps({\n ...node.props,\n children: node.rendered,\n values: {isDisabled: isDisabled || isCurrent, isCurrent},\n defaultClassName: 'react-aria-Breadcrumb'\n });\n\n return (\n <li\n {...filterDOMProps(props as any)}\n {...renderProps}\n ref={ref}\n data-disabled={isDisabled || isCurrent || undefined}\n data-current={isCurrent || undefined}>\n <LinkContext.Provider value={linkProps}>\n {renderProps.children}\n </LinkContext.Provider>\n </li>\n );\n});\n"],"names":[],"version":3,"file":"Breadcrumbs.main.js.map"}
@@ -4,7 +4,7 @@ import {LinkContext as $4f118338184dc1d9$export$e2509388b49734e7} from "./Link.m
4
4
  import {useBreadcrumbs as $c5cc5$useBreadcrumbs} from "react-aria";
5
5
  import {CollectionBuilder as $c5cc5$CollectionBuilder, Collection as $c5cc5$Collection, createLeafComponent as $c5cc5$createLeafComponent} from "@react-aria/collections";
6
6
  import {filterDOMProps as $c5cc5$filterDOMProps} from "@react-aria/utils";
7
- import $c5cc5$react, {createContext as $c5cc5$createContext, useContext as $c5cc5$useContext, forwardRef as $c5cc5$forwardRef} from "react";
7
+ import $c5cc5$react, {createContext as $c5cc5$createContext, forwardRef as $c5cc5$forwardRef, useContext as $c5cc5$useContext} from "react";
8
8
 
9
9
  /*
10
10
  * Copyright 2022 Adobe. All rights reserved.
@@ -24,15 +24,15 @@ import $c5cc5$react, {createContext as $c5cc5$createContext, useContext as $c5cc
24
24
 
25
25
 
26
26
  const $778035c5624f61e7$export$65596d3621b0a4a0 = /*#__PURE__*/ (0, $c5cc5$createContext)(null);
27
- function $778035c5624f61e7$var$Breadcrumbs(props, ref) {
27
+ const $778035c5624f61e7$export$2dc68d50d56fbbd = /*#__PURE__*/ (0, $c5cc5$forwardRef)(function Breadcrumbs(props, ref) {
28
28
  [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $778035c5624f61e7$export$65596d3621b0a4a0);
29
29
  let { CollectionRoot: CollectionRoot } = (0, $c5cc5$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
30
30
  let { navProps: navProps } = (0, $c5cc5$useBreadcrumbs)(props);
31
31
  return /*#__PURE__*/ (0, $c5cc5$react).createElement((0, $c5cc5$CollectionBuilder), {
32
32
  content: /*#__PURE__*/ (0, $c5cc5$react).createElement((0, $c5cc5$Collection), props)
33
- }, (collection)=>/*#__PURE__*/ {
33
+ }, (collection)=>{
34
34
  var _props_className;
35
- return (0, $c5cc5$react).createElement("ol", {
35
+ return /*#__PURE__*/ (0, $c5cc5$react).createElement("ol", {
36
36
  ref: ref,
37
37
  ...navProps,
38
38
  slot: props.slot || undefined,
@@ -44,10 +44,7 @@ function $778035c5624f61e7$var$Breadcrumbs(props, ref) {
44
44
  collection: collection
45
45
  })));
46
46
  });
47
- }
48
- /**
49
- * Breadcrumbs display a hierarchy of links to the current page or resource in an application.
50
- */ const $778035c5624f61e7$export$2dc68d50d56fbbd = /*#__PURE__*/ (0, $c5cc5$forwardRef)($778035c5624f61e7$var$Breadcrumbs);
47
+ });
51
48
  const $778035c5624f61e7$export$dabcc1ec9dd9d1cc = /*#__PURE__*/ (0, $c5cc5$createLeafComponent)('item', function Breadcrumb(props, ref, node) {
52
49
  // Recreating useBreadcrumbItem because we want to use composition instead of having the link builtin.
53
50
  let isCurrent = node.nextKey == null;
@@ -4,7 +4,7 @@ import {LinkContext as $4f118338184dc1d9$export$e2509388b49734e7} from "./Link.m
4
4
  import {useBreadcrumbs as $c5cc5$useBreadcrumbs} from "react-aria";
5
5
  import {CollectionBuilder as $c5cc5$CollectionBuilder, Collection as $c5cc5$Collection, createLeafComponent as $c5cc5$createLeafComponent} from "@react-aria/collections";
6
6
  import {filterDOMProps as $c5cc5$filterDOMProps} from "@react-aria/utils";
7
- import $c5cc5$react, {createContext as $c5cc5$createContext, useContext as $c5cc5$useContext, forwardRef as $c5cc5$forwardRef} from "react";
7
+ import $c5cc5$react, {createContext as $c5cc5$createContext, forwardRef as $c5cc5$forwardRef, useContext as $c5cc5$useContext} from "react";
8
8
 
9
9
  /*
10
10
  * Copyright 2022 Adobe. All rights reserved.
@@ -24,15 +24,15 @@ import $c5cc5$react, {createContext as $c5cc5$createContext, useContext as $c5cc
24
24
 
25
25
 
26
26
  const $778035c5624f61e7$export$65596d3621b0a4a0 = /*#__PURE__*/ (0, $c5cc5$createContext)(null);
27
- function $778035c5624f61e7$var$Breadcrumbs(props, ref) {
27
+ const $778035c5624f61e7$export$2dc68d50d56fbbd = /*#__PURE__*/ (0, $c5cc5$forwardRef)(function Breadcrumbs(props, ref) {
28
28
  [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $778035c5624f61e7$export$65596d3621b0a4a0);
29
29
  let { CollectionRoot: CollectionRoot } = (0, $c5cc5$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
30
30
  let { navProps: navProps } = (0, $c5cc5$useBreadcrumbs)(props);
31
31
  return /*#__PURE__*/ (0, $c5cc5$react).createElement((0, $c5cc5$CollectionBuilder), {
32
32
  content: /*#__PURE__*/ (0, $c5cc5$react).createElement((0, $c5cc5$Collection), props)
33
- }, (collection)=>/*#__PURE__*/ {
33
+ }, (collection)=>{
34
34
  var _props_className;
35
- return (0, $c5cc5$react).createElement("ol", {
35
+ return /*#__PURE__*/ (0, $c5cc5$react).createElement("ol", {
36
36
  ref: ref,
37
37
  ...navProps,
38
38
  slot: props.slot || undefined,
@@ -44,10 +44,7 @@ function $778035c5624f61e7$var$Breadcrumbs(props, ref) {
44
44
  collection: collection
45
45
  })));
46
46
  });
47
- }
48
- /**
49
- * Breadcrumbs display a hierarchy of links to the current page or resource in an application.
50
- */ const $778035c5624f61e7$export$2dc68d50d56fbbd = /*#__PURE__*/ (0, $c5cc5$forwardRef)($778035c5624f61e7$var$Breadcrumbs);
47
+ });
51
48
  const $778035c5624f61e7$export$dabcc1ec9dd9d1cc = /*#__PURE__*/ (0, $c5cc5$createLeafComponent)('item', function Breadcrumb(props, ref, node) {
52
49
  // Recreating useBreadcrumbItem because we want to use composition instead of having the link builtin.
53
50
  let isCurrent = node.nextKey == null;
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAkBM,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAAyD;AAEvG,SAAS,kCAA8B,KAA0B,EAAE,GAAmC;IACpG,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAwB;IAC1D,IAAI,YAAC,QAAQ,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE;IAEhC,qBACE,gCAAC,CAAA,GAAA,wBAAgB;QAAE,uBAAS,gCAAC,CAAA,GAAA,iBAAS,GAAM;OACzC,CAAA;YAMc;eALb,gCAAC;YACC,KAAK;YACJ,GAAG,QAAQ;YACZ,MAAM,MAAM,IAAI,IAAI;YACpB,OAAO,MAAM,KAAK;YAClB,WAAW,CAAA,mBAAA,MAAM,SAAS,cAAf,8BAAA,mBAAmB;yBAC9B,gCAAC,0CAAmB,QAAQ;YAAC,OAAO;yBAClC,gCAAC;YAAe,YAAY;;IAE5B;AAIZ;AAEA;;CAEC,GACD,MAAM,2CAA6B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB;AAwB3D,MAAM,4CAAa,WAAW,GAAG,CAAA,GAAA,0BAAkB,EAAE,QAAQ,SAAS,WAAW,KAAsB,EAAE,GAAgC,EAAE,IAAmB;IACnK,sGAAsG;IACtG,IAAI,YAAY,KAAK,OAAO,IAAI;IAChC,IAAI,cAAC,UAAU,YAAE,QAAQ,EAAC,GAAG,CAAA,GAAA,yCAAgB,EAAE;IAC/C,IAAI,YAAY;QACd,gBAAgB,YAAY,SAAS;QACrC,YAAY,cAAc;QAC1B,SAAS,IAAM,qBAAA,+BAAA,SAAW,KAAK,GAAG;IACpC;IAEA,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK,KAAK;QACb,UAAU,KAAK,QAAQ;QACvB,QAAQ;YAAC,YAAY,cAAc;uBAAW;QAAS;QACvD,kBAAkB;IACpB;IAEA,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,qBAAa,EAAE,MAAa;QAC/B,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,cAAc,aAAa;QAC1C,gBAAc,aAAa;qBAC3B,gCAAC,CAAA,GAAA,yCAAU,EAAE,QAAQ;QAAC,OAAO;OAC1B,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Breadcrumbs.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 {AriaBreadcrumbsProps, useBreadcrumbs} from 'react-aria';\nimport {Collection, CollectionBuilder, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext} from './Collection';\nimport {ContextValue, RenderProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType, Key} from '@react-types/shared';\nimport {LinkContext} from './Link';\nimport {Node} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\n\nexport interface BreadcrumbsProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'>, AriaBreadcrumbsProps, StyleProps, SlotProps {\n /** Whether the breadcrumbs are disabled. */\n isDisabled?: boolean,\n /** Handler that is called when a breadcrumb is clicked. */\n onAction?: (key: Key) => void\n}\n\nexport const BreadcrumbsContext = createContext<ContextValue<BreadcrumbsProps<any>, HTMLOListElement>>(null);\n\nfunction Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: ForwardedRef<HTMLOListElement>) {\n [props, ref] = useContextProps(props, ref, BreadcrumbsContext);\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let {navProps} = useBreadcrumbs(props);\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => (\n <ol\n ref={ref}\n {...navProps}\n slot={props.slot || undefined}\n style={props.style}\n className={props.className ?? 'react-aria-Breadcrumbs'}>\n <BreadcrumbsContext.Provider value={props}>\n <CollectionRoot collection={collection} />\n </BreadcrumbsContext.Provider>\n </ol>\n )}\n </CollectionBuilder>\n );\n}\n\n/**\n * Breadcrumbs display a hierarchy of links to the current page or resource in an application.\n */\nconst _Breadcrumbs = /*#__PURE__*/ (forwardRef as forwardRefType)(Breadcrumbs);\nexport {_Breadcrumbs as Breadcrumbs};\n\nexport interface BreadcrumbRenderProps {\n /**\n * Whether the breadcrumb is for the current page.\n * @selector [data-current]\n */\n isCurrent: boolean,\n /**\n * Whether the breadcrumb is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface BreadcrumbProps extends RenderProps<BreadcrumbRenderProps> {\n /** A unique id for the breadcrumb, which will be passed to `onAction` when the breadcrumb is pressed. */\n id?: Key\n}\n\n/**\n * A Breadcrumb represents an individual item in a `<Breadcrumbs>` list.\n */\nexport const Breadcrumb = /*#__PURE__*/ createLeafComponent('item', function Breadcrumb(props: BreadcrumbProps, ref: ForwardedRef<HTMLLIElement>, node: Node<unknown>) {\n // Recreating useBreadcrumbItem because we want to use composition instead of having the link builtin.\n let isCurrent = node.nextKey == null;\n let {isDisabled, onAction} = useSlottedContext(BreadcrumbsContext)!;\n let linkProps = {\n 'aria-current': isCurrent ? 'page' : null,\n isDisabled: isDisabled || isCurrent,\n onPress: () => onAction?.(node.key)\n };\n\n let renderProps = useRenderProps({\n ...node.props,\n children: node.rendered,\n values: {isDisabled: isDisabled || isCurrent, isCurrent},\n defaultClassName: 'react-aria-Breadcrumb'\n });\n\n return (\n <li\n {...filterDOMProps(props as any)}\n {...renderProps}\n ref={ref}\n data-disabled={isDisabled || isCurrent || undefined}\n data-current={isCurrent || undefined}>\n <LinkContext.Provider value={linkProps}>\n {renderProps.children}\n </LinkContext.Provider>\n </li>\n );\n});\n"],"names":[],"version":3,"file":"Breadcrumbs.module.js.map"}
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAkBM,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAAyD;AAKhG,MAAM,2CAA4B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,YAA8B,KAA0B,EAAE,GAAmC;IAC5K,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,kBAAC,cAAc,EAA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"],"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 {AriaBreadcrumbsProps, useBreadcrumbs} from 'react-aria';\nimport {Collection, CollectionBuilder, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext} from './Collection';\nimport {ContextValue, RenderProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType, Key} from '@react-types/shared';\nimport {LinkContext} from './Link';\nimport {Node} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\n\nexport interface BreadcrumbsProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'>, AriaBreadcrumbsProps, StyleProps, SlotProps {\n /** Whether the breadcrumbs are disabled. */\n isDisabled?: boolean,\n /** Handler that is called when a breadcrumb is clicked. */\n onAction?: (key: Key) => void\n}\n\nexport const BreadcrumbsContext = createContext<ContextValue<BreadcrumbsProps<any>, HTMLOListElement>>(null);\n\n/**\n * Breadcrumbs display a hierarchy of links to the current page or resource in an application.\n */\nexport const Breadcrumbs = /*#__PURE__*/ (forwardRef as forwardRefType)(function Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: ForwardedRef<HTMLOListElement>) {\n [props, ref] = useContextProps(props, ref, BreadcrumbsContext);\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let {navProps} = useBreadcrumbs(props);\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => (\n <ol\n ref={ref}\n {...navProps}\n slot={props.slot || undefined}\n style={props.style}\n className={props.className ?? 'react-aria-Breadcrumbs'}>\n <BreadcrumbsContext.Provider value={props}>\n <CollectionRoot collection={collection} />\n </BreadcrumbsContext.Provider>\n </ol>\n )}\n </CollectionBuilder>\n );\n});\n\nexport interface BreadcrumbRenderProps {\n /**\n * Whether the breadcrumb is for the current page.\n * @selector [data-current]\n */\n isCurrent: boolean,\n /**\n * Whether the breadcrumb is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface BreadcrumbProps extends RenderProps<BreadcrumbRenderProps> {\n /** A unique id for the breadcrumb, which will be passed to `onAction` when the breadcrumb is pressed. */\n id?: Key\n}\n\n/**\n * A Breadcrumb represents an individual item in a `<Breadcrumbs>` list.\n */\nexport const Breadcrumb = /*#__PURE__*/ createLeafComponent('item', function Breadcrumb(props: BreadcrumbProps, ref: ForwardedRef<HTMLLIElement>, node: Node<unknown>) {\n // Recreating useBreadcrumbItem because we want to use composition instead of having the link builtin.\n let isCurrent = node.nextKey == null;\n let {isDisabled, onAction} = useSlottedContext(BreadcrumbsContext)!;\n let linkProps = {\n 'aria-current': isCurrent ? 'page' : null,\n isDisabled: isDisabled || isCurrent,\n onPress: () => onAction?.(node.key)\n };\n\n let renderProps = useRenderProps({\n ...node.props,\n children: node.rendered,\n values: {isDisabled: isDisabled || isCurrent, isCurrent},\n defaultClassName: 'react-aria-Breadcrumb'\n });\n\n return (\n <li\n {...filterDOMProps(props as any)}\n {...renderProps}\n ref={ref}\n data-disabled={isDisabled || isCurrent || undefined}\n data-current={isCurrent || undefined}>\n <LinkContext.Provider value={linkProps}>\n {renderProps.children}\n </LinkContext.Provider>\n </li>\n );\n});\n"],"names":[],"version":3,"file":"Breadcrumbs.module.js.map"}
@@ -45,7 +45,7 @@ const $b856e6788a7ea5bf$var$additionalButtonHTMLAttributes = new Set([
45
45
  'value'
46
46
  ]);
47
47
  const $b856e6788a7ea5bf$export$24d547caef80ccd1 = /*#__PURE__*/ (0, $3vfYa$react.createContext)({});
48
- function $b856e6788a7ea5bf$var$Button(props, ref) {
48
+ const $b856e6788a7ea5bf$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $3vfYa$reactariacollections.createHideableComponent)(function Button(props, ref) {
49
49
  [props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $b856e6788a7ea5bf$export$24d547caef80ccd1);
50
50
  props = $b856e6788a7ea5bf$var$disablePendingProps(props);
51
51
  let ctx = props;
@@ -92,12 +92,15 @@ function $b856e6788a7ea5bf$var$Button(props, ref) {
92
92
  ariaLabelledby,
93
93
  buttonId
94
94
  ]);
95
+ // When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).
96
+ // We do this by changing the button's type to button.
95
97
  return /*#__PURE__*/ (0, ($parcel$interopDefault($3vfYa$react))).createElement("button", {
96
98
  ...(0, $3vfYa$reactariautils.filterDOMProps)(props, {
97
99
  propNames: $b856e6788a7ea5bf$var$additionalButtonHTMLAttributes
98
100
  }),
99
101
  ...(0, $3vfYa$reactaria.mergeProps)(buttonProps, focusProps, hoverProps),
100
102
  ...renderProps,
103
+ type: buttonProps.type === 'submit' && isPending ? 'button' : buttonProps.type,
101
104
  id: buttonId,
102
105
  ref: ref,
103
106
  "aria-labelledby": ariaLabelledby,
@@ -114,7 +117,7 @@ function $b856e6788a7ea5bf$var$Button(props, ref) {
114
117
  id: progressId
115
118
  }
116
119
  }, renderProps.children));
117
- }
120
+ });
118
121
  function $b856e6788a7ea5bf$var$disablePendingProps(props) {
119
122
  // Don't allow interaction while isPending is true
120
123
  if (props.isPending) {
@@ -130,9 +133,6 @@ function $b856e6788a7ea5bf$var$disablePendingProps(props) {
130
133
  }
131
134
  return props;
132
135
  }
133
- /**
134
- * A button allows a user to perform an action, with mouse, touch, and keyboard interactions.
135
- */ const $b856e6788a7ea5bf$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $3vfYa$reactariacollections.createHideableComponent)($b856e6788a7ea5bf$var$Button);
136
136
 
137
137
 
138
138
  //# sourceMappingURL=Button.main.js.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AAI,GAAG;IACf;IACA,OAAO;AACT;AAEA;;CAEC,GACD,MAAM,4CAAU,WAAW,GAAG,CAAA,GAAA,mDAAsB,EAAE","sources":["packages/react-aria-components/src/Button.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 */\n\nimport {announce} from '@react-aria/live-announcer';\nimport {\n AriaButtonProps,\n HoverEvents,\n mergeProps,\n useButton,\n useFocusRing,\n useHover,\n useId\n} from 'react-aria';\nimport {\n ContextValue,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {createHideableComponent} from '@react-aria/collections';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {ProgressBarContext} from './ProgressBar';\nimport React, {createContext, ForwardedRef, useEffect, useRef} from 'react';\n\nexport interface ButtonRenderProps {\n /**\n * Whether the button is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the button is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the button is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the button is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the button is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the button is currently in a pending state.\n * @selector [data-pending]\n */\n isPending: boolean\n}\n\nexport interface ButtonProps extends Omit<AriaButtonProps, 'children' | 'href' | 'target' | 'rel' | 'elementType'>, HoverEvents, SlotProps, RenderProps<ButtonRenderProps> {\n /**\n * The `<form>` element to associate the button with.\n * The value of this attribute must be the id of a `<form>` in the same document.\n */\n form?: string,\n /**\n * The URL that processes the information submitted by the button.\n * Overrides the action attribute of the button's form owner.\n */\n formAction?: string,\n /** Indicates how to encode the form data that is submitted. */\n formEncType?: string,\n /** Indicates the HTTP method used to submit the form. */\n formMethod?: string,\n /** Indicates that the form is not to be validated when it is submitted. */\n formNoValidate?: boolean,\n /** Overrides the target attribute of the button's form owner. */\n formTarget?: string,\n /** Submitted as a pair with the button's value as part of the form data. */\n name?: string,\n /** The value associated with the button's name when it's submitted with the form data. */\n value?: string,\n /**\n * Whether the button is in a pending state. This disables press and hover events\n * while retaining focusability, and announces the pending state to screen readers.\n */\n isPending?: boolean\n}\n\ninterface ButtonContextValue extends ButtonProps {\n isPressed?: boolean\n}\n\nconst additionalButtonHTMLAttributes = new Set(['form', 'formAction', 'formEncType', 'formMethod', 'formNoValidate', 'formTarget', 'name', 'value']);\n\nexport const ButtonContext = createContext<ContextValue<ButtonContextValue, HTMLButtonElement>>({});\n\nfunction Button(props: ButtonProps, ref: ForwardedRef<HTMLButtonElement>) {\n [props, ref] = useContextProps(props, ref, ButtonContext);\n props = disablePendingProps(props);\n let ctx = props as ButtonContextValue;\n let {isPending} = ctx;\n let {buttonProps, isPressed} = useButton(props, ref);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing(props);\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: props.isDisabled || isPending\n });\n let renderValues = {\n isHovered,\n isPressed: (ctx.isPressed || isPressed) && !isPending,\n isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isPending: isPending ?? false\n };\n\n let renderProps = useRenderProps({\n ...props,\n values: renderValues,\n defaultClassName: 'react-aria-Button'\n });\n\n let buttonId = useId(buttonProps.id);\n let progressId = useId();\n\n let ariaLabelledby = buttonProps['aria-labelledby'];\n if (isPending) {\n // aria-labelledby wins over aria-label\n // https://www.w3.org/TR/accname-1.2/#computation-steps\n if (ariaLabelledby) {\n ariaLabelledby = `${ariaLabelledby} ${progressId}`;\n } else if (buttonProps['aria-label']) {\n ariaLabelledby = `${buttonId} ${progressId}`;\n }\n }\n\n let wasPending = useRef(isPending);\n useEffect(() => {\n let message = {'aria-labelledby': ariaLabelledby || buttonId};\n if (!wasPending.current && isFocused && isPending) {\n announce(message, 'assertive');\n } else if (wasPending.current && isFocused && !isPending) {\n announce(message, 'assertive');\n }\n wasPending.current = isPending;\n }, [isPending, isFocused, ariaLabelledby, buttonId]);\n\n return (\n <button\n {...filterDOMProps(props, {propNames: additionalButtonHTMLAttributes})}\n {...mergeProps(buttonProps, focusProps, hoverProps)}\n {...renderProps}\n id={buttonId}\n ref={ref}\n aria-labelledby={ariaLabelledby}\n slot={props.slot || undefined}\n aria-disabled={isPending ? 'true' : buttonProps['aria-disabled']}\n data-disabled={props.isDisabled || undefined}\n data-pressed={renderValues.isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-pending={isPending || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <ProgressBarContext.Provider value={{id: progressId}}>\n {renderProps.children}\n </ProgressBarContext.Provider>\n </button>\n );\n}\n\nfunction disablePendingProps(props) {\n // Don't allow interaction while isPending is true\n if (props.isPending) {\n props.onPress = undefined;\n props.onPressStart = undefined;\n props.onPressEnd = undefined;\n props.onPressChange = undefined;\n props.onPressUp = undefined;\n props.onKeyDown = undefined;\n props.onKeyUp = undefined;\n props.onClick = undefined;\n props.href = undefined;\n }\n return props;\n}\n\n/**\n * A button allows a user to perform an action, with mouse, touch, and keyboard interactions.\n */\nconst _Button = /*#__PURE__*/ createHideableComponent(Button);\nexport {_Button as Button};\n"],"names":[],"version":3,"file":"Button.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AA2FD,MAAM,uDAAiC,IAAI,IAAI;IAAC;IAAQ;IAAc;IAAe;IAAc;IAAkB;IAAc;IAAQ;CAAQ;AAE5I,MAAM,0DAAgB,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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 */\n\nimport {announce} from '@react-aria/live-announcer';\nimport {\n AriaButtonProps,\n HoverEvents,\n mergeProps,\n useButton,\n useFocusRing,\n useHover,\n useId\n} from 'react-aria';\nimport {\n ContextValue,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {createHideableComponent} from '@react-aria/collections';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {ProgressBarContext} from './ProgressBar';\nimport React, {createContext, ForwardedRef, useEffect, useRef} from 'react';\n\nexport interface ButtonRenderProps {\n /**\n * Whether the button is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the button is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the button is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the button is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the button is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the button is currently in a pending state.\n * @selector [data-pending]\n */\n isPending: boolean\n}\n\nexport interface ButtonProps extends Omit<AriaButtonProps, 'children' | 'href' | 'target' | 'rel' | 'elementType'>, HoverEvents, SlotProps, RenderProps<ButtonRenderProps> {\n /**\n * The `<form>` element to associate the button with.\n * The value of this attribute must be the id of a `<form>` in the same document.\n */\n form?: string,\n /**\n * The URL that processes the information submitted by the button.\n * Overrides the action attribute of the button's form owner.\n */\n formAction?: string,\n /** Indicates how to encode the form data that is submitted. */\n formEncType?: string,\n /** Indicates the HTTP method used to submit the form. */\n formMethod?: string,\n /** Indicates that the form is not to be validated when it is submitted. */\n formNoValidate?: boolean,\n /** Overrides the target attribute of the button's form owner. */\n formTarget?: string,\n /** Submitted as a pair with the button's value as part of the form data. */\n name?: string,\n /** The value associated with the button's name when it's submitted with the form data. */\n value?: string,\n /**\n * Whether the button is in a pending state. This disables press and hover events\n * while retaining focusability, and announces the pending state to screen readers.\n */\n isPending?: boolean\n}\n\ninterface ButtonContextValue extends ButtonProps {\n isPressed?: boolean\n}\n\nconst additionalButtonHTMLAttributes = new Set(['form', 'formAction', 'formEncType', 'formMethod', 'formNoValidate', 'formTarget', 'name', 'value']);\n\nexport const ButtonContext = createContext<ContextValue<ButtonContextValue, HTMLButtonElement>>({});\n\n/**\n * A button allows a user to perform an action, with mouse, touch, and keyboard interactions.\n */\nexport const Button = /*#__PURE__*/ createHideableComponent(function Button(props: ButtonProps, ref: ForwardedRef<HTMLButtonElement>) {\n [props, ref] = useContextProps(props, ref, ButtonContext);\n props = disablePendingProps(props);\n let ctx = props as ButtonContextValue;\n let {isPending} = ctx;\n let {buttonProps, isPressed} = useButton(props, ref);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing(props);\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: props.isDisabled || isPending\n });\n let renderValues = {\n isHovered,\n isPressed: (ctx.isPressed || isPressed) && !isPending,\n isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isPending: isPending ?? false\n };\n\n let renderProps = useRenderProps({\n ...props,\n values: renderValues,\n defaultClassName: 'react-aria-Button'\n });\n\n let buttonId = useId(buttonProps.id);\n let progressId = useId();\n\n let ariaLabelledby = buttonProps['aria-labelledby'];\n if (isPending) {\n // aria-labelledby wins over aria-label\n // https://www.w3.org/TR/accname-1.2/#computation-steps\n if (ariaLabelledby) {\n ariaLabelledby = `${ariaLabelledby} ${progressId}`;\n } else if (buttonProps['aria-label']) {\n ariaLabelledby = `${buttonId} ${progressId}`;\n }\n }\n\n let wasPending = useRef(isPending);\n useEffect(() => {\n let message = {'aria-labelledby': ariaLabelledby || buttonId};\n if (!wasPending.current && isFocused && isPending) {\n announce(message, 'assertive');\n } else if (wasPending.current && isFocused && !isPending) {\n announce(message, 'assertive');\n }\n wasPending.current = isPending;\n }, [isPending, isFocused, ariaLabelledby, buttonId]);\n\n // When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).\n // We do this by changing the button's type to button.\n return (\n <button\n {...filterDOMProps(props, {propNames: additionalButtonHTMLAttributes})}\n {...mergeProps(buttonProps, focusProps, hoverProps)}\n {...renderProps}\n type={buttonProps.type === 'submit' && isPending ? 'button' : buttonProps.type}\n id={buttonId}\n ref={ref}\n aria-labelledby={ariaLabelledby}\n slot={props.slot || undefined}\n aria-disabled={isPending ? 'true' : buttonProps['aria-disabled']}\n data-disabled={props.isDisabled || undefined}\n data-pressed={renderValues.isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-pending={isPending || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <ProgressBarContext.Provider value={{id: progressId}}>\n {renderProps.children}\n </ProgressBarContext.Provider>\n </button>\n );\n});\n\nfunction disablePendingProps(props) {\n // Don't allow interaction while isPending is true\n if (props.isPending) {\n props.onPress = undefined;\n props.onPressStart = undefined;\n props.onPressEnd = undefined;\n props.onPressChange = undefined;\n props.onPressUp = undefined;\n props.onKeyDown = undefined;\n props.onKeyUp = undefined;\n props.onClick = undefined;\n props.href = undefined;\n }\n return props;\n}\n"],"names":[],"version":3,"file":"Button.main.js.map"}
package/dist/Button.mjs CHANGED
@@ -34,7 +34,7 @@ const $d2b4bc8c273e7be6$var$additionalButtonHTMLAttributes = new Set([
34
34
  'value'
35
35
  ]);
36
36
  const $d2b4bc8c273e7be6$export$24d547caef80ccd1 = /*#__PURE__*/ (0, $fM325$createContext)({});
37
- function $d2b4bc8c273e7be6$var$Button(props, ref) {
37
+ const $d2b4bc8c273e7be6$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $fM325$createHideableComponent)(function Button(props, ref) {
38
38
  [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $d2b4bc8c273e7be6$export$24d547caef80ccd1);
39
39
  props = $d2b4bc8c273e7be6$var$disablePendingProps(props);
40
40
  let ctx = props;
@@ -81,12 +81,15 @@ function $d2b4bc8c273e7be6$var$Button(props, ref) {
81
81
  ariaLabelledby,
82
82
  buttonId
83
83
  ]);
84
+ // When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).
85
+ // We do this by changing the button's type to button.
84
86
  return /*#__PURE__*/ (0, $fM325$react).createElement("button", {
85
87
  ...(0, $fM325$filterDOMProps)(props, {
86
88
  propNames: $d2b4bc8c273e7be6$var$additionalButtonHTMLAttributes
87
89
  }),
88
90
  ...(0, $fM325$mergeProps)(buttonProps, focusProps, hoverProps),
89
91
  ...renderProps,
92
+ type: buttonProps.type === 'submit' && isPending ? 'button' : buttonProps.type,
90
93
  id: buttonId,
91
94
  ref: ref,
92
95
  "aria-labelledby": ariaLabelledby,
@@ -103,7 +106,7 @@ function $d2b4bc8c273e7be6$var$Button(props, ref) {
103
106
  id: progressId
104
107
  }
105
108
  }, renderProps.children));
106
- }
109
+ });
107
110
  function $d2b4bc8c273e7be6$var$disablePendingProps(props) {
108
111
  // Don't allow interaction while isPending is true
109
112
  if (props.isPending) {
@@ -119,9 +122,6 @@ function $d2b4bc8c273e7be6$var$disablePendingProps(props) {
119
122
  }
120
123
  return props;
121
124
  }
122
- /**
123
- * A button allows a user to perform an action, with mouse, touch, and keyboard interactions.
124
- */ const $d2b4bc8c273e7be6$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $fM325$createHideableComponent)($d2b4bc8c273e7be6$var$Button);
125
125
 
126
126
 
127
127
  export {$d2b4bc8c273e7be6$export$24d547caef80ccd1 as ButtonContext, $d2b4bc8c273e7be6$export$353f5b6fc5456de1 as Button};
@@ -34,7 +34,7 @@ const $d2b4bc8c273e7be6$var$additionalButtonHTMLAttributes = new Set([
34
34
  'value'
35
35
  ]);
36
36
  const $d2b4bc8c273e7be6$export$24d547caef80ccd1 = /*#__PURE__*/ (0, $fM325$createContext)({});
37
- function $d2b4bc8c273e7be6$var$Button(props, ref) {
37
+ const $d2b4bc8c273e7be6$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $fM325$createHideableComponent)(function Button(props, ref) {
38
38
  [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $d2b4bc8c273e7be6$export$24d547caef80ccd1);
39
39
  props = $d2b4bc8c273e7be6$var$disablePendingProps(props);
40
40
  let ctx = props;
@@ -81,12 +81,15 @@ function $d2b4bc8c273e7be6$var$Button(props, ref) {
81
81
  ariaLabelledby,
82
82
  buttonId
83
83
  ]);
84
+ // When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).
85
+ // We do this by changing the button's type to button.
84
86
  return /*#__PURE__*/ (0, $fM325$react).createElement("button", {
85
87
  ...(0, $fM325$filterDOMProps)(props, {
86
88
  propNames: $d2b4bc8c273e7be6$var$additionalButtonHTMLAttributes
87
89
  }),
88
90
  ...(0, $fM325$mergeProps)(buttonProps, focusProps, hoverProps),
89
91
  ...renderProps,
92
+ type: buttonProps.type === 'submit' && isPending ? 'button' : buttonProps.type,
90
93
  id: buttonId,
91
94
  ref: ref,
92
95
  "aria-labelledby": ariaLabelledby,
@@ -103,7 +106,7 @@ function $d2b4bc8c273e7be6$var$Button(props, ref) {
103
106
  id: progressId
104
107
  }
105
108
  }, renderProps.children));
106
- }
109
+ });
107
110
  function $d2b4bc8c273e7be6$var$disablePendingProps(props) {
108
111
  // Don't allow interaction while isPending is true
109
112
  if (props.isPending) {
@@ -119,9 +122,6 @@ function $d2b4bc8c273e7be6$var$disablePendingProps(props) {
119
122
  }
120
123
  return props;
121
124
  }
122
- /**
123
- * A button allows a user to perform an action, with mouse, touch, and keyboard interactions.
124
- */ const $d2b4bc8c273e7be6$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $fM325$createHideableComponent)($d2b4bc8c273e7be6$var$Button);
125
125
 
126
126
 
127
127
  export {$d2b4bc8c273e7be6$export$24d547caef80ccd1 as ButtonContext, $d2b4bc8c273e7be6$export$353f5b6fc5456de1 as Button};