@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,78 @@
1
+ import type { NormalizeProps, PropTypes } from "@zag-js/types";
2
+ import type { IconState } from "../icon/index.js";
3
+ import { type ChoiceGroupItemState, type ChoiceGroupMachine, type ChoiceGroupSchema, type ChoiceGroupService, type ChoiceGroupValueChangeDetails } from "../selector/choice-group.js";
4
+ /** Stable DOM parts shared by every adapter. */
5
+ export declare const CHECK_LIST_PARTS: readonly ["root", "label", "description", "list", "item", "input", "content", "title", "item-description", "extra", "check"];
6
+ export type CheckListPart = (typeof CHECK_LIST_PARTS)[number];
7
+ /** One list row. `label` is the accessible row name; long descriptions wrap. */
8
+ export interface QwCheckListItem {
9
+ value: string;
10
+ label: string;
11
+ description?: string;
12
+ /** Trailing supporting text (price, ETA…), read after the description. */
13
+ extra?: string;
14
+ disabled?: boolean;
15
+ /** Row stays focusable and submitted but cannot change. */
16
+ readOnly?: boolean;
17
+ }
18
+ export type CheckListValueChangeDetails = ChoiceGroupValueChangeDetails<QwCheckListItem>;
19
+ export interface QwCheckListProps {
20
+ id?: string;
21
+ /** Required nonempty group name rendered as the fieldset legend. */
22
+ label: string;
23
+ hideLabel?: boolean;
24
+ description?: string;
25
+ describedBy?: string;
26
+ items: QwCheckListItem[];
27
+ /** Multiple checkboxes instead of single radios. Defaults false. */
28
+ multiple?: boolean;
29
+ value?: string[];
30
+ defaultValue?: string[];
31
+ /** Native validation; in single mode it also blocks clearing the selected row. */
32
+ required?: boolean;
33
+ min?: number;
34
+ max?: number;
35
+ disabled?: boolean;
36
+ readOnly?: boolean;
37
+ invalid?: boolean;
38
+ name?: string;
39
+ form?: string;
40
+ dir?: string;
41
+ loop?: boolean;
42
+ onValueChange?: (details: CheckListValueChangeDetails) => void;
43
+ }
44
+ export type QwCheckListSchema = ChoiceGroupSchema;
45
+ export type QwCheckListMachine = ChoiceGroupMachine;
46
+ export type QwCheckListService = ChoiceGroupService;
47
+ export type QwCheckListItemState = ChoiceGroupItemState;
48
+ export interface QwCheckListItemProps {
49
+ value: string;
50
+ }
51
+ export declare function normalizeCheckListItems(items: readonly QwCheckListItem[]): QwCheckListItem[];
52
+ export declare function normalizeCheckListValue(value?: readonly string[], multiple?: boolean): string[];
53
+ export declare function createCheckListProps(props: QwCheckListProps): QwCheckListSchema["props"];
54
+ export declare const checkListMachine: QwCheckListMachine;
55
+ export interface QwCheckListApi<T extends PropTypes = PropTypes> {
56
+ value: string[];
57
+ items: QwCheckListItem[];
58
+ label: string;
59
+ description: string;
60
+ setValue(value: string[]): void;
61
+ toggleValue(value: string): void;
62
+ clearValue(): void;
63
+ getRootProps(): T["element"];
64
+ getLabelProps(): T["element"];
65
+ getDescriptionProps(): T["element"];
66
+ getListProps(): T["element"];
67
+ getItemState(item: QwCheckListItemProps): QwCheckListItemState;
68
+ getItemProps(item: QwCheckListItemProps): T["label"];
69
+ getInputProps(item: QwCheckListItemProps): T["input"];
70
+ getContentProps(item: QwCheckListItemProps): T["element"];
71
+ getTitleProps(item: QwCheckListItemProps): T["element"];
72
+ getItemDescriptionProps(item: QwCheckListItemProps): T["element"];
73
+ getExtraProps(item: QwCheckListItemProps): T["element"];
74
+ getCheckProps(item: QwCheckListItemProps): T["element"];
75
+ getCheckIconState(item: QwCheckListItemProps): IconState;
76
+ }
77
+ /** Mechanical list-row part mapping over the shared selection kernel. */
78
+ export declare function connectCheckList<T extends PropTypes>(service: QwCheckListService, normalize: NormalizeProps<T>): QwCheckListApi<T>;
@@ -0,0 +1,2 @@
1
+ export { CHECK_LIST_PARTS, normalizeCheckListItems, normalizeCheckListValue, createCheckListProps, checkListMachine, connectCheckList } from "./check-list.js";
2
+ export type { CheckListPart, QwCheckListItem, CheckListValueChangeDetails, QwCheckListProps, QwCheckListSchema, QwCheckListMachine, QwCheckListService, QwCheckListItemState, QwCheckListItemProps, QwCheckListApi } from "./check-list.js";
@@ -0,0 +1,2 @@
1
+ import { a as normalizeCheckListItems, i as createCheckListProps, n as checkListMachine, o as normalizeCheckListValue, r as connectCheckList, t as CHECK_LIST_PARTS } from "../check-list-BvZHQt5w.js";
2
+ export { CHECK_LIST_PARTS, checkListMachine, connectCheckList, createCheckListProps, normalizeCheckListItems, normalizeCheckListValue };
@@ -0,0 +1,60 @@
1
+ import { a as normalizeChoiceValue, i as normalizeChoiceItems, n as createChoiceGroupMachine, r as createChoiceGroupProps, t as connectChoiceGroup } from "./choice-group-C4c9m0qe.js";
2
+ //#region src/check-list/check-list.ts
3
+ /** Stable DOM parts shared by every adapter. */
4
+ const CHECK_LIST_PARTS = [
5
+ "root",
6
+ "label",
7
+ "description",
8
+ "list",
9
+ "item",
10
+ "input",
11
+ "content",
12
+ "title",
13
+ "item-description",
14
+ "extra",
15
+ "check"
16
+ ];
17
+ function normalizeCheckListItems(items) {
18
+ return normalizeChoiceItems(items, "CheckList");
19
+ }
20
+ function normalizeCheckListValue(value = [], multiple = false) {
21
+ return normalizeChoiceValue(value, multiple);
22
+ }
23
+ function createCheckListProps(props) {
24
+ return createChoiceGroupProps({
25
+ ...props,
26
+ items: props.items ?? [],
27
+ onValueChange: props.onValueChange
28
+ }, "CheckList");
29
+ }
30
+ const checkListMachine = createChoiceGroupMachine("check-list");
31
+ /** Mechanical list-row part mapping over the shared selection kernel. */
32
+ function connectCheckList(service, normalize) {
33
+ const api = connectChoiceGroup("check-list", service, normalize);
34
+ return {
35
+ value: api.value,
36
+ items: api.items,
37
+ label: api.label,
38
+ description: api.description,
39
+ setValue: api.setValue,
40
+ toggleValue: api.toggleValue,
41
+ clearValue: api.clearValue,
42
+ getRootProps: () => api.getRootProps(),
43
+ getLabelProps: api.getLabelProps,
44
+ getDescriptionProps: api.getDescriptionProps,
45
+ getListProps: () => api.getGroupProps("list"),
46
+ getItemState: api.getItemState,
47
+ getItemProps: (item) => api.getItemProps(item, "item"),
48
+ getInputProps: api.getInputProps,
49
+ getContentProps: (item) => api.getItemPartProps(item, "content"),
50
+ getTitleProps: (item) => api.getTextProps(item, "title"),
51
+ getItemDescriptionProps: (item) => api.getItemDescriptionProps(item, "item-description"),
52
+ getExtraProps: (item) => api.getExtraProps(item, "extra"),
53
+ getCheckProps: (item) => api.getCheckProps(item, "check"),
54
+ getCheckIconState: api.getCheckIconState
55
+ };
56
+ }
57
+ //#endregion
58
+ export { normalizeCheckListItems as a, createCheckListProps as i, checkListMachine as n, normalizeCheckListValue as o, connectCheckList as r, CHECK_LIST_PARTS as t };
59
+
60
+ //# sourceMappingURL=check-list-BvZHQt5w.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-list-BvZHQt5w.js","names":[],"sources":["../src/check-list/check-list.ts"],"sourcesContent":["import type { NormalizeProps, PropTypes } from \"@zag-js/types\";\nimport type { IconState } from \"../icon/index.js\";\nimport { connectChoiceGroup, createChoiceGroupMachine, createChoiceGroupProps, normalizeChoiceItems, normalizeChoiceValue, type ChoiceGroupItemState, type ChoiceGroupMachine, type ChoiceGroupSchema, type ChoiceGroupService, type ChoiceGroupValueChangeDetails } from \"../selector/choice-group.js\";\n\n/** Stable DOM parts shared by every adapter. */\nexport const CHECK_LIST_PARTS = [\"root\", \"label\", \"description\", \"list\", \"item\", \"input\", \"content\", \"title\", \"item-description\", \"extra\", \"check\"] as const;\nexport type CheckListPart = (typeof CHECK_LIST_PARTS)[number];\n/** One list row. `label` is the accessible row name; long descriptions wrap. */\nexport interface QwCheckListItem {\n value: string;\n label: string;\n description?: string;\n /** Trailing supporting text (price, ETA…), read after the description. */\n extra?: string;\n disabled?: boolean;\n /** Row stays focusable and submitted but cannot change. */\n readOnly?: boolean;\n}\nexport type CheckListValueChangeDetails = ChoiceGroupValueChangeDetails<QwCheckListItem>;\nexport interface QwCheckListProps {\n id?: string;\n /** Required nonempty group name rendered as the fieldset legend. */\n label: string;\n hideLabel?: boolean;\n description?: string;\n describedBy?: string;\n items: QwCheckListItem[];\n /** Multiple checkboxes instead of single radios. Defaults false. */\n multiple?: boolean;\n value?: string[];\n defaultValue?: string[];\n /** Native validation; in single mode it also blocks clearing the selected row. */\n required?: boolean;\n min?: number;\n max?: number;\n disabled?: boolean;\n readOnly?: boolean;\n invalid?: boolean;\n name?: string;\n form?: string;\n dir?: string;\n loop?: boolean;\n onValueChange?: (details: CheckListValueChangeDetails) => void;\n}\nexport type QwCheckListSchema = ChoiceGroupSchema;\nexport type QwCheckListMachine = ChoiceGroupMachine;\nexport type QwCheckListService = ChoiceGroupService;\nexport type QwCheckListItemState = ChoiceGroupItemState;\nexport interface QwCheckListItemProps { value: string }\n\nexport function normalizeCheckListItems(items: readonly QwCheckListItem[]): QwCheckListItem[] { return normalizeChoiceItems(items, \"CheckList\"); }\nexport function normalizeCheckListValue(value: readonly string[] = [], multiple = false): string[] { return normalizeChoiceValue(value, multiple); }\nexport function createCheckListProps(props: QwCheckListProps): QwCheckListSchema[\"props\"] {\n return createChoiceGroupProps({ ...props, items: props.items ?? [], onValueChange: props.onValueChange as QwCheckListSchema[\"props\"][\"onValueChange\"] }, \"CheckList\");\n}\nexport const checkListMachine: QwCheckListMachine = createChoiceGroupMachine(\"check-list\");\n\nexport interface QwCheckListApi<T extends PropTypes = PropTypes> {\n value: string[];\n items: QwCheckListItem[];\n label: string;\n description: string;\n setValue(value: string[]): void;\n toggleValue(value: string): void;\n clearValue(): void;\n getRootProps(): T[\"element\"];\n getLabelProps(): T[\"element\"];\n getDescriptionProps(): T[\"element\"];\n getListProps(): T[\"element\"];\n getItemState(item: QwCheckListItemProps): QwCheckListItemState;\n getItemProps(item: QwCheckListItemProps): T[\"label\"];\n getInputProps(item: QwCheckListItemProps): T[\"input\"];\n getContentProps(item: QwCheckListItemProps): T[\"element\"];\n getTitleProps(item: QwCheckListItemProps): T[\"element\"];\n getItemDescriptionProps(item: QwCheckListItemProps): T[\"element\"];\n getExtraProps(item: QwCheckListItemProps): T[\"element\"];\n getCheckProps(item: QwCheckListItemProps): T[\"element\"];\n getCheckIconState(item: QwCheckListItemProps): IconState;\n}\n/** Mechanical list-row part mapping over the shared selection kernel. */\nexport function connectCheckList<T extends PropTypes>(service: QwCheckListService, normalize: NormalizeProps<T>): QwCheckListApi<T> {\n const api = connectChoiceGroup(\"check-list\", service, normalize);\n return {\n value: api.value, items: api.items as QwCheckListItem[], label: api.label, description: api.description,\n setValue: api.setValue, toggleValue: api.toggleValue, clearValue: api.clearValue,\n getRootProps: () => api.getRootProps(), getLabelProps: api.getLabelProps, getDescriptionProps: api.getDescriptionProps,\n getListProps: () => api.getGroupProps(\"list\"),\n getItemState: api.getItemState,\n getItemProps: (item) => api.getItemProps(item, \"item\"),\n getInputProps: api.getInputProps,\n getContentProps: (item) => api.getItemPartProps(item, \"content\"),\n getTitleProps: (item) => api.getTextProps(item, \"title\"),\n getItemDescriptionProps: (item) => api.getItemDescriptionProps(item, \"item-description\"),\n getExtraProps: (item) => api.getExtraProps(item, \"extra\"),\n getCheckProps: (item) => api.getCheckProps(item, \"check\"),\n getCheckIconState: api.getCheckIconState,\n };\n}\n"],"mappings":";;;AAKA,MAAa,mBAAmB;CAAC;CAAQ;CAAS;CAAe;CAAQ;CAAQ;CAAS;CAAW;CAAS;CAAoB;CAAS;AAAO;AA6ClJ,SAAgB,wBAAwB,OAAsD;CAAE,OAAO,qBAAqB,OAAO,WAAW;AAAG;AACjJ,SAAgB,wBAAwB,QAA2B,CAAC,GAAG,WAAW,OAAiB;CAAE,OAAO,qBAAqB,OAAO,QAAQ;AAAG;AACnJ,SAAgB,qBAAqB,OAAqD;CACxF,OAAO,uBAAuB;EAAE,GAAG;EAAO,OAAO,MAAM,SAAS,CAAC;EAAG,eAAe,MAAM;CAA6D,GAAG,WAAW;AACtK;AACA,MAAa,mBAAuC,yBAAyB,YAAY;;AAyBzF,SAAgB,iBAAsC,SAA6B,WAAiD;CAClI,MAAM,MAAM,mBAAmB,cAAc,SAAS,SAAS;CAC/D,OAAO;EACL,OAAO,IAAI;EAAO,OAAO,IAAI;EAA4B,OAAO,IAAI;EAAO,aAAa,IAAI;EAC5F,UAAU,IAAI;EAAU,aAAa,IAAI;EAAa,YAAY,IAAI;EACtE,oBAAoB,IAAI,aAAa;EAAG,eAAe,IAAI;EAAe,qBAAqB,IAAI;EACnG,oBAAoB,IAAI,cAAc,MAAM;EAC5C,cAAc,IAAI;EAClB,eAAe,SAAS,IAAI,aAAa,MAAM,MAAM;EACrD,eAAe,IAAI;EACnB,kBAAkB,SAAS,IAAI,iBAAiB,MAAM,SAAS;EAC/D,gBAAgB,SAAS,IAAI,aAAa,MAAM,OAAO;EACvD,0BAA0B,SAAS,IAAI,wBAAwB,MAAM,kBAAkB;EACvF,gBAAgB,SAAS,IAAI,cAAc,MAAM,OAAO;EACxD,gBAAgB,SAAS,IAAI,cAAc,MAAM,OAAO;EACxD,mBAAmB,IAAI;CACzB;AACF"}
@@ -0,0 +1,59 @@
1
+ import { connect as zagConnect, type CheckedState, type Machine as ZagMachine } from "@zag-js/checkbox";
2
+ import type { Machine, Service } from "@zag-js/core";
3
+ import type { NormalizeProps, PropTypes } from "@zag-js/types";
4
+ export type CheckboxCheckedState = CheckedState;
5
+ export interface QwCheckboxProps {
6
+ /** Stable instance id; frameworks generate an SSR-safe id when omitted. */
7
+ id?: string;
8
+ /** Accessible text label. Keep links outside the checkbox label. */
9
+ label: string;
10
+ /** Optional supporting text linked through aria-describedby. */
11
+ description?: string;
12
+ /** External Field help/error references, merged with the control-owned description. */
13
+ describedBy?: string;
14
+ /** Controlled state; rejected updates restore the native input. */
15
+ checked?: CheckboxCheckedState;
16
+ /** Uncontrolled initial value and reset target; defaults to false. */
17
+ defaultChecked?: CheckboxCheckedState;
18
+ /** Prevent activation and omit the field from native submission. */
19
+ disabled?: boolean;
20
+ /** Prevent activation while retaining focus and submission. */
21
+ readOnly?: boolean;
22
+ /** Require a checked value through native form validation. */
23
+ required?: boolean;
24
+ /** Expose invalid ARIA and visual state; application supplies error text. */
25
+ invalid?: boolean;
26
+ /** Native form field name. Unnamed inputs submit no value. */
27
+ name?: string;
28
+ /** Native submitted value; defaults to on. Mixed state submits nothing. */
29
+ value?: string;
30
+ /** Associate the input with a form id outside its ancestor tree. */
31
+ form?: string;
32
+ /** Logical text and layout direction. */
33
+ dir?: "ltr" | "rtl";
34
+ /** Update request, including reset to the declared default. */
35
+ onCheckedChange?: (details: {
36
+ checked: CheckboxCheckedState;
37
+ }) => void;
38
+ }
39
+ type ZagSchema = ZagMachine extends Machine<infer S> ? S : never;
40
+ export interface QwCheckboxSchema extends ZagSchema {
41
+ props: ZagSchema["props"] & {
42
+ label?: string;
43
+ description?: string;
44
+ describedBy?: string;
45
+ };
46
+ }
47
+ export type QwCheckboxMachine = Machine<QwCheckboxSchema>;
48
+ export type QwCheckboxService = Service<QwCheckboxSchema>;
49
+ export declare function createCheckboxProps(props: QwCheckboxProps): Partial<QwCheckboxSchema["props"]>;
50
+ /** Upstream state/press/focus behavior; native form lifecycle is shared in Core. */
51
+ export declare const checkboxMachine: QwCheckboxMachine;
52
+ export interface QwCheckboxApi<T extends PropTypes = PropTypes> extends ReturnType<typeof zagConnect<T>> {
53
+ label: string;
54
+ description: string;
55
+ indicatorText: string;
56
+ getDescriptionProps(): T["element"];
57
+ }
58
+ export declare function connect<T extends PropTypes>(service: QwCheckboxService, normalize: NormalizeProps<T>): QwCheckboxApi<T>;
59
+ export {};
@@ -0,0 +1,2 @@
1
+ export { checkboxMachine, createCheckboxProps, connect } from "./checkbox.js";
2
+ export type { CheckboxCheckedState, QwCheckboxProps, QwCheckboxSchema, QwCheckboxMachine, QwCheckboxService, QwCheckboxApi } from "./checkbox.js";
@@ -0,0 +1,2 @@
1
+ import { n as connect, r as createCheckboxProps, t as checkboxMachine } from "../checkbox-BlndJrz5.js";
2
+ export { checkboxMachine, connect, createCheckboxProps };
@@ -0,0 +1,127 @@
1
+ import { t as mergeDescriptionIds } from "./aria-description-CimD2M_C.js";
2
+ import { n as trackSelectionForm, t as syncSelectionInputs } from "./selection-form-BOM_odUk.js";
3
+ import { dataAttr } from "@zag-js/dom-query";
4
+ import { connect, machine } from "@zag-js/checkbox";
5
+ //#region src/checkbox/checkbox.ts
6
+ function createCheckboxProps(props) {
7
+ return {
8
+ ...props,
9
+ defaultChecked: props.defaultChecked ?? false,
10
+ value: props.value ?? "on"
11
+ };
12
+ }
13
+ const base = machine;
14
+ const inputId = (scope) => scope.ids?.hiddenInput ?? `checkbox:${scope.id}:input`;
15
+ const rootId = (scope) => scope.ids?.root ?? `checkbox:${scope.id}`;
16
+ function sync(params) {
17
+ const checked = params.context.get("checked");
18
+ syncSelectionInputs(params.scope, [{
19
+ id: inputId(params.scope),
20
+ checked: checked === true,
21
+ indeterminate: checked === "indeterminate"
22
+ }]);
23
+ }
24
+ /** Upstream state/press/focus behavior; native form lifecycle is shared in Core. */
25
+ const checkboxMachine = {
26
+ ...base,
27
+ implementations: {
28
+ ...base.implementations,
29
+ effects: {
30
+ ...base.implementations?.effects,
31
+ trackFormControlState(params) {
32
+ return trackSelectionForm({
33
+ scope: params.scope,
34
+ rootId: rootId(params.scope),
35
+ form: () => params.prop("form"),
36
+ getState: () => [{
37
+ id: inputId(params.scope),
38
+ checked: params.context.get("checked") === true,
39
+ indeterminate: params.context.get("checked") === "indeterminate"
40
+ }],
41
+ onReset: () => params.context.set("checked", params.prop("defaultChecked") ?? false),
42
+ onDisabledChange: (ids) => params.context.set("fieldsetDisabled", ids.includes(inputId(params.scope)))
43
+ }).stop;
44
+ }
45
+ },
46
+ actions: {
47
+ ...base.implementations?.actions,
48
+ syncInputElement: sync,
49
+ setChecked(params) {
50
+ if (!params.event.isTrusted || !params.computed("disabled") && !params.prop("readOnly")) params.context.set("checked", params.event.checked);
51
+ queueMicrotask(() => sync(params));
52
+ },
53
+ toggleChecked(params) {
54
+ params.context.set("checked", params.context.get("checked") !== true);
55
+ queueMicrotask(() => sync(params));
56
+ }
57
+ }
58
+ }
59
+ };
60
+ function connect$1(service, normalize) {
61
+ const api = connect(service, normalize);
62
+ const disabled = service.computed("disabled");
63
+ const descriptionId = `checkbox:${service.scope.id}:description`;
64
+ const data = { "data-disabled": dataAttr(disabled) };
65
+ return {
66
+ ...api,
67
+ disabled,
68
+ label: service.prop("label") ?? "",
69
+ description: service.prop("description") ?? "",
70
+ indicatorText: api.indeterminate ? "−" : "✓",
71
+ getRootProps: () => ({
72
+ ...api.getRootProps(),
73
+ ...normalize.label(data)
74
+ }),
75
+ getLabelProps: () => ({
76
+ ...api.getLabelProps(),
77
+ ...normalize.element(data)
78
+ }),
79
+ getControlProps: () => ({
80
+ ...api.getControlProps(),
81
+ ...normalize.element(data)
82
+ }),
83
+ getIndicatorProps: () => ({
84
+ ...api.getIndicatorProps(),
85
+ ...normalize.element({
86
+ "aria-hidden": true,
87
+ ...data
88
+ })
89
+ }),
90
+ getDescriptionProps: () => normalize.element({
91
+ id: descriptionId,
92
+ "data-scope": "checkbox",
93
+ "data-part": "description",
94
+ ...data
95
+ }),
96
+ getHiddenInputProps() {
97
+ const input = { ...api.getHiddenInputProps() };
98
+ delete input.defaultChecked;
99
+ return {
100
+ ...input,
101
+ ...normalize.input({
102
+ checked: api.checked,
103
+ disabled: !!service.prop("disabled"),
104
+ readOnly: !!service.prop("readOnly"),
105
+ "aria-checked": api.indeterminate ? "mixed" : api.checked,
106
+ "aria-describedby": mergeDescriptionIds(service.prop("description") ? descriptionId : void 0, service.prop("describedBy")),
107
+ "data-scope": "checkbox",
108
+ "data-part": "input",
109
+ onChange() {},
110
+ onClick(event) {
111
+ if (disabled || service.prop("readOnly")) event.preventDefault();
112
+ else service.send({
113
+ type: "CHECKED.SET",
114
+ checked: event.currentTarget.checked,
115
+ isTrusted: true
116
+ });
117
+ queueMicrotask(() => sync(service));
118
+ }
119
+ })
120
+ };
121
+ }
122
+ };
123
+ }
124
+ //#endregion
125
+ export { connect$1 as n, createCheckboxProps as r, checkboxMachine as t };
126
+
127
+ //# sourceMappingURL=checkbox-BlndJrz5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkbox-BlndJrz5.js","names":["zagMachine","connect","zagConnect"],"sources":["../src/checkbox/checkbox.ts"],"sourcesContent":["import { mergeDescriptionIds } from \"../aria-description.js\";\nimport { machine as zagMachine, connect as zagConnect, type CheckedState, type Machine as ZagMachine } from \"@zag-js/checkbox\";\nimport type { Machine, Params, Service } from \"@zag-js/core\";\nimport { dataAttr } from \"@zag-js/dom-query\";\nimport type { NormalizeProps, PropTypes } from \"@zag-js/types\";\nimport { syncSelectionInputs, trackSelectionForm } from \"../selection-form.js\";\n\nexport type CheckboxCheckedState = CheckedState;\nexport interface QwCheckboxProps {\n /** Stable instance id; frameworks generate an SSR-safe id when omitted. */\n id?: string;\n /** Accessible text label. Keep links outside the checkbox label. */\n label: string;\n /** Optional supporting text linked through aria-describedby. */\n description?: string;\n /** External Field help/error references, merged with the control-owned description. */\n describedBy?: string;\n /** Controlled state; rejected updates restore the native input. */\n checked?: CheckboxCheckedState;\n /** Uncontrolled initial value and reset target; defaults to false. */\n defaultChecked?: CheckboxCheckedState;\n /** Prevent activation and omit the field from native submission. */\n disabled?: boolean;\n /** Prevent activation while retaining focus and submission. */\n readOnly?: boolean;\n /** Require a checked value through native form validation. */\n required?: boolean;\n /** Expose invalid ARIA and visual state; application supplies error text. */\n invalid?: boolean;\n /** Native form field name. Unnamed inputs submit no value. */\n name?: string;\n /** Native submitted value; defaults to on. Mixed state submits nothing. */\n value?: string;\n /** Associate the input with a form id outside its ancestor tree. */\n form?: string;\n /** Logical text and layout direction. */\n dir?: \"ltr\" | \"rtl\";\n /** Update request, including reset to the declared default. */\n onCheckedChange?: (details: { checked: CheckboxCheckedState }) => void;\n}\ntype ZagSchema = ZagMachine extends Machine<infer S> ? S : never;\nexport interface QwCheckboxSchema extends ZagSchema {\n props: ZagSchema[\"props\"] & { label?: string; description?: string; describedBy?: string };\n}\nexport type QwCheckboxMachine = Machine<QwCheckboxSchema>;\nexport type QwCheckboxService = Service<QwCheckboxSchema>;\n\nexport function createCheckboxProps(props: QwCheckboxProps): Partial<QwCheckboxSchema[\"props\"]> {\n return { ...props, defaultChecked: props.defaultChecked ?? false, value: props.value ?? \"on\" };\n}\nconst base = zagMachine as QwCheckboxMachine;\nconst inputId = (scope: QwCheckboxService[\"scope\"]) => scope.ids?.hiddenInput ?? `checkbox:${scope.id}:input`;\nconst rootId = (scope: QwCheckboxService[\"scope\"]) => scope.ids?.root ?? `checkbox:${scope.id}`;\nfunction sync(params: Pick<Params<QwCheckboxSchema>, \"scope\" | \"context\">) {\n const checked = params.context.get(\"checked\");\n syncSelectionInputs(params.scope, [{ id: inputId(params.scope), checked: checked === true, indeterminate: checked === \"indeterminate\" }]);\n}\n/** Upstream state/press/focus behavior; native form lifecycle is shared in Core. */\nexport const checkboxMachine: QwCheckboxMachine = {\n ...base,\n implementations: {\n ...base.implementations,\n effects: {\n ...base.implementations?.effects,\n trackFormControlState(params) {\n const tracker = trackSelectionForm({\n scope: params.scope, rootId: rootId(params.scope), form: () => params.prop(\"form\"),\n getState: () => [{ id: inputId(params.scope), checked: params.context.get(\"checked\") === true, indeterminate: params.context.get(\"checked\") === \"indeterminate\" }],\n onReset: () => params.context.set(\"checked\", params.prop(\"defaultChecked\") ?? false),\n onDisabledChange: (ids) => params.context.set(\"fieldsetDisabled\", ids.includes(inputId(params.scope))),\n });\n return tracker.stop;\n },\n },\n actions: {\n ...base.implementations?.actions,\n syncInputElement: sync,\n setChecked(params) {\n if (!params.event.isTrusted || (!params.computed(\"disabled\") && !params.prop(\"readOnly\"))) params.context.set(\"checked\", params.event.checked);\n queueMicrotask(() => sync(params));\n },\n toggleChecked(params) {\n params.context.set(\"checked\", params.context.get(\"checked\") !== true);\n queueMicrotask(() => sync(params));\n },\n },\n },\n};\nexport interface QwCheckboxApi<T extends PropTypes = PropTypes> extends ReturnType<typeof zagConnect<T>> {\n label: string;\n description: string;\n indicatorText: string;\n getDescriptionProps(): T[\"element\"];\n}\nexport function connect<T extends PropTypes>(service: QwCheckboxService, normalize: NormalizeProps<T>): QwCheckboxApi<T> {\n const api = zagConnect(service, normalize);\n const disabled = service.computed(\"disabled\");\n const descriptionId = `checkbox:${service.scope.id}:description`;\n const data = { \"data-disabled\": dataAttr(disabled) };\n return {\n ...api, disabled, label: service.prop(\"label\") ?? \"\", description: service.prop(\"description\") ?? \"\",\n indicatorText: api.indeterminate ? \"−\" : \"✓\",\n getRootProps: () => ({ ...api.getRootProps(), ...normalize.label(data) }),\n getLabelProps: () => ({ ...api.getLabelProps(), ...normalize.element(data) }),\n getControlProps: () => ({ ...api.getControlProps(), ...normalize.element(data) }),\n getIndicatorProps: () => ({ ...api.getIndicatorProps(), ...normalize.element({ \"aria-hidden\": true, ...data }) }),\n getDescriptionProps: () => normalize.element({ id: descriptionId, \"data-scope\": \"checkbox\", \"data-part\": \"description\", ...data }),\n getHiddenInputProps() {\n const input = { ...api.getHiddenInputProps() };\n delete input.defaultChecked;\n return { ...input, ...normalize.input({\n checked: api.checked, disabled: !!service.prop(\"disabled\"), readOnly: !!service.prop(\"readOnly\"),\n \"aria-checked\": api.indeterminate ? \"mixed\" : api.checked,\n \"aria-describedby\": mergeDescriptionIds(service.prop(\"description\") ? descriptionId : undefined, service.prop(\"describedBy\")),\n \"data-scope\": \"checkbox\", \"data-part\": \"input\",\n // Click is reliable even when React's change tracker rejects a prior change.\n onChange() {},\n onClick(event) {\n if (disabled || service.prop(\"readOnly\")) event.preventDefault();\n else service.send({ type: \"CHECKED.SET\", checked: event.currentTarget.checked, isTrusted: true });\n queueMicrotask(() => sync(service));\n },\n }) };\n },\n };\n}\n"],"mappings":"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"}
@@ -0,0 +1,86 @@
1
+ import { type Machine, type Service } from "@zag-js/core";
2
+ import type { NormalizeProps, PropTypes } from "@zag-js/types";
3
+ import { type QwSelectionItem } from "../selection.js";
4
+ export interface QwCheckboxGroupProps {
5
+ /** Stable instance id; adapters supply an SSR-safe id when omitted. */
6
+ id?: string;
7
+ /** Accessible group name rendered as a native fieldset legend. */
8
+ label: string;
9
+ /** Optional group supporting text linked through aria-describedby. */
10
+ description?: string;
11
+ /** Ordered options with unique non-empty values and accessible text labels. */
12
+ items: QwSelectionItem[];
13
+ /** Controlled ordered values; duplicates are removed, unknown values retained. */
14
+ value?: string[];
15
+ /** Uncontrolled initial values and the requested target on form reset. */
16
+ defaultValue?: string[];
17
+ /** Minimum selected count for user removals; defaults to zero. */
18
+ min?: number;
19
+ /** Maximum selected count for user additions; defaults to unlimited. */
20
+ max?: number;
21
+ /** Disable all options and exclude them from native submission. */
22
+ disabled?: boolean;
23
+ /** Prevent user changes while retaining focus and submitted values. */
24
+ readOnly?: boolean;
25
+ /** Require at least one enabled, rendered option through native validation. */
26
+ required?: boolean;
27
+ /** Expose invalid group and input semantics; caller supplies error text. */
28
+ invalid?: boolean;
29
+ /** Native field name; selected enabled options submit repeated name/value pairs. */
30
+ name?: string;
31
+ /** Form id for inputs associated with an external form. */
32
+ form?: string;
33
+ /** Visual layout direction; native Tab order remains the option order. */
34
+ orientation?: "vertical" | "horizontal";
35
+ /** Text and layout direction. */
36
+ dir?: "ltr" | "rtl";
37
+ /** One update request for each accepted value change, including form reset. */
38
+ onValueChange?: (details: {
39
+ value: string[];
40
+ }) => void;
41
+ }
42
+ export interface QwCheckboxGroupSchema {
43
+ props: QwCheckboxGroupProps & {
44
+ defaultValue: string[];
45
+ orientation: "vertical" | "horizontal";
46
+ };
47
+ context: {
48
+ value: string[];
49
+ disabledIds: string[];
50
+ };
51
+ state: "ready";
52
+ action: "setValue" | "toggleValue" | "syncInputs";
53
+ effect: "trackForm";
54
+ event: {
55
+ type: "VALUE.SET";
56
+ value: string[];
57
+ } | {
58
+ type: "VALUE.TOGGLE";
59
+ value: string;
60
+ };
61
+ }
62
+ export type QwCheckboxGroupMachine = Machine<QwCheckboxGroupSchema>;
63
+ export type QwCheckboxGroupService = Service<QwCheckboxGroupSchema>;
64
+ export interface QwCheckboxGroupItemProps {
65
+ value: string;
66
+ }
67
+ export declare function createCheckboxGroupProps(props: QwCheckboxGroupProps): Partial<QwCheckboxGroupSchema["props"]>;
68
+ /** Zag owns the bindable lifecycle; shared Core rules own all selection behavior. */
69
+ export declare const checkboxGroupMachine: QwCheckboxGroupMachine;
70
+ export interface QwCheckboxGroupApi<T extends PropTypes = PropTypes> {
71
+ value: string[];
72
+ items: QwSelectionItem[];
73
+ label: string;
74
+ description: string;
75
+ setValue(value: string[]): void;
76
+ toggleValue(value: string): void;
77
+ getRootProps(): T["element"];
78
+ getLabelProps(): T["element"];
79
+ getDescriptionProps(): T["element"];
80
+ getItemProps(item: QwCheckboxGroupItemProps): T["label"];
81
+ getInputProps(item: QwCheckboxGroupItemProps): T["input"];
82
+ getControlProps(item: QwCheckboxGroupItemProps): T["element"];
83
+ getTextProps(item: QwCheckboxGroupItemProps): T["element"];
84
+ getItemDescriptionProps(item: QwCheckboxGroupItemProps): T["element"];
85
+ }
86
+ export declare function connect<T extends PropTypes>(service: QwCheckboxGroupService, normalize: NormalizeProps<T>): QwCheckboxGroupApi<T>;
@@ -0,0 +1,3 @@
1
+ export { checkboxGroupMachine, createCheckboxGroupProps, connect } from "./checkbox-group.js";
2
+ export type { QwCheckboxGroupProps, QwCheckboxGroupSchema, QwCheckboxGroupMachine, QwCheckboxGroupService, QwCheckboxGroupApi, QwCheckboxGroupItemProps } from "./checkbox-group.js";
3
+ export type { QwSelectionItem } from "../selection.js";
@@ -0,0 +1,2 @@
1
+ import { n as connect, r as createCheckboxGroupProps, t as checkboxGroupMachine } from "../checkbox-group-gGfsTv-e.js";
2
+ export { checkboxGroupMachine, connect, createCheckboxGroupProps };