@astryx-vue/core 0.33.2 → 0.33.3

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 (310) hide show
  1. package/dist/AlertDialog/index.js +1 -1
  2. package/dist/{AlertDialog-BwW3jdTg.js → AlertDialog-BwH9WU-t.js} +8 -8
  3. package/dist/AppShell/index.js +1 -1
  4. package/dist/{AppShell-BURF50V8.js → AppShell-BwzRYOky.js} +5 -5
  5. package/dist/Avatar/index.js +1 -1
  6. package/dist/{Avatar-CcmhCa5q.js → Avatar-C6E6TYbe.js} +1 -1
  7. package/dist/AvatarGroup/index.d.ts +1 -1
  8. package/dist/AvatarGroup/index.js +1 -1
  9. package/dist/{AvatarGroup-DJKoExQk.js → AvatarGroup-C0V--ipx.js} +1 -1
  10. package/dist/Banner/index.d.ts +1 -1
  11. package/dist/Banner/index.js +1 -1
  12. package/dist/{Banner-DSSXXFU9.js → Banner-Ds5KIeES.js} +1 -1
  13. package/dist/BottomSheet/index.d.ts +1 -1
  14. package/dist/BottomSheet/index.js +2 -2
  15. package/dist/{BottomSheet-KUGb-GPw.js → BottomSheet-BmmGemH5.js} +1 -1
  16. package/dist/{BottomSheet-Jq7g0EWd.js → BottomSheet-DKEUVLe5.js} +9 -9
  17. package/dist/Breadcrumbs/index.js +2 -2
  18. package/dist/{Breadcrumbs-BEx7_LpB.js → Breadcrumbs-DWAYp-JJ.js} +1 -1
  19. package/dist/Button/index.d.ts +1 -1
  20. package/dist/Button/index.js +1 -1
  21. package/dist/{Button-BlWhnkeM.js → Button-X-Q_ghg8.js} +4 -4
  22. package/dist/ButtonGroup/index.d.ts +1 -1
  23. package/dist/ButtonGroup/index.js +1 -1
  24. package/dist/{ButtonGroup-D3pGXH3t.js → ButtonGroup-DsYdUmF1.js} +2 -2
  25. package/dist/Calendar/index.d.ts +1 -1
  26. package/dist/Carousel/index.d.ts +1 -1
  27. package/dist/Carousel/index.js +1 -1
  28. package/dist/{Carousel-XHo3AGQj.js → Carousel-D8uVV1J_.js} +1 -1
  29. package/dist/Chat/index.d.ts +1 -1
  30. package/dist/Chat/index.js +1 -1
  31. package/dist/{Chat-B0c_CxBk.js → Chat-Dy-icS2C.js} +5 -5
  32. package/dist/CheckboxInput/index.d.ts +1 -1
  33. package/dist/CheckboxInput/index.js +1 -1
  34. package/dist/{CheckboxInput-DCeCsNvg.js → CheckboxInput-CiUtutIS.js} +3 -3
  35. package/dist/CheckboxList/index.d.ts +1 -1
  36. package/dist/CheckboxList/index.js +1 -1
  37. package/dist/{CheckboxListItem-CGC_EBYs.js → CheckboxListItem-B6sV7-Og.js} +5 -5
  38. package/dist/ClickableCard/index.d.ts +1 -1
  39. package/dist/ClickableCard/index.js +1 -1
  40. package/dist/{ClickableCard-aU0QED8P.js → ClickableCard-DDk_RtHd.js} +1 -1
  41. package/dist/Code/index.js +1 -1
  42. package/dist/{CodeBlock-ClZvd61o.js → CodeBlock-r2-MlpBB.js} +1 -1
  43. package/dist/Collapsible/index.d.ts +1 -1
  44. package/dist/Collapsible/index.js +1 -1
  45. package/dist/{Collapsible-BAup__Sy.js → Collapsible-0XI3tKgj.js} +3 -3
  46. package/dist/CommandPalette/index.d.ts +1 -1
  47. package/dist/CommandPalette/index.js +1 -1
  48. package/dist/{CommandPalette-CvalZZHH.js → CommandPalette-BYR0Lxxd.js} +2 -2
  49. package/dist/ComplexSelector/index.d.ts +1 -1
  50. package/dist/ComplexSelector/index.js +1 -1
  51. package/dist/{ComplexSelector-DIwWcWwi.js → ComplexSelector-CIXrqCoX.js} +2 -2
  52. package/dist/ContextMenu/index.d.ts +1 -1
  53. package/dist/ContextMenu/index.js +2 -2
  54. package/dist/{ContextMenu-BnX93m0D.js → ContextMenu-CfVyaP5v.js} +6 -6
  55. package/dist/DateInput/index.d.ts +1 -1
  56. package/dist/DateInput/index.js +1 -1
  57. package/dist/{DateInput-BFjeik3X.js → DateInput-DRzZ8dY7.js} +4 -4
  58. package/dist/DateRangeInput/index.d.ts +1 -1
  59. package/dist/DateRangeInput/index.js +1 -1
  60. package/dist/{DateRangeInput-Cnrp5SDW.js → DateRangeInput-DL2aOQXJ.js} +3 -3
  61. package/dist/DateTimeInput/index.d.ts +1 -1
  62. package/dist/DateTimeInput/index.js +1 -1
  63. package/dist/{DateTimeInput-Zsf86rSO.js → DateTimeInput-KWkpamG4.js} +5 -5
  64. package/dist/Dialog/index.js +3 -3
  65. package/dist/{Dialog-Bl5CCsoX.js → Dialog-BM5VEE8z.js} +2 -2
  66. package/dist/{Dialog-DIWIrzgk.js → Dialog-CJzq1gms.js} +1 -1
  67. package/dist/{DialogHeader-DbWkeIrf.js → DialogHeader-Do4EOX2f.js} +2 -2
  68. package/dist/Divider/index.d.ts +1 -1
  69. package/dist/Drawer/index.d.ts +1 -1
  70. package/dist/Drawer/index.js +1 -1
  71. package/dist/{Drawer-MdC2BxbG.js → Drawer-DuQ620WO.js} +2 -2
  72. package/dist/DropdownMenu/index.js +2 -2
  73. package/dist/{DropdownMenu-4o8qS78m.js → DropdownMenu-CbENfJOq.js} +9 -9
  74. package/dist/EmptyState/index.js +1 -1
  75. package/dist/{EmptyState-CeZXvaPU.js → EmptyState-BAP8BpDj.js} +2 -2
  76. package/dist/Field/index.js +3 -3
  77. package/dist/{Field-CrTrfcXB.js → Field-B1fsgAqp.js} +1 -1
  78. package/dist/{FieldInfoTip-C3Ztw-wI.js → FieldInfoTip-CntJCcnM.js} +1 -1
  79. package/dist/{FieldLabel-CFE2WC_i.js → FieldLabel-D56uJrRE.js} +1 -1
  80. package/dist/FileInput/index.js +1 -1
  81. package/dist/{FileInput-BhO1SCw-.js → FileInput-EjlruVVX.js} +3 -3
  82. package/dist/Heading/index.d.ts +1 -1
  83. package/dist/Heading/index.js +1 -1
  84. package/dist/{Heading-AZCa8gid.js → Heading-D94VFJtm.js} +1 -1
  85. package/dist/HoverCard/index.d.ts +1 -1
  86. package/dist/HoverCard/index.js +1 -1
  87. package/dist/{HoverCard-C4VR_GZ0.js → HoverCard-rwpyd6nt.js} +4 -4
  88. package/dist/IconButton/index.js +1 -1
  89. package/dist/{IconButton-CqWEkha9.js → IconButton-CXg9qTRM.js} +1 -1
  90. package/dist/InfoTip/index.d.ts +1 -1
  91. package/dist/InfoTip/index.js +1 -1
  92. package/dist/{InfoTip-Dps1Aaem.js → InfoTip-jFet-iAx.js} +2 -2
  93. package/dist/{InputClearButton-Xjvkkq7B.js → InputClearButton-DBTrsrSH.js} +1 -1
  94. package/dist/InputGroup/index.d.ts +1 -1
  95. package/dist/InputGroup/index.js +1 -1
  96. package/dist/{InputGroup-gYIGs7VH.js → InputGroup-D7UBxktR.js} +1 -1
  97. package/dist/{Item-FxMSEuU3.js → Item-DbalBZXc.js} +2 -2
  98. package/dist/{LayerContentBoundary-C7VZOgMs.js → LayerContentBoundary-CTjEpdM4.js} +1 -1
  99. package/dist/Layout/index.js +2 -2
  100. package/dist/{Layout-D6UhyoVb.js → Layout-BEJwZon4.js} +1 -1
  101. package/dist/{LayoutPanel-DfS5TvSP.js → LayoutPanel-BgJdL0KV.js} +1 -1
  102. package/dist/Lightbox/index.js +1 -1
  103. package/dist/{Lightbox-76vHqGA0.js → Lightbox-DJXB22k0.js} +1 -1
  104. package/dist/Link/index.d.ts +1 -1
  105. package/dist/Link/index.js +1 -1
  106. package/dist/{Link-QPBGLcTk.js → Link-eXwB0Hjg.js} +2 -2
  107. package/dist/List/index.d.ts +1 -1
  108. package/dist/List/index.js +2 -2
  109. package/dist/{ListItem-Ss6Kw90l.js → ListItem-C5B8uYyn.js} +4 -4
  110. package/dist/Markdown/index.js +1 -1
  111. package/dist/{Markdown-Cz6wbx9z.js → Markdown-COub2yng.js} +3 -3
  112. package/dist/MobileNav/index.js +1 -1
  113. package/dist/{MobileNavToggle-CCJBX2fq.js → MobileNavToggle-DI5yDKfp.js} +2 -2
  114. package/dist/MoreMenu/index.d.ts +1 -1
  115. package/dist/MoreMenu/index.js +1 -1
  116. package/dist/{MoreMenu-OOQAeJT9.js → MoreMenu-C7gie2PE.js} +8 -8
  117. package/dist/MultiSelector/index.d.ts +1 -1
  118. package/dist/MultiSelector/index.js +1 -1
  119. package/dist/{MultiSelector-9HGDsMQE.js → MultiSelector-CnGUU8P3.js} +6 -6
  120. package/dist/{NavDisclosure-BTeZLyLq.js → NavDisclosure-CSnUZY3k.js} +1 -1
  121. package/dist/{NavHeadingSurface-DPmolgVb.js → NavHeadingSurface-C3fTf5--.js} +1 -1
  122. package/dist/NavItem/index.d.ts +1 -1
  123. package/dist/NavItem/index.js +1 -1
  124. package/dist/{NavItem-BL3g0YUf.js → NavItem-Cciu9aok.js} +1 -1
  125. package/dist/NavMenu/index.js +3 -3
  126. package/dist/{NavMenu-DcTh1DCM.js → NavMenu--iyy_m84.js} +2 -2
  127. package/dist/{NavMenuItem-Dmsno5s3.js → NavMenuItem-BmAm-Cv8.js} +3 -3
  128. package/dist/NumberInput/index.d.ts +1 -1
  129. package/dist/NumberInput/index.js +1 -1
  130. package/dist/{NumberInput-DWYCcrUw.js → NumberInput-CD9sHbON.js} +3 -3
  131. package/dist/Outline/index.js +1 -1
  132. package/dist/{Outline-DGtPcD0U.js → Outline-vieAJS2J.js} +3 -3
  133. package/dist/OverflowList/index.d.ts +1 -1
  134. package/dist/OverflowList/index.js +1 -1
  135. package/dist/{OverflowList-EIr4jQjY.js → OverflowList-YLVHypB3.js} +2 -2
  136. package/dist/Pagination/index.d.ts +1 -1
  137. package/dist/Pagination/index.js +1 -1
  138. package/dist/{Pagination-Ch7-xIFe.js → Pagination-Bnkp4oAA.js} +2 -2
  139. package/dist/PanGestureRecognizer-CzIWpazn.js +681 -0
  140. package/dist/Popover/index.d.ts +1 -1
  141. package/dist/Popover/index.js +1 -1
  142. package/dist/{Popover-LSIKv1zS.js → Popover-CYJ1z_7L.js} +9 -9
  143. package/dist/PowerSearch/index.d.ts +1 -1
  144. package/dist/PowerSearch/index.js +1 -1
  145. package/dist/{PowerSearch-Cjkv0qON.js → PowerSearch-DEpXEmgs.js} +26 -26
  146. package/dist/PressTracker-L5-Ark_9.js +190 -0
  147. package/dist/ProgressBar/index.d.ts +1 -1
  148. package/dist/ProgressBar/index.js +1 -1
  149. package/dist/{ProgressBar-nPERcjvJ.js → ProgressBar-ChgsiVRR.js} +3 -3
  150. package/dist/Radio/index.d.ts +1 -1
  151. package/dist/Radio/index.js +1 -1
  152. package/dist/{RadioGroup-BWFVn7Gd.js → RadioGroup-BdO-xZv0.js} +4 -4
  153. package/dist/RadioList/index.d.ts +1 -1
  154. package/dist/RadioList/index.js +1 -1
  155. package/dist/{RadioListItem-D1rnSZeL.js → RadioListItem-DzGPuWTt.js} +1 -1
  156. package/dist/Resizable/index.js +1 -1
  157. package/dist/{ResizeHandle-DyjQfxxG.js → ResizeHandle-Dcel1HkU.js} +2 -2
  158. package/dist/ScrollableArea/index.d.ts +1 -1
  159. package/dist/SegmentedControl/index.js +1 -1
  160. package/dist/{SegmentedControl-CkR8ur3h.js → SegmentedControl-BURyE9XU.js} +2 -2
  161. package/dist/SelectableCard/index.d.ts +1 -1
  162. package/dist/SelectableCard/index.js +1 -1
  163. package/dist/{SelectableCard-uDblNb5T.js → SelectableCard-BZTF6qw-.js} +1 -1
  164. package/dist/Selector/index.d.ts +1 -1
  165. package/dist/Selector/index.js +1 -1
  166. package/dist/{Selector-BiLcyM3Y.js → Selector-SkwSbf4j.js} +4 -4
  167. package/dist/SideNav/index.d.ts +1 -1
  168. package/dist/SideNav/index.js +2 -2
  169. package/dist/{SideNav-d0A9mlEW.js → SideNav-BxJfJU95.js} +9 -9
  170. package/dist/Slider/index.js +1 -1
  171. package/dist/Slider-ORmi7QJ7.js +1785 -0
  172. package/dist/Stack/index.d.ts +1 -1
  173. package/dist/StatusDot/index.js +1 -1
  174. package/dist/{StatusDot-D3z-WEGn.js → StatusDot-D7nVuPg7.js} +1 -1
  175. package/dist/Stepper/index.d.ts +1 -1
  176. package/dist/Stepper/index.js +1 -1
  177. package/dist/{Stepper-CePOs80C.js → Stepper-C4-wtxn4.js} +1 -1
  178. package/dist/Switch/index.d.ts +1 -1
  179. package/dist/Switch/index.js +1 -1
  180. package/dist/Switch-Cw1UKVjQ.js +1468 -0
  181. package/dist/TabList/index.d.ts +1 -1
  182. package/dist/TabList/index.js +1 -1
  183. package/dist/{TabList-CthDI2i1.js → TabList-DNDe2ipJ.js} +3 -3
  184. package/dist/Table/index.d.ts +1 -1
  185. package/dist/Table/index.js +1 -1
  186. package/dist/{Table-egoY0slV.js → Table-CqppyRk8.js} +12 -12
  187. package/dist/Text/index.d.ts +1 -1
  188. package/dist/Text/index.js +1 -1
  189. package/dist/{Text-CGb1rxyK.js → Text-kwsIut3C.js} +1 -1
  190. package/dist/TextArea/index.d.ts +1 -1
  191. package/dist/TextArea/index.js +1 -1
  192. package/dist/{TextArea-B3WlT4sr.js → TextArea-I3ghDb9r.js} +4 -4
  193. package/dist/TextInput/index.d.ts +1 -1
  194. package/dist/TextInput/index.js +1 -1
  195. package/dist/{TextInput-C4CqgE0E.js → TextInput-Xz_ibpOl.js} +4 -4
  196. package/dist/Thumbnail/index.js +1 -1
  197. package/dist/{Thumbnail-6YWZ9a2A.js → Thumbnail-bS62Tr_f.js} +3 -3
  198. package/dist/{TimeField-CvBKO_Ew.js → TimeField-Bsb8n22d.js} +3 -3
  199. package/dist/TimeInput/index.d.ts +1 -1
  200. package/dist/TimeInput/index.js +1 -1
  201. package/dist/{TimeInput-Cl9HIZrP.js → TimeInput-D40_6GrX.js} +2 -2
  202. package/dist/Timer/index.d.ts +1 -1
  203. package/dist/Timer/index.js +1 -1
  204. package/dist/{Timer-BNa_W8zr.js → Timer-B-9sSJWK.js} +1 -1
  205. package/dist/Timestamp/index.d.ts +1 -1
  206. package/dist/Timestamp/index.js +1 -1
  207. package/dist/{Timestamp-D_NTXtxz.js → Timestamp-Bt9ZR975.js} +3 -3
  208. package/dist/Toast/index.js +1 -1
  209. package/dist/{Toast-E6NqFf3W.js → Toast-BQxfIeVU.js} +5 -3
  210. package/dist/ToggleButton/index.d.ts +1 -1
  211. package/dist/ToggleButton/index.js +1 -1
  212. package/dist/{ToggleButton-ih92QX-K.js → ToggleButton-IFhFMpQh.js} +3 -3
  213. package/dist/Token/index.js +1 -1
  214. package/dist/{Token-DE1udaRF.js → Token-CpmqfG4i.js} +1 -1
  215. package/dist/Tokenizer/index.d.ts +1 -1
  216. package/dist/Tokenizer/index.js +1 -1
  217. package/dist/{Tokenizer-DbD2ZBuh.js → Tokenizer-Dvr7ICpS.js} +13 -13
  218. package/dist/Toolbar/index.d.ts +1 -1
  219. package/dist/Tooltip/index.d.ts +1 -1
  220. package/dist/Tooltip/index.js +2 -2
  221. package/dist/{Tooltip-sXtW5dTD.js → Tooltip-DyGaJUbl.js} +1 -1
  222. package/dist/TopNav/index.d.ts +1 -1
  223. package/dist/TopNav/index.js +1 -1
  224. package/dist/{TopNav-D688LaUK.js → TopNav-Cw_dcKpf.js} +5 -5
  225. package/dist/TreeList/index.js +1 -1
  226. package/dist/{TreeList-BFKPBFKu.js → TreeList-CBfKKbUQ.js} +4 -4
  227. package/dist/Typeahead/index.js +2 -2
  228. package/dist/{Typeahead-BwjzOjT4.js → Typeahead-D9-WjsCU.js} +5 -5
  229. package/dist/{VelocityTracker-bns4TzMt.js → VelocityTracker-CPFBHDpy.js} +1 -1
  230. package/dist/{accessibleName-nYUMoSTW.js → accessibleName-Cw9s1690.js} +2 -2
  231. package/dist/{animator-DnLs_cbV.js → animator-ozeBZ_zC.js} +3 -3
  232. package/dist/{assertOptions-BdLvkG6M.js → assertOptions-V_jJxpn9.js} +1 -1
  233. package/dist/{clickGuard-C3VmOLhI.js → clickGuard-CxqcfBCJ.js} +2 -2
  234. package/dist/{coarsePointer-BfMx3H23.js → coarsePointer-DGnAPIcU.js} +1 -1
  235. package/dist/composables/index.js +10 -10
  236. package/dist/{composables-B9tgZEzP.js → composables-BJoAw6XA.js} +11 -9
  237. package/dist/{context-Dktfy1fh.js → context-WDet15_N.js} +1 -1
  238. package/dist/{useAttachment-CALrXA-t.js → geometry-CoQRz-F1.js} +12 -710
  239. package/dist/{gestures-CppaWqif.js → gestures-yKyyMqeQ.js} +225 -1
  240. package/dist/{holdEntranceInput-DgimbgGm.js → holdEntranceInput-BsusS3bM.js} +2 -2
  241. package/dist/{index-MOtVbTwK.d.ts → index--kbwaSXW.d.ts} +3 -3
  242. package/dist/{index-X4S7_dmq.d.ts → index-BA8exXNP.d.ts} +1 -1
  243. package/dist/{index-CArP_6wv.d.ts → index-BI1QLuYB.d.ts} +2 -2
  244. package/dist/{index-maTGrWjF.d.ts → index-BenG-F5d.d.ts} +1 -1
  245. package/dist/{index-D7ShT2c-.d.ts → index-BgT6mH3U.d.ts} +1 -1
  246. package/dist/{index-C1e8LNx2.d.ts → index-BjqoHLMq.d.ts} +1 -1
  247. package/dist/{index-DN5Ga_Zm.d.ts → index-BqQlY3fL.d.ts} +3 -3
  248. package/dist/{index-Otl047R1.d.ts → index-BtqvPjAf.d.ts} +2 -2
  249. package/dist/{index-waTkqxTz.d.ts → index-C89cIh4E.d.ts} +1 -1
  250. package/dist/{index-D05JGsT3.d.ts → index-C8wfe0Mr.d.ts} +1 -1
  251. package/dist/{index-CdvmnNMH.d.ts → index-COgrQZIL.d.ts} +1 -1
  252. package/dist/{index-AgTJRqUY.d.ts → index-CQi9WGWE.d.ts} +2 -2
  253. package/dist/{index-D65x5ny5.d.ts → index-CY0KtUSC.d.ts} +67 -67
  254. package/dist/{index-rdwI-mcm.d.ts → index-CtYlR9Cu.d.ts} +1 -1
  255. package/dist/{index-DWVhyvVu.d.ts → index-D1JOMiI5.d.ts} +8 -8
  256. package/dist/{index-eCp-ElSp.d.ts → index-DPhQZXYw.d.ts} +2 -2
  257. package/dist/{index-CM00rrgg.d.ts → index-DuxRUPMc.d.ts} +3 -3
  258. package/dist/{index-BOiwoyXq.d.ts → index-GyRgg1-v.d.ts} +8 -8
  259. package/dist/{index-CUuUoX3h.d.ts → index-JE1HrzdJ.d.ts} +3 -3
  260. package/dist/{index-Ak1b0V24.d.ts → index-Pad9p8CU.d.ts} +1 -1
  261. package/dist/{index-85y5NZP-.d.ts → index-V6uruC4Z.d.ts} +1 -1
  262. package/dist/{index-3LdpzxQZ.d.ts → index-ZKBj_1nu.d.ts} +2 -2
  263. package/dist/{index-Cm36VS1A.d.ts → index-mK1ICsVg.d.ts} +2 -2
  264. package/dist/{index-ql9ApSTF.d.ts → index-yQc-te9a.d.ts} +2 -2
  265. package/dist/index.d.ts +24 -24
  266. package/dist/index.js +101 -101
  267. package/dist/{inputHold-DW2LYHb5.js → inputHold-BJtjc9iI.js} +4 -4
  268. package/dist/{inputHoldState-xntIqr5W.js → inputHoldState-BYi5FKZl.js} +2 -2
  269. package/dist/{inputStream-bPd9eB2b.js → inputStream-HXw2lZ-3.js} +1 -1
  270. package/dist/{landing-9mjHGn26.js → landing-Qk_FHR-s.js} +1 -1
  271. package/dist/{layerDepth-c3jUndA2.js → layerDepth-SGFJ5L6X.js} +1 -1
  272. package/dist/{lazyBottomSheet-Ca7Mdou2.js → lazyBottomSheet-Bg5E8lr3.js} +1 -1
  273. package/dist/{linearEasing-CBwOorE7.js → linearEasing-VHwy6xl_.js} +1 -1
  274. package/dist/{presentation-Cy_yf56y.js → presentation-twEOzzJq.js} +1 -1
  275. package/dist/{presentationHold-B4tK68sd.js → presentationHold-CZsVmjlY.js} +1 -1
  276. package/dist/{pressFeedback-BlOSZew9.js → pressFeedback-9ogipvI4.js} +4 -4
  277. package/dist/{pressGesture-yntcDLXo.js → pressGesture-B3Efxs_z.js} +1 -1
  278. package/dist/{rubberBand-DDapO54w.js → projection-qPcLQcwK.js} +2 -50
  279. package/dist/{reportChange-DPFCmyOB.js → reportChange-BUTgduu-.js} +3 -3
  280. package/dist/{resizableChannel-DOmBYh4V.js → resizableChannel-_j_AW2B6.js} +5 -5
  281. package/dist/{resolveMotion-CF9fXX0t.js → resolveMotion-DftkGFw6.js} +1 -1
  282. package/dist/{resolveSnapPoint-mZzJRIC2.js → resolveSnapPoint-A4dhS5jj.js} +1 -1
  283. package/dist/rubberBand-DDd5ElTe.js +65 -0
  284. package/dist/{sharedRealm-H1OrlP0V.js → sharedRealm-DBtNH73I.js} +9 -1
  285. package/dist/{springs-B2jqskKJ.js → springs-DjAn_oV5.js} +1 -1
  286. package/dist/{stillPointerGate-Htiy6uKa.js → stillPointerGate-BvCX7ddI.js} +1 -1
  287. package/dist/{tooltipFocusRules-BHJUQprJ.js → tooltipFocusRules-CxIlSnHw.js} +2 -2
  288. package/dist/{tooltipTriggerRules-Dremu4W9.js → tooltipTriggerRules-CHNpQ6RL.js} +1 -1
  289. package/dist/{touchHold-DXtx7npm.js → touchHold-CjNjGH7O.js} +1 -1
  290. package/dist/{useActionGroupTracking-DDhfTUOK.js → useActionGroupTracking-ByLJoM-8.js} +3 -3
  291. package/dist/{useAnimatedLayout-B6Xj_kTo.js → useAnimatedLayout-IcX0UfS4.js} +1 -1
  292. package/dist/useAttachment-CGiD9rt6.js +24 -0
  293. package/dist/{useChatStreamScroll-CuMzkXgD.js → useChatStreamScroll-DcNKcNTj.js} +1 -1
  294. package/dist/{useDismiss-BvDK4xBe.js → useDismiss-6SGAlkB_.js} +1 -1
  295. package/dist/{useHeldPresentation-BF5vGVUn.js → useHeldPresentation-DJEthuMT.js} +1 -1
  296. package/dist/{useInputStatusIcon-MyCpVp3g.js → useInputStatusIcon-D0q4S1Ye.js} +1 -1
  297. package/dist/{useMenuEntranceHold-HznOwIry.js → useMenuEntranceHold-B7f9ShX2.js} +1 -1
  298. package/dist/{useMenuPress-BJVQF7ml.js → useMenuPress-cBIQyTsN.js} +4 -4
  299. package/dist/{usePressFeedback-cxyksfAD.js → usePressFeedback-Dx-a3i82.js} +1 -1
  300. package/dist/{useResizable-C-9ff2ZK.js → useResizable-JvgYydox.js} +6 -5
  301. package/dist/{useTooltip-w57yzB7h.js → useTooltip-owvVSn_m.js} +4 -4
  302. package/dist/{useTouchHitArea-CgUvnuTz.js → useTouchHitArea-BGkvMAyp.js} +2 -2
  303. package/dist/{useTouchTriggerInternal-DSA228_-.js → useTouchTriggerInternal-5ExaYYSy.js} +1 -1
  304. package/dist/{useTruncationTooltip--w8vh7M-.js → useTruncationTooltip-DHI6q_EV.js} +3 -3
  305. package/dist/{useTypeaheadMenuConfig-C-EOaLF-.js → useTypeaheadMenuConfig-COiZ4isy.js} +1 -1
  306. package/package.json +1 -1
  307. package/styles/slider.css +59 -12
  308. package/styles/switch.css +101 -34
  309. package/dist/Slider-BdIrYmul.js +0 -735
  310. package/dist/Switch-6tQbDX9A.js +0 -355
