@solid2-aria/stately 0.0.0-stage → 0.0.1

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 (477) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +45 -2
  3. package/dist/LICENSES/Apache-2.0.txt +201 -0
  4. package/dist/LICENSES/react-spectrum-NOTICE.txt +242 -0
  5. package/dist/NOTICE.txt +636 -0
  6. package/dist/autocomplete/create-autocomplete-state.d.ts +46 -0
  7. package/dist/autocomplete/create-autocomplete-state.js +41 -0
  8. package/dist/autocomplete/create-autocomplete-state.js.map +1 -0
  9. package/dist/calendar/create-calendar-state.d.ts +62 -0
  10. package/dist/calendar/create-calendar-state.js +357 -0
  11. package/dist/calendar/create-calendar-state.js.map +1 -0
  12. package/dist/calendar/create-range-calendar-state.d.ts +63 -0
  13. package/dist/calendar/create-range-calendar-state.js +204 -0
  14. package/dist/calendar/create-range-calendar-state.js.map +1 -0
  15. package/dist/calendar/types.d.ts +222 -0
  16. package/dist/calendar/types.js +16 -0
  17. package/dist/calendar/utils.d.ts +27 -0
  18. package/dist/calendar/utils.js +81 -0
  19. package/dist/calendar/utils.js.map +1 -0
  20. package/dist/checkbox/create-checkbox-group-state.d.ts +60 -0
  21. package/dist/checkbox/create-checkbox-group-state.js +88 -0
  22. package/dist/checkbox/create-checkbox-group-state.js.map +1 -0
  23. package/dist/collections/collection-builder.d.ts +28 -0
  24. package/dist/collections/collection-builder.js +164 -0
  25. package/dist/collections/collection-builder.js.map +1 -0
  26. package/dist/collections/create-collection.d.ts +24 -0
  27. package/dist/collections/create-collection.js +35 -0
  28. package/dist/collections/create-collection.js.map +1 -0
  29. package/dist/collections/get-child-nodes.d.ts +25 -0
  30. package/dist/collections/get-child-nodes.js +67 -0
  31. package/dist/collections/get-child-nodes.js.map +1 -0
  32. package/dist/collections/get-item-count.d.ts +19 -0
  33. package/dist/collections/get-item-count.js +34 -0
  34. package/dist/collections/get-item-count.js.map +1 -0
  35. package/dist/collections/item.d.ts +29 -0
  36. package/dist/collections/item.js +68 -0
  37. package/dist/collections/item.js.map +1 -0
  38. package/dist/collections/section.d.ts +29 -0
  39. package/dist/collections/section.js +60 -0
  40. package/dist/collections/section.js.map +1 -0
  41. package/dist/collections/types.d.ts +46 -0
  42. package/dist/collections/types.js +29 -0
  43. package/dist/collections/types.js.map +1 -0
  44. package/dist/color/color/base-color.d.ts +40 -0
  45. package/dist/color/color/base-color.js +122 -0
  46. package/dist/color/color/base-color.js.map +1 -0
  47. package/dist/color/color/color-classes.d.ts +27 -0
  48. package/dist/color/color/color-classes.js +29 -0
  49. package/dist/color/color/color-classes.js.map +1 -0
  50. package/dist/color/color/color-constructors.d.ts +23 -0
  51. package/dist/color/color/color-constructors.js +16 -0
  52. package/dist/color/color/color.d.ts +3 -0
  53. package/dist/color/color/color.js +2 -0
  54. package/dist/color/color/hsb-color.d.ts +24 -0
  55. package/dist/color/color/hsb-color.js +183 -0
  56. package/dist/color/color/hsb-color.js.map +1 -0
  57. package/dist/color/color/hsl-color.d.ts +24 -0
  58. package/dist/color/color/hsl-color.js +184 -0
  59. package/dist/color/color/hsl-color.js.map +1 -0
  60. package/dist/color/color/normalize-hue.d.ts +18 -0
  61. package/dist/color/color/normalize-hue.js +24 -0
  62. package/dist/color/color/normalize-hue.js.map +1 -0
  63. package/dist/color/color/oklch.d.ts +19 -0
  64. package/dist/color/color/oklch.js +97 -0
  65. package/dist/color/color/oklch.js.map +1 -0
  66. package/dist/color/color/rgb-color.d.ts +24 -0
  67. package/dist/color/color/rgb-color.js +230 -0
  68. package/dist/color/color/rgb-color.js.map +1 -0
  69. package/dist/color/color.d.ts +25 -0
  70. package/dist/color/color.js +41 -0
  71. package/dist/color/color.js.map +1 -0
  72. package/dist/color/create-color-area-state.d.ts +105 -0
  73. package/dist/color/create-color-area-state.js +138 -0
  74. package/dist/color/create-color-area-state.js.map +1 -0
  75. package/dist/color/create-color-channel-field-state.d.ts +29 -0
  76. package/dist/color/create-color-channel-field-state.js +69 -0
  77. package/dist/color/create-color-channel-field-state.js.map +1 -0
  78. package/dist/color/create-color-field-state.d.ts +61 -0
  79. package/dist/color/create-color-field-state.js +113 -0
  80. package/dist/color/create-color-field-state.js.map +1 -0
  81. package/dist/color/create-color-picker-state.d.ts +16 -0
  82. package/dist/color/create-color-picker-state.js +26 -0
  83. package/dist/color/create-color-picker-state.js.map +1 -0
  84. package/dist/color/create-color-slider-state.d.ts +50 -0
  85. package/dist/color/create-color-slider-state.js +93 -0
  86. package/dist/color/create-color-slider-state.js.map +1 -0
  87. package/dist/color/create-color-wheel-state.d.ts +76 -0
  88. package/dist/color/create-color-wheel-state.js +130 -0
  89. package/dist/color/create-color-wheel-state.js.map +1 -0
  90. package/dist/color/create-color.d.ts +20 -0
  91. package/dist/color/create-color.js +33 -0
  92. package/dist/color/create-color.js.map +1 -0
  93. package/dist/color/types.d.ts +87 -0
  94. package/dist/color/types.js +5 -0
  95. package/dist/combobox/create-combo-box-state.d.ts +157 -0
  96. package/dist/combobox/create-combo-box-state.js +450 -0
  97. package/dist/combobox/create-combo-box-state.js.map +1 -0
  98. package/dist/data/create-async-list.d.ts +88 -0
  99. package/dist/data/create-async-list.js +276 -0
  100. package/dist/data/create-async-list.js.map +1 -0
  101. package/dist/data/create-list-data.d.ts +140 -0
  102. package/dist/data/create-list-data.js +250 -0
  103. package/dist/data/create-list-data.js.map +1 -0
  104. package/dist/data/create-tree-data.d.ts +134 -0
  105. package/dist/data/create-tree-data.js +364 -0
  106. package/dist/data/create-tree-data.js.map +1 -0
  107. package/dist/datepicker/create-date-field-state.d.ts +138 -0
  108. package/dist/datepicker/create-date-field-state.js +449 -0
  109. package/dist/datepicker/create-date-field-state.js.map +1 -0
  110. package/dist/datepicker/create-date-picker-state.d.ts +82 -0
  111. package/dist/datepicker/create-date-picker-state.js +191 -0
  112. package/dist/datepicker/create-date-picker-state.js.map +1 -0
  113. package/dist/datepicker/create-date-range-picker-state.d.ts +97 -0
  114. package/dist/datepicker/create-date-range-picker-state.js +305 -0
  115. package/dist/datepicker/create-date-range-picker-state.js.map +1 -0
  116. package/dist/datepicker/create-time-field-state.d.ts +34 -0
  117. package/dist/datepicker/create-time-field-state.js +128 -0
  118. package/dist/datepicker/create-time-field-state.js.map +1 -0
  119. package/dist/datepicker/incomplete-date.d.ts +71 -0
  120. package/dist/datepicker/incomplete-date.js +324 -0
  121. package/dist/datepicker/incomplete-date.js.map +1 -0
  122. package/dist/datepicker/placeholders.d.ts +18 -0
  123. package/dist/datepicker/placeholders.js +418 -0
  124. package/dist/datepicker/placeholders.js.map +1 -0
  125. package/dist/datepicker/types.d.ts +131 -0
  126. package/dist/datepicker/types.js +16 -0
  127. package/dist/datepicker/utils.d.ts +37 -0
  128. package/dist/datepicker/utils.js +168 -0
  129. package/dist/datepicker/utils.js.map +1 -0
  130. package/dist/disclosure/create-disclosure-group-state.d.ts +47 -0
  131. package/dist/disclosure/create-disclosure-group-state.js +62 -0
  132. package/dist/disclosure/create-disclosure-group-state.js.map +1 -0
  133. package/dist/disclosure/create-disclosure-state.d.ts +42 -0
  134. package/dist/disclosure/create-disclosure-state.js +49 -0
  135. package/dist/disclosure/create-disclosure-state.js.map +1 -0
  136. package/dist/dnd/create-draggable-collection-state.d.ts +63 -0
  137. package/dist/dnd/create-draggable-collection-state.js +136 -0
  138. package/dist/dnd/create-draggable-collection-state.js.map +1 -0
  139. package/dist/dnd/create-droppable-collection-state.d.ts +55 -0
  140. package/dist/dnd/create-droppable-collection-state.js +155 -0
  141. package/dist/dnd/create-droppable-collection-state.js.map +1 -0
  142. package/dist/flags/flags.d.ts +21 -0
  143. package/dist/flags/flags.js +34 -0
  144. package/dist/flags/flags.js.map +1 -0
  145. package/dist/form/create-form-validation-state.d.ts +37 -0
  146. package/dist/form/create-form-validation-state.js +152 -0
  147. package/dist/form/create-form-validation-state.js.map +1 -0
  148. package/dist/grid/create-grid-state.d.ts +38 -0
  149. package/dist/grid/create-grid-state.js +85 -0
  150. package/dist/grid/create-grid-state.js.map +1 -0
  151. package/dist/grid/grid-collection.d.ts +68 -0
  152. package/dist/grid/grid-collection.js +133 -0
  153. package/dist/grid/grid-collection.js.map +1 -0
  154. package/dist/index.d.ts +91 -0
  155. package/dist/index.js +86 -0
  156. package/dist/intl/color/ar-AE.js +44 -0
  157. package/dist/intl/color/ar-AE.js.map +1 -0
  158. package/dist/intl/color/bg-BG.js +44 -0
  159. package/dist/intl/color/bg-BG.js.map +1 -0
  160. package/dist/intl/color/cs-CZ.js +44 -0
  161. package/dist/intl/color/cs-CZ.js.map +1 -0
  162. package/dist/intl/color/da-DK.js +44 -0
  163. package/dist/intl/color/da-DK.js.map +1 -0
  164. package/dist/intl/color/de-DE.js +44 -0
  165. package/dist/intl/color/de-DE.js.map +1 -0
  166. package/dist/intl/color/el-GR.js +44 -0
  167. package/dist/intl/color/el-GR.js.map +1 -0
  168. package/dist/intl/color/en-US.js +44 -0
  169. package/dist/intl/color/en-US.js.map +1 -0
  170. package/dist/intl/color/es-ES.js +44 -0
  171. package/dist/intl/color/es-ES.js.map +1 -0
  172. package/dist/intl/color/et-EE.js +44 -0
  173. package/dist/intl/color/et-EE.js.map +1 -0
  174. package/dist/intl/color/fi-FI.js +44 -0
  175. package/dist/intl/color/fi-FI.js.map +1 -0
  176. package/dist/intl/color/fr-FR.js +44 -0
  177. package/dist/intl/color/fr-FR.js.map +1 -0
  178. package/dist/intl/color/he-IL.js +44 -0
  179. package/dist/intl/color/he-IL.js.map +1 -0
  180. package/dist/intl/color/hr-HR.js +44 -0
  181. package/dist/intl/color/hr-HR.js.map +1 -0
  182. package/dist/intl/color/hu-HU.js +44 -0
  183. package/dist/intl/color/hu-HU.js.map +1 -0
  184. package/dist/intl/color/index.js +75 -0
  185. package/dist/intl/color/index.js.map +1 -0
  186. package/dist/intl/color/it-IT.js +44 -0
  187. package/dist/intl/color/it-IT.js.map +1 -0
  188. package/dist/intl/color/ja-JP.js +44 -0
  189. package/dist/intl/color/ja-JP.js.map +1 -0
  190. package/dist/intl/color/ko-KR.js +44 -0
  191. package/dist/intl/color/ko-KR.js.map +1 -0
  192. package/dist/intl/color/lt-LT.js +44 -0
  193. package/dist/intl/color/lt-LT.js.map +1 -0
  194. package/dist/intl/color/lv-LV.js +44 -0
  195. package/dist/intl/color/lv-LV.js.map +1 -0
  196. package/dist/intl/color/nb-NO.js +44 -0
  197. package/dist/intl/color/nb-NO.js.map +1 -0
  198. package/dist/intl/color/nl-NL.js +44 -0
  199. package/dist/intl/color/nl-NL.js.map +1 -0
  200. package/dist/intl/color/pl-PL.js +44 -0
  201. package/dist/intl/color/pl-PL.js.map +1 -0
  202. package/dist/intl/color/pt-BR.js +44 -0
  203. package/dist/intl/color/pt-BR.js.map +1 -0
  204. package/dist/intl/color/pt-PT.js +44 -0
  205. package/dist/intl/color/pt-PT.js.map +1 -0
  206. package/dist/intl/color/ro-RO.js +44 -0
  207. package/dist/intl/color/ro-RO.js.map +1 -0
  208. package/dist/intl/color/ru-RU.js +44 -0
  209. package/dist/intl/color/ru-RU.js.map +1 -0
  210. package/dist/intl/color/sk-SK.js +44 -0
  211. package/dist/intl/color/sk-SK.js.map +1 -0
  212. package/dist/intl/color/sl-SI.js +44 -0
  213. package/dist/intl/color/sl-SI.js.map +1 -0
  214. package/dist/intl/color/sr-SP.js +44 -0
  215. package/dist/intl/color/sr-SP.js.map +1 -0
  216. package/dist/intl/color/sv-SE.js +44 -0
  217. package/dist/intl/color/sv-SE.js.map +1 -0
  218. package/dist/intl/color/tr-TR.js +44 -0
  219. package/dist/intl/color/tr-TR.js.map +1 -0
  220. package/dist/intl/color/uk-UA.js +44 -0
  221. package/dist/intl/color/uk-UA.js.map +1 -0
  222. package/dist/intl/color/zh-CN.js +44 -0
  223. package/dist/intl/color/zh-CN.js.map +1 -0
  224. package/dist/intl/color/zh-TW.js +44 -0
  225. package/dist/intl/color/zh-TW.js.map +1 -0
  226. package/dist/intl/datepicker/ar-AE.js +11 -0
  227. package/dist/intl/datepicker/ar-AE.js.map +1 -0
  228. package/dist/intl/datepicker/bg-BG.js +11 -0
  229. package/dist/intl/datepicker/bg-BG.js.map +1 -0
  230. package/dist/intl/datepicker/cs-CZ.js +11 -0
  231. package/dist/intl/datepicker/cs-CZ.js.map +1 -0
  232. package/dist/intl/datepicker/da-DK.js +11 -0
  233. package/dist/intl/datepicker/da-DK.js.map +1 -0
  234. package/dist/intl/datepicker/de-DE.js +11 -0
  235. package/dist/intl/datepicker/de-DE.js.map +1 -0
  236. package/dist/intl/datepicker/el-GR.js +11 -0
  237. package/dist/intl/datepicker/el-GR.js.map +1 -0
  238. package/dist/intl/datepicker/en-US.js +11 -0
  239. package/dist/intl/datepicker/en-US.js.map +1 -0
  240. package/dist/intl/datepicker/es-ES.js +11 -0
  241. package/dist/intl/datepicker/es-ES.js.map +1 -0
  242. package/dist/intl/datepicker/et-EE.js +11 -0
  243. package/dist/intl/datepicker/et-EE.js.map +1 -0
  244. package/dist/intl/datepicker/fi-FI.js +11 -0
  245. package/dist/intl/datepicker/fi-FI.js.map +1 -0
  246. package/dist/intl/datepicker/fr-FR.js +11 -0
  247. package/dist/intl/datepicker/fr-FR.js.map +1 -0
  248. package/dist/intl/datepicker/he-IL.js +11 -0
  249. package/dist/intl/datepicker/he-IL.js.map +1 -0
  250. package/dist/intl/datepicker/hr-HR.js +11 -0
  251. package/dist/intl/datepicker/hr-HR.js.map +1 -0
  252. package/dist/intl/datepicker/hu-HU.js +11 -0
  253. package/dist/intl/datepicker/hu-HU.js.map +1 -0
  254. package/dist/intl/datepicker/index.js +75 -0
  255. package/dist/intl/datepicker/index.js.map +1 -0
  256. package/dist/intl/datepicker/it-IT.js +11 -0
  257. package/dist/intl/datepicker/it-IT.js.map +1 -0
  258. package/dist/intl/datepicker/ja-JP.js +11 -0
  259. package/dist/intl/datepicker/ja-JP.js.map +1 -0
  260. package/dist/intl/datepicker/ko-KR.js +11 -0
  261. package/dist/intl/datepicker/ko-KR.js.map +1 -0
  262. package/dist/intl/datepicker/lt-LT.js +11 -0
  263. package/dist/intl/datepicker/lt-LT.js.map +1 -0
  264. package/dist/intl/datepicker/lv-LV.js +11 -0
  265. package/dist/intl/datepicker/lv-LV.js.map +1 -0
  266. package/dist/intl/datepicker/nb-NO.js +11 -0
  267. package/dist/intl/datepicker/nb-NO.js.map +1 -0
  268. package/dist/intl/datepicker/nl-NL.js +11 -0
  269. package/dist/intl/datepicker/nl-NL.js.map +1 -0
  270. package/dist/intl/datepicker/pl-PL.js +11 -0
  271. package/dist/intl/datepicker/pl-PL.js.map +1 -0
  272. package/dist/intl/datepicker/pt-BR.js +11 -0
  273. package/dist/intl/datepicker/pt-BR.js.map +1 -0
  274. package/dist/intl/datepicker/pt-PT.js +11 -0
  275. package/dist/intl/datepicker/pt-PT.js.map +1 -0
  276. package/dist/intl/datepicker/ro-RO.js +11 -0
  277. package/dist/intl/datepicker/ro-RO.js.map +1 -0
  278. package/dist/intl/datepicker/ru-RU.js +11 -0
  279. package/dist/intl/datepicker/ru-RU.js.map +1 -0
  280. package/dist/intl/datepicker/sk-SK.js +11 -0
  281. package/dist/intl/datepicker/sk-SK.js.map +1 -0
  282. package/dist/intl/datepicker/sl-SI.js +11 -0
  283. package/dist/intl/datepicker/sl-SI.js.map +1 -0
  284. package/dist/intl/datepicker/sr-SP.js +11 -0
  285. package/dist/intl/datepicker/sr-SP.js.map +1 -0
  286. package/dist/intl/datepicker/sv-SE.js +11 -0
  287. package/dist/intl/datepicker/sv-SE.js.map +1 -0
  288. package/dist/intl/datepicker/tr-TR.js +11 -0
  289. package/dist/intl/datepicker/tr-TR.js.map +1 -0
  290. package/dist/intl/datepicker/uk-UA.js +11 -0
  291. package/dist/intl/datepicker/uk-UA.js.map +1 -0
  292. package/dist/intl/datepicker/zh-CN.js +11 -0
  293. package/dist/intl/datepicker/zh-CN.js.map +1 -0
  294. package/dist/intl/datepicker/zh-TW.js +11 -0
  295. package/dist/intl/datepicker/zh-TW.js.map +1 -0
  296. package/dist/layout/grid-layout.d.ts +107 -0
  297. package/dist/layout/grid-layout.js +253 -0
  298. package/dist/layout/grid-layout.js.map +1 -0
  299. package/dist/layout/list-layout.d.ts +187 -0
  300. package/dist/layout/list-layout.js +488 -0
  301. package/dist/layout/list-layout.js.map +1 -0
  302. package/dist/layout/table-layout.d.ts +98 -0
  303. package/dist/layout/table-layout.js +476 -0
  304. package/dist/layout/table-layout.js.map +1 -0
  305. package/dist/layout/waterfall-layout.d.ts +85 -0
  306. package/dist/layout/waterfall-layout.js +225 -0
  307. package/dist/layout/waterfall-layout.js.map +1 -0
  308. package/dist/list/create-list-state.d.ts +48 -0
  309. package/dist/list/create-list-state.js +123 -0
  310. package/dist/list/create-list-state.js.map +1 -0
  311. package/dist/list/create-single-select-list-state.d.ts +38 -0
  312. package/dist/list/create-single-select-list-state.js +55 -0
  313. package/dist/list/create-single-select-list-state.js.map +1 -0
  314. package/dist/list/list-collection.d.ts +36 -0
  315. package/dist/list/list-collection.js +91 -0
  316. package/dist/list/list-collection.js.map +1 -0
  317. package/dist/menu/create-menu-trigger-state.d.ts +55 -0
  318. package/dist/menu/create-menu-trigger-state.js +58 -0
  319. package/dist/menu/create-menu-trigger-state.js.map +1 -0
  320. package/dist/menu/create-submenu-trigger-state.d.ts +47 -0
  321. package/dist/menu/create-submenu-trigger-state.js +59 -0
  322. package/dist/menu/create-submenu-trigger-state.js.map +1 -0
  323. package/dist/numberfield/create-number-field-state.d.ts +93 -0
  324. package/dist/numberfield/create-number-field-state.js +139 -0
  325. package/dist/numberfield/create-number-field-state.js.map +1 -0
  326. package/dist/overlays/create-overlay-trigger-state.d.ts +51 -0
  327. package/dist/overlays/create-overlay-trigger-state.js +56 -0
  328. package/dist/overlays/create-overlay-trigger-state.js.map +1 -0
  329. package/dist/radio/create-radio-group-state.d.ts +61 -0
  330. package/dist/radio/create-radio-group-state.js +71 -0
  331. package/dist/radio/create-radio-group-state.js.map +1 -0
  332. package/dist/searchfield/create-search-field-state.d.ts +35 -0
  333. package/dist/searchfield/create-search-field-state.js +34 -0
  334. package/dist/searchfield/create-search-field-state.js.map +1 -0
  335. package/dist/select/create-select-state.d.ts +116 -0
  336. package/dist/select/create-select-state.js +151 -0
  337. package/dist/select/create-select-state.js.map +1 -0
  338. package/dist/selection/create-multiple-selection-state.d.ts +39 -0
  339. package/dist/selection/create-multiple-selection-state.js +114 -0
  340. package/dist/selection/create-multiple-selection-state.js.map +1 -0
  341. package/dist/selection/selection-manager.d.ts +139 -0
  342. package/dist/selection/selection-manager.js +334 -0
  343. package/dist/selection/selection-manager.js.map +1 -0
  344. package/dist/selection/selection.d.ts +27 -0
  345. package/dist/selection/selection.js +38 -0
  346. package/dist/selection/selection.js.map +1 -0
  347. package/dist/selection/types.d.ts +116 -0
  348. package/dist/selection/types.js +16 -0
  349. package/dist/slider/create-slider-state.d.ts +182 -0
  350. package/dist/slider/create-slider-state.js +131 -0
  351. package/dist/slider/create-slider-state.js.map +1 -0
  352. package/dist/steplist/create-step-list-state.d.ts +40 -0
  353. package/dist/steplist/create-step-list-state.js +132 -0
  354. package/dist/steplist/create-step-list-state.js.map +1 -0
  355. package/dist/table/cell.d.ts +37 -0
  356. package/dist/table/cell.js +47 -0
  357. package/dist/table/cell.js.map +1 -0
  358. package/dist/table/collection-context.d.ts +4 -0
  359. package/dist/table/collection-context.js +8 -0
  360. package/dist/table/collection-context.js.map +1 -0
  361. package/dist/table/column.d.ts +66 -0
  362. package/dist/table/column.js +71 -0
  363. package/dist/table/column.js.map +1 -0
  364. package/dist/table/create-table-column-resize-state.d.ts +65 -0
  365. package/dist/table/create-table-column-resize-state.js +100 -0
  366. package/dist/table/create-table-column-resize-state.js.map +1 -0
  367. package/dist/table/create-table-state.d.ts +112 -0
  368. package/dist/table/create-table-state.js +122 -0
  369. package/dist/table/create-table-state.js.map +1 -0
  370. package/dist/table/create-tree-grid-state.d.ts +44 -0
  371. package/dist/table/create-tree-grid-state.js +145 -0
  372. package/dist/table/create-tree-grid-state.js.map +1 -0
  373. package/dist/table/row.d.ts +44 -0
  374. package/dist/table/row.js +91 -0
  375. package/dist/table/row.js.map +1 -0
  376. package/dist/table/table-body.d.ts +36 -0
  377. package/dist/table/table-body.js +57 -0
  378. package/dist/table/table-body.js.map +1 -0
  379. package/dist/table/table-collection.d.ts +62 -0
  380. package/dist/table/table-collection.js +274 -0
  381. package/dist/table/table-collection.js.map +1 -0
  382. package/dist/table/table-column-layout.d.ts +47 -0
  383. package/dist/table/table-column-layout.js +94 -0
  384. package/dist/table/table-column-layout.js.map +1 -0
  385. package/dist/table/table-header.d.ts +37 -0
  386. package/dist/table/table-header.js +52 -0
  387. package/dist/table/table-header.js.map +1 -0
  388. package/dist/table/table-utils.d.ts +60 -0
  389. package/dist/table/table-utils.js +203 -0
  390. package/dist/table/table-utils.js.map +1 -0
  391. package/dist/tabs/create-tab-list-state.d.ts +42 -0
  392. package/dist/tabs/create-tab-list-state.js +78 -0
  393. package/dist/tabs/create-tab-list-state.js.map +1 -0
  394. package/dist/toast/create-toast-state.d.ts +97 -0
  395. package/dist/toast/create-toast-state.js +166 -0
  396. package/dist/toast/create-toast-state.js.map +1 -0
  397. package/dist/toggle/create-toggle-group-state.d.ts +55 -0
  398. package/dist/toggle/create-toggle-group-state.js +62 -0
  399. package/dist/toggle/create-toggle-group-state.js.map +1 -0
  400. package/dist/toggle/create-toggle-state.d.ts +58 -0
  401. package/dist/toggle/create-toggle-state.js +43 -0
  402. package/dist/toggle/create-toggle-state.js.map +1 -0
  403. package/dist/tokenfield/create-token-field-state.d.ts +39 -0
  404. package/dist/tokenfield/create-token-field-state.js +44 -0
  405. package/dist/tokenfield/create-token-field-state.js.map +1 -0
  406. package/dist/tokenfield/token-field-value.d.ts +111 -0
  407. package/dist/tokenfield/token-field-value.js +327 -0
  408. package/dist/tokenfield/token-field-value.js.map +1 -0
  409. package/dist/tooltip/create-tooltip-trigger-state.d.ts +73 -0
  410. package/dist/tooltip/create-tooltip-trigger-state.js +136 -0
  411. package/dist/tooltip/create-tooltip-trigger-state.js.map +1 -0
  412. package/dist/tree/create-tree-state.d.ts +42 -0
  413. package/dist/tree/create-tree-state.js +75 -0
  414. package/dist/tree/create-tree-state.js.map +1 -0
  415. package/dist/tree/tree-collection.d.ts +36 -0
  416. package/dist/tree/tree-collection.js +84 -0
  417. package/dist/tree/tree-collection.js.map +1 -0
  418. package/dist/utils/create-controlled-signal.d.ts +23 -0
  419. package/dist/utils/create-controlled-signal.js +54 -0
  420. package/dist/utils/create-controlled-signal.js.map +1 -0
  421. package/dist/utils/get-item-key.d.ts +5 -0
  422. package/dist/utils/get-item-key.js +12 -0
  423. package/dist/utils/get-item-key.js.map +1 -0
  424. package/dist/utils/get-node-props.d.ts +23 -0
  425. package/dist/utils/get-node-props.js +38 -0
  426. package/dist/utils/get-node-props.js.map +1 -0
  427. package/dist/utils/has-content.d.ts +5 -0
  428. package/dist/utils/has-content.js +7 -0
  429. package/dist/utils/has-content.js.map +1 -0
  430. package/dist/utils/legacy-props.d.ts +10 -0
  431. package/dist/utils/legacy-props.js +17 -0
  432. package/dist/utils/legacy-props.js.map +1 -0
  433. package/dist/utils/number.d.ts +25 -0
  434. package/dist/utils/number.js +59 -0
  435. package/dist/utils/number.js.map +1 -0
  436. package/dist/utils/parse-calendar-identifier.d.ts +5 -0
  437. package/dist/utils/parse-calendar-identifier.js +31 -0
  438. package/dist/utils/parse-calendar-identifier.js.map +1 -0
  439. package/dist/utils/require-value.d.ts +4 -0
  440. package/dist/utils/require-value.js +10 -0
  441. package/dist/utils/require-value.js.map +1 -0
  442. package/dist/virtualizer/create-virtualizer-state.d.ts +44 -0
  443. package/dist/virtualizer/create-virtualizer-state.js +92 -0
  444. package/dist/virtualizer/create-virtualizer-state.js.map +1 -0
  445. package/dist/virtualizer/layout-info.d.ts +94 -0
  446. package/dist/virtualizer/layout-info.js +118 -0
  447. package/dist/virtualizer/layout-info.js.map +1 -0
  448. package/dist/virtualizer/layout.d.ts +91 -0
  449. package/dist/virtualizer/layout.js +71 -0
  450. package/dist/virtualizer/layout.js.map +1 -0
  451. package/dist/virtualizer/overscan-manager.d.ts +25 -0
  452. package/dist/virtualizer/overscan-manager.js +46 -0
  453. package/dist/virtualizer/overscan-manager.js.map +1 -0
  454. package/dist/virtualizer/point.d.ts +36 -0
  455. package/dist/virtualizer/point.js +48 -0
  456. package/dist/virtualizer/point.js.map +1 -0
  457. package/dist/virtualizer/rect.d.ts +103 -0
  458. package/dist/virtualizer/rect.js +156 -0
  459. package/dist/virtualizer/rect.js.map +1 -0
  460. package/dist/virtualizer/reusable-view.d.ts +51 -0
  461. package/dist/virtualizer/reusable-view.js +81 -0
  462. package/dist/virtualizer/reusable-view.js.map +1 -0
  463. package/dist/virtualizer/scroll-anchor.d.ts +98 -0
  464. package/dist/virtualizer/scroll-anchor.js +150 -0
  465. package/dist/virtualizer/scroll-anchor.js.map +1 -0
  466. package/dist/virtualizer/size.d.ts +34 -0
  467. package/dist/virtualizer/size.js +46 -0
  468. package/dist/virtualizer/size.js.map +1 -0
  469. package/dist/virtualizer/types.d.ts +47 -0
  470. package/dist/virtualizer/types.js +16 -0
  471. package/dist/virtualizer/utils.d.ts +19 -0
  472. package/dist/virtualizer/utils.js +27 -0
  473. package/dist/virtualizer/utils.js.map +1 -0
  474. package/dist/virtualizer/virtualizer.d.ts +99 -0
  475. package/dist/virtualizer/virtualizer.js +314 -0
  476. package/dist/virtualizer/virtualizer.js.map +1 -0
  477. package/package.json +174 -4
