@okam/stack-ui 1.29.0 → 1.30.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/components/Accordion/components/AccordionItem.d.ts +1 -0
  2. package/components/Accordion/index.d.ts +2 -1
  3. package/components/Accordion/interface.d.ts +3 -2
  4. package/components/Alerts/components/AlertsCloseButton.d.ts +1 -1
  5. package/components/Alerts/index.d.ts +2 -1
  6. package/components/Alerts/interface.d.ts +4 -3
  7. package/components/Box/index.d.ts +3 -2
  8. package/components/Button/index.d.ts +8 -4
  9. package/components/Button/interface.d.ts +3 -2
  10. package/components/Calendar/index.d.ts +5 -1
  11. package/components/Calendar/interface.d.ts +2 -1
  12. package/components/Carousel/components/CarouselNavigationButton.d.ts +3 -3
  13. package/components/Date/index.d.ts +2 -1
  14. package/components/Date/interface.d.ts +2 -1
  15. package/components/Icon/index.d.ts +2 -1
  16. package/components/Icon/interface.d.ts +2 -1
  17. package/components/Lightbox/hooks/overlay/index.d.ts +75 -0
  18. package/components/Lightbox/index.d.ts +2 -1
  19. package/components/Lightbox/interface.d.ts +3 -2
  20. package/components/Menu/Menu.d.ts +2 -1
  21. package/components/Menu/interface.d.ts +5 -4
  22. package/components/Modal/index.d.ts +2 -1
  23. package/components/Modal/interface.d.ts +2 -1
  24. package/components/Popover/index.d.ts +2 -1
  25. package/components/Popover/interface.d.ts +3 -2
  26. package/components/ShareButton/index.d.ts +2 -1
  27. package/components/ShareButton/interface.d.ts +2 -2
  28. package/components/SidePanel/index.d.ts +3 -3
  29. package/components/SidePanel/interface.d.ts +5 -4
  30. package/components/Typography/index.d.ts +3 -2
  31. package/components/Video/index.d.ts +2 -1
  32. package/components/Video/interface.d.ts +2 -1
  33. package/components/WysiwygBlock/attributes.d.ts +2 -0
  34. package/components/WysiwygBlock/index.d.ts +2 -1
  35. package/components/WysiwygBlock/interface.d.ts +2 -1
  36. package/components/fields/Checkbox/Checkbox.interface.d.ts +2 -1
  37. package/components/fields/Checkbox/index.d.ts +2 -1
  38. package/components/fields/CheckboxGroup/index.d.ts +2 -1
  39. package/components/fields/CheckboxGroup/interface.d.ts +2 -1
  40. package/components/fields/DatePicker/index.d.ts +2 -1
  41. package/components/fields/DatePicker/interface.d.ts +2 -1
  42. package/components/fields/Radio/Radio.interface.d.ts +3 -2
  43. package/components/fields/Radio/index.d.ts +3 -2
  44. package/components/fields/RadioGroup/index.d.ts +2 -1
  45. package/components/fields/RadioGroup/interface.d.ts +2 -1
  46. package/components/fields/SearchField/index.d.ts +2 -1
  47. package/components/fields/SearchField/interface.d.ts +2 -1
  48. package/components/fields/Select/Select.d.ts +2 -1
  49. package/components/fields/Select/Select.interface.d.ts +3 -2
  50. package/components/fields/TextArea/index.d.ts +2 -1
  51. package/components/fields/TextInputField/interface.d.ts +3 -2
  52. package/index.d.ts +1 -0
  53. package/index.js +1 -1
  54. package/index.mjs +41 -38
  55. package/index100.js +1 -2
  56. package/index100.mjs +22 -21
  57. package/index101.js +2 -1
  58. package/index101.mjs +22 -63
  59. package/index102.js +1 -1
  60. package/index102.mjs +58 -24
  61. package/index103.js +1 -1
  62. package/index103.mjs +29 -4
  63. package/index104.js +1 -1
  64. package/index104.mjs +52 -11
  65. package/index105.js +1 -1
  66. package/index105.mjs +4 -14
  67. package/index106.js +1 -1
  68. package/index106.mjs +11 -23
  69. package/index107.js +1 -1
  70. package/index107.mjs +13 -22
  71. package/index108.js +1 -1
  72. package/index108.mjs +23 -39
  73. package/index109.js +1 -2
  74. package/index109.mjs +22 -12
  75. package/index11.js +1 -1
  76. package/index11.mjs +2 -2
  77. package/index110.js +1 -1
  78. package/index110.mjs +38 -7
  79. package/index111.js +2 -1
  80. package/index111.mjs +12 -21
  81. package/index112.js +1 -1
  82. package/index112.mjs +7 -38
  83. package/index113.js +1 -1
  84. package/index113.mjs +20 -48
  85. package/index114.js +1 -1
  86. package/index114.mjs +38 -40
  87. package/index115.js +1 -1
  88. package/index115.mjs +47 -11
  89. package/index116.js +1 -1
  90. package/index116.mjs +41 -26
  91. package/index117.js +1 -1
  92. package/index117.mjs +14 -20
  93. package/index118.js +1 -1
  94. package/index118.mjs +30 -8
  95. package/index119.js +1 -1
  96. package/index119.mjs +20 -30
  97. package/index120.js +1 -1
  98. package/index120.mjs +8 -14
  99. package/index121.js +1 -1
  100. package/index121.mjs +29 -16
  101. package/index122.js +1 -1
  102. package/index122.mjs +15 -21
  103. package/index123.js +1 -1
  104. package/index123.mjs +17 -11
  105. package/index124.js +1 -2
  106. package/index124.mjs +20 -21
  107. package/index125.js +1 -1
  108. package/index125.mjs +11 -12
  109. package/index126.js +2 -1
  110. package/index126.mjs +22 -46
  111. package/index127.js +1 -1
  112. package/index127.mjs +12 -241
  113. package/index128.js +1 -2
  114. package/index128.mjs +46 -13
  115. package/index129.js +1 -1
  116. package/index129.mjs +239 -28
  117. package/index13.js +1 -1
  118. package/index13.mjs +8 -5
  119. package/index130.js +2 -1
  120. package/index130.mjs +13 -51
  121. package/index131.js +1 -1
  122. package/index131.mjs +30 -27
  123. package/index132.js +1 -1
  124. package/index132.mjs +49 -19
  125. package/index133.js +1 -1
  126. package/index133.mjs +26 -61
  127. package/index134.js +1 -1
  128. package/index134.mjs +17 -91
  129. package/index135.js +1 -1
  130. package/index135.mjs +59 -29
  131. package/index136.js +1 -1
  132. package/index136.mjs +90 -117
  133. package/index137.js +1 -1
  134. package/index137.mjs +32 -26
  135. package/index138.js +1 -1
  136. package/index138.mjs +118 -121
  137. package/index139.js +1 -1
  138. package/index139.mjs +27 -134
  139. package/index14.js +1 -1
  140. package/index14.mjs +3 -3
  141. package/index140.js +1 -1
  142. package/index140.mjs +122 -12
  143. package/index141.js +1 -1
  144. package/index141.mjs +131 -92
  145. package/index142.js +1 -1
  146. package/index142.mjs +12 -104
  147. package/index143.js +1 -1
  148. package/index143.mjs +95 -5
  149. package/index144.js +1 -1
  150. package/index144.mjs +106 -3
  151. package/index145.js +1 -1
  152. package/index145.mjs +5 -125
  153. package/index146.js +1 -1
  154. package/index146.mjs +3 -29
  155. package/index147.js +1 -1
  156. package/index147.mjs +113 -39
  157. package/index148.js +1 -1
  158. package/index148.mjs +19 -34
  159. package/index149.js +1 -1
  160. package/index149.mjs +40 -26
  161. package/index150.js +1 -1
  162. package/index150.mjs +29 -98
  163. package/index151.js +1 -1
  164. package/index151.mjs +28 -68
  165. package/index152.js +1 -1
  166. package/index152.mjs +90 -78
  167. package/index153.js +1 -1
  168. package/index153.mjs +78 -98
  169. package/index154.js +1 -1
  170. package/index154.mjs +101 -199
  171. package/index155.js +1 -1
  172. package/index155.mjs +98 -65
  173. package/index156.js +1 -1
  174. package/index156.mjs +185 -127
  175. package/index157.js +1 -1
  176. package/index157.mjs +54 -109
  177. package/index158.js +1 -1
  178. package/index158.mjs +126 -202
  179. package/index159.js +1 -1
  180. package/index159.mjs +104 -175
  181. package/index16.js +1 -1
  182. package/index16.mjs +2 -2
  183. package/index160.js +1 -1
  184. package/index160.mjs +208 -60
  185. package/index161.js +1 -1
  186. package/index161.mjs +178 -246
  187. package/index162.js +1 -1
  188. package/index162.mjs +63 -91
  189. package/index163.js +1 -1
  190. package/index163.mjs +250 -166
  191. package/index164.js +1 -1
  192. package/index164.mjs +91 -78
  193. package/index165.js +1 -1
  194. package/index165.mjs +170 -54
  195. package/index166.js +1 -1
  196. package/index166.mjs +72 -114
  197. package/index167.js +1 -1
  198. package/index167.mjs +51 -109
  199. package/index168.js +1 -1
  200. package/index168.mjs +112 -108
  201. package/index169.js +1 -1
  202. package/index169.mjs +109 -65
  203. package/index170.js +1 -1
  204. package/index170.mjs +117 -105
  205. package/index171.js +1 -1
  206. package/index171.mjs +68 -48
  207. package/index172.js +1 -1
  208. package/index172.mjs +108 -91
  209. package/index173.js +1 -1
  210. package/index173.mjs +37 -55
  211. package/index174.js +1 -1
  212. package/index174.mjs +80 -43
  213. package/index175.js +1 -1
  214. package/index175.mjs +52 -81
  215. package/index176.js +1 -5
  216. package/index176.mjs +42 -66
  217. package/index177.js +1 -1
  218. package/index177.mjs +87 -1999
  219. package/index178.js +5 -1
  220. package/index178.mjs +79 -58
  221. package/index179.js +1 -1
  222. package/index179.mjs +1998 -175
  223. package/index18.js +1 -1
  224. package/index18.mjs +7 -7
  225. package/index180.js +1 -1
  226. package/index180.mjs +59 -5
  227. package/index181.js +1 -1
  228. package/index181.mjs +183 -125
  229. package/index182.js +1 -1
  230. package/index182.mjs +5 -179
  231. package/index183.js +1 -1
  232. package/index183.mjs +129 -8
  233. package/index184.js +1 -1
  234. package/index184.mjs +179 -3
  235. package/index185.js +1 -1
  236. package/index185.mjs +8 -35
  237. package/index186.js +1 -1
  238. package/index186.mjs +3 -5
  239. package/index187.js +1 -1
  240. package/index187.mjs +35 -28
  241. package/index188.js +1 -1
  242. package/index188.mjs +5 -6
  243. package/index189.js +1 -1
  244. package/index189.mjs +26 -310
  245. package/index19.js +1 -1
  246. package/index19.mjs +2 -2
  247. package/index190.js +1 -1
  248. package/index190.mjs +6 -192
  249. package/index191.js +1 -1
  250. package/index191.mjs +339 -7
  251. package/index192.js +1 -1
  252. package/index192.mjs +180 -23
  253. package/index193.js +1 -1
  254. package/index193.mjs +6 -53
  255. package/index194.js +1 -1
  256. package/index194.mjs +24 -44
  257. package/index195.js +1 -1
  258. package/index195.mjs +55 -124
  259. package/index196.js +1 -1
  260. package/index196.mjs +46 -5
  261. package/index197.js +1 -1
  262. package/index197.mjs +108 -26
  263. package/index198.js +1 -1
  264. package/index198.mjs +32 -6
  265. package/index199.js +1 -1
  266. package/index199.mjs +5 -7
  267. package/index2.js +1 -1
  268. package/index2.mjs +19 -19
  269. package/index20.js +1 -1
  270. package/index20.mjs +1 -1
  271. package/index200.js +1 -1
  272. package/index200.mjs +28 -7
  273. package/index201.js +1 -1
  274. package/index201.mjs +7 -5
  275. package/index202.js +1 -1
  276. package/index202.mjs +7 -5
  277. package/index203.js +1 -1
  278. package/index203.mjs +7 -9
  279. package/index204.js +1 -0
  280. package/index204.mjs +7 -0
  281. package/index205.js +1 -0
  282. package/index205.mjs +8 -0
  283. package/index206.js +1 -0
  284. package/index206.mjs +12 -0
  285. package/index21.js +1 -1
  286. package/index21.mjs +8 -8
  287. package/index22.js +1 -1
  288. package/index22.mjs +2 -2
  289. package/index23.js +1 -1
  290. package/index23.mjs +3 -3
  291. package/index24.js +1 -1
  292. package/index24.mjs +14 -14
  293. package/index26.js +1 -1
  294. package/index26.mjs +28 -21
  295. package/index27.js +1 -1
  296. package/index27.mjs +12 -12
  297. package/index28.js +1 -1
  298. package/index28.mjs +6 -6
  299. package/index29.js +1 -1
  300. package/index29.mjs +1 -1
  301. package/index30.js +1 -1
  302. package/index30.mjs +14 -8
  303. package/index31.js +1 -1
  304. package/index31.mjs +18 -18
  305. package/index32.js +1 -1
  306. package/index32.mjs +1 -1
  307. package/index33.mjs +43 -43
  308. package/index34.js +1 -1
  309. package/index34.mjs +1 -1
  310. package/index35.js +1 -1
  311. package/index35.mjs +3 -3
  312. package/index36.mjs +10 -10
  313. package/index4.js +1 -1
  314. package/index4.mjs +3 -3
  315. package/index6.js +1 -1
  316. package/index6.mjs +34 -33
  317. package/index65.js +1 -1
  318. package/index65.mjs +1 -1
  319. package/index66.js +1 -1
  320. package/index66.mjs +2 -2
  321. package/index67.js +1 -1
  322. package/index67.mjs +1 -1
  323. package/index69.js +1 -1
  324. package/index69.mjs +1 -1
  325. package/index7.mjs +4 -4
  326. package/index70.js +1 -1
  327. package/index70.mjs +1 -1
  328. package/index71.js +1 -1
  329. package/index71.mjs +1 -1
  330. package/index72.js +2 -1
  331. package/index72.mjs +27 -2
  332. package/index73.js +1 -2
  333. package/index73.mjs +2 -9
  334. package/index74.js +1 -1
  335. package/index74.mjs +7 -6
  336. package/index75.js +1 -1
  337. package/index75.mjs +6 -6
  338. package/index76.js +1 -1
  339. package/index76.mjs +6 -6
  340. package/index77.js +2 -1
  341. package/index77.mjs +8 -25
  342. package/index78.js +1 -1
  343. package/index78.mjs +25 -2
  344. package/index79.js +1 -6
  345. package/index79.mjs +2 -94
  346. package/index8.js +1 -1
  347. package/index8.mjs +42 -23
  348. package/index80.js +6 -1
  349. package/index80.mjs +79 -54
  350. package/index81.js +1 -1
  351. package/index81.mjs +61 -33
  352. package/index82.js +1 -42
  353. package/index82.mjs +34 -67
  354. package/index83.js +42 -1
  355. package/index83.mjs +69 -154
  356. package/index84.js +1 -9
  357. package/index84.mjs +149 -47
  358. package/index85.js +9 -1
  359. package/index85.mjs +48 -36
  360. package/index86.js +1 -1
  361. package/index86.mjs +40 -8
  362. package/index87.js +1 -1
  363. package/index87.mjs +9 -31
  364. package/index88.js +1 -1
  365. package/index88.mjs +35 -6
  366. package/index89.js +1 -12
  367. package/index89.mjs +6 -40
  368. package/index9.js +1 -1
  369. package/index9.mjs +7 -7
  370. package/index90.js +12 -1
  371. package/index90.mjs +36 -25
  372. package/index91.js +1 -1
  373. package/index91.mjs +24 -8
  374. package/index92.js +1 -7
  375. package/index92.mjs +7 -13
  376. package/index93.js +6 -14
  377. package/index93.mjs +13 -65
  378. package/index94.js +15 -1
  379. package/index94.mjs +71 -7
  380. package/index95.js +1 -16
  381. package/index95.mjs +7 -25
  382. package/index96.js +16 -1
  383. package/index96.mjs +20 -37
  384. package/index97.js +1 -1
  385. package/index97.mjs +40 -43
  386. package/index98.js +1 -1
  387. package/index98.mjs +44 -47
  388. package/index99.js +1 -1
  389. package/index99.mjs +48 -17
  390. package/package.json +1 -1
  391. package/providers/Translation/index.d.ts +4 -0
  392. package/providers/Translation/interface.d.ts +16 -0
  393. package/theme/Accordion/index.d.ts +12 -12
  394. package/theme/Alerts/index.d.ts +22 -22
  395. package/theme/Box/index.d.ts +8 -8
  396. package/theme/Button/index.d.ts +2 -2
  397. package/theme/Calendar/index.d.ts +12 -12
  398. package/theme/Carousel/index.d.ts +11 -11
  399. package/theme/Checkbox/index.d.ts +8 -8
  400. package/theme/CheckboxGroup/index.d.ts +3 -3
  401. package/theme/DatePicker/index.d.ts +9 -9
  402. package/theme/Image/index.d.ts +1 -1
  403. package/theme/LightBox/index.d.ts +9 -9
  404. package/theme/Radio/index.d.ts +6 -6
  405. package/theme/RadioGroup/index.d.ts +3 -3
  406. package/theme/Search/index.d.ts +3 -3
  407. package/theme/ShareButton/index.d.ts +10 -10
  408. package/theme/SidePanel/index.d.ts +3 -3
  409. package/theme/TextArea/index.d.ts +2 -2
  410. package/theme/Typography/index.d.ts +2 -2
  411. package/transitions/ModalTransition.d.ts +3 -6
  412. package/transitions/RenderWithSlide.d.ts +3 -6
  413. package/transitions/SidePanelTransition.d.ts +3 -6