@@ -0,0 +1,1468 @@
1
+ import "./pressFeedback-9ogipvI4.js";
2
+ import { i as withoutClickGuard, t as armClickGuard } from "./clickGuard-CxqcfBCJ.js";
3
+ import { i as subscribeInput } from "./inputStream-HXw2lZ-3.js";
4
+ import { n as useTouchHitArea } from "./useTouchHitArea-BGkvMAyp.js";
5
+ import { a as registerMotionTable, d as toSpring } from "./roles-DWH31Bn3.js";
6
+ import { c as solveSpring } from "./linearEasing-VHwy6xl_.js";
7
+ import { r as UIKIT_GESTURES } from "./gestures-yKyyMqeQ.js";
8
+ import { t as usePressFeedback } from "./usePressFeedback-Dx-a3i82.js";
9
+ import { t as _sfc_main$1 } from "./VisuallyHidden-cpmsV-0M.js";
10
+ import { t as _sfc_main$2 } from "./ButtonTooltip-ZpQP-aQg.js";
11
+ import { t as useButtonTooltip } from "./useButtonTooltip-DjCaZMp_.js";
12
+ import { n as createMotionEngine } from "./animator-ozeBZ_zC.js";
13
+ import { t as resolveMotion } from "./resolveMotion-DftkGFw6.js";
14
+ import { i as SWITCH_THUMB_MOVE_SPRING } from "./springs-DjAn_oV5.js";
15
+ import { a as lockSelection, i as getGestureHost } from "./geometry-CoQRz-F1.js";
16
+ import { r as watchCoarsePointer } from "./coarsePointer-DGnAPIcU.js";
17
+ import { t as isRtlElement } from "./isRtlElement-NHuH48AA.js";
18
+ import { t as useAnnounce } from "./announce-GU01Oix2.js";
19
+ import { o as useComponentMessages } from "./context-B8IEFCDR.js";
20
+ import { a as rubberBandUnclamp, n as rubberBandClamp } from "./rubberBand-DDd5ElTe.js";
21
+ import { r as withholdCallerHandlers } from "./disabledInteraction-Bqoyhoss.js";
22
+ import { t as ariaRequired } from "./context-CrVCeUUK.js";
23
+ import { t as _sfc_main$3 } from "./FieldLabel-D56uJrRE.js";
24
+ import { t as _sfc_main$4 } from "./FieldStatus-DmCWPT6U.js";
25
+ import { t as switchMessages } from "./switch-B9xwxdOU.js";
26
+ import { n as createPressTracker } from "./PressTracker-L5-Ark_9.js";
27
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, mergeModels, mergeProps, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onScopeDispose, onUpdated, openBlock, renderSlot, shallowRef, toDisplayString, unref, useAttrs, useId, useModel, useTemplateRef, watch, withCtx } from "vue";
28
+ import "../styles/switch.css";
29
+ //#region src/Switch/useSwitchAction.ts
30
+ function useSwitchAction(options) {
31
+ const optimistic = shallowRef(null);
32
+ const pendingCount = shallowRef(0);
33
+ let revision = 0;
34
+ watch(options.model, () => {
35
+ optimistic.value = null;
36
+ });
37
+ function commit(value, event) {
38
+ const current = ++revision;
39
+ const changeEvent = new CustomEvent("change", {
40
+ cancelable: true,
41
+ detail: {
42
+ value,
43
+ originalEvent: event
44
+ }
45
+ });
46
+ if (event.defaultPrevented) changeEvent.preventDefault();
47
+ optimistic.value = value;
48
+ options.model.value = value;
49
+ options.emitChange(value, changeEvent);
50
+ const action = options.changeAction();
51
+ if (!action || changeEvent.defaultPrevented) {
52
+ optimistic.value = null;
53
+ return;
54
+ }
55
+ pendingCount.value += 1;
56
+ const finish = () => {
57
+ pendingCount.value -= 1;
58
+ if (current === revision) optimistic.value = null;
59
+ };
60
+ try {
61
+ const result = action(value, changeEvent);
62
+ if (result == null) {
63
+ finish();
64
+ return;
65
+ }
66
+ Promise.resolve(result).then(finish, (error) => {
67
+ finish();
68
+ options.emitError(error, value, changeEvent);
69
+ });
70
+ } catch (error) {
71
+ finish();
72
+ options.emitError(error, value, changeEvent);
73
+ }
74
+ }
75
+ return {
76
+ commit,
77
+ value: computed(() => optimistic.value ?? options.model.value),
78
+ isPending: computed(() => pendingCount.value > 0)
79
+ };
80
+ }
81
+ //#endregion
82
+ //#region src/motion/uikit/switch.ts
83
+ /**
84
+ * @file switch.ts
85
+ * @input The springs table's measured switch travel (springs.ts)
86
+ * @output Exports `switchControl`: UISwitch's geometry, the springs of its
87
+ * Liquid Glass thumb and of its track color, the drag's rubber band and
88
+ * flip distance, and the release timing
89
+ * @position The switch domain of the UIKit constants table (motion/uikit)
90
+ *
91
+ * The values are UISwitch's on iOS 26.2, read in a UIKit host app on the
92
+ * simulator. Lengths are in pt (CSS px). uikit.test.ts checks each `@source`.
93
+ */
94
+ /**
95
+ * UISwitch on iOS 26.2. Under a finger its white thumb lifts into a clear
96
+ * glass lens, and a drag moves it with a rubber band. The track colour slides
97
+ * on a spring of its own. UISwitch plays no haptic.
98
+ */
99
+ const switchControl = {
100
+ /**
101
+ * The control's size (width × height): the track.
102
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
103
+ * iPhone 17 Pro, `UISwitch` frame 63 × 28 (intrinsic 61 × 28), track view
104
+ * 63 × 28 with corner radius 14, Oct 23 2026
105
+ */
106
+ trackSize: [63, 28],
107
+ /**
108
+ * The thumb at rest (width × height), inset equally from the track's top,
109
+ * bottom and nearer end; it never changes size between off and on.
110
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
111
+ * iPhone 17 Pro, `_UILiquidLensView` frame 37 × 24 at x 2 (off) and
112
+ * x 24 (on) inside the 63 × 28 track, Oct 23 2026
113
+ */
114
+ thumbSize: [37, 24],
115
+ /**
116
+ * The thumb lifted under a finger (width × height). The lens grows about
117
+ * its own center, past the track, and holds this size while the finger
118
+ * stays down.
119
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
120
+ * iPhone 17 Pro, lens bounds settled at 58 × 38.33 during a 1 s hold
121
+ * (center unmoved), Oct 23 2026
122
+ */
123
+ liftedThumbSize: [58, 38.333],
124
+ /**
125
+ * The lift: the thumb growing to `liftedThumbSize` while its white fill
126
+ * fades out and the clear glass fades in (one spring drives all three).
127
+ * Starts with the touch outside a scroll view, after its content delay
128
+ * inside one. UISwitch keeps it under Reduce Motion; core's Switch does not
129
+ * lift then.
130
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
131
+ * iPhone 17 Pro, per-frame lens bounds during a 1 s hold fitted with one
132
+ * spring for width and height (rms 0.29 pt; the fill's and the glass's
133
+ * opacity overshoot by the same 13 %; the lens's settings read on a tap
134
+ * say damping 0.625, response 0.27, whose 8 % overshoot is short of the
135
+ * frames' 12 %), Oct 23 2026
136
+ */
137
+ lift: {
138
+ response: .23,
139
+ dampingRatio: .55
140
+ },
141
+ /**
142
+ * The settle after the finger lifts: the lens shrinking back to
143
+ * `thumbSize` while the white fill returns over the glass.
144
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
145
+ * iPhone 17 Pro, the lens's spring settings read on a tap (damping 0.7,
146
+ * response 0.5); per-frame lens bounds after the lift of a 1 s hold fit
147
+ * one spring at 0.49 / 0.70 (rms 0.065 pt; the opacities undershoot by
148
+ * the same 4.5 %), Oct 23 2026
149
+ */
150
+ settle: {
151
+ response: .5,
152
+ dampingRatio: .7
153
+ },
154
+ /**
155
+ * The settle never starts sooner than this after the lift began, so a
156
+ * quick tap still shows the lifted lens, in ms.
157
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
158
+ * iPhone 17 Pro, a 50 ms tap: the lift→settle hand-off fitted at 235 ms
159
+ * after the lift began (rms 0.33 pt), Oct 23 2026
160
+ * @measure M-SW07
161
+ */
162
+ minimumLiftMs: 235,
163
+ /**
164
+ * The thumb travelling to the committed end after a release or a
165
+ * programmatic change. It starts from the thumb's own velocity.
166
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
167
+ * iPhone 17 Pro, the lens's position behavior read on a tap (damping 1,
168
+ * response 0.3); the lens center after a 50 ms tap and after a 1 s hold
169
+ * fits one spring at 0.31 / 1 (rms 0.11 pt), Oct 23 2026; the springs
170
+ * table's `SWITCH_THUMB_MOVE_SPRING` holds the one value
171
+ */
172
+ travel: SWITCH_THUMB_MOVE_SPRING,
173
+ /**
174
+ * During a drag the thumb chases the finger: each move retargets this
175
+ * spring at the finger's position, rubber-banded past either end.
176
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
177
+ * iPhone 17 Pro, a 4 s drag off → on → past both ends: the lens center
178
+ * simulated as this spring chasing the rubber-banded finger fits every
179
+ * frame (rms 0.21 pt), Oct 23 2026
180
+ */
181
+ tracking: {
182
+ response: .36,
183
+ dampingRatio: 1
184
+ },
185
+ /**
186
+ * The drag's rubber band past either end: UIScrollView's
187
+ * `(1 − 1 ÷ (x·c ÷ d + 1))·d`. The coefficient c and the dimension d are in
188
+ * pt for the 28 pt control. Scale d with the track height.
189
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
190
+ * iPhone 17 Pro, the same drag fit: c 0.55, d 11.75–12 pt, the
191
+ * translation measured from where the finger landed, Oct 23 2026
192
+ */
193
+ rubberBand: {
194
+ coefficient: .55,
195
+ dimension: 12
196
+ },
197
+ /**
198
+ * A drag flips the switch by the finger, not the thumb. Once the finger is
199
+ * this far from where it landed, toward the other end, the switch shows
200
+ * the other side. The distance is the track width minus the thumb width
201
+ * (63 − 37 pt). Back past where it landed, the starting side shows again.
202
+ * Flips happen on touch events only, so a fast swipe flips on the lift.
203
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
204
+ * iPhone 17 Pro, `UISwitchModernVisualElement` ivars per frame and the
205
+ * "SwitchWellPosition" springs during 1 pt-step drags: the same 26 pt for
206
+ * presses at x 8, 20.5 and 45, with and without a 400 ms hold, mirrored
207
+ * on an on switch; flipping back at the press point, Oct 23 2026
208
+ */
209
+ flipDistance: 26,
210
+ /**
211
+ * The track color turning on: the well image sliding in on a critically
212
+ * damped spring, starting when the switch flips (the lift of a tap).
213
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
214
+ * iPhone 17 Pro, `CASpringAnimation` "SwitchWellPosition" read: mass 1,
215
+ * stiffness 85.377, damping 18.480 (response 0.68 s), Oct 23 2026
216
+ */
217
+ wellOn: {
218
+ mass: 1,
219
+ stiffness: 85.37720070146501,
220
+ damping: 18.47995678582231
221
+ },
222
+ /**
223
+ * The track color turning off: the same well sliding back, faster.
224
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
225
+ * iPhone 17 Pro, `CASpringAnimation` "SwitchWellPosition" read: mass 1,
226
+ * stiffness 246.740, damping 31.416 (response 0.40 s), Oct 23 2026
227
+ */
228
+ wellOff: {
229
+ mass: 1,
230
+ stiffness: 246.74011002723395,
231
+ damping: 31.41592653589793
232
+ },
233
+ /**
234
+ * The lifted lens's drop shadow: y offset and radius in pt, then black
235
+ * alpha; none at rest.
236
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
237
+ * iPhone 17 Pro, the lens layer's presented `shadowOffset` (0, 7),
238
+ * `shadowRadius` 3, `shadowOpacity` 0.12 once lifted, 0 at rest,
239
+ * Oct 23 2026
240
+ */
241
+ liftedShadow: [
242
+ 7,
243
+ 3,
244
+ .12
245
+ ],
246
+ /**
247
+ * UISwitch plays no haptic on a tap, a hold or a drag.
248
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
249
+ * iPhone 17 Pro, every `UIFeedbackGenerator` entry point hooked: no call
250
+ * on tap, hold, drag or flip, Oct 23 2026
251
+ */
252
+ haptic: "none"
253
+ };
254
+ /**
255
+ * Registers the switch table's motion roles as internal roles. Nothing
256
+ * registers on import: Switch's touch presentation calls it once before its
257
+ * first animation, and a second call does nothing.
258
+ */
259
+ function registerSwitchTable() {
260
+ registerMotionTable("switchControl", switchControl, { roles: [
261
+ "lift",
262
+ "settle",
263
+ "travel",
264
+ "tracking",
265
+ "wellOn",
266
+ "wellOff",
267
+ "minimumLiftMs"
268
+ ] });
269
+ }
270
+ //#endregion
271
+ //#region src/Switch/switchTouch.ts
272
+ /**
273
+ * @file switchTouch.ts
274
+ * @input The UIKit switch constants (motion/uikit/switch.ts) and a track size
275
+ * @output The pure model of Switch's touch presentation: thumb geometry, the
276
+ * drag's target, the flip rule, the commit on release, and when the lifted
277
+ * thumb may settle
278
+ * @position Pure half of Switch's touch presentation; driven by
279
+ * switchTouchController.ts, tested by switchTouch.test.ts without a browser
280
+ *
281
+ * Positions are thumb offsets from the off end, 0 … `travel`, in the writing
282
+ * direction; the caller mirrors them for right-to-left.
283
+ */
284
+ const [UIKIT_TRACK_WIDTH, UIKIT_TRACK_HEIGHT] = switchControl.trackSize;
285
+ const [UIKIT_THUMB_WIDTH, UIKIT_THUMB_HEIGHT] = switchControl.thumbSize;
286
+ const [LIFTED_WIDTH, LIFTED_HEIGHT] = switchControl.liftedThumbSize;
287
+ /**
288
+ * The thumb geometry in a track of this size: the thumb's measured box when
289
+ * given, UIKit's proportions otherwise.
290
+ */
291
+ function switchTouchGeometry(trackWidth, trackHeight, thumb) {
292
+ const thumbHeight = thumb?.height ?? trackHeight * UIKIT_THUMB_HEIGHT / UIKIT_TRACK_HEIGHT;
293
+ const thumbWidth = thumb?.width ?? trackWidth * UIKIT_THUMB_WIDTH / UIKIT_TRACK_WIDTH;
294
+ const inset = Math.max(0, (trackHeight - thumbHeight) / 2);
295
+ const liftScale = Math.max(1, Math.min(LIFTED_WIDTH / UIKIT_THUMB_WIDTH, LIFTED_HEIGHT / UIKIT_THUMB_HEIGHT, thumbWidth > 0 ? 1 + inset / thumbWidth : 1, thumbHeight > 0 ? 1 + inset / thumbHeight : 1));
296
+ const liftGrowth = thumbWidth * (liftScale - 1) / 2;
297
+ return {
298
+ trackWidth,
299
+ trackHeight,
300
+ thumbWidth,
301
+ thumbHeight,
302
+ inset,
303
+ travel: Math.max(0, trackWidth - thumbWidth - 2 * inset),
304
+ liftScaleX: liftScale,
305
+ liftScaleY: liftScale,
306
+ rubberBandDimension: Math.max(0, Math.min(switchControl.rubberBand.dimension * trackHeight / UIKIT_TRACK_HEIGHT, inset - liftGrowth)),
307
+ flipDistance: Math.max(0, trackWidth - thumbWidth)
308
+ };
309
+ }
310
+ /**
311
+ * Where the drag puts the thumb's target: the offset at the landing, moved
312
+ * by the finger's translation and rubber-banded past either end. `start` is
313
+ * the thumb's offset on screen when the finger landed, mid-flight or banded.
314
+ * It is unbanded first, so a finger that grabs a moving thumb continues
315
+ * without a jump.
316
+ */
317
+ function dragTarget(start, translation, geometry) {
318
+ const { travel, rubberBandDimension } = geometry;
319
+ const coefficient = switchControl.rubberBand.coefficient;
320
+ const raw = rubberBandUnclamp(start, 0, travel, rubberBandDimension, coefficient) + translation;
321
+ return rubberBandClamp(raw, 0, travel, rubberBandDimension, coefficient);
322
+ }
323
+ function startFlip(isOn) {
324
+ return {
325
+ startedOn: isOn,
326
+ isVisuallyOn: isOn,
327
+ isArmed: false,
328
+ didFlip: false
329
+ };
330
+ }
331
+ /**
332
+ * One touch event of the drag. `translation` is the finger's travel since it
333
+ * landed along the writing direction (positive toward the on end).
334
+ */
335
+ function stepFlip(flip, translation, geometry) {
336
+ const toward = flip.startedOn ? -translation : translation;
337
+ if (flip.isVisuallyOn !== flip.startedOn) return toward < 0 ? {
338
+ ...flip,
339
+ isVisuallyOn: flip.startedOn,
340
+ isArmed: false
341
+ } : flip;
342
+ const isPast = toward >= geometry.flipDistance;
343
+ if (flip.isArmed && isPast) return {
344
+ ...flip,
345
+ isVisuallyOn: !flip.startedOn,
346
+ isArmed: false,
347
+ didFlip: true
348
+ };
349
+ return isPast === flip.isArmed ? flip : {
350
+ ...flip,
351
+ isArmed: isPast
352
+ };
353
+ }
354
+ /**
355
+ * What a release commits: the side a drag flipped to; when nothing flipped,
356
+ * the other side of the value, wherever the finger lifts. A press slid off
357
+ * and lifted outside toggles too, as UISwitch's does.
358
+ */
359
+ function commitOnRelease(flip, isOn) {
360
+ return flip?.didFlip === true ? flip.isVisuallyOn : !isOn;
361
+ }
362
+ /**
363
+ * When the lifted thumb may settle (ms): the release, but never sooner than
364
+ * the minimum lift time after the lift.
365
+ */
366
+ function settleTime(releaseTime, liftTime, minimumLiftMs = switchControl.minimumLiftMs) {
367
+ return Math.max(releaseTime, liftTime + minimumLiftMs);
368
+ }
369
+ /**
370
+ * Waits for the browser's trusted click inside `target`. Reports it after its
371
+ * handlers ran (a task later), or that none came within the wait. Returns
372
+ * the function that ends the wait without a report.
373
+ */
374
+ function awaitBrowserClick(target, { onClicked, onNoClick }) {
375
+ const view = target.ownerDocument.defaultView;
376
+ if (view == null) {
377
+ let isEnded = false;
378
+ queueMicrotask(() => {
379
+ if (!isEnded) onNoClick();
380
+ });
381
+ return () => {
382
+ isEnded = true;
383
+ };
384
+ }
385
+ let isDone = false;
386
+ let report = null;
387
+ let timer = null;
388
+ let stopListening = null;
389
+ const stop = () => {
390
+ isDone = true;
391
+ stopListening?.();
392
+ stopListening = null;
393
+ if (timer != null) {
394
+ view.clearTimeout(timer);
395
+ timer = null;
396
+ }
397
+ };
398
+ stopListening = subscribeInput(view, "click", (event) => {
399
+ if (isDone || !event.isTrusted || !target.contains(event.target)) return;
400
+ stop();
401
+ report = view.setTimeout(() => {
402
+ report = null;
403
+ onClicked(event.defaultPrevented);
404
+ }, 0);
405
+ });
406
+ timer = view.setTimeout(() => {
407
+ if (isDone) return;
408
+ stop();
409
+ onNoClick();
410
+ }, 300);
411
+ return () => {
412
+ stop();
413
+ if (report != null) {
414
+ view.clearTimeout(report);
415
+ report = null;
416
+ }
417
+ };
418
+ }
419
+ /** Clicks `element` and reports whether a handler cancelled the click. */
420
+ function clickAndReport(element) {
421
+ const view = element.ownerDocument.defaultView;
422
+ let clicked = null;
423
+ const grab = (event) => {
424
+ if (clicked == null && event.target === element) clicked = event;
425
+ };
426
+ view?.addEventListener("click", grab, true);
427
+ try {
428
+ element.click();
429
+ } finally {
430
+ view?.removeEventListener("click", grab, true);
431
+ }
432
+ return clicked?.defaultPrevented === true;
433
+ }
434
+ /**
435
+ * A control's own click for a lift: the shared click guard swallows the
436
+ * browser's late click of the same lift, so the control toggles once.
437
+ */
438
+ function clickForLift(element) {
439
+ armClickGuard(element.ownerDocument);
440
+ return withoutClickGuard(() => clickAndReport(element));
441
+ }
442
+ //#endregion
443
+ //#region src/utils/pressedRowLock.ts
444
+ /**
445
+ * @file pressedRowLock.ts
446
+ * @input The elements a press tracker holds and the touch's target
447
+ * @output lockPressedRow: the selection lock for a control's press, over the
448
+ * control and the pressable row around it
449
+ * @position A press tracker's `selectionLock` for a control whose hold acts
450
+ * (Switch), over utils/selectionLock.ts
451
+ */
452
+ /**
453
+ * Locks the selection on `elements` and on the pressable row each sits in,
454
+ * so a held finger selects no label text beside the control.
455
+ */
456
+ function lockPressedRow(elements, target) {
457
+ const held = /* @__PURE__ */ new Set();
458
+ for (const element of elements) {
459
+ held.add(element);
460
+ held.add(element.closest(`[data-astryx-pressable]`) ?? element);
461
+ }
462
+ return lockSelection(held, target);
463
+ }
464
+ //#endregion
465
+ //#region src/Switch/switchFill.ts
466
+ /**
467
+ * @file switchFill.ts
468
+ * @input Switch's native input and its track
469
+ * @output readFillInState: the track's computed fill as the theme paints it
470
+ * in a given state, read in place
471
+ * @position Read by switchTouchVisuals.ts for the colour fade under a finger
472
+ *
473
+ * The track's fill follows the input's `:checked` (switch.css). The colour
474
+ * fade needs the fill of the state the track is not in: the input's checked
475
+ * state is swapped, the colour read and the state swapped back in the same
476
+ * task, so nothing paints in between and no event fires.
477
+ */
478
+ /** The track's computed fill when the input's checked state is `isOn`. */
479
+ function readFillInState(input, track, isOn) {
480
+ const saved = input.checked;
481
+ const held = track.style.getPropertyValue("background-color");
482
+ input.checked = isOn;
483
+ if (held !== "") track.style.removeProperty("background-color");
484
+ try {
485
+ return getComputedStyle(track).backgroundColor;
486
+ } finally {
487
+ input.checked = saved;
488
+ if (held !== "") track.style.setProperty("background-color", held);
489
+ }
490
+ }
491
+ //#endregion
492
+ //#region src/Switch/switchTouchVisuals.ts
493
+ /** The fade layer's colour, set on the track for its `::after`. */
494
+ const FADE_FILL = "--_switch-fade-fill";
495
+ /** The track's own fill while a change is held (inline, over its CSS). */
496
+ const BASE_FILL = "background-color";
497
+ function now$1() {
498
+ return typeof performance === "undefined" ? Date.now() : performance.now();
499
+ }
500
+ /**
501
+ * The lift spring until `holdSeconds`, then the settle spring from where the
502
+ * lift got to: one curve, so the settle starts on the compositor's clock.
503
+ */
504
+ function liftThenSettle(options) {
505
+ const hold = Math.max(0, options.holdSeconds);
506
+ const first = solveSpring(toSpring(options.lift), {
507
+ from: options.from,
508
+ to: options.lifted,
509
+ velocity: options.velocity
510
+ });
511
+ const second = solveSpring(toSpring(options.settle), {
512
+ from: first.value(hold),
513
+ to: options.rest,
514
+ velocity: first.velocity(hold)
515
+ });
516
+ return {
517
+ duration: hold + second.settleTime(options.threshold),
518
+ at: (t) => t < hold ? first.value(t) : second.value(t - hold),
519
+ velocity: (t) => t < hold ? first.velocity(t) : second.velocity(t - hold)
520
+ };
521
+ }
522
+ var SwitchTouchVisuals = class {
523
+ geometry;
524
+ /** Whether `geometry` holds the rendered boxes since the last attach. */
525
+ isGeometryMeasured = false;
526
+ /** The value the CSS shows. */
527
+ isOn;
528
+ /** The side the visuals show or head to. */
529
+ isVisuallyOn;
530
+ /** +1 left-to-right, −1 right-to-left. */
531
+ direction = 1;
532
+ thumb = null;
533
+ /** The fade layer: its opacity is how far the visuals are from the value. */
534
+ fade = null;
535
+ /** The lifted shadow: the thumb's `::after`, faded in with the lift. */
536
+ shadow = null;
537
+ elements = null;
538
+ /** When the thumb lifted (ms); null while at rest. */
539
+ liftTime = null;
540
+ /** When the running settle leaves the lift, ms. */
541
+ settleAt = null;
542
+ /** A change landed mid-fade that the fade already heads to (see the file). */
543
+ baseHeld = false;
544
+ baseHold = 0;
545
+ constructor(isOn, geometry) {
546
+ this.isOn = isOn;
547
+ this.isVisuallyOn = isOn;
548
+ this.geometry = geometry;
549
+ }
550
+ /** The parts a press measures, with no animator (the switch's own look). */
551
+ bind(elements, direction) {
552
+ this.elements = elements;
553
+ this.direction = direction;
554
+ this.isGeometryMeasured = false;
555
+ this.isVisuallyOn = this.isOn;
556
+ }
557
+ /** The animators of the touch presentation, from rest. */
558
+ attach(elements, direction) {
559
+ this.bind(elements, direction);
560
+ this.thumb = createMotionEngine(elements.thumb);
561
+ this.fade = createMotionEngine(elements.track, {
562
+ pseudoElement: "::after",
563
+ initial: { opacity: 0 },
564
+ base: { opacity: 0 }
565
+ });
566
+ this.fade.set({ opacity: 0 }, { promote: false });
567
+ this.shadow = createMotionEngine(elements.thumb, {
568
+ pseudoElement: "::after",
569
+ initial: { opacity: 0 },
570
+ base: { opacity: 0 }
571
+ });
572
+ this.shadow.set({ opacity: 0 }, { promote: false });
573
+ this.paintFade();
574
+ }
575
+ /** Undo the animators and every inline style they wrote. */
576
+ detach() {
577
+ for (const animator of [
578
+ this.thumb,
579
+ this.fade,
580
+ this.shadow
581
+ ]) {
582
+ const element = animator?.element;
583
+ animator?.dispose();
584
+ if (element != null) for (const property of [
585
+ "translate",
586
+ "scale",
587
+ "opacity"
588
+ ]) element.style.removeProperty(property);
589
+ }
590
+ this.elements?.track.style.removeProperty(FADE_FILL);
591
+ this.elements?.track.style.removeProperty(BASE_FILL);
592
+ this.baseHeld = false;
593
+ this.baseHold++;
594
+ this.thumb = this.fade = this.shadow = null;
595
+ this.liftTime = null;
596
+ this.settleAt = null;
597
+ this.elements = null;
598
+ }
599
+ setGeometry(geometry) {
600
+ this.geometry = geometry;
601
+ this.isGeometryMeasured = false;
602
+ this.thumb?.set({
603
+ x: 0,
604
+ scaleX: 1,
605
+ scaleY: 1
606
+ }, { promote: false });
607
+ }
608
+ /**
609
+ * The thumb geometry from the rendered boxes: the track's box less its
610
+ * border, and the thumb's used size from its computed style, which its
611
+ * scale does not change.
612
+ */
613
+ measureGeometry() {
614
+ const track = this.elements?.track;
615
+ const thumb = this.elements?.thumb;
616
+ if (track == null) return;
617
+ const box = track.getBoundingClientRect();
618
+ const trackWidth = box.width - 2 * track.clientLeft;
619
+ const trackHeight = box.height - 2 * track.clientTop;
620
+ if (trackWidth <= 0 || trackHeight <= 0) return;
621
+ this.isGeometryMeasured = true;
622
+ const style = thumb == null ? null : getComputedStyle(thumb);
623
+ const thumbWidth = style == null ? NaN : Number.parseFloat(style.width);
624
+ const thumbHeight = style == null ? NaN : Number.parseFloat(style.height);
625
+ this.geometry = switchTouchGeometry(trackWidth, trackHeight, thumbWidth > 0 && thumbHeight > 0 ? {
626
+ width: thumbWidth,
627
+ height: thumbHeight
628
+ } : void 0);
629
+ }
630
+ /**
631
+ * The rendered value changed and the CSS already moved the thumb's rest:
632
+ * the delta is rebased so nothing moves, the thumb's scale carries its old
633
+ * size, and the fade layer swaps under the new fill. `previousSize` is the
634
+ * thumb diameter of the previous state when nothing was measured yet.
635
+ * Returns whether the animator springs (reduced motion is off).
636
+ */
637
+ rebaseToValue(isOn, previousSize, time) {
638
+ const previous = this.isOn;
639
+ this.isOn = isOn;
640
+ const thumb = this.thumb;
641
+ if (thumb == null) return false;
642
+ let measured = null;
643
+ if (!this.isGeometryMeasured && previousSize != null) {
644
+ this.measureGeometry();
645
+ measured = this.geometry;
646
+ this.geometry = switchTouchGeometry(measured.trackWidth, measured.trackHeight, {
647
+ width: previousSize,
648
+ height: previousSize
649
+ });
650
+ }
651
+ const springs = thumb.reducedMotion() === "off";
652
+ thumb.rebase({ x: this.direction * (this.rest(previous) - this.rest(isOn)) }, springs ? { towards: { x: this.toX(this.rest(isOn)) } } : {});
653
+ const before = this.geometry;
654
+ if (measured == null) this.measureGeometry();
655
+ else this.geometry = measured;
656
+ if (springs) this.rescaleThumb(before, this.geometry, time);
657
+ if (this.fade != null) {
658
+ this.landBase(time);
659
+ if (this.isVisuallyOn !== isOn || !this.holdBase()) this.swapFade(time);
660
+ }
661
+ return springs;
662
+ }
663
+ rest(isOn) {
664
+ return isOn ? this.geometry.travel : 0;
665
+ }
666
+ /** The animator's x for a thumb offset, relative to its CSS place. */
667
+ toX(offset) {
668
+ return this.direction * (offset - this.rest(this.isOn));
669
+ }
670
+ /** The thumb's offset on screen at `time`, from the curve. */
671
+ offsetAt(time) {
672
+ const x = this.thumb?.get("x", time) ?? 0;
673
+ return this.rest(this.isOn) + this.direction * x;
674
+ }
675
+ /** The colour heads for one side. */
676
+ showWell(isOn, time, touchRelease = false) {
677
+ this.isVisuallyOn = isOn;
678
+ this.paintFade();
679
+ this.animateFade(time, void 0, touchRelease);
680
+ }
681
+ /** The track colour and the thumb head for one side. */
682
+ showSide(isOn, time, velocity, touchRelease = false) {
683
+ if (isOn !== this.isVisuallyOn) this.showWell(isOn, time, touchRelease);
684
+ this.thumb?.animate({ x: this.toX(this.rest(isOn)) }, {
685
+ spring: switchControl.travel,
686
+ velocity: velocity == null ? void 0 : { x: velocity }
687
+ }, { touchRelease });
688
+ }
689
+ /** The thumb follows the finger: a tracking spring, or at once under reduced motion. */
690
+ track(offset) {
691
+ const thumb = this.thumb;
692
+ if (thumb == null) return;
693
+ const target = this.toX(offset);
694
+ if (thumb.reducedMotion() === "off") thumb.animate({ x: target }, { spring: switchControl.tracking });
695
+ else thumb.set({ x: target });
696
+ }
697
+ /**
698
+ * The fade layer heads for the visuals on UIKit's well springs: clear when
699
+ * they show the value, opaque (the other fill) when they show the other side.
700
+ */
701
+ animateFade(_time, velocity, touchRelease = false) {
702
+ this.fade?.animate({ opacity: this.isVisuallyOn === this.isOn ? 0 : 1 }, {
703
+ spring: this.isVisuallyOn ? switchControl.wellOn : switchControl.wellOff,
704
+ velocity: velocity == null ? void 0 : { opacity: velocity }
705
+ }, { touchRelease });
706
+ }
707
+ /** The layer swaps to the other fill and the complement of its opacity. */
708
+ swapFade(time) {
709
+ const fade = this.fade;
710
+ if (fade == null) return;
711
+ const opacity = fade.get("opacity", time);
712
+ const fadeVelocity = fade.getVelocity("opacity", time);
713
+ this.paintFade();
714
+ fade.rebase({ opacity: 1 - 2 * opacity });
715
+ this.animateFade(time, -fadeVelocity);
716
+ }
717
+ /** Holds the track's fill at the previous value's until the fade lands. */
718
+ holdBase() {
719
+ const elements = this.elements;
720
+ const fade = this.fade;
721
+ if (elements == null || fade == null) return false;
722
+ elements.track.style.setProperty(BASE_FILL, readFillInState(elements.input, elements.track, !this.isOn));
723
+ this.baseHeld = true;
724
+ const hold = ++this.baseHold;
725
+ fade.atRest(["opacity"]).then(() => {
726
+ if (hold === this.baseHold) this.landBase(now$1());
727
+ });
728
+ return true;
729
+ }
730
+ /** Ends a held fill: the track shows its value's fill and the layer swaps under it. */
731
+ landBase(time) {
732
+ if (!this.baseHeld) return;
733
+ this.baseHeld = false;
734
+ this.baseHold++;
735
+ this.elements?.track.style.removeProperty(BASE_FILL);
736
+ this.swapFade(time);
737
+ }
738
+ /** The fade layer's colour: the track's fill in its other state. */
739
+ paintFade() {
740
+ const elements = this.elements;
741
+ if (elements == null || this.fade == null) return;
742
+ elements.track.style.setProperty(FADE_FILL, readFillInState(elements.input, elements.track, !this.isOn));
743
+ }
744
+ /** The thumb grows into half the gap around it and its shadow fades in. */
745
+ lift(time) {
746
+ if (this.thumb == null || this.thumb.reducedMotion() !== "off") return;
747
+ this.liftTime = time;
748
+ const lift = this.thumb.animate({
749
+ scaleX: this.geometry.liftScaleX,
750
+ scaleY: this.geometry.liftScaleY
751
+ }, { spring: switchControl.lift });
752
+ this.shadow?.animate({ opacity: 1 }, { spring: switchControl.lift });
753
+ lift.started.then((start) => {
754
+ if (this.liftTime === time) this.liftTime = start;
755
+ });
756
+ }
757
+ /** The thumb settles back, no sooner than the minimum lift time after it lifted. */
758
+ settle(time, touchRelease) {
759
+ const liftTime = this.liftTime;
760
+ if (liftTime == null) return;
761
+ this.liftTime = null;
762
+ const element = this.thumb?.element;
763
+ const lift = resolveMotion(element, switchControl.lift);
764
+ const settle = resolveMotion(element, switchControl.settle);
765
+ this.settleAt = settleTime(time, liftTime, resolveMotion(element, switchControl, "minimumLiftMs"));
766
+ const holdSeconds = (this.settleAt - time) / 1e3;
767
+ const play = (animator, property, lifted, rest, threshold) => {
768
+ animator?.play({ [property]: liftThenSettle({
769
+ from: animator.get(property, time),
770
+ velocity: animator.getVelocity(property, time),
771
+ lifted,
772
+ rest,
773
+ holdSeconds,
774
+ threshold,
775
+ lift,
776
+ settle
777
+ }) }, { touchRelease });
778
+ };
779
+ play(this.thumb, "scaleX", this.geometry.liftScaleX, 1, 1e-4);
780
+ play(this.thumb, "scaleY", this.geometry.liftScaleY, 1, 1e-4);
781
+ play(this.shadow, "opacity", 1, 0, .001);
782
+ }
783
+ /**
784
+ * The thumb's box changed size with the value: its scale carries the size
785
+ * it showed, then heads for the new box through the settle, or to the lift
786
+ * a held press keeps.
787
+ */
788
+ rescaleThumb(before, after, time) {
789
+ const thumb = this.thumb;
790
+ if (thumb == null || !(before.thumbWidth > 0 && before.thumbHeight > 0) || !(after.thumbWidth > 0 && after.thumbHeight > 0) || before.thumbWidth === after.thumbWidth && before.thumbHeight === after.thumbHeight) return;
791
+ const held = this.liftTime != null;
792
+ const hold = this.settleAt == null ? 0 : Math.max(0, this.settleAt - time) / 1e3;
793
+ for (const [property, factor, lifted] of [[
794
+ "scaleX",
795
+ before.thumbWidth / after.thumbWidth,
796
+ before.liftScaleX
797
+ ], [
798
+ "scaleY",
799
+ before.thumbHeight / after.thumbHeight,
800
+ before.liftScaleY
801
+ ]]) {
802
+ const keep = lifted * factor;
803
+ thumb.play({ [property]: liftThenSettle({
804
+ from: thumb.get(property, time) * factor,
805
+ velocity: thumb.getVelocity(property, time) * factor,
806
+ lifted: keep,
807
+ rest: held ? keep : 1,
808
+ holdSeconds: held ? 0 : hold,
809
+ threshold: 1e-4,
810
+ lift: resolveMotion(thumb.element, switchControl.lift),
811
+ settle: resolveMotion(thumb.element, switchControl.settle)
812
+ }) });
813
+ }
814
+ }
815
+ };
816
+ //#endregion
817
+ //#region src/Switch/switchTouchController.ts
818
+ /** Horizontal travel at which the press begins if it has not (a pan would), px. */
819
+ const PAN_HYSTERESIS = UIKIT_GESTURES.pan.hysteresis.value;
820
+ function now() {
821
+ return typeof performance === "undefined" ? Date.now() : performance.now();
822
+ }
823
+ var SwitchTouchController = class {
824
+ visuals;
825
+ elements = null;
826
+ isInteractive = true;
827
+ /** The thumb's diameter in each state, for a change before any press. */
828
+ thumbSizes = null;
829
+ /** The thumb's diameter the stylesheet sets for the state it attached in. */
830
+ attachedThumb = null;
831
+ detachers = [];
832
+ /** When the press began (ms); null with no press. */
833
+ pressTime = null;
834
+ /** The thumb's offset when the current finger landed. */
835
+ downOffset = 0;
836
+ drag = null;
837
+ /** The press and the pan both report one event; the second is skipped. */
838
+ isStepping = false;
839
+ /** The current touch already ended in a release. */
840
+ released = false;
841
+ /** Reduced motion: a release changed the value and the travel waits for it. */
842
+ pendingTravel = false;
843
+ /** A finger is down on the switch. */
844
+ isTracking = false;
845
+ /** A lift is waiting for the browser's own click; this ends the wait. */
846
+ endBrowserClickWait = null;
847
+ reconcileTimer = null;
848
+ constructor(isOn, geometry) {
849
+ this.visuals = new SwitchTouchVisuals(isOn, geometry);
850
+ }
851
+ get isAttached() {
852
+ return this.elements != null;
853
+ }
854
+ attach(elements, presentation) {
855
+ this.detach();
856
+ this.elements = elements;
857
+ const direction = isRtlElement(elements.surface) ? -1 : 1;
858
+ this.attachedThumb = null;
859
+ this.visuals.bind(elements, direction);
860
+ if (presentation === "touch") {
861
+ registerSwitchTable();
862
+ const themed = /^\s*(\d+(?:\.\d+)?|\.\d+)px\s*$/.exec(getComputedStyle(elements.thumb).getPropertyValue("--_switch-thumb-size"));
863
+ this.attachedThumb = themed ? Number(themed[1]) : null;
864
+ this.visuals.attach(elements, direction);
865
+ }
866
+ this.detachers = this.attachTracker(elements.surface);
867
+ }
868
+ /**
869
+ * UIControl's tracking, which never blocks a scroll. The press begins with
870
+ * the touch, or with the first horizontal move a pan would begin on.
871
+ * Inside a scroller the touch waits for the content delay.
872
+ */
873
+ attachTracker(surface) {
874
+ const host = getGestureHost(surface.ownerDocument);
875
+ const tracker = createPressTracker({
876
+ view: surface,
877
+ getBounds: () => surface.getBoundingClientRect(),
878
+ isEnabled: () => this.isInteractive,
879
+ isBraking: () => host.isScrollBraking(surface),
880
+ selectionLock: lockPressedRow,
881
+ holdsContextMenu: () => this.pressTime != null,
882
+ onControlEvent: (event, touch) => this.onControlEvent(event, touch),
883
+ onHighlightChange: (isHighlighted) => {
884
+ if (isHighlighted && this.isTracking && this.pressTime == null) this.pressBegan(now());
885
+ }
886
+ });
887
+ return [host.attachConsumer(surface, tracker), () => tracker.dispose()];
888
+ }
889
+ /** Undo everything: listeners, timers, animations and inline styles. */
890
+ detach() {
891
+ for (const detach of this.detachers) detach();
892
+ this.detachers = [];
893
+ this.clearTimers();
894
+ this.visuals.detach();
895
+ this.elements = null;
896
+ this.pressTime = null;
897
+ this.drag = null;
898
+ this.isTracking = false;
899
+ }
900
+ setInteractive(isInteractive) {
901
+ this.isInteractive = isInteractive;
902
+ if (!isInteractive && this.pressTime != null) this.abandon(now());
903
+ }
904
+ setThumbSizes(sizes) {
905
+ this.thumbSizes = sizes;
906
+ }
907
+ setGeometry(geometry) {
908
+ this.visuals.setGeometry(geometry);
909
+ }
910
+ /**
911
+ * The rendered value changed and the CSS already moved the thumb's rest.
912
+ * The visuals rebase so nothing moves on screen, then head for the value.
913
+ */
914
+ setValue(isOn) {
915
+ const visuals = this.visuals;
916
+ if (isOn === visuals.isOn) return;
917
+ const previous = visuals.isOn;
918
+ const time = now();
919
+ const previousSize = this.thumbSizes == null ? null : this.attachedThumb ?? this.thumbSizes[previous ? "on" : "off"];
920
+ const springs = visuals.rebaseToValue(isOn, previousSize, time);
921
+ const thumb = visuals.thumb;
922
+ if (thumb == null) {
923
+ visuals.isVisuallyOn = isOn;
924
+ return;
925
+ }
926
+ const wasDragging = this.endDragForValue();
927
+ if (springs || wasDragging || this.pendingTravel || visuals.isVisuallyOn !== isOn) {
928
+ const touchRelease = this.pendingTravel;
929
+ this.pendingTravel = false;
930
+ visuals.showSide(isOn, time, thumb.getVelocity("x", time), touchRelease);
931
+ }
932
+ }
933
+ /** The app changed the value mid-gesture: the value wins, nothing commits. */
934
+ endDragForValue() {
935
+ if (this.drag == null || this.released) return false;
936
+ this.drag = null;
937
+ this.released = true;
938
+ this.pressEnded();
939
+ return true;
940
+ }
941
+ touchDown(time) {
942
+ this.visuals.measureGeometry();
943
+ this.visuals.landBase(time);
944
+ this.released = false;
945
+ this.pendingTravel = false;
946
+ this.drag = null;
947
+ this.downOffset = this.visuals.offsetAt(time);
948
+ }
949
+ onControlEvent(event, touch) {
950
+ const travel = touch.x - touch.startX;
951
+ const time = now();
952
+ switch (event) {
953
+ case "touchDown":
954
+ this.isTracking = true;
955
+ this.touchDown(time);
956
+ return;
957
+ case "touchDragInside":
958
+ case "touchDragOutside":
959
+ if (this.released || !this.isInteractive) return;
960
+ if (this.pressTime == null) {
961
+ if (Math.abs(travel) < PAN_HYSTERESIS) return;
962
+ this.pressBegan(time);
963
+ }
964
+ this.move(time, travel);
965
+ return;
966
+ case "touchUpInside":
967
+ case "touchUpOutside":
968
+ this.isTracking = false;
969
+ if (this.released || !this.isInteractive) return;
970
+ this.move(time, travel);
971
+ if (this.drag?.flip.didFlip !== true && event === "touchUpInside") {
972
+ this.release(time, {
973
+ byBrowserClick: true,
974
+ clicksIfNoBrowserClick: touch.pointerType === "touch"
975
+ });
976
+ return;
977
+ }
978
+ if (touch.pointerType !== "touch" && (event === "touchUpOutside" || this.drag?.flip.didFlip !== true)) {
979
+ this.released = true;
980
+ this.abandon(time);
981
+ return;
982
+ }
983
+ if (this.elements != null) armClickGuard(this.elements.input.ownerDocument);
984
+ this.release(time);
985
+ return;
986
+ case "touchCancel":
987
+ this.isTracking = false;
988
+ if (!this.released) {
989
+ this.released = true;
990
+ this.abandon(time);
991
+ }
992
+ }
993
+ }
994
+ /** One event of a held or dragged switch: the thumb follows and the flip rule steps. */
995
+ move(time, travel) {
996
+ if (this.isStepping) return;
997
+ this.isStepping = true;
998
+ queueMicrotask(() => {
999
+ this.isStepping = false;
1000
+ });
1001
+ const visuals = this.visuals;
1002
+ const x = visuals.direction * travel;
1003
+ const drag = this.drag ??= {
1004
+ start: this.downOffset,
1005
+ flip: startFlip(visuals.isOn)
1006
+ };
1007
+ visuals.track(dragTarget(drag.start, x, visuals.geometry));
1008
+ drag.flip = stepFlip(drag.flip, x, visuals.geometry);
1009
+ if (drag.flip.isVisuallyOn !== visuals.isVisuallyOn) visuals.showWell(drag.flip.isVisuallyOn, time);
1010
+ }
1011
+ /**
1012
+ * The finger lifted after a tap, a hold or a drag. `byBrowserClick`: the
1013
+ * browser's own click activates the input, and the switch clicks it only
1014
+ * if that click never comes.
1015
+ */
1016
+ release(time, { byBrowserClick = false, clicksIfNoBrowserClick = true } = {}) {
1017
+ if (this.released) return;
1018
+ this.released = true;
1019
+ this.clearTimers();
1020
+ const visuals = this.visuals;
1021
+ const commit = commitOnRelease(this.drag?.flip ?? null, visuals.isOn);
1022
+ this.drag = null;
1023
+ if (this.pressTime == null) this.pressBegan(time);
1024
+ if (commit !== visuals.isOn && visuals.thumb != null && visuals.thumb.reducedMotion({ touchRelease: true }) !== "off") {
1025
+ this.pendingTravel = true;
1026
+ visuals.showWell(commit, time, true);
1027
+ } else visuals.showSide(commit, time, void 0, true);
1028
+ this.pressEnded(time, true);
1029
+ const surface = this.elements?.surface;
1030
+ if (byBrowserClick && surface != null) {
1031
+ this.endBrowserClickWait = awaitBrowserClick(surface, {
1032
+ onClicked: () => {
1033
+ this.endBrowserClickWait = null;
1034
+ this.scheduleReconcile();
1035
+ },
1036
+ onNoClick: () => {
1037
+ this.endBrowserClickWait = null;
1038
+ if (clicksIfNoBrowserClick && commit !== visuals.isOn) this.clickInput();
1039
+ this.scheduleReconcile();
1040
+ }
1041
+ });
1042
+ return;
1043
+ }
1044
+ if (commit !== visuals.isOn) this.clickInput();
1045
+ this.scheduleReconcile();
1046
+ }
1047
+ clickInput() {
1048
+ const input = this.elements?.input;
1049
+ if (input != null) clickForLift(input);
1050
+ }
1051
+ /** If the owner kept the old value, the visuals go back to it. */
1052
+ scheduleReconcile() {
1053
+ if (this.reconcileTimer != null) clearTimeout(this.reconcileTimer);
1054
+ this.reconcileTimer = setTimeout(() => {
1055
+ this.reconcileTimer = null;
1056
+ const visuals = this.visuals;
1057
+ if (this.drag == null && visuals.isVisuallyOn !== visuals.isOn) {
1058
+ this.pendingTravel = false;
1059
+ visuals.showSide(visuals.isOn, now(), void 0, true);
1060
+ }
1061
+ }, 0);
1062
+ }
1063
+ /** The touch ended without a release (cancelled, or the switch turned off). */
1064
+ abandon(time) {
1065
+ this.drag = null;
1066
+ this.visuals.showSide(this.visuals.isOn, time, void 0, true);
1067
+ this.pressEnded(time, true);
1068
+ }
1069
+ /** The press began: the switch holds the touch and the thumb lifts. */
1070
+ pressBegan(time) {
1071
+ this.pressTime = time;
1072
+ this.visuals.lift(time);
1073
+ }
1074
+ pressEnded(time = now(), touchRelease = false) {
1075
+ this.pressTime = null;
1076
+ this.visuals.settle(time, touchRelease);
1077
+ }
1078
+ clearTimers() {
1079
+ this.endBrowserClickWait?.();
1080
+ this.endBrowserClickWait = null;
1081
+ if (this.reconcileTimer != null) {
1082
+ clearTimeout(this.reconcileTimer);
1083
+ this.reconcileTimer = null;
1084
+ }
1085
+ }
1086
+ };
1087
+ //#endregion
1088
+ //#region src/Switch/useSwitchTouch.ts
1089
+ /** Whether the primary pointer is coarse now, following changes. */
1090
+ function useIsTouch() {
1091
+ const isTouch = shallowRef(false);
1092
+ if (typeof window === "undefined") return isTouch;
1093
+ isTouch.value = typeof window.matchMedia === "function" && window.matchMedia("(pointer: coarse)").matches;
1094
+ onScopeDispose(watchCoarsePointer(window, (isCoarse) => {
1095
+ isTouch.value = isCoarse;
1096
+ }));
1097
+ return isTouch;
1098
+ }
1099
+ /**
1100
+ * Switch's gestures, attached for every pointer, with the touch
1101
+ * presentation under a coarse primary pointer. Its parts are rendered and
1102
+ * styled for it whether or not it is active; it only animates and listens.
1103
+ */
1104
+ function useSwitchTouch(parts, options) {
1105
+ const isTouch = useIsTouch();
1106
+ const [width, height] = options.trackSize();
1107
+ const controller = new SwitchTouchController(options.isOn(), switchTouchGeometry(width, height));
1108
+ watch(options.isOn, (isOn) => controller.setValue(isOn), { flush: "post" });
1109
+ watch(options.trackSize, ([trackWidth, trackHeight]) => controller.setGeometry(switchTouchGeometry(trackWidth, trackHeight)));
1110
+ watch(options.thumbSizes, (sizes) => controller.setThumbSizes(sizes), { immediate: true });
1111
+ watch(options.isInteractive, (isInteractive) => controller.setInteractive(isInteractive), {
1112
+ immediate: true,
1113
+ flush: "sync"
1114
+ });
1115
+ watch(() => [
1116
+ parts.surface.value,
1117
+ parts.input.value,
1118
+ parts.thumb.value,
1119
+ parts.track.value,
1120
+ isTouch.value,
1121
+ options.isDisabled()
1122
+ ], ([surface, input, thumb, track, touch, isDisabled], _previous, onCleanup) => {
1123
+ if (isDisabled || surface == null || input == null || thumb == null || track == null) return;
1124
+ controller.attach({
1125
+ surface,
1126
+ input,
1127
+ thumb,
1128
+ track
1129
+ }, touch ? "touch" : "pointer");
1130
+ onCleanup(() => controller.detach());
1131
+ }, {
1132
+ immediate: true,
1133
+ flush: "post"
1134
+ });
1135
+ }
1136
+ //#endregion
1137
+ //#region src/Switch/Switch.vue
1138
+ const _hoisted_1 = [
1139
+ "data-size",
1140
+ "data-label-position",
1141
+ "data-label-spacing",
1142
+ "data-status",
1143
+ "data-blocked"
1144
+ ];
1145
+ const _hoisted_2 = [
1146
+ "id",
1147
+ "checked",
1148
+ "name",
1149
+ "form",
1150
+ "readonly",
1151
+ "required",
1152
+ "aria-checked",
1153
+ "aria-labelledby",
1154
+ "aria-describedby",
1155
+ "aria-disabled",
1156
+ "aria-readonly",
1157
+ "aria-busy",
1158
+ "aria-required",
1159
+ "aria-invalid"
1160
+ ];
1161
+ const _hoisted_3 = {
1162
+ key: 0,
1163
+ class: "astryx-switch-spinner"
1164
+ };
1165
+ const _hoisted_4 = { class: "astryx-switch-label" };
1166
+ const _sfc_main = /*@__PURE__*/ defineComponent({
1167
+ name: "AstryxSwitch",
1168
+ inheritAttrs: false,
1169
+ __name: "Switch",
1170
+ props: /*@__PURE__*/ mergeModels({
1171
+ id: {},
1172
+ size: { default: "md" },
1173
+ labelPosition: { default: "end" },
1174
+ labelSpacing: { default: "hug" },
1175
+ isReadOnly: { type: Boolean },
1176
+ disabledMessage: {},
1177
+ status: {},
1178
+ statusVariant: { default: "detached" },
1179
+ changeAction: {},
1180
+ isLoading: { type: Boolean },
1181
+ description: {},
1182
+ width: {},
1183
+ hasAutoFocus: { type: Boolean },
1184
+ htmlName: {},
1185
+ form: {},
1186
+ loadingLabel: {},
1187
+ label: {},
1188
+ isLabelHidden: { type: Boolean },
1189
+ isDisabled: { type: Boolean },
1190
+ isOptional: { type: Boolean },
1191
+ isRequired: { type: Boolean },
1192
+ labelIcon: {},
1193
+ labelTooltip: {},
1194
+ optionalLabel: {},
1195
+ requiredLabel: {},
1196
+ targetClass: {}
1197
+ }, {
1198
+ "modelValue": {
1199
+ type: Boolean,
1200
+ required: true
1201
+ },
1202
+ "modelModifiers": {}
1203
+ }),
1204
+ emits: /*@__PURE__*/ mergeModels(["change", "actionError"], ["update:modelValue"]),
1205
+ setup(__props, { expose: __expose, emit: __emit }) {
1206
+ const props = __props;
1207
+ const emit = __emit;
1208
+ const TRACK_SIZE = {
1209
+ sm: [32, 20],
1210
+ md: [40, 24],
1211
+ lg: [52, 28]
1212
+ };
1213
+ const THUMB_SIZE = {
1214
+ sm: {
1215
+ off: 14,
1216
+ on: 16
1217
+ },
1218
+ md: {
1219
+ off: 16,
1220
+ on: 20
1221
+ },
1222
+ lg: {
1223
+ off: 20,
1224
+ on: 24
1225
+ }
1226
+ };
1227
+ const ariaRequired$1 = computed(() => ariaRequired(props.isRequired, props.isOptional, void 0));
1228
+ const messages = useComponentMessages({ switch: switchMessages });
1229
+ const announce = useAnnounce();
1230
+ const press = usePressFeedback({ hasOverlay: false });
1231
+ const model = useModel(__props, "modelValue");
1232
+ const attrs = useAttrs();
1233
+ const input = useTemplateRef("input");
1234
+ const control = useTemplateRef("control");
1235
+ const track = useTemplateRef("track");
1236
+ const thumb = useTemplateRef("thumb");
1237
+ const generatedId = `astryx-switch-${useId()}`;
1238
+ const inputId = computed(() => props.id ?? generatedId);
1239
+ const descriptionId = computed(() => props.description ? `${inputId.value}-description` : void 0);
1240
+ const statusId = computed(() => props.status?.message ? props.status.messageId ?? `${inputId.value}-status` : void 0);
1241
+ const disabledId = `${generatedId}-disabled`;
1242
+ const showsDisabledMessage = computed(() => !!props.isDisabled && !!props.disabledMessage?.trim());
1243
+ const tooltip = useButtonTooltip(showsDisabledMessage);
1244
+ const action = useSwitchAction({
1245
+ model,
1246
+ changeAction: () => props.changeAction,
1247
+ emitChange: (value, event) => emit("change", value, event),
1248
+ emitError: (error, value, event) => emit("actionError", error, value, event)
1249
+ });
1250
+ const busy = computed(() => !!props.isLoading || action.isPending.value);
1251
+ const blocked = computed(() => props.isDisabled || props.isReadOnly || busy.value);
1252
+ useTouchHitArea(control, () => !blocked.value);
1253
+ useSwitchTouch({
1254
+ surface: control,
1255
+ input,
1256
+ thumb,
1257
+ track
1258
+ }, {
1259
+ isOn: () => action.value.value,
1260
+ isInteractive: () => !blocked.value,
1261
+ isDisabled: () => !!props.isDisabled,
1262
+ trackSize: () => TRACK_SIZE[props.size],
1263
+ thumbSizes: () => THUMB_SIZE[props.size]
1264
+ });
1265
+ const loadingText = computed(() => props.loadingLabel || messages.value.switch.loading);
1266
+ watch(busy, (isBusy) => {
1267
+ if (isBusy) announce(loadingText.value);
1268
+ }, { immediate: true });
1269
+ const widthStyle = computed(() => ({ width: typeof props.width === "number" ? `${props.width}px` : props.width }));
1270
+ const element = computed(() => input.value ?? null);
1271
+ function focus(options) {
1272
+ input.value?.focus(options);
1273
+ }
1274
+ function blur() {
1275
+ input.value?.blur();
1276
+ }
1277
+ __expose({
1278
+ element,
1279
+ focus,
1280
+ blur
1281
+ });
1282
+ const controlledAttrs = /* @__PURE__ */ new Set([
1283
+ "class",
1284
+ "style",
1285
+ "id",
1286
+ "type",
1287
+ "checked",
1288
+ "disabled",
1289
+ "readonly",
1290
+ "autofocus",
1291
+ "role",
1292
+ "aria-checked",
1293
+ "aria-labelledby",
1294
+ "aria-describedby",
1295
+ "aria-disabled",
1296
+ "aria-readonly",
1297
+ "aria-required",
1298
+ "aria-busy"
1299
+ ]);
1300
+ function inputAttrs() {
1301
+ return Object.fromEntries(Object.entries(withholdCallerHandlers(attrs, !!props.isDisabled)).filter(([key]) => !controlledAttrs.has(key)));
1302
+ }
1303
+ function describedBy() {
1304
+ return [
1305
+ attrs["aria-describedby"],
1306
+ descriptionId.value,
1307
+ statusId.value,
1308
+ showsDisabledMessage.value ? disabledId : void 0
1309
+ ].filter(Boolean).join(" ") || void 0;
1310
+ }
1311
+ function labelledBy() {
1312
+ const external = attrs["aria-labelledby"];
1313
+ if (typeof external === "string" && external.trim() !== "") return external;
1314
+ return `${inputId.value}-label`;
1315
+ }
1316
+ function syncNative() {
1317
+ if (input.value) input.value.checked = action.value.value;
1318
+ }
1319
+ function click(event) {
1320
+ if (blocked.value) {
1321
+ event.preventDefault();
1322
+ nextTick(syncNative);
1323
+ }
1324
+ }
1325
+ function change(event) {
1326
+ if (!blocked.value && input.value) action.commit(input.value.checked, event);
1327
+ nextTick(syncNative);
1328
+ }
1329
+ function reset(event) {
1330
+ if (event.target === input.value?.form) nextTick(syncNative);
1331
+ }
1332
+ function keydown(event) {
1333
+ if (event.key === "Escape") tooltip.hideImmediately();
1334
+ }
1335
+ let ownerDocument;
1336
+ onMounted(() => {
1337
+ syncNative();
1338
+ ownerDocument = input.value?.ownerDocument;
1339
+ ownerDocument?.addEventListener("reset", reset, true);
1340
+ if (props.hasAutoFocus) focus({ preventScroll: true });
1341
+ });
1342
+ onUpdated(syncNative);
1343
+ onBeforeUnmount(() => ownerDocument?.removeEventListener("reset", reset, true));
1344
+ return (_ctx, _cache) => {
1345
+ return openBlock(), createElementBlock(Fragment, null, [createElementVNode("div", {
1346
+ class: normalizeClass(["astryx-switch", unref(attrs).class]),
1347
+ style: normalizeStyle([widthStyle.value, unref(attrs).style]),
1348
+ "data-size": __props.size,
1349
+ "data-label-position": __props.labelPosition !== "end" ? __props.labelPosition : void 0,
1350
+ "data-label-spacing": __props.labelSpacing !== "hug" ? __props.labelSpacing : void 0,
1351
+ "data-status": __props.status?.type,
1352
+ "data-blocked": blocked.value || void 0
1353
+ }, [
1354
+ createElementVNode("div", mergeProps({ class: "astryx-switch-row" }, blocked.value ? void 0 : unref(press).pressableProps, {
1355
+ onPointerenter: _cache[2] || (_cache[2] = (...args) => unref(tooltip).onPointerEnter && unref(tooltip).onPointerEnter(...args)),
1356
+ onPointerleave: _cache[3] || (_cache[3] = (...args) => unref(tooltip).onPointerLeave && unref(tooltip).onPointerLeave(...args))
1357
+ }), [createElementVNode("span", {
1358
+ ref_key: "control",
1359
+ ref: control,
1360
+ class: "astryx-switch-control"
1361
+ }, [createElementVNode("input", mergeProps(inputAttrs(), {
1362
+ id: inputId.value,
1363
+ ref_key: "input",
1364
+ ref: input,
1365
+ class: "astryx-switch-native",
1366
+ type: "checkbox",
1367
+ role: "switch",
1368
+ checked: unref(action).value.value,
1369
+ name: __props.isDisabled ? void 0 : __props.htmlName ?? inputAttrs().name,
1370
+ form: __props.isDisabled ? "" : inputAttrs().form,
1371
+ readonly: __props.isReadOnly || showsDisabledMessage.value,
1372
+ required: __props.isRequired && !__props.isOptional,
1373
+ "aria-checked": unref(action).value.value,
1374
+ "aria-labelledby": labelledBy(),
1375
+ "aria-describedby": describedBy(),
1376
+ "aria-disabled": __props.isDisabled || void 0,
1377
+ "aria-readonly": __props.isReadOnly || void 0,
1378
+ "aria-busy": busy.value || void 0,
1379
+ "aria-required": ariaRequired$1.value,
1380
+ "aria-invalid": __props.status?.type === "error" ? true : __props.isRequired ? false : inputAttrs()["aria-invalid"],
1381
+ onClick: click,
1382
+ onChange: change,
1383
+ onKeydown: keydown,
1384
+ onFocus: _cache[0] || (_cache[0] = (...args) => unref(tooltip).onFocus && unref(tooltip).onFocus(...args)),
1385
+ onBlur: _cache[1] || (_cache[1] = (...args) => unref(tooltip).onBlur && unref(tooltip).onBlur(...args))
1386
+ }), null, 16, _hoisted_2), createElementVNode("span", {
1387
+ ref_key: "track",
1388
+ ref: track,
1389
+ class: "astryx-switch-track",
1390
+ "aria-hidden": "true"
1391
+ }, [createElementVNode("span", {
1392
+ ref_key: "thumb",
1393
+ ref: thumb,
1394
+ class: "astryx-switch-thumb"
1395
+ }, null, 512), busy.value ? (openBlock(), createElementBlock("span", _hoisted_3)) : createCommentVNode("v-if", true)], 512)], 512), createElementVNode("div", _hoisted_4, [createVNode(_sfc_main$3, {
1396
+ label: __props.label,
1397
+ "input-id": inputId.value,
1398
+ "label-id": `${inputId.value}-label`,
1399
+ description: __props.description,
1400
+ "description-id": descriptionId.value,
1401
+ "is-label-hidden": __props.isLabelHidden,
1402
+ "is-disabled": __props.isDisabled,
1403
+ "is-optional": __props.isOptional,
1404
+ "is-required": __props.isRequired,
1405
+ "target-class": "astryx-switch-label",
1406
+ "label-icon": __props.labelIcon,
1407
+ "label-tooltip": __props.labelTooltip,
1408
+ "optional-label": __props.optionalLabel,
1409
+ "required-label": __props.requiredLabel
1410
+ }, createSlots({ _: 2 }, [_ctx.$slots.labelIcon ? {
1411
+ name: "labelIcon",
1412
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "labelIcon")]),
1413
+ key: "0"
1414
+ } : void 0]), 1032, [
1415
+ "label",
1416
+ "input-id",
1417
+ "label-id",
1418
+ "description",
1419
+ "description-id",
1420
+ "is-label-hidden",
1421
+ "is-disabled",
1422
+ "is-optional",
1423
+ "is-required",
1424
+ "label-icon",
1425
+ "label-tooltip",
1426
+ "optional-label",
1427
+ "required-label"
1428
+ ])])], 16),
1429
+ __props.status?.message ? (openBlock(), createBlock(_sfc_main$4, {
1430
+ key: 0,
1431
+ id: statusId.value,
1432
+ type: __props.status.type,
1433
+ message: __props.status.message,
1434
+ variant: __props.statusVariant === "attached" ? "attached" : "detached"
1435
+ }, null, 8, [
1436
+ "id",
1437
+ "type",
1438
+ "message",
1439
+ "variant"
1440
+ ])) : createCommentVNode("v-if", true),
1441
+ showsDisabledMessage.value ? (openBlock(), createBlock(_sfc_main$1, {
1442
+ key: 1,
1443
+ id: disabledId
1444
+ }, {
1445
+ default: withCtx(() => [createTextVNode(toDisplayString(__props.disabledMessage), 1)]),
1446
+ _: 1
1447
+ })) : createCommentVNode("v-if", true)
1448
+ ], 14, _hoisted_1), showsDisabledMessage.value ? (openBlock(), createBlock(_sfc_main$2, {
1449
+ key: 0,
1450
+ id: `${generatedId}-tooltip`,
1451
+ anchor: input.value,
1452
+ open: unref(tooltip).isOpen.value,
1453
+ text: __props.disabledMessage ?? "",
1454
+ onPointerEnter: unref(tooltip).onTooltipPointerEnter,
1455
+ onPointerLeave: unref(tooltip).onTooltipPointerLeave
1456
+ }, null, 8, [
1457
+ "id",
1458
+ "anchor",
1459
+ "open",
1460
+ "text",
1461
+ "onPointerEnter",
1462
+ "onPointerLeave"
1463
+ ])) : createCommentVNode("v-if", true)], 64);
1464
+ };
1465
+ }
1466
+ });
1467
+ //#endregion
1468
+ export { _sfc_main as t };