@gemologic/sheen 0.1.0-rc.0 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (484) hide show
  1. package/README.md +11 -1
  2. package/THIRD_PARTY_NOTICES.md +18 -0
  3. package/dist/primitives/Accordion.js +1 -1
  4. package/dist/primitives/Collapsible.js +1 -1
  5. package/dist/primitives/Combobox.js +1 -1
  6. package/dist/primitives/CommandPalette.js +2 -2
  7. package/dist/primitives/ContextMenu.js +2 -2
  8. package/dist/primitives/Dialog.js +1 -1
  9. package/dist/primitives/DropdownMenu.js +2 -2
  10. package/dist/primitives/LinkTooltip.js +1 -1
  11. package/dist/primitives/Popover.js +1 -1
  12. package/dist/primitives/Select.js +1 -1
  13. package/dist/primitives/Tabs.js +1 -1
  14. package/dist/primitives/Tooltip.js +1 -1
  15. package/dist/primitives/tooltip-layer.js +1 -1
  16. package/dist/theme/ThemeProvider.js +30 -30
  17. package/dist/theme/intl.js +4 -4
  18. package/dist/utils/polymorphic.d.ts +1 -1
  19. package/dist/vite.d.ts +3 -0
  20. package/dist/vite.js +54 -0
  21. package/package.json +71 -5
  22. package/src/primitives/Accordion.tsx +1 -1
  23. package/src/primitives/Collapsible.tsx +1 -1
  24. package/src/primitives/Combobox.tsx +1 -1
  25. package/src/primitives/CommandPalette.tsx +2 -2
  26. package/src/primitives/ContextMenu.tsx +2 -2
  27. package/src/primitives/Dialog.tsx +1 -1
  28. package/src/primitives/DropdownMenu.tsx +2 -2
  29. package/src/primitives/LinkTooltip.tsx +1 -1
  30. package/src/primitives/Popover.tsx +1 -1
  31. package/src/primitives/Select.tsx +1 -1
  32. package/src/primitives/Tabs.tsx +1 -1
  33. package/src/primitives/Tooltip.tsx +1 -1
  34. package/src/primitives/tooltip-layer.tsx +1 -1
  35. package/src/theme/ThemeProvider.tsx +7 -3
  36. package/src/theme/intl.ts +4 -2
  37. package/src/utils/polymorphic.ts +1 -1
  38. package/src/vite.ts +51 -0
  39. package/vendor/cmdk-solid/LICENSE +14 -0
  40. package/vendor/cmdk-solid/chunk/5WIGIOAJ.jsx +98 -0
  41. package/vendor/cmdk-solid/chunk/IOVUHIGA.js +96 -0
  42. package/vendor/cmdk-solid/command-score.cjs +98 -0
  43. package/vendor/cmdk-solid/command-score.d.cts +4 -0
  44. package/vendor/cmdk-solid/command-score.d.ts +4 -0
  45. package/vendor/cmdk-solid/command-score.js +2 -0
  46. package/vendor/cmdk-solid/command-score.jsx +7 -0
  47. package/vendor/cmdk-solid/index.cjs +827 -0
  48. package/vendor/cmdk-solid/index.d.cts +184 -0
  49. package/vendor/cmdk-solid/index.d.ts +184 -0
  50. package/vendor/cmdk-solid/index.js +729 -0
  51. package/vendor/cmdk-solid/index.jsx +666 -0
  52. package/vendor/integrity.json +450 -0
  53. package/vendor/kobalte-core/LICENSE.md +21 -0
  54. package/vendor/kobalte-core/NOTICE.txt +231 -0
  55. package/vendor/kobalte-core/accordion/index.d.ts +10 -0
  56. package/vendor/kobalte-core/accordion/index.js +2 -0
  57. package/vendor/kobalte-core/accordion/index.jsx +33 -0
  58. package/vendor/kobalte-core/alert/index.d.ts +5 -0
  59. package/vendor/kobalte-core/alert/index.js +2 -0
  60. package/vendor/kobalte-core/alert/index.jsx +11 -0
  61. package/vendor/kobalte-core/alert-dialog/index.d.ts +10 -0
  62. package/vendor/kobalte-core/alert-dialog/index.js +3 -0
  63. package/vendor/kobalte-core/alert-dialog/index.jsx +40 -0
  64. package/vendor/kobalte-core/badge/index.d.ts +23 -0
  65. package/vendor/kobalte-core/badge/index.js +24 -0
  66. package/vendor/kobalte-core/badge/index.jsx +24 -0
  67. package/vendor/kobalte-core/breadcrumbs/index.d.ts +5 -0
  68. package/vendor/kobalte-core/breadcrumbs/index.js +2 -0
  69. package/vendor/kobalte-core/breadcrumbs/index.jsx +19 -0
  70. package/vendor/kobalte-core/button/index.d.ts +6 -0
  71. package/vendor/kobalte-core/button/index.js +2 -0
  72. package/vendor/kobalte-core/button/index.jsx +12 -0
  73. package/vendor/kobalte-core/button-root-da654b3e.d.ts +28 -0
  74. package/vendor/kobalte-core/checkbox/index.d.ts +8 -0
  75. package/vendor/kobalte-core/checkbox/index.js +2 -0
  76. package/vendor/kobalte-core/checkbox/index.jsx +35 -0
  77. package/vendor/kobalte-core/chunk/272QBW42.js +712 -0
  78. package/vendor/kobalte-core/chunk/27MLNS66.js +353 -0
  79. package/vendor/kobalte-core/chunk/2RVGL3MU.js +45 -0
  80. package/vendor/kobalte-core/chunk/2UV3VFID.jsx +431 -0
  81. package/vendor/kobalte-core/chunk/2X5XWQIS.js +19 -0
  82. package/vendor/kobalte-core/chunk/2YCOH52P.js +81 -0
  83. package/vendor/kobalte-core/chunk/3565MS4H.jsx +127 -0
  84. package/vendor/kobalte-core/chunk/3ARTUDH2.jsx +1633 -0
  85. package/vendor/kobalte-core/chunk/3D6FM2PJ.js +1001 -0
  86. package/vendor/kobalte-core/chunk/3DLZMX4Z.jsx +81 -0
  87. package/vendor/kobalte-core/chunk/3DZKSKAQ.jsx +366 -0
  88. package/vendor/kobalte-core/chunk/3JA5IX2L.jsx +52 -0
  89. package/vendor/kobalte-core/chunk/3NGA46QE.js +116 -0
  90. package/vendor/kobalte-core/chunk/3QQCO6IA.js +46 -0
  91. package/vendor/kobalte-core/chunk/3T74IGH6.js +860 -0
  92. package/vendor/kobalte-core/chunk/3XNSRO2W.jsx +226 -0
  93. package/vendor/kobalte-core/chunk/43XIKO67.js +99 -0
  94. package/vendor/kobalte-core/chunk/4VWIKJ7Q.jsx +842 -0
  95. package/vendor/kobalte-core/chunk/53Y5XP3B.js +61 -0
  96. package/vendor/kobalte-core/chunk/5WXHJDCZ.jsx +10 -0
  97. package/vendor/kobalte-core/chunk/5ZKAE4VZ.js +8 -0
  98. package/vendor/kobalte-core/chunk/66KLKSW3.js +36 -0
  99. package/vendor/kobalte-core/chunk/6TDKM7BK.jsx +815 -0
  100. package/vendor/kobalte-core/chunk/6Y7B2NEO.js +21 -0
  101. package/vendor/kobalte-core/chunk/7ABWW5DT.jsx +483 -0
  102. package/vendor/kobalte-core/chunk/7CVNMTYF.js +171 -0
  103. package/vendor/kobalte-core/chunk/7DPKSDZL.js +447 -0
  104. package/vendor/kobalte-core/chunk/7I44E2QD.js +190 -0
  105. package/vendor/kobalte-core/chunk/7LCANGHD.js +29 -0
  106. package/vendor/kobalte-core/chunk/7OVKXYPU.js +90 -0
  107. package/vendor/kobalte-core/chunk/7TPOQ36Z.js +202 -0
  108. package/vendor/kobalte-core/chunk/7ZHN3PYD.js +30 -0
  109. package/vendor/kobalte-core/chunk/ANN3A2QM.js +29 -0
  110. package/vendor/kobalte-core/chunk/AT6SKIG6.js +119 -0
  111. package/vendor/kobalte-core/chunk/AWVDBFMO.jsx +280 -0
  112. package/vendor/kobalte-core/chunk/B2CSS4CB.js +36 -0
  113. package/vendor/kobalte-core/chunk/BDJEWKR2.jsx +153 -0
  114. package/vendor/kobalte-core/chunk/BK63AFY4.js +348 -0
  115. package/vendor/kobalte-core/chunk/BLN63FDC.js +40 -0
  116. package/vendor/kobalte-core/chunk/BU4OFZP5.jsx +146 -0
  117. package/vendor/kobalte-core/chunk/CLZZ2KZC.js +152 -0
  118. package/vendor/kobalte-core/chunk/CODJDE4S.jsx +131 -0
  119. package/vendor/kobalte-core/chunk/CWAEFUDR.js +732 -0
  120. package/vendor/kobalte-core/chunk/DBKNBLZP.js +395 -0
  121. package/vendor/kobalte-core/chunk/DTAYBJDT.jsx +339 -0
  122. package/vendor/kobalte-core/chunk/DX4MAOJL.js +653 -0
  123. package/vendor/kobalte-core/chunk/E4R2EMM4.js +10 -0
  124. package/vendor/kobalte-core/chunk/E53DB7BS.jsx +34 -0
  125. package/vendor/kobalte-core/chunk/EHGSTO6V.jsx +138 -0
  126. package/vendor/kobalte-core/chunk/EJ5I5XML.jsx +1 -0
  127. package/vendor/kobalte-core/chunk/ET5T45DO.js +17 -0
  128. package/vendor/kobalte-core/chunk/EYO4IMPK.jsx +867 -0
  129. package/vendor/kobalte-core/chunk/FINWO3A5.jsx +21 -0
  130. package/vendor/kobalte-core/chunk/FKUFPCQ6.jsx +120 -0
  131. package/vendor/kobalte-core/chunk/FLVHQV4A.jsx +22 -0
  132. package/vendor/kobalte-core/chunk/FN6EICGO.jsx +44 -0
  133. package/vendor/kobalte-core/chunk/FOXVCQFV.jsx +48 -0
  134. package/vendor/kobalte-core/chunk/G3KI2B4X.js +228 -0
  135. package/vendor/kobalte-core/chunk/G4JQYERT.jsx +1 -0
  136. package/vendor/kobalte-core/chunk/GAVSAJBM.jsx +86 -0
  137. package/vendor/kobalte-core/chunk/GIRHAWVP.jsx +46 -0
  138. package/vendor/kobalte-core/chunk/GROIIANN.jsx +32 -0
  139. package/vendor/kobalte-core/chunk/GSF7SFRW.jsx +98 -0
  140. package/vendor/kobalte-core/chunk/GXANOQ5B.jsx +66 -0
  141. package/vendor/kobalte-core/chunk/H7BK6JF7.jsx +489 -0
  142. package/vendor/kobalte-core/chunk/HGKTPMYY.js +1332 -0
  143. package/vendor/kobalte-core/chunk/HWIPVJ7H.js +121 -0
  144. package/vendor/kobalte-core/chunk/I2LBZHJH.js +144 -0
  145. package/vendor/kobalte-core/chunk/ICNSTULC.js +33 -0
  146. package/vendor/kobalte-core/chunk/IGYOA2ZZ.jsx +33 -0
  147. package/vendor/kobalte-core/chunk/IN725QRS.js +175 -0
  148. package/vendor/kobalte-core/chunk/INFLGCRV.js +123 -0
  149. package/vendor/kobalte-core/chunk/JEP7F7FN.js +89 -0
  150. package/vendor/kobalte-core/chunk/JGNXQB3J.js +140 -0
  151. package/vendor/kobalte-core/chunk/JHMNWOLY.jsx +87 -0
  152. package/vendor/kobalte-core/chunk/JNCCF6MP.jsx +12 -0
  153. package/vendor/kobalte-core/chunk/K6ON3K7Z.js +93 -0
  154. package/vendor/kobalte-core/chunk/K6P57S75.js +23 -0
  155. package/vendor/kobalte-core/chunk/KEL2LLJM.jsx +244 -0
  156. package/vendor/kobalte-core/chunk/KQVCPTCE.js +316 -0
  157. package/vendor/kobalte-core/chunk/KR2RRKPK.jsx +197 -0
  158. package/vendor/kobalte-core/chunk/KVL5CS3M.jsx +37 -0
  159. package/vendor/kobalte-core/chunk/LP6E37CW.jsx +228 -0
  160. package/vendor/kobalte-core/chunk/LUHKRAPV.js +129 -0
  161. package/vendor/kobalte-core/chunk/LV6CC6HJ.js +226 -0
  162. package/vendor/kobalte-core/chunk/MUDPLHYE.js +56 -0
  163. package/vendor/kobalte-core/chunk/NEFPNRTI.jsx +426 -0
  164. package/vendor/kobalte-core/chunk/NY67XGGP.js +216 -0
  165. package/vendor/kobalte-core/chunk/OGE3DKII.jsx +413 -0
  166. package/vendor/kobalte-core/chunk/OK5BA5VH.jsx +533 -0
  167. package/vendor/kobalte-core/chunk/OPHDMVQK.jsx +217 -0
  168. package/vendor/kobalte-core/chunk/OPRD3XHK.js +207 -0
  169. package/vendor/kobalte-core/chunk/OU7DYFTQ.jsx +191 -0
  170. package/vendor/kobalte-core/chunk/OYES4GOP.jsx +21 -0
  171. package/vendor/kobalte-core/chunk/P6IXTWXS.jsx +197 -0
  172. package/vendor/kobalte-core/chunk/PBBM7A6R.jsx +113 -0
  173. package/vendor/kobalte-core/chunk/PKWJSNR5.js +474 -0
  174. package/vendor/kobalte-core/chunk/PTVG6YKC.js +148 -0
  175. package/vendor/kobalte-core/chunk/PTWD4LYA.jsx +537 -0
  176. package/vendor/kobalte-core/chunk/PYSNB6I6.jsx +324 -0
  177. package/vendor/kobalte-core/chunk/Q2T3QQUA.js +419 -0
  178. package/vendor/kobalte-core/chunk/QEMPLYZX.js +28 -0
  179. package/vendor/kobalte-core/chunk/QIRIOMOH.js +338 -0
  180. package/vendor/kobalte-core/chunk/QJIB6BDF.jsx +30 -0
  181. package/vendor/kobalte-core/chunk/QJK6CGTE.js +293 -0
  182. package/vendor/kobalte-core/chunk/R4V3527Z.js +130 -0
  183. package/vendor/kobalte-core/chunk/R5JXRO27.js +1 -0
  184. package/vendor/kobalte-core/chunk/RFN6X5VH.jsx +1058 -0
  185. package/vendor/kobalte-core/chunk/SD3NY4DU.js +344 -0
  186. package/vendor/kobalte-core/chunk/SLRA6PIF.jsx +263 -0
  187. package/vendor/kobalte-core/chunk/SOM3K36D.jsx +191 -0
  188. package/vendor/kobalte-core/chunk/STGRFJHZ.js +43 -0
  189. package/vendor/kobalte-core/chunk/T4C3DMHT.jsx +52 -0
  190. package/vendor/kobalte-core/chunk/TDH5Z2ZB.js +263 -0
  191. package/vendor/kobalte-core/chunk/TP2BLHDF.jsx +284 -0
  192. package/vendor/kobalte-core/chunk/TS4C47MF.js +22 -0
  193. package/vendor/kobalte-core/chunk/TSB6MOZK.jsx +242 -0
  194. package/vendor/kobalte-core/chunk/TVVHJCOX.js +204 -0
  195. package/vendor/kobalte-core/chunk/TY22MKYR.jsx +996 -0
  196. package/vendor/kobalte-core/chunk/UEEZAKDC.js +1 -0
  197. package/vendor/kobalte-core/chunk/UESR3MKV.jsx +743 -0
  198. package/vendor/kobalte-core/chunk/UGE6PPGT.jsx +220 -0
  199. package/vendor/kobalte-core/chunk/UKTBL2JL.jsx +88 -0
  200. package/vendor/kobalte-core/chunk/V25KEN4T.jsx +399 -0
  201. package/vendor/kobalte-core/chunk/VI7QYH27.jsx +33 -0
  202. package/vendor/kobalte-core/chunk/W4MWOWKG.js +310 -0
  203. package/vendor/kobalte-core/chunk/WAUM5GOD.jsx +68 -0
  204. package/vendor/kobalte-core/chunk/WHII6HHI.js +145 -0
  205. package/vendor/kobalte-core/chunk/WKVBAVXH.jsx +378 -0
  206. package/vendor/kobalte-core/chunk/WR5BIFYV.js +780 -0
  207. package/vendor/kobalte-core/chunk/XLBXJFYN.js +108 -0
  208. package/vendor/kobalte-core/chunk/XNF3WGZ2.jsx +176 -0
  209. package/vendor/kobalte-core/chunk/XOC6SOOC.jsx +53 -0
  210. package/vendor/kobalte-core/chunk/XTJD7L6B.jsx +101 -0
  211. package/vendor/kobalte-core/chunk/XUUROM4M.jsx +120 -0
  212. package/vendor/kobalte-core/chunk/YA7DCYMB.js +80 -0
  213. package/vendor/kobalte-core/chunk/YFEENJN5.jsx +41 -0
  214. package/vendor/kobalte-core/chunk/YGDQXQ2B.js +28 -0
  215. package/vendor/kobalte-core/chunk/YKGT7A57.js +85 -0
  216. package/vendor/kobalte-core/chunk/YPUNLYJC.js +268 -0
  217. package/vendor/kobalte-core/chunk/YSW4UOAR.js +40 -0
  218. package/vendor/kobalte-core/chunk/ZAGMEN2K.jsx +152 -0
  219. package/vendor/kobalte-core/chunk/ZG3NR5OC.jsx +120 -0
  220. package/vendor/kobalte-core/chunk/ZZYKR3VO.jsx +42 -0
  221. package/vendor/kobalte-core/collapsible/index.d.ts +7 -0
  222. package/vendor/kobalte-core/collapsible/index.js +2 -0
  223. package/vendor/kobalte-core/collapsible/index.jsx +23 -0
  224. package/vendor/kobalte-core/collapsible-trigger-6358fcd4.d.ts +84 -0
  225. package/vendor/kobalte-core/color-area/index.d.ts +189 -0
  226. package/vendor/kobalte-core/color-area/index.js +724 -0
  227. package/vendor/kobalte-core/color-area/index.jsx +777 -0
  228. package/vendor/kobalte-core/color-channel-field/index.d.ts +49 -0
  229. package/vendor/kobalte-core/color-channel-field/index.js +72 -0
  230. package/vendor/kobalte-core/color-channel-field/index.jsx +117 -0
  231. package/vendor/kobalte-core/color-field/index.d.ts +48 -0
  232. package/vendor/kobalte-core/color-field/index.js +114 -0
  233. package/vendor/kobalte-core/color-field/index.jsx +155 -0
  234. package/vendor/kobalte-core/color-mode/index.d.ts +78 -0
  235. package/vendor/kobalte-core/color-mode/index.js +2 -0
  236. package/vendor/kobalte-core/color-mode/index.jsx +28 -0
  237. package/vendor/kobalte-core/color-slider/index.d.ts +109 -0
  238. package/vendor/kobalte-core/color-slider/index.js +183 -0
  239. package/vendor/kobalte-core/color-slider/index.jsx +255 -0
  240. package/vendor/kobalte-core/color-swatch/index.d.ts +39 -0
  241. package/vendor/kobalte-core/color-swatch/index.js +48 -0
  242. package/vendor/kobalte-core/color-swatch/index.jsx +64 -0
  243. package/vendor/kobalte-core/color-wheel/index.d.ts +166 -0
  244. package/vendor/kobalte-core/color-wheel/index.js +620 -0
  245. package/vendor/kobalte-core/color-wheel/index.jsx +640 -0
  246. package/vendor/kobalte-core/colors/index.d.ts +15 -0
  247. package/vendor/kobalte-core/colors/index.js +2 -0
  248. package/vendor/kobalte-core/colors/index.jsx +17 -0
  249. package/vendor/kobalte-core/combobox/index.d.ts +20 -0
  250. package/vendor/kobalte-core/combobox/index.js +8 -0
  251. package/vendor/kobalte-core/combobox/index.jsx +80 -0
  252. package/vendor/kobalte-core/combobox-root-3702d1f6.d.ts +382 -0
  253. package/vendor/kobalte-core/context-menu/index.d.ts +15 -0
  254. package/vendor/kobalte-core/context-menu/index.js +5 -0
  255. package/vendor/kobalte-core/context-menu/index.jsx +75 -0
  256. package/vendor/kobalte-core/create-list-state-d9a0f1f2.d.ts +232 -0
  257. package/vendor/kobalte-core/dialog/index.d.ts +10 -0
  258. package/vendor/kobalte-core/dialog/index.js +2 -0
  259. package/vendor/kobalte-core/dialog/index.jsx +40 -0
  260. package/vendor/kobalte-core/dialog-trigger-f415bd9b.d.ts +184 -0
  261. package/vendor/kobalte-core/dismissable-layer/index.d.ts +51 -0
  262. package/vendor/kobalte-core/dismissable-layer/index.js +2 -0
  263. package/vendor/kobalte-core/dismissable-layer/index.jsx +12 -0
  264. package/vendor/kobalte-core/dropdown-menu/index.d.ts +18 -0
  265. package/vendor/kobalte-core/dropdown-menu/index.js +5 -0
  266. package/vendor/kobalte-core/dropdown-menu/index.jsx +73 -0
  267. package/vendor/kobalte-core/file-field/index.d.ts +221 -0
  268. package/vendor/kobalte-core/file-field/index.js +539 -0
  269. package/vendor/kobalte-core/file-field/index.jsx +564 -0
  270. package/vendor/kobalte-core/form-control-description-330657bc.d.ts +49 -0
  271. package/vendor/kobalte-core/form-control-error-message-9efcbea8.d.ts +25 -0
  272. package/vendor/kobalte-core/form-control-label-2a5ca7a3.d.ts +22 -0
  273. package/vendor/kobalte-core/hover-card/index.d.ts +11 -0
  274. package/vendor/kobalte-core/hover-card/index.js +3 -0
  275. package/vendor/kobalte-core/hover-card/index.jsx +33 -0
  276. package/vendor/kobalte-core/i18n/index.d.ts +81 -0
  277. package/vendor/kobalte-core/i18n/index.js +2 -0
  278. package/vendor/kobalte-core/i18n/index.jsx +28 -0
  279. package/vendor/kobalte-core/image/index.d.ts +5 -0
  280. package/vendor/kobalte-core/image/index.js +2 -0
  281. package/vendor/kobalte-core/image/index.jsx +17 -0
  282. package/vendor/kobalte-core/index-19a0ff67.d.ts +180 -0
  283. package/vendor/kobalte-core/index-1a4410b1.d.ts +184 -0
  284. package/vendor/kobalte-core/index-29c57b8d.d.ts +90 -0
  285. package/vendor/kobalte-core/index-2a97f0d5.d.ts +259 -0
  286. package/vendor/kobalte-core/index-339032c6.d.ts +24 -0
  287. package/vendor/kobalte-core/index-3a4165aa.d.ts +38 -0
  288. package/vendor/kobalte-core/index-45d19411.d.ts +181 -0
  289. package/vendor/kobalte-core/index-47114d4c.d.ts +153 -0
  290. package/vendor/kobalte-core/index-4933558f.d.ts +22 -0
  291. package/vendor/kobalte-core/index-4cb1a0c7.d.ts +178 -0
  292. package/vendor/kobalte-core/index-544033ad.d.ts +148 -0
  293. package/vendor/kobalte-core/index-5eae1bf9.d.ts +145 -0
  294. package/vendor/kobalte-core/index-64ed0578.d.ts +47 -0
  295. package/vendor/kobalte-core/index-68c6e688.d.ts +125 -0
  296. package/vendor/kobalte-core/index-71913923.d.ts +107 -0
  297. package/vendor/kobalte-core/index-774e18fb.d.ts +155 -0
  298. package/vendor/kobalte-core/index-78f1e72b.d.ts +22 -0
  299. package/vendor/kobalte-core/index-79050fd4.d.ts +22 -0
  300. package/vendor/kobalte-core/index-82a3d7cf.d.ts +76 -0
  301. package/vendor/kobalte-core/index-839e646d.d.ts +308 -0
  302. package/vendor/kobalte-core/index-8b78f50e.d.ts +96 -0
  303. package/vendor/kobalte-core/index-8dfcce13.d.ts +49 -0
  304. package/vendor/kobalte-core/index-929e4c7c.d.ts +109 -0
  305. package/vendor/kobalte-core/index-a6cbe732.d.ts +267 -0
  306. package/vendor/kobalte-core/index-a8504bc6.d.ts +105 -0
  307. package/vendor/kobalte-core/index-d652f235.d.ts +234 -0
  308. package/vendor/kobalte-core/index-d734f7ac.d.ts +120 -0
  309. package/vendor/kobalte-core/index-e3628d61.d.ts +405 -0
  310. package/vendor/kobalte-core/index-e8f9edc7.d.ts +484 -0
  311. package/vendor/kobalte-core/index-e96454a3.d.ts +113 -0
  312. package/vendor/kobalte-core/index-ed2fe8c4.d.ts +176 -0
  313. package/vendor/kobalte-core/index-f3e15e6a.d.ts +107 -0
  314. package/vendor/kobalte-core/index.d.ts +333 -0
  315. package/vendor/kobalte-core/index.js +56 -0
  316. package/vendor/kobalte-core/index.jsx +322 -0
  317. package/vendor/kobalte-core/link/index.d.ts +6 -0
  318. package/vendor/kobalte-core/link/index.js +2 -0
  319. package/vendor/kobalte-core/link/index.jsx +12 -0
  320. package/vendor/kobalte-core/link-root-bf54d4f3.d.ts +26 -0
  321. package/vendor/kobalte-core/listbox/index.d.ts +10 -0
  322. package/vendor/kobalte-core/listbox/index.js +2 -0
  323. package/vendor/kobalte-core/listbox/index.jsx +30 -0
  324. package/vendor/kobalte-core/listbox-item-indicator-b8390ce9.d.ts +27 -0
  325. package/vendor/kobalte-core/listbox-section-58338bda.d.ts +172 -0
  326. package/vendor/kobalte-core/menu/index.d.ts +41 -0
  327. package/vendor/kobalte-core/menu/index.js +2 -0
  328. package/vendor/kobalte-core/menu/index.jsx +72 -0
  329. package/vendor/kobalte-core/menu-sub-trigger-29a7ad75.d.ts +462 -0
  330. package/vendor/kobalte-core/menubar/index.d.ts +19 -0
  331. package/vendor/kobalte-core/menubar/index.js +6 -0
  332. package/vendor/kobalte-core/menubar/index.jsx +79 -0
  333. package/vendor/kobalte-core/menubar-context-c1a81ca0.d.ts +73 -0
  334. package/vendor/kobalte-core/meter/index.d.ts +15 -0
  335. package/vendor/kobalte-core/meter/index.js +2 -0
  336. package/vendor/kobalte-core/meter/index.jsx +23 -0
  337. package/vendor/kobalte-core/meter-value-label-797727cd.d.ts +117 -0
  338. package/vendor/kobalte-core/navigation-menu/index.d.ts +191 -0
  339. package/vendor/kobalte-core/navigation-menu/index.js +432 -0
  340. package/vendor/kobalte-core/navigation-menu/index.jsx +571 -0
  341. package/vendor/kobalte-core/number-field/index.d.ts +11 -0
  342. package/vendor/kobalte-core/number-field/index.js +5 -0
  343. package/vendor/kobalte-core/number-field/index.jsx +42 -0
  344. package/vendor/kobalte-core/number-field-root-3524531f.d.ts +128 -0
  345. package/vendor/kobalte-core/pagination/index.d.ts +6 -0
  346. package/vendor/kobalte-core/pagination/index.js +2 -0
  347. package/vendor/kobalte-core/pagination/index.jsx +26 -0
  348. package/vendor/kobalte-core/polymorphic/index.d.ts +29 -0
  349. package/vendor/kobalte-core/polymorphic/index.js +2 -0
  350. package/vendor/kobalte-core/polymorphic/index.jsx +8 -0
  351. package/vendor/kobalte-core/popover/index.d.ts +11 -0
  352. package/vendor/kobalte-core/popover/index.js +3 -0
  353. package/vendor/kobalte-core/popover/index.jsx +45 -0
  354. package/vendor/kobalte-core/popper/index.d.ts +42 -0
  355. package/vendor/kobalte-core/popper/index.js +2 -0
  356. package/vendor/kobalte-core/popper/index.jsx +20 -0
  357. package/vendor/kobalte-core/popper-arrow-89a19127.d.ts +24 -0
  358. package/vendor/kobalte-core/popper-root-c2da235c.d.ts +81 -0
  359. package/vendor/kobalte-core/primitives/create-collection/index.d.ts +16 -0
  360. package/vendor/kobalte-core/primitives/create-collection/index.js +3 -0
  361. package/vendor/kobalte-core/primitives/create-collection/index.jsx +12 -0
  362. package/vendor/kobalte-core/primitives/create-controllable-signal/index.d.ts +33 -0
  363. package/vendor/kobalte-core/primitives/create-controllable-signal/index.js +2 -0
  364. package/vendor/kobalte-core/primitives/create-controllable-signal/index.jsx +15 -0
  365. package/vendor/kobalte-core/primitives/create-disclosure-state/index.d.ts +31 -0
  366. package/vendor/kobalte-core/primitives/create-disclosure-state/index.js +2 -0
  367. package/vendor/kobalte-core/primitives/create-disclosure-state/index.jsx +10 -0
  368. package/vendor/kobalte-core/primitives/create-dom-collection/index.d.ts +32 -0
  369. package/vendor/kobalte-core/primitives/create-dom-collection/index.js +2 -0
  370. package/vendor/kobalte-core/primitives/create-dom-collection/index.jsx +17 -0
  371. package/vendor/kobalte-core/primitives/create-escape-key-down/index.d.ts +18 -0
  372. package/vendor/kobalte-core/primitives/create-escape-key-down/index.js +2 -0
  373. package/vendor/kobalte-core/primitives/create-escape-key-down/index.jsx +8 -0
  374. package/vendor/kobalte-core/primitives/create-focus-scope/index.d.ts +21 -0
  375. package/vendor/kobalte-core/primitives/create-focus-scope/index.js +2 -0
  376. package/vendor/kobalte-core/primitives/create-focus-scope/index.jsx +9 -0
  377. package/vendor/kobalte-core/primitives/create-form-reset-listener/index.d.ts +9 -0
  378. package/vendor/kobalte-core/primitives/create-form-reset-listener/index.js +2 -0
  379. package/vendor/kobalte-core/primitives/create-form-reset-listener/index.jsx +8 -0
  380. package/vendor/kobalte-core/primitives/create-hide-outside/index.d.ts +29 -0
  381. package/vendor/kobalte-core/primitives/create-hide-outside/index.js +2 -0
  382. package/vendor/kobalte-core/primitives/create-hide-outside/index.jsx +12 -0
  383. package/vendor/kobalte-core/primitives/create-interact-outside/index.d.ts +39 -0
  384. package/vendor/kobalte-core/primitives/create-interact-outside/index.js +2 -0
  385. package/vendor/kobalte-core/primitives/create-interact-outside/index.jsx +9 -0
  386. package/vendor/kobalte-core/primitives/create-register-id/index.d.ts +9 -0
  387. package/vendor/kobalte-core/primitives/create-register-id/index.js +2 -0
  388. package/vendor/kobalte-core/primitives/create-register-id/index.jsx +8 -0
  389. package/vendor/kobalte-core/primitives/create-size/index.d.ts +9 -0
  390. package/vendor/kobalte-core/primitives/create-size/index.js +2 -0
  391. package/vendor/kobalte-core/primitives/create-size/index.jsx +8 -0
  392. package/vendor/kobalte-core/primitives/create-tag-name/index.d.ts +15 -0
  393. package/vendor/kobalte-core/primitives/create-tag-name/index.js +2 -0
  394. package/vendor/kobalte-core/primitives/create-tag-name/index.jsx +9 -0
  395. package/vendor/kobalte-core/primitives/create-toggle-state/index.d.ts +33 -0
  396. package/vendor/kobalte-core/primitives/create-toggle-state/index.js +2 -0
  397. package/vendor/kobalte-core/primitives/create-toggle-state/index.jsx +10 -0
  398. package/vendor/kobalte-core/primitives/create-transition/index.d.ts +52 -0
  399. package/vendor/kobalte-core/primitives/create-transition/index.js +2 -0
  400. package/vendor/kobalte-core/primitives/create-transition/index.jsx +8 -0
  401. package/vendor/kobalte-core/progress/index.d.ts +6 -0
  402. package/vendor/kobalte-core/progress/index.js +2 -0
  403. package/vendor/kobalte-core/progress/index.jsx +24 -0
  404. package/vendor/kobalte-core/radio-group/index.d.ts +8 -0
  405. package/vendor/kobalte-core/radio-group/index.js +4 -0
  406. package/vendor/kobalte-core/radio-group/index.jsx +40 -0
  407. package/vendor/kobalte-core/radio-group-root-0af7f9b9.d.ts +195 -0
  408. package/vendor/kobalte-core/rating/index.d.ts +172 -0
  409. package/vendor/kobalte-core/rating/index.js +464 -0
  410. package/vendor/kobalte-core/rating/index.jsx +540 -0
  411. package/vendor/kobalte-core/search/index.d.ts +85 -0
  412. package/vendor/kobalte-core/search/index.js +177 -0
  413. package/vendor/kobalte-core/search/index.jsx +227 -0
  414. package/vendor/kobalte-core/segmented-control/index.d.ts +69 -0
  415. package/vendor/kobalte-core/segmented-control/index.js +162 -0
  416. package/vendor/kobalte-core/segmented-control/index.jsx +217 -0
  417. package/vendor/kobalte-core/select/index.d.ts +19 -0
  418. package/vendor/kobalte-core/select/index.js +6 -0
  419. package/vendor/kobalte-core/select/index.jsx +75 -0
  420. package/vendor/kobalte-core/separator/index.d.ts +6 -0
  421. package/vendor/kobalte-core/separator/index.js +2 -0
  422. package/vendor/kobalte-core/separator/index.jsx +12 -0
  423. package/vendor/kobalte-core/separator-root-cb685406.d.ts +25 -0
  424. package/vendor/kobalte-core/skeleton/index.d.ts +5 -0
  425. package/vendor/kobalte-core/skeleton/index.js +2 -0
  426. package/vendor/kobalte-core/skeleton/index.jsx +11 -0
  427. package/vendor/kobalte-core/slider/index.d.ts +11 -0
  428. package/vendor/kobalte-core/slider/index.js +5 -0
  429. package/vendor/kobalte-core/slider/index.jsx +43 -0
  430. package/vendor/kobalte-core/slider-value-label-2be90f59.d.ts +211 -0
  431. package/vendor/kobalte-core/spin-button/index.d.ts +10 -0
  432. package/vendor/kobalte-core/spin-button/index.js +2 -0
  433. package/vendor/kobalte-core/spin-button/index.jsx +12 -0
  434. package/vendor/kobalte-core/spin-button-root-3a44420a.d.ts +63 -0
  435. package/vendor/kobalte-core/switch/index.d.ts +8 -0
  436. package/vendor/kobalte-core/switch/index.js +2 -0
  437. package/vendor/kobalte-core/switch/index.jsx +35 -0
  438. package/vendor/kobalte-core/tabs/index.d.ts +8 -0
  439. package/vendor/kobalte-core/tabs/index.js +2 -0
  440. package/vendor/kobalte-core/tabs/index.jsx +27 -0
  441. package/vendor/kobalte-core/text-field/index.d.ts +9 -0
  442. package/vendor/kobalte-core/text-field/index.js +5 -0
  443. package/vendor/kobalte-core/text-field/index.jsx +34 -0
  444. package/vendor/kobalte-core/text-field-root-0b8dfa5a.d.ts +73 -0
  445. package/vendor/kobalte-core/time-field/index.d.ts +165 -0
  446. package/vendor/kobalte-core/time-field/index.js +818 -0
  447. package/vendor/kobalte-core/time-field/index.jsx +824 -0
  448. package/vendor/kobalte-core/toast/index.d.ts +6 -0
  449. package/vendor/kobalte-core/toast/index.js +2 -0
  450. package/vendor/kobalte-core/toast/index.jsx +33 -0
  451. package/vendor/kobalte-core/toggle-button/index.d.ts +7 -0
  452. package/vendor/kobalte-core/toggle-button/index.js +2 -0
  453. package/vendor/kobalte-core/toggle-button/index.jsx +16 -0
  454. package/vendor/kobalte-core/toggle-button-root-1cfacf95.d.ts +42 -0
  455. package/vendor/kobalte-core/toggle-group/index.d.ts +10 -0
  456. package/vendor/kobalte-core/toggle-group/index.js +2 -0
  457. package/vendor/kobalte-core/toggle-group/index.jsx +26 -0
  458. package/vendor/kobalte-core/tooltip/index.d.ts +10 -0
  459. package/vendor/kobalte-core/tooltip/index.js +3 -0
  460. package/vendor/kobalte-core/tooltip/index.jsx +32 -0
  461. package/vendor/kobalte-core/types-6adf33e1.d.ts +8 -0
  462. package/vendor/kobalte-core/types-877adc4a.d.ts +125 -0
  463. package/vendor/kobalte-core/types-f8ae18e5.d.ts +72 -0
  464. package/vendor/kobalte-core/utils-45fb8d63.d.ts +11 -0
  465. package/vendor/kobalte-utils/LICENSE.md +21 -0
  466. package/vendor/kobalte-utils/NOTICE.txt +231 -0
  467. package/vendor/kobalte-utils/index.cjs +878 -0
  468. package/vendor/kobalte-utils/index.d.cts +227 -0
  469. package/vendor/kobalte-utils/index.d.ts +227 -0
  470. package/vendor/kobalte-utils/index.js +791 -0
  471. package/vendor/origins.json +33 -0
  472. package/vendor/solid-web/LICENSE +21 -0
  473. package/vendor/solid-web/dev.cjs +896 -0
  474. package/vendor/solid-web/dev.js +784 -0
  475. package/vendor/solid-web/server.cjs +2 -0
  476. package/vendor/solid-web/server.js +2 -0
  477. package/vendor/solid-web/types/client.d.ts +93 -0
  478. package/vendor/solid-web/types/core.d.ts +2 -0
  479. package/vendor/solid-web/types/index.d.ts +50 -0
  480. package/vendor/solid-web/types/jsx.d.ts +1 -0
  481. package/vendor/solid-web/types/server-mock.d.ts +65 -0
  482. package/vendor/solid-web/types/server.d.ts +187 -0
  483. package/vendor/solid-web/web.cjs +885 -0
  484. package/vendor/solid-web/web.js +773 -0
