@qw-ui/core 0.3.0-next.4 → 0.3.0-next.42

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 (415) hide show
  1. package/README.md +21 -37
  2. package/dist/action-sheet/action-sheet.d.ts +110 -0
  3. package/dist/action-sheet/index.d.ts +2 -0
  4. package/dist/action-sheet/index.js +2 -0
  5. package/dist/action-sheet-Cvcr1S_m.js +183 -0
  6. package/dist/action-sheet-Cvcr1S_m.js.map +1 -0
  7. package/dist/area-picker/area-picker.d.ts +113 -0
  8. package/dist/area-picker/index.d.ts +1 -0
  9. package/dist/area-picker/index.js +348 -0
  10. package/dist/area-picker/index.js.map +1 -0
  11. package/dist/aria-description-CimD2M_C.js +13 -0
  12. package/dist/aria-description-CimD2M_C.js.map +1 -0
  13. package/dist/aria-description.d.ts +2 -0
  14. package/dist/avatar/avatar-load.d.ts +76 -0
  15. package/dist/avatar/avatar.d.ts +22 -5
  16. package/dist/avatar/index.d.ts +1 -0
  17. package/dist/avatar/index.js +57 -18
  18. package/dist/avatar/index.js.map +1 -1
  19. package/dist/avatar-load-w9dq05oV.js +139 -0
  20. package/dist/avatar-load-w9dq05oV.js.map +1 -0
  21. package/dist/back-top/back-top.d.ts +77 -0
  22. package/dist/back-top/index.d.ts +1 -0
  23. package/dist/back-top/index.js +189 -0
  24. package/dist/back-top/index.js.map +1 -0
  25. package/dist/badge/badge.d.ts +85 -0
  26. package/dist/badge/index.d.ts +1 -0
  27. package/dist/badge/index.js +88 -0
  28. package/dist/badge/index.js.map +1 -0
  29. package/dist/button/button.d.ts +13 -0
  30. package/dist/button/index.js +3 -5
  31. package/dist/button/index.js.map +1 -1
  32. package/dist/calendar/calendar.d.ts +100 -0
  33. package/dist/calendar/index.d.ts +1 -0
  34. package/dist/calendar/index.js +2 -0
  35. package/dist/calendar-CmpK3stz.js +363 -0
  36. package/dist/calendar-CmpK3stz.js.map +1 -0
  37. package/dist/card/card.d.ts +68 -0
  38. package/dist/card/index.d.ts +2 -0
  39. package/dist/card/index.js +2 -0
  40. package/dist/card-DRtWa6Cr.js +107 -0
  41. package/dist/card-DRtWa6Cr.js.map +1 -0
  42. package/dist/cascader/cascader.d.ts +115 -0
  43. package/dist/cascader/index.d.ts +1 -0
  44. package/dist/cascader/index.js +2 -0
  45. package/dist/cascader-D-xMjs7P.js +333 -0
  46. package/dist/cascader-D-xMjs7P.js.map +1 -0
  47. package/dist/cell/cell.d.ts +41 -0
  48. package/dist/cell/index.d.ts +1 -0
  49. package/dist/cell/index.js +43 -0
  50. package/dist/cell/index.js.map +1 -0
  51. package/dist/check-list/check-list.d.ts +78 -0
  52. package/dist/check-list/index.d.ts +2 -0
  53. package/dist/check-list/index.js +2 -0
  54. package/dist/check-list-BvZHQt5w.js +60 -0
  55. package/dist/check-list-BvZHQt5w.js.map +1 -0
  56. package/dist/checkbox/checkbox.d.ts +59 -0
  57. package/dist/checkbox/index.d.ts +2 -0
  58. package/dist/checkbox/index.js +2 -0
  59. package/dist/checkbox-BlndJrz5.js +127 -0
  60. package/dist/checkbox-BlndJrz5.js.map +1 -0
  61. package/dist/checkbox-group/checkbox-group.d.ts +86 -0
  62. package/dist/checkbox-group/index.d.ts +3 -0
  63. package/dist/checkbox-group/index.js +2 -0
  64. package/dist/checkbox-group-gGfsTv-e.js +223 -0
  65. package/dist/checkbox-group-gGfsTv-e.js.map +1 -0
  66. package/dist/choice-group-C4c9m0qe.js +373 -0
  67. package/dist/choice-group-C4c9m0qe.js.map +1 -0
  68. package/dist/circle/circle.d.ts +97 -0
  69. package/dist/circle/index.d.ts +1 -0
  70. package/dist/circle/index.js +119 -0
  71. package/dist/circle/index.js.map +1 -0
  72. package/dist/collapse/collapse.d.ts +98 -0
  73. package/dist/collapse/index.d.ts +2 -0
  74. package/dist/collapse/index.js +2 -0
  75. package/dist/collapse-B969h7-H.js +226 -0
  76. package/dist/collapse-B969h7-H.js.map +1 -0
  77. package/dist/countdown/countdown.d.ts +114 -0
  78. package/dist/countdown/index.d.ts +1 -0
  79. package/dist/countdown/index.js +309 -0
  80. package/dist/countdown/index.js.map +1 -0
  81. package/dist/date-picker/date-picker.d.ts +168 -0
  82. package/dist/date-picker/index.d.ts +1 -0
  83. package/dist/date-picker/index.js +401 -0
  84. package/dist/date-picker/index.js.map +1 -0
  85. package/dist/descriptions/descriptions.d.ts +69 -0
  86. package/dist/descriptions/index.d.ts +1 -0
  87. package/dist/descriptions/index.js +86 -0
  88. package/dist/descriptions/index.js.map +1 -0
  89. package/dist/dialog/dialog.d.ts +61 -43
  90. package/dist/dialog/index.js +73 -19
  91. package/dist/dialog/index.js.map +1 -1
  92. package/dist/divider/divider.d.ts +18 -2
  93. package/dist/divider/index.js +20 -2
  94. package/dist/divider/index.js.map +1 -1
  95. package/dist/dropdown/dropdown.d.ts +172 -0
  96. package/dist/dropdown/index.d.ts +2 -0
  97. package/dist/dropdown/index.js +467 -0
  98. package/dist/dropdown/index.js.map +1 -0
  99. package/dist/ellipsis/ellipsis-layout.d.ts +34 -0
  100. package/dist/ellipsis/ellipsis.d.ts +88 -0
  101. package/dist/ellipsis/index.d.ts +2 -0
  102. package/dist/ellipsis/index.js +320 -0
  103. package/dist/ellipsis/index.js.map +1 -0
  104. package/dist/empty/empty-illustration.d.ts +3 -0
  105. package/dist/empty/empty.d.ts +43 -1
  106. package/dist/empty/index.js +2 -21
  107. package/dist/empty-CAgyvhUI.js +166 -0
  108. package/dist/empty-CAgyvhUI.js.map +1 -0
  109. package/dist/field/field.d.ts +95 -0
  110. package/dist/field/index.d.ts +2 -0
  111. package/dist/field/index.js +2 -0
  112. package/dist/field-DMHGIMZF.js +241 -0
  113. package/dist/field-DMHGIMZF.js.map +1 -0
  114. package/dist/floating-bubble/floating-bubble.d.ts +116 -0
  115. package/dist/floating-bubble/index.d.ts +1 -0
  116. package/dist/floating-bubble/index.js +333 -0
  117. package/dist/floating-bubble/index.js.map +1 -0
  118. package/dist/floating-panel/floating-panel.d.ts +80 -0
  119. package/dist/floating-panel/index.d.ts +2 -0
  120. package/dist/floating-panel/index.js +2 -0
  121. package/dist/floating-panel-Cbm5njBJ.js +363 -0
  122. package/dist/floating-panel-Cbm5njBJ.js.map +1 -0
  123. package/dist/footer/footer.d.ts +94 -0
  124. package/dist/footer/index.d.ts +1 -0
  125. package/dist/footer/index.js +154 -0
  126. package/dist/footer/index.js.map +1 -0
  127. package/dist/form/connect.d.ts +6 -0
  128. package/dist/form/form.d.ts +100 -0
  129. package/dist/form/ids.d.ts +14 -0
  130. package/dist/form/index.d.ts +13 -0
  131. package/dist/form/index.js +3 -0
  132. package/dist/form/methods.d.ts +5 -0
  133. package/dist/form/model.d.ts +24 -0
  134. package/dist/form/native.d.ts +25 -0
  135. package/dist/form/rules.d.ts +40 -0
  136. package/dist/form/ssr.d.ts +7 -0
  137. package/dist/form/types.d.ts +150 -0
  138. package/dist/form-BAGkIEMY.js +1354 -0
  139. package/dist/form-BAGkIEMY.js.map +1 -0
  140. package/dist/format-BDUY0C_c.js +89 -0
  141. package/dist/format-BDUY0C_c.js.map +1 -0
  142. package/dist/gesture-_SRHIvBm.js +30 -0
  143. package/dist/gesture-_SRHIvBm.js.map +1 -0
  144. package/dist/grid/grid-item.d.ts +22 -0
  145. package/dist/grid/grid.d.ts +42 -0
  146. package/dist/grid/index.d.ts +2 -0
  147. package/dist/grid/index.js +73 -0
  148. package/dist/grid/index.js.map +1 -0
  149. package/dist/icon/icon.d.ts +37 -1
  150. package/dist/icon/identity.d.ts +3 -0
  151. package/dist/icon/index.js +2 -20
  152. package/dist/icon-Cgdbnk1u.js +77 -0
  153. package/dist/icon-Cgdbnk1u.js.map +1 -0
  154. package/dist/image/image-load.d.ts +24 -0
  155. package/dist/image/image.d.ts +45 -8
  156. package/dist/image/index.d.ts +1 -0
  157. package/dist/image/index.js +116 -14
  158. package/dist/image/index.js.map +1 -1
  159. package/dist/image-preview/image-preview.d.ts +124 -0
  160. package/dist/image-preview/index.d.ts +1 -0
  161. package/dist/image-preview/index.js +450 -0
  162. package/dist/image-preview/index.js.map +1 -0
  163. package/dist/index-bar/index-bar.d.ts +121 -0
  164. package/dist/index-bar/index.d.ts +1 -0
  165. package/dist/index-bar/index.js +386 -0
  166. package/dist/index-bar/index.js.map +1 -0
  167. package/dist/index.d.ts +115 -10
  168. package/dist/index.js +151 -11
  169. package/dist/index.js.map +1 -0
  170. package/dist/infinite-scroll/index.d.ts +1 -0
  171. package/dist/infinite-scroll/index.js +248 -0
  172. package/dist/infinite-scroll/index.js.map +1 -0
  173. package/dist/infinite-scroll/infinite-scroll.d.ts +95 -0
  174. package/dist/input/index.js +181 -22
  175. package/dist/input/index.js.map +1 -1
  176. package/dist/input/input.d.ts +44 -1
  177. package/dist/layer-IpFrl5--.js +414 -0
  178. package/dist/layer-IpFrl5--.js.map +1 -0
  179. package/dist/layout-BRSqi4AQ.js +43 -0
  180. package/dist/layout-BRSqi4AQ.js.map +1 -0
  181. package/dist/layout.d.ts +13 -0
  182. package/dist/list/index.d.ts +2 -0
  183. package/dist/list/index.js +2 -0
  184. package/dist/list/list.d.ts +30 -0
  185. package/dist/list-6-iz-Irh.js +28 -0
  186. package/dist/list-6-iz-Irh.js.map +1 -0
  187. package/dist/loading/index.js +45 -2
  188. package/dist/loading/index.js.map +1 -1
  189. package/dist/loading/loading.d.ts +45 -2
  190. package/dist/modal-dialog-machine-CF9_z3Dm.js +487 -0
  191. package/dist/modal-dialog-machine-CF9_z3Dm.js.map +1 -0
  192. package/dist/modal-dialog-machine.d.ts +21 -0
  193. package/dist/modal-dismissable-lifetime.d.ts +21 -0
  194. package/dist/modal-registry.d.ts +24 -0
  195. package/dist/modal-render-hydration.d.ts +35 -0
  196. package/dist/modal-render-runtime.d.ts +19 -0
  197. package/dist/modal-render-scope.d.ts +63 -0
  198. package/dist/nav-bar/index.d.ts +1 -0
  199. package/dist/nav-bar/index.js +115 -0
  200. package/dist/nav-bar/index.js.map +1 -0
  201. package/dist/nav-bar/nav-bar.d.ts +76 -0
  202. package/dist/notice-bar/index.d.ts +2 -0
  203. package/dist/notice-bar/index.js +2 -0
  204. package/dist/notice-bar/notice-bar.d.ts +103 -0
  205. package/dist/notice-bar-DMpwLvRb.js +231 -0
  206. package/dist/notice-bar-DMpwLvRb.js.map +1 -0
  207. package/dist/notify/index.d.ts +1 -0
  208. package/dist/notify/index.js +251 -0
  209. package/dist/notify/index.js.map +1 -0
  210. package/dist/notify/notify.d.ts +123 -0
  211. package/dist/number-keyboard/index.d.ts +1 -0
  212. package/dist/number-keyboard/index.js +333 -0
  213. package/dist/number-keyboard/index.js.map +1 -0
  214. package/dist/number-keyboard/number-keyboard.d.ts +141 -0
  215. package/dist/overlay-panel/index.d.ts +2 -0
  216. package/dist/overlay-panel/index.js +2 -0
  217. package/dist/overlay-panel/overlay-panel.d.ts +20 -0
  218. package/dist/overlay-panel-Z_qdKeBj.js +26 -0
  219. package/dist/overlay-panel-Z_qdKeBj.js.map +1 -0
  220. package/dist/page-indicator/index.d.ts +1 -0
  221. package/dist/page-indicator/index.js +138 -0
  222. package/dist/page-indicator/index.js.map +1 -0
  223. package/dist/page-indicator/page-indicator.d.ts +93 -0
  224. package/dist/pagination/index.d.ts +1 -0
  225. package/dist/pagination/index.js +198 -0
  226. package/dist/pagination/index.js.map +1 -0
  227. package/dist/pagination/pagination.d.ts +125 -0
  228. package/dist/password-input/index.d.ts +1 -0
  229. package/dist/password-input/index.js +317 -0
  230. package/dist/password-input/index.js.map +1 -0
  231. package/dist/password-input/password-input.d.ts +144 -0
  232. package/dist/picker/index.d.ts +8 -0
  233. package/dist/picker/index.js +2 -0
  234. package/dist/picker/picker-machine.d.ts +80 -0
  235. package/dist/picker/picker.d.ts +121 -0
  236. package/dist/picker/platform.d.ts +84 -0
  237. package/dist/picker/selection-connect.d.ts +90 -0
  238. package/dist/picker/selection-model.d.ts +211 -0
  239. package/dist/picker-BykFntQN.js +1675 -0
  240. package/dist/picker-BykFntQN.js.map +1 -0
  241. package/dist/popover/index.d.ts +3 -0
  242. package/dist/popover/index.js +253 -0
  243. package/dist/popover/index.js.map +1 -0
  244. package/dist/popover/layer.d.ts +44 -0
  245. package/dist/popover/popover.d.ts +104 -0
  246. package/dist/popover/positioning.d.ts +132 -0
  247. package/dist/popup/index.d.ts +2 -0
  248. package/dist/popup/index.js +2 -0
  249. package/dist/popup/popup.d.ts +60 -0
  250. package/dist/popup-z5d8IYCt.js +576 -0
  251. package/dist/popup-z5d8IYCt.js.map +1 -0
  252. package/dist/portal-BHCNTWhg.js +78 -0
  253. package/dist/portal-BHCNTWhg.js.map +1 -0
  254. package/dist/portal.d.ts +61 -0
  255. package/dist/price/format.d.ts +19 -0
  256. package/dist/price/index.d.ts +1 -0
  257. package/dist/price/index.js +154 -0
  258. package/dist/price/index.js.map +1 -0
  259. package/dist/price/price.d.ts +88 -0
  260. package/dist/progress/index.d.ts +1 -0
  261. package/dist/progress/index.js +2 -0
  262. package/dist/progress/progress.d.ts +32 -0
  263. package/dist/progress-f3iYEfdA.js +37 -0
  264. package/dist/progress-f3iYEfdA.js.map +1 -0
  265. package/dist/pull-refresh/index.d.ts +1 -0
  266. package/dist/pull-refresh/index.js +414 -0
  267. package/dist/pull-refresh/index.js.map +1 -0
  268. package/dist/pull-refresh/pull-refresh.d.ts +118 -0
  269. package/dist/radio-group/index.d.ts +3 -0
  270. package/dist/radio-group/index.js +2 -0
  271. package/dist/radio-group/radio-group.d.ts +78 -0
  272. package/dist/radio-group-BOIMuqnS.js +230 -0
  273. package/dist/radio-group-BOIMuqnS.js.map +1 -0
  274. package/dist/rate/index.d.ts +1 -0
  275. package/dist/rate/index.js +2 -0
  276. package/dist/rate/rate-form.d.ts +28 -0
  277. package/dist/rate/rate.d.ts +144 -0
  278. package/dist/rate-5XsU2QkY.js +631 -0
  279. package/dist/rate-5XsU2QkY.js.map +1 -0
  280. package/dist/reorder/index.d.ts +1 -0
  281. package/dist/reorder/index.js +720 -0
  282. package/dist/reorder/index.js.map +1 -0
  283. package/dist/reorder/reorder.d.ts +190 -0
  284. package/dist/result/index.d.ts +1 -0
  285. package/dist/result/index.js +123 -0
  286. package/dist/result/index.js.map +1 -0
  287. package/dist/result/result.d.ts +88 -0
  288. package/dist/safe-area/index.d.ts +1 -0
  289. package/dist/safe-area/index.js +42 -0
  290. package/dist/safe-area/index.js.map +1 -0
  291. package/dist/safe-area/safe-area.d.ts +28 -0
  292. package/dist/search-bar/index.js +4 -2
  293. package/dist/search-bar/index.js.map +1 -1
  294. package/dist/search-bar/search-bar.d.ts +6 -0
  295. package/dist/segmented/index.d.ts +2 -0
  296. package/dist/segmented/index.js +2 -0
  297. package/dist/segmented/segmented.d.ts +127 -0
  298. package/dist/segmented-BaU38_L4.js +367 -0
  299. package/dist/segmented-BaU38_L4.js.map +1 -0
  300. package/dist/selection-form-BOM_odUk.js +88 -0
  301. package/dist/selection-form-BOM_odUk.js.map +1 -0
  302. package/dist/selection-form.d.ts +27 -0
  303. package/dist/selection-ivXqO1eu.js +55 -0
  304. package/dist/selection-ivXqO1eu.js.map +1 -0
  305. package/dist/selection.d.ts +29 -0
  306. package/dist/selector/choice-group.d.ts +114 -0
  307. package/dist/selector/index.d.ts +2 -0
  308. package/dist/selector/index.js +2 -0
  309. package/dist/selector/selector.d.ts +90 -0
  310. package/dist/selector-BU2MMJ4N.js +93 -0
  311. package/dist/selector-BU2MMJ4N.js.map +1 -0
  312. package/dist/share-sheet/index.d.ts +1 -0
  313. package/dist/share-sheet/index.js +138 -0
  314. package/dist/share-sheet/index.js.map +1 -0
  315. package/dist/share-sheet/share-sheet.d.ts +139 -0
  316. package/dist/side-nav/index.d.ts +1 -0
  317. package/dist/side-nav/index.js +99 -0
  318. package/dist/side-nav/index.js.map +1 -0
  319. package/dist/side-nav/side-nav.d.ts +94 -0
  320. package/dist/skeleton/index.js +51 -2
  321. package/dist/skeleton/index.js.map +1 -1
  322. package/dist/skeleton/skeleton.d.ts +34 -3
  323. package/dist/slider/index.d.ts +1 -0
  324. package/dist/slider/index.js +482 -0
  325. package/dist/slider/index.js.map +1 -0
  326. package/dist/slider/slider.d.ts +174 -0
  327. package/dist/space/index.d.ts +1 -0
  328. package/dist/space/index.js +52 -0
  329. package/dist/space/index.js.map +1 -0
  330. package/dist/space/space.d.ts +46 -0
  331. package/dist/statistic/index.d.ts +1 -0
  332. package/dist/statistic/index.js +152 -0
  333. package/dist/statistic/index.js.map +1 -0
  334. package/dist/statistic/statistic.d.ts +101 -0
  335. package/dist/stepper/index.d.ts +1 -0
  336. package/dist/stepper/index.js +172 -0
  337. package/dist/stepper/index.js.map +1 -0
  338. package/dist/stepper/stepper.d.ts +161 -0
  339. package/dist/steps/index.d.ts +1 -0
  340. package/dist/steps/index.js +72 -0
  341. package/dist/steps/index.js.map +1 -0
  342. package/dist/steps/steps.d.ts +67 -0
  343. package/dist/sticky/index.d.ts +1 -0
  344. package/dist/sticky/index.js +145 -0
  345. package/dist/sticky/index.js.map +1 -0
  346. package/dist/sticky/sticky.d.ts +70 -0
  347. package/dist/swipe-action/index.d.ts +1 -0
  348. package/dist/swipe-action/index.js +417 -0
  349. package/dist/swipe-action/index.js.map +1 -0
  350. package/dist/swipe-action/swipe-action.d.ts +148 -0
  351. package/dist/swiper/gesture.d.ts +32 -0
  352. package/dist/swiper/index.d.ts +1 -0
  353. package/dist/swiper/index.js +2 -0
  354. package/dist/swiper/swiper.d.ts +177 -0
  355. package/dist/swiper-BKivDkHp.js +550 -0
  356. package/dist/swiper-BKivDkHp.js.map +1 -0
  357. package/dist/switch/index.d.ts +1 -0
  358. package/dist/switch/index.js +168 -0
  359. package/dist/switch/index.js.map +1 -0
  360. package/dist/switch/switch.d.ts +142 -0
  361. package/dist/tabbar/index.d.ts +1 -0
  362. package/dist/tabbar/index.js +95 -0
  363. package/dist/tabbar/index.js.map +1 -0
  364. package/dist/tabbar/tabbar.d.ts +119 -0
  365. package/dist/tabs/index.js +22 -1
  366. package/dist/tabs/index.js.map +1 -1
  367. package/dist/tabs/tabs.d.ts +12 -8
  368. package/dist/tag/index.js +123 -2
  369. package/dist/tag/index.js.map +1 -1
  370. package/dist/tag/tag.d.ts +67 -1
  371. package/dist/textarea/index.d.ts +2 -0
  372. package/dist/textarea/index.js +2 -242
  373. package/dist/textarea/platform.d.ts +22 -0
  374. package/dist/textarea/textarea.d.ts +169 -46
  375. package/dist/textarea-qbnruDUG.js +775 -0
  376. package/dist/textarea-qbnruDUG.js.map +1 -0
  377. package/dist/time-picker/index.d.ts +1 -0
  378. package/dist/time-picker/index.js +228 -0
  379. package/dist/time-picker/index.js.map +1 -0
  380. package/dist/time-picker/time-picker.d.ts +83 -0
  381. package/dist/timeline/index.d.ts +1 -0
  382. package/dist/timeline/index.js +131 -0
  383. package/dist/timeline/index.js.map +1 -0
  384. package/dist/timeline/timeline.d.ts +79 -0
  385. package/dist/toast/index.js +47 -4
  386. package/dist/toast/index.js.map +1 -1
  387. package/dist/toast/toast.d.ts +26 -3
  388. package/dist/top-bar/index.js +16 -2
  389. package/dist/top-bar/index.js.map +1 -1
  390. package/dist/top-bar/top-bar.d.ts +13 -2
  391. package/dist/tree-select/index.d.ts +1 -0
  392. package/dist/tree-select/index.js +512 -0
  393. package/dist/tree-select/index.js.map +1 -0
  394. package/dist/tree-select/tree-select.d.ts +215 -0
  395. package/dist/typography/index.d.ts +1 -0
  396. package/dist/typography/index.js +82 -0
  397. package/dist/typography/index.js.map +1 -0
  398. package/dist/typography/typography.d.ts +54 -0
  399. package/dist/upload/index.d.ts +1 -0
  400. package/dist/upload/index.js +458 -0
  401. package/dist/upload/index.js.map +1 -0
  402. package/dist/upload/upload.d.ts +172 -0
  403. package/dist/virtual-list/index.d.ts +1 -0
  404. package/dist/virtual-list/index.js +445 -0
  405. package/dist/virtual-list/index.js.map +1 -0
  406. package/dist/virtual-list/virtual-list.d.ts +160 -0
  407. package/dist/visual-manifest.d.ts +27 -0
  408. package/dist/watermark/index.d.ts +1 -0
  409. package/dist/watermark/index.js +260 -0
  410. package/dist/watermark/index.js.map +1 -0
  411. package/dist/watermark/watermark.d.ts +106 -0
  412. package/package.json +417 -44
  413. package/dist/empty/index.js.map +0 -1
  414. package/dist/icon/index.js.map +0 -1
  415. package/dist/textarea/index.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/reorder/reorder.ts"],"sourcesContent":["import { createMachine, type Machine, type Service } from \"@zag-js/core\";\nimport { visuallyHiddenStyle } from \"@zag-js/dom-query\";\nimport type { NormalizeProps, PropTypes } from \"@zag-js/types\";\n\n/** Stable DOM parts shared by every adapter. */\nexport const REORDER_PARTS = [\"root\", \"list\", \"item\", \"content\", \"handle\", \"instructions\", \"status\"] as const;\n/** What started the active drag. */\nexport const REORDER_SOURCES = [\"pointer\", \"keyboard\"] as const;\nexport type ReorderSource = (typeof REORDER_SOURCES)[number];\n/** Pointer travel in CSS pixels before a press on a handle becomes a drag. */\nexport const REORDER_DEFAULT_THRESHOLD = 8;\n/** Band in CSS pixels at the block edges of the scroll container where a pointer drag auto-scrolls. */\nexport const REORDER_AUTO_SCROLL_EDGE = 48;\n/** Maximum auto-scroll step in CSS pixels per frame. */\nexport const REORDER_AUTO_SCROLL_SPEED = 16;\n/** Default texts. Templates replace {text}, {position} (1-based) and {count}. */\nexport const REORDER_DEFAULT_TEXTS = {\n label: \"排序列表\",\n handleLabel: \"拖动排序 {text}\",\n instructions: \"按空格键或回车键拿起,按上下方向键移动,再按空格键或回车键放下,按 Esc 键取消。\",\n pickedText: \"已拿起 {text},第 {position} 项,共 {count} 项\",\n movedText: \"{text} 移到第 {position} 项,共 {count} 项\",\n droppedText: \"已放下 {text},第 {position} 项,共 {count} 项\",\n rejectedText: \"{text} 未移动,仍为第 {position} 项,共 {count} 项\",\n cancelledText: \"已取消,{text} 回到第 {position} 项,共 {count} 项\",\n} as const;\nexport type ReorderTexts = { -readonly [K in keyof typeof REORDER_DEFAULT_TEXTS]: string };\n\n/** Field name, or a function returning a unique nonempty string / finite number. Omitted: string/number items are their own key, objects use `key`. */\nexport type ReorderItemKey<T = unknown> = string | ((item: T, index: number) => string | number);\n/** Field name, or a function returning the row text. Omitted: string/number items are their own text, objects use `text`; empty text falls back to the key. */\nexport type ReorderItemText<T = unknown> = string | ((item: T, index: number) => string);\n/** Field name, or a function; only `true` disables. Omitted: the `disabled` field. */\nexport type ReorderItemDisabled<T = unknown> = string | ((item: T, index: number) => boolean);\n/** Drop proposal: `key` moves from index `from` to index `to`; `value` is the complete proposed key order. */\nexport interface ReorderDetails { key: string; from: number; to: number; value: string[] }\n/** One row in the effective order. */\nexport interface ReorderEntry<T = unknown> { key: string; index: number; item: T; text: string; disabled: boolean }\n/** Active drag snapshot; offset and pitch are CSS pixels along the block axis, measured when the drag started. */\nexport interface ReorderDrag { key: string; text: string; from: number; to: number; count: number; offset: number; pitch: number; source: ReorderSource; signature: string }\n/** Measured block edges of an item, in viewport pixels. */\nexport interface ReorderRect { top: number; bottom: number }\n\nexport interface QwReorderProps<T = unknown> extends Partial<ReorderTexts> {\n /** Page-unique instance identity; adapters generate one when omitted. */\n id?: string;\n /** Caller-owned rows; never mutated. */\n items?: readonly T[];\n itemKey?: ReorderItemKey<T>;\n itemText?: ReorderItemText<T>;\n itemDisabled?: ReorderItemDisabled<T>;\n /** Controlled key order. The order only changes when the owner updates it; not updating rejects a proposal. */\n value?: readonly string[];\n /** Initial Core-owned key order. Keys missing from an order are appended in items order. */\n defaultValue?: readonly string[];\n /** Disable every handle; an active drag is cancelled. */\n disabled?: boolean;\n /** Pointer travel in CSS pixels before a drag starts; defaults to 8. */\n threshold?: number;\n /** A drop that changes the order. Uncontrolled lists commit it; controlled owners accept by updating `value`. */\n onReorder?: (details: ReorderDetails) => void;\n}\nexport interface ResolvedReorderState<T = unknown> {\n /** Items in caller order. */\n entries: ReorderEntry<T>[]; keys: string[]; disabled: boolean; threshold: number; texts: ReorderTexts;\n}\n\nconst text = (value: unknown, fallback: string): string => typeof value === \"string\" && value.trim() ? value : fallback;\nconst clamp = (value: number, min: number, max: number): number => Math.min(max, Math.max(min, value));\nconst finite = (value: unknown, fallback = 0): number => typeof value === \"number\" && Number.isFinite(value) ? value : fallback;\nconst field = (item: unknown, name: string): unknown => item !== null && typeof item === \"object\" ? (item as Record<string, unknown>)[name] : undefined;\nconst accessor = <F>(value: unknown): F | undefined => typeof value === \"function\" || (typeof value === \"string\" && value.trim()) ? value as F : undefined;\nconst primitive = (item: unknown): item is string | number => typeof item === \"string\" || typeof item === \"number\";\nconst TEXT_NAMES = Object.keys(REORDER_DEFAULT_TEXTS) as (keyof ReorderTexts)[];\n\nexport function resolveReorderKey<T>(item: T, index: number, itemKey?: ReorderItemKey<T>): string {\n const raw = typeof itemKey === \"function\" ? itemKey(item, index) : typeof itemKey === \"string\" ? field(item, itemKey) : primitive(item) ? item : field(item, \"key\");\n if (typeof raw === \"string\" && raw.length) return raw;\n if (typeof raw === \"number\" && Number.isFinite(raw)) return String(raw);\n throw new TypeError(`Reorder item ${index} requires a nonempty string or finite number key`);\n}\nexport function resolveReorderText<T>(item: T, index: number, itemText?: ReorderItemText<T>): string {\n const raw = typeof itemText === \"function\" ? itemText(item, index) : typeof itemText === \"string\" ? field(item, itemText) : primitive(item) ? item : field(item, \"text\");\n return typeof raw === \"string\" ? raw : typeof raw === \"number\" && Number.isFinite(raw) ? String(raw) : \"\";\n}\nexport function resolveReorderDisabled<T>(item: T, index: number, itemDisabled?: ReorderItemDisabled<T>): boolean {\n return (typeof itemDisabled === \"function\" ? itemDisabled(item, index) : field(item, typeof itemDisabled === \"string\" ? itemDisabled : \"disabled\")) === true;\n}\n/** Missing or duplicate keys throw: a silent fallback would break row identity. */\nexport function resolveReorderState<T>(props: QwReorderProps<T> = {}): ResolvedReorderState<T> {\n const items: readonly T[] = Array.isArray(props.items) ? props.items : [], seen = new Set<string>(), entries: ReorderEntry<T>[] = [];\n const itemKey = accessor<ReorderItemKey<T>>(props.itemKey), itemText = accessor<ReorderItemText<T>>(props.itemText), itemDisabled = accessor<ReorderItemDisabled<T>>(props.itemDisabled);\n items.forEach((item, index) => {\n const key = resolveReorderKey(item, index, itemKey);\n if (seen.has(key)) throw new TypeError(`Reorder item keys must be unique: ${key}`);\n seen.add(key);\n entries.push({ key, index, item, text: resolveReorderText(item, index, itemText) || key, disabled: resolveReorderDisabled(item, index, itemDisabled) });\n });\n const threshold = finite(props.threshold, -1);\n return {\n entries, keys: entries.map((entry) => entry.key), disabled: !!props.disabled, threshold: threshold >= 0 ? threshold : REORDER_DEFAULT_THRESHOLD,\n texts: Object.fromEntries(TEXT_NAMES.map((name) => [name, text(props[name], REORDER_DEFAULT_TEXTS[name])])) as ReorderTexts,\n };\n}\n/** Effective order: the known keys of `order` (first occurrence), then the remaining keys in items order. */\nexport function resolveReorderOrder(keys: readonly string[], order?: readonly unknown[] | null): string[] {\n if (!Array.isArray(order)) return [...keys];\n const known = new Set(keys), seen = new Set<string>(), result: string[] = [];\n for (const key of order) if (typeof key === \"string\" && known.has(key) && !seen.has(key)) { seen.add(key); result.push(key); }\n for (const key of keys) if (!seen.has(key)) result.push(key);\n return result;\n}\n/** Entries in the effective order, with `index` as the position in that order. */\nexport function getReorderEntries<T>(state: ResolvedReorderState<T>, order?: readonly unknown[] | null): ReorderEntry<T>[] {\n const byKey = new Map(state.entries.map((entry) => [entry.key, entry]));\n return resolveReorderOrder(state.keys, order).map((key, index) => ({ ...byKey.get(key)!, index }));\n}\n/** Move one key; `to` is the final index (clamped). Never mutates the input. */\nexport function moveReorderKeys(order: readonly string[], from: number, to: number): string[] {\n const next = [...order];\n if (!Number.isInteger(from) || from < 0 || from >= next.length) return next;\n const [key] = next.splice(from, 1);\n next.splice(clamp(Math.round(finite(to, from)), 0, next.length), 0, key!);\n return next;\n}\nexport function formatReorderText(template: string, values: { text: string; position: number; count: number }): string {\n return template.replace(/\\{(text|position|count)\\}/g, (_match, name: \"text\" | \"position\" | \"count\") => String(values[name]));\n}\n/** Distance the other items shift: the dragged item's block size plus the gap to its neighbour. */\nexport function getReorderPitch(rects: readonly ReorderRect[], from: number): number {\n const rect = rects[from];\n if (!rect) return 0;\n const next = rects[from + 1], previous = rects[from - 1];\n const gap = next ? next.top - rect.bottom : previous ? rect.top - previous.bottom : 0;\n return Math.max(0, rect.bottom - rect.top + Math.max(0, gap));\n}\n/** Keep the dragged item between the first item's top and the last item's bottom. */\nexport function clampReorderOffset(rects: readonly ReorderRect[], from: number, offset: number): number {\n const rect = rects[from], first = rects[0], last = rects[rects.length - 1];\n if (!rect || !first || !last || !Number.isFinite(offset)) return 0;\n return clamp(offset, Math.min(0, first.top - rect.top), Math.max(0, last.bottom - rect.bottom));\n}\n/** Final index of the dragged item: it passes another item once its centre crosses that item's centre. Rects are in DOM order. */\nexport function getReorderTargetIndex(rects: readonly ReorderRect[], from: number, offset: number): number {\n const rect = rects[from];\n if (!rect || !Number.isFinite(offset)) return clamp(from, 0, Math.max(0, rects.length - 1));\n const centre = (rect.top + rect.bottom) / 2 + offset, mid = (index: number) => (rects[index]!.top + rects[index]!.bottom) / 2;\n let to = from;\n while (to + 1 < rects.length && mid(to + 1) < centre) to += 1;\n if (to === from) while (to > 0 && mid(to - 1) > centre) to -= 1;\n return to;\n}\n/** Offset that places the dragged item exactly in slot `to` (keyboard moves). */\nexport function getReorderSlotOffset(rects: readonly ReorderRect[], from: number, to: number): number {\n const rect = rects[from], target = rects[to];\n if (!rect || !target) return 0;\n return to > from ? target.bottom - rect.bottom : target.top - rect.top;\n}\n/** Preview shift of a non-dragged item at `index` while the dragged item targets `to`. */\nexport function getReorderShift(index: number, drag: Pick<ReorderDrag, \"from\" | \"to\" | \"pitch\">): number {\n if (index > drag.from && index <= drag.to) return -drag.pitch;\n if (index < drag.from && index >= drag.to) return drag.pitch;\n return 0;\n}\n/** Keyboard target while picked up: ArrowUp/ArrowDown step, Home/End jump, clamped to [0, count - 1]; null for other keys. */\nexport function getReorderKeyTarget(key: string, to: number, count: number): number | null {\n const next = key === \"ArrowUp\" ? to - 1 : key === \"ArrowDown\" ? to + 1 : key === \"Home\" ? 0 : key === \"End\" ? count - 1 : null;\n return next === null ? null : clamp(next, 0, Math.max(0, count - 1));\n}\n/** Auto-scroll step for a pointer at `y` within the viewport band [top, bottom]; negative scrolls up, 0 outside the edge bands. */\nexport function getReorderAutoScroll(y: number, top: number, bottom: number, edge = REORDER_AUTO_SCROLL_EDGE, speed = REORDER_AUTO_SCROLL_SPEED): number {\n const band = Math.min(edge, (bottom - top) / 2);\n if (!Number.isFinite(y) || !(band > 0)) return 0;\n if (y < top + band) return -Math.ceil(speed * Math.min(1, (top + band - y) / band));\n if (y > bottom - band) return Math.ceil(speed * Math.min(1, (y - bottom + band) / band));\n return 0;\n}\nexport function createReorderProps<T>(props: QwReorderProps<T> = {}): QwReorderProps {\n if (props.id !== undefined && (typeof props.id !== \"string\" || !props.id.trim())) throw new TypeError(\"Reorder requires a nonempty instance id when provided\");\n return { ...props } as QwReorderProps;\n}\n\ninterface ReorderPending { key: string; text: string; signature: string }\nexport interface QwReorderSchema {\n props: QwReorderProps;\n context: { value: string[]; drag: ReorderDrag | null; announcement: string };\n refs: { drag: ReorderDrag | null; pending: ReorderPending | null; reset: (() => void) | null; settle: (() => void) | null; restore: (() => void) | null };\n state: \"ready\";\n action: \"start\" | \"move\" | \"drop\" | \"cancel\" | \"orderChange\" | \"reconcile\" | \"settle\";\n effect: \"trackInteraction\";\n event:\n | { type: \"DRAG.START\"; key: string; from: number; source: ReorderSource; pitch: number }\n | { type: \"DRAG.MOVE\"; to: number; offset: number }\n | { type: \"DRAG.DROP\" }\n | { type: \"DRAG.CANCEL\" }\n | { type: \"DROP.SETTLE\" };\n}\nexport type QwReorderMachine = Machine<QwReorderSchema>;\nexport type QwReorderService = Service<QwReorderSchema>;\ntype PropReader = <K extends keyof QwReorderProps>(key: K) => QwReorderProps[K];\ntype ContextReader = { get<K extends keyof QwReorderSchema[\"context\"]>(key: K): QwReorderSchema[\"context\"][K]; set<K extends keyof QwReorderSchema[\"context\"]>(key: K, value: QwReorderSchema[\"context\"][K]): void };\ntype RefsAccess = { get<K extends keyof QwReorderSchema[\"refs\"]>(key: K): QwReorderSchema[\"refs\"][K]; set<K extends keyof QwReorderSchema[\"refs\"]>(key: K, value: QwReorderSchema[\"refs\"][K]): void };\ninterface ActionParams { prop: PropReader; context: ContextReader; refs: RefsAccess }\nconst PROP_NAMES = [\"items\", \"itemKey\", \"itemText\", \"itemDisabled\", \"disabled\", \"threshold\", ...TEXT_NAMES] as const;\nconst stateOf = (prop: PropReader) => resolveReorderState(Object.fromEntries(PROP_NAMES.map((name) => [name, prop(name)])) as QwReorderProps);\nconst keysOf = (value: unknown): string[] => Array.isArray(value) ? value.filter((key): key is string => typeof key === \"string\") : [];\nconst sameKeys = (a: readonly string[] | undefined, b: readonly string[] | undefined) => !!a && !!b && a.length === b.length && a.every((key, index) => key === b[index]);\n/** Live state: props re-resolved on every read; the order reconciled against the current items. */\nfunction live(prop: PropReader, context: Pick<ContextReader, \"get\">) {\n const state = stateOf(prop), entries = getReorderEntries(state, context.get(\"value\")), order = entries.map((entry) => entry.key);\n return { state, entries, order, signature: order.join(\"\\u0000\") };\n}\nconst ids = (scope: QwReorderService[\"scope\"]) => {\n const base = `reorder:${scope.id}`;\n return { root: base, list: `${base}:list`, instructions: `${base}:instructions`, status: `${base}:status`,\n item: (key: string) => `${base}:item:${encodeURIComponent(key)}`, handle: (key: string) => `${base}:handle:${encodeURIComponent(key)}` };\n};\nfunction announce(context: ContextReader, template: string, values: { text: string; index: number; count: number }): void {\n context.set(\"announcement\", formatReorderText(template, { text: values.text, position: values.index + 1, count: values.count }));\n}\nfunction setDrag({ context, refs }: ActionParams, drag: ReorderDrag | null): void { refs.set(\"drag\", drag); context.set(\"drag\", drag); }\n/** End the active drag without changing the order. */\nfunction cancelDrag(params: ActionParams): void {\n const drag = params.refs.get(\"drag\");\n if (!drag) return;\n setDrag(params, null); params.refs.get(\"reset\")?.();\n announce(params.context, stateOf(params.prop).texts.cancelledText, { text: drag.text, index: drag.from, count: drag.count });\n}\n/** An order/data change, a disabled list or a disabled dragged item invalidates the measured drag: cancel it. */\nfunction reconcileDrag(params: ActionParams): void {\n const drag = params.refs.get(\"drag\");\n if (!drag) return;\n const now = live(params.prop, params.context), entry = now.entries[drag.from];\n if (now.state.disabled || now.signature !== drag.signature || entry?.key !== drag.key || entry.disabled) cancelDrag(params);\n}\n/** The block-scrollable ancestor (the root included), or null for the page viewport. */\nfunction scrollParent(root: HTMLElement): HTMLElement | null {\n const doc = root.ownerDocument, win = doc.defaultView;\n for (let node: HTMLElement | null = root; node && node !== doc.body && node !== doc.documentElement; node = node.parentElement) {\n const overflow = win?.getComputedStyle(node).overflowY ?? \"\";\n if ((overflow === \"auto\" || overflow === \"scroll\" || overflow === \"overlay\") && node.scrollHeight > node.clientHeight) return node;\n }\n return null;\n}\ninterface PointerGesture {\n pointerId: number; key: string; from: number; to: number; offset: number; startX: number; startY: number; y: number; active: boolean;\n handle: HTMLElement; rects: ReorderRect[]; listTop: number; scroller: HTMLElement | null;\n}\n\n/** Core owns pointer ownership/threshold/capture, insertion math, keyboard moves, announcements, proposals, focus retention and cleanup. */\nexport const reorderMachine: QwReorderMachine = createMachine<QwReorderSchema>({\n props: ({ props }) => createReorderProps(props), initialState: () => \"ready\", states: { ready: {} },\n context: ({ bindable, prop }) => ({\n value: bindable<string[]>(() => ({\n defaultValue: resolveReorderOrder(stateOf(prop).keys, prop(\"defaultValue\")),\n value: prop(\"value\") === undefined ? undefined : keysOf(prop(\"value\")), isEqual: sameKeys, hash: (value) => value.join(\"\\u0000\"),\n })),\n drag: bindable<ReorderDrag | null>(() => ({ defaultValue: null })),\n announcement: bindable(() => ({ defaultValue: \"\" })),\n }),\n refs: () => ({ drag: null, pending: null, reset: null, settle: null, restore: null }),\n watch({ track, prop, context, action }) {\n track([() => live(prop, context).signature], () => action([\"orderChange\"]));\n track([() => !!prop(\"disabled\"), () => stateOf(prop).entries.map((entry) => entry.disabled ? 1 : 0).join(\"\")], () => action([\"reconcile\"]));\n },\n on: {\n \"DRAG.START\": { actions: [\"start\"] }, \"DRAG.MOVE\": { actions: [\"move\"] }, \"DRAG.DROP\": { actions: [\"drop\"] }, \"DRAG.CANCEL\": { actions: [\"cancel\"] },\n \"DROP.SETTLE\": { actions: [\"settle\"] },\n },\n effects: [\"trackInteraction\"],\n implementations: {\n actions: {\n start(params) {\n const { event, prop, context, refs } = params;\n if (event.type !== \"DRAG.START\" || refs.get(\"drag\")) return;\n const now = live(prop, context), entry = now.entries[event.from];\n if (now.state.disabled || entry?.key !== event.key || entry.disabled) { refs.get(\"reset\")?.(); return; }\n refs.set(\"pending\", null);\n setDrag(params, { key: entry.key, text: entry.text, from: entry.index, to: entry.index, count: now.order.length, offset: 0, pitch: Math.max(0, finite(event.pitch)),\n source: event.source, signature: now.signature });\n announce(context, now.state.texts.pickedText, { text: entry.text, index: entry.index, count: now.order.length });\n },\n move(params) {\n const { event, prop, context, refs } = params, drag = refs.get(\"drag\");\n if (event.type !== \"DRAG.MOVE\" || !drag) return;\n const to = clamp(Math.round(finite(event.to, drag.to)), 0, drag.count - 1), offset = finite(event.offset);\n if (to === drag.to && offset === drag.offset) return;\n setDrag(params, { ...drag, to, offset });\n if (to !== drag.to) announce(context, stateOf(prop).texts.movedText, { text: drag.text, index: to, count: drag.count });\n },\n drop(params) {\n const { prop, context, refs } = params, drag = refs.get(\"drag\");\n if (!drag) return;\n const now = live(prop, context);\n if (now.signature !== drag.signature) { cancelDrag(params); return; }\n setDrag(params, null); refs.get(\"reset\")?.();\n if (drag.to === drag.from) { announce(context, now.state.texts.droppedText, { text: drag.text, index: drag.from, count: now.order.length }); return; }\n const value = moveReorderKeys(now.order, drag.from, drag.to);\n // The owner decides; the outcome is announced when the order changes (orderChange) or on the next frame (settle).\n refs.set(\"pending\", { key: drag.key, text: drag.text, signature: now.signature });\n refs.get(\"settle\")?.();\n prop(\"onReorder\")?.({ key: drag.key, from: drag.from, to: drag.to, value: [...value] });\n context.set(\"value\", value);\n },\n cancel(params) { cancelDrag(params); },\n reconcile(params) { reconcileDrag(params); },\n orderChange(params) {\n const { prop, context, refs } = params;\n reconcileDrag(params);\n const pending = refs.get(\"pending\"), now = live(prop, context);\n if (pending && pending.signature !== now.signature) {\n refs.set(\"pending\", null);\n const index = now.order.indexOf(pending.key);\n if (index !== -1) announce(context, now.state.texts.droppedText, { text: pending.text, index, count: now.order.length });\n }\n refs.get(\"restore\")?.();\n },\n settle({ prop, context, refs }) {\n const pending = refs.get(\"pending\"), now = live(prop, context);\n // Unchanged after the owner had its chance: a rejection. Pending stays so a late acceptance is still announced once.\n if (pending && pending.signature === now.signature) announce(context, now.state.texts.rejectedText, { text: pending.text, index: now.order.indexOf(pending.key), count: now.order.length });\n },\n },\n effects: {\n trackInteraction({ scope, prop, context, refs, send }) {\n const id = ids(scope), root = scope.getById<HTMLElement>(id.root), doc = root?.ownerDocument, win = doc?.defaultView;\n if (!root || !doc || !win) return;\n let pointer: PointerGesture | null = null, keyboard: { key: string; from: number; to: number; rects: ReorderRect[] } | null = null;\n let scrollFrame = 0, focusKey: string | null = null, disposed = false;\n const frames = new Set<number>();\n const later = (run: () => void) => { const handle = win.requestAnimationFrame(() => { frames.delete(handle); if (!disposed) run(); }); frames.add(handle); };\n const element = (kind: \"item\" | \"handle\", key: string) => scope.getById<HTMLElement>(id[kind](key));\n /** The handle of this list that contains target; handles of nested lists are ignored. */\n const handleAt = (target: EventTarget | null): { element: HTMLElement; key: string } | null => {\n const found = (target as Element | null)?.closest?.('[data-scope=\"reorder\"][data-part=\"handle\"]') as HTMLElement | null | undefined;\n const key = found?.getAttribute(\"data-key\");\n return found && key != null && found.closest('[data-scope=\"reorder\"][data-part=\"root\"]') === root ? { element: found, key } : null;\n };\n const startable = (key: string) => {\n const now = live(prop, context), entry = now.entries.find((item) => item.key === key);\n return now.state.disabled || !entry || entry.disabled ? null : { now, entry };\n };\n // Measured strategy: real item rects at drag start (variable heights, uniform gap); layout must not change mid-drag.\n const measure = (order: readonly string[]): ReorderRect[] => order.map((key) => { const rect = element(\"item\", key)?.getBoundingClientRect(); return { top: rect?.top ?? 0, bottom: rect?.bottom ?? 0 }; });\n const listRect = () => scope.getById<HTMLElement>(id.list)?.getBoundingClientRect();\n const stopPointer = () => {\n const gesture = pointer;\n if (!gesture) return;\n pointer = null;\n doc.removeEventListener(\"pointermove\", onMove, true); doc.removeEventListener(\"pointerup\", onUp, true);\n doc.removeEventListener(\"pointercancel\", onCancel, true); doc.removeEventListener(\"lostpointercapture\", onCancel, true); doc.removeEventListener(\"scroll\", onScroll, true);\n if (scrollFrame) { win.cancelAnimationFrame(scrollFrame); scrollFrame = 0; }\n try { if (gesture.handle.hasPointerCapture?.(gesture.pointerId)) gesture.handle.releasePointerCapture(gesture.pointerId); } catch { /* already released by the platform */ }\n };\n const update = (gesture: PointerGesture) => {\n // Pointer travel plus any scroll of the list since the drag started.\n const raw = gesture.y - gesture.startY + gesture.listTop - (listRect()?.top ?? gesture.listTop);\n // The clamp parks the centre exactly on an edge item's centre, so the target must come from the raw travel.\n const offset = clampReorderOffset(gesture.rects, gesture.from, raw);\n const to = getReorderTargetIndex(gesture.rects, gesture.from, raw);\n if (to === gesture.to && offset === gesture.offset) return;\n gesture.to = to; gesture.offset = offset;\n send({ type: \"DRAG.MOVE\", to, offset });\n };\n const scrollStep = (gesture: PointerGesture) => {\n const scroller = gesture.scroller, rect = scroller?.getBoundingClientRect(), top = rect ? rect.top + scroller!.clientTop : 0;\n const bottom = scroller ? top + scroller.clientHeight : win.innerHeight, list = listRect(), step = getReorderAutoScroll(gesture.y, top, bottom);\n return !list || (step < 0 && list.top >= top) || (step > 0 && list.bottom <= bottom) ? 0 : step;\n };\n const autoScroll = () => {\n scrollFrame = 0;\n const gesture = pointer, step = gesture?.active ? scrollStep(gesture) : 0;\n if (!gesture || !step) return;\n const position = () => gesture.scroller ? gesture.scroller.scrollTop : win.scrollY, before = position();\n if (gesture.scroller) gesture.scroller.scrollTop = before + step; else win.scrollBy(0, step);\n if (position() === before) return; // already at the scroll edge\n update(gesture);\n scrollFrame = win.requestAnimationFrame(autoScroll);\n };\n const onDown = (event: PointerEvent) => {\n // One owner: only the primary button/contact of the first pointer; a second pointer is ignored.\n if (pointer || keyboard || event.isPrimary === false || event.button !== 0) return;\n const hit = handleAt(event.target), found = hit && startable(hit.key);\n if (!hit || !found) return;\n event.preventDefault(); // no text selection or focus theft while dragging\n pointer = { pointerId: event.pointerId, key: found.entry.key, from: found.entry.index, to: found.entry.index, offset: 0, startX: event.clientX, startY: event.clientY, y: event.clientY,\n active: false, handle: hit.element, rects: [], listTop: 0, scroller: null };\n try { hit.element.setPointerCapture?.(event.pointerId); } catch { /* synthetic pointers cannot be captured */ }\n doc.addEventListener(\"pointermove\", onMove, true); doc.addEventListener(\"pointerup\", onUp, true);\n doc.addEventListener(\"pointercancel\", onCancel, true); doc.addEventListener(\"lostpointercapture\", onCancel, true); doc.addEventListener(\"scroll\", onScroll, true);\n };\n const onMove = (event: PointerEvent) => {\n const gesture = pointer;\n if (!gesture || event.pointerId !== gesture.pointerId) return;\n gesture.y = event.clientY;\n if (!gesture.active) {\n const found = startable(gesture.key);\n if (Math.hypot(event.clientX - gesture.startX, event.clientY - gesture.startY) < (found?.now.state.threshold ?? 0)) return;\n if (!found || keyboard) { stopPointer(); return; }\n gesture.active = true; gesture.from = gesture.to = found.entry.index; gesture.rects = measure(found.now.order);\n gesture.listTop = listRect()?.top ?? 0; gesture.scroller = scrollParent(root);\n send({ type: \"DRAG.START\", key: gesture.key, from: gesture.from, source: \"pointer\", pitch: getReorderPitch(gesture.rects, gesture.from) });\n }\n if (event.cancelable) event.preventDefault();\n update(gesture);\n if (!scrollFrame && scrollStep(gesture)) scrollFrame = win.requestAnimationFrame(autoScroll);\n };\n const onUp = (event: PointerEvent) => {\n const gesture = pointer;\n if (!gesture || event.pointerId !== gesture.pointerId) return;\n if (gesture.active) { gesture.y = event.clientY; update(gesture); }\n stopPointer();\n if (gesture.active) send({ type: \"DRAG.DROP\" });\n };\n // pointercancel and lostpointercapture (capture stolen, node removed) restore the order.\n const onCancel = (event: PointerEvent) => {\n const gesture = pointer;\n if (!gesture || event.pointerId !== gesture.pointerId) return;\n stopPointer();\n if (gesture.active) send({ type: \"DRAG.CANCEL\" });\n };\n const onScroll = () => { if (pointer?.active) update(pointer); };\n // Escape cancels a pointer drag wherever focus is; capture phase runs before document-level dismiss handlers.\n const onEscape = (event: KeyboardEvent) => {\n if (event.defaultPrevented || event.key !== \"Escape\" || !pointer?.active) return;\n event.preventDefault(); stopPointer(); send({ type: \"DRAG.CANCEL\" });\n };\n // Handle keys are read on the root, so they win over ancestors and document-level listeners.\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey || pointer?.active) return;\n const hit = handleAt(event.target), toggle = event.key === \" \" || event.key === \"Enter\";\n if (!hit) return;\n if (!keyboard) {\n const found = toggle && !event.repeat && !pointer ? startable(hit.key) : null;\n if (!found) return;\n event.preventDefault();\n focusKey = null;\n keyboard = { key: found.entry.key, from: found.entry.index, to: found.entry.index, rects: measure(found.now.order) };\n send({ type: \"DRAG.START\", key: keyboard.key, from: keyboard.from, source: \"keyboard\", pitch: getReorderPitch(keyboard.rects, keyboard.from) });\n return;\n }\n if (hit.key !== keyboard.key) return;\n if (toggle || event.key === \"Escape\") {\n event.preventDefault();\n if (toggle && event.repeat) return;\n keyboard = null;\n send({ type: toggle ? \"DRAG.DROP\" : \"DRAG.CANCEL\" });\n return;\n }\n const to = getReorderKeyTarget(event.key, keyboard.to, keyboard.rects.length);\n if (to === null) return;\n event.preventDefault();\n if (to === keyboard.to) return;\n keyboard.to = to;\n send({ type: \"DRAG.MOVE\", to, offset: getReorderSlotOffset(keyboard.rects, keyboard.from, to) });\n const key = keyboard.key;\n later(() => element(\"item\", key)?.scrollIntoView?.({ block: \"nearest\" }));\n };\n // Leaving the picked-up handle (Tab, click elsewhere, window blur) cancels a keyboard drag.\n const onFocusOut = (event: FocusEvent) => { if (keyboard && handleAt(event.target)?.key === keyboard.key) { keyboard = null; send({ type: \"DRAG.CANCEL\" }); } };\n const onFocusIn = (event: FocusEvent) => { if (focusKey && handleAt(event.target)?.key !== focusKey) focusKey = null; };\n refs.set(\"reset\", () => { stopPointer(); keyboard = null; });\n // Remember the focused handle at a drop, and check for a rejection one frame later.\n refs.set(\"settle\", () => {\n const active = doc.activeElement;\n focusKey = active && root.contains(active) ? handleAt(active)?.key ?? null : null;\n later(() => send({ type: \"DROP.SETTLE\" }));\n });\n // Frameworks move keyed nodes on reorder, which can drop focus to <body>: return it to the same handle.\n refs.set(\"restore\", () => later(() => {\n const active = doc.activeElement, key = focusKey;\n if (!key || (active && active !== doc.body)) return;\n element(\"handle\", key)?.focus({ preventScroll: true });\n element(\"item\", key)?.scrollIntoView?.({ block: \"nearest\" });\n }));\n root.addEventListener(\"pointerdown\", onDown); root.addEventListener(\"keydown\", onKeyDown); root.addEventListener(\"focusout\", onFocusOut);\n doc.addEventListener(\"keydown\", onEscape, true); doc.addEventListener(\"focusin\", onFocusIn);\n return () => {\n disposed = true; stopPointer(); keyboard = null; focusKey = null;\n for (const handle of frames) win.cancelAnimationFrame(handle);\n frames.clear();\n refs.set(\"reset\", null); refs.set(\"settle\", null); refs.set(\"restore\", null); refs.set(\"drag\", null); refs.set(\"pending\", null);\n root.removeEventListener(\"pointerdown\", onDown); root.removeEventListener(\"keydown\", onKeyDown); root.removeEventListener(\"focusout\", onFocusOut);\n doc.removeEventListener(\"keydown\", onEscape, true); doc.removeEventListener(\"focusin\", onFocusIn);\n };\n },\n },\n },\n});\n\nexport interface QwReorderApi<T extends PropTypes = PropTypes, I = unknown> {\n /** Rows in the effective order; render them keyed by `key` so nodes are moved, never re-created. */\n items: ReorderEntry<I>[];\n /** Effective key order. */\n value: string[];\n count: number; disabled: boolean; dragging: boolean; activeKey: string | null; source: ReorderSource | null;\n label: string; instructions: string; announcement: string;\n getRootProps(): T[\"element\"];\n getListProps(): T[\"element\"];\n getItemProps(item: ReorderEntry<I>): T[\"element\"];\n getContentProps(item: ReorderEntry<I>): T[\"element\"];\n getHandleProps(item: ReorderEntry<I>): T[\"button\"];\n getInstructionsProps(): T[\"element\"];\n getStatusProps(): T[\"element\"];\n}\nexport function connectReorder<T extends PropTypes, I = unknown>(service: QwReorderService, normalize: NormalizeProps<T>): QwReorderApi<T, I> {\n const now = live(service.prop, service.context), id = ids(service.scope), { texts, disabled } = now.state, count = now.order.length;\n const raw = service.context.get(\"drag\");\n // A drag measured against another order (data changed, not yet reconciled) renders as no drag.\n const drag = raw && raw.signature === now.signature && now.order[raw.from] === raw.key ? raw : null;\n const part = (name: (typeof REORDER_PARTS)[number]) => ({ \"data-scope\": \"reorder\", \"data-part\": name });\n const shiftOf = (entry: ReorderEntry<I>) => !drag ? 0 : entry.key === drag.key ? drag.offset : getReorderShift(entry.index, drag);\n return {\n items: now.entries as ReorderEntry<I>[], value: now.order, count, disabled, dragging: !!drag, activeKey: drag?.key ?? null, source: drag?.source ?? null,\n label: texts.label, instructions: texts.instructions, announcement: service.context.get(\"announcement\"),\n getRootProps: () => normalize.element({ ...part(\"root\"), id: id.root, role: \"group\", \"aria-label\": texts.label,\n \"data-disabled\": disabled ? \"true\" : undefined, \"data-dragging\": drag ? \"true\" : undefined, \"data-source\": drag?.source }),\n getListProps: () => normalize.element({ ...part(\"list\"), id: id.list, role: \"list\" }),\n getItemProps: (entry) => {\n const active = drag?.key === entry.key, shift = shiftOf(entry);\n return normalize.element({ ...part(\"item\"), id: id.item(entry.key), role: \"listitem\", \"data-key\": entry.key, \"data-index\": entry.index,\n \"data-disabled\": entry.disabled ? \"true\" : undefined, \"data-dragging\": active ? \"true\" : undefined, \"data-shifted\": !active && shift ? \"true\" : undefined,\n style: shift ? { transform: `translateY(${shift}px)` } : undefined });\n },\n getContentProps: (entry) => normalize.element({ ...part(\"content\"), \"data-key\": entry.key }),\n getHandleProps: (entry) => normalize.button({ ...part(\"handle\"), id: id.handle(entry.key), type: \"button\", \"data-key\": entry.key, disabled: disabled || entry.disabled,\n \"aria-label\": formatReorderText(texts.handleLabel, { text: entry.text, position: entry.index + 1, count }), \"aria-describedby\": id.instructions,\n \"aria-pressed\": drag?.key === entry.key ? \"true\" : undefined, \"data-dragging\": drag?.key === entry.key ? \"true\" : undefined }),\n getInstructionsProps: () => normalize.element({ ...part(\"instructions\"), id: id.instructions, style: visuallyHiddenStyle }),\n getStatusProps: () => normalize.element({ ...part(\"status\"), id: id.status, role: \"status\", \"aria-live\": \"assertive\", \"aria-atomic\": \"true\", style: visuallyHiddenStyle }),\n };\n}\n"],"mappings":";;;;AAKA,MAAa,gBAAgB;CAAC;CAAQ;CAAQ;CAAQ;CAAW;CAAU;CAAgB;AAAQ;;AAEnG,MAAa,kBAAkB,CAAC,WAAW,UAAU;;AAGrD,MAAa,4BAA4B;;AAEzC,MAAa,2BAA2B;;AAExC,MAAa,4BAA4B;;AAEzC,MAAa,wBAAwB;CACnC,OAAO;CACP,aAAa;CACb,cAAc;CACd,YAAY;CACZ,WAAW;CACX,aAAa;CACb,cAAc;CACd,eAAe;AACjB;AA0CA,MAAM,QAAQ,OAAgB,aAA6B,OAAO,UAAU,YAAY,MAAM,KAAK,IAAI,QAAQ;AAC/G,MAAM,SAAS,OAAe,KAAa,QAAwB,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC;AACrG,MAAM,UAAU,OAAgB,WAAW,MAAc,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,IAAI,QAAQ;AACvH,MAAM,SAAS,MAAe,SAA0B,SAAS,QAAQ,OAAO,SAAS,WAAY,KAAiC,QAAQ,KAAA;AAC9I,MAAM,YAAe,UAAkC,OAAO,UAAU,cAAe,OAAO,UAAU,YAAY,MAAM,KAAK,IAAK,QAAa,KAAA;AACjJ,MAAM,aAAa,SAA2C,OAAO,SAAS,YAAY,OAAO,SAAS;AAC1G,MAAM,aAAa,OAAO,KAAK,qBAAqB;AAEpD,SAAgB,kBAAqB,MAAS,OAAe,SAAqC;CAChG,MA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EAAoB,CAAC;CAC3K;AACF"}
