@qw-ui/core 0.3.0-next.8 → 0.3.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 (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":"progress-f3iYEfdA.js","names":[],"sources":["../src/progress/progress.ts"],"sourcesContent":["/** Finite range and accessible progress contract. */\nexport const PROGRESS_TONES = [\"brand\", \"success\", \"danger\"] as const;\nexport type ProgressTone = (typeof PROGRESS_TONES)[number];\nexport interface QwProgressProps {\n /** Accessible name, supplied by the caller. */\n label: string;\n value?: number;\n max?: number;\n indeterminate?: boolean;\n tone?: ProgressTone;\n}\nexport interface ResolvedProgressState {\n label: string;\n value: number;\n max: number;\n percent: number;\n indeterminate: boolean;\n tone: ProgressTone;\n}\nexport interface ProgressRootProps {\n role: \"progressbar\";\n \"aria-label\": string;\n \"aria-valuemin\": 0;\n \"aria-valuemax\": number;\n \"aria-valuenow\"?: number;\n \"data-scope\": \"progress\";\n \"data-part\": \"root\";\n \"data-tone\": ProgressTone;\n \"data-indeterminate\"?: \"true\";\n}\nexport function resolveProgressState(props: QwProgressProps): ResolvedProgressState {\n const max = props.max != null && Number.isFinite(props.max) && props.max > 0 ? props.max : 100;\n const input = props.value ?? 0;\n const value = Number.isFinite(input) ? Math.min(max, Math.max(0, input)) : 0;\n return { label: props.label, max, value, percent: (value / max) * 100,\n indeterminate: props.indeterminate ?? false, tone: props.tone ?? \"brand\" };\n}\nexport function getProgressRootProps(state: ResolvedProgressState): ProgressRootProps {\n return {\n role: \"progressbar\", \"aria-label\": state.label, \"aria-valuemin\": 0, \"aria-valuemax\": state.max,\n ...(!state.indeterminate ? { \"aria-valuenow\": state.value } : {}),\n \"data-scope\": \"progress\", \"data-part\": \"root\", \"data-tone\": state.tone,\n ...(state.indeterminate ? { \"data-indeterminate\": \"true\" as const } : {}),\n };\n}\n"],"mappings":";;AACA,MAAa,iBAAiB;CAAC;CAAS;CAAW;AAAQ;AA6B3D,SAAgB,qBAAqB,OAA+C;CAClF,MAAM,MAAM,MAAM,OAAO,QAAQ,OAAO,SAAS,MAAM,GAAG,KAAK,MAAM,MAAM,IAAI,MAAM,MAAM;CAC3F,MAAM,QAAQ,MAAM,SAAS;CAC7B,MAAM,QAAQ,OAAO,SAAS,KAAK,IAAI,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC,IAAI;CAC3E,OAAO;EAAE,OAAO,MAAM;EAAO;EAAK;EAAO,SAAU,QAAQ,MAAO;EAChE,eAAe,MAAM,iBAAiB;EAAO,MAAM,MAAM,QAAQ;CAAQ;AAC7E;AACA,SAAgB,qBAAqB,OAAiD;CACpF,OAAO;EACL,MAAM;EAAe,cAAc,MAAM;EAAO,iBAAiB;EAAG,iBAAiB,MAAM;EAC3F,GAAI,CAAC,MAAM,gBAAgB,EAAE,iBAAiB,MAAM,MAAM,IAAI,CAAC;EAC/D,cAAc;EAAY,aAAa;EAAQ,aAAa,MAAM;EAClE,GAAI,MAAM,gBAAgB,EAAE,sBAAsB,OAAgB,IAAI,CAAC;CACzE;AACF"}
@@ -0,0 +1 @@
1
+ export * from "./pull-refresh.js";
@@ -0,0 +1,414 @@
1
+ import { t as lockGestureAxis } from "../gesture-_SRHIvBm.js";
2
+ import { createMachine } from "@zag-js/core";
3
+ //#region src/pull-refresh/pull-refresh.ts
4
+ /** Stable DOM parts shared by every adapter. */
5
+ const PULL_REFRESH_PARTS = [
6
+ "root",
7
+ "track",
8
+ "head",
9
+ "status",
10
+ "refresh",
11
+ "content"
12
+ ];
13
+ /** Rendered status vocabulary. pulling = below threshold, loosing = release now to refresh. */
14
+ const PULL_REFRESH_STATUSES = [
15
+ "idle",
16
+ "pulling",
17
+ "loosing",
18
+ "loading",
19
+ "success",
20
+ "error",
21
+ "disabled"
22
+ ];
23
+ const PULL_REFRESH_DEFAULT_HEAD_HEIGHT = 50;
24
+ const PULL_REFRESH_DEFAULT_DAMPING = .5;
25
+ const PULL_REFRESH_DEFAULT_SUCCESS_DURATION = 500;
26
+ const text = (value, fallback) => typeof value === "string" && value.trim() ? value : fallback;
27
+ const positive = (value, fallback) => typeof value === "number" && Number.isFinite(value) && value > 0 ? value : fallback;
28
+ function resolvePullRefreshState(props = {}) {
29
+ const headHeight = positive(props.headHeight, 50);
30
+ const damping = typeof props.damping === "number" && props.damping > 0 && props.damping <= 1 ? props.damping : PULL_REFRESH_DEFAULT_DAMPING;
31
+ const duration = props.successDuration;
32
+ return {
33
+ target: typeof props.target === "string" && props.target.trim() ? props.target : void 0,
34
+ headHeight,
35
+ threshold: positive(props.threshold, headHeight),
36
+ damping,
37
+ successDuration: typeof duration === "number" && Number.isFinite(duration) && duration >= 0 ? duration : 500,
38
+ disabled: !!props.disabled,
39
+ pullingText: text(props.pullingText, "下拉即可刷新"),
40
+ loosingText: text(props.loosingText, "释放即可刷新"),
41
+ loadingText: text(props.loadingText, "刷新中…"),
42
+ successText: text(props.successText, "刷新成功"),
43
+ errorText: text(props.errorText, "刷新失败"),
44
+ refreshText: text(props.refreshText, "刷新"),
45
+ retryText: text(props.retryText, "重试")
46
+ };
47
+ }
48
+ /** Damped displayed distance for a raw downward finger travel. */
49
+ function resolvePullDistance(raw, state) {
50
+ if (!Number.isFinite(raw) || raw <= 0) return 0;
51
+ const damped = raw * state.damping;
52
+ const distance = damped <= state.threshold ? damped : state.threshold + (damped - state.threshold) * .5;
53
+ return Math.min(distance, state.threshold * 2);
54
+ }
55
+ /** One status vocabulary for every adapter. */
56
+ function resolvePullRefreshStatus(state, machineState, distance) {
57
+ if (machineState === "pulling") return distance >= state.threshold ? "loosing" : "pulling";
58
+ if (machineState !== "idle") return machineState;
59
+ return state.disabled ? "disabled" : "idle";
60
+ }
61
+ function createPullRefreshProps(props = {}) {
62
+ if (props.id !== void 0 && (typeof props.id !== "string" || !props.id.trim())) throw new TypeError("PullRefresh requires a nonempty instance id when provided");
63
+ if (props.onRefresh !== void 0 && typeof props.onRefresh !== "function") throw new TypeError("PullRefresh onRefresh must be a function returning a Promise");
64
+ return { ...props };
65
+ }
66
+ const ids = (scope) => ({
67
+ root: `pull-refresh:${scope.id}`,
68
+ status: `pull-refresh:${scope.id}:status`
69
+ });
70
+ const live = (service) => resolvePullRefreshState({
71
+ target: service.prop("target"),
72
+ headHeight: service.prop("headHeight"),
73
+ threshold: service.prop("threshold"),
74
+ damping: service.prop("damping"),
75
+ successDuration: service.prop("successDuration"),
76
+ disabled: service.prop("disabled"),
77
+ pullingText: service.prop("pullingText"),
78
+ loosingText: service.prop("loosingText"),
79
+ loadingText: service.prop("loadingText"),
80
+ successText: service.prop("successText"),
81
+ errorText: service.prop("errorText"),
82
+ refreshText: service.prop("refreshText"),
83
+ retryText: service.prop("retryText")
84
+ });
85
+ const scrollable = (value) => value === "auto" || value === "scroll" || value === "overlay";
86
+ /** Scroll offset of the resolved container: target id, nearest scrollable ancestor, then the viewport. */
87
+ function scrollTopOf(root, target) {
88
+ const doc = root.ownerDocument, win = doc.defaultView;
89
+ if (target) {
90
+ const element = root.getRootNode().getElementById?.(target) ?? doc.getElementById(target);
91
+ if (element) return element.scrollTop;
92
+ }
93
+ for (let node = root.parentElement; node && node !== doc.body && node !== doc.documentElement; node = node.parentElement) if (win && scrollable(win.getComputedStyle(node).overflowY)) return node.scrollTop;
94
+ return win?.scrollY ?? doc.documentElement.scrollTop ?? 0;
95
+ }
96
+ const toIdle = {
97
+ target: "idle",
98
+ actions: ["resetDistance", "bumpGeneration"]
99
+ };
100
+ /** Core owns the gesture, top-of-scroll check, axis lock, damping, single-flight refresh, generation ticket and cleanup. */
101
+ const pullRefreshMachine = createMachine({
102
+ props: ({ props }) => createPullRefreshProps(props),
103
+ initialState: () => "idle",
104
+ context: ({ bindable }) => ({
105
+ distance: bindable(() => ({ defaultValue: 0 })),
106
+ generation: bindable(() => ({ defaultValue: 0 }))
107
+ }),
108
+ watch({ track, prop, send }) {
109
+ track([() => prop("disabled")], () => send({ type: "SETTINGS.CHANGE" }));
110
+ },
111
+ effects: ["trackGestures"],
112
+ states: {
113
+ idle: { on: {
114
+ "PULL.MOVE": {
115
+ guard: "canPull",
116
+ target: "pulling",
117
+ actions: ["setDistance"]
118
+ },
119
+ REFRESH: {
120
+ guard: "canRefresh",
121
+ target: "loading"
122
+ }
123
+ } },
124
+ pulling: { on: {
125
+ "PULL.MOVE": { actions: ["setDistance"] },
126
+ "PULL.END": [{
127
+ guard: "reached",
128
+ target: "loading",
129
+ actions: ["resetDistance"]
130
+ }, {
131
+ target: "idle",
132
+ actions: ["resetDistance"]
133
+ }],
134
+ "PULL.CANCEL": {
135
+ target: "idle",
136
+ actions: ["resetDistance"]
137
+ },
138
+ "SETTINGS.CHANGE": {
139
+ guard: "isDisabled",
140
+ ...toIdle
141
+ }
142
+ } },
143
+ loading: {
144
+ effects: ["runRefresh"],
145
+ on: {
146
+ "REFRESH.DONE": {
147
+ guard: "isCurrent",
148
+ target: "success"
149
+ },
150
+ "REFRESH.FAIL": {
151
+ guard: "isCurrent",
152
+ target: "error",
153
+ actions: ["notifyError"]
154
+ },
155
+ "SETTINGS.CHANGE": {
156
+ guard: "isDisabled",
157
+ ...toIdle
158
+ }
159
+ }
160
+ },
161
+ success: {
162
+ effects: ["successTimer"],
163
+ on: {
164
+ "SUCCESS.DONE": { target: "idle" },
165
+ "SETTINGS.CHANGE": {
166
+ guard: "isDisabled",
167
+ ...toIdle
168
+ }
169
+ }
170
+ },
171
+ error: { on: {
172
+ "PULL.MOVE": {
173
+ guard: "canPull",
174
+ target: "pulling",
175
+ actions: ["setDistance"]
176
+ },
177
+ REFRESH: {
178
+ guard: "canRefresh",
179
+ target: "loading"
180
+ },
181
+ "SETTINGS.CHANGE": {
182
+ guard: "isDisabled",
183
+ ...toIdle
184
+ }
185
+ } }
186
+ },
187
+ implementations: {
188
+ guards: {
189
+ canPull: ({ prop }) => !live({ prop }).disabled,
190
+ canRefresh: ({ prop }) => !live({ prop }).disabled,
191
+ reached: ({ prop, event }) => event.type === "PULL.END" && event.distance >= live({ prop }).threshold,
192
+ isDisabled: ({ prop }) => live({ prop }).disabled,
193
+ isCurrent: ({ context, event }) => (event.type === "REFRESH.DONE" || event.type === "REFRESH.FAIL") && event.generation === context.get("generation")
194
+ },
195
+ actions: {
196
+ setDistance({ event, context }) {
197
+ if (event.type === "PULL.MOVE") context.set("distance", Math.max(0, event.distance));
198
+ },
199
+ resetDistance({ context }) {
200
+ context.set("distance", 0);
201
+ },
202
+ bumpGeneration({ context }) {
203
+ context.set("generation", context.get("generation") + 1);
204
+ },
205
+ notifyError({ event, prop }) {
206
+ if (event.type === "REFRESH.FAIL") prop("onError")?.({ error: event.error });
207
+ }
208
+ },
209
+ effects: {
210
+ runRefresh({ prop, context, send }) {
211
+ const generation = context.get("generation");
212
+ let cancelled = false;
213
+ let result;
214
+ try {
215
+ result = prop("onRefresh")?.();
216
+ } catch (error) {
217
+ result = Promise.reject(error);
218
+ }
219
+ Promise.resolve(result).then(() => {
220
+ if (!cancelled) send({
221
+ type: "REFRESH.DONE",
222
+ generation
223
+ });
224
+ }, (error) => {
225
+ if (!cancelled) send({
226
+ type: "REFRESH.FAIL",
227
+ generation,
228
+ error
229
+ });
230
+ });
231
+ return () => {
232
+ cancelled = true;
233
+ };
234
+ },
235
+ successTimer({ prop, send }) {
236
+ const timer = setTimeout(() => send({ type: "SUCCESS.DONE" }), live({ prop }).successDuration);
237
+ return () => clearTimeout(timer);
238
+ },
239
+ trackGestures({ scope, prop, state, send }) {
240
+ const root = scope.getById(ids(scope).root), win = root?.ownerDocument.defaultView;
241
+ if (!root || !win) return;
242
+ let gesture = null, suppressClick = false;
243
+ const canStart = () => !live({ prop }).disabled && state.matches("idle", "error") && scrollTopOf(root, live({ prop }).target) <= 0;
244
+ const begin = (id, x, y) => {
245
+ gesture = canStart() ? {
246
+ id,
247
+ x,
248
+ y,
249
+ axis: "pending",
250
+ pulling: false,
251
+ distance: 0
252
+ } : null;
253
+ };
254
+ /** Returns true when this move belongs to the pull, so the caller may cancel native scrolling. */
255
+ const move = (x, y) => {
256
+ const current = gesture;
257
+ if (!current) return false;
258
+ const dx = x - current.x, dy = y - current.y;
259
+ if (current.axis === "pending") {
260
+ current.axis = lockGestureAxis(dx, dy, true);
261
+ if (current.axis === "cross" || current.axis === "main" && dy <= 0) {
262
+ gesture = null;
263
+ return false;
264
+ }
265
+ if (current.axis === "pending") return dy > 0 && dy >= Math.abs(dx) && scrollTopOf(root, live({ prop }).target) <= 0;
266
+ }
267
+ if (!current.pulling && scrollTopOf(root, live({ prop }).target) > 0) {
268
+ gesture = null;
269
+ return false;
270
+ }
271
+ current.pulling = true;
272
+ current.distance = resolvePullDistance(dy, live({ prop }));
273
+ send({
274
+ type: "PULL.MOVE",
275
+ distance: current.distance
276
+ });
277
+ return true;
278
+ };
279
+ const end = (cancel) => {
280
+ const done = gesture;
281
+ gesture = null;
282
+ if (!done?.pulling) return;
283
+ suppressClick = true;
284
+ send(cancel ? { type: "PULL.CANCEL" } : {
285
+ type: "PULL.END",
286
+ distance: done.distance
287
+ });
288
+ };
289
+ const point = (event) => event.touches[0] ?? event.changedTouches[0];
290
+ const onTouchStart = (event) => {
291
+ const touch = point(event);
292
+ if (event.touches.length === 1 && touch) begin("touch", touch.clientX, touch.clientY);
293
+ else end(true);
294
+ };
295
+ const onTouchMove = (event) => {
296
+ const touch = point(event);
297
+ if (gesture?.id === "touch" && touch && move(touch.clientX, touch.clientY) && event.cancelable) event.preventDefault();
298
+ };
299
+ const onTouchEnd = () => {
300
+ if (gesture?.id === "touch") end(false);
301
+ };
302
+ const onTouchCancel = () => {
303
+ if (gesture?.id === "touch") end(true);
304
+ };
305
+ const onPointerDown = (event) => {
306
+ if (event.pointerType !== "touch" && event.button === 0) begin(event.pointerId, event.clientX, event.clientY);
307
+ };
308
+ const onPointerMove = (event) => {
309
+ if (gesture?.id !== event.pointerId) return;
310
+ const wasPulling = gesture.pulling;
311
+ if (move(event.clientX, event.clientY)) {
312
+ event.preventDefault();
313
+ if (!wasPulling) try {
314
+ root.setPointerCapture?.(event.pointerId);
315
+ } catch {}
316
+ }
317
+ };
318
+ const onPointerUp = (event) => {
319
+ if (gesture?.id === event.pointerId) end(false);
320
+ };
321
+ const onPointerCancel = (event) => {
322
+ if (gesture?.id === event.pointerId) end(true);
323
+ };
324
+ const onClick = (event) => {
325
+ if (suppressClick) {
326
+ event.preventDefault();
327
+ event.stopPropagation();
328
+ }
329
+ suppressClick = false;
330
+ };
331
+ const passive = { passive: true };
332
+ root.addEventListener("touchstart", onTouchStart, passive);
333
+ root.addEventListener("touchmove", onTouchMove, { passive: false });
334
+ root.addEventListener("touchend", onTouchEnd, passive);
335
+ root.addEventListener("touchcancel", onTouchCancel, passive);
336
+ root.addEventListener("pointerdown", onPointerDown);
337
+ root.addEventListener("pointermove", onPointerMove);
338
+ root.addEventListener("pointerup", onPointerUp);
339
+ root.addEventListener("pointercancel", onPointerCancel);
340
+ root.addEventListener("click", onClick, true);
341
+ return () => {
342
+ gesture = null;
343
+ root.removeEventListener("touchstart", onTouchStart);
344
+ root.removeEventListener("touchmove", onTouchMove);
345
+ root.removeEventListener("touchend", onTouchEnd);
346
+ root.removeEventListener("touchcancel", onTouchCancel);
347
+ root.removeEventListener("pointerdown", onPointerDown);
348
+ root.removeEventListener("pointermove", onPointerMove);
349
+ root.removeEventListener("pointerup", onPointerUp);
350
+ root.removeEventListener("pointercancel", onPointerCancel);
351
+ root.removeEventListener("click", onClick, true);
352
+ };
353
+ }
354
+ }
355
+ }
356
+ });
357
+ function connectPullRefresh(service, normalize) {
358
+ const state = live(service), machineState = service.state.get(), pulled = service.context.get("distance");
359
+ const status = resolvePullRefreshStatus(state, machineState, pulled);
360
+ const distance = machineState === "pulling" ? pulled : machineState === "idle" ? 0 : state.headHeight;
361
+ const statusText = {
362
+ pulling: state.pullingText,
363
+ loosing: state.loosingText,
364
+ loading: state.loadingText,
365
+ success: state.successText,
366
+ error: state.errorText
367
+ }[status] ?? "";
368
+ const id = ids(service.scope), part = (name) => ({
369
+ "data-scope": "pull-refresh",
370
+ "data-part": name,
371
+ "data-status": status
372
+ });
373
+ const refresh = () => service.send({ type: "REFRESH" });
374
+ return {
375
+ status,
376
+ distance,
377
+ statusText,
378
+ refreshText: status === "error" ? state.retryText : state.refreshText,
379
+ refresh,
380
+ getRootProps: () => normalize.element({
381
+ ...part("root"),
382
+ id: id.root,
383
+ "aria-busy": status === "loading" || void 0,
384
+ "data-disabled": state.disabled ? "true" : void 0,
385
+ style: { "--qw-pull-refresh-head-height": `${state.headHeight}px` }
386
+ }),
387
+ getTrackProps: () => normalize.element({
388
+ ...part("track"),
389
+ "data-dragging": machineState === "pulling" ? "true" : void 0,
390
+ style: { "--qw-pull-refresh-offset": `${distance}px` }
391
+ }),
392
+ getHeadProps: () => normalize.element({ ...part("head") }),
393
+ getStatusProps: () => normalize.element({
394
+ ...part("status"),
395
+ id: id.status,
396
+ role: "status",
397
+ "aria-live": "polite"
398
+ }),
399
+ getRefreshProps: () => normalize.button({
400
+ ...part("refresh"),
401
+ type: "button",
402
+ disabled: state.disabled || status === "loading" || void 0,
403
+ "aria-describedby": id.status,
404
+ onClick(event) {
405
+ if (!event.defaultPrevented) refresh();
406
+ }
407
+ }),
408
+ getContentProps: () => normalize.element({ ...part("content") })
409
+ };
410
+ }
411
+ //#endregion
412
+ export { PULL_REFRESH_DEFAULT_DAMPING, PULL_REFRESH_DEFAULT_HEAD_HEIGHT, PULL_REFRESH_DEFAULT_SUCCESS_DURATION, PULL_REFRESH_PARTS, PULL_REFRESH_STATUSES, connectPullRefresh, createPullRefreshProps, pullRefreshMachine, resolvePullDistance, resolvePullRefreshState, resolvePullRefreshStatus };
413
+
414
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/pull-refresh/pull-refresh.ts"],"sourcesContent":["import { createMachine, type Machine, type Service } from \"@zag-js/core\";\nimport type { NormalizeProps, PropTypes } from \"@zag-js/types\";\nimport { lockGestureAxis, type GestureAxis } from \"../swiper/gesture.js\";\n\n/** Stable DOM parts shared by every adapter. */\nexport const PULL_REFRESH_PARTS = [\"root\", \"track\", \"head\", \"status\", \"refresh\", \"content\"] as const;\n/** Rendered status vocabulary. pulling = below threshold, loosing = release now to refresh. */\nexport const PULL_REFRESH_STATUSES = [\"idle\", \"pulling\", \"loosing\", \"loading\", \"success\", \"error\", \"disabled\"] as const;\nexport type PullRefreshStatus = (typeof PULL_REFRESH_STATUSES)[number];\nexport const PULL_REFRESH_DEFAULT_HEAD_HEIGHT = 50;\nexport const PULL_REFRESH_DEFAULT_DAMPING = 0.5;\nexport const PULL_REFRESH_DEFAULT_SUCCESS_DURATION = 500;\n/** Any request library: resolve when fresh data is in place, reject on failure. */\nexport type PullRefreshHandler = () => Promise<void> | void;\nexport interface PullRefreshErrorDetails { error: unknown }\n\nexport interface QwPullRefreshProps {\n /** Page-unique instance identity; adapters generate one when omitted. */\n id?: string;\n /** Called at most once at a time. Results arriving after unmount or disable are ignored. */\n onRefresh?: PullRefreshHandler;\n /** Element id of the scrolling container. Omitted/missing: nearest scrollable ancestor, then the viewport. */\n target?: string;\n /** Head height in CSS px while loading/success/error; default 50. */\n headHeight?: number;\n /** Displayed pull distance (after damping) that arms release-to-refresh; defaults to headHeight. */\n threshold?: number;\n /** Finger-to-content ratio in (0, 1]; default 0.5. Beyond the threshold resistance doubles; capped at 2×threshold. */\n damping?: number;\n /** How long the success text stays before collapsing (ms); default 500. */\n successDuration?: number;\n /** Ignore gestures and the refresh action; an in-flight result is ignored. */\n disabled?: boolean;\n pullingText?: string;\n loosingText?: string;\n loadingText?: string;\n successText?: string;\n errorText?: string;\n /** Keyboard/AT alternative button text; default 刷新. */\n refreshText?: string;\n /** Same button after a failure; default 重试. */\n retryText?: string;\n onError?: (details: PullRefreshErrorDetails) => void;\n}\nexport interface ResolvedPullRefreshState {\n target: string | undefined; headHeight: number; threshold: number; damping: number; successDuration: number; disabled: boolean;\n pullingText: string; loosingText: string; loadingText: string; successText: string; errorText: string; refreshText: string; retryText: string;\n}\nconst text = (value: string | undefined, fallback: string): string => typeof value === \"string\" && value.trim() ? value : fallback;\nconst positive = (value: unknown, fallback: number): number => typeof value === \"number\" && Number.isFinite(value) && value > 0 ? value : fallback;\n\nexport function resolvePullRefreshState(props: QwPullRefreshProps = {}): ResolvedPullRefreshState {\n const headHeight = positive(props.headHeight, PULL_REFRESH_DEFAULT_HEAD_HEIGHT);\n const damping = typeof props.damping === \"number\" && props.damping > 0 && props.damping <= 1 ? props.damping : PULL_REFRESH_DEFAULT_DAMPING;\n const duration = props.successDuration;\n return {\n target: typeof props.target === \"string\" && props.target.trim() ? props.target : undefined,\n headHeight, threshold: positive(props.threshold, headHeight), damping,\n successDuration: typeof duration === \"number\" && Number.isFinite(duration) && duration >= 0 ? duration : PULL_REFRESH_DEFAULT_SUCCESS_DURATION,\n disabled: !!props.disabled,\n pullingText: text(props.pullingText, \"下拉即可刷新\"), loosingText: text(props.loosingText, \"释放即可刷新\"), loadingText: text(props.loadingText, \"刷新中…\"),\n successText: text(props.successText, \"刷新成功\"), errorText: text(props.errorText, \"刷新失败\"),\n refreshText: text(props.refreshText, \"刷新\"), retryText: text(props.retryText, \"重试\"),\n };\n}\n/** Damped displayed distance for a raw downward finger travel. */\nexport function resolvePullDistance(raw: number, state: Pick<ResolvedPullRefreshState, \"threshold\" | \"damping\">): number {\n if (!Number.isFinite(raw) || raw <= 0) return 0;\n const damped = raw * state.damping;\n const distance = damped <= state.threshold ? damped : state.threshold + (damped - state.threshold) * 0.5;\n return Math.min(distance, state.threshold * 2);\n}\ntype MachineState = \"idle\" | \"pulling\" | \"loading\" | \"success\" | \"error\";\n/** One status vocabulary for every adapter. */\nexport function resolvePullRefreshStatus(state: ResolvedPullRefreshState, machineState: MachineState, distance: number): PullRefreshStatus {\n if (machineState === \"pulling\") return distance >= state.threshold ? \"loosing\" : \"pulling\";\n if (machineState !== \"idle\") return machineState;\n return state.disabled ? \"disabled\" : \"idle\";\n}\nexport function createPullRefreshProps(props: QwPullRefreshProps = {}): QwPullRefreshProps {\n if (props.id !== undefined && (typeof props.id !== \"string\" || !props.id.trim())) throw new TypeError(\"PullRefresh requires a nonempty instance id when provided\");\n if (props.onRefresh !== undefined && typeof props.onRefresh !== \"function\") throw new TypeError(\"PullRefresh onRefresh must be a function returning a Promise\");\n return { ...props };\n}\n\nexport interface QwPullRefreshSchema {\n props: QwPullRefreshProps;\n context: { distance: number; generation: number };\n state: MachineState;\n action: \"setDistance\" | \"resetDistance\" | \"notifyError\" | \"bumpGeneration\";\n guard: \"canPull\" | \"canRefresh\" | \"reached\" | \"isDisabled\" | \"isCurrent\";\n effect: \"trackGestures\" | \"runRefresh\" | \"successTimer\";\n event:\n | { type: \"PULL.MOVE\"; distance: number }\n | { type: \"PULL.END\"; distance: number }\n | { type: \"PULL.CANCEL\" }\n | { type: \"REFRESH\" }\n | { type: \"SETTINGS.CHANGE\" }\n | { type: \"SUCCESS.DONE\" }\n | { type: \"REFRESH.DONE\"; generation: number }\n | { type: \"REFRESH.FAIL\"; generation: number; error: unknown };\n}\nexport type QwPullRefreshMachine = Machine<QwPullRefreshSchema>;\nexport type QwPullRefreshService = Service<QwPullRefreshSchema>;\nconst ids = (scope: QwPullRefreshService[\"scope\"]) => ({ root: `pull-refresh:${scope.id}`, status: `pull-refresh:${scope.id}:status` });\nconst live = (service: Pick<QwPullRefreshService, \"prop\">) => resolvePullRefreshState({\n target: service.prop(\"target\"), headHeight: service.prop(\"headHeight\"), threshold: service.prop(\"threshold\"), damping: service.prop(\"damping\"),\n successDuration: service.prop(\"successDuration\"), disabled: service.prop(\"disabled\"),\n pullingText: service.prop(\"pullingText\"), loosingText: service.prop(\"loosingText\"), loadingText: service.prop(\"loadingText\"),\n successText: service.prop(\"successText\"), errorText: service.prop(\"errorText\"), refreshText: service.prop(\"refreshText\"), retryText: service.prop(\"retryText\"),\n});\nconst scrollable = (value: string) => value === \"auto\" || value === \"scroll\" || value === \"overlay\";\n/** Scroll offset of the resolved container: target id, nearest scrollable ancestor, then the viewport. */\nfunction scrollTopOf(root: HTMLElement, target: string | undefined): number {\n const doc = root.ownerDocument, win = doc.defaultView;\n if (target) {\n const owner = root.getRootNode() as Document | ShadowRoot;\n const element = owner.getElementById?.(target) ?? doc.getElementById(target);\n if (element) return element.scrollTop;\n }\n for (let node = root.parentElement; node && node !== doc.body && node !== doc.documentElement; node = node.parentElement) {\n if (win && scrollable(win.getComputedStyle(node).overflowY)) return node.scrollTop;\n }\n return win?.scrollY ?? doc.documentElement.scrollTop ?? 0;\n}\nconst toIdle: { target: \"idle\"; actions: QwPullRefreshSchema[\"action\"][] } = { target: \"idle\", actions: [\"resetDistance\", \"bumpGeneration\"] };\n\n/** Core owns the gesture, top-of-scroll check, axis lock, damping, single-flight refresh, generation ticket and cleanup. */\nexport const pullRefreshMachine: QwPullRefreshMachine = createMachine<QwPullRefreshSchema>({\n props: ({ props }) => createPullRefreshProps(props), initialState: () => \"idle\",\n context: ({ bindable }) => ({ distance: bindable(() => ({ defaultValue: 0 })), generation: bindable(() => ({ defaultValue: 0 })) }),\n watch({ track, prop, send }) { track([() => prop(\"disabled\")], () => send({ type: \"SETTINGS.CHANGE\" })); },\n effects: [\"trackGestures\"],\n states: {\n idle: { on: { \"PULL.MOVE\": { guard: \"canPull\", target: \"pulling\", actions: [\"setDistance\"] }, REFRESH: { guard: \"canRefresh\", target: \"loading\" } } },\n pulling: {\n on: {\n \"PULL.MOVE\": { actions: [\"setDistance\"] },\n \"PULL.END\": [{ guard: \"reached\", target: \"loading\", actions: [\"resetDistance\"] }, { target: \"idle\", actions: [\"resetDistance\"] }],\n \"PULL.CANCEL\": { target: \"idle\", actions: [\"resetDistance\"] },\n \"SETTINGS.CHANGE\": { guard: \"isDisabled\", ...toIdle },\n },\n },\n loading: {\n effects: [\"runRefresh\"],\n on: {\n \"REFRESH.DONE\": { guard: \"isCurrent\", target: \"success\" },\n \"REFRESH.FAIL\": { guard: \"isCurrent\", target: \"error\", actions: [\"notifyError\"] },\n // Disabling abandons the in-flight result; it is never reported.\n \"SETTINGS.CHANGE\": { guard: \"isDisabled\", ...toIdle },\n },\n },\n success: { effects: [\"successTimer\"], on: { \"SUCCESS.DONE\": { target: \"idle\" }, \"SETTINGS.CHANGE\": { guard: \"isDisabled\", ...toIdle } } },\n error: {\n on: {\n \"PULL.MOVE\": { guard: \"canPull\", target: \"pulling\", actions: [\"setDistance\"] },\n REFRESH: { guard: \"canRefresh\", target: \"loading\" },\n \"SETTINGS.CHANGE\": { guard: \"isDisabled\", ...toIdle },\n },\n },\n },\n implementations: {\n guards: {\n canPull: ({ prop }) => !live({ prop }).disabled,\n canRefresh: ({ prop }) => !live({ prop }).disabled,\n reached: ({ prop, event }) => event.type === \"PULL.END\" && event.distance >= live({ prop }).threshold,\n isDisabled: ({ prop }) => live({ prop }).disabled,\n isCurrent: ({ context, event }) => (event.type === \"REFRESH.DONE\" || event.type === \"REFRESH.FAIL\") && event.generation === context.get(\"generation\"),\n },\n actions: {\n setDistance({ event, context }) { if (event.type === \"PULL.MOVE\") context.set(\"distance\", Math.max(0, event.distance)); },\n resetDistance({ context }) { context.set(\"distance\", 0); },\n bumpGeneration({ context }) { context.set(\"generation\", context.get(\"generation\") + 1); },\n notifyError({ event, prop }) { if (event.type === \"REFRESH.FAIL\") prop(\"onError\")?.({ error: event.error }); },\n },\n effects: {\n runRefresh({ prop, context, send }) {\n const generation = context.get(\"generation\");\n let cancelled = false;\n let result: unknown;\n try { result = prop(\"onRefresh\")?.(); } catch (error) { result = Promise.reject(error); }\n Promise.resolve(result).then(\n () => { if (!cancelled) send({ type: \"REFRESH.DONE\", generation }); },\n (error: unknown) => { if (!cancelled) send({ type: \"REFRESH.FAIL\", generation, error }); },\n );\n return () => { cancelled = true; };\n },\n successTimer({ prop, send }) {\n const timer = setTimeout(() => send({ type: \"SUCCESS.DONE\" }), live({ prop }).successDuration);\n return () => clearTimeout(timer);\n },\n trackGestures({ scope, prop, state, send }) {\n const root = scope.getById<HTMLElement>(ids(scope).root), win = root?.ownerDocument.defaultView;\n if (!root || !win) return;\n type Gesture = { id: number | \"touch\"; x: number; y: number; axis: GestureAxis; pulling: boolean; distance: number };\n let gesture: Gesture | null = null, suppressClick = false;\n const canStart = () => !live({ prop }).disabled && state.matches(\"idle\", \"error\") && scrollTopOf(root, live({ prop }).target) <= 0;\n const begin = (id: Gesture[\"id\"], x: number, y: number) => { gesture = canStart() ? { id, x, y, axis: \"pending\", pulling: false, distance: 0 } : null; };\n /** Returns true when this move belongs to the pull, so the caller may cancel native scrolling. */\n const move = (x: number, y: number): boolean => {\n const current = gesture;\n if (!current) return false;\n const dx = x - current.x, dy = y - current.y;\n if (current.axis === \"pending\") {\n current.axis = lockGestureAxis(dx, dy, true);\n // Horizontal intent or an upward drag: hand the gesture back to native scrolling / inner swipers.\n if (current.axis === \"cross\" || (current.axis === \"main\" && dy <= 0)) { gesture = null; return false; }\n if (current.axis === \"pending\") return dy > 0 && dy >= Math.abs(dx) && scrollTopOf(root, live({ prop }).target) <= 0;\n }\n if (!current.pulling && scrollTopOf(root, live({ prop }).target) > 0) { gesture = null; return false; }\n current.pulling = true; current.distance = resolvePullDistance(dy, live({ prop }));\n send({ type: \"PULL.MOVE\", distance: current.distance });\n return true;\n };\n const end = (cancel: boolean) => {\n const done = gesture; gesture = null;\n if (!done?.pulling) return;\n suppressClick = true;\n send(cancel ? { type: \"PULL.CANCEL\" } : { type: \"PULL.END\", distance: done.distance });\n };\n const point = (event: TouchEvent) => event.touches[0] ?? event.changedTouches[0];\n const onTouchStart = (event: TouchEvent) => { const touch = point(event); if (event.touches.length === 1 && touch) begin(\"touch\", touch.clientX, touch.clientY); else end(true); };\n // Non-passive so a real pull can stop the overscroll; native scrolling is never cancelled otherwise.\n const onTouchMove = (event: TouchEvent) => { const touch = point(event); if (gesture?.id === \"touch\" && touch && move(touch.clientX, touch.clientY) && event.cancelable) event.preventDefault(); };\n const onTouchEnd = () => { if (gesture?.id === \"touch\") end(false); };\n const onTouchCancel = () => { if (gesture?.id === \"touch\") end(true); };\n // Mouse/pen use pointer events (touch is handled above so touch-action can stay pan-x pan-y).\n const onPointerDown = (event: PointerEvent) => { if (event.pointerType !== \"touch\" && event.button === 0) begin(event.pointerId, event.clientX, event.clientY); };\n const onPointerMove = (event: PointerEvent) => {\n if (gesture?.id !== event.pointerId) return;\n const wasPulling = gesture.pulling;\n if (move(event.clientX, event.clientY)) { event.preventDefault(); if (!wasPulling) { try { root.setPointerCapture?.(event.pointerId); } catch { /* released */ } } }\n };\n const onPointerUp = (event: PointerEvent) => { if (gesture?.id === event.pointerId) end(false); };\n const onPointerCancel = (event: PointerEvent) => { if (gesture?.id === event.pointerId) end(true); };\n // A pull never activates the content under the finger.\n const onClick = (event: Event) => { if (suppressClick) { event.preventDefault(); event.stopPropagation(); } suppressClick = false; };\n const passive = { passive: true } as const;\n root.addEventListener(\"touchstart\", onTouchStart, passive); root.addEventListener(\"touchmove\", onTouchMove, { passive: false });\n root.addEventListener(\"touchend\", onTouchEnd, passive); root.addEventListener(\"touchcancel\", onTouchCancel, passive);\n root.addEventListener(\"pointerdown\", onPointerDown); root.addEventListener(\"pointermove\", onPointerMove);\n root.addEventListener(\"pointerup\", onPointerUp); root.addEventListener(\"pointercancel\", onPointerCancel);\n root.addEventListener(\"click\", onClick, true);\n return () => {\n gesture = null;\n root.removeEventListener(\"touchstart\", onTouchStart); root.removeEventListener(\"touchmove\", onTouchMove);\n root.removeEventListener(\"touchend\", onTouchEnd); root.removeEventListener(\"touchcancel\", onTouchCancel);\n root.removeEventListener(\"pointerdown\", onPointerDown); root.removeEventListener(\"pointermove\", onPointerMove);\n root.removeEventListener(\"pointerup\", onPointerUp); root.removeEventListener(\"pointercancel\", onPointerCancel);\n root.removeEventListener(\"click\", onClick, true);\n };\n },\n },\n },\n});\n\nexport interface QwPullRefreshApi<T extends PropTypes = PropTypes> {\n status: PullRefreshStatus; distance: number; statusText: string; refreshText: string;\n /** Keyboard/AT and imperative refresh; also retries after a failure. Ignored while loading or disabled. */\n refresh(): void;\n getRootProps(): T[\"element\"];\n getTrackProps(): T[\"element\"];\n getHeadProps(): T[\"element\"];\n getStatusProps(): T[\"element\"];\n getRefreshProps(): T[\"button\"];\n getContentProps(): T[\"element\"];\n}\nexport function connectPullRefresh<T extends PropTypes>(service: QwPullRefreshService, normalize: NormalizeProps<T>): QwPullRefreshApi<T> {\n const state = live(service), machineState = service.state.get(), pulled = service.context.get(\"distance\");\n const status = resolvePullRefreshStatus(state, machineState, pulled);\n const distance = machineState === \"pulling\" ? pulled : machineState === \"idle\" ? 0 : state.headHeight;\n const statusText = ({ pulling: state.pullingText, loosing: state.loosingText, loading: state.loadingText, success: state.successText, error: state.errorText } as Partial<Record<PullRefreshStatus, string>>)[status] ?? \"\";\n const id = ids(service.scope), part = (name: string) => ({ \"data-scope\": \"pull-refresh\", \"data-part\": name, \"data-status\": status });\n const refresh = () => service.send({ type: \"REFRESH\" });\n return {\n status, distance, statusText, refreshText: status === \"error\" ? state.retryText : state.refreshText, refresh,\n getRootProps: () => normalize.element({ ...part(\"root\"), id: id.root, \"aria-busy\": status === \"loading\" || undefined, \"data-disabled\": state.disabled ? \"true\" : undefined,\n style: { \"--qw-pull-refresh-head-height\": `${state.headHeight}px` } }),\n getTrackProps: () => normalize.element({ ...part(\"track\"), \"data-dragging\": machineState === \"pulling\" ? \"true\" : undefined, style: { \"--qw-pull-refresh-offset\": `${distance}px` } }),\n getHeadProps: () => normalize.element({ ...part(\"head\") }),\n getStatusProps: () => normalize.element({ ...part(\"status\"), id: id.status, role: \"status\", \"aria-live\": \"polite\" }),\n getRefreshProps: () => normalize.button({ ...part(\"refresh\"), type: \"button\", disabled: state.disabled || status === \"loading\" || undefined, \"aria-describedby\": id.status,\n onClick(event: { defaultPrevented: boolean }) { if (!event.defaultPrevented) refresh(); } }),\n getContentProps: () => normalize.element({ ...part(\"content\") }),\n };\n}\n"],"mappings":";;;;AAKA,MAAa,qBAAqB;CAAC;CAAQ;CAAS;CAAQ;CAAU;CAAW;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E,qBAAqB,UAAU,QAAQ;GAAE,GAAG,KAAK,OAAO;GAAG,iBAAiB,iBAAiB,YAAY,SAAS,KAAA;GAAW,OAAO,EAAE,4BAA4B,GAAG,SAAS,IAAI;EAAE,CAAC;EACrL,oBAAoB,UAAU,QAAQ,EAAE,GAAG,KAAK,MAAM,EAAE,CAAC;EACzD,sBAAsB,UAAU,QAAQ;GAAE,GAAG,KAAK,QAAQ;GAAG,IAAI,GAAG;GAAQ,MAAM;GAAU,aAAa;EAAS,CAAC;EACnH,uBAAuB,UAAU,OAAO;GAAE,GAAG,KAAK,SAAS;GAAG,MAAM;GAAU,UAAU,MAAM,YAAY,WAAW,aAAa,KAAA;GAAW,oBAAoB,GAAG;GAClK,QAAQ,OAAsC;IAAE,IAAI,CAAC,MAAM,kBAAkB,QAAQ;GAAG;EAAE,CAAC;EAC7F,uBAAuB,UAAU,QAAQ,EAAE,GAAG,KAAK,SAAS,EAAE,CAAC;CACjE;AACF"}
@@ -0,0 +1,118 @@
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 PULL_REFRESH_PARTS: readonly ["root", "track", "head", "status", "refresh", "content"];
5
+ /** Rendered status vocabulary. pulling = below threshold, loosing = release now to refresh. */
6
+ export declare const PULL_REFRESH_STATUSES: readonly ["idle", "pulling", "loosing", "loading", "success", "error", "disabled"];
7
+ export type PullRefreshStatus = (typeof PULL_REFRESH_STATUSES)[number];
8
+ export declare const PULL_REFRESH_DEFAULT_HEAD_HEIGHT = 50;
9
+ export declare const PULL_REFRESH_DEFAULT_DAMPING = 0.5;
10
+ export declare const PULL_REFRESH_DEFAULT_SUCCESS_DURATION = 500;
11
+ /** Any request library: resolve when fresh data is in place, reject on failure. */
12
+ export type PullRefreshHandler = () => Promise<void> | void;
13
+ export interface PullRefreshErrorDetails {
14
+ error: unknown;
15
+ }
16
+ export interface QwPullRefreshProps {
17
+ /** Page-unique instance identity; adapters generate one when omitted. */
18
+ id?: string;
19
+ /** Called at most once at a time. Results arriving after unmount or disable are ignored. */
20
+ onRefresh?: PullRefreshHandler;
21
+ /** Element id of the scrolling container. Omitted/missing: nearest scrollable ancestor, then the viewport. */
22
+ target?: string;
23
+ /** Head height in CSS px while loading/success/error; default 50. */
24
+ headHeight?: number;
25
+ /** Displayed pull distance (after damping) that arms release-to-refresh; defaults to headHeight. */
26
+ threshold?: number;
27
+ /** Finger-to-content ratio in (0, 1]; default 0.5. Beyond the threshold resistance doubles; capped at 2×threshold. */
28
+ damping?: number;
29
+ /** How long the success text stays before collapsing (ms); default 500. */
30
+ successDuration?: number;
31
+ /** Ignore gestures and the refresh action; an in-flight result is ignored. */
32
+ disabled?: boolean;
33
+ pullingText?: string;
34
+ loosingText?: string;
35
+ loadingText?: string;
36
+ successText?: string;
37
+ errorText?: string;
38
+ /** Keyboard/AT alternative button text; default 刷新. */
39
+ refreshText?: string;
40
+ /** Same button after a failure; default 重试. */
41
+ retryText?: string;
42
+ onError?: (details: PullRefreshErrorDetails) => void;
43
+ }
44
+ export interface ResolvedPullRefreshState {
45
+ target: string | undefined;
46
+ headHeight: number;
47
+ threshold: number;
48
+ damping: number;
49
+ successDuration: number;
50
+ disabled: boolean;
51
+ pullingText: string;
52
+ loosingText: string;
53
+ loadingText: string;
54
+ successText: string;
55
+ errorText: string;
56
+ refreshText: string;
57
+ retryText: string;
58
+ }
59
+ export declare function resolvePullRefreshState(props?: QwPullRefreshProps): ResolvedPullRefreshState;
60
+ /** Damped displayed distance for a raw downward finger travel. */
61
+ export declare function resolvePullDistance(raw: number, state: Pick<ResolvedPullRefreshState, "threshold" | "damping">): number;
62
+ type MachineState = "idle" | "pulling" | "loading" | "success" | "error";
63
+ /** One status vocabulary for every adapter. */
64
+ export declare function resolvePullRefreshStatus(state: ResolvedPullRefreshState, machineState: MachineState, distance: number): PullRefreshStatus;
65
+ export declare function createPullRefreshProps(props?: QwPullRefreshProps): QwPullRefreshProps;
66
+ export interface QwPullRefreshSchema {
67
+ props: QwPullRefreshProps;
68
+ context: {
69
+ distance: number;
70
+ generation: number;
71
+ };
72
+ state: MachineState;
73
+ action: "setDistance" | "resetDistance" | "notifyError" | "bumpGeneration";
74
+ guard: "canPull" | "canRefresh" | "reached" | "isDisabled" | "isCurrent";
75
+ effect: "trackGestures" | "runRefresh" | "successTimer";
76
+ event: {
77
+ type: "PULL.MOVE";
78
+ distance: number;
79
+ } | {
80
+ type: "PULL.END";
81
+ distance: number;
82
+ } | {
83
+ type: "PULL.CANCEL";
84
+ } | {
85
+ type: "REFRESH";
86
+ } | {
87
+ type: "SETTINGS.CHANGE";
88
+ } | {
89
+ type: "SUCCESS.DONE";
90
+ } | {
91
+ type: "REFRESH.DONE";
92
+ generation: number;
93
+ } | {
94
+ type: "REFRESH.FAIL";
95
+ generation: number;
96
+ error: unknown;
97
+ };
98
+ }
99
+ export type QwPullRefreshMachine = Machine<QwPullRefreshSchema>;
100
+ export type QwPullRefreshService = Service<QwPullRefreshSchema>;
101
+ /** Core owns the gesture, top-of-scroll check, axis lock, damping, single-flight refresh, generation ticket and cleanup. */
102
+ export declare const pullRefreshMachine: QwPullRefreshMachine;
103
+ export interface QwPullRefreshApi<T extends PropTypes = PropTypes> {
104
+ status: PullRefreshStatus;
105
+ distance: number;
106
+ statusText: string;
107
+ refreshText: string;
108
+ /** Keyboard/AT and imperative refresh; also retries after a failure. Ignored while loading or disabled. */
109
+ refresh(): void;
110
+ getRootProps(): T["element"];
111
+ getTrackProps(): T["element"];
112
+ getHeadProps(): T["element"];
113
+ getStatusProps(): T["element"];
114
+ getRefreshProps(): T["button"];
115
+ getContentProps(): T["element"];
116
+ }
117
+ export declare function connectPullRefresh<T extends PropTypes>(service: QwPullRefreshService, normalize: NormalizeProps<T>): QwPullRefreshApi<T>;
118
+ export {};
@@ -0,0 +1,3 @@
1
+ export { radioGroupMachine, createRadioGroupProps, connect } from "./radio-group.js";
2
+ export type { QwRadioGroupProps, QwRadioGroupSchema, QwRadioGroupMachine, QwRadioGroupService, QwRadioGroupApi, QwRadioGroupItemProps } from "./radio-group.js";
3
+ export type { QwSelectionItem } from "../selection.js";
@@ -0,0 +1,2 @@
1
+ import { n as createRadioGroupProps, r as radioGroupMachine, t as connect } from "../radio-group-BOIMuqnS.js";
2
+ export { connect, createRadioGroupProps, radioGroupMachine };