@@ -0,0 +1,1058 @@
1
+ // Vendored and modified by Gemologic Sheen from @kobalte/core@0.13.13; see package THIRD_PARTY_NOTICES.md.
2
+ import {
3
+ createCollection
4
+ } from "./FKUFPCQ6.jsx";
5
+ import {
6
+ useLocale
7
+ } from "./LP6E37CW.jsx";
8
+ import {
9
+ createControllableSignal
10
+ } from "./FN6EICGO.jsx";
11
+
12
+ // src/selection/types.ts
13
+ var Selection = class _Selection extends Set {
14
+ anchorKey;
15
+ currentKey;
16
+ constructor(keys, anchorKey, currentKey) {
17
+ super(keys);
18
+ if (keys instanceof _Selection) {
19
+ this.anchorKey = anchorKey || keys.anchorKey;
20
+ this.currentKey = currentKey || keys.currentKey;
21
+ } else {
22
+ this.anchorKey = anchorKey;
23
+ this.currentKey = currentKey;
24
+ }
25
+ }
26
+ };
27
+
28
+ // src/selection/create-multiple-selection-state.ts
29
+ import { access, mergeDefaultProps } from "#sheen-kobalte-utils";
30
+ import { createEffect, createMemo, createSignal } from "solid-js";
31
+
32
+ // src/selection/create-controllable-selection-signal.ts
33
+ function createControllableSelectionSignal(props) {
34
+ const [_value, setValue] = createControllableSignal(props);
35
+ const value = () => _value() ?? new Selection();
36
+ return [value, setValue];
37
+ }
38
+
39
+ // src/selection/utils.ts
40
+ import { isAppleDevice, isMac } from "#sheen-kobalte-utils";
41
+ function isNonContiguousSelectionModifier(e) {
42
+ return isAppleDevice() ? e.altKey : e.ctrlKey;
43
+ }
44
+ function isCtrlKeyPressed(e) {
45
+ if (isMac()) {
46
+ return e.metaKey;
47
+ }
48
+ return e.ctrlKey;
49
+ }
50
+ function convertSelection(selection) {
51
+ return new Selection(selection);
52
+ }
53
+ function isSameSelection(setA, setB) {
54
+ if (setA.size !== setB.size) {
55
+ return false;
56
+ }
57
+ for (const item of setA) {
58
+ if (!setB.has(item)) {
59
+ return false;
60
+ }
61
+ }
62
+ return true;
63
+ }
64
+
65
+ // src/selection/create-multiple-selection-state.ts
66
+ function createMultipleSelectionState(props) {
67
+ const mergedProps = mergeDefaultProps(
68
+ {
69
+ selectionMode: "none",
70
+ selectionBehavior: "toggle"
71
+ },
72
+ props
73
+ );
74
+ const [isFocused, setFocused] = createSignal(false);
75
+ const [focusedKey, setFocusedKey] = createSignal();
76
+ const selectedKeysProp = createMemo(() => {
77
+ const selection = access(mergedProps.selectedKeys);
78
+ if (selection != null) {
79
+ return convertSelection(selection);
80
+ }
81
+ return selection;
82
+ });
83
+ const defaultSelectedKeys = createMemo(() => {
84
+ const defaultSelection = access(mergedProps.defaultSelectedKeys);
85
+ if (defaultSelection != null) {
86
+ return convertSelection(defaultSelection);
87
+ }
88
+ return new Selection();
89
+ });
90
+ const [selectedKeys, _setSelectedKeys] = createControllableSelectionSignal({
91
+ value: selectedKeysProp,
92
+ defaultValue: defaultSelectedKeys,
93
+ onChange: (value) => mergedProps.onSelectionChange?.(value)
94
+ });
95
+ const [selectionBehavior, setSelectionBehavior] = createSignal(access(mergedProps.selectionBehavior));
96
+ const selectionMode = () => access(mergedProps.selectionMode);
97
+ const disallowEmptySelection = () => access(mergedProps.disallowEmptySelection) ?? false;
98
+ const setSelectedKeys = (keys) => {
99
+ if (access(mergedProps.allowDuplicateSelectionEvents) || !isSameSelection(keys, selectedKeys())) {
100
+ _setSelectedKeys(keys);
101
+ }
102
+ };
103
+ createEffect(() => {
104
+ const selection = selectedKeys();
105
+ if (access(mergedProps.selectionBehavior) === "replace" && selectionBehavior() === "toggle" && typeof selection === "object" && selection.size === 0) {
106
+ setSelectionBehavior("replace");
107
+ }
108
+ });
109
+ createEffect(() => {
110
+ setSelectionBehavior(access(mergedProps.selectionBehavior) ?? "toggle");
111
+ });
112
+ return {
113
+ selectionMode,
114
+ disallowEmptySelection,
115
+ selectionBehavior,
116
+ setSelectionBehavior,
117
+ isFocused,
118
+ setFocused,
119
+ focusedKey,
120
+ setFocusedKey,
121
+ selectedKeys,
122
+ setSelectedKeys
123
+ };
124
+ }
125
+
126
+ // src/selection/create-type-select.ts
127
+ import { access as access2 } from "#sheen-kobalte-utils";
128
+ import { createSignal as createSignal2 } from "solid-js";
129
+ function createTypeSelect(props) {
130
+ const [search, setSearch] = createSignal2("");
131
+ const [timeoutId, setTimeoutId] = createSignal2(-1);
132
+ const onKeyDown = (e) => {
133
+ if (access2(props.isDisabled)) {
134
+ return;
135
+ }
136
+ const delegate = access2(props.keyboardDelegate);
137
+ const manager = access2(props.selectionManager);
138
+ if (!delegate.getKeyForSearch) {
139
+ return;
140
+ }
141
+ const character = getStringForKey(e.key);
142
+ if (!character || e.ctrlKey || e.metaKey) {
143
+ return;
144
+ }
145
+ if (character === " " && search().trim().length > 0) {
146
+ e.preventDefault();
147
+ e.stopPropagation();
148
+ }
149
+ let newSearch = setSearch((prev) => prev + character);
150
+ let key = delegate.getKeyForSearch(newSearch, manager.focusedKey()) ?? delegate.getKeyForSearch(newSearch);
151
+ if (key == null && isAllSameLetter(newSearch)) {
152
+ newSearch = newSearch[0];
153
+ key = delegate.getKeyForSearch(newSearch, manager.focusedKey()) ?? delegate.getKeyForSearch(newSearch);
154
+ }
155
+ if (key != null) {
156
+ manager.setFocusedKey(key);
157
+ props.onTypeSelect?.(key);
158
+ }
159
+ clearTimeout(timeoutId());
160
+ setTimeoutId(window.setTimeout(() => setSearch(""), 500));
161
+ };
162
+ return {
163
+ typeSelectHandlers: {
164
+ onKeyDown
165
+ }
166
+ };
167
+ }
168
+ function getStringForKey(key) {
169
+ if (key.length === 1 || !/^[A-Z]/i.test(key)) {
170
+ return key;
171
+ }
172
+ return "";
173
+ }
174
+ function isAllSameLetter(search) {
175
+ return search.split("").every((letter) => letter === search[0]);
176
+ }
177
+
178
+ // src/selection/create-selectable-collection.ts
179
+ import {
180
+ access as access3,
181
+ callHandler,
182
+ createEventListener,
183
+ focusWithoutScrolling,
184
+ getFocusableTreeWalker,
185
+ scrollIntoView
186
+ } from "#sheen-kobalte-utils";
187
+ import {
188
+ createEffect as createEffect2,
189
+ createMemo as createMemo2,
190
+ mergeProps,
191
+ on,
192
+ onMount
193
+ } from "solid-js";
194
+ function createSelectableCollection(props, ref, scrollRef) {
195
+ const defaultProps = {
196
+ selectOnFocus: () => access3(props.selectionManager).selectionBehavior() === "replace"
197
+ };
198
+ const mergedProps = mergeProps(defaultProps, props);
199
+ const finalScrollRef = () => scrollRef?.() ?? ref();
200
+ const { direction } = useLocale();
201
+ let scrollPos = { top: 0, left: 0 };
202
+ createEventListener(
203
+ () => !access3(mergedProps.isVirtualized) ? finalScrollRef() : void 0,
204
+ "scroll",
205
+ () => {
206
+ const scrollEl = finalScrollRef();
207
+ if (!scrollEl) {
208
+ return;
209
+ }
210
+ scrollPos = {
211
+ top: scrollEl.scrollTop,
212
+ left: scrollEl.scrollLeft
213
+ };
214
+ }
215
+ );
216
+ const { typeSelectHandlers } = createTypeSelect({
217
+ isDisabled: () => access3(mergedProps.disallowTypeAhead),
218
+ keyboardDelegate: () => access3(mergedProps.keyboardDelegate),
219
+ selectionManager: () => access3(mergedProps.selectionManager)
220
+ });
221
+ const orientation = () => access3(mergedProps.orientation) ?? "vertical";
222
+ const onKeyDown = (e) => {
223
+ callHandler(e, typeSelectHandlers.onKeyDown);
224
+ if (e.altKey && e.key === "Tab") {
225
+ e.preventDefault();
226
+ }
227
+ const refEl = ref();
228
+ if (!refEl?.contains(e.target)) {
229
+ return;
230
+ }
231
+ const manager = access3(mergedProps.selectionManager);
232
+ const selectOnFocus = access3(mergedProps.selectOnFocus);
233
+ const navigateToKey = (key) => {
234
+ if (key != null) {
235
+ manager.setFocusedKey(key);
236
+ if (e.shiftKey && manager.selectionMode() === "multiple") {
237
+ manager.extendSelection(key);
238
+ } else if (selectOnFocus && !isNonContiguousSelectionModifier(e)) {
239
+ manager.replaceSelection(key);
240
+ }
241
+ }
242
+ };
243
+ const delegate = access3(mergedProps.keyboardDelegate);
244
+ const shouldFocusWrap = access3(mergedProps.shouldFocusWrap);
245
+ const focusedKey = manager.focusedKey();
246
+ switch (e.key) {
247
+ case (orientation() === "vertical" ? "ArrowDown" : "ArrowRight"): {
248
+ if (delegate.getKeyBelow) {
249
+ e.preventDefault();
250
+ let nextKey;
251
+ if (focusedKey != null) {
252
+ nextKey = delegate.getKeyBelow(focusedKey);
253
+ } else {
254
+ nextKey = delegate.getFirstKey?.();
255
+ }
256
+ if (nextKey == null && shouldFocusWrap) {
257
+ nextKey = delegate.getFirstKey?.(focusedKey);
258
+ }
259
+ navigateToKey(nextKey);
260
+ }
261
+ break;
262
+ }
263
+ case (orientation() === "vertical" ? "ArrowUp" : "ArrowLeft"): {
264
+ if (delegate.getKeyAbove) {
265
+ e.preventDefault();
266
+ let nextKey;
267
+ if (focusedKey != null) {
268
+ nextKey = delegate.getKeyAbove(focusedKey);
269
+ } else {
270
+ nextKey = delegate.getLastKey?.();
271
+ }
272
+ if (nextKey == null && shouldFocusWrap) {
273
+ nextKey = delegate.getLastKey?.(focusedKey);
274
+ }
275
+ navigateToKey(nextKey);
276
+ }
277
+ break;
278
+ }
279
+ case (orientation() === "vertical" ? "ArrowLeft" : "ArrowUp"): {
280
+ if (delegate.getKeyLeftOf) {
281
+ e.preventDefault();
282
+ const isRTL = direction() === "rtl";
283
+ let nextKey;
284
+ if (focusedKey != null) {
285
+ nextKey = delegate.getKeyLeftOf(focusedKey);
286
+ } else {
287
+ nextKey = isRTL ? delegate.getFirstKey?.() : delegate.getLastKey?.();
288
+ }
289
+ navigateToKey(nextKey);
290
+ }
291
+ break;
292
+ }
293
+ case (orientation() === "vertical" ? "ArrowRight" : "ArrowDown"): {
294
+ if (delegate.getKeyRightOf) {
295
+ e.preventDefault();
296
+ const isRTL = direction() === "rtl";
297
+ let nextKey;
298
+ if (focusedKey != null) {
299
+ nextKey = delegate.getKeyRightOf(focusedKey);
300
+ } else {
301
+ nextKey = isRTL ? delegate.getLastKey?.() : delegate.getFirstKey?.();
302
+ }
303
+ navigateToKey(nextKey);
304
+ }
305
+ break;
306
+ }
307
+ case "Home":
308
+ if (delegate.getFirstKey) {
309
+ e.preventDefault();
310
+ const firstKey = delegate.getFirstKey(
311
+ focusedKey,
312
+ isCtrlKeyPressed(e)
313
+ );
314
+ if (firstKey != null) {
315
+ manager.setFocusedKey(firstKey);
316
+ if (isCtrlKeyPressed(e) && e.shiftKey && manager.selectionMode() === "multiple") {
317
+ manager.extendSelection(firstKey);
318
+ } else if (selectOnFocus) {
319
+ manager.replaceSelection(firstKey);
320
+ }
321
+ }
322
+ }
323
+ break;
324
+ case "End":
325
+ if (delegate.getLastKey) {
326
+ e.preventDefault();
327
+ const lastKey = delegate.getLastKey(focusedKey, isCtrlKeyPressed(e));
328
+ if (lastKey != null) {
329
+ manager.setFocusedKey(lastKey);
330
+ if (isCtrlKeyPressed(e) && e.shiftKey && manager.selectionMode() === "multiple") {
331
+ manager.extendSelection(lastKey);
332
+ } else if (selectOnFocus) {
333
+ manager.replaceSelection(lastKey);
334
+ }
335
+ }
336
+ }
337
+ break;
338
+ case "PageDown":
339
+ if (delegate.getKeyPageBelow && focusedKey != null) {
340
+ e.preventDefault();
341
+ const nextKey = delegate.getKeyPageBelow(focusedKey);
342
+ navigateToKey(nextKey);
343
+ }
344
+ break;
345
+ case "PageUp":
346
+ if (delegate.getKeyPageAbove && focusedKey != null) {
347
+ e.preventDefault();
348
+ const nextKey = delegate.getKeyPageAbove(focusedKey);
349
+ navigateToKey(nextKey);
350
+ }
351
+ break;
352
+ case "a":
353
+ if (isCtrlKeyPressed(e) && manager.selectionMode() === "multiple" && access3(mergedProps.disallowSelectAll) !== true) {
354
+ e.preventDefault();
355
+ manager.selectAll();
356
+ }
357
+ break;
358
+ case "Escape":
359
+ if (!e.defaultPrevented && !access3(mergedProps.disallowEmptySelection)) {
360
+ e.preventDefault();
361
+ manager.clearSelection();
362
+ }
363
+ break;
364
+ case "Tab": {
365
+ if (!access3(mergedProps.allowsTabNavigation)) {
366
+ if (e.shiftKey) {
367
+ refEl.focus();
368
+ } else {
369
+ const walker = getFocusableTreeWalker(refEl, { tabbable: true });
370
+ let next;
371
+ let last;
372
+ do {
373
+ last = walker.lastChild();
374
+ if (last) {
375
+ next = last;
376
+ }
377
+ } while (last);
378
+ if (next && !next.contains(document.activeElement)) {
379
+ focusWithoutScrolling(next);
380
+ }
381
+ }
382
+ break;
383
+ }
384
+ }
385
+ }
386
+ };
387
+ const onFocusIn = (e) => {
388
+ const manager = access3(mergedProps.selectionManager);
389
+ const delegate = access3(mergedProps.keyboardDelegate);
390
+ const selectOnFocus = access3(mergedProps.selectOnFocus);
391
+ if (manager.isFocused()) {
392
+ if (!e.currentTarget.contains(e.target)) {
393
+ manager.setFocused(false);
394
+ }
395
+ return;
396
+ }
397
+ if (!e.currentTarget.contains(e.target)) {
398
+ return;
399
+ }
400
+ manager.setFocused(true);
401
+ if (manager.focusedKey() == null) {
402
+ const navigateToFirstKey = (key) => {
403
+ if (key == null) {
404
+ return;
405
+ }
406
+ manager.setFocusedKey(key);
407
+ if (selectOnFocus) {
408
+ manager.replaceSelection(key);
409
+ }
410
+ };
411
+ const relatedTarget = e.relatedTarget;
412
+ if (relatedTarget && e.currentTarget.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING) {
413
+ navigateToFirstKey(
414
+ manager.lastSelectedKey() ?? delegate.getLastKey?.()
415
+ );
416
+ } else {
417
+ navigateToFirstKey(
418
+ manager.firstSelectedKey() ?? delegate.getFirstKey?.()
419
+ );
420
+ }
421
+ } else if (!access3(mergedProps.isVirtualized)) {
422
+ const scrollEl = finalScrollRef();
423
+ if (scrollEl) {
424
+ scrollEl.scrollTop = scrollPos.top;
425
+ scrollEl.scrollLeft = scrollPos.left;
426
+ const element = scrollEl.querySelector(
427
+ `[data-key="${manager.focusedKey()}"]`
428
+ );
429
+ if (element) {
430
+ focusWithoutScrolling(element);
431
+ scrollIntoView(scrollEl, element);
432
+ }
433
+ }
434
+ }
435
+ };
436
+ const onFocusOut = (e) => {
437
+ const manager = access3(mergedProps.selectionManager);
438
+ if (!e.currentTarget.contains(e.relatedTarget)) {
439
+ manager.setFocused(false);
440
+ }
441
+ };
442
+ const onMouseDown = (e) => {
443
+ if (finalScrollRef() === e.target) {
444
+ e.preventDefault();
445
+ }
446
+ };
447
+ const tryAutoFocus = () => {
448
+ const autoFocus = access3(mergedProps.autoFocus);
449
+ if (!autoFocus) {
450
+ return;
451
+ }
452
+ const manager = access3(mergedProps.selectionManager);
453
+ const container = ref();
454
+ if (manager.isFocused() && manager.focusedKey() != null && container?.contains(container.ownerDocument.activeElement)) return;
455
+ const delegate = access3(mergedProps.keyboardDelegate);
456
+ let focusedKey;
457
+ if (autoFocus === "first") {
458
+ focusedKey = delegate.getFirstKey?.();
459
+ }
460
+ if (autoFocus === "last") {
461
+ focusedKey = delegate.getLastKey?.();
462
+ }
463
+ const selectedKeys = manager.selectedKeys();
464
+ if (selectedKeys.size) {
465
+ focusedKey = selectedKeys.values().next().value;
466
+ }
467
+ manager.setFocused(true);
468
+ manager.setFocusedKey(focusedKey);
469
+ const refEl = ref();
470
+ if (refEl && focusedKey == null && !access3(mergedProps.shouldUseVirtualFocus)) {
471
+ focusWithoutScrolling(refEl);
472
+ }
473
+ };
474
+ onMount(() => {
475
+ if (mergedProps.deferAutoFocus) {
476
+ setTimeout(tryAutoFocus, 0);
477
+ } else {
478
+ tryAutoFocus();
479
+ }
480
+ });
481
+ createEffect2(
482
+ on(
483
+ [
484
+ finalScrollRef,
485
+ () => access3(mergedProps.isVirtualized),
486
+ () => access3(mergedProps.selectionManager).focusedKey()
487
+ ],
488
+ (newValue) => {
489
+ const [scrollEl, isVirtualized, focusedKey] = newValue;
490
+ if (isVirtualized) {
491
+ focusedKey && mergedProps.scrollToKey?.(focusedKey);
492
+ } else {
493
+ if (focusedKey && scrollEl) {
494
+ const element = scrollEl.querySelector(
495
+ `[data-key="${focusedKey}"]`
496
+ );
497
+ if (element) {
498
+ scrollIntoView(scrollEl, element);
499
+ }
500
+ }
501
+ }
502
+ }
503
+ )
504
+ );
505
+ const tabIndex = createMemo2(() => {
506
+ if (access3(mergedProps.shouldUseVirtualFocus)) {
507
+ return void 0;
508
+ }
509
+ return access3(mergedProps.selectionManager).focusedKey() == null ? 0 : -1;
510
+ });
511
+ return {
512
+ tabIndex,
513
+ onKeyDown,
514
+ onMouseDown,
515
+ onFocusIn,
516
+ onFocusOut
517
+ };
518
+ }
519
+
520
+ // src/selection/create-selectable-item.ts
521
+ import {
522
+ access as access4,
523
+ focusWithoutScrolling as focusWithoutScrolling2
524
+ } from "#sheen-kobalte-utils";
525
+ import {
526
+ createEffect as createEffect3,
527
+ createMemo as createMemo3,
528
+ on as on2
529
+ } from "solid-js";
530
+ function createSelectableItem(props, ref) {
531
+ const manager = () => access4(props.selectionManager);
532
+ const key = () => access4(props.key);
533
+ const shouldUseVirtualFocus = () => access4(props.shouldUseVirtualFocus);
534
+ const onSelect = (e) => {
535
+ if (manager().selectionMode() === "none") {
536
+ return;
537
+ }
538
+ if (manager().selectionMode() === "single") {
539
+ if (manager().isSelected(key()) && !manager().disallowEmptySelection()) {
540
+ manager().toggleSelection(key());
541
+ } else {
542
+ manager().replaceSelection(key());
543
+ }
544
+ } else if (e?.shiftKey) {
545
+ manager().extendSelection(key());
546
+ } else if (manager().selectionBehavior() === "toggle" || isCtrlKeyPressed(e) || "pointerType" in e && e.pointerType === "touch") {
547
+ manager().toggleSelection(key());
548
+ } else {
549
+ manager().replaceSelection(key());
550
+ }
551
+ };
552
+ const isSelected = () => manager().isSelected(key());
553
+ const isDisabled = () => access4(props.disabled) || manager().isDisabled(key());
554
+ const allowsSelection = () => !isDisabled() && manager().canSelectItem(key());
555
+ let pointerDownType = null;
556
+ const onPointerDown = (e) => {
557
+ if (!allowsSelection()) {
558
+ return;
559
+ }
560
+ pointerDownType = e.pointerType;
561
+ if (e.pointerType === "mouse" && e.button === 0 && !access4(props.shouldSelectOnPressUp)) {
562
+ onSelect(e);
563
+ }
564
+ };
565
+ const onPointerUp = (e) => {
566
+ if (!allowsSelection()) {
567
+ return;
568
+ }
569
+ if (e.pointerType === "mouse" && e.button === 0 && access4(props.shouldSelectOnPressUp) && access4(props.allowsDifferentPressOrigin)) {
570
+ onSelect(e);
571
+ }
572
+ };
573
+ const onClick = (e) => {
574
+ if (!allowsSelection()) {
575
+ return;
576
+ }
577
+ if (access4(props.shouldSelectOnPressUp) && !access4(props.allowsDifferentPressOrigin) || pointerDownType !== "mouse") {
578
+ onSelect(e);
579
+ }
580
+ };
581
+ const onKeyDown = (e) => {
582
+ if (!allowsSelection() || !["Enter", " "].includes(e.key)) {
583
+ return;
584
+ }
585
+ if (isNonContiguousSelectionModifier(e)) {
586
+ manager().toggleSelection(key());
587
+ } else {
588
+ onSelect(e);
589
+ }
590
+ };
591
+ const onMouseDown = (e) => {
592
+ if (isDisabled()) {
593
+ e.preventDefault();
594
+ }
595
+ };
596
+ const onFocus = (e) => {
597
+ const refEl = ref();
598
+ if (shouldUseVirtualFocus() || isDisabled() || !refEl) {
599
+ return;
600
+ }
601
+ if (e.target === refEl) {
602
+ manager().setFocusedKey(key());
603
+ }
604
+ };
605
+ const tabIndex = createMemo3(() => {
606
+ if (shouldUseVirtualFocus() || isDisabled()) {
607
+ return void 0;
608
+ }
609
+ return key() === manager().focusedKey() ? 0 : -1;
610
+ });
611
+ const dataKey = createMemo3(() => {
612
+ return access4(props.virtualized) ? void 0 : key();
613
+ });
614
+ createEffect3(
615
+ on2(
616
+ [
617
+ ref,
618
+ key,
619
+ shouldUseVirtualFocus,
620
+ () => manager().focusedKey(),
621
+ () => manager().isFocused()
622
+ ],
623
+ ([refEl, key2, shouldUseVirtualFocus2, focusedKey, isFocused]) => {
624
+ if (refEl && key2 === focusedKey && isFocused && !shouldUseVirtualFocus2 && document.activeElement !== refEl) {
625
+ if (props.focus) {
626
+ props.focus();
627
+ } else {
628
+ focusWithoutScrolling2(refEl);
629
+ }
630
+ }
631
+ }
632
+ )
633
+ );
634
+ return {
635
+ isSelected,
636
+ isDisabled,
637
+ allowsSelection,
638
+ tabIndex,
639
+ dataKey,
640
+ onPointerDown,
641
+ onPointerUp,
642
+ onClick,
643
+ onKeyDown,
644
+ onMouseDown,
645
+ onFocus
646
+ };
647
+ }
648
+
649
+ // src/selection/selection-manager.ts
650
+ var SelectionManager = class {
651
+ collection;
652
+ state;
653
+ constructor(collection, state) {
654
+ this.collection = collection;
655
+ this.state = state;
656
+ }
657
+ /** The type of selection that is allowed in the collection. */
658
+ selectionMode() {
659
+ return this.state.selectionMode();
660
+ }
661
+ /** Whether the collection allows empty selection. */
662
+ disallowEmptySelection() {
663
+ return this.state.disallowEmptySelection();
664
+ }
665
+ /** The selection behavior for the collection. */
666
+ selectionBehavior() {
667
+ return this.state.selectionBehavior();
668
+ }
669
+ /** Sets the selection behavior for the collection. */
670
+ setSelectionBehavior(selectionBehavior) {
671
+ this.state.setSelectionBehavior(selectionBehavior);
672
+ }
673
+ /** Whether the collection is currently focused. */
674
+ isFocused() {
675
+ return this.state.isFocused();
676
+ }
677
+ /** Sets whether the collection is focused. */
678
+ setFocused(isFocused) {
679
+ this.state.setFocused(isFocused);
680
+ }
681
+ /** The current focused key in the collection. */
682
+ focusedKey() {
683
+ return this.state.focusedKey();
684
+ }
685
+ /** Sets the focused key. */
686
+ setFocusedKey(key) {
687
+ if (key == null || this.collection().getItem(key)) {
688
+ this.state.setFocusedKey(key);
689
+ }
690
+ }
691
+ /** The currently selected keys in the collection. */
692
+ selectedKeys() {
693
+ return this.state.selectedKeys();
694
+ }
695
+ /** Returns whether a key is selected. */
696
+ isSelected(key) {
697
+ if (this.state.selectionMode() === "none") {
698
+ return false;
699
+ }
700
+ const retrievedKey = this.getKey(key);
701
+ if (retrievedKey == null) {
702
+ return false;
703
+ }
704
+ return this.state.selectedKeys().has(retrievedKey);
705
+ }
706
+ /** Whether the selection is empty. */
707
+ isEmpty() {
708
+ return this.state.selectedKeys().size === 0;
709
+ }
710
+ /** Whether all items in the collection are selected. */
711
+ isSelectAll() {
712
+ if (this.isEmpty()) {
713
+ return false;
714
+ }
715
+ const selectedKeys = this.state.selectedKeys();
716
+ return this.getAllSelectableKeys().every((k) => selectedKeys.has(k));
717
+ }
718
+ firstSelectedKey() {
719
+ let first;
720
+ for (const key of this.state.selectedKeys()) {
721
+ const item = this.collection().getItem(key);
722
+ const isItemBeforeFirst = item?.index != null && first?.index != null && item.index < first.index;
723
+ if (!first || isItemBeforeFirst) {
724
+ first = item;
725
+ }
726
+ }
727
+ return first?.key;
728
+ }
729
+ lastSelectedKey() {
730
+ let last;
731
+ for (const key of this.state.selectedKeys()) {
732
+ const item = this.collection().getItem(key);
733
+ const isItemAfterLast = item?.index != null && last?.index != null && item.index > last.index;
734
+ if (!last || isItemAfterLast) {
735
+ last = item;
736
+ }
737
+ }
738
+ return last?.key;
739
+ }
740
+ /** Extends the selection to the given key. */
741
+ extendSelection(toKey) {
742
+ if (this.selectionMode() === "none") {
743
+ return;
744
+ }
745
+ if (this.selectionMode() === "single") {
746
+ this.replaceSelection(toKey);
747
+ return;
748
+ }
749
+ const retrievedToKey = this.getKey(toKey);
750
+ if (retrievedToKey == null) {
751
+ return;
752
+ }
753
+ const selectedKeys = this.state.selectedKeys();
754
+ const anchorKey = selectedKeys.anchorKey || retrievedToKey;
755
+ const selection = new Selection(selectedKeys, anchorKey, retrievedToKey);
756
+ for (const key of this.getKeyRange(
757
+ anchorKey,
758
+ selectedKeys.currentKey || retrievedToKey
759
+ )) {
760
+ selection.delete(key);
761
+ }
762
+ for (const key of this.getKeyRange(retrievedToKey, anchorKey)) {
763
+ if (this.canSelectItem(key)) {
764
+ selection.add(key);
765
+ }
766
+ }
767
+ this.state.setSelectedKeys(selection);
768
+ }
769
+ getKeyRange(from, to) {
770
+ const fromItem = this.collection().getItem(from);
771
+ const toItem = this.collection().getItem(to);
772
+ if (fromItem && toItem) {
773
+ if (fromItem.index != null && toItem.index != null && fromItem.index <= toItem.index) {
774
+ return this.getKeyRangeInternal(from, to);
775
+ }
776
+ return this.getKeyRangeInternal(to, from);
777
+ }
778
+ return [];
779
+ }
780
+ getKeyRangeInternal(from, to) {
781
+ const keys = [];
782
+ let key = from;
783
+ while (key != null) {
784
+ const item = this.collection().getItem(key);
785
+ if (item && item.type === "item") {
786
+ keys.push(key);
787
+ }
788
+ if (key === to) {
789
+ return keys;
790
+ }
791
+ key = this.collection().getKeyAfter(key);
792
+ }
793
+ return [];
794
+ }
795
+ getKey(key) {
796
+ const item = this.collection().getItem(key);
797
+ if (!item) {
798
+ return key;
799
+ }
800
+ if (!item || item.type !== "item") {
801
+ return null;
802
+ }
803
+ return item.key;
804
+ }
805
+ /** Toggles whether the given key is selected. */
806
+ toggleSelection(key) {
807
+ if (this.selectionMode() === "none") {
808
+ return;
809
+ }
810
+ if (this.selectionMode() === "single" && !this.isSelected(key)) {
811
+ this.replaceSelection(key);
812
+ return;
813
+ }
814
+ const retrievedKey = this.getKey(key);
815
+ if (retrievedKey == null) {
816
+ return;
817
+ }
818
+ const keys = new Selection(this.state.selectedKeys());
819
+ if (keys.has(retrievedKey)) {
820
+ keys.delete(retrievedKey);
821
+ } else if (this.canSelectItem(retrievedKey)) {
822
+ keys.add(retrievedKey);
823
+ keys.anchorKey = retrievedKey;
824
+ keys.currentKey = retrievedKey;
825
+ }
826
+ if (this.disallowEmptySelection() && keys.size === 0) {
827
+ return;
828
+ }
829
+ this.state.setSelectedKeys(keys);
830
+ }
831
+ /** Replaces the selection with only the given key. */
832
+ replaceSelection(key) {
833
+ if (this.selectionMode() === "none") {
834
+ return;
835
+ }
836
+ const retrievedKey = this.getKey(key);
837
+ if (retrievedKey == null) {
838
+ return;
839
+ }
840
+ const selection = this.canSelectItem(retrievedKey) ? new Selection([retrievedKey], retrievedKey, retrievedKey) : new Selection();
841
+ this.state.setSelectedKeys(selection);
842
+ }
843
+ /** Replaces the selection with the given keys. */
844
+ setSelectedKeys(keys) {
845
+ if (this.selectionMode() === "none") {
846
+ return;
847
+ }
848
+ const selection = new Selection();
849
+ for (const key of keys) {
850
+ const retrievedKey = this.getKey(key);
851
+ if (retrievedKey != null) {
852
+ selection.add(retrievedKey);
853
+ if (this.selectionMode() === "single") {
854
+ break;
855
+ }
856
+ }
857
+ }
858
+ this.state.setSelectedKeys(selection);
859
+ }
860
+ /** Selects all items in the collection. */
861
+ selectAll() {
862
+ if (this.selectionMode() === "multiple") {
863
+ this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()));
864
+ }
865
+ }
866
+ /**
867
+ * Removes all keys from the selection.
868
+ */
869
+ clearSelection() {
870
+ const selectedKeys = this.state.selectedKeys();
871
+ if (!this.disallowEmptySelection() && selectedKeys.size > 0) {
872
+ this.state.setSelectedKeys(new Selection());
873
+ }
874
+ }
875
+ /**
876
+ * Toggles between select all and an empty selection.
877
+ */
878
+ toggleSelectAll() {
879
+ if (this.isSelectAll()) {
880
+ this.clearSelection();
881
+ } else {
882
+ this.selectAll();
883
+ }
884
+ }
885
+ select(key, e) {
886
+ if (this.selectionMode() === "none") {
887
+ return;
888
+ }
889
+ if (this.selectionMode() === "single") {
890
+ if (this.isSelected(key) && !this.disallowEmptySelection()) {
891
+ this.toggleSelection(key);
892
+ } else {
893
+ this.replaceSelection(key);
894
+ }
895
+ } else if (this.selectionBehavior() === "toggle" || e && e.pointerType === "touch") {
896
+ this.toggleSelection(key);
897
+ } else {
898
+ this.replaceSelection(key);
899
+ }
900
+ }
901
+ /** Returns whether the current selection is equal to the given selection. */
902
+ isSelectionEqual(selection) {
903
+ if (selection === this.state.selectedKeys()) {
904
+ return true;
905
+ }
906
+ const selectedKeys = this.selectedKeys();
907
+ if (selection.size !== selectedKeys.size) {
908
+ return false;
909
+ }
910
+ for (const key of selection) {
911
+ if (!selectedKeys.has(key)) {
912
+ return false;
913
+ }
914
+ }
915
+ for (const key of selectedKeys) {
916
+ if (!selection.has(key)) {
917
+ return false;
918
+ }
919
+ }
920
+ return true;
921
+ }
922
+ canSelectItem(key) {
923
+ if (this.state.selectionMode() === "none") {
924
+ return false;
925
+ }
926
+ const item = this.collection().getItem(key);
927
+ return item != null && !item.disabled;
928
+ }
929
+ isDisabled(key) {
930
+ const item = this.collection().getItem(key);
931
+ return !item || item.disabled;
932
+ }
933
+ getAllSelectableKeys() {
934
+ const keys = [];
935
+ const addKeys = (key) => {
936
+ while (key != null) {
937
+ if (this.canSelectItem(key)) {
938
+ const item = this.collection().getItem(key);
939
+ if (!item) {
940
+ continue;
941
+ }
942
+ if (item.type === "item") {
943
+ keys.push(key);
944
+ }
945
+ }
946
+ key = this.collection().getKeyAfter(key);
947
+ }
948
+ };
949
+ addKeys(this.collection().getFirstKey());
950
+ return keys;
951
+ }
952
+ };
953
+
954
+ // src/list/list-collection.ts
955
+ var ListCollection = class {
956
+ keyMap = /* @__PURE__ */ new Map();
957
+ iterable;
958
+ firstKey;
959
+ lastKey;
960
+ constructor(nodes) {
961
+ this.iterable = nodes;
962
+ for (const node of nodes) {
963
+ this.keyMap.set(node.key, node);
964
+ }
965
+ if (this.keyMap.size === 0) {
966
+ return;
967
+ }
968
+ let last;
969
+ let index = 0;
970
+ for (const [key, node] of this.keyMap) {
971
+ if (last) {
972
+ last.nextKey = key;
973
+ node.prevKey = last.key;
974
+ } else {
975
+ this.firstKey = key;
976
+ node.prevKey = void 0;
977
+ }
978
+ if (node.type === "item") {
979
+ node.index = index++;
980
+ }
981
+ last = node;
982
+ last.nextKey = void 0;
983
+ }
984
+ this.lastKey = last.key;
985
+ }
986
+ *[Symbol.iterator]() {
987
+ yield* this.iterable;
988
+ }
989
+ getSize() {
990
+ return this.keyMap.size;
991
+ }
992
+ getKeys() {
993
+ return this.keyMap.keys();
994
+ }
995
+ getKeyBefore(key) {
996
+ return this.keyMap.get(key)?.prevKey;
997
+ }
998
+ getKeyAfter(key) {
999
+ return this.keyMap.get(key)?.nextKey;
1000
+ }
1001
+ getFirstKey() {
1002
+ return this.firstKey;
1003
+ }
1004
+ getLastKey() {
1005
+ return this.lastKey;
1006
+ }
1007
+ getItem(key) {
1008
+ return this.keyMap.get(key);
1009
+ }
1010
+ at(idx) {
1011
+ const keys = [...this.getKeys()];
1012
+ return this.getItem(keys[idx]);
1013
+ }
1014
+ };
1015
+
1016
+ // src/list/create-list-state.ts
1017
+ import { access as access5 } from "#sheen-kobalte-utils";
1018
+ import { createComputed } from "solid-js";
1019
+ function createListState(props) {
1020
+ const selectionState = createMultipleSelectionState(props);
1021
+ const factory = (nodes) => {
1022
+ return props.filter ? new ListCollection(props.filter(nodes)) : new ListCollection(nodes);
1023
+ };
1024
+ const collection = createCollection(
1025
+ {
1026
+ dataSource: () => access5(props.dataSource),
1027
+ getKey: () => access5(props.getKey),
1028
+ getTextValue: () => access5(props.getTextValue),
1029
+ getDisabled: () => access5(props.getDisabled),
1030
+ getSectionChildren: () => access5(props.getSectionChildren),
1031
+ factory
1032
+ },
1033
+ [() => props.filter]
1034
+ );
1035
+ const selectionManager = new SelectionManager(collection, selectionState);
1036
+ createComputed(() => {
1037
+ const focusedKey = selectionState.focusedKey();
1038
+ if (focusedKey != null && !collection().getItem(focusedKey)) {
1039
+ selectionState.setFocusedKey(void 0);
1040
+ }
1041
+ });
1042
+ return {
1043
+ collection,
1044
+ selectionManager: () => selectionManager
1045
+ };
1046
+ }
1047
+
1048
+ export {
1049
+ Selection,
1050
+ isSameSelection,
1051
+ createMultipleSelectionState,
1052
+ createTypeSelect,
1053
+ createSelectableCollection,
1054
+ createSelectableItem,
1055
+ SelectionManager,
1056
+ ListCollection,
1057
+ createListState
1058
+ };