@@ -0,0 +1,190 @@
1
+ import { type Machine, type Service } from "@zag-js/core";
2
+ import type { NormalizeProps, PropTypes } from "@zag-js/types";
3
+ /** Stable DOM parts shared by every adapter. */
4
+ export declare const REORDER_PARTS: readonly ["root", "list", "item", "content", "handle", "instructions", "status"];
5
+ /** What started the active drag. */
6
+ export declare const REORDER_SOURCES: readonly ["pointer", "keyboard"];
7
+ export type ReorderSource = (typeof REORDER_SOURCES)[number];
8
+ /** Pointer travel in CSS pixels before a press on a handle becomes a drag. */
9
+ export declare const REORDER_DEFAULT_THRESHOLD = 8;
10
+ /** Band in CSS pixels at the block edges of the scroll container where a pointer drag auto-scrolls. */
11
+ export declare const REORDER_AUTO_SCROLL_EDGE = 48;
12
+ /** Maximum auto-scroll step in CSS pixels per frame. */
13
+ export declare const REORDER_AUTO_SCROLL_SPEED = 16;
14
+ /** Default texts. Templates replace {text}, {position} (1-based) and {count}. */
15
+ export declare const REORDER_DEFAULT_TEXTS: {
16
+ readonly label: "排序列表";
17
+ readonly handleLabel: "拖动排序 {text}";
18
+ readonly instructions: "按空格键或回车键拿起,按上下方向键移动,再按空格键或回车键放下,按 Esc 键取消。";
19
+ readonly pickedText: "已拿起 {text},第 {position} 项,共 {count} 项";
20
+ readonly movedText: "{text} 移到第 {position} 项,共 {count} 项";
21
+ readonly droppedText: "已放下 {text},第 {position} 项,共 {count} 项";
22
+ readonly rejectedText: "{text} 未移动,仍为第 {position} 项,共 {count} 项";
23
+ readonly cancelledText: "已取消,{text} 回到第 {position} 项,共 {count} 项";
24
+ };
25
+ export type ReorderTexts = {
26
+ -readonly [K in keyof typeof REORDER_DEFAULT_TEXTS]: string;
27
+ };
28
+ /** Field name, or a function returning a unique nonempty string / finite number. Omitted: string/number items are their own key, objects use `key`. */
29
+ export type ReorderItemKey<T = unknown> = string | ((item: T, index: number) => string | number);
30
+ /** Field name, or a function returning the row text. Omitted: string/number items are their own text, objects use `text`; empty text falls back to the key. */
31
+ export type ReorderItemText<T = unknown> = string | ((item: T, index: number) => string);
32
+ /** Field name, or a function; only `true` disables. Omitted: the `disabled` field. */
33
+ export type ReorderItemDisabled<T = unknown> = string | ((item: T, index: number) => boolean);
34
+ /** Drop proposal: `key` moves from index `from` to index `to`; `value` is the complete proposed key order. */
35
+ export interface ReorderDetails {
36
+ key: string;
37
+ from: number;
38
+ to: number;
39
+ value: string[];
40
+ }
41
+ /** One row in the effective order. */
42
+ export interface ReorderEntry<T = unknown> {
43
+ key: string;
44
+ index: number;
45
+ item: T;
46
+ text: string;
47
+ disabled: boolean;
48
+ }
49
+ /** Active drag snapshot; offset and pitch are CSS pixels along the block axis, measured when the drag started. */
50
+ export interface ReorderDrag {
51
+ key: string;
52
+ text: string;
53
+ from: number;
54
+ to: number;
55
+ count: number;
56
+ offset: number;
57
+ pitch: number;
58
+ source: ReorderSource;
59
+ signature: string;
60
+ }
61
+ /** Measured block edges of an item, in viewport pixels. */
62
+ export interface ReorderRect {
63
+ top: number;
64
+ bottom: number;
65
+ }
66
+ export interface QwReorderProps<T = unknown> extends Partial<ReorderTexts> {
67
+ /** Page-unique instance identity; adapters generate one when omitted. */
68
+ id?: string;
69
+ /** Caller-owned rows; never mutated. */
70
+ items?: readonly T[];
71
+ itemKey?: ReorderItemKey<T>;
72
+ itemText?: ReorderItemText<T>;
73
+ itemDisabled?: ReorderItemDisabled<T>;
74
+ /** Controlled key order. The order only changes when the owner updates it; not updating rejects a proposal. */
75
+ value?: readonly string[];
76
+ /** Initial Core-owned key order. Keys missing from an order are appended in items order. */
77
+ defaultValue?: readonly string[];
78
+ /** Disable every handle; an active drag is cancelled. */
79
+ disabled?: boolean;
80
+ /** Pointer travel in CSS pixels before a drag starts; defaults to 8. */
81
+ threshold?: number;
82
+ /** A drop that changes the order. Uncontrolled lists commit it; controlled owners accept by updating `value`. */
83
+ onReorder?: (details: ReorderDetails) => void;
84
+ }
85
+ export interface ResolvedReorderState<T = unknown> {
86
+ /** Items in caller order. */
87
+ entries: ReorderEntry<T>[];
88
+ keys: string[];
89
+ disabled: boolean;
90
+ threshold: number;
91
+ texts: ReorderTexts;
92
+ }
93
+ export declare function resolveReorderKey<T>(item: T, index: number, itemKey?: ReorderItemKey<T>): string;
94
+ export declare function resolveReorderText<T>(item: T, index: number, itemText?: ReorderItemText<T>): string;
95
+ export declare function resolveReorderDisabled<T>(item: T, index: number, itemDisabled?: ReorderItemDisabled<T>): boolean;
96
+ /** Missing or duplicate keys throw: a silent fallback would break row identity. */
97
+ export declare function resolveReorderState<T>(props?: QwReorderProps<T>): ResolvedReorderState<T>;
98
+ /** Effective order: the known keys of `order` (first occurrence), then the remaining keys in items order. */
99
+ export declare function resolveReorderOrder(keys: readonly string[], order?: readonly unknown[] | null): string[];
100
+ /** Entries in the effective order, with `index` as the position in that order. */
101
+ export declare function getReorderEntries<T>(state: ResolvedReorderState<T>, order?: readonly unknown[] | null): ReorderEntry<T>[];
102
+ /** Move one key; `to` is the final index (clamped). Never mutates the input. */
103
+ export declare function moveReorderKeys(order: readonly string[], from: number, to: number): string[];
104
+ export declare function formatReorderText(template: string, values: {
105
+ text: string;
106
+ position: number;
107
+ count: number;
108
+ }): string;
109
+ /** Distance the other items shift: the dragged item's block size plus the gap to its neighbour. */
110
+ export declare function getReorderPitch(rects: readonly ReorderRect[], from: number): number;
111
+ /** Keep the dragged item between the first item's top and the last item's bottom. */
112
+ export declare function clampReorderOffset(rects: readonly ReorderRect[], from: number, offset: number): number;
113
+ /** Final index of the dragged item: it passes another item once its centre crosses that item's centre. Rects are in DOM order. */
114
+ export declare function getReorderTargetIndex(rects: readonly ReorderRect[], from: number, offset: number): number;
115
+ /** Offset that places the dragged item exactly in slot `to` (keyboard moves). */
116
+ export declare function getReorderSlotOffset(rects: readonly ReorderRect[], from: number, to: number): number;
117
+ /** Preview shift of a non-dragged item at `index` while the dragged item targets `to`. */
118
+ export declare function getReorderShift(index: number, drag: Pick<ReorderDrag, "from" | "to" | "pitch">): number;
119
+ /** Keyboard target while picked up: ArrowUp/ArrowDown step, Home/End jump, clamped to [0, count - 1]; null for other keys. */
120
+ export declare function getReorderKeyTarget(key: string, to: number, count: number): number | null;
121
+ /** Auto-scroll step for a pointer at `y` within the viewport band [top, bottom]; negative scrolls up, 0 outside the edge bands. */
122
+ export declare function getReorderAutoScroll(y: number, top: number, bottom: number, edge?: number, speed?: number): number;
123
+ export declare function createReorderProps<T>(props?: QwReorderProps<T>): QwReorderProps;
124
+ interface ReorderPending {
125
+ key: string;
126
+ text: string;
127
+ signature: string;
128
+ }
129
+ export interface QwReorderSchema {
130
+ props: QwReorderProps;
131
+ context: {
132
+ value: string[];
133
+ drag: ReorderDrag | null;
134
+ announcement: string;
135
+ };
136
+ refs: {
137
+ drag: ReorderDrag | null;
138
+ pending: ReorderPending | null;
139
+ reset: (() => void) | null;
140
+ settle: (() => void) | null;
141
+ restore: (() => void) | null;
142
+ };
143
+ state: "ready";
144
+ action: "start" | "move" | "drop" | "cancel" | "orderChange" | "reconcile" | "settle";
145
+ effect: "trackInteraction";
146
+ event: {
147
+ type: "DRAG.START";
148
+ key: string;
149
+ from: number;
150
+ source: ReorderSource;
151
+ pitch: number;
152
+ } | {
153
+ type: "DRAG.MOVE";
154
+ to: number;
155
+ offset: number;
156
+ } | {
157
+ type: "DRAG.DROP";
158
+ } | {
159
+ type: "DRAG.CANCEL";
160
+ } | {
161
+ type: "DROP.SETTLE";
162
+ };
163
+ }
164
+ export type QwReorderMachine = Machine<QwReorderSchema>;
165
+ export type QwReorderService = Service<QwReorderSchema>;
166
+ /** Core owns pointer ownership/threshold/capture, insertion math, keyboard moves, announcements, proposals, focus retention and cleanup. */
167
+ export declare const reorderMachine: QwReorderMachine;
168
+ export interface QwReorderApi<T extends PropTypes = PropTypes, I = unknown> {
169
+ /** Rows in the effective order; render them keyed by `key` so nodes are moved, never re-created. */
170
+ items: ReorderEntry<I>[];
171
+ /** Effective key order. */
172
+ value: string[];
173
+ count: number;
174
+ disabled: boolean;
175
+ dragging: boolean;
176
+ activeKey: string | null;
177
+ source: ReorderSource | null;
178
+ label: string;
179
+ instructions: string;
180
+ announcement: string;
181
+ getRootProps(): T["element"];
182
+ getListProps(): T["element"];
183
+ getItemProps(item: ReorderEntry<I>): T["element"];
184
+ getContentProps(item: ReorderEntry<I>): T["element"];
185
+ getHandleProps(item: ReorderEntry<I>): T["button"];
186
+ getInstructionsProps(): T["element"];
187
+ getStatusProps(): T["element"];
188
+ }
189
+ export declare function connectReorder<T extends PropTypes, I = unknown>(service: QwReorderService, normalize: NormalizeProps<T>): QwReorderApi<T, I>;
190
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./result.js";
@@ -0,0 +1,123 @@
1
+ import { i as getIconVector, o as resolveIconState, r as getIconRootProps } from "../icon-Cgdbnk1u.js";
2
+ //#region src/result/result.ts
3
+ const RESULT_STATUSES = [
4
+ "success",
5
+ "error",
6
+ "warning",
7
+ "info",
8
+ "waiting"
9
+ ];
10
+ const RESULT_ANNOUNCEMENTS = [
11
+ "off",
12
+ "status",
13
+ "alert"
14
+ ];
15
+ const RESULT_HEADING_LEVELS = [
16
+ 2,
17
+ 3,
18
+ 4,
19
+ 5,
20
+ 6
21
+ ];
22
+ const RESULT_PARTS = [
23
+ "root",
24
+ "icon",
25
+ "title",
26
+ "description",
27
+ "extra",
28
+ "actions"
29
+ ];
30
+ const symbols = {
31
+ success: "circle-check-fill",
32
+ error: "circle-close-fill",
33
+ warning: "attention-fill",
34
+ info: "info-fill",
35
+ waiting: "time"
36
+ };
37
+ const nonblank = (value) => typeof value === "string" && value.trim() ? value.trim() : void 0;
38
+ function prefix(id) {
39
+ let result = "qw-result-";
40
+ for (let index = 0; index < id.length; index++) result += id.charCodeAt(index).toString(16).padStart(4, "0");
41
+ return result;
42
+ }
43
+ /** Pure render-time resolution; never reads a DOM node or manufactures a request. */
44
+ function resolveResultState(props, presence = {}, fallbackId, attributes = {}) {
45
+ const id = nonblank(props.id) ? props.id : fallbackId;
46
+ if (!nonblank(id)) throw new TypeError("Result requires a non-empty stable id");
47
+ const status = RESULT_STATUSES.includes(props.status) ? props.status : "info";
48
+ const headingLevel = RESULT_HEADING_LEVELS.includes(props.headingLevel) ? props.headingLevel : 2;
49
+ const announce = RESULT_ANNOUNCEMENTS.includes(props.announce) ? props.announce : "off";
50
+ const hasTitle = presence.title === true || props.title != null;
51
+ const hasDescription = presence.description === true || props.description != null;
52
+ const titleId = hasTitle ? `${prefix(id)}-title` : void 0;
53
+ const descriptionId = hasDescription ? `${prefix(id)}-description` : void 0;
54
+ const ariaLabel = typeof attributes["aria-label"] === "string" ? attributes["aria-label"] : void 0;
55
+ const labelledBy = nonblank(props.labelledBy) ?? nonblank(attributes["aria-labelledby"]) ?? (ariaLabel === void 0 ? titleId : void 0);
56
+ const describedBy = nonblank(props.describedBy) ?? nonblank(attributes["aria-describedby"]) ?? descriptionId;
57
+ return {
58
+ id,
59
+ status,
60
+ title: props.title ?? "",
61
+ description: props.description ?? "",
62
+ headingTag: `h${headingLevel}`,
63
+ compact: props.compact === true,
64
+ announce,
65
+ iconMode: props.hideIcon === true ? "hidden" : presence.icon === true ? "custom" : "default",
66
+ iconName: symbols[status],
67
+ titleFromContent: presence.title === true,
68
+ descriptionFromContent: presence.description === true,
69
+ titleId,
70
+ descriptionId,
71
+ labelledBy,
72
+ describedBy,
73
+ ariaLabel,
74
+ visible: {
75
+ root: true,
76
+ icon: props.hideIcon !== true,
77
+ title: hasTitle,
78
+ description: hasDescription,
79
+ extra: presence.extra === true,
80
+ actions: presence.default === true
81
+ }
82
+ };
83
+ }
84
+ /** Named static group or explicitly requested live region; no implicit alert/focus. */
85
+ function getResultRootProps(state) {
86
+ return {
87
+ "data-scope": "result",
88
+ "data-part": "root",
89
+ "data-status": state.status,
90
+ "data-compact": state.compact ? "true" : void 0,
91
+ role: state.announce === "off" ? state.labelledBy !== void 0 || state.ariaLabel !== void 0 ? "group" : void 0 : state.announce,
92
+ "aria-labelledby": state.labelledBy,
93
+ "aria-describedby": state.describedBy,
94
+ "aria-label": state.ariaLabel,
95
+ "aria-live": state.announce === "off" ? void 0 : state.announce === "status" ? "polite" : "assertive",
96
+ "aria-atomic": state.announce === "off" ? void 0 : true
97
+ };
98
+ }
99
+ /** Stable part selectors and references; absent parts have no dangling IDs. */
100
+ function getResultPartProps(state, part) {
101
+ return {
102
+ "data-scope": "result",
103
+ "data-part": part,
104
+ hidden: !state.visible[part],
105
+ id: part === "title" ? state.titleId : part === "description" ? state.descriptionId : void 0
106
+ };
107
+ }
108
+ /** Existing canonical system symbol with decorative semantics and scoped vectors. */
109
+ function getResultIcon(state) {
110
+ const icon = resolveIconState({
111
+ id: `${state.id}-result-symbol`,
112
+ name: state.iconName
113
+ });
114
+ return {
115
+ tag: "svg",
116
+ attrs: getIconRootProps(icon),
117
+ children: getIconVector(icon)
118
+ };
119
+ }
120
+ //#endregion
121
+ export { RESULT_ANNOUNCEMENTS, RESULT_HEADING_LEVELS, RESULT_PARTS, RESULT_STATUSES, getResultIcon, getResultPartProps, getResultRootProps, resolveResultState };
122
+
123
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/result/result.ts"],"sourcesContent":["import { resolveIconState, getIconRootProps, getIconVector, type IconName, type IconVectorNode } from \"../icon/index.js\";\n\nexport const RESULT_STATUSES = [\"success\", \"error\", \"warning\", \"info\", \"waiting\"] as const;\nexport const RESULT_ANNOUNCEMENTS = [\"off\", \"status\", \"alert\"] as const;\nexport const RESULT_HEADING_LEVELS = [2, 3, 4, 5, 6] as const;\nexport const RESULT_PARTS = [\"root\", \"icon\", \"title\", \"description\", \"extra\", \"actions\"] as const;\nexport type ResultStatus = (typeof RESULT_STATUSES)[number];\nexport type ResultAnnouncement = (typeof RESULT_ANNOUNCEMENTS)[number];\nexport type ResultHeadingLevel = (typeof RESULT_HEADING_LEVELS)[number];\nexport type ResultPart = (typeof RESULT_PARTS)[number];\n\n/** Framework-neutral scalar outcome inputs; rich nodes use explicit presence. */\nexport interface QwResultProps {\n /** Stable caller identity, or framework useId fallback. Native SSR requires one. */\n id?: string;\n /** Outcome, default info. Invalid runtime values use info. */\n status?: ResultStatus;\n /** Scalar main text; present rich title content overrides it. */\n title?: string | null;\n /** Supporting text; rich description content overrides it. */\n description?: string | null;\n /** Actual native heading level, default h2. */\n headingLevel?: ResultHeadingLevel;\n /** Compact spacing and symbol geometry for embedded results. */\n compact?: boolean;\n /** Hide default or custom symbol while retaining caller content. */\n hideIcon?: boolean;\n /** Explicit live region; static off is the default regardless of outcome. */\n announce?: ResultAnnouncement;\n /** Explicit external accessible-name references. */\n labelledBy?: string;\n /** Explicit external description references. */\n describedBy?: string;\n}\n\nexport interface ResultPresence {\n readonly icon?: boolean;\n readonly title?: boolean;\n readonly description?: boolean;\n readonly extra?: boolean;\n readonly default?: boolean;\n}\n\n/** Core-owned outcome, content and ARIA decisions used unchanged by every adapter. */\nexport interface ResultState {\n readonly id: string;\n readonly status: ResultStatus;\n readonly title: string;\n readonly description: string;\n readonly headingTag: `h${ResultHeadingLevel}`;\n readonly compact: boolean;\n readonly announce: ResultAnnouncement;\n readonly iconMode: \"default\" | \"custom\" | \"hidden\";\n readonly iconName: IconName;\n readonly titleFromContent: boolean;\n readonly descriptionFromContent: boolean;\n readonly titleId?: string;\n readonly descriptionId?: string;\n readonly labelledBy?: string;\n readonly describedBy?: string;\n readonly ariaLabel?: string;\n readonly visible: Readonly<Record<ResultPart, boolean>>;\n}\n\nconst symbols = { success: \"circle-check-fill\", error: \"circle-close-fill\", warning: \"attention-fill\", info: \"info-fill\", waiting: \"time\" } as const satisfies Readonly<Record<ResultStatus, IconName>>;\nconst nonblank = (value: unknown): string | undefined => typeof value === \"string\" && value.trim() ? value.trim() : undefined;\nfunction prefix(id: string): string {\n let result = \"qw-result-\";\n for (let index = 0; index < id.length; index++) result += id.charCodeAt(index).toString(16).padStart(4, \"0\");\n return result;\n}\n\n/** Pure render-time resolution; never reads a DOM node or manufactures a request. */\nexport function resolveResultState(props: QwResultProps, presence: ResultPresence = {}, fallbackId?: string, attributes: Readonly<Record<string, unknown>> = {}): ResultState {\n const id = nonblank(props.id) ? props.id! : fallbackId;\n if (!nonblank(id)) throw new TypeError(\"Result requires a non-empty stable id\");\n const status = RESULT_STATUSES.includes(props.status!) ? props.status! : \"info\";\n const headingLevel = RESULT_HEADING_LEVELS.includes(props.headingLevel!) ? props.headingLevel! : 2;\n const announce = RESULT_ANNOUNCEMENTS.includes(props.announce!) ? props.announce! : \"off\";\n const hasTitle = presence.title === true || props.title != null;\n const hasDescription = presence.description === true || props.description != null;\n const titleId = hasTitle ? `${prefix(id!)}-title` : undefined;\n const descriptionId = hasDescription ? `${prefix(id!)}-description` : undefined;\n const ariaLabel = typeof attributes[\"aria-label\"] === \"string\" ? attributes[\"aria-label\"] : undefined;\n const labelledBy = nonblank(props.labelledBy) ?? nonblank(attributes[\"aria-labelledby\"]) ?? (ariaLabel === undefined ? titleId : undefined);\n const describedBy = nonblank(props.describedBy) ?? nonblank(attributes[\"aria-describedby\"]) ?? descriptionId;\n return {\n id: id!, status, title: props.title ?? \"\", description: props.description ?? \"\", headingTag: `h${headingLevel}`, compact: props.compact === true, announce,\n iconMode: props.hideIcon === true ? \"hidden\" : presence.icon === true ? \"custom\" : \"default\", iconName: symbols[status],\n titleFromContent: presence.title === true, descriptionFromContent: presence.description === true,\n titleId, descriptionId, labelledBy, describedBy, ariaLabel,\n visible: { root: true, icon: props.hideIcon !== true, title: hasTitle, description: hasDescription, extra: presence.extra === true, actions: presence.default === true },\n };\n}\n\n/** Named static group or explicitly requested live region; no implicit alert/focus. */\nexport function getResultRootProps(state: ResultState) {\n return {\n \"data-scope\": \"result\" as const, \"data-part\": \"root\" as const, \"data-status\": state.status, \"data-compact\": state.compact ? \"true\" : undefined,\n role: state.announce === \"off\" ? state.labelledBy !== undefined || state.ariaLabel !== undefined ? \"group\" as const : undefined : state.announce,\n \"aria-labelledby\": state.labelledBy, \"aria-describedby\": state.describedBy, \"aria-label\": state.ariaLabel,\n \"aria-live\": state.announce === \"off\" ? undefined : state.announce === \"status\" ? \"polite\" as const : \"assertive\" as const,\n \"aria-atomic\": state.announce === \"off\" ? undefined : true,\n };\n}\n\n/** Stable part selectors and references; absent parts have no dangling IDs. */\nexport function getResultPartProps(state: ResultState, part: ResultPart) {\n return {\n \"data-scope\": \"result\" as const, \"data-part\": part, hidden: !state.visible[part],\n id: part === \"title\" ? state.titleId : part === \"description\" ? state.descriptionId : undefined,\n };\n}\n\nexport interface ResultIcon {\n readonly tag: \"svg\";\n readonly attrs: ReturnType<typeof getIconRootProps>;\n readonly children: readonly IconVectorNode[];\n}\n\n/** Existing canonical system symbol with decorative semantics and scoped vectors. */\nexport function getResultIcon(state: ResultState): ResultIcon {\n const icon = resolveIconState({ id: `${state.id}-result-symbol`, name: state.iconName });\n return { tag: \"svg\", attrs: getIconRootProps(icon), children: getIconVector(icon) };\n}\n"],"mappings":";;AAEA,MAAa,kBAAkB;CAAC;CAAW;CAAS;CAAW;CAAQ;AAAS;AAChF,MAAa,uBAAuB;CAAC;CAAO;CAAU;AAAO;AAC7D,MAAa,wBAAwB;CAAC;CAAG;CAAG;CAAG;CAAG;AAAC;AACnD,MAAa,eAAe;CAAC;CAAQ;CAAQ;CAAS;CAAe;CAAS;AAAS;AA2DvF,MAAM,UAAU;CAAE,SAAS;CAAqB,OAAO;CAAqB,SAAS;CAAkB,MAAM;CAAa,SAAS;AAAO;AAC1I,MAAM,YAAY,UAAuC,OAAO,UAAU,YAAY,MAAM,KAAK,IAAI,MAAM,KAAK,IAAI,KAAA;AACpH,SAAS,OAAO,IAAoB;CAClC,IAAI,SAAS;CACb,KAAK,IAAI,QAAQ,GAAG,QAAQ,GAAG,QAAQ,SAAS,UAAU,GAAG,WAAW,KAAK,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG;CAC3G,OAAO;AACT;;AAGA,SAAgB,mBAAmB,OAAsB,WAA2B,CAAC,GAAG,YA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AGA,SAAgB,mBAAmB,OAAoB;CACrD,OAAO;EACL,cAAc;EAAmB,aAAa;EAAiB,eAAe,MAAM;EAAQ,gBAAgB,MAAM,UAAU,SAAS,KAAA;EACrI,MAAM,MAAM,aAAa,QAAQ,MAAM,eAAe,KAAA,KAAa,MAAM,cAAc,KAAA,IAAY,UAAmB,KAAA,IAAY,MAAM;EACxI,mBAAmB,MAAM;EAAY,oBAAoB,MAAM;EAAa,cAAc,MAAM;EAChG,aAAa,MAAM,aAAa,QAAQ,KAAA,IAAY,MAAM,aAAa,WAAW,WAAoB;EACtG,eAAe,MAAM,aAAa,QAAQ,KAAA,IAAY;CACxD;AACF;;AAGA,SAAgB,mBAAmB,OAAoB,MAAkB;CACvE,OAAO;EACL,cAAc;EAAmB,aAAa;EAAM,QAAQ,CAAC,MAAM,QAAQ;EAC3E,IAAI,SAAS,UAAU,MAAM,UAAU,SAAS,gBAAgB,MAAM,gBAAgB,KAAA;CACxF;AACF;;AASA,SAAgB,cAAc,OAAgC;CAC5D,MAAM,OAAO,iBAAiB;EAAE,IAAI,GAAG,MAAM,GAAG;EAAiB,MAAM,MAAM;CAAS,CAAC;CACvF,OAAO;EAAE,KAAK;EAAO,OAAO,iBAAiB,IAAI;EAAG,UAAU,cAAc,IAAI;CAAE;AACpF"}
@@ -0,0 +1,88 @@
1
+ import { getIconRootProps, type IconName, type IconVectorNode } from "../icon/index.js";
2
+ export declare const RESULT_STATUSES: readonly ["success", "error", "warning", "info", "waiting"];
3
+ export declare const RESULT_ANNOUNCEMENTS: readonly ["off", "status", "alert"];
4
+ export declare const RESULT_HEADING_LEVELS: readonly [2, 3, 4, 5, 6];
5
+ export declare const RESULT_PARTS: readonly ["root", "icon", "title", "description", "extra", "actions"];
6
+ export type ResultStatus = (typeof RESULT_STATUSES)[number];
7
+ export type ResultAnnouncement = (typeof RESULT_ANNOUNCEMENTS)[number];
8
+ export type ResultHeadingLevel = (typeof RESULT_HEADING_LEVELS)[number];
9
+ export type ResultPart = (typeof RESULT_PARTS)[number];
10
+ /** Framework-neutral scalar outcome inputs; rich nodes use explicit presence. */
11
+ export interface QwResultProps {
12
+ /** Stable caller identity, or framework useId fallback. Native SSR requires one. */
13
+ id?: string;
14
+ /** Outcome, default info. Invalid runtime values use info. */
15
+ status?: ResultStatus;
16
+ /** Scalar main text; present rich title content overrides it. */
17
+ title?: string | null;
18
+ /** Supporting text; rich description content overrides it. */
19
+ description?: string | null;
20
+ /** Actual native heading level, default h2. */
21
+ headingLevel?: ResultHeadingLevel;
22
+ /** Compact spacing and symbol geometry for embedded results. */
23
+ compact?: boolean;
24
+ /** Hide default or custom symbol while retaining caller content. */
25
+ hideIcon?: boolean;
26
+ /** Explicit live region; static off is the default regardless of outcome. */
27
+ announce?: ResultAnnouncement;
28
+ /** Explicit external accessible-name references. */
29
+ labelledBy?: string;
30
+ /** Explicit external description references. */
31
+ describedBy?: string;
32
+ }
33
+ export interface ResultPresence {
34
+ readonly icon?: boolean;
35
+ readonly title?: boolean;
36
+ readonly description?: boolean;
37
+ readonly extra?: boolean;
38
+ readonly default?: boolean;
39
+ }
40
+ /** Core-owned outcome, content and ARIA decisions used unchanged by every adapter. */
41
+ export interface ResultState {
42
+ readonly id: string;
43
+ readonly status: ResultStatus;
44
+ readonly title: string;
45
+ readonly description: string;
46
+ readonly headingTag: `h${ResultHeadingLevel}`;
47
+ readonly compact: boolean;
48
+ readonly announce: ResultAnnouncement;
49
+ readonly iconMode: "default" | "custom" | "hidden";
50
+ readonly iconName: IconName;
51
+ readonly titleFromContent: boolean;
52
+ readonly descriptionFromContent: boolean;
53
+ readonly titleId?: string;
54
+ readonly descriptionId?: string;
55
+ readonly labelledBy?: string;
56
+ readonly describedBy?: string;
57
+ readonly ariaLabel?: string;
58
+ readonly visible: Readonly<Record<ResultPart, boolean>>;
59
+ }
60
+ /** Pure render-time resolution; never reads a DOM node or manufactures a request. */
61
+ export declare function resolveResultState(props: QwResultProps, presence?: ResultPresence, fallbackId?: string, attributes?: Readonly<Record<string, unknown>>): ResultState;
62
+ /** Named static group or explicitly requested live region; no implicit alert/focus. */
63
+ export declare function getResultRootProps(state: ResultState): {
64
+ "data-scope": "result";
65
+ "data-part": "root";
66
+ "data-status": "error" | "info" | "success" | "waiting" | "warning";
67
+ "data-compact": string | undefined;
68
+ role: "alert" | "group" | "status" | undefined;
69
+ "aria-labelledby": string | undefined;
70
+ "aria-describedby": string | undefined;
71
+ "aria-label": string | undefined;
72
+ "aria-live": "assertive" | "polite" | undefined;
73
+ "aria-atomic": boolean | undefined;
74
+ };
75
+ /** Stable part selectors and references; absent parts have no dangling IDs. */
76
+ export declare function getResultPartProps(state: ResultState, part: ResultPart): {
77
+ "data-scope": "result";
78
+ "data-part": "actions" | "description" | "extra" | "icon" | "root" | "title";
79
+ hidden: boolean;
80
+ id: string | undefined;
81
+ };
82
+ export interface ResultIcon {
83
+ readonly tag: "svg";
84
+ readonly attrs: ReturnType<typeof getIconRootProps>;
85
+ readonly children: readonly IconVectorNode[];
86
+ }
87
+ /** Existing canonical system symbol with decorative semantics and scoped vectors. */
88
+ export declare function getResultIcon(state: ResultState): ResultIcon;
@@ -0,0 +1 @@
1
+ export * from "./safe-area.js";
@@ -0,0 +1,42 @@
1
+ //#region src/safe-area/safe-area.ts
2
+ /** Beta passive, physical-edge safe-area layout. All rules are shared across adapters. */
3
+ const SAFE_AREA_EDGES = [
4
+ "top",
5
+ "right",
6
+ "bottom",
7
+ "left"
8
+ ];
9
+ const SAFE_AREA_MODES = ["padding", "margin"];
10
+ const SAFE_AREA_MINIMUM_PRESETS = [
11
+ "none",
12
+ "sm",
13
+ "md",
14
+ "lg"
15
+ ];
16
+ function resolveSafeAreaState(props = {}) {
17
+ const edges = Array.isArray(props.edges) && Array.from(props.edges).every((edge) => SAFE_AREA_EDGES.includes(edge)) ? SAFE_AREA_EDGES.filter((edge) => props.edges.includes(edge)) : ["bottom"];
18
+ const value = props.minInset;
19
+ let minimum = "var(--qw-sem-size-safe-area-minimum-none)";
20
+ if (typeof value === "number" && Number.isFinite(value) && value >= 0) minimum = `${value}px`;
21
+ if (typeof value === "string" && value.trim()) minimum = SAFE_AREA_MINIMUM_PRESETS.includes(value) ? `var(--qw-sem-size-safe-area-minimum-${value})` : value;
22
+ return {
23
+ edges,
24
+ mode: SAFE_AREA_MODES.includes(props.mode) ? props.mode : "padding",
25
+ minimum
26
+ };
27
+ }
28
+ function getSafeAreaRootProps(state) {
29
+ return {
30
+ "data-scope": "safe-area",
31
+ "data-part": "root",
32
+ "data-mode": state.mode,
33
+ "data-edges": state.edges.join(" ")
34
+ };
35
+ }
36
+ function getSafeAreaStyle(state) {
37
+ return Object.fromEntries(SAFE_AREA_EDGES.map((edge) => [`--qw-safe-area-${edge}`, state.edges.includes(edge) ? `max(var(--qw-sem-size-safe-area-inset-${edge}), ${state.minimum})` : "0px"]));
38
+ }
39
+ //#endregion
40
+ export { SAFE_AREA_EDGES, SAFE_AREA_MINIMUM_PRESETS, SAFE_AREA_MODES, getSafeAreaRootProps, getSafeAreaStyle, resolveSafeAreaState };
41
+
42
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/safe-area/safe-area.ts"],"sourcesContent":["/** Beta passive, physical-edge safe-area layout. All rules are shared across adapters. */\nexport const SAFE_AREA_EDGES = [\"top\", \"right\", \"bottom\", \"left\"] as const;\nexport const SAFE_AREA_MODES = [\"padding\", \"margin\"] as const;\nexport const SAFE_AREA_MINIMUM_PRESETS = [\"none\", \"sm\", \"md\", \"lg\"] as const;\nexport type SafeAreaEdge = (typeof SAFE_AREA_EDGES)[number];\nexport type SafeAreaMode = (typeof SAFE_AREA_MODES)[number];\nexport interface QwSafeAreaProps {\n /** Protected physical edges, default bottom. An empty list disables all edges. */\n edges?: readonly SafeAreaEdge[];\n /** Apply protection as padding or margin; default padding. Margin follows CSS collapse rules. */\n mode?: SafeAreaMode;\n /** Minimum per selected edge: none/sm/md/lg, nonnegative pixels or CSS length. Default none. */\n minInset?: number | string;\n}\nexport interface ResolvedSafeAreaState { edges: readonly SafeAreaEdge[]; mode: SafeAreaMode; minimum: string }\nexport function resolveSafeAreaState(props: QwSafeAreaProps = {}): ResolvedSafeAreaState {\n const edges = Array.isArray(props.edges) && Array.from(props.edges).every(edge => SAFE_AREA_EDGES.includes(edge))\n ? SAFE_AREA_EDGES.filter(edge => props.edges!.includes(edge)) : [\"bottom\" as const];\n const value = props.minInset;\n let minimum = \"var(--qw-sem-size-safe-area-minimum-none)\";\n if (typeof value === \"number\" && Number.isFinite(value) && value >= 0) minimum = `${value}px`;\n if (typeof value === \"string\" && value.trim()) minimum = SAFE_AREA_MINIMUM_PRESETS.includes(value as never) ? `var(--qw-sem-size-safe-area-minimum-${value})` : value;\n return { edges, mode: SAFE_AREA_MODES.includes(props.mode!) ? props.mode! : \"padding\", minimum };\n}\nexport interface SafeAreaRootProps { \"data-scope\": \"safe-area\"; \"data-part\": \"root\"; \"data-mode\": SafeAreaMode; \"data-edges\": string }\nexport function getSafeAreaRootProps(state: ResolvedSafeAreaState): SafeAreaRootProps {\n return { \"data-scope\": \"safe-area\", \"data-part\": \"root\", \"data-mode\": state.mode, \"data-edges\": state.edges.join(\" \") };\n}\nexport function getSafeAreaStyle(state: ResolvedSafeAreaState): Readonly<Record<string, string>> {\n return Object.fromEntries(SAFE_AREA_EDGES.map(edge => [`--qw-safe-area-${edge}`, state.edges.includes(edge) ? `max(var(--qw-sem-size-safe-area-inset-${edge}), ${state.minimum})` : \"0px\"]));\n}\n"],"mappings":";;AACA,MAAa,kBAAkB;CAAC;CAAO;CAAS;CAAU;AAAM;AAChE,MAAa,kBAAkB,CAAC,WAAW,QAAQ;AACnD,MAAa,4BAA4B;CAAC;CAAQ;CAAM;CAAM;AAAI;AAYlE,SAAgB,qBAAqB,QAAyB,CAAC,GAA0B;CACvF,MAAM,QAAQ,MAAM,QAAQ,MAAM,KAAK,KAAK,MAAM,KAAK,MAAM,KAAK,CAAC,CAAC,OAAM,SAAQ,gBAAgB,SAAS,IAAI,CAAC,IAC5G,gBAAgB,QAAO,SAAQ,MAAM,MAAO,SAAS,IAAI,CAAC,IAAI,CAAC,QAAiB;CACpF,MAAM,QAAQ,MAAM;CACpB,IAAI,UAAU;CACd,IAAI,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,KAAK,SAAS,GAAG,UAAU,GAAG,MAAM;CAC1F,IAAI,OAAO,UAAU,YAAY,MAAM,KAAK,GAAG,UAAU,0BAA0B,SAAS,KAAc,IAAI,uCAAuC,MAAM,KAAK;CAChK,OAAO;EAAE;EAAO,MAAM,gBAAgB,SAAS,MAAM,IAAK,IAAI,MAAM,OAAQ;EAAW;CAAQ;AACjG;AAEA,SAAgB,qBAAqB,OAAiD;CACpF,OAAO;EAAE,cAAc;EAAa,aAAa;EAAQ,aAAa,MAAM;EAAM,cAAc,MAAM,MAAM,KAAK,GAAG;CAAE;AACxH;AACA,SAAgB,iBAAiB,OAAgE;CAC/F,OAAO,OAAO,YAAY,gBAAgB,KAAI,SAAQ,CAAC,kBAAkB,QAAQ,MAAM,MAAM,SAAS,IAAI,IAAI,yCAAyC,KAAK,KAAK,MAAM,QAAQ,KAAK,KAAK,CAAC,CAAC;AAC7L"}