@@ -0,0 +1,150 @@
1
+ /*
2
+ * Copyright 2026 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ /*
13
+ * Derived from Adobe React Spectrum: packages/react-stately/src/virtualizer/ScrollAnchor.ts.
14
+ * Modified for Solid Aria: adapted imports, collection descriptors, and reactive state APIs for Solid 2.
15
+ * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
16
+ */
17
+ import { Rect } from "./rect.js";
18
+ // src/virtualizer/scroll-anchor.ts
19
+ /**
20
+ * Minimum overlap an item must have with the viewport, along the scroll axis,
21
+ * to be eligible as a scroll anchor. Without this, an item that only overlaps the viewport
22
+ * by a sliver (e.g. 1px, essentially scrolled out of view) can still "win" the anchor
23
+ * tie-break over a substantially visible item.
24
+ */
25
+ const MIN_ANCHOR_OVERLAP = 4;
26
+ function dimensionForAxis(axis) {
27
+ return axis === "x" ? "width" : "height";
28
+ }
29
+ /**
30
+ * Given a previously-captured anchor, computes the new viewport coordinate (along `axis`) needed
31
+ * to keep it at the same offset from the viewport's start.
32
+ */
33
+ function computeScrollAnchorTarget(anchor, axis, getLayoutInfo, visibleRect, contentSize) {
34
+ const finalInfo = getLayoutInfo(anchor.key);
35
+ if (!finalInfo) return null;
36
+ const adjustment = finalInfo.rect[anchor.corner][axis] - visibleRect[axis] - anchor.offset;
37
+ if (adjustment === 0) return null;
38
+ const target = visibleRect[axis] + adjustment;
39
+ const dimension = dimensionForAxis(axis);
40
+ const max = Math.max(0, contentSize[dimension] - visibleRect[dimension]);
41
+ const clamped = Math.max(0, Math.min(max, target));
42
+ return clamped === visibleRect[axis] ? null : clamped;
43
+ }
44
+ /**
45
+ * Picks the item to anchor scroll to: the one nearest the top of the viewport when
46
+ * anchoring to 'end', or nearest the bottom when anchoring to 'start'. Callers can
47
+ * exclude certain items (like loaders) with `isAnchorable`.
48
+ */
49
+ function captureScrollAnchor(edge, axis, visibleRect, visibleLayoutInfos, isAnchorable = () => true) {
50
+ const dimension = dimensionForAxis(axis);
51
+ let best = null;
52
+ for (const [key, layoutInfo] of visibleLayoutInfos) {
53
+ if (!isAnchorable(layoutInfo)) continue;
54
+ const overlap = layoutInfo.rect.intersection(visibleRect)[dimension];
55
+ if (layoutInfo.rect.area > 0 && overlap >= MIN_ANCHOR_OVERLAP) {
56
+ const corner = layoutInfo.rect.getCornerInRect(visibleRect) ?? "topLeft";
57
+ const offset = layoutInfo.rect[corner][axis] - visibleRect[axis];
58
+ if (!best || (edge === "end" ? offset < best.offset : offset > best.offset)) best = {
59
+ corner,
60
+ key,
61
+ offset
62
+ };
63
+ }
64
+ }
65
+ return best;
66
+ }
67
+ /** Returns the viewport coordinate (along `axis`) that pins the viewport to `edge` of the content. */
68
+ function getEdgeSnapTarget(edge, axis, contentSize, previousVisibleRect) {
69
+ if (edge === "start") return 0;
70
+ const dimension = dimensionForAxis(axis);
71
+ return Math.max(0, contentSize[dimension] - previousVisibleRect[dimension]);
72
+ }
73
+ /**
74
+ * Whether the viewport is currently within `threshold` px of the anchored edge — used by
75
+ * Virtualizer to compute wasNearAnchorEdge generically, without any layout-specific state.
76
+ */
77
+ function isNearEdge(visibleRect, contentSize, edge, axis, threshold) {
78
+ if (edge === "start") return visibleRect[axis] <= threshold;
79
+ const dimension = dimensionForAxis(axis);
80
+ return contentSize[dimension] - (visibleRect[axis] + visibleRect[dimension]) <= threshold;
81
+ }
82
+ /**
83
+ * Works out the new scroll position after content changes. Tries to keep the anchor
84
+ * item where it was. If that doesn't apply, sticks the view to the edge instead, but
85
+ * only if the user was already near the edge and didn't just scroll away on their own.
86
+ */
87
+ function resolveScrollAdjustment(edge, axis, anchor, wasNearAnchorEdge, isScrolling, itemSizeChanged, contentSizeDelta, getLayoutInfo, previousVisibleRect, contentSize) {
88
+ const withTarget = (target) => axis === "x" ? new Rect(target, previousVisibleRect.y, previousVisibleRect.width, previousVisibleRect.height) : new Rect(previousVisibleRect.x, target, previousVisibleRect.width, previousVisibleRect.height);
89
+ if (anchor) {
90
+ const target = computeScrollAnchorTarget(anchor, axis, getLayoutInfo, previousVisibleRect, contentSize);
91
+ if (target !== null && target !== void 0) return withTarget(target);
92
+ }
93
+ if (wasNearAnchorEdge && !isScrolling && (!itemSizeChanged || contentSizeDelta > 0)) {
94
+ const target = withTarget(getEdgeSnapTarget(edge, axis, contentSize, previousVisibleRect));
95
+ return target.equals(previousVisibleRect) ? null : target;
96
+ }
97
+ return null;
98
+ }
99
+ /**
100
+ * Tracks the cross-pass state needed to keep the viewport anchored to a layout's edge across
101
+ * relayouts.
102
+ */
103
+ var ScrollAnchorTracker = class {
104
+ hasSnappedToEdge = false;
105
+ hadEstimatedVisibleItems = false;
106
+ wasNearAnchorEdge = false;
107
+ /** Resets all tracked state, e.g. when the virtualizer's layout instance changes. */
108
+ reset() {
109
+ this.hasSnappedToEdge = false;
110
+ this.hadEstimatedVisibleItems = false;
111
+ this.wasNearAnchorEdge = false;
112
+ }
113
+ /**
114
+ * Captures the anchor from pre-layout view positions.
115
+ */
116
+ captureBeforeLayout(anchorInfo, preLayoutInfos, visibleRect) {
117
+ if (!anchorInfo) return null;
118
+ return captureScrollAnchor(anchorInfo.edge, anchorInfo.axis, visibleRect, preLayoutInfos, anchorInfo.isAnchorable);
119
+ }
120
+ /**
121
+ * Runs the full post-layout decision: updates the tracked state for the next pass, and
122
+ * returns the resolved scroll target, or null if nothing should change.
123
+ */
124
+ resolveAfterLayout(options) {
125
+ const { anchorInfo, anchor, postLayoutInfos, previousVisibleRect, previousContentSize, contentSize, itemSizeChanged, isScrolling, getLayoutInfo } = options;
126
+ if (!anchorInfo) return null;
127
+ const wasSettlingLastPass = this.hadEstimatedVisibleItems;
128
+ const wasNearAnchorEdgeLastPass = this.wasNearAnchorEdge;
129
+ let hasEstimated = false;
130
+ for (const layoutInfo of postLayoutInfos.values()) if (layoutInfo.estimatedSize) {
131
+ hasEstimated = true;
132
+ break;
133
+ }
134
+ this.hadEstimatedVisibleItems = hasEstimated;
135
+ if (!wasSettlingLastPass) this.wasNearAnchorEdge = isNearEdge(previousVisibleRect, previousContentSize, anchorInfo.edge, anchorInfo.axis, anchorInfo.threshold);
136
+ if (previousVisibleRect.area === 0) return null;
137
+ const dimension = anchorInfo.axis === "x" ? "width" : "height";
138
+ const contentSizeDelta = contentSize[dimension] - previousContentSize[dimension];
139
+ const isFirstAnchoredLayout = !this.hasSnappedToEdge;
140
+ this.hasSnappedToEdge = true;
141
+ if (!isFirstAnchoredLayout && contentSizeDelta === 0 && !itemSizeChanged) return null;
142
+ const wasNearAnchorEdge = isFirstAnchoredLayout || wasSettlingLastPass && wasNearAnchorEdgeLastPass || isNearEdge(previousVisibleRect, previousContentSize, anchorInfo.edge, anchorInfo.axis, anchorInfo.threshold);
143
+ if (!wasSettlingLastPass) this.wasNearAnchorEdge = wasNearAnchorEdge;
144
+ const effectiveAnchor = isFirstAnchoredLayout || wasSettlingLastPass && wasNearAnchorEdgeLastPass ? null : anchor;
145
+ return resolveScrollAdjustment(anchorInfo.edge, anchorInfo.axis, effectiveAnchor, wasNearAnchorEdge, isScrolling, itemSizeChanged, contentSizeDelta, getLayoutInfo, previousVisibleRect, contentSize);
146
+ }
147
+ };
148
+ export { ScrollAnchorTracker, captureScrollAnchor, computeScrollAnchorTarget, getEdgeSnapTarget, isNearEdge, resolveScrollAdjustment };
149
+
150
+ //# sourceMappingURL=scroll-anchor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scroll-anchor.js","names":[],"sources":["../../src/virtualizer/scroll-anchor.ts"],"sourcesContent":["/*\n * Copyright 2026 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/*\n * Derived from Adobe React Spectrum: packages/react-stately/src/virtualizer/ScrollAnchor.ts.\n * Modified for Solid Aria: adapted imports, collection descriptors, and reactive state APIs for Solid 2.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport type { Key } from \"@solid2-aria/types-shared\";\n\nimport type { LayoutInfo } from \"./layout-info\";\nimport { Rect } from \"./rect\";\nimport type { RectCorner } from \"./rect\";\nimport type { Size } from \"./size\";\n\nexport type ScrollAnchorAxis = \"x\" | \"y\";\n\nexport type ScrollAnchorEdge = \"start\" | \"end\";\n\nexport interface ScrollAnchor {\n key: Key;\n corner: RectCorner;\n offset: number;\n}\n\nexport interface ScrollAnchorInfo {\n /** Which edge of the content the viewport should stay anchored to. */\n edge: \"start\" | \"end\";\n /** Which axis `edge` refers to — 'y' for vertical lists, 'x' for horizontal. */\n axis: \"x\" | \"y\";\n /** Distance (px) from `edge` within which the viewport is considered \"following\" it. */\n threshold: number;\n /**\n * Optional classifier excluding structural/ephemeral layout infos (e.g. loaders) from being\n * selected as the anchor. Defaults to allowing any layoutInfo.\n */\n isAnchorable?: (layoutInfo: LayoutInfo) => boolean;\n}\n\n/**\n * Minimum overlap an item must have with the viewport, along the scroll axis,\n * to be eligible as a scroll anchor. Without this, an item that only overlaps the viewport\n * by a sliver (e.g. 1px, essentially scrolled out of view) can still \"win\" the anchor\n * tie-break over a substantially visible item.\n */\nconst MIN_ANCHOR_OVERLAP = 4;\n\nfunction dimensionForAxis(axis: ScrollAnchorAxis): \"width\" | \"height\" {\n return axis === \"x\" ? \"width\" : \"height\";\n}\n\n/**\n * Given a previously-captured anchor, computes the new viewport coordinate (along `axis`) needed\n * to keep it at the same offset from the viewport's start.\n */\nexport function computeScrollAnchorTarget(\n anchor: ScrollAnchor,\n axis: ScrollAnchorAxis,\n getLayoutInfo: (key: Key) => LayoutInfo | null,\n visibleRect: Rect,\n contentSize: Size\n): number | null {\n const finalInfo = getLayoutInfo(anchor.key);\n\n if (!finalInfo) {\n return null;\n }\n\n const adjustment =\n finalInfo.rect[anchor.corner][axis] - visibleRect[axis] - anchor.offset;\n\n if (adjustment === 0) {\n return null;\n }\n\n const target = visibleRect[axis] + adjustment;\n const dimension = dimensionForAxis(axis);\n const max = Math.max(0, contentSize[dimension] - visibleRect[dimension]);\n const clamped = Math.max(0, Math.min(max, target));\n\n return clamped === visibleRect[axis] ? null : clamped;\n}\n\n/**\n * Picks the item to anchor scroll to: the one nearest the top of the viewport when\n * anchoring to 'end', or nearest the bottom when anchoring to 'start'. Callers can\n * exclude certain items (like loaders) with `isAnchorable`.\n */\nexport function captureScrollAnchor(\n edge: ScrollAnchorEdge,\n axis: ScrollAnchorAxis,\n visibleRect: Rect,\n visibleLayoutInfos: Iterable<[Key, LayoutInfo]>,\n isAnchorable: (layoutInfo: LayoutInfo) => boolean = () => true\n): ScrollAnchor | null {\n const dimension = dimensionForAxis(axis);\n let best: ScrollAnchor | null = null;\n\n for (const [key, layoutInfo] of visibleLayoutInfos) {\n if (!isAnchorable(layoutInfo)) {\n continue;\n }\n\n const overlap = layoutInfo.rect.intersection(visibleRect)[dimension];\n\n if (layoutInfo.rect.area > 0 && overlap >= MIN_ANCHOR_OVERLAP) {\n const corner = layoutInfo.rect.getCornerInRect(visibleRect) ?? \"topLeft\";\n const offset = layoutInfo.rect[corner][axis] - visibleRect[axis];\n\n const isBetter =\n !best || (edge === \"end\" ? offset < best.offset : offset > best.offset);\n\n if (isBetter) {\n best = { corner, key, offset };\n }\n }\n }\n\n return best;\n}\n\n/** Returns the viewport coordinate (along `axis`) that pins the viewport to `edge` of the content. */\nexport function getEdgeSnapTarget(\n edge: ScrollAnchorEdge,\n axis: ScrollAnchorAxis,\n contentSize: Size,\n previousVisibleRect: Rect\n): number {\n if (edge === \"start\") {\n return 0;\n }\n\n const dimension = dimensionForAxis(axis);\n\n return Math.max(0, contentSize[dimension] - previousVisibleRect[dimension]);\n}\n\n/**\n * Whether the viewport is currently within `threshold` px of the anchored edge — used by\n * Virtualizer to compute wasNearAnchorEdge generically, without any layout-specific state.\n */\nexport function isNearEdge(\n visibleRect: Rect,\n contentSize: Size,\n edge: ScrollAnchorEdge,\n axis: ScrollAnchorAxis,\n threshold: number\n): boolean {\n if (edge === \"start\") {\n return visibleRect[axis] <= threshold;\n }\n\n const dimension = dimensionForAxis(axis);\n\n const distanceFromEnd =\n contentSize[dimension] - (visibleRect[axis] + visibleRect[dimension]);\n\n return distanceFromEnd <= threshold;\n}\n\n/**\n * Works out the new scroll position after content changes. Tries to keep the anchor\n * item where it was. If that doesn't apply, sticks the view to the edge instead, but\n * only if the user was already near the edge and didn't just scroll away on their own.\n */\nexport function resolveScrollAdjustment(\n edge: ScrollAnchorEdge,\n axis: ScrollAnchorAxis,\n anchor: ScrollAnchor | null,\n wasNearAnchorEdge: boolean,\n isScrolling: boolean,\n itemSizeChanged: boolean,\n contentSizeDelta: number,\n getLayoutInfo: (key: Key) => LayoutInfo | null,\n previousVisibleRect: Rect,\n contentSize: Size\n): Rect | null {\n const withTarget = (target: number): Rect =>\n axis === \"x\"\n ? new Rect(\n target,\n previousVisibleRect.y,\n previousVisibleRect.width,\n previousVisibleRect.height\n )\n : new Rect(\n previousVisibleRect.x,\n target,\n previousVisibleRect.width,\n previousVisibleRect.height\n );\n\n if (anchor) {\n const target = computeScrollAnchorTarget(\n anchor,\n axis,\n getLayoutInfo,\n previousVisibleRect,\n contentSize\n );\n\n if (target !== null && target !== undefined) {\n return withTarget(target);\n }\n }\n\n if (\n wasNearAnchorEdge &&\n !isScrolling &&\n (!itemSizeChanged || contentSizeDelta > 0)\n ) {\n const target = withTarget(\n getEdgeSnapTarget(edge, axis, contentSize, previousVisibleRect)\n );\n\n return target.equals(previousVisibleRect) ? null : target;\n }\n\n return null;\n}\n\nexport interface ResolveAfterLayoutOptions {\n anchorInfo: ScrollAnchorInfo | null;\n /** The anchor captured by `captureBeforeLayout` before this pass's `layout.update()` ran. */\n anchor: ScrollAnchor | null;\n /** The full post-layout visible layout infos, i.e. `virtualizer.getVisibleLayoutInfos()`. */\n postLayoutInfos: Map<Key, LayoutInfo>;\n previousVisibleRect: Rect;\n previousContentSize: Size;\n contentSize: Size;\n itemSizeChanged: boolean;\n isScrolling: boolean;\n getLayoutInfo: (key: Key) => LayoutInfo | null;\n}\n\n/**\n * Tracks the cross-pass state needed to keep the viewport anchored to a layout's edge across\n * relayouts.\n */\nexport class ScrollAnchorTracker {\n private hasSnappedToEdge = false;\n private hadEstimatedVisibleItems = false;\n private wasNearAnchorEdge = false;\n /** Resets all tracked state, e.g. when the virtualizer's layout instance changes. */\n reset(): void {\n this.hasSnappedToEdge = false;\n this.hadEstimatedVisibleItems = false;\n this.wasNearAnchorEdge = false;\n }\n /**\n * Captures the anchor from pre-layout view positions.\n */\n captureBeforeLayout(\n anchorInfo: ScrollAnchorInfo | null,\n preLayoutInfos: Iterable<[Key, LayoutInfo]>,\n visibleRect: Rect\n ): ScrollAnchor | null {\n if (!anchorInfo) {\n return null;\n }\n\n return captureScrollAnchor(\n anchorInfo.edge,\n anchorInfo.axis,\n visibleRect,\n preLayoutInfos,\n anchorInfo.isAnchorable\n );\n }\n /**\n * Runs the full post-layout decision: updates the tracked state for the next pass, and\n * returns the resolved scroll target, or null if nothing should change.\n */\n resolveAfterLayout(options: ResolveAfterLayoutOptions): Rect | null {\n const {\n anchorInfo,\n anchor,\n postLayoutInfos,\n previousVisibleRect,\n previousContentSize,\n contentSize,\n itemSizeChanged,\n isScrolling,\n getLayoutInfo,\n } = options;\n\n if (!anchorInfo) {\n return null;\n }\n\n // Read the previous pass's state into locals before any writes below overwrite it.\n const wasSettlingLastPass = this.hadEstimatedVisibleItems;\n const wasNearAnchorEdgeLastPass = this.wasNearAnchorEdge;\n let hasEstimated = false;\n\n for (const layoutInfo of postLayoutInfos.values()) {\n if (layoutInfo.estimatedSize) {\n hasEstimated = true;\n break;\n }\n }\n\n this.hadEstimatedVisibleItems = hasEstimated;\n\n // Don't recheck \"near edge?\" mid-resize because it could look like a scroll that never happened.\n // Reuse the answer from before the resizing started.\n if (!wasSettlingLastPass) {\n this.wasNearAnchorEdge = isNearEdge(\n previousVisibleRect,\n previousContentSize,\n anchorInfo.edge,\n anchorInfo.axis,\n anchorInfo.threshold\n );\n }\n\n if (previousVisibleRect.area === 0) {\n return null;\n }\n\n const dimension: \"width\" | \"height\" =\n anchorInfo.axis === \"x\" ? \"width\" : \"height\";\n\n const contentSizeDelta =\n contentSize[dimension] - previousContentSize[dimension];\n\n const isFirstAnchoredLayout = !this.hasSnappedToEdge;\n this.hasSnappedToEdge = true;\n\n // Only modify scroll when content actually changed (or this is the first layout, which always snaps)\n if (!isFirstAnchoredLayout && contentSizeDelta === 0 && !itemSizeChanged) {\n return null;\n }\n\n const wasNearAnchorEdge =\n isFirstAnchoredLayout ||\n (wasSettlingLastPass && wasNearAnchorEdgeLastPass) ||\n isNearEdge(\n previousVisibleRect,\n previousContentSize,\n anchorInfo.edge,\n anchorInfo.axis,\n anchorInfo.threshold\n );\n\n // A first-ever layout always snaps to the edge, even if the raw distance check says\n // otherwise. Save that real decision here so later passes in this cascade reuse it.\n if (!wasSettlingLastPass) {\n this.wasNearAnchorEdge = wasNearAnchorEdge;\n }\n\n // Skip restoring to the captured anchor while still resizing because items above it are also still growing,\n // and following it would fall short of the edge.\n const effectiveAnchor =\n isFirstAnchoredLayout ||\n (wasSettlingLastPass && wasNearAnchorEdgeLastPass)\n ? null\n : anchor;\n\n return resolveScrollAdjustment(\n anchorInfo.edge,\n anchorInfo.axis,\n effectiveAnchor,\n wasNearAnchorEdge,\n isScrolling,\n itemSizeChanged,\n contentSizeDelta,\n getLayoutInfo,\n previousVisibleRect,\n contentSize\n );\n }\n}\n"],"mappings":"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"}
@@ -0,0 +1,34 @@
1
+ /*
2
+ * Copyright 2020 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ /*
13
+ * Derived from Adobe React Spectrum: packages/react-stately/src/virtualizer/Size.ts.
14
+ * Modified for Solid Aria: adapted imports, collection descriptors, and reactive state APIs for Solid 2.
15
+ * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
16
+ */
17
+ export declare class Size {
18
+ width: number;
19
+ height: number;
20
+ constructor(width?: number, height?: number);
21
+ /**
22
+ * Returns a copy of this size.
23
+ */
24
+ copy(): Size;
25
+ /**
26
+ * Returns whether this size is equal to another one.
27
+ */
28
+ equals(other: Size): boolean;
29
+ /**
30
+ * The total area of the Size.
31
+ */
32
+ get area(): number;
33
+ }
34
+ //# sourceMappingURL=size.d.ts.map
@@ -0,0 +1,46 @@
1
+ /*
2
+ * Copyright 2020 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ /*
13
+ * Derived from Adobe React Spectrum: packages/react-stately/src/virtualizer/Size.ts.
14
+ * Modified for Solid Aria: adapted imports, collection descriptors, and reactive state APIs for Solid 2.
15
+ * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
16
+ */
17
+ // src/virtualizer/size.ts
18
+ var Size = class Size {
19
+ width;
20
+ height;
21
+ constructor(width = 0, height = 0) {
22
+ this.width = Math.max(width, 0);
23
+ this.height = Math.max(height, 0);
24
+ }
25
+ /**
26
+ * Returns a copy of this size.
27
+ */
28
+ copy() {
29
+ return new Size(this.width, this.height);
30
+ }
31
+ /**
32
+ * Returns whether this size is equal to another one.
33
+ */
34
+ equals(other) {
35
+ return this.width === other.width && this.height === other.height;
36
+ }
37
+ /**
38
+ * The total area of the Size.
39
+ */
40
+ get area() {
41
+ return this.width * this.height;
42
+ }
43
+ };
44
+ export { Size };
45
+
46
+ //# sourceMappingURL=size.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"size.js","names":[],"sources":["../../src/virtualizer/size.ts"],"sourcesContent":["/*\n * Copyright 2020 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/*\n * Derived from Adobe React Spectrum: packages/react-stately/src/virtualizer/Size.ts.\n * Modified for Solid Aria: adapted imports, collection descriptors, and reactive state APIs for Solid 2.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nexport class Size {\n width: number;\n height: number;\n\n constructor(width = 0, height = 0) {\n this.width = Math.max(width, 0);\n this.height = Math.max(height, 0);\n }\n\n /**\n * Returns a copy of this size.\n */\n copy(): Size {\n return new Size(this.width, this.height);\n }\n\n /**\n * Returns whether this size is equal to another one.\n */\n equals(other: Size): boolean {\n return this.width === other.width && this.height === other.height;\n }\n\n /**\n * The total area of the Size.\n */\n get area(): number {\n return this.width * this.height;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,IAAa,OAAb,MAAa,KAAK;CAChB;CACA;CAEA,YAAY,QAAQ,GAAG,SAAS,GAAG;EACjC,KAAK,QAAQ,KAAK,IAAI,OAAO,CAAC;EAC9B,KAAK,SAAS,KAAK,IAAI,QAAQ,CAAC;CAClC;;;;CAKA,OAAa;EACX,OAAO,IAAI,KAAK,KAAK,OAAO,KAAK,MAAM;CACzC;;;;CAKA,OAAO,OAAsB;EAC3B,OAAO,KAAK,UAAU,MAAM,SAAS,KAAK,WAAW,MAAM;CAC7D;;;;CAKA,IAAI,OAAe;EACjB,OAAO,KAAK,QAAQ,KAAK;CAC3B;AACF"}
@@ -0,0 +1,47 @@
1
+ /*
2
+ * Copyright 2020 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ /*
13
+ * Derived from Adobe React Spectrum: packages/react-stately/src/virtualizer/types.ts.
14
+ * Modified for Solid Aria: adapted imports, collection descriptors, and reactive state APIs for Solid 2.
15
+ * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
16
+ */
17
+ import { Size } from "./size.js";
18
+ import { Rect } from "./rect.js";
19
+ import { Layout } from "./layout.js";
20
+ import { Collection, Key } from "@solid2-aria/types-shared";
21
+ export interface InvalidationContext<O = unknown> {
22
+ contentChanged?: boolean;
23
+ offsetChanged?: boolean;
24
+ sizeChanged?: boolean;
25
+ widthChanged?: boolean;
26
+ heightChanged?: boolean;
27
+ itemSizeChanged?: boolean;
28
+ layoutOptionsChanged?: boolean;
29
+ layoutOptions?: O;
30
+ }
31
+ export interface VirtualizerDelegate<T extends object, V> {
32
+ setVisibleRect: (rect: Rect) => void;
33
+ renderView: (type: string, content: T | null) => V;
34
+ invalidate: (ctx: InvalidationContext) => void;
35
+ }
36
+ export interface VirtualizerRenderOptions<T extends object, O = unknown> {
37
+ layout: Layout<T>;
38
+ collection: Collection<T>;
39
+ persistedKeys?: Set<Key> | null;
40
+ visibleRect: Rect;
41
+ size: Size;
42
+ invalidationContext: InvalidationContext;
43
+ isScrolling: boolean;
44
+ layoutOptions?: O;
45
+ }
46
+ export type Mutable<T> = { -readonly [P in keyof T]: T[P]; };
47
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,16 @@
1
+ /*
2
+ * Copyright 2020 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ /*
13
+ * Derived from Adobe React Spectrum: packages/react-stately/src/virtualizer/types.ts.
14
+ * Modified for Solid Aria: adapted imports, collection descriptors, and reactive state APIs for Solid 2.
15
+ * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
16
+ */
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Copyright 2020 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ /*
13
+ * Derived from Adobe React Spectrum: packages/react-stately/src/virtualizer/utils.ts.
14
+ * Modified for Solid Aria: adapted imports, collection descriptors, and reactive state APIs for Solid 2.
15
+ * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
16
+ */
17
+ /** Returns whether two sets are equal. */
18
+ export declare function isSetEqual<T>(a: Set<T>, b: Set<T>): boolean;
19
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1,27 @@
1
+ /*
2
+ * Copyright 2020 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ /*
13
+ * Derived from Adobe React Spectrum: packages/react-stately/src/virtualizer/utils.ts.
14
+ * Modified for Solid Aria: adapted imports, collection descriptors, and reactive state APIs for Solid 2.
15
+ * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
16
+ */
17
+ // src/virtualizer/utils.ts
18
+ /** Returns whether two sets are equal. */
19
+ function isSetEqual(a, b) {
20
+ if (a === b) return true;
21
+ if (a.size !== b.size) return false;
22
+ for (const key of a) if (!b.has(key)) return false;
23
+ return true;
24
+ }
25
+ export { isSetEqual };
26
+
27
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","names":[],"sources":["../../src/virtualizer/utils.ts"],"sourcesContent":["/*\n * Copyright 2020 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/*\n * Derived from Adobe React Spectrum: packages/react-stately/src/virtualizer/utils.ts.\n * Modified for Solid Aria: adapted imports, collection descriptors, and reactive state APIs for Solid 2.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\n/** Returns whether two sets are equal. */\nexport function isSetEqual<T>(a: Set<T>, b: Set<T>): boolean {\n if (a === b) {\n return true;\n }\n\n if (a.size !== b.size) {\n return false;\n }\n\n for (const key of a) {\n if (!b.has(key)) {\n return false;\n }\n }\n\n return true;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,SAAgB,WAAc,GAAW,GAAoB;CAC3D,IAAI,MAAM,GACR,OAAO;CAGT,IAAI,EAAE,SAAS,EAAE,MACf,OAAO;CAGT,KAAK,MAAM,OAAO,GAChB,IAAI,CAAC,EAAE,IAAI,GAAG,GACZ,OAAO;CAIX,OAAO;AACT"}
@@ -0,0 +1,99 @@
1
+ /*
2
+ * Copyright 2020 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ /*
13
+ * Derived from Adobe React Spectrum: packages/react-stately/src/virtualizer/Virtualizer.ts.
14
+ * Modified for Solid Aria: adapted imports, collection descriptors, and reactive state APIs for Solid 2.
15
+ * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
16
+ */
17
+ import { Point } from "./point.js";
18
+ import { Size } from "./size.js";
19
+ import { Rect } from "./rect.js";
20
+ import { LayoutInfo } from "./layout-info.js";
21
+ import { InvalidationContext, VirtualizerDelegate, VirtualizerRenderOptions } from "./types.js";
22
+ import { ReusableView } from "./reusable-view.js";
23
+ import { Layout } from "./layout.js";
24
+ import { Collection, Key } from "@solid2-aria/types-shared";
25
+ interface VirtualizerOptions<T extends object, V> {
26
+ delegate: VirtualizerDelegate<T, V>;
27
+ collection: Collection<T>;
28
+ layout: Layout<T>;
29
+ }
30
+ /**
31
+ * The Virtualizer class renders a scrollable collection of data using customizable layouts.
32
+ * It supports very large collections by only rendering visible views to the DOM, reusing
33
+ * them as you scroll. Virtualizer can present any type of view, including non-item views
34
+ * such as section headers and footers.
35
+ *
36
+ * Virtualizer uses `Layout` objects to compute what views should be visible, and how
37
+ * to position and style them. This means that virtualizer can have its items arranged in
38
+ * a stack, a grid, a circle, or any other layout you can think of. The layout can be changed
39
+ * dynamically at runtime as well.
40
+ *
41
+ * Layouts produce information on what views should appear in the virtualizer, but do not create the
42
+ * views themselves directly. It is the responsibility of the `VirtualizerDelegate` object to render
43
+ * elements for each layout info. The virtualizer manages a set of `ReusableView` objects, which are
44
+ * reused as the user scrolls by swapping their content with cached elements returned by the
45
+ * delegate.
46
+ */
47
+ export declare class Virtualizer<T extends object, V> {
48
+ /**
49
+ * The virtualizer delegate. The delegate is used by the virtualizer
50
+ * to create and configure views.
51
+ */
52
+ delegate: VirtualizerDelegate<T, V>;
53
+ /** The current content of the virtualizer. */
54
+ private _collection;
55
+ get collection(): Collection<T>;
56
+ /** The layout object that determines the visible views. */
57
+ private _layout;
58
+ get layout(): Layout<T>;
59
+ /** The size of the scrollable content. */
60
+ private _contentSize;
61
+ get contentSize(): Size;
62
+ /** The currently visible rectangle. */
63
+ private _visibleRect;
64
+ get visibleRect(): Rect;
65
+ /** The size of the virtualizer scroll view. */
66
+ private _size;
67
+ get size(): Size;
68
+ /** The set of persisted keys that are always present in the DOM, even if not currently in view. */
69
+ private _persistedKeys;
70
+ get persistedKeys(): Set<Key>;
71
+ private readonly _visibleViews;
72
+ private readonly _renderedContent;
73
+ private readonly _rootView;
74
+ private _isScrolling;
75
+ private _invalidationContext;
76
+ private readonly _overscanManager;
77
+ private readonly _scrollAnchor;
78
+ constructor(options: VirtualizerOptions<T, V>);
79
+ /** Returns whether the given key, or an ancestor, is persisted. */
80
+ isPersistedKey(key: Key): boolean;
81
+ private getParentView;
82
+ private getReusableView;
83
+ private _renderView;
84
+ private _renderContent;
85
+ /**
86
+ * Returns the key for the item view currently at the given point.
87
+ */
88
+ keyAtPoint(point: Point): Key | null;
89
+ private relayout;
90
+ getVisibleLayoutInfos(): Map<Key, LayoutInfo>;
91
+ private updateSubviews;
92
+ /** Performs layout and updates visible views as needed. */
93
+ render(opts: VirtualizerRenderOptions<T>): ReusableView<T, V>[];
94
+ getVisibleView(key: Key): ReusableView<T, V> | undefined;
95
+ invalidate(context: InvalidationContext): void;
96
+ updateItemSize(key: Key, size: Size): void;
97
+ }
98
+ export {};
99
+ //# sourceMappingURL=virtualizer.d.ts.map