package/index134.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("./index191.js"),x=require("@react-aria/focus"),T=require("@react-aria/utils"),V=require("./index189.js"),j=require("./index194.js"),v=require("react");function N(o){let{selectionManager:t,key:s,ref:c,shouldSelectOnPressUp:L,shouldUseVirtualFocus:d,focus:D,isDisabled:n,onAction:b,allowsDifferentPressOrigin:C,linkBehavior:u="action"}=o,F=T.useRouter(),a=e=>{if(e.pointerType==="keyboard"&&A.isNonContiguousSelectionModifier(e))t.toggleSelection(s);else{if(t.selectionMode==="none")return;if(t.isLink(s)){if(u==="selection"){let f=t.getItemProps(s);F.open(c.current,e,f.href,f.routerOptions),t.setSelectedKeys(t.selectedKeys);return}else if(u==="override"||u==="none")return}t.selectionMode==="single"?t.isSelected(s)&&!t.disallowEmptySelection?t.toggleSelection(s):t.replaceSelection(s):e&&e.shiftKey?t.extendSelection(s):t.selectionBehavior==="toggle"||e&&(A.isCtrlKeyPressed(e)||e.pointerType==="touch"||e.pointerType==="virtual")?t.toggleSelection(s):t.replaceSelection(s)}};v.useEffect(()=>{s===t.focusedKey&&t.isFocused&&!d&&(D?D():document.activeElement!==c.current&&x.focusSafely(c.current))},[c,s,t.focusedKey,t.childFocusStrategy,t.isFocused,d]),n=n||t.isDisabled(s);let y={};!d&&!n?y={tabIndex:s===t.focusedKey?0:-1,onFocus(e){e.target===c.current&&t.setFocusedKey(s)}}:n&&(y.onMouseDown=e=>{e.preventDefault()});let E=t.isLink(s)&&u==="override",O=t.isLink(s)&&u!=="selection"&&u!=="none",r=!n&&t.canSelectItem(s)&&!E,k=(b||O)&&!n,l=k&&(t.selectionBehavior==="replace"?!r:!r||t.isEmpty),h=k&&r&&t.selectionBehavior==="replace",p=l||h,P=v.useRef(null),g=p&&r,m=v.useRef(!1),w=v.useRef(!1),S=e=>{if(b&&b(),O){let f=t.getItemProps(s);F.open(c.current,e,f.href,f.routerOptions)}},i={};L?(i.onPressStart=e=>{P.current=e.pointerType,m.current=g,e.pointerType==="keyboard"&&(!p||$())&&a(e)},C?(i.onPressUp=l?null:e=>{e.pointerType!=="keyboard"&&r&&a(e)},i.onPress=l?S:null):i.onPress=e=>{if(l||h&&e.pointerType!=="mouse"){if(e.pointerType==="keyboard"&&!K())return;S(e)}else e.pointerType!=="keyboard"&&r&&a(e)}):(i.onPressStart=e=>{P.current=e.pointerType,m.current=g,w.current=l,r&&(e.pointerType==="mouse"&&!l||e.pointerType==="keyboard"&&(!k||$()))&&a(e)},i.onPress=e=>{(e.pointerType==="touch"||e.pointerType==="pen"||e.pointerType==="virtual"||e.pointerType==="keyboard"&&p&&K()||e.pointerType==="mouse"&&w.current)&&(p?S(e):r&&a(e))}),y["data-key"]=s,i.preventFocusOnPress=d;let{pressProps:q,isPressed:B}=V.usePress(i),M=h?e=>{P.current==="mouse"&&(e.stopPropagation(),e.preventDefault(),S(e))}:void 0,{longPressProps:I}=j.useLongPress({isDisabled:!g,onLongPress(e){e.pointerType==="touch"&&(a(e),t.setSelectionBehavior("toggle"))}}),R=e=>{P.current==="touch"&&m.current&&e.preventDefault()},U=t.isLink(s)?e=>{T.openLink.isOpening||e.preventDefault()}:void 0;return{itemProps:T.mergeProps(y,r||l?q:{},g?I:{},{onDoubleClick:M,onDragStartCapture:R,onClick:U}),isPressed:B,isSelected:t.isSelected(s),isFocused:t.isFocused&&t.focusedKey===s,isDisabled:n,allowsSelection:r,hasAction:p}}function K(){let o=window.event;return(o==null?void 0:o.key)==="Enter"}function $(){let o=window.event;return(o==null?void 0:o.key)===" "||(o==null?void 0:o.code)==="Space"}exports.useSelectableItem=N;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index199.js"),l=require("@react-aria/utils"),u=require("@react-aria/focus");function t(a,e,r){let n=u.useHasTabbableChild(r)?void 0:0;var i;const b=d.generateId(e,(i=a.id)!==null&&i!==void 0?i:e==null?void 0:e.selectedKey,"tabpanel"),o=l.useLabels({...a,id:b,"aria-labelledby":d.generateId(e,e==null?void 0:e.selectedKey,"tab")});return{tabPanelProps:l.mergeProps(o,{tabIndex:n,role:"tabpanel","aria-describedby":a["aria-describedby"],"aria-details":a["aria-details"]})}}exports.useTabPanel=t;
package/index134.mjs CHANGED
@@ -1,97 +1,23 @@
1
- import { isNonContiguousSelectionModifier as U, isCtrlKeyPressed as R } from "./index191.mjs";
2
- import { focusSafely as V } from "@react-aria/focus";
3
- import { useRouter as N, openLink as j, mergeProps as q } from "@react-aria/utils";
4
- import { usePress as z } from "./index189.mjs";
5
- import { useLongPress as G } from "./index194.mjs";
6
- import { useEffect as H, useRef as h } from "react";
7
- function _(r) {
8
- let { selectionManager: t, key: o, ref: c, shouldSelectOnPressUp: K, shouldUseVirtualFocus: d, focus: $, isDisabled: n, onAction: g, allowsDifferentPressOrigin: O, linkBehavior: a = "action" } = r, T = N(), p = (e) => {
9
- if (e.pointerType === "keyboard" && U(e)) t.toggleSelection(o);
10
- else {
11
- if (t.selectionMode === "none") return;
12
- if (t.isLink(o)) {
13
- if (a === "selection") {
14
- let f = t.getItemProps(o);
15
- T.open(c.current, e, f.href, f.routerOptions), t.setSelectedKeys(t.selectedKeys);
16
- return;
17
- } else if (a === "override" || a === "none") return;
18
- }
19
- t.selectionMode === "single" ? t.isSelected(o) && !t.disallowEmptySelection ? t.toggleSelection(o) : t.replaceSelection(o) : e && e.shiftKey ? t.extendSelection(o) : t.selectionBehavior === "toggle" || e && (R(e) || e.pointerType === "touch" || e.pointerType === "virtual") ? t.toggleSelection(o) : t.replaceSelection(o);
20
- }
21
- };
22
- H(() => {
23
- o === t.focusedKey && t.isFocused && !d && ($ ? $() : document.activeElement !== c.current && V(c.current));
24
- }, [
25
- c,
26
- o,
27
- t.focusedKey,
28
- t.childFocusStrategy,
29
- t.isFocused,
30
- d
31
- ]), n = n || t.isDisabled(o);
32
- let y = {};
33
- !d && !n ? y = {
34
- tabIndex: o === t.focusedKey ? 0 : -1,
35
- onFocus(e) {
36
- e.target === c.current && t.setFocusedKey(o);
37
- }
38
- } : n && (y.onMouseDown = (e) => {
39
- e.preventDefault();
1
+ import { generateId as i } from "./index199.mjs";
2
+ import { useLabels as n, mergeProps as c } from "@react-aria/utils";
3
+ import { useHasTabbableChild as f } from "@react-aria/focus";
4
+ function m(a, e, l) {
5
+ let r = f(l) ? void 0 : 0;
6
+ var d;
7
+ const b = i(e, (d = a.id) !== null && d !== void 0 ? d : e == null ? void 0 : e.selectedKey, "tabpanel"), o = n({
8
+ ...a,
9
+ id: b,
10
+ "aria-labelledby": i(e, e == null ? void 0 : e.selectedKey, "tab")
40
11
  });
41
- let L = t.isLink(o) && a === "override", D = t.isLink(o) && a !== "selection" && a !== "none", i = !n && t.canSelectItem(o) && !L, S = (g || D) && !n, l = S && (t.selectionBehavior === "replace" ? !i : !i || t.isEmpty), v = S && i && t.selectionBehavior === "replace", u = l || v, P = h(null), m = u && i, k = h(!1), F = h(!1), b = (e) => {
42
- if (g && g(), D) {
43
- let f = t.getItemProps(o);
44
- T.open(c.current, e, f.href, f.routerOptions);
45
- }
46
- }, s = {};
47
- K ? (s.onPressStart = (e) => {
48
- P.current = e.pointerType, k.current = m, e.pointerType === "keyboard" && (!u || A()) && p(e);
49
- }, O ? (s.onPressUp = l ? null : (e) => {
50
- e.pointerType !== "keyboard" && i && p(e);
51
- }, s.onPress = l ? b : null) : s.onPress = (e) => {
52
- if (l || v && e.pointerType !== "mouse") {
53
- if (e.pointerType === "keyboard" && !w()) return;
54
- b(e);
55
- } else e.pointerType !== "keyboard" && i && p(e);
56
- }) : (s.onPressStart = (e) => {
57
- P.current = e.pointerType, k.current = m, F.current = l, i && (e.pointerType === "mouse" && !l || e.pointerType === "keyboard" && (!S || A())) && p(e);
58
- }, s.onPress = (e) => {
59
- (e.pointerType === "touch" || e.pointerType === "pen" || e.pointerType === "virtual" || e.pointerType === "keyboard" && u && w() || e.pointerType === "mouse" && F.current) && (u ? b(e) : i && p(e));
60
- }), y["data-key"] = o, s.preventFocusOnPress = d;
61
- let { pressProps: x, isPressed: C } = z(s), E = v ? (e) => {
62
- P.current === "mouse" && (e.stopPropagation(), e.preventDefault(), b(e));
63
- } : void 0, { longPressProps: B } = G({
64
- isDisabled: !m,
65
- onLongPress(e) {
66
- e.pointerType === "touch" && (p(e), t.setSelectionBehavior("toggle"));
67
- }
68
- }), I = (e) => {
69
- P.current === "touch" && k.current && e.preventDefault();
70
- }, M = t.isLink(o) ? (e) => {
71
- j.isOpening || e.preventDefault();
72
- } : void 0;
73
12
  return {
74
- itemProps: q(y, i || l ? x : {}, m ? B : {}, {
75
- onDoubleClick: E,
76
- onDragStartCapture: I,
77
- onClick: M
78
- }),
79
- isPressed: C,
80
- isSelected: t.isSelected(o),
81
- isFocused: t.isFocused && t.focusedKey === o,
82
- isDisabled: n,
83
- allowsSelection: i,
84
- hasAction: u
13
+ tabPanelProps: c(o, {
14
+ tabIndex: r,
15
+ role: "tabpanel",
16
+ "aria-describedby": a["aria-describedby"],
17
+ "aria-details": a["aria-details"]
18
+ })
85
19
  };
86
20
  }
87
- function w() {
88
- let r = window.event;
89
- return (r == null ? void 0 : r.key) === "Enter";
90
- }
91
- function A() {
92
- let r = window.event;
93
- return (r == null ? void 0 : r.key) === " " || (r == null ? void 0 : r.code) === "Space";
94
- }
95
21
  export {
96
- _ as useSelectableItem
22
+ m as useTabPanel
97
23
  };
package/index135.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index190.js"),b=require("./index195.js"),u=require("@react-aria/i18n"),g=require("react");function y(l){let{selectionManager:t,collection:o,disabledKeys:a,ref:e,keyboardDelegate:r}=l,i=u.useCollator({usage:"search",sensitivity:"base"}),s=t.disabledBehavior,c=g.useMemo(()=>r||new b.ListKeyboardDelegate({collection:o,disabledKeys:a,disabledBehavior:s,ref:e,collator:i}),[r,o,a,e,i,s]),{collectionProps:n}=d.useSelectableCollection({...l,ref:e,selectionManager:t,keyboardDelegate:c});return{listProps:n}}exports.useSelectableList=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@react-aria/utils"),O=require("@react-aria/focus"),m=require("./index191.js");function S(s,o){let{elementType:r="button",isDisabled:e,onPress:l,onPressStart:u,onPressEnd:P,onPressUp:p,onPressChange:c,preventFocusOnPress:b,allowFocusWhenDisabled:f,onClick:i,href:g,target:h,rel:y,type:d="button"}=s,n;r==="button"?n={type:d,disabled:e}:n={role:"button",tabIndex:e?void 0:0,href:r==="a"&&e?void 0:g,target:r==="a"?h:void 0,type:r==="input"?d:void 0,disabled:r==="input"?e:void 0,"aria-disabled":!e||r==="input"?void 0:e,rel:r==="a"?y:void 0};let{pressProps:C,isPressed:x}=m.usePress({onPressStart:u,onPressEnd:P,onPressChange:c,onPress:l,onPressUp:p,isDisabled:e,preventFocusOnPress:b,ref:o}),{focusableProps:t}=O.useFocusable(s,o);f&&(t.tabIndex=e?-1:t.tabIndex);let D=a.mergeProps(t,C,a.filterDOMProps(s,{labelable:!0}));return{isPressed:x,buttonProps:a.mergeProps(n,D,{"aria-haspopup":s["aria-haspopup"],"aria-expanded":s["aria-expanded"],"aria-controls":s["aria-controls"],"aria-pressed":s["aria-pressed"],onClick:F=>{i&&(i(F),console.warn("onClick is deprecated, please use onPress"))}})}}exports.useButton=S;
package/index135.mjs CHANGED
@@ -1,34 +1,64 @@
1
- import { useSelectableCollection as b } from "./index190.mjs";
2
- import { ListKeyboardDelegate as n } from "./index195.mjs";
3
- import { useCollator as f } from "@react-aria/i18n";
4
- import { useMemo as g } from "react";
5
- function u(a) {
6
- let { selectionManager: o, collection: l, disabledKeys: t, ref: e, keyboardDelegate: r } = a, i = f({
7
- usage: "search",
8
- sensitivity: "base"
9
- }), s = o.disabledBehavior, d = g(() => r || new n({
10
- collection: l,
11
- disabledKeys: t,
12
- disabledBehavior: s,
13
- ref: e,
14
- collator: i
15
- }), [
16
- r,
17
- l,
18
- t,
19
- e,
20
- i,
21
- s
22
- ]), { collectionProps: c } = b({
23
- ...a,
24
- ref: e,
25
- selectionManager: o,
26
- keyboardDelegate: d
27
- });
1
+ import { mergeProps as i, filterDOMProps as F } from "@react-aria/utils";
2
+ import { useFocusable as $ } from "@react-aria/focus";
3
+ import { usePress as O } from "./index191.mjs";
4
+ function E(s, t) {
5
+ let {
6
+ elementType: r = "button",
7
+ isDisabled: e,
8
+ onPress: l,
9
+ onPressStart: u,
10
+ onPressEnd: p,
11
+ onPressUp: P,
12
+ onPressChange: c,
13
+ preventFocusOnPress: f,
14
+ allowFocusWhenDisabled: b,
15
+ // @ts-ignore
16
+ onClick: o,
17
+ href: h,
18
+ target: m,
19
+ rel: x,
20
+ type: d = "button"
21
+ } = s, n;
22
+ r === "button" ? n = {
23
+ type: d,
24
+ disabled: e
25
+ } : n = {
26
+ role: "button",
27
+ tabIndex: e ? void 0 : 0,
28
+ href: r === "a" && e ? void 0 : h,
29
+ target: r === "a" ? m : void 0,
30
+ type: r === "input" ? d : void 0,
31
+ disabled: r === "input" ? e : void 0,
32
+ "aria-disabled": !e || r === "input" ? void 0 : e,
33
+ rel: r === "a" ? x : void 0
34
+ };
35
+ let { pressProps: g, isPressed: C } = O({
36
+ onPressStart: u,
37
+ onPressEnd: p,
38
+ onPressChange: c,
39
+ onPress: l,
40
+ onPressUp: P,
41
+ isDisabled: e,
42
+ preventFocusOnPress: f,
43
+ ref: t
44
+ }), { focusableProps: a } = $(s, t);
45
+ b && (a.tabIndex = e ? -1 : a.tabIndex);
46
+ let y = i(a, g, F(s, {
47
+ labelable: !0
48
+ }));
28
49
  return {
29
- listProps: c
50
+ isPressed: C,
51
+ buttonProps: i(n, y, {
52
+ "aria-haspopup": s["aria-haspopup"],
53
+ "aria-expanded": s["aria-expanded"],
54
+ "aria-controls": s["aria-controls"],
55
+ "aria-pressed": s["aria-pressed"],
56
+ onClick: (D) => {
57
+ o && (o(D), console.warn("onClick is deprecated, please use onPress"));
58
+ }
59
+ })
30
60
  };
31
61
  }
32
62
  export {
33
- u as useSelectableList
63
+ E as useButton
34
64
  };
package/index136.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),v={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},x={...v,customError:!0,valid:!1},c={isInvalid:!1,validationDetails:v,validationErrors:[]},h=n.createContext({}),I="__formValidationState"+Date.now();function R(e){if(e[I]){let{realtimeValidation:a,displayValidation:t,updateValidation:i,resetValidation:s,commitValidation:l}=e[I];return{realtimeValidation:a,displayValidation:t,updateValidation:i,resetValidation:s,commitValidation:l}}return w(e)}function w(e){let{isInvalid:a,validationState:t,name:i,value:s,builtinValidation:l,validate:d,validationBehavior:o="aria"}=e;t&&(a||(a=t==="invalid"));let V=a!==void 0?{isInvalid:a,validationErrors:[],validationDetails:x}:null,m=n.useMemo(()=>T(F(d,s)),[d,s]);l!=null&&l.validationDetails.valid&&(l=null);let u=n.useContext(h),A=n.useMemo(()=>i?Array.isArray(i)?i.flatMap(r=>D(u[r])):D(u[i]):[],[u,i]),[C,L]=n.useState(u),[g,$]=n.useState(!1);u!==C&&(L(u),$(!1));let b=n.useMemo(()=>T(g?[]:A),[g,A]),M=n.useRef(c),[E,p]=n.useState(c),f=n.useRef(c),_=()=>{if(!O)return;S(!1);let r=m||l||M.current;y(r,f.current)||(f.current=r,p(r))},[O,S]=n.useState(!1);return n.useEffect(_),{realtimeValidation:V||b||m||l||c,displayValidation:o==="native"?V||b||E:V||b||m||l||E,updateValidation(r){o==="aria"&&!y(E,r)?p(r):M.current=r},resetValidation(){let r=c;y(r,f.current)||(f.current=r,p(r)),o==="native"&&S(!1),$(!0)},commitValidation(){o==="native"&&S(!0),$(!0)}}}function D(e){return e?Array.isArray(e)?e:[e]:[]}function F(e,a){if(typeof e=="function"){let t=e(a);if(t&&typeof t!="boolean")return D(t)}return[]}function T(e){return e.length?{isInvalid:!0,validationErrors:e,validationDetails:x}:null}function y(e,a){return e===a?!0:e&&a&&e.isInvalid===a.isInvalid&&e.validationErrors.length===a.validationErrors.length&&e.validationErrors.every((t,i)=>t===a.validationErrors[i])&&Object.entries(e.validationDetails).every(([t,i])=>a.validationDetails[t]===i)}function U(...e){let a=new Set,t=!1,i={...v};for(let d of e){var s,l;for(let o of d.validationErrors)a.add(o);t||(t=d.isInvalid);for(let o in i)(s=i)[l=o]||(s[l]=d.validationDetails[o])}return i.valid=!t,{isInvalid:t,validationErrors:[...a],validationDetails:i}}exports.DEFAULT_VALIDATION_RESULT=c;exports.FormValidationContext=h;exports.VALID_VALIDITY_STATE=v;exports.mergeValidation=U;exports.privateValidationStateProp=I;exports.useFormValidationState=R;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("./index193.js"),x=require("@react-aria/focus"),T=require("@react-aria/utils"),V=require("./index191.js"),j=require("./index196.js"),v=require("react");function N(o){let{selectionManager:t,key:s,ref:c,shouldSelectOnPressUp:L,shouldUseVirtualFocus:d,focus:D,isDisabled:n,onAction:b,allowsDifferentPressOrigin:C,linkBehavior:u="action"}=o,F=T.useRouter(),a=e=>{if(e.pointerType==="keyboard"&&A.isNonContiguousSelectionModifier(e))t.toggleSelection(s);else{if(t.selectionMode==="none")return;if(t.isLink(s)){if(u==="selection"){let f=t.getItemProps(s);F.open(c.current,e,f.href,f.routerOptions),t.setSelectedKeys(t.selectedKeys);return}else if(u==="override"||u==="none")return}t.selectionMode==="single"?t.isSelected(s)&&!t.disallowEmptySelection?t.toggleSelection(s):t.replaceSelection(s):e&&e.shiftKey?t.extendSelection(s):t.selectionBehavior==="toggle"||e&&(A.isCtrlKeyPressed(e)||e.pointerType==="touch"||e.pointerType==="virtual")?t.toggleSelection(s):t.replaceSelection(s)}};v.useEffect(()=>{s===t.focusedKey&&t.isFocused&&!d&&(D?D():document.activeElement!==c.current&&x.focusSafely(c.current))},[c,s,t.focusedKey,t.childFocusStrategy,t.isFocused,d]),n=n||t.isDisabled(s);let y={};!d&&!n?y={tabIndex:s===t.focusedKey?0:-1,onFocus(e){e.target===c.current&&t.setFocusedKey(s)}}:n&&(y.onMouseDown=e=>{e.preventDefault()});let E=t.isLink(s)&&u==="override",O=t.isLink(s)&&u!=="selection"&&u!=="none",r=!n&&t.canSelectItem(s)&&!E,k=(b||O)&&!n,l=k&&(t.selectionBehavior==="replace"?!r:!r||t.isEmpty),h=k&&r&&t.selectionBehavior==="replace",p=l||h,P=v.useRef(null),g=p&&r,m=v.useRef(!1),w=v.useRef(!1),S=e=>{if(b&&b(),O){let f=t.getItemProps(s);F.open(c.current,e,f.href,f.routerOptions)}},i={};L?(i.onPressStart=e=>{P.current=e.pointerType,m.current=g,e.pointerType==="keyboard"&&(!p||$())&&a(e)},C?(i.onPressUp=l?null:e=>{e.pointerType!=="keyboard"&&r&&a(e)},i.onPress=l?S:null):i.onPress=e=>{if(l||h&&e.pointerType!=="mouse"){if(e.pointerType==="keyboard"&&!K())return;S(e)}else e.pointerType!=="keyboard"&&r&&a(e)}):(i.onPressStart=e=>{P.current=e.pointerType,m.current=g,w.current=l,r&&(e.pointerType==="mouse"&&!l||e.pointerType==="keyboard"&&(!k||$()))&&a(e)},i.onPress=e=>{(e.pointerType==="touch"||e.pointerType==="pen"||e.pointerType==="virtual"||e.pointerType==="keyboard"&&p&&K()||e.pointerType==="mouse"&&w.current)&&(p?S(e):r&&a(e))}),y["data-key"]=s,i.preventFocusOnPress=d;let{pressProps:q,isPressed:B}=V.usePress(i),M=h?e=>{P.current==="mouse"&&(e.stopPropagation(),e.preventDefault(),S(e))}:void 0,{longPressProps:I}=j.useLongPress({isDisabled:!g,onLongPress(e){e.pointerType==="touch"&&(a(e),t.setSelectionBehavior("toggle"))}}),R=e=>{P.current==="touch"&&m.current&&e.preventDefault()},U=t.isLink(s)?e=>{T.openLink.isOpening||e.preventDefault()}:void 0;return{itemProps:T.mergeProps(y,r||l?q:{},g?I:{},{onDoubleClick:M,onDragStartCapture:R,onClick:U}),isPressed:B,isSelected:t.isSelected(s),isFocused:t.isFocused&&t.focusedKey===s,isDisabled:n,allowsSelection:r,hasAction:p}}function K(){let o=window.event;return(o==null?void 0:o.key)==="Enter"}function $(){let o=window.event;return(o==null?void 0:o.key)===" "||(o==null?void 0:o.code)==="Space"}exports.useSelectableItem=N;
package/index136.mjs CHANGED
@@ -1,124 +1,97 @@
1
- import { createContext as O, useMemo as I, useContext as U, useState as f, useRef as T, useEffect as R } from "react";
2
- const D = {
3
- badInput: !1,
4
- customError: !1,
5
- patternMismatch: !1,
6
- rangeOverflow: !1,
7
- rangeUnderflow: !1,
8
- stepMismatch: !1,
9
- tooLong: !1,
10
- tooShort: !1,
11
- typeMismatch: !1,
12
- valueMissing: !1,
13
- valid: !0
14
- }, L = {
15
- ...D,
16
- customError: !0,
17
- valid: !1
18
- }, c = {
19
- isInvalid: !1,
20
- validationDetails: D,
21
- validationErrors: []
22
- }, B = O({}), h = "__formValidationState" + Date.now();
23
- function P(a) {
24
- if (a[h]) {
25
- let { realtimeValidation: e, displayValidation: t, updateValidation: i, resetValidation: o, commitValidation: l } = a[h];
26
- return {
27
- realtimeValidation: e,
28
- displayValidation: t,
29
- updateValidation: i,
30
- resetValidation: o,
31
- commitValidation: l
32
- };
33
- }
34
- return Q(a);
35
- }
36
- function Q(a) {
37
- let { isInvalid: e, validationState: t, name: i, value: o, builtinValidation: l, validate: d, validationBehavior: n = "aria" } = a;
38
- t && (e || (e = t === "invalid"));
39
- let v = e !== void 0 ? {
40
- isInvalid: e,
41
- validationErrors: [],
42
- validationDetails: L
43
- } : null, V = I(() => C(Y(d, o)), [
44
- d,
45
- o
46
- ]);
47
- l != null && l.validationDetails.valid && (l = null);
48
- let s = U(B), A = I(() => i ? Array.isArray(i) ? i.flatMap((r) => S(s[r])) : S(s[i]) : [], [
49
- s,
50
- i
51
- ]), [M, _] = f(s), [x, m] = f(!1);
52
- s !== M && (_(s), m(!1));
53
- let $ = I(() => C(x ? [] : A), [
54
- x,
55
- A
56
- ]), g = T(c), [b, E] = f(c), u = T(c), w = () => {
57
- if (!F) return;
58
- p(!1);
59
- let r = V || l || g.current;
60
- y(r, u.current) || (u.current = r, E(r));
61
- }, [F, p] = f(!1);
62
- return R(w), {
63
- realtimeValidation: v || $ || V || l || c,
64
- displayValidation: n === "native" ? v || $ || b : v || $ || V || l || b,
65
- updateValidation(r) {
66
- n === "aria" && !y(b, r) ? E(r) : g.current = r;
67
- },
68
- resetValidation() {
69
- let r = c;
70
- y(r, u.current) || (u.current = r, E(r)), n === "native" && p(!1), m(!0);
71
- },
72
- commitValidation() {
73
- n === "native" && p(!0), m(!0);
1
+ import { isNonContiguousSelectionModifier as U, isCtrlKeyPressed as R } from "./index193.mjs";
2
+ import { focusSafely as V } from "@react-aria/focus";
3
+ import { useRouter as N, openLink as j, mergeProps as q } from "@react-aria/utils";
4
+ import { usePress as z } from "./index191.mjs";
5
+ import { useLongPress as G } from "./index196.mjs";
6
+ import { useEffect as H, useRef as h } from "react";
7
+ function _(r) {
8
+ let { selectionManager: t, key: o, ref: c, shouldSelectOnPressUp: K, shouldUseVirtualFocus: d, focus: $, isDisabled: n, onAction: g, allowsDifferentPressOrigin: O, linkBehavior: a = "action" } = r, T = N(), p = (e) => {
9
+ if (e.pointerType === "keyboard" && U(e)) t.toggleSelection(o);
10
+ else {
11
+ if (t.selectionMode === "none") return;
12
+ if (t.isLink(o)) {
13
+ if (a === "selection") {
14
+ let f = t.getItemProps(o);
15
+ T.open(c.current, e, f.href, f.routerOptions), t.setSelectedKeys(t.selectedKeys);
16
+ return;
17
+ } else if (a === "override" || a === "none") return;
18
+ }
19
+ t.selectionMode === "single" ? t.isSelected(o) && !t.disallowEmptySelection ? t.toggleSelection(o) : t.replaceSelection(o) : e && e.shiftKey ? t.extendSelection(o) : t.selectionBehavior === "toggle" || e && (R(e) || e.pointerType === "touch" || e.pointerType === "virtual") ? t.toggleSelection(o) : t.replaceSelection(o);
74
20
  }
75
21
  };
22
+ H(() => {
23
+ o === t.focusedKey && t.isFocused && !d && ($ ? $() : document.activeElement !== c.current && V(c.current));
24
+ }, [
25
+ c,
26
+ o,
27
+ t.focusedKey,
28
+ t.childFocusStrategy,
29
+ t.isFocused,
30
+ d
31
+ ]), n = n || t.isDisabled(o);
32
+ let y = {};
33
+ !d && !n ? y = {
34
+ tabIndex: o === t.focusedKey ? 0 : -1,
35
+ onFocus(e) {
36
+ e.target === c.current && t.setFocusedKey(o);
37
+ }
38
+ } : n && (y.onMouseDown = (e) => {
39
+ e.preventDefault();
40
+ });
41
+ let L = t.isLink(o) && a === "override", D = t.isLink(o) && a !== "selection" && a !== "none", i = !n && t.canSelectItem(o) && !L, S = (g || D) && !n, l = S && (t.selectionBehavior === "replace" ? !i : !i || t.isEmpty), v = S && i && t.selectionBehavior === "replace", u = l || v, P = h(null), m = u && i, k = h(!1), F = h(!1), b = (e) => {
42
+ if (g && g(), D) {
43
+ let f = t.getItemProps(o);
44
+ T.open(c.current, e, f.href, f.routerOptions);
45
+ }
46
+ }, s = {};
47
+ K ? (s.onPressStart = (e) => {
48
+ P.current = e.pointerType, k.current = m, e.pointerType === "keyboard" && (!u || A()) && p(e);
49
+ }, O ? (s.onPressUp = l ? null : (e) => {
50
+ e.pointerType !== "keyboard" && i && p(e);
51
+ }, s.onPress = l ? b : null) : s.onPress = (e) => {
52
+ if (l || v && e.pointerType !== "mouse") {
53
+ if (e.pointerType === "keyboard" && !w()) return;
54
+ b(e);
55
+ } else e.pointerType !== "keyboard" && i && p(e);
56
+ }) : (s.onPressStart = (e) => {
57
+ P.current = e.pointerType, k.current = m, F.current = l, i && (e.pointerType === "mouse" && !l || e.pointerType === "keyboard" && (!S || A())) && p(e);
58
+ }, s.onPress = (e) => {
59
+ (e.pointerType === "touch" || e.pointerType === "pen" || e.pointerType === "virtual" || e.pointerType === "keyboard" && u && w() || e.pointerType === "mouse" && F.current) && (u ? b(e) : i && p(e));
60
+ }), y["data-key"] = o, s.preventFocusOnPress = d;
61
+ let { pressProps: x, isPressed: C } = z(s), E = v ? (e) => {
62
+ P.current === "mouse" && (e.stopPropagation(), e.preventDefault(), b(e));
63
+ } : void 0, { longPressProps: B } = G({
64
+ isDisabled: !m,
65
+ onLongPress(e) {
66
+ e.pointerType === "touch" && (p(e), t.setSelectionBehavior("toggle"));
67
+ }
68
+ }), I = (e) => {
69
+ P.current === "touch" && k.current && e.preventDefault();
70
+ }, M = t.isLink(o) ? (e) => {
71
+ j.isOpening || e.preventDefault();
72
+ } : void 0;
73
+ return {
74
+ itemProps: q(y, i || l ? x : {}, m ? B : {}, {
75
+ onDoubleClick: E,
76
+ onDragStartCapture: I,
77
+ onClick: M
78
+ }),
79
+ isPressed: C,
80
+ isSelected: t.isSelected(o),
81
+ isFocused: t.isFocused && t.focusedKey === o,
82
+ isDisabled: n,
83
+ allowsSelection: i,
84
+ hasAction: u
85
+ };
76
86
  }
77
- function S(a) {
78
- return a ? Array.isArray(a) ? a : [
79
- a
80
- ] : [];
81
- }
82
- function Y(a, e) {
83
- if (typeof a == "function") {
84
- let t = a(e);
85
- if (t && typeof t != "boolean") return S(t);
86
- }
87
- return [];
88
- }
89
- function C(a) {
90
- return a.length ? {
91
- isInvalid: !0,
92
- validationErrors: a,
93
- validationDetails: L
94
- } : null;
95
- }
96
- function y(a, e) {
97
- return a === e ? !0 : a && e && a.isInvalid === e.isInvalid && a.validationErrors.length === e.validationErrors.length && a.validationErrors.every((t, i) => t === e.validationErrors[i]) && Object.entries(a.validationDetails).every(([t, i]) => e.validationDetails[t] === i);
87
+ function w() {
88
+ let r = window.event;
89
+ return (r == null ? void 0 : r.key) === "Enter";
98
90
  }
99
- function k(...a) {
100
- let e = /* @__PURE__ */ new Set(), t = !1, i = {
101
- ...D
102
- };
103
- for (let d of a) {
104
- var o, l;
105
- for (let n of d.validationErrors) e.add(n);
106
- t || (t = d.isInvalid);
107
- for (let n in i) (o = i)[l = n] || (o[l] = d.validationDetails[n]);
108
- }
109
- return i.valid = !t, {
110
- isInvalid: t,
111
- validationErrors: [
112
- ...e
113
- ],
114
- validationDetails: i
115
- };
91
+ function A() {
92
+ let r = window.event;
93
+ return (r == null ? void 0 : r.key) === " " || (r == null ? void 0 : r.code) === "Space";
116
94
  }
117
95
  export {
118
- c as DEFAULT_VALIDATION_RESULT,
119
- B as FormValidationContext,
120
- D as VALID_VALIDITY_STATE,
121
- k as mergeValidation,
122
- h as privateValidationStateProp,
123
- P as useFormValidationState
96
+ _ as useSelectableItem
124
97
  };
package/index137.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react");function C(o,b,u){let[p,s]=l.useState(o||b),i=l.useRef(o!==void 0),e=o!==void 0;l.useEffect(()=>{let t=i.current;t!==e&&console.warn(`WARN: A component changed from ${t?"controlled":"uncontrolled"} to ${e?"controlled":"uncontrolled"}.`),i.current=e},[e]);let n=e?o:p,S=l.useCallback((t,...f)=>{let a=(r,...c)=>{u&&(Object.is(n,r)||u(r,...c)),e||(n=r)};typeof t=="function"?(console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"),s((c,...m)=>{let d=t(e?n:c,...m);return a(d,...f),e?c:d})):(e||s(t),a(t,...f))},[e,n,u]);return[n,S]}exports.useControlledState=C;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index192.js"),u=require("./index197.js"),g=require("@react-aria/i18n"),y=require("react");function D(l){let{selectionManager:t,collection:o,disabledKeys:a,ref:e,keyboardDelegate:r,layoutDelegate:i}=l,s=g.useCollator({usage:"search",sensitivity:"base"}),c=t.disabledBehavior,n=y.useMemo(()=>r||new u.ListKeyboardDelegate({collection:o,disabledKeys:a,disabledBehavior:c,ref:e,collator:s,layoutDelegate:i}),[r,i,o,a,e,s,c]),{collectionProps:d}=b.useSelectableCollection({...l,ref:e,selectionManager:t,keyboardDelegate:n});return{listProps:d}}exports.useSelectableList=D;
package/index137.mjs CHANGED
@@ -1,30 +1,36 @@
1
- import { useState as C, useRef as $, useEffect as S, useCallback as V } from "react";
2
- function w(o, d, c) {
3
- let [p, s] = C(o || d), u = $(o !== void 0), e = o !== void 0;
4
- S(() => {
5
- let t = u.current;
6
- t !== e && console.warn(`WARN: A component changed from ${t ? "controlled" : "uncontrolled"} to ${e ? "controlled" : "uncontrolled"}.`), u.current = e;
7
- }, [
8
- e
9
- ]);
10
- let n = e ? o : p, b = V((t, ...i) => {
11
- let f = (r, ...l) => {
12
- c && (Object.is(n, r) || c(r, ...l)), e || (n = r);
13
- };
14
- typeof t == "function" ? (console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"), s((l, ...m) => {
15
- let a = t(e ? n : l, ...m);
16
- return f(a, ...i), e ? l : a;
17
- })) : (e || s(t), f(t, ...i));
18
- }, [
1
+ import { useSelectableCollection as n } from "./index192.mjs";
2
+ import { ListKeyboardDelegate as g } from "./index197.mjs";
3
+ import { useCollator as f } from "@react-aria/i18n";
4
+ import { useMemo as y } from "react";
5
+ function D(a) {
6
+ let { selectionManager: l, collection: o, disabledKeys: t, ref: e, keyboardDelegate: r, layoutDelegate: i } = a, s = f({
7
+ usage: "search",
8
+ sensitivity: "base"
9
+ }), d = l.disabledBehavior, c = y(() => r || new g({
10
+ collection: o,
11
+ disabledKeys: t,
12
+ disabledBehavior: d,
13
+ ref: e,
14
+ collator: s,
15
+ layoutDelegate: i
16
+ }), [
17
+ r,
18
+ i,
19
+ o,
20
+ t,
19
21
  e,
20
- n,
21
- c
22
- ]);
23
- return [
24
- n,
25
- b
26
- ];
22
+ s,
23
+ d
24
+ ]), { collectionProps: b } = n({
25
+ ...a,
26
+ ref: e,
27
+ selectionManager: l,
28
+ keyboardDelegate: c
29
+ });
30
+ return {
31
+ listProps: b
32
+ };
27
33
  }
28
34
  export {
29
- w as useControlledState
35
+ D as useSelectableList
30
36
  };
package/index138.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index139.js"),l=require("./index130.js"),d=require("./index140.js"),f=require("./index141.js"),u=require("./index142.js"),y=require("./index143.js");function m(s){let t=typeof s[0]=="object"?s.shift():new f.GregorianCalendar,e;if(typeof s[0]=="string")e=s.shift();else{let a=t.getEras();e=a[a.length-1]}let r=s.shift(),n=s.shift(),h=s.shift();return[t,e,r,n,h]}var p=new WeakMap;class c{copy(){return this.era?new c(this.calendar,this.era,this.year,this.month,this.day):new c(this.calendar,this.year,this.month,this.day)}add(t){return i.add(this,t)}subtract(t){return i.subtract(this,t)}set(t){return i.set(this,t)}cycle(t,e,r){return i.cycleDate(this,t,e,r)}toDate(t){return u.toDate(this,t)}toString(){return d.dateToString(this)}compare(t){return l.compareDate(this,t)}constructor(...t){y._class_private_field_init(this,p,{writable:!0,value:void 0});let[e,r,n,h,a]=m(t);this.calendar=e,this.era=r,this.year=n,this.month=h,this.day=a,i.constrain(this)}}var v=new WeakMap;class o{copy(){return this.era?new o(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new o(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return i.add(this,t)}subtract(t){return i.subtract(this,t)}set(t){return i.set(i.setTime(this,t),t)}cycle(t,e,r){switch(t){case"era":case"year":case"month":case"day":return i.cycleDate(this,t,e,r);default:return i.cycleTime(this,t,e,r)}}toDate(t,e){return u.toDate(this,t,e)}toString(){return d.dateTimeToString(this)}compare(t){let e=l.compareDate(this,t);return e===0?l.compareTime(this,u.toCalendarDateTime(t)):e}constructor(...t){y._class_private_field_init(this,v,{writable:!0,value:void 0});let[e,r,n,h,a]=m(t);this.calendar=e,this.era=r,this.year=n,this.month=h,this.day=a,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,i.constrain(this)}}exports.CalendarDate=c;exports.CalendarDateTime=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),v={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},x={...v,customError:!0,valid:!1},c={isInvalid:!1,validationDetails:v,validationErrors:[]},h=n.createContext({}),I="__formValidationState"+Date.now();function R(e){if(e[I]){let{realtimeValidation:a,displayValidation:t,updateValidation:i,resetValidation:s,commitValidation:l}=e[I];return{realtimeValidation:a,displayValidation:t,updateValidation:i,resetValidation:s,commitValidation:l}}return w(e)}function w(e){let{isInvalid:a,validationState:t,name:i,value:s,builtinValidation:l,validate:d,validationBehavior:o="aria"}=e;t&&(a||(a=t==="invalid"));let V=a!==void 0?{isInvalid:a,validationErrors:[],validationDetails:x}:null,m=n.useMemo(()=>T(F(d,s)),[d,s]);l!=null&&l.validationDetails.valid&&(l=null);let u=n.useContext(h),A=n.useMemo(()=>i?Array.isArray(i)?i.flatMap(r=>D(u[r])):D(u[i]):[],[u,i]),[C,L]=n.useState(u),[g,$]=n.useState(!1);u!==C&&(L(u),$(!1));let b=n.useMemo(()=>T(g?[]:A),[g,A]),M=n.useRef(c),[E,p]=n.useState(c),f=n.useRef(c),_=()=>{if(!O)return;S(!1);let r=m||l||M.current;y(r,f.current)||(f.current=r,p(r))},[O,S]=n.useState(!1);return n.useEffect(_),{realtimeValidation:V||b||m||l||c,displayValidation:o==="native"?V||b||E:V||b||m||l||E,updateValidation(r){o==="aria"&&!y(E,r)?p(r):M.current=r},resetValidation(){let r=c;y(r,f.current)||(f.current=r,p(r)),o==="native"&&S(!1),$(!0)},commitValidation(){o==="native"&&S(!0),$(!0)}}}function D(e){return e?Array.isArray(e)?e:[e]:[]}function F(e,a){if(typeof e=="function"){let t=e(a);if(t&&typeof t!="boolean")return D(t)}return[]}function T(e){return e.length?{isInvalid:!0,validationErrors:e,validationDetails:x}:null}function y(e,a){return e===a?!0:e&&a&&e.isInvalid===a.isInvalid&&e.validationErrors.length===a.validationErrors.length&&e.validationErrors.every((t,i)=>t===a.validationErrors[i])&&Object.entries(e.validationDetails).every(([t,i])=>a.validationDetails[t]===i)}function U(...e){let a=new Set,t=!1,i={...v};for(let d of e){var s,l;for(let o of d.validationErrors)a.add(o);t||(t=d.isInvalid);for(let o in i)(s=i)[l=o]||(s[l]=d.validationDetails[o])}return i.valid=!t,{isInvalid:t,validationErrors:[...a],validationDetails:i}}exports.DEFAULT_VALIDATION_RESULT=c;exports.FormValidationContext=h;exports.VALID_VALIDITY_STATE=v;exports.mergeValidation=U;exports.privateValidationStateProp=I;exports.useFormValidationState=R;