@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,55 @@
1
+ /*
2
+ * Copyright 2024 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/toggle/useToggleGroupState.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 { Key } from "@solid2-aria/types-shared";
18
+ export interface ToggleGroupProps {
19
+ /**
20
+ * Whether single or multiple selection is enabled.
21
+ *
22
+ * @default 'single'
23
+ */
24
+ selectionMode?: "single" | "multiple";
25
+ /** Whether the collection allows empty selection. */
26
+ disallowEmptySelection?: boolean;
27
+ /** The currently selected keys in the collection (controlled). */
28
+ selectedKeys?: Iterable<Key>;
29
+ /** The initial selected keys in the collection (uncontrolled). */
30
+ defaultSelectedKeys?: Iterable<Key>;
31
+ /** Handler that is called when the selection changes. */
32
+ onSelectionChange?: (keys: Set<Key>) => void;
33
+ /** Whether all items are disabled. */
34
+ isDisabled?: boolean;
35
+ }
36
+ export interface ToggleGroupState {
37
+ /** Whether single or multiple selection is enabled. */
38
+ readonly selectionMode: "single" | "multiple";
39
+ /** Whether all items are disabled. */
40
+ readonly isDisabled: boolean;
41
+ /** A set of keys for items that are selected. */
42
+ readonly selectedKeys: Set<Key>;
43
+ /** Toggles the selected state for an item by its key. */
44
+ toggleKey: (key: Key) => void;
45
+ /** Sets whether the given key is selected. */
46
+ setSelected: (key: Key, isSelected: boolean) => void;
47
+ /** Replaces the set of selected keys. */
48
+ setSelectedKeys: (keys: Set<Key>) => void;
49
+ }
50
+ /**
51
+ * Manages state for a group of toggles.
52
+ * It supports both single and multiple selected items.
53
+ */
54
+ export declare function createToggleGroupState(props: ToggleGroupProps): ToggleGroupState;
55
+ //# sourceMappingURL=create-toggle-group-state.d.ts.map
@@ -0,0 +1,62 @@
1
+ /*
2
+ * Copyright 2024 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/toggle/useToggleGroupState.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 { createMemo, untrack } from "solid-js";
19
+ // src/toggle/create-toggle-group-state.ts
20
+ /**
21
+ * Manages state for a group of toggles.
22
+ * It supports both single and multiple selected items.
23
+ */
24
+ function createToggleGroupState(props) {
25
+ const controlled = createMemo(() => props.selectedKeys ? new Set(props.selectedKeys) : void 0);
26
+ const [selectedKeys, setSelectedKeys] = createControlledSignal(controlled, untrack(() => new Set(props.defaultSelectedKeys)), (keys) => props.onSelectionChange?.(keys));
27
+ function toggleKey(key) {
28
+ setSelectedKeys((previous) => {
29
+ if (props.selectionMode !== "multiple") return new Set(previous.has(key) && !(props.disallowEmptySelection === true) ? [] : [key]);
30
+ const keys = new Set(previous);
31
+ if (keys.has(key) && (!(props.disallowEmptySelection === true) || keys.size > 1)) keys.delete(key);
32
+ else keys.add(key);
33
+ return keys;
34
+ });
35
+ }
36
+ return {
37
+ get isDisabled() {
38
+ return props.isDisabled ?? false;
39
+ },
40
+ get selectedKeys() {
41
+ return selectedKeys();
42
+ },
43
+ get selectionMode() {
44
+ return props.selectionMode ?? "single";
45
+ },
46
+ setSelected(key, isSelected) {
47
+ setSelectedKeys((previous) => {
48
+ if (previous.has(key) === isSelected) return previous;
49
+ if (props.selectionMode !== "multiple") return new Set(!isSelected && !(props.disallowEmptySelection === true) ? [] : [key]);
50
+ const keys = new Set(previous);
51
+ if (isSelected) keys.add(key);
52
+ else if (!(props.disallowEmptySelection === true) || keys.size > 1) keys.delete(key);
53
+ return keys;
54
+ });
55
+ },
56
+ setSelectedKeys,
57
+ toggleKey
58
+ };
59
+ }
60
+ export { createToggleGroupState };
61
+
62
+ //# sourceMappingURL=create-toggle-group-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-toggle-group-state.js","names":[],"sources":["../../src/toggle/create-toggle-group-state.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/*\n * Derived from Adobe React Spectrum: packages/react-stately/src/toggle/useToggleGroupState.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\";\nimport { createMemo, untrack } from \"solid-js\";\n\nimport { createControlledSignal } from \"../utils/create-controlled-signal\";\n\nexport interface ToggleGroupProps {\n /**\n * Whether single or multiple selection is enabled.\n *\n * @default 'single'\n */\n selectionMode?: \"single\" | \"multiple\";\n /** Whether the collection allows empty selection. */\n disallowEmptySelection?: boolean;\n /** The currently selected keys in the collection (controlled). */\n selectedKeys?: Iterable<Key>;\n /** The initial selected keys in the collection (uncontrolled). */\n defaultSelectedKeys?: Iterable<Key>;\n /** Handler that is called when the selection changes. */\n onSelectionChange?: (keys: Set<Key>) => void;\n /** Whether all items are disabled. */\n isDisabled?: boolean;\n}\n\nexport interface ToggleGroupState {\n /** Whether single or multiple selection is enabled. */\n readonly selectionMode: \"single\" | \"multiple\";\n /** Whether all items are disabled. */\n readonly isDisabled: boolean;\n /** A set of keys for items that are selected. */\n readonly selectedKeys: Set<Key>;\n /** Toggles the selected state for an item by its key. */\n toggleKey: (key: Key) => void;\n /** Sets whether the given key is selected. */\n setSelected: (key: Key, isSelected: boolean) => void;\n /** Replaces the set of selected keys. */\n setSelectedKeys: (keys: Set<Key>) => void;\n}\n\n/**\n * Manages state for a group of toggles.\n * It supports both single and multiple selected items.\n */\nexport function createToggleGroupState(\n props: ToggleGroupProps\n): ToggleGroupState {\n const controlled = createMemo(() =>\n props.selectedKeys ? new Set(props.selectedKeys) : undefined\n );\n\n const [selectedKeys, setSelectedKeys] = createControlledSignal(\n controlled,\n untrack(() => new Set<Key>(props.defaultSelectedKeys)),\n (keys) => props.onSelectionChange?.(keys)\n );\n\n function toggleKey(key: Key) {\n setSelectedKeys((previous) => {\n if (props.selectionMode !== \"multiple\") {\n return new Set(\n previous.has(key) && !(props.disallowEmptySelection === true)\n ? []\n : [key]\n );\n }\n\n const keys = new Set(previous);\n\n if (\n keys.has(key) &&\n (!(props.disallowEmptySelection === true) || keys.size > 1)\n ) {\n keys.delete(key);\n } else {\n keys.add(key);\n }\n\n return keys;\n });\n }\n\n return {\n get isDisabled() {\n return props.isDisabled ?? false;\n },\n get selectedKeys() {\n return selectedKeys();\n },\n get selectionMode() {\n return props.selectionMode ?? \"single\";\n },\n setSelected(key, isSelected) {\n setSelectedKeys((previous) => {\n if (previous.has(key) === isSelected) {\n return previous;\n }\n\n if (props.selectionMode !== \"multiple\") {\n return new Set(\n !isSelected && !(props.disallowEmptySelection === true) ? [] : [key]\n );\n }\n\n const keys = new Set(previous);\n\n if (isSelected) {\n keys.add(key);\n } else if (!(props.disallowEmptySelection === true) || keys.size > 1) {\n keys.delete(key);\n }\n\n return keys;\n });\n },\n setSelectedKeys,\n toggleKey,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA4DA,SAAgB,uBACd,OACkB;CAClB,MAAM,aAAa,iBACjB,MAAM,eAAe,IAAI,IAAI,MAAM,YAAY,IAAI,KAAA,CACrD;CAEA,MAAM,CAAC,cAAc,mBAAmB,uBACtC,YACA,cAAc,IAAI,IAAS,MAAM,mBAAmB,CAAC,IACpD,SAAS,MAAM,oBAAoB,IAAI,CAC1C;CAEA,SAAS,UAAU,KAAU;EAC3B,iBAAiB,aAAa;GAC5B,IAAI,MAAM,kBAAkB,YAC1B,OAAO,IAAI,IACT,SAAS,IAAI,GAAG,KAAK,EAAE,MAAM,2BAA2B,QACpD,CAAC,IACD,CAAC,GAAG,CACV;GAGF,MAAM,OAAO,IAAI,IAAI,QAAQ;GAE7B,IACE,KAAK,IAAI,GAAG,MACX,EAAE,MAAM,2BAA2B,SAAS,KAAK,OAAO,IAEzD,KAAK,OAAO,GAAG;QAEf,KAAK,IAAI,GAAG;GAGd,OAAO;EACT,CAAC;CACH;CAEA,OAAO;EACL,IAAI,aAAa;GACf,OAAO,MAAM,cAAc;EAC7B;EACA,IAAI,eAAe;GACjB,OAAO,aAAa;EACtB;EACA,IAAI,gBAAgB;GAClB,OAAO,MAAM,iBAAiB;EAChC;EACA,YAAY,KAAK,YAAY;GAC3B,iBAAiB,aAAa;IAC5B,IAAI,SAAS,IAAI,GAAG,MAAM,YACxB,OAAO;IAGT,IAAI,MAAM,kBAAkB,YAC1B,OAAO,IAAI,IACT,CAAC,cAAc,EAAE,MAAM,2BAA2B,QAAQ,CAAC,IAAI,CAAC,GAAG,CACrE;IAGF,MAAM,OAAO,IAAI,IAAI,QAAQ;IAE7B,IAAI,YACF,KAAK,IAAI,GAAG;SACP,IAAI,EAAE,MAAM,2BAA2B,SAAS,KAAK,OAAO,GACjE,KAAK,OAAO,GAAG;IAGjB,OAAO;GACT,CAAC;EACH;EACA;EACA;CACF;AACF"}
@@ -0,0 +1,58 @@
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/toggle/useToggleState.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 { Element } from "solid-js";
18
+ import { FocusableProps, InputBase, Validation } from "@solid2-aria/types-shared";
19
+ export interface ToggleStateOptions extends InputBase {
20
+ /**
21
+ * Whether the element should be selected (uncontrolled).
22
+ */
23
+ defaultSelected?: boolean;
24
+ /**
25
+ * Whether the element should be selected (controlled).
26
+ */
27
+ isSelected?: boolean;
28
+ /**
29
+ * Handler that is called when the element's selection state changes.
30
+ */
31
+ onChange?: (isSelected: boolean) => void;
32
+ }
33
+ export interface ToggleProps extends ToggleStateOptions, Validation<boolean>, FocusableProps {
34
+ /**
35
+ * The label for the element.
36
+ */
37
+ children?: Element;
38
+ /**
39
+ * The value of the input element, used when submitting an HTML form. See
40
+ * [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefvalue).
41
+ */
42
+ value?: string;
43
+ }
44
+ export interface ToggleState {
45
+ /** Whether the toggle is selected. */
46
+ readonly isSelected: boolean;
47
+ /** Whether the toggle is selected by default. */
48
+ readonly defaultSelected: boolean;
49
+ /** Updates selection state. */
50
+ setSelected: (isSelected: boolean) => void;
51
+ /** Toggle the selection state. */
52
+ toggle: () => void;
53
+ }
54
+ /**
55
+ * Provides state management for toggle components like checkboxes and switches.
56
+ */
57
+ export declare function createToggleState(props?: ToggleStateOptions): ToggleState;
58
+ //# sourceMappingURL=create-toggle-state.d.ts.map
@@ -0,0 +1,43 @@
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/toggle/useToggleState.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 { untrack } from "solid-js";
19
+ // src/toggle/create-toggle-state.ts
20
+ /**
21
+ * Provides state management for toggle components like checkboxes and switches.
22
+ */
23
+ function createToggleState(props = {}) {
24
+ const [isSelected, setSelected] = createControlledSignal(() => props.isSelected, untrack(() => props.defaultSelected ?? false), (value) => props.onChange?.(value));
25
+ const initialValue = untrack(isSelected);
26
+ return {
27
+ get defaultSelected() {
28
+ return props.defaultSelected ?? initialValue;
29
+ },
30
+ get isSelected() {
31
+ return isSelected();
32
+ },
33
+ setSelected(value) {
34
+ if (!(props.isReadOnly === true)) setSelected(value);
35
+ },
36
+ toggle() {
37
+ if (!(props.isReadOnly === true)) setSelected((value) => !value);
38
+ }
39
+ };
40
+ }
41
+ export { createToggleState };
42
+
43
+ //# sourceMappingURL=create-toggle-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-toggle-state.js","names":[],"sources":["../../src/toggle/create-toggle-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/toggle/useToggleState.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 FocusableProps,\n InputBase,\n Validation,\n} from \"@solid2-aria/types-shared\";\nimport type { Element as SolidElement } from \"solid-js\";\nimport { untrack } from \"solid-js\";\n\nimport { createControlledSignal } from \"../utils/create-controlled-signal\";\n\nexport interface ToggleStateOptions extends InputBase {\n /**\n * Whether the element should be selected (uncontrolled).\n */\n defaultSelected?: boolean;\n /**\n * Whether the element should be selected (controlled).\n */\n isSelected?: boolean;\n /**\n * Handler that is called when the element's selection state changes.\n */\n onChange?: (isSelected: boolean) => void;\n}\n\nexport interface ToggleProps\n extends ToggleStateOptions, Validation<boolean>, FocusableProps {\n /**\n * The label for the element.\n */\n children?: SolidElement;\n /**\n * The value of the input element, used when submitting an HTML form. See\n * [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefvalue).\n */\n value?: string;\n}\n\nexport interface ToggleState {\n /** Whether the toggle is selected. */\n readonly isSelected: boolean;\n /** Whether the toggle is selected by default. */\n readonly defaultSelected: boolean;\n /** Updates selection state. */\n setSelected: (isSelected: boolean) => void;\n /** Toggle the selection state. */\n toggle: () => void;\n}\n\n/**\n * Provides state management for toggle components like checkboxes and switches.\n */\nexport function createToggleState(props: ToggleStateOptions = {}): ToggleState {\n const [isSelected, setSelected] = createControlledSignal(\n () => props.isSelected,\n untrack(() => props.defaultSelected ?? false),\n (value) => props.onChange?.(value)\n );\n\n const initialValue = untrack(isSelected);\n\n return {\n get defaultSelected() {\n return props.defaultSelected ?? initialValue;\n },\n get isSelected() {\n return isSelected();\n },\n setSelected(value) {\n if (!(props.isReadOnly === true)) {\n setSelected(value);\n }\n },\n toggle() {\n if (!(props.isReadOnly === true)) {\n setSelected((value) => !value);\n }\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqEA,SAAgB,kBAAkB,QAA4B,CAAC,GAAgB;CAC7E,MAAM,CAAC,YAAY,eAAe,6BAC1B,MAAM,YACZ,cAAc,MAAM,mBAAmB,KAAK,IAC3C,UAAU,MAAM,WAAW,KAAK,CACnC;CAEA,MAAM,eAAe,QAAQ,UAAU;CAEvC,OAAO;EACL,IAAI,kBAAkB;GACpB,OAAO,MAAM,mBAAmB;EAClC;EACA,IAAI,aAAa;GACf,OAAO,WAAW;EACpB;EACA,YAAY,OAAO;GACjB,IAAI,EAAE,MAAM,eAAe,OACzB,YAAY,KAAK;EAErB;EACA,SAAS;GACP,IAAI,EAAE,MAAM,eAAe,OACzB,aAAa,UAAU,CAAC,KAAK;EAEjC;CACF;AACF"}
@@ -0,0 +1,39 @@
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/tokenfield/useTokenFieldState.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 { TokenFieldValue } from "./token-field-value.js";
18
+ import { ValueBase } from "@solid2-aria/types-shared";
19
+ export type TokenFieldProps<T extends TokenFieldValue = TokenFieldValue> = ValueBase<T> & (TokenFieldValue extends T ? unknown : {
20
+ value: T;
21
+ } | {
22
+ defaultValue: T;
23
+ });
24
+ export interface TokenFieldState<T extends TokenFieldValue = TokenFieldValue> {
25
+ /** The current value of the token field. */
26
+ value: T;
27
+ /** Sets the value of the token field. */
28
+ setValue: (fn: T | ((value: T) => T)) => void;
29
+ /** Whether the token field is composing. */
30
+ isComposing: boolean;
31
+ /** Sets the composing state of the token field. */
32
+ setComposing: (isComposing: boolean) => void;
33
+ }
34
+ /**
35
+ * Provides state management for a token field. Tracks the field value and the
36
+ * composition state.
37
+ */
38
+ export declare function createTokenFieldState<T extends TokenFieldValue = TokenFieldValue>(props: TokenFieldProps<T>): TokenFieldState<T>;
39
+ //# sourceMappingURL=create-token-field-state.d.ts.map
@@ -0,0 +1,44 @@
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/tokenfield/useTokenFieldState.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 { TokenFieldValue } from "./token-field-value.js";
19
+ import { createSignal, untrack } from "solid-js";
20
+ // src/tokenfield/create-token-field-state.ts
21
+ /**
22
+ * Provides state management for a token field. Tracks the field value and the
23
+ * composition state.
24
+ */
25
+ function createTokenFieldState(props) {
26
+ const fallback = untrack(() => props.defaultValue ?? props.value ?? new TokenFieldValue([]));
27
+ const [value, setValue] = createControlledSignal(() => props.value, fallback, (localValue) => props.onChange?.(localValue));
28
+ const [isComposing, setComposing] = createSignal(false, { ownedWrite: true });
29
+ return {
30
+ get isComposing() {
31
+ return isComposing();
32
+ },
33
+ setComposing(next) {
34
+ setComposing(next);
35
+ },
36
+ setValue,
37
+ get value() {
38
+ return value();
39
+ }
40
+ };
41
+ }
42
+ export { createTokenFieldState };
43
+
44
+ //# sourceMappingURL=create-token-field-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-token-field-state.js","names":[],"sources":["../../src/tokenfield/create-token-field-state.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/tokenfield/useTokenFieldState.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 { ValueBase } from \"@solid2-aria/types-shared\";\nimport { createSignal, untrack } from \"solid-js\";\n\nimport { createControlledSignal } from \"../utils/create-controlled-signal\";\nimport { TokenFieldValue } from \"./token-field-value\";\n\nexport type TokenFieldProps<T extends TokenFieldValue = TokenFieldValue> =\n ValueBase<T> &\n (TokenFieldValue extends T ? unknown : { value: T } | { defaultValue: T });\n\nexport interface TokenFieldState<T extends TokenFieldValue = TokenFieldValue> {\n /** The current value of the token field. */\n value: T;\n /** Sets the value of the token field. */\n setValue: (fn: T | ((value: T) => T)) => void;\n /** Whether the token field is composing. */\n isComposing: boolean;\n /** Sets the composing state of the token field. */\n setComposing: (isComposing: boolean) => void;\n}\n\n/**\n * Provides state management for a token field. Tracks the field value and the\n * composition state.\n */\nexport function createTokenFieldState<\n T extends TokenFieldValue = TokenFieldValue,\n>(props: TokenFieldProps<T>): TokenFieldState<T> {\n // SAFETY: TokenFieldProps requires an initial value for specialized T; only the base value type may use the empty fallback.\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n const fallback = untrack(\n () => props.defaultValue ?? props.value ?? new TokenFieldValue([])\n ) as T;\n\n const [value, setValue] = createControlledSignal(\n () => props.value,\n fallback,\n (localValue) => props.onChange?.(localValue)\n );\n\n const [isComposing, setComposing] = createSignal(false, { ownedWrite: true });\n\n return {\n get isComposing() {\n return isComposing();\n },\n setComposing(next) {\n setComposing(next);\n },\n setValue,\n get value() {\n return value();\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA0CA,SAAgB,sBAEd,OAA+C;CAG/C,MAAM,WAAW,cACT,MAAM,gBAAgB,MAAM,SAAS,IAAI,gBAAgB,CAAC,CAAC,CACnE;CAEA,MAAM,CAAC,OAAO,YAAY,6BAClB,MAAM,OACZ,WACC,eAAe,MAAM,WAAW,UAAU,CAC7C;CAEA,MAAM,CAAC,aAAa,gBAAgB,aAAa,OAAO,EAAE,YAAY,KAAK,CAAC;CAE5E,OAAO;EACL,IAAI,cAAc;GAChB,OAAO,YAAY;EACrB;EACA,aAAa,MAAM;GACjB,aAAa,IAAI;EACnB;EACA;EACA,IAAI,QAAQ;GACV,OAAO,MAAM;EACf;CACF;AACF"}
@@ -0,0 +1,111 @@
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/tokenfield/TokenFieldValue.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 type TokenFieldSegment<T = unknown> = TextSegment | TokenSegment<T>;
18
+ export interface TextSegment {
19
+ type: "text";
20
+ text: string;
21
+ }
22
+ export interface TokenSegment<T = unknown> {
23
+ type: "token";
24
+ text: string;
25
+ /** An arbitrary value associated with the token. */
26
+ value?: T;
27
+ }
28
+ export interface Position {
29
+ /** Index of the segment in the list. */
30
+ index: number;
31
+ /** Text offset within the segment in UTF-16 code units. */
32
+ offset: number;
33
+ }
34
+ /** Represents a text selection in a TokenField. */
35
+ export declare class SelectedRange {
36
+ /** The anchor position. */
37
+ anchor: Position;
38
+ /** The current (i.e. caret) position. */
39
+ current: Position;
40
+ /**
41
+ * Creates a new selection range. If only a single position is provided, the selection is
42
+ * collapsed.
43
+ */
44
+ constructor(anchor: Position, current?: Position);
45
+ /** Whether the selection is collapsed to a single caret position. */
46
+ get isCollapsed(): boolean;
47
+ /** The side of the selection closest to the start of the value. */
48
+ get start(): Position;
49
+ /** The side of the selection closest to the end of the value. */
50
+ get end(): Position;
51
+ /** Returns whether this selection is equal to another. */
52
+ isEqual(other: SelectedRange): boolean;
53
+ }
54
+ declare enum Direction {
55
+ Forward = 1,
56
+ Backward = -1
57
+ }
58
+ export interface TokenFieldValueOptions {
59
+ selectedRange?: SelectedRange | null;
60
+ }
61
+ /**
62
+ * A list of segments containing editable text and non-editable tokens.
63
+ */
64
+ export declare class TokenFieldValue<T = unknown> {
65
+ static readonly Direction: typeof Direction;
66
+ static readonly SelectedRange: typeof SelectedRange;
67
+ /** The text and token segments in the list. */
68
+ readonly segments: readonly TokenFieldSegment<T>[];
69
+ /** The selected range. */
70
+ selectedRange: SelectedRange;
71
+ private previous;
72
+ private next;
73
+ private isCoalescing;
74
+ /** Create a new list with the given segments. */
75
+ constructor(tokens: readonly TokenFieldSegment<T>[], options?: TokenFieldValueOptions);
76
+ protected createFieldValue(segments: readonly TokenFieldSegment<T>[]): this;
77
+ get caretPosition(): Position;
78
+ /** Create a new list with the caret position set to the given position. */
79
+ withSelectedRange(selectedRange: SelectedRange): this;
80
+ withCaretPosition(position: Position): this;
81
+ private static splitSegment;
82
+ private static createTextSegment;
83
+ protected tokenize(text: string): TokenFieldSegment<T>[];
84
+ private clampPosition;
85
+ /** Replace the text between two positions with new text. */
86
+ replaceRange(start: Position, end: Position, text: string, coalesce?: boolean): this;
87
+ /** Replace the text between two positions with new segments. */
88
+ replaceRangeWithSegments(initialStart: Position, initialEnd: Position, insert: TokenFieldSegment<T>[], coalesce?: boolean): this;
89
+ /** Find the boundary before or after a position using an Intl.Segmenter. */
90
+ findBoundaryWithSegmenter(initialPosition: Position, segmenter: Intl.Segmenter, direction: Direction): Position | null;
91
+ /** Find a line boundary before or after a position. */
92
+ findLineBoundary(position: Position, direction: Direction): Position | null;
93
+ /** Find a string or regular expression match before or after a position. */
94
+ findText(position: Position, direction: Direction, search: string | RegExp): Position | null;
95
+ /** Delete text at a position using a segmenter. */
96
+ delete(position: Position, segmenter: Intl.Segmenter, direction: Direction, coalesce?: boolean): this;
97
+ /** Delete text to the next or previous line break. */
98
+ deleteLine(position: Position, direction: Direction, coalesce?: boolean): this;
99
+ /** Create a new list containing a subset of the segments. */
100
+ slice(initialStart: Position, initialEnd: Position): this;
101
+ /** Convert the list to a string. */
102
+ toString(): string;
103
+ /** Returns the previous list in the undo history. */
104
+ undo(): this;
105
+ /** Returns the next list in the redo history. */
106
+ redo(): this;
107
+ /** End coalescing undo/redo history. */
108
+ endCoalescing(): void;
109
+ }
110
+ export {};
111
+ //# sourceMappingURL=token-field-value.d.ts.map