@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,75 @@
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/tree/useTreeState.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 { createControlledSignal } from "../utils/create-controlled-signal.js";
18
+ import { createCollection } from "../collections/create-collection.js";
19
+ import { createMultipleSelectionState } from "../selection/create-multiple-selection-state.js";
20
+ import { SelectionManager } from "../selection/selection-manager.js";
21
+ import { TreeCollection } from "./tree-collection.js";
22
+ import { createMemo, createRenderEffect, untrack } from "solid-js";
23
+ // src/tree/create-tree-state.ts
24
+ /**
25
+ * Provides state management for tree-like components. Handles building a collection
26
+ * of items from props, item expanded state, and manages multiple selection state.
27
+ */
28
+ function createTreeState(props) {
29
+ const [expandedKeys, setExpandedKeys] = createControlledSignal(() => props.expandedKeys ? new Set(props.expandedKeys) : void 0, untrack(() => props.defaultExpandedKeys ? new Set(props.defaultExpandedKeys) : /* @__PURE__ */ new Set()), (keys) => {
30
+ props.onExpandedChange?.(keys);
31
+ });
32
+ const selectionState = createMultipleSelectionState(props);
33
+ const disabledKeys = createMemo(() => props.disabledKeys ? new Set(props.disabledKeys) : /* @__PURE__ */ new Set());
34
+ const tree = createCollection(props, (nodes) => new TreeCollection(nodes, { get expandedKeys() {
35
+ return expandedKeys();
36
+ } }), null);
37
+ createRenderEffect(() => {
38
+ const { focusedKey } = selectionState;
39
+ return focusedKey !== null && !tree().getItem(focusedKey);
40
+ }, (removed) => {
41
+ if (removed) selectionState.setFocusedKey(null);
42
+ });
43
+ const onToggle = (key) => {
44
+ setExpandedKeys((current) => toggleKey(current, key));
45
+ };
46
+ return {
47
+ get collection() {
48
+ return tree();
49
+ },
50
+ get disabledKeys() {
51
+ return disabledKeys();
52
+ },
53
+ get expandedKeys() {
54
+ return expandedKeys();
55
+ },
56
+ get selectionManager() {
57
+ return new SelectionManager(tree(), selectionState);
58
+ },
59
+ get setExpandedKeys() {
60
+ return setExpandedKeys;
61
+ },
62
+ get toggleKey() {
63
+ return onToggle;
64
+ }
65
+ };
66
+ }
67
+ function toggleKey(set, key) {
68
+ const res = new Set(set);
69
+ if (res.has(key)) res.delete(key);
70
+ else res.add(key);
71
+ return res;
72
+ }
73
+ export { createTreeState };
74
+
75
+ //# sourceMappingURL=create-tree-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-tree-state.js","names":[],"sources":["../../src/tree/create-tree-state.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/tree/useTreeState.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 {\n Collection,\n CollectionStateBase,\n DisabledBehavior,\n Expandable,\n Key,\n MultipleSelection,\n Node,\n} from \"@solid2-aria/types-shared\";\nimport { createMemo, createRenderEffect, untrack } from \"solid-js\";\n\nimport { createCollection } from \"../collections/create-collection\";\nimport { createMultipleSelectionState } from \"../selection/create-multiple-selection-state\";\nimport { SelectionManager } from \"../selection/selection-manager\";\nimport { createControlledSignal } from \"../utils/create-controlled-signal\";\nimport { TreeCollection } from \"./tree-collection\";\n\nexport interface TreeProps<T>\n extends CollectionStateBase<T>, Expandable, MultipleSelection {\n /** Whether `disabledKeys` applies to all interactions, or only selection. */\n disabledBehavior?: DisabledBehavior;\n}\n\nexport interface TreeState<T> {\n /** A collection of items in the tree. */\n readonly collection: Collection<Node<T>>;\n /** A set of keys for items that are disabled. */\n readonly disabledKeys: Set<Key>;\n /** A set of keys for items that are expanded. */\n readonly expandedKeys: Set<Key>;\n /** Toggles the expanded state for an item by its key. */\n toggleKey: (key: Key) => void;\n /** Replaces the set of expanded keys. */\n setExpandedKeys: (keys: Set<Key>) => void;\n /** A selection manager to read and update multiple selection state. */\n readonly selectionManager: SelectionManager;\n}\n\n/**\n * Provides state management for tree-like components. Handles building a collection\n * of items from props, item expanded state, and manages multiple selection state.\n */\nexport function createTreeState<T extends object>(\n props: TreeProps<T>\n): TreeState<T> {\n const [expandedKeys, setExpandedKeys] = createControlledSignal(\n () => (props.expandedKeys ? new Set(props.expandedKeys) : undefined),\n untrack(() =>\n props.defaultExpandedKeys\n ? new Set(props.defaultExpandedKeys)\n : new Set<Key>()\n ),\n (keys) => {\n props.onExpandedChange?.(keys);\n }\n );\n\n const selectionState = createMultipleSelectionState(props);\n\n const disabledKeys = createMemo(() =>\n props.disabledKeys ? new Set(props.disabledKeys) : new Set<Key>()\n );\n\n const tree = createCollection(\n props,\n (nodes) =>\n new TreeCollection(nodes, {\n get expandedKeys() {\n return expandedKeys();\n },\n }),\n null\n );\n\n // Reset focused key if that item is deleted from the collection.\n createRenderEffect(\n () => {\n const { focusedKey } = selectionState;\n\n return focusedKey !== null && !tree().getItem(focusedKey);\n },\n (removed) => {\n if (removed) {\n selectionState.setFocusedKey(null);\n }\n }\n );\n\n const onToggle = (key: Key) => {\n setExpandedKeys((current) => toggleKey(current, key));\n };\n\n return {\n get collection() {\n return tree();\n },\n get disabledKeys() {\n return disabledKeys();\n },\n get expandedKeys() {\n return expandedKeys();\n },\n get selectionManager() {\n return new SelectionManager(tree(), selectionState);\n },\n get setExpandedKeys() {\n return setExpandedKeys;\n },\n get toggleKey() {\n return onToggle;\n },\n };\n}\n\nfunction toggleKey(set: Set<Key>, key: Key): Set<Key> {\n const res = new Set(set);\n\n if (res.has(key)) {\n res.delete(key);\n } else {\n res.add(key);\n }\n\n return res;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DA,SAAgB,gBACd,OACc;CACd,MAAM,CAAC,cAAc,mBAAmB,6BAC/B,MAAM,eAAe,IAAI,IAAI,MAAM,YAAY,IAAI,KAAA,GAC1D,cACE,MAAM,sBACF,IAAI,IAAI,MAAM,mBAAmB,oBACjC,IAAI,IAAS,CACnB,IACC,SAAS;EACR,MAAM,mBAAmB,IAAI;CAC/B,CACF;CAEA,MAAM,iBAAiB,6BAA6B,KAAK;CAEzD,MAAM,eAAe,iBACnB,MAAM,eAAe,IAAI,IAAI,MAAM,YAAY,oBAAI,IAAI,IAAS,CAClE;CAEA,MAAM,OAAO,iBACX,QACC,UACC,IAAI,eAAe,OAAO,EACxB,IAAI,eAAe;EACjB,OAAO,aAAa;CACtB,EACF,CAAC,GACH,IACF;CAGA,yBACQ;EACJ,MAAM,EAAE,eAAe;EAEvB,OAAO,eAAe,QAAQ,CAAC,KAAK,CAAC,CAAC,QAAQ,UAAU;CAC1D,IACC,YAAY;EACX,IAAI,SACF,eAAe,cAAc,IAAI;CAErC,CACF;CAEA,MAAM,YAAY,QAAa;EAC7B,iBAAiB,YAAY,UAAU,SAAS,GAAG,CAAC;CACtD;CAEA,OAAO;EACL,IAAI,aAAa;GACf,OAAO,KAAK;EACd;EACA,IAAI,eAAe;GACjB,OAAO,aAAa;EACtB;EACA,IAAI,eAAe;GACjB,OAAO,aAAa;EACtB;EACA,IAAI,mBAAmB;GACrB,OAAO,IAAI,iBAAiB,KAAK,GAAG,cAAc;EACpD;EACA,IAAI,kBAAkB;GACpB,OAAO;EACT;EACA,IAAI,YAAY;GACd,OAAO;EACT;CACF;AACF;AAEA,SAAS,UAAU,KAAe,KAAoB;CACpD,MAAM,MAAM,IAAI,IAAI,GAAG;CAEvB,IAAI,IAAI,IAAI,GAAG,GACb,IAAI,OAAO,GAAG;MAEd,IAAI,IAAI,GAAG;CAGb,OAAO;AACT"}
@@ -0,0 +1,36 @@
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/tree/TreeCollection.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 { Collection, Key, Node } from "@solid2-aria/types-shared";
18
+ export declare class TreeCollection<T> implements Collection<Node<T>> {
19
+ private readonly keyMap;
20
+ private readonly iterable;
21
+ private readonly firstKey;
22
+ private readonly lastKey;
23
+ constructor(nodes: Iterable<Node<T>>, { expandedKeys }?: {
24
+ expandedKeys?: Set<Key>;
25
+ });
26
+ [Symbol.iterator](): IterableIterator<Node<T>>;
27
+ get size(): number;
28
+ getKeys(): IterableIterator<Key>;
29
+ getKeyBefore(key: Key): Key | null;
30
+ getKeyAfter(key: Key): Key | null;
31
+ getFirstKey(): Key | null;
32
+ getLastKey(): Key | null;
33
+ getItem(key: Key): Node<T> | null;
34
+ at(idx: number): Node<T> | null;
35
+ }
36
+ //# sourceMappingURL=tree-collection.d.ts.map
@@ -0,0 +1,84 @@
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/tree/TreeCollection.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 { getChildNodes } from "../collections/get-child-nodes.js";
18
+ // src/tree/tree-collection.ts
19
+ var TreeCollection = class {
20
+ keyMap = /* @__PURE__ */ new Map();
21
+ iterable;
22
+ firstKey = null;
23
+ lastKey = null;
24
+ constructor(nodes, { expandedKeys } = {}) {
25
+ this.iterable = nodes;
26
+ const visibleExpandedKeys = expandedKeys ?? /* @__PURE__ */ new Set();
27
+ const visit = (node) => {
28
+ this.keyMap.set(node.key, node);
29
+ if (node.type === "section" || visibleExpandedKeys.has(node.key)) for (const child of getChildNodes(node, this)) visit(child);
30
+ };
31
+ for (const node of nodes) visit(node);
32
+ let last = null;
33
+ let index = 0;
34
+ for (const [key, node] of this.keyMap) {
35
+ if (last) {
36
+ last.nextKey = key;
37
+ node.prevKey = last.key;
38
+ } else {
39
+ this.firstKey = key;
40
+ node.prevKey = void 0;
41
+ }
42
+ if (node.type === "item") {
43
+ index += 1;
44
+ node.index = index;
45
+ }
46
+ last = node;
47
+ last.nextKey = void 0;
48
+ }
49
+ this.lastKey = last?.key ?? null;
50
+ }
51
+ *[Symbol.iterator]() {
52
+ yield* this.iterable;
53
+ }
54
+ get size() {
55
+ return this.keyMap.size;
56
+ }
57
+ getKeys() {
58
+ return this.keyMap.keys();
59
+ }
60
+ getKeyBefore(key) {
61
+ const node = this.keyMap.get(key);
62
+ return node ? node.prevKey ?? null : null;
63
+ }
64
+ getKeyAfter(key) {
65
+ const node = this.keyMap.get(key);
66
+ return node ? node.nextKey ?? null : null;
67
+ }
68
+ getFirstKey() {
69
+ return this.firstKey;
70
+ }
71
+ getLastKey() {
72
+ return this.lastKey;
73
+ }
74
+ getItem(key) {
75
+ return this.keyMap.get(key) ?? null;
76
+ }
77
+ at(idx) {
78
+ const key = [...this.getKeys()][idx];
79
+ return key === void 0 ? null : this.getItem(key);
80
+ }
81
+ };
82
+ export { TreeCollection };
83
+
84
+ //# sourceMappingURL=tree-collection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tree-collection.js","names":[],"sources":["../../src/tree/tree-collection.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/tree/TreeCollection.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 { Collection, Key, Node } from \"@solid2-aria/types-shared\";\n\nimport { getChildNodes } from \"../collections/get-child-nodes\";\n\nexport class TreeCollection<T> implements Collection<Node<T>> {\n private readonly keyMap = new Map<Key, Node<T>>();\n private readonly iterable: Iterable<Node<T>>;\n private readonly firstKey: Key | null = null;\n private readonly lastKey: Key | null = null;\n constructor(\n nodes: Iterable<Node<T>>,\n {\n expandedKeys,\n }: {\n expandedKeys?: Set<Key>;\n } = {}\n ) {\n this.iterable = nodes;\n const visibleExpandedKeys = expandedKeys ?? new Set<Key>();\n\n const visit = (node: Node<T>) => {\n this.keyMap.set(node.key, node);\n\n if (node.type === \"section\" || visibleExpandedKeys.has(node.key)) {\n for (const child of getChildNodes(node, this)) {\n visit(child);\n }\n }\n };\n\n for (const node of nodes) {\n visit(node);\n }\n\n let last: Node<T> | null = null;\n let index = 0;\n\n for (const [key, node] of this.keyMap) {\n if (last) {\n last.nextKey = key;\n node.prevKey = last.key;\n } else {\n this.firstKey = key;\n node.prevKey = undefined;\n }\n\n if (node.type === \"item\") {\n index += 1;\n node.index = index;\n }\n\n last = node;\n // Set nextKey as undefined since this might be the last node\n // If it isn't the last node, last.nextKey will properly set at start of new loop\n last.nextKey = undefined;\n }\n\n this.lastKey = last?.key ?? null;\n }\n *[Symbol.iterator](): IterableIterator<Node<T>> {\n yield* this.iterable;\n }\n get size(): number {\n return this.keyMap.size;\n }\n getKeys(): IterableIterator<Key> {\n return this.keyMap.keys();\n }\n getKeyBefore(key: Key): Key | null {\n const node = this.keyMap.get(key);\n\n return node ? (node.prevKey ?? null) : null;\n }\n getKeyAfter(key: Key): Key | null {\n const node = this.keyMap.get(key);\n\n return node ? (node.nextKey ?? null) : null;\n }\n getFirstKey(): Key | null {\n return this.firstKey;\n }\n getLastKey(): Key | null {\n return this.lastKey;\n }\n getItem(key: Key): Node<T> | null {\n return this.keyMap.get(key) ?? null;\n }\n at(idx: number): Node<T> | null {\n const keys = [...this.getKeys()];\n const key = keys[idx];\n\n return key === undefined ? null : this.getItem(key);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAqBA,IAAa,iBAAb,MAA8D;CAC5D,yBAA0B,IAAI,IAAkB;CAChD;CACA,WAAwC;CACxC,UAAuC;CACvC,YACE,OACA,EACE,iBAGE,CAAC,GACL;EACA,KAAK,WAAW;EAChB,MAAM,sBAAsB,gCAAgB,IAAI,IAAS;EAEzD,MAAM,SAAS,SAAkB;GAC/B,KAAK,OAAO,IAAI,KAAK,KAAK,IAAI;GAE9B,IAAI,KAAK,SAAS,aAAa,oBAAoB,IAAI,KAAK,GAAG,GAC7D,KAAK,MAAM,SAAS,cAAc,MAAM,IAAI,GAC1C,MAAM,KAAK;EAGjB;EAEA,KAAK,MAAM,QAAQ,OACjB,MAAM,IAAI;EAGZ,IAAI,OAAuB;EAC3B,IAAI,QAAQ;EAEZ,KAAK,MAAM,CAAC,KAAK,SAAS,KAAK,QAAQ;GACrC,IAAI,MAAM;IACR,KAAK,UAAU;IACf,KAAK,UAAU,KAAK;GACtB,OAAO;IACL,KAAK,WAAW;IAChB,KAAK,UAAU,KAAA;GACjB;GAEA,IAAI,KAAK,SAAS,QAAQ;IACxB,SAAS;IACT,KAAK,QAAQ;GACf;GAEA,OAAO;GAGP,KAAK,UAAU,KAAA;EACjB;EAEA,KAAK,UAAU,MAAM,OAAO;CAC9B;CACA,EAAE,OAAO,YAAuC;EAC9C,OAAO,KAAK;CACd;CACA,IAAI,OAAe;EACjB,OAAO,KAAK,OAAO;CACrB;CACA,UAAiC;EAC/B,OAAO,KAAK,OAAO,KAAK;CAC1B;CACA,aAAa,KAAsB;EACjC,MAAM,OAAO,KAAK,OAAO,IAAI,GAAG;EAEhC,OAAO,OAAQ,KAAK,WAAW,OAAQ;CACzC;CACA,YAAY,KAAsB;EAChC,MAAM,OAAO,KAAK,OAAO,IAAI,GAAG;EAEhC,OAAO,OAAQ,KAAK,WAAW,OAAQ;CACzC;CACA,cAA0B;EACxB,OAAO,KAAK;CACd;CACA,aAAyB;EACvB,OAAO,KAAK;CACd;CACA,QAAQ,KAA0B;EAChC,OAAO,KAAK,OAAO,IAAI,GAAG,KAAK;CACjC;CACA,GAAG,KAA6B;EAE9B,MAAM,MAAM,CADE,GAAG,KAAK,QAAQ,CACf,CAAC,CAAC;EAEjB,OAAO,QAAQ,KAAA,IAAY,OAAO,KAAK,QAAQ,GAAG;CACpD;AACF"}
@@ -0,0 +1,23 @@
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/utils/useControlledState.ts.
14
+ * Modified for Solid Aria: adapted state handling, APIs, or formatting 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 { Accessor } from "solid-js";
18
+ type StateUpdate<T> = T | ((previous: T) => T);
19
+ type ControlledSetter<T, Args extends unknown[]> = (value: StateUpdate<T>, ...args: Args) => void;
20
+ export declare function createControlledSignal<T, Args extends unknown[] = []>(value: Accessor<T>, defaultValue: undefined, onChange?: (value: NoInfer<T>, ...args: Args) => void): [Accessor<T>, ControlledSetter<T, Args>];
21
+ export declare function createControlledSignal<T, Args extends unknown[] = []>(value: Accessor<T | undefined>, defaultValue: T, onChange?: (value: NoInfer<T>, ...args: Args) => void): [Accessor<T>, ControlledSetter<T, Args>];
22
+ export {};
23
+ //# sourceMappingURL=create-controlled-signal.d.ts.map
@@ -0,0 +1,54 @@
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/utils/useControlledState.ts.
14
+ * Modified for Solid Aria: adapted state handling, APIs, or formatting 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 { createRenderEffect, createSignal, untrack } from "solid-js";
18
+ // src/utils/create-controlled-signal.ts
19
+ function isUpdater(update) {
20
+ return typeof update === "function";
21
+ }
22
+ function createControlledSignal(value, defaultValue, onChange) {
23
+ const initialValue = untrack(value);
24
+ let initialState = defaultValue;
25
+ if (initialValue !== void 0) initialState = initialValue;
26
+ const [state, setState] = createSignal({ value: initialState }, { ownedWrite: true });
27
+ let pendingValue = initialState;
28
+ let wasControlled = initialValue !== void 0;
29
+ const currentValue = () => {
30
+ const controlledValue = value();
31
+ if (controlledValue !== void 0) return controlledValue;
32
+ return state().value;
33
+ };
34
+ createRenderEffect(() => ({
35
+ controlled: value() !== void 0,
36
+ state: state(),
37
+ value: currentValue()
38
+ }), (current) => {
39
+ if (wasControlled !== current.controlled && process.env.NODE_ENV !== "production") console.warn(`WARN: A component changed from ${wasControlled ? "controlled" : "uncontrolled"} to ${current.controlled ? "controlled" : "uncontrolled"}.`);
40
+ wasControlled = current.controlled;
41
+ pendingValue = current.value;
42
+ });
43
+ const setValue = (update, ...args) => {
44
+ const nextValue = isUpdater(update) ? update(pendingValue) : update;
45
+ if (Object.is(pendingValue, nextValue)) return;
46
+ pendingValue = nextValue;
47
+ setState({ value: nextValue });
48
+ untrack(() => onChange?.(nextValue, ...args));
49
+ };
50
+ return [currentValue, setValue];
51
+ }
52
+ export { createControlledSignal };
53
+
54
+ //# sourceMappingURL=create-controlled-signal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-controlled-signal.js","names":[],"sources":["../../src/utils/create-controlled-signal.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/utils/useControlledState.ts.\n * Modified for Solid Aria: adapted state handling, APIs, or formatting 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 { Accessor } from \"solid-js\";\nimport { createRenderEffect, createSignal, untrack } from \"solid-js\";\n\ntype StateUpdate<T> = T | ((previous: T) => T);\n\ntype ControlledSetter<T, Args extends unknown[]> = (\n value: StateUpdate<T>,\n ...args: Args\n) => void;\n\nfunction isUpdater<T>(update: StateUpdate<T>): update is (previous: T) => T {\n return typeof update === \"function\";\n}\n\nexport function createControlledSignal<T, Args extends unknown[] = []>(\n value: Accessor<T>,\n defaultValue: undefined,\n onChange?: (value: NoInfer<T>, ...args: Args) => void\n): [Accessor<T>, ControlledSetter<T, Args>];\nexport function createControlledSignal<T, Args extends unknown[] = []>(\n value: Accessor<T | undefined>,\n defaultValue: T,\n onChange?: (value: NoInfer<T>, ...args: Args) => void\n): [Accessor<T>, ControlledSetter<T, Args>];\nexport function createControlledSignal<T, Args extends unknown[] = []>(\n value: Accessor<T | undefined>,\n defaultValue: T,\n onChange?: (value: NoInfer<T>, ...args: Args) => void\n): [Accessor<T>, ControlledSetter<T, Args>] {\n const initialValue = untrack(value);\n\n let initialState = defaultValue;\n\n if (initialValue !== undefined) {\n initialState = initialValue;\n }\n\n const [state, setState] = createSignal(\n { value: initialState },\n { ownedWrite: true }\n );\n\n let pendingValue = initialState;\n let wasControlled = initialValue !== undefined;\n\n const currentValue = () => {\n const controlledValue = value();\n\n if (controlledValue !== undefined) {\n return controlledValue;\n }\n\n return state().value;\n };\n\n createRenderEffect(\n () => ({\n controlled: value() !== undefined,\n state: state(),\n value: currentValue(),\n }),\n (current) => {\n if (\n wasControlled !== current.controlled &&\n process.env.NODE_ENV !== \"production\"\n ) {\n console.warn(\n `WARN: A component changed from ${wasControlled ? \"controlled\" : \"uncontrolled\"} to ${current.controlled ? \"controlled\" : \"uncontrolled\"}.`\n );\n }\n\n wasControlled = current.controlled;\n pendingValue = current.value;\n }\n );\n\n const setValue: ControlledSetter<T, Args> = (update, ...args) => {\n const nextValue = isUpdater(update) ? update(pendingValue) : update;\n\n if (Object.is(pendingValue, nextValue)) {\n return;\n }\n\n pendingValue = nextValue;\n setState({ value: nextValue });\n untrack(() => onChange?.(nextValue, ...args));\n };\n\n return [currentValue, setValue];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA2BA,SAAS,UAAa,QAAsD;CAC1E,OAAO,OAAO,WAAW;AAC3B;AAYA,SAAgB,uBACd,OACA,cACA,UAC0C;CAC1C,MAAM,eAAe,QAAQ,KAAK;CAElC,IAAI,eAAe;CAEnB,IAAI,iBAAiB,KAAA,GACnB,eAAe;CAGjB,MAAM,CAAC,OAAO,YAAY,aACxB,EAAE,OAAO,aAAa,GACtB,EAAE,YAAY,KAAK,CACrB;CAEA,IAAI,eAAe;CACnB,IAAI,gBAAgB,iBAAiB,KAAA;CAErC,MAAM,qBAAqB;EACzB,MAAM,kBAAkB,MAAM;EAE9B,IAAI,oBAAoB,KAAA,GACtB,OAAO;EAGT,OAAO,MAAM,CAAC,CAAC;CACjB;CAEA,0BACS;EACL,YAAY,MAAM,MAAM,KAAA;EACxB,OAAO,MAAM;EACb,OAAO,aAAa;CACtB,KACC,YAAY;EACX,IACE,kBAAkB,QAAQ,cAC1B,QAAQ,IAAI,aAAa,cAEzB,QAAQ,KACN,kCAAkC,gBAAgB,eAAe,eAAe,MAAM,QAAQ,aAAa,eAAe,eAAe,EAC3I;EAGF,gBAAgB,QAAQ;EACxB,eAAe,QAAQ;CACzB,CACF;CAEA,MAAM,YAAuC,QAAQ,GAAG,SAAS;EAC/D,MAAM,YAAY,UAAU,MAAM,IAAI,OAAO,YAAY,IAAI;EAE7D,IAAI,OAAO,GAAG,cAAc,SAAS,GACnC;EAGF,eAAe;EACf,SAAS,EAAE,OAAO,UAAU,CAAC;EAC7B,cAAc,WAAW,WAAW,GAAG,IAAI,CAAC;CAC9C;CAEA,OAAO,CAAC,cAAc,QAAQ;AAChC"}
@@ -0,0 +1,5 @@
1
+
2
+ import { Key } from "@solid2-aria/types-shared";
3
+ /** Resolves the conventional id/key fields when a data source has no getKey callback. */
4
+ export declare function getItemKey(item: unknown): Key;
5
+ //# sourceMappingURL=get-item-key.d.ts.map
@@ -0,0 +1,12 @@
1
+
2
+ // src/utils/get-item-key.ts
3
+ /** Resolves the conventional id/key fields when a data source has no getKey callback. */
4
+ function getItemKey(item) {
5
+ if (typeof item !== "object" || item === null) throw new Error("Provide getKey for items without an id or key.");
6
+ const key = ("id" in item ? item.id : void 0) ?? ("key" in item ? item.key : void 0);
7
+ if (typeof key === "string" || typeof key === "number") return key;
8
+ throw new Error("Provide getKey for items without a string or number id or key.");
9
+ }
10
+ export { getItemKey };
11
+
12
+ //# sourceMappingURL=get-item-key.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-item-key.js","names":[],"sources":["../../src/utils/get-item-key.ts"],"sourcesContent":["import type { Key } from \"@solid2-aria/types-shared\";\n\n/** Resolves the conventional id/key fields when a data source has no getKey callback. */\n// oxlint-disable-next-line anti-slop/no-unknown-parameters -- This function parses the conventional id/key metadata boundary for arbitrary caller-provided items.\nexport function getItemKey(item: unknown): Key {\n if (typeof item !== \"object\" || item === null) {\n throw new Error(\"Provide getKey for items without an id or key.\");\n }\n\n const key =\n (\"id\" in item ? item.id : undefined) ??\n (\"key\" in item ? item.key : undefined);\n\n if (typeof key === \"string\" || typeof key === \"number\") {\n return key;\n }\n\n throw new Error(\n \"Provide getKey for items without a string or number id or key.\"\n );\n}\n"],"mappings":";;;AAIA,SAAgB,WAAW,MAAoB;CAC7C,IAAI,OAAO,SAAS,YAAY,SAAS,MACvC,MAAM,IAAI,MAAM,gDAAgD;CAGlE,MAAM,OACH,QAAQ,OAAO,KAAK,KAAK,KAAA,OACzB,SAAS,OAAO,KAAK,MAAM,KAAA;CAE9B,IAAI,OAAO,QAAQ,YAAY,OAAO,QAAQ,UAC5C,OAAO;CAGT,MAAM,IAAI,MACR,gEACF;AACF"}
@@ -0,0 +1,23 @@
1
+
2
+ import { ColumnSize } from "../table/column.js";
3
+ /** Read the built-in metadata at the boundary of the extensible Node.props contract. */
4
+ export declare function getNodeProps(node: {
5
+ props?: unknown;
6
+ } | null | undefined): {
7
+ allowsSorting: boolean;
8
+ children: number;
9
+ colSpan: number | undefined;
10
+ defaultWidth: ColumnSize | undefined;
11
+ disabledBehavior: unknown;
12
+ hasChildItems: boolean;
13
+ href: string | undefined;
14
+ isDisabled: boolean;
15
+ isDragButtonCell: boolean;
16
+ isLoading: boolean;
17
+ isRowHeader: boolean;
18
+ isSelectionCell: boolean;
19
+ maxWidth: ColumnSize | undefined;
20
+ minWidth: ColumnSize | undefined;
21
+ width: ColumnSize | undefined;
22
+ };
23
+ //# sourceMappingURL=get-node-props.d.ts.map
@@ -0,0 +1,38 @@
1
+
2
+ // src/utils/get-node-props.ts
3
+ function isColumnSize(value) {
4
+ return typeof value === "number" || typeof value === "string" && /^-?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?(?:%|fr)?$/iu.test(value);
5
+ }
6
+ function columnSize(metadata, key) {
7
+ const value = metadata[key];
8
+ return (typeof value === "string" || typeof value === "number") && isColumnSize(value) ? value : void 0;
9
+ }
10
+ /** Read the built-in metadata at the boundary of the extensible Node.props contract. */
11
+ function getNodeProps(node) {
12
+ const metadata = node?.props;
13
+ const props = typeof metadata === "object" && metadata !== null ? metadata : {};
14
+ const children = props.children;
15
+ const childItems = props.UNSTABLE_childItems;
16
+ const { colSpan } = props;
17
+ const { href } = props;
18
+ return {
19
+ allowsSorting: props.allowsSorting === true,
20
+ children: Array.isArray(children) ? children.length : 0,
21
+ colSpan: typeof colSpan === "number" ? colSpan : void 0,
22
+ defaultWidth: columnSize(props, "defaultWidth"),
23
+ disabledBehavior: props.disabledBehavior,
24
+ hasChildItems: childItems !== null && childItems !== void 0,
25
+ href: typeof href === "string" ? href : void 0,
26
+ isDisabled: props.isDisabled === true,
27
+ isDragButtonCell: props.isDragButtonCell === true,
28
+ isLoading: props.isLoading === true,
29
+ isRowHeader: props.isRowHeader === true,
30
+ isSelectionCell: props.isSelectionCell === true,
31
+ maxWidth: columnSize(props, "maxWidth"),
32
+ minWidth: columnSize(props, "minWidth"),
33
+ width: columnSize(props, "width")
34
+ };
35
+ }
36
+ export { getNodeProps };
37
+
38
+ //# sourceMappingURL=get-node-props.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-node-props.js","names":[],"sources":["../../src/utils/get-node-props.ts"],"sourcesContent":["import type { ColumnSize } from \"../table/column\";\n\ninterface NodeMetadata {\n allowsSorting?: unknown;\n children?: unknown;\n UNSTABLE_childItems?: unknown;\n colSpan?: unknown;\n href?: unknown;\n defaultWidth?: unknown;\n disabledBehavior?: unknown;\n isDisabled?: unknown;\n isDragButtonCell?: unknown;\n isLoading?: unknown;\n isRowHeader?: unknown;\n isSelectionCell?: unknown;\n maxWidth?: unknown;\n minWidth?: unknown;\n width?: unknown;\n}\n\nfunction isColumnSize(value: string | number): value is ColumnSize {\n return (\n typeof value === \"number\" ||\n (typeof value === \"string\" &&\n /^-?(?:\\d+\\.?\\d*|\\.\\d+)(?:e[+-]?\\d+)?(?:%|fr)?$/iu.test(value))\n );\n}\n\nfunction columnSize(\n metadata: NodeMetadata,\n key: \"width\" | \"defaultWidth\" | \"minWidth\" | \"maxWidth\"\n): ColumnSize | undefined {\n const value = metadata[key];\n\n return (typeof value === \"string\" || typeof value === \"number\") &&\n isColumnSize(value)\n ? value\n : undefined;\n}\n\n/** Read the built-in metadata at the boundary of the extensible Node.props contract. */\nexport function getNodeProps(node: { props?: unknown } | null | undefined) {\n const metadata: unknown = node?.props;\n\n const props: NodeMetadata =\n typeof metadata === \"object\" && metadata !== null ? metadata : {};\n\n const children: unknown = props.children;\n const childItems = props.UNSTABLE_childItems;\n const { colSpan } = props;\n const { href } = props;\n\n return {\n allowsSorting: props.allowsSorting === true,\n children: Array.isArray(children) ? children.length : 0,\n colSpan: typeof colSpan === \"number\" ? colSpan : undefined,\n defaultWidth: columnSize(props, \"defaultWidth\"),\n disabledBehavior: props.disabledBehavior,\n hasChildItems: childItems !== null && childItems !== undefined,\n href: typeof href === \"string\" ? href : undefined,\n isDisabled: props.isDisabled === true,\n isDragButtonCell: props.isDragButtonCell === true,\n isLoading: props.isLoading === true,\n isRowHeader: props.isRowHeader === true,\n isSelectionCell: props.isSelectionCell === true,\n maxWidth: columnSize(props, \"maxWidth\"),\n minWidth: columnSize(props, \"minWidth\"),\n width: columnSize(props, \"width\"),\n };\n}\n"],"mappings":";;AAoBA,SAAS,aAAa,OAA6C;CACjE,OACE,OAAO,UAAU,YAChB,OAAO,UAAU,YAChB,mDAAmD,KAAK,KAAK;AAEnE;AAEA,SAAS,WACP,UACA,KACwB;CACxB,MAAM,QAAQ,SAAS;CAEvB,QAAQ,OAAO,UAAU,YAAY,OAAO,UAAU,aACpD,aAAa,KAAK,IAChB,QACA,KAAA;AACN;;AAGA,SAAgB,aAAa,MAA8C;CACzE,MAAM,WAAoB,MAAM;CAEhC,MAAM,QACJ,OAAO,aAAa,YAAY,aAAa,OAAO,WAAW,CAAC;CAElE,MAAM,WAAoB,MAAM;CAChC,MAAM,aAAa,MAAM;CACzB,MAAM,EAAE,YAAY;CACpB,MAAM,EAAE,SAAS;CAEjB,OAAO;EACL,eAAe,MAAM,kBAAkB;EACvC,UAAU,MAAM,QAAQ,QAAQ,IAAI,SAAS,SAAS;EACtD,SAAS,OAAO,YAAY,WAAW,UAAU,KAAA;EACjD,cAAc,WAAW,OAAO,cAAc;EAC9C,kBAAkB,MAAM;EACxB,eAAe,eAAe,QAAQ,eAAe,KAAA;EACrD,MAAM,OAAO,SAAS,WAAW,OAAO,KAAA;EACxC,YAAY,MAAM,eAAe;EACjC,kBAAkB,MAAM,qBAAqB;EAC7C,WAAW,MAAM,cAAc;EAC/B,aAAa,MAAM,gBAAgB;EACnC,iBAAiB,MAAM,oBAAoB;EAC3C,UAAU,WAAW,OAAO,UAAU;EACtC,UAAU,WAAW,OAAO,UAAU;EACtC,OAAO,WAAW,OAAO,OAAO;CAClC;AACF"}
@@ -0,0 +1,5 @@
1
+
2
+ import { Element } from "solid-js";
3
+ /** Collection descriptors use JavaScript truthiness to select optional JSX content. */
4
+ export declare const hasContent: (value: Element) => boolean;
5
+ //# sourceMappingURL=has-content.d.ts.map
@@ -0,0 +1,7 @@
1
+
2
+ // src/utils/has-content.ts
3
+ /** Collection descriptors use JavaScript truthiness to select optional JSX content. */
4
+ const hasContent = Boolean;
5
+ export { hasContent };
6
+
7
+ //# sourceMappingURL=has-content.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"has-content.js","names":[],"sources":["../../src/utils/has-content.ts"],"sourcesContent":["import type { Element as SolidElement } from \"solid-js\";\n\n/** Collection descriptors use JavaScript truthiness to select optional JSX content. */\nexport const hasContent: (value: SolidElement) => boolean = Boolean;\n"],"mappings":";;;AAGA,MAAa,aAA+C"}
@@ -0,0 +1,10 @@
1
+
2
+ import { SelectProps } from "../select/create-select-state.js";
3
+ import { Key, Validation } from "@solid2-aria/types-shared";
4
+ type LegacySelectionProps = Pick<SelectProps<object>, "selectedKey" | "defaultSelectedKey" | "onSelectionChange">;
5
+ export declare function getLegacySelectedKey(props: LegacySelectionProps): Key | null | undefined;
6
+ export declare function getLegacyDefaultSelectedKey(props: LegacySelectionProps): Key | null | undefined;
7
+ export declare function notifyLegacySelectionChange(props: LegacySelectionProps, key: Key | null): void;
8
+ export declare function getLegacyValidationState(props: Pick<Validation, "validationState">): import("@solid2-aria/types-shared").ValidationState | undefined;
9
+ export {};
10
+ //# sourceMappingURL=legacy-props.d.ts.map
@@ -0,0 +1,17 @@
1
+
2
+ // src/utils/legacy-props.ts
3
+ function getLegacySelectedKey(props) {
4
+ return props.selectedKey;
5
+ }
6
+ function getLegacyDefaultSelectedKey(props) {
7
+ return props.defaultSelectedKey;
8
+ }
9
+ function notifyLegacySelectionChange(props, key) {
10
+ props.onSelectionChange?.(key);
11
+ }
12
+ function getLegacyValidationState(props) {
13
+ return props.validationState;
14
+ }
15
+ export { getLegacyDefaultSelectedKey, getLegacySelectedKey, getLegacyValidationState, notifyLegacySelectionChange };
16
+
17
+ //# sourceMappingURL=legacy-props.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacy-props.js","names":[],"sources":["../../src/utils/legacy-props.ts"],"sourcesContent":["import type { Key, Validation } from \"@solid2-aria/types-shared\";\n\nimport type { SelectProps } from \"../select/create-select-state\";\n\ntype LegacySelectionProps = Pick<\n SelectProps<object>,\n \"selectedKey\" | \"defaultSelectedKey\" | \"onSelectionChange\"\n>;\n\nexport function getLegacySelectedKey(\n props: LegacySelectionProps\n): Key | null | undefined {\n // oxlint-disable-next-line typescript/no-deprecated, solid/reactivity -- The compatibility getter is evaluated in its caller's tracked scope.\n return props.selectedKey;\n}\n\nexport function getLegacyDefaultSelectedKey(\n props: LegacySelectionProps\n): Key | null | undefined {\n // oxlint-disable-next-line typescript/no-deprecated, solid/reactivity -- The compatibility getter is evaluated in its caller's tracked scope.\n return props.defaultSelectedKey;\n}\n\nexport function notifyLegacySelectionChange(\n props: LegacySelectionProps,\n key: Key | null\n): void {\n // oxlint-disable-next-line typescript/no-deprecated -- Notify existing consumers of the legacy callback alongside onChange.\n props.onSelectionChange?.(key);\n}\n\nexport function getLegacyValidationState(\n props: Pick<Validation, \"validationState\">\n) {\n // oxlint-disable-next-line typescript/no-deprecated, solid/reactivity -- The compatibility getter is evaluated in its caller's tracked scope.\n return props.validationState;\n}\n"],"mappings":";;AASA,SAAgB,qBACd,OACwB;CAExB,OAAO,MAAM;AACf;AAEA,SAAgB,4BACd,OACwB;CAExB,OAAO,MAAM;AACf;AAEA,SAAgB,4BACd,OACA,KACM;CAEN,MAAM,oBAAoB,GAAG;AAC/B;AAEA,SAAgB,yBACd,OACA;CAEA,OAAO,MAAM;AACf"}
@@ -0,0 +1,25 @@
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/utils/number.ts.
14
+ * Modified for Solid Aria: adapted state handling, APIs, or formatting for Solid 2.
15
+ * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
16
+ */
17
+ /**
18
+ * Takes a value and forces it to the closest min/max if it's outside. Also forces it to the closest
19
+ * valid step.
20
+ */
21
+ export declare function clamp(value: number, min?: number, max?: number): number;
22
+ export declare function roundToStepPrecision(value: number, step: number): number;
23
+ export declare function snapValueToStep(value: number, min: number | undefined, max: number | undefined, step: number): number;
24
+ export declare function toFixedNumber(value: number, digits: number, base?: number): number;
25
+ //# sourceMappingURL=number.d.ts.map
@@ -0,0 +1,59 @@
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/utils/number.ts.
14
+ * Modified for Solid Aria: adapted state handling, APIs, or formatting 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/utils/number.ts
18
+ /**
19
+ * Takes a value and forces it to the closest min/max if it's outside. Also forces it to the closest
20
+ * valid step.
21
+ */
22
+ function clamp(value, min = -Infinity, max = Infinity) {
23
+ return Math.min(Math.max(value, min), max);
24
+ }
25
+ function roundToStepPrecision(value, step) {
26
+ let roundedValue = value;
27
+ let precision = 0;
28
+ const stepString = step.toString();
29
+ const eIndex = stepString.toLowerCase().indexOf("e-");
30
+ if (eIndex > 0) precision = Math.abs(Math.floor(Math.log10(Math.abs(step)))) + eIndex;
31
+ else {
32
+ const pointIndex = stepString.indexOf(".");
33
+ if (pointIndex !== -1) precision = stepString.length - pointIndex;
34
+ }
35
+ if (precision > 0) {
36
+ const pow = 10 ** precision;
37
+ roundedValue = Math.round(roundedValue * pow) / pow;
38
+ }
39
+ return roundedValue;
40
+ }
41
+ function snapValueToStep(value, min, max, step) {
42
+ const minOrNan = Number(min);
43
+ const maxOrNan = Number(max);
44
+ const remainder = (value - (Number.isNaN(minOrNan) ? 0 : minOrNan)) % step;
45
+ let snappedValue = roundToStepPrecision(Math.abs(remainder) * 2 >= step ? value + Math.sign(remainder) * (step - Math.abs(remainder)) : value - remainder, step);
46
+ if (!Number.isNaN(minOrNan)) {
47
+ if (snappedValue < minOrNan) snappedValue = minOrNan;
48
+ else if (!Number.isNaN(maxOrNan) && snappedValue > maxOrNan) snappedValue = minOrNan + Math.floor(roundToStepPrecision((maxOrNan - minOrNan) / step, step)) * step;
49
+ } else if (!Number.isNaN(maxOrNan) && snappedValue > maxOrNan) snappedValue = Math.floor(roundToStepPrecision(maxOrNan / step, step)) * step;
50
+ snappedValue = roundToStepPrecision(snappedValue, step);
51
+ return snappedValue;
52
+ }
53
+ function toFixedNumber(value, digits, base = 10) {
54
+ const pow = base ** digits;
55
+ return Math.round(value * pow) / pow;
56
+ }
57
+ export { clamp, roundToStepPrecision, snapValueToStep, toFixedNumber };
58
+
59
+ //# sourceMappingURL=number.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number.js","names":[],"sources":["../../src/utils/number.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/utils/number.ts.\n * Modified for Solid Aria: adapted state handling, APIs, or formatting 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/**\n * Takes a value and forces it to the closest min/max if it's outside. Also forces it to the closest\n * valid step.\n */\n\nexport function clamp(value: number, min = -Infinity, max = Infinity): number {\n const newValue = Math.min(Math.max(value, min), max);\n\n return newValue;\n}\n\nexport function roundToStepPrecision(value: number, step: number): number {\n let roundedValue = value;\n let precision = 0;\n const stepString = step.toString();\n // Handle negative exponents in exponential notation (e.g., \"1e-7\" → precision 8)\n const eIndex = stepString.toLowerCase().indexOf(\"e-\");\n\n if (eIndex > 0) {\n precision = Math.abs(Math.floor(Math.log10(Math.abs(step)))) + eIndex;\n } else {\n const pointIndex = stepString.indexOf(\".\");\n\n if (pointIndex !== -1) {\n precision = stepString.length - pointIndex;\n }\n }\n\n if (precision > 0) {\n const pow = 10 ** precision;\n roundedValue = Math.round(roundedValue * pow) / pow;\n }\n\n return roundedValue;\n}\n\nexport function snapValueToStep(\n value: number,\n min: number | undefined,\n max: number | undefined,\n step: number\n): number {\n const minOrNan = Number(min);\n const maxOrNan = Number(max);\n const remainder = (value - (Number.isNaN(minOrNan) ? 0 : minOrNan)) % step;\n\n let snappedValue = roundToStepPrecision(\n Math.abs(remainder) * 2 >= step\n ? value + Math.sign(remainder) * (step - Math.abs(remainder))\n : value - remainder,\n step\n );\n\n if (!Number.isNaN(minOrNan)) {\n if (snappedValue < minOrNan) {\n snappedValue = minOrNan;\n } else if (!Number.isNaN(maxOrNan) && snappedValue > maxOrNan) {\n snappedValue =\n minOrNan +\n Math.floor(roundToStepPrecision((maxOrNan - minOrNan) / step, step)) *\n step;\n }\n } else if (!Number.isNaN(maxOrNan) && snappedValue > maxOrNan) {\n snappedValue =\n Math.floor(roundToStepPrecision(maxOrNan / step, step)) * step;\n }\n\n // correct floating point behavior by rounding to step precision\n snappedValue = roundToStepPrecision(snappedValue, step);\n\n return snappedValue;\n}\n\n/* Takes a value and rounds off to the number of digits. */\nexport function toFixedNumber(\n value: number,\n digits: number,\n base = 10\n): number {\n const pow = base ** digits;\n\n return Math.round(value * pow) / pow;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBA,SAAgB,MAAM,OAAe,MAAM,WAAW,MAAM,UAAkB;CAG5E,OAFiB,KAAK,IAAI,KAAK,IAAI,OAAO,GAAG,GAAG,GAElC;AAChB;AAEA,SAAgB,qBAAqB,OAAe,MAAsB;CACxE,IAAI,eAAe;CACnB,IAAI,YAAY;CAChB,MAAM,aAAa,KAAK,SAAS;CAEjC,MAAM,SAAS,WAAW,YAAY,CAAC,CAAC,QAAQ,IAAI;CAEpD,IAAI,SAAS,GACX,YAAY,KAAK,IAAI,KAAK,MAAM,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI;MAC1D;EACL,MAAM,aAAa,WAAW,QAAQ,GAAG;EAEzC,IAAI,eAAe,IACjB,YAAY,WAAW,SAAS;CAEpC;CAEA,IAAI,YAAY,GAAG;EACjB,MAAM,MAAM,MAAM;EAClB,eAAe,KAAK,MAAM,eAAe,GAAG,IAAI;CAClD;CAEA,OAAO;AACT;AAEA,SAAgB,gBACd,OACA,KACA,KACA,MACQ;CACR,MAAM,WAAW,OAAO,GAAG;CAC3B,MAAM,WAAW,OAAO,GAAG;CAC3B,MAAM,aAAa,SAAS,OAAO,MAAM,QAAQ,IAAI,IAAI,aAAa;CAEtE,IAAI,eAAe,qBACjB,KAAK,IAAI,SAAS,IAAI,KAAK,OACvB,QAAQ,KAAK,KAAK,SAAS,KAAK,OAAO,KAAK,IAAI,SAAS,KACzD,QAAQ,WACZ,IACF;CAEA,IAAI,CAAC,OAAO,MAAM,QAAQ,GAAG;EAC3B,IAAI,eAAe,UACjB,eAAe;OACV,IAAI,CAAC,OAAO,MAAM,QAAQ,KAAK,eAAe,UACnD,eACE,WACA,KAAK,MAAM,sBAAsB,WAAW,YAAY,MAAM,IAAI,CAAC,IACjE;CAER,OAAO,IAAI,CAAC,OAAO,MAAM,QAAQ,KAAK,eAAe,UACnD,eACE,KAAK,MAAM,qBAAqB,WAAW,MAAM,IAAI,CAAC,IAAI;CAI9D,eAAe,qBAAqB,cAAc,IAAI;CAEtD,OAAO;AACT;AAGA,SAAgB,cACd,OACA,QACA,OAAO,IACC;CACR,MAAM,MAAM,QAAQ;CAEpB,OAAO,KAAK,MAAM,QAAQ,GAAG,IAAI;AACnC"}
@@ -0,0 +1,5 @@
1
+
2
+ import { CalendarIdentifier } from "@internationalized/date";
3
+ /** Narrow Intl's string calendar identifier before passing it to a calendar factory. */
4
+ export declare function parseCalendarIdentifier(value: string): CalendarIdentifier;
5
+ //# sourceMappingURL=parse-calendar-identifier.d.ts.map
@@ -0,0 +1,31 @@
1
+
2
+ // src/utils/parse-calendar-identifier.ts
3
+ const CALENDAR_IDENTIFIERS = [
4
+ "gregory",
5
+ "buddhist",
6
+ "chinese",
7
+ "coptic",
8
+ "dangi",
9
+ "ethioaa",
10
+ "ethiopic",
11
+ "hebrew",
12
+ "indian",
13
+ "islamic",
14
+ "islamic-umalqura",
15
+ "islamic-tbla",
16
+ "islamic-civil",
17
+ "islamic-rgsa",
18
+ "iso8601",
19
+ "japanese",
20
+ "persian",
21
+ "roc"
22
+ ];
23
+ /** Narrow Intl's string calendar identifier before passing it to a calendar factory. */
24
+ function parseCalendarIdentifier(value) {
25
+ const identifier = CALENDAR_IDENTIFIERS.find((candidate) => candidate === value);
26
+ if (identifier === void 0) throw new RangeError(`Unsupported calendar identifier: ${value}`);
27
+ return identifier;
28
+ }
29
+ export { parseCalendarIdentifier };
30
+
31
+ //# sourceMappingURL=parse-calendar-identifier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-calendar-identifier.js","names":[],"sources":["../../src/utils/parse-calendar-identifier.ts"],"sourcesContent":["import type { CalendarIdentifier } from \"@internationalized/date\";\n\nconst CALENDAR_IDENTIFIERS = [\n \"gregory\",\n \"buddhist\",\n \"chinese\",\n \"coptic\",\n \"dangi\",\n \"ethioaa\",\n \"ethiopic\",\n \"hebrew\",\n \"indian\",\n \"islamic\",\n \"islamic-umalqura\",\n \"islamic-tbla\",\n \"islamic-civil\",\n \"islamic-rgsa\",\n \"iso8601\",\n \"japanese\",\n \"persian\",\n \"roc\",\n] as const satisfies readonly CalendarIdentifier[];\n\n/** Narrow Intl's string calendar identifier before passing it to a calendar factory. */\nexport function parseCalendarIdentifier(value: string): CalendarIdentifier {\n const identifier = CALENDAR_IDENTIFIERS.find(\n (candidate) => candidate === value\n );\n\n if (identifier === undefined) {\n throw new RangeError(`Unsupported calendar identifier: ${value}`);\n }\n\n return identifier;\n}\n"],"mappings":";;AAEA,MAAM,uBAAuB;CAC3B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;AAGA,SAAgB,wBAAwB,OAAmC;CACzE,MAAM,aAAa,qBAAqB,MACrC,cAAc,cAAc,KAC/B;CAEA,IAAI,eAAe,KAAA,GACjB,MAAM,IAAI,WAAW,oCAAoC,OAAO;CAGlE,OAAO;AACT"}
@@ -0,0 +1,4 @@
1
+
2
+ /** Check collection and layout invariants that TypeScript cannot infer from key or index bounds. */
3
+ export declare function requireValue<T>(value: T, message: string): NonNullable<T>;
4
+ //# sourceMappingURL=require-value.d.ts.map
@@ -0,0 +1,10 @@
1
+
2
+ // src/utils/require-value.ts
3
+ /** Check collection and layout invariants that TypeScript cannot infer from key or index bounds. */
4
+ function requireValue(value, message) {
5
+ if (value === null || value === void 0) throw new Error(message);
6
+ return value;
7
+ }
8
+ export { requireValue };
9
+
10
+ //# sourceMappingURL=require-value.js.map