@astryx-vue/core 0.2.5 → 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 (409) hide show
  1. package/THIRD_PARTY_NOTICES.md +9 -0
  2. package/dist/AlertDialog/index.js +1 -1
  3. package/dist/{AlertDialog-B6UeBCE7.js → AlertDialog-RAVA_cT1.js} +13 -7
  4. package/dist/AppShell/index.d.ts +1 -1
  5. package/dist/AppShell/index.js +1 -1
  6. package/dist/{AppShell-CeBmB0Q9.js → AppShell-0wTvOo3H.js} +3 -3
  7. package/dist/Avatar/index.d.ts +2 -2
  8. package/dist/Avatar/index.js +1 -1
  9. package/dist/{Avatar-BB4Z4LF1.js → Avatar-pPZ4dI_s.js} +161 -16
  10. package/dist/AvatarGroup/index.d.ts +2 -2
  11. package/dist/AvatarGroup/index.js +1 -1
  12. package/dist/AvatarGroup-B--NQSB3.js +98 -0
  13. package/dist/Banner/index.d.ts +1 -1
  14. package/dist/Banner/index.js +1 -1
  15. package/dist/{Banner-CJe9Im5a.js → Banner-GbGxrqQO.js} +1 -1
  16. package/dist/BottomSheet/index.d.ts +1 -1
  17. package/dist/BottomSheet/index.js +2 -2
  18. package/dist/{BottomSheet-o7xw-TOi.js → BottomSheet-JYMB_Ofl.js} +12 -9
  19. package/dist/{BottomSheet-BV6vfgGu.js → BottomSheet-pt7m4CvC.js} +3 -1
  20. package/dist/Breadcrumbs/index.d.ts +1 -1
  21. package/dist/Breadcrumbs/index.js +2 -2
  22. package/dist/{Breadcrumbs-D6G7f5WL.js → Breadcrumbs-DIm4figq.js} +22 -11
  23. package/dist/Button/index.d.ts +1 -1
  24. package/dist/Button/index.js +1 -1
  25. package/dist/{Button-DrqeomlE.js → Button-B6Hj_O_s.js} +3 -1
  26. package/dist/ButtonGroup/index.d.ts +1 -1
  27. package/dist/Calendar/index.d.ts +1 -1
  28. package/dist/Calendar/index.js +1 -1
  29. package/dist/{Calendar-DmTeM7PO.js → Calendar-B7vIowKq.js} +2 -2
  30. package/dist/Card/index.d.ts +1 -1
  31. package/dist/Card/index.js +1 -1
  32. package/dist/{Card-HAjZQg2s.js → Card-B-I24X9S.js} +2 -0
  33. package/dist/Carousel/index.d.ts +1 -1
  34. package/dist/Carousel/index.js +1 -1
  35. package/dist/{Carousel-CIKrcA2r.js → Carousel-CA8zpD9v.js} +48 -31
  36. package/dist/Center/index.d.ts +1 -1
  37. package/dist/Chat/index.d.ts +2 -2
  38. package/dist/Chat/index.js +1 -1
  39. package/dist/{Chat-BFox3u9D.js → Chat-Bmna9EOA.js} +98 -61
  40. package/dist/CheckboxInput/index.d.ts +1 -1
  41. package/dist/CheckboxInput/index.js +1 -1
  42. package/dist/{CheckboxInput-25Q8ItH-.js → CheckboxInput-BS9J6edf.js} +2 -2
  43. package/dist/CheckboxList/index.d.ts +1 -1
  44. package/dist/CheckboxList/index.js +1 -1
  45. package/dist/{CheckboxList-BlPf7vPe.js → CheckboxList-CX1i_jVP.js} +8 -7
  46. package/dist/Citation/index.js +1 -1
  47. package/dist/{Citation-BG-vg9ia.js → Citation-Djgwa0ko.js} +1 -1
  48. package/dist/ClickableCard/index.d.ts +1 -1
  49. package/dist/ClickableCard/index.js +1 -1
  50. package/dist/{ClickableCard-Bhds4RRe.js → ClickableCard-DUsC-j03.js} +1 -1
  51. package/dist/Code/index.d.ts +1 -1
  52. package/dist/Code/index.js +1 -1
  53. package/dist/{CodeBlock-B2pnEOJY.js → CodeBlock-D0BFubut.js} +5 -1
  54. package/dist/Collapsible/index.d.ts +2 -2
  55. package/dist/Collapsible/index.js +2 -2
  56. package/dist/{Collapsible-3YerR-FO.js → Collapsible-Cov3Pyq5.js} +67 -22
  57. package/dist/CommandPalette/index.d.ts +2 -2
  58. package/dist/CommandPalette/index.js +1 -1
  59. package/dist/{CommandPalette-DKgHzmJk.js → CommandPalette-YHsUNg3V.js} +60 -20
  60. package/dist/ComplexSelector/index.d.ts +1 -1
  61. package/dist/ComplexSelector/index.js +1 -1
  62. package/dist/{ComplexSelector-Dv44FFhN.js → ComplexSelector-DWLdKPGI.js} +41 -9
  63. package/dist/ContextMenu/index.d.ts +1 -1
  64. package/dist/ContextMenu/index.js +2 -2
  65. package/dist/{ContextMenu-BeJO5HYx.js → ContextMenu-Bq9b3Ti5.js} +15 -8
  66. package/dist/DateInput/index.d.ts +1 -1
  67. package/dist/DateInput/index.js +1 -1
  68. package/dist/DateInput-DT518j5E.js +841 -0
  69. package/dist/DateRangeInput/index.d.ts +1 -1
  70. package/dist/DateRangeInput/index.js +1 -1
  71. package/dist/{DateRangeInput-Cp6AZfew.js → DateRangeInput-Bqi5tlIA.js} +188 -140
  72. package/dist/DateTimeInput/index.d.ts +1 -1
  73. package/dist/DateTimeInput/index.js +1 -1
  74. package/dist/{DateTimeInput-B6MPPp76.js → DateTimeInput-A7m2O3bg.js} +43 -12
  75. package/dist/Dialog/index.d.ts +1 -1
  76. package/dist/Dialog/index.js +2 -2
  77. package/dist/{Dialog-CvRplBo-.js → Dialog-BiOSKQso.js} +9 -5
  78. package/dist/{Dialog-rfUt3y8P.js → Dialog-FGHfDu5M.js} +1 -1
  79. package/dist/Divider/index.d.ts +1 -1
  80. package/dist/DropdownMenu/index.js +3 -3
  81. package/dist/{DropdownMenu-6E9jFdFe.js → DropdownMenu-CoOQVlRp.js} +9 -10
  82. package/dist/{DropdownMenu--lnUeJEG.js → DropdownMenu-DEb2dSSP.js} +44 -33
  83. package/dist/EmptyState/index.js +1 -1
  84. package/dist/{EmptyState-0RWymQUS.js → EmptyState-C_GH7IV5.js} +2 -2
  85. package/dist/Field/index.d.ts +2 -2
  86. package/dist/Field/index.js +2 -2
  87. package/dist/{Field-8zRxzDHE.js → Field-D5gUEGw4.js} +1 -1
  88. package/dist/FieldInfoTip-Ds-sW_jY.js +98 -0
  89. package/dist/FieldLabel-BNeXRuGH.js +95 -0
  90. package/dist/FieldStatus/index.d.ts +1 -1
  91. package/dist/FileInput/index.d.ts +1 -1
  92. package/dist/FileInput/index.js +1 -1
  93. package/dist/FileInput-BpdiO1V8.js +285 -0
  94. package/dist/Grid/index.d.ts +1 -1
  95. package/dist/Heading/index.d.ts +1 -1
  96. package/dist/Heading/index.js +1 -1
  97. package/dist/{Heading-B9C3LZlS.js → Heading-BnwWEWkp.js} +7 -2
  98. package/dist/HoverCard/index.d.ts +2 -2
  99. package/dist/HoverCard/index.js +2 -2
  100. package/dist/HoverCard-ycY50pRN.js +492 -0
  101. package/dist/IconButton/index.js +1 -1
  102. package/dist/{IconButton-BNQuz9W_.js → IconButton-DDNgNl7B.js} +1 -1
  103. package/dist/InputGroup/index.d.ts +1 -1
  104. package/dist/InputGroup/index.js +1 -1
  105. package/dist/{InputGroup-BzR6JRZb.js → InputGroup-CA03Smrs.js} +1 -1
  106. package/dist/InternationalizationProvider/index.d.ts +2 -0
  107. package/dist/InternationalizationProvider/index.js +2 -0
  108. package/dist/InternationalizationProvider-DJay_w3B.js +170 -0
  109. package/dist/{Item-DrYJL1TG.js → Item-KhFKX9St.js} +15 -6
  110. package/dist/LayerProvider/index.d.ts +2 -0
  111. package/dist/LayerProvider/index.js +3 -0
  112. package/dist/LayerProvider-D9NsQFzL.js +73 -0
  113. package/dist/Layout/index.d.ts +1 -1
  114. package/dist/Layout/index.js +2 -2
  115. package/dist/{Layout-Bed3kP0M.js → Layout-C6RHllr-.js} +2 -2
  116. package/dist/{LayoutPanel-C34uOq3e.js → LayoutPanel-DXOsaeQb.js} +4 -1
  117. package/dist/Lightbox/index.js +1 -1
  118. package/dist/{Lightbox-Br3o0SyQ.js → Lightbox-DTF9EdTG.js} +2 -2
  119. package/dist/Link/index.d.ts +2 -2
  120. package/dist/Link/index.js +1 -1
  121. package/dist/{Link-DCZ6922-.js → Link-BqHCtiyt.js} +26 -7
  122. package/dist/LinkProvider/index.d.ts +2 -0
  123. package/dist/LinkProvider/index.js +3 -0
  124. package/dist/LinkProvider-Qsps9_mL.js +17 -0
  125. package/dist/List/index.d.ts +1 -1
  126. package/dist/List/index.js +2 -2
  127. package/dist/{ListItem-CcRHWuEm.js → ListItem-8RWT8XAG.js} +1 -1
  128. package/dist/Markdown/index.d.ts +1 -1
  129. package/dist/Markdown/index.js +1 -1
  130. package/dist/{Markdown-Bz0R3kNj.js → Markdown-CvtN7HnF.js} +4 -4
  131. package/dist/MetadataList/index.js +1 -1
  132. package/dist/{MetadataList-CFaocx6j.js → MetadataList-B-OelQlt.js} +1 -1
  133. package/dist/MobileNav/index.js +1 -1
  134. package/dist/{MobileNavToggle-Dh3uLivq.js → MobileNavToggle-DxGz0xKA.js} +11 -5
  135. package/dist/MoreMenu/index.d.ts +1 -1
  136. package/dist/MoreMenu/index.js +1 -1
  137. package/dist/{MoreMenu-B95nRSe8.js → MoreMenu-Dlb7MLlW.js} +33 -20
  138. package/dist/MultiSelector/index.d.ts +1 -1
  139. package/dist/MultiSelector/index.js +1 -1
  140. package/dist/{MultiSelector-DuF5TECE.js → MultiSelector-BtAUfQ3t.js} +122 -54
  141. package/dist/{NavDisclosure-C6sPZ89n.js → NavDisclosure-C_fugrQ3.js} +1 -2
  142. package/dist/{NavHeadingSurface-Cb3x9iDx.js → NavHeadingSurface-B3yJspSN.js} +18 -11
  143. package/dist/NavItem/index.d.ts +1 -1
  144. package/dist/NavItem/index.js +2 -2
  145. package/dist/{NavItem-FFOisITc.js → NavItem-BBIGSvDj.js} +7 -3
  146. package/dist/NavMenu/index.d.ts +1 -1
  147. package/dist/NavMenu/index.js +3 -3
  148. package/dist/{NavMenu-ClIgMaxE.js → NavMenu-ThXguZAz.js} +7 -3
  149. package/dist/{NavMenuItem-E7S8gBh-.js → NavMenuItem-BvJNsDFC.js} +8 -4
  150. package/dist/NumberInput/index.d.ts +1 -1
  151. package/dist/NumberInput/index.js +1 -1
  152. package/dist/NumberInput-AZ9x3oja.js +473 -0
  153. package/dist/Outline/index.js +1 -1
  154. package/dist/{Outline-DBUuchi9.js → Outline-755h-lMP.js} +1 -1
  155. package/dist/OverflowList/index.d.ts +1 -1
  156. package/dist/OverflowList/index.js +1 -1
  157. package/dist/{OverflowList-aDd_oem0.js → OverflowList-NmrSMbxb.js} +10 -6
  158. package/dist/Pagination/index.d.ts +1 -1
  159. package/dist/Pagination/index.js +1 -1
  160. package/dist/{Pagination-CNe9F6Fl.js → Pagination-DqwNQFRp.js} +29 -14
  161. package/dist/Popover/index.d.ts +3 -3
  162. package/dist/Popover/index.js +2 -2
  163. package/dist/Popover-DJf8POzL.js +308 -0
  164. package/dist/PowerSearch/index.d.ts +1 -1
  165. package/dist/PowerSearch/index.js +1 -1
  166. package/dist/{PowerSearch-C6U8Sq1Y.js → PowerSearch-DvjiPqMZ.js} +44 -31
  167. package/dist/ProgressBar/index.d.ts +1 -1
  168. package/dist/ProgressBar/index.js +1 -1
  169. package/dist/{ProgressBar-DF6WZNCI.js → ProgressBar-CVLzdoBK.js} +9 -3
  170. package/dist/Radio/index.d.ts +1 -1
  171. package/dist/Radio/index.js +1 -1
  172. package/dist/{RadioGroup-CBqUPq_L.js → RadioGroup-Bfu6JSNV.js} +60 -24
  173. package/dist/RadioList/index.d.ts +1 -1
  174. package/dist/RadioList/index.js +1 -1
  175. package/dist/{RadioList-CPOJn9Th.js → RadioList-xY1cwLdZ.js} +4 -1
  176. package/dist/Resizable/index.d.ts +1 -1
  177. package/dist/Resizable/index.js +1 -1
  178. package/dist/{ResizeHandle-DYy0e3v9.js → ResizeHandle-q4nD_586.js} +1 -1
  179. package/dist/ScrollableArea/index.d.ts +1 -1
  180. package/dist/ScrollableArea/index.js +1 -1
  181. package/dist/{ScrollableArea-DQDYjnxO.js → ScrollableArea-D4dCJv9I.js} +14 -3
  182. package/dist/Scrollbars/index.d.ts +2 -0
  183. package/dist/Scrollbars/index.js +3 -0
  184. package/dist/Scrollbars-D_93hJYK.js +75 -0
  185. package/dist/Section/index.d.ts +2 -1
  186. package/dist/Section/index.js +1 -1
  187. package/dist/{Section-C48Wqfc7.js → Section-v2QuWBBJ.js} +1 -1
  188. package/dist/SegmentedControl/index.d.ts +1 -1
  189. package/dist/SelectableCard/index.d.ts +1 -1
  190. package/dist/SelectableCard/index.js +1 -1
  191. package/dist/{SelectableCard-Bj5s_tIN.js → SelectableCard-Cku4dRzc.js} +1 -1
  192. package/dist/Selector/index.d.ts +1 -1
  193. package/dist/Selector/index.js +1 -1
  194. package/dist/{Selector-5N-hq2nF.js → Selector-DJ2BhUTV.js} +90 -31
  195. package/dist/SideNav/index.d.ts +2 -2
  196. package/dist/SideNav/index.js +1 -1
  197. package/dist/{SideNav-CT9lfspi.js → SideNav-BF8mYDxl.js} +76 -44
  198. package/dist/Slider/index.d.ts +1 -1
  199. package/dist/Slider/index.js +1 -1
  200. package/dist/{Slider-D8h_RKcF.js → Slider-DWobsPgm.js} +2 -2
  201. package/dist/Stack/index.d.ts +2 -2
  202. package/dist/Stack/index.js +2 -2
  203. package/dist/{Stack-iv52y_Jv.js → Stack-CTsTFfar.js} +18 -3
  204. package/dist/{Stack-gGcYdOAh.js → Stack-kQlYbbL4.js} +22 -7
  205. package/dist/StatusDot/index.d.ts +1 -1
  206. package/dist/StatusDot/index.js +1 -1
  207. package/dist/StatusDot-BPUhMOff.js +45 -0
  208. package/dist/Stepper/index.d.ts +1 -1
  209. package/dist/Stepper/index.js +1 -1
  210. package/dist/{Stepper-BqhVCgC-.js → Stepper-CE8dHysu.js} +1 -1
  211. package/dist/Switch/index.d.ts +1 -1
  212. package/dist/Switch/index.js +1 -1
  213. package/dist/{Switch-SesQzPGZ.js → Switch-DaVPRxvN.js} +2 -2
  214. package/dist/TabList/index.d.ts +2 -2
  215. package/dist/TabList/index.js +1 -1
  216. package/dist/{TabList-BlzkrObv.js → TabList-DIkK9sgK.js} +100 -23
  217. package/dist/Table/index.d.ts +3 -3
  218. package/dist/Table/index.js +2 -2
  219. package/dist/{Table-CsdH8fCB.js → Table-fecqnm7P.js} +870 -241
  220. package/dist/Text/index.d.ts +2 -2
  221. package/dist/Text/index.js +1 -1
  222. package/dist/{Text-DIzZw6FA.js → Text-CV3LmscH.js} +7 -2
  223. package/dist/TextArea/index.d.ts +1 -1
  224. package/dist/TextArea/index.js +1 -1
  225. package/dist/{TextArea-CPwSytdO.js → TextArea-Ab5Sw60T.js} +24 -14
  226. package/dist/TextInput/index.d.ts +1 -1
  227. package/dist/TextInput/index.js +1 -1
  228. package/dist/{TextInput-BasnjVvy.js → TextInput-zFT1_qgI.js} +21 -24
  229. package/dist/Thumbnail/index.js +1 -1
  230. package/dist/{Thumbnail-BnQwX1cQ.js → Thumbnail-C3NnJUFG.js} +5 -5
  231. package/dist/TimeField-CoHDGmsP.js +435 -0
  232. package/dist/TimeInput/index.d.ts +1 -1
  233. package/dist/TimeInput/index.js +1 -1
  234. package/dist/{TimeInput-C9gptCOK.js → TimeInput-D2k3Ux3p.js} +14 -2
  235. package/dist/Timer/index.d.ts +1 -1
  236. package/dist/Timer/index.js +1 -1
  237. package/dist/{Timer-kxzQx3tp.js → Timer-avMQk5DN.js} +1 -1
  238. package/dist/Timestamp/index.d.ts +1 -1
  239. package/dist/Timestamp/index.js +1 -1
  240. package/dist/{Timestamp-D7bd_nF3.js → Timestamp-xpQKCk0d.js} +7 -7
  241. package/dist/Toast/index.d.ts +3 -2
  242. package/dist/Toast/index.js +1 -1
  243. package/dist/{Toast-C2ML-bmi.js → Toast-BuqIZV5z.js} +136 -38
  244. package/dist/ToggleButton/index.d.ts +1 -1
  245. package/dist/ToggleButton/index.js +1 -1
  246. package/dist/{ToggleButton-BB_I8EdM.js → ToggleButton-B-C-Q7XP.js} +1 -1
  247. package/dist/Token/index.d.ts +1 -1
  248. package/dist/Token/index.js +1 -1
  249. package/dist/{Token-D2GsI_Ei.js → Token-DsntTYhQ.js} +33 -17
  250. package/dist/Tokenizer/index.d.ts +1 -1
  251. package/dist/Tokenizer/index.js +1 -1
  252. package/dist/Tokenizer-B5C_qY7t.js +585 -0
  253. package/dist/Toolbar/index.d.ts +2 -1
  254. package/dist/Tooltip/index.d.ts +2 -2
  255. package/dist/Tooltip/index.js +2 -2
  256. package/dist/Tooltip-C4Vaqd3G.js +320 -0
  257. package/dist/TopNav/index.d.ts +1 -1
  258. package/dist/TopNav/index.js +1 -1
  259. package/dist/{TopNav-arWFLTBM.js → TopNav-Ciq0l1w7.js} +122 -84
  260. package/dist/TreeList/index.d.ts +1 -1
  261. package/dist/TreeList/index.js +1 -1
  262. package/dist/{TreeList-C9xvMpJZ.js → TreeList-BUz-KZJd.js} +90 -40
  263. package/dist/Typeahead/index.d.ts +1 -1
  264. package/dist/Typeahead/index.js +2 -2
  265. package/dist/Typeahead-JP9RT87x.js +656 -0
  266. package/dist/{TypeaheadMenu-BEObzonz.js → TypeaheadMenu-DBW6rHeO.js} +133 -44
  267. package/dist/composables/index.d.ts +3 -3
  268. package/dist/composables/index.js +12 -7
  269. package/dist/{composables-CWw6t-RJ.js → composables-CbKx9C1Y.js} +424 -4
  270. package/dist/context-C_peZbXf.js +16 -0
  271. package/dist/context-M-er0-Rk.js +99 -0
  272. package/dist/{context-CPh7kE-a.js → context-iABt_ueM.js} +30 -4
  273. package/dist/{index-CLmKfnqf.d.ts → index-0QGtSf3r.d.ts} +2 -0
  274. package/dist/{index-z3uLM1O6.d.ts → index-B1WJxt-n.d.ts} +1 -1
  275. package/dist/{index-BPwD6aBv.d.ts → index-B3Fomy15.d.ts} +2 -2
  276. package/dist/{index-CPwzSbQQ.d.ts → index-B42oE_F-.d.ts} +17 -1
  277. package/dist/{index-EFqQF2Bx.d.ts → index-B4OOtNP8.d.ts} +2 -2
  278. package/dist/index-B7yhzGUT.d.ts +171 -0
  279. package/dist/{index-DFbvnBlf.d.ts → index-B9e52paP.d.ts} +15 -2
  280. package/dist/{index-CEB7Ywvw.d.ts → index-BKnyTWPM.d.ts} +1 -1
  281. package/dist/{index-CsVS37na.d.ts → index-BNbAJV9C.d.ts} +1 -1
  282. package/dist/index-BTK7aStw.d.ts +88 -0
  283. package/dist/{index-BBtJt5_A.d.ts → index-BULhhnGf.d.ts} +1 -1
  284. package/dist/{index-D7-WTV6I.d.ts → index-BVKivP59.d.ts} +2 -2
  285. package/dist/{index-BpH4wvsg.d.ts → index-BgT6mH3U.d.ts} +2 -2
  286. package/dist/{index-Be1czg3M.d.ts → index-BhpAUzUr.d.ts} +47 -7
  287. package/dist/{index-BcJBLWJ0.d.ts → index-BkjSF265.d.ts} +67 -4
  288. package/dist/{index-DxR1FChm.d.ts → index-Bu8NA2SD.d.ts} +49 -6
  289. package/dist/{index-HV6W3xCx.d.ts → index-Byar3h1e.d.ts} +1 -1
  290. package/dist/{index-C-QpeUlQ.d.ts → index-C2nbK2AA.d.ts} +52 -7
  291. package/dist/{index-iBLzInje.d.ts → index-C5e-7Obr.d.ts} +1 -1
  292. package/dist/index-CEv_AvOg.d.ts +17 -0
  293. package/dist/{index-Dgg0bHVM.d.ts → index-CICeEoZV.d.ts} +2 -1
  294. package/dist/{index-CB9Srua5.d.ts → index-CL1T2j4y.d.ts} +7 -4
  295. package/dist/{index-DjMwF8ET.d.ts → index-COgrQZIL.d.ts} +7 -1
  296. package/dist/{index-Ca8VIE4l.d.ts → index-CVn0GBdB.d.ts} +1 -1
  297. package/dist/{index-ChWlKHjc.d.ts → index-Cde5JvtX.d.ts} +15 -3
  298. package/dist/index-CitZGSn0.d.ts +39 -0
  299. package/dist/index-CkKPMIeX.d.ts +55 -0
  300. package/dist/{index-FEy8qFSD.d.ts → index-ClNU2Th8.d.ts} +30 -3
  301. package/dist/{index-kaKBOZSU.d.ts → index-Cq31D3fJ.d.ts} +99 -7
  302. package/dist/{index-xfkEuGLY.d.ts → index-CqE4Bf3Q.d.ts} +8 -2
  303. package/dist/{index-DtePJ_w_.d.ts → index-Crp3NFLW.d.ts} +2 -2
  304. package/dist/{index-BlOIC_AM.d.ts → index-CsNi1I8j.d.ts} +6 -0
  305. package/dist/index-Cyb9Du5Z.d.ts +76 -0
  306. package/dist/{index-4TRnFGxv.d.ts → index-D41_xqjs.d.ts} +50 -10
  307. package/dist/{index-eshFLli0.d.ts → index-D97pQbua.d.ts} +7 -0
  308. package/dist/{index-c67ca7eJ.d.ts → index-DEQ5cnUV.d.ts} +1 -1
  309. package/dist/{index-BmAxqw1G.d.ts → index-DG52Bg0W.d.ts} +15 -1
  310. package/dist/{index-Da7Jm8Ht.d.ts → index-DIXAzTKL.d.ts} +1 -1
  311. package/dist/{index-BmmdzwT9.d.ts → index-DNA2l1RN.d.ts} +35 -11
  312. package/dist/{index-B9rqmYxh.d.ts → index-DUaLJO7l.d.ts} +978 -313
  313. package/dist/index-DVmgNb78.d.ts +143 -0
  314. package/dist/{index-CDdRQQF3.d.ts → index-DWh2WC8W.d.ts} +18 -6
  315. package/dist/index-DXpSFlPG.d.ts +78 -0
  316. package/dist/{index-C_2Z65Rp.d.ts → index-DeQwYJbg.d.ts} +39 -2
  317. package/dist/{index-JL4auphT.d.ts → index-GI9xIV9l.d.ts} +2 -2
  318. package/dist/{index-Ctu32CLv.d.ts → index-IBAInumL.d.ts} +93 -56
  319. package/dist/{index-vizlhXVs.d.ts → index-T2FOcOuI.d.ts} +492 -16
  320. package/dist/{index-CA6RbRWx.d.ts → index-TXcNH86P.d.ts} +2 -2
  321. package/dist/{index-BIPc1v82.d.ts → index-TntQsADQ.d.ts} +1 -1
  322. package/dist/index-fAZaRruV.d.ts +125 -0
  323. package/dist/{index-COxy6LEW.d.ts → index-gW0HW02U.d.ts} +1 -1
  324. package/dist/{index-D5N9ikrS.d.ts → index-hCpxKePE.d.ts} +1 -1
  325. package/dist/{index-CpiWVbRZ.d.ts → index-i0tNFWfz.d.ts} +3 -1
  326. package/dist/{index-YmSe1ujk.d.ts → index-lgvUFSCO.d.ts} +1 -1
  327. package/dist/{index-bvr3WHvs.d.ts → index-xrzJC4wm.d.ts} +1 -1
  328. package/dist/{index-BK9T1TPZ.d.ts → index-yT1yiiww.d.ts} +28 -9
  329. package/dist/index.d.ts +80 -76
  330. package/dist/index.js +127 -113
  331. package/dist/link-C4_WogdF.js +18 -0
  332. package/dist/{index-C3GaPqvJ.d.ts → loadCatalog-BGHKG_9N.d.ts} +16 -37
  333. package/dist/{locale-sLw5Caia.js → loadCatalog-CXKqEB9s.js} +25 -65
  334. package/dist/locale/index.d.ts +3 -2
  335. package/dist/locale/index.js +4 -3
  336. package/dist/locale-DgkZEMTn.js +105 -0
  337. package/dist/{searchResultMessage-CCnq-_ce.js → searchResultMessage-hXXNOFJP.js} +2 -2
  338. package/dist/{size-xcIqExkS.js → size-Cpn_wzXi.js} +1 -1
  339. package/dist/{types-3eXh_5os.d.ts → types-0Q_SJv_F.d.ts} +3 -1
  340. package/dist/types-BRfVvZTH.d.ts +108 -0
  341. package/dist/{types-D7QNSqoN.d.ts → types-BTk0WZ0b.d.ts} +8 -0
  342. package/dist/{types-D_J66aPN.d.ts → types-BnNTzEnd.d.ts} +5 -1
  343. package/dist/{types-D9nP_X-c.d.ts → types-Ckih2YJi.d.ts} +9 -2
  344. package/dist/{types-Db3Owy8Q.d.ts → types-OGMYGejX.d.ts} +5 -0
  345. package/dist/{index-nKlTsNfV.d.ts → types-uFMH9NaM.d.ts} +14 -17
  346. package/dist/{useAnchoredListbox-BN9LQnon.js → useAnchoredListbox-DwztMNjP.js} +9 -4
  347. package/dist/useDevWarning-DznOpOHT.js +36 -0
  348. package/dist/useInputContainer-CpgDe2-4.js +51 -0
  349. package/dist/useInputStatusIcon-DBOwxV4x.js +41 -0
  350. package/dist/useInteractiveRole-Cn0Nd5GX.js +25 -0
  351. package/dist/{useMenuDrillIn-BgjJcY3K.js → useMenuDrillIn-DzKGkTho.js} +1 -1
  352. package/dist/{useMenuPress-DUmEy4TB.js → useMenuPress-D-FRNrBW.js} +162 -14
  353. package/dist/useMergedRefs-CfHHlCsn.js +109 -0
  354. package/dist/useNumberField-4-dIGVed.js +128 -0
  355. package/dist/{usePositionedLayer-C1NBOsVT.js → usePositionedLayer-Cru9_00b.js} +70 -7
  356. package/dist/useResizable-DDwPpPe6.d.ts +409 -0
  357. package/dist/useRestoreFocus-Djw9RUIf.js +153 -0
  358. package/dist/useScrollbars-C2NJ6Qwq.js +43 -0
  359. package/dist/{useTimeValue-DWk6oTAZ.js → useTimeValue-6ufHM15W.js} +1 -1
  360. package/dist/utils-D33VQDnk.js +58 -0
  361. package/locales/SOURCE.json +1 -1
  362. package/locales/en.json +445 -1
  363. package/package.json +19 -2
  364. package/styles/avatar-group.css +19 -1
  365. package/styles/avatar.css +34 -13
  366. package/styles/chat.css +17 -1
  367. package/styles/dialog-header.css +5 -1
  368. package/styles/field.css +11 -0
  369. package/styles/heading.css +9 -0
  370. package/styles/indicator-focus-ring.css +18 -0
  371. package/styles/number-input.css +33 -0
  372. package/styles/pressable.css +44 -0
  373. package/styles/progress-bar.css +18 -0
  374. package/styles/scrollbars.css +28 -0
  375. package/styles/side-nav.css +20 -6
  376. package/styles/stack.css +4 -2
  377. package/styles/status-dot.css +18 -0
  378. package/styles/tab-list.css +38 -2
  379. package/styles/table.css +66 -6
  380. package/styles/text.css +9 -0
  381. package/styles/time-input.css +41 -0
  382. package/styles/top-nav.css +46 -19
  383. package/styles/typeahead.css +31 -0
  384. package/styles.css +2 -0
  385. package/dist/AvatarGroup-QyzSrpYA.js +0 -60
  386. package/dist/DateInput-D4XFAEMp.js +0 -743
  387. package/dist/FieldLabel-DmmJyX7w.js +0 -184
  388. package/dist/FileInput-DuNwdbAo.js +0 -238
  389. package/dist/HoverCard-EhbWaGOW.js +0 -443
  390. package/dist/NumberInput-B4IL3s_8.js +0 -210
  391. package/dist/Popover-D7zqpFwU.js +0 -215
  392. package/dist/StatusDot-CaoIapp4.js +0 -27
  393. package/dist/TimeField-Biiuv0hB.js +0 -214
  394. package/dist/Tokenizer-rwzamZg4.js +0 -473
  395. package/dist/Tooltip-C2fh9anJ.js +0 -271
  396. package/dist/Typeahead-_V11btpv.js +0 -499
  397. package/dist/index-Blm197N_.d.ts +0 -82
  398. package/dist/index-Bt7ewoz2.d.ts +0 -119
  399. package/dist/index-C1HIqW_H.d.ts +0 -38
  400. package/dist/index-CngORuiq.d.ts +0 -387
  401. package/dist/index-D4I_obqR.d.ts +0 -58
  402. package/dist/link-CdcUSxAj.js +0 -12
  403. package/dist/size-BuTzpgnR.d.ts +0 -14
  404. package/dist/types-Cp4liug-.d.ts +0 -170
  405. package/dist/useDismiss-Cj8x_51F.js +0 -62
  406. package/dist/useNumberField-DL-Radsp.js +0 -49
  407. package/dist/useResizable-CUoNPmUw.d.ts +0 -72
  408. package/dist/useRestoreFocus-BvMdXVX9.js +0 -96
  409. package/dist/utils-C9r3UD_y.js +0 -16
@@ -0,0 +1,25 @@
1
+ import { computed, toValue } from "vue";
2
+ //#region src/composables/useInteractiveRole.ts
3
+ /**
4
+ * 对应原版 Astryx 的 `hooks/useInteractiveRole`。
5
+ *
6
+ * 把「这个多态组件到底渲染成什么」收在一处决定:有 `href` 就是链接,
7
+ * 没 `href` 但有 `onClick` 就是按钮,都没有就是一段普通内容。
8
+ * 时而是链接、时而按钮、时而是纯内容的组件都该走这里,判断先后顺序才不会各写一套。
9
+ *
10
+ * 只有 `link` 才真的渲染 `a`,这样键盘、中键新开标签这些行为都是浏览器给的。
11
+ *
12
+ * 上游还会读父级给的「触发上下文」(Popover、DropdownMenu 之类),
13
+ * 让组件自动成为新浮层的合法触发器。我们的浮层不支持子元素当触发器,
14
+ * 没有这份上下文可读,所以这里停在 `onClick` 这一层。
15
+ */
16
+ function useInteractiveRole(options) {
17
+ return { role: computed(() => {
18
+ const href = toValue(options.href);
19
+ if (!toValue(options.isDisabled ?? false) && href != null && href !== "") return "link";
20
+ if (toValue(options.hasOnClick ?? false)) return "button";
21
+ return "inert";
22
+ }) };
23
+ }
24
+ //#endregion
25
+ export { useInteractiveRole as t };
@@ -1,5 +1,5 @@
1
1
  import { t as _sfc_main$4 } from "./Icon-bteSId7T.js";
2
- import { t as _sfc_main$5 } from "./Item-DrYJL1TG.js";
2
+ import { t as _sfc_main$5 } from "./Item-KhFKX9St.js";
3
3
  import { t as _sfc_main$6 } from "./CheckboxIndicator-D37cm2Rh.js";
4
4
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, inject, mergeModels, openBlock, provide, ref, renderSlot, toDisplayString, unref, useModel, useSlots, watch, withCtx } from "vue";
5
5
  import "../styles/dropdown-menu.css";
@@ -2,6 +2,13 @@ import { onBeforeUnmount, toValue } from "vue";
2
2
  //#region src/composables/useLongPress.ts
3
3
  const DEFAULT_DELAY_MS = 500;
4
4
  const DEFAULT_MOVE_CANCEL_PX = 10;
5
+ function touchPoint(event) {
6
+ const touch = event.touches?.[0] ?? event.changedTouches?.[0];
7
+ return touch == null ? null : {
8
+ x: touch.clientX,
9
+ y: touch.clientY
10
+ };
11
+ }
5
12
  /**
6
13
  * 对应原版 Astryx 的 `hooks/useLongPress`。
7
14
  *
@@ -10,13 +17,19 @@ const DEFAULT_MOVE_CANCEL_PX = 10;
10
17
  * iOS Safari never synthesizes a `contextmenu` event for a held finger, so a
11
18
  * long press is the only touch affordance that can open a cursor-positioned
12
19
  * surface. The press is cancelled when the finger travels past the tolerance,
13
- * lifts, or the touch is cancelled.
20
+ * lifts, a second finger lands, or the touch is cancelled.
21
+ *
22
+ * 两种绑法:自己接指针事件时用 `start` / `moveTo` / `cancel`;直接要触摸监听时
23
+ * 把 `handlers` 摊到元素上。
14
24
  */
15
25
  function useLongPress(options) {
16
26
  const delayMs = options.delayMs ?? DEFAULT_DELAY_MS;
17
27
  const moveCancelPx = options.moveCancelPx ?? DEFAULT_MOVE_CANCEL_PX;
18
28
  let timer = null;
19
29
  let origin = null;
30
+ function isDisabled() {
31
+ return toValue(options.isDisabled) === true || toValue(options.disabled) === true;
32
+ }
20
33
  function cancel() {
21
34
  if (timer != null) {
22
35
  clearTimeout(timer);
@@ -25,7 +38,7 @@ function useLongPress(options) {
25
38
  origin = null;
26
39
  }
27
40
  function start(point) {
28
- if (toValue(options.isDisabled)) return;
41
+ if (isDisabled()) return;
29
42
  cancel();
30
43
  origin = {
31
44
  x: point.x,
@@ -49,9 +62,37 @@ function useLongPress(options) {
49
62
  }
50
63
  return true;
51
64
  }
65
+ /**
66
+ * A press needs exactly one finger. A second one cancels it, the way a
67
+ * lift does.
68
+ */
69
+ function onTouchStart(event) {
70
+ if ((event.touches?.length ?? 0) !== 1) {
71
+ cancel();
72
+ return;
73
+ }
74
+ const point = touchPoint(event);
75
+ if (point != null) start(point);
76
+ }
77
+ function onTouchMove(event) {
78
+ const point = touchPoint(event);
79
+ if (point != null) moveTo(point);
80
+ }
81
+ function onTouchEnd() {
82
+ cancel();
83
+ }
84
+ function onTouchCancel() {
85
+ cancel();
86
+ }
52
87
  onBeforeUnmount(cancel);
53
88
  return {
54
89
  cancel,
90
+ handlers: {
91
+ onTouchCancel,
92
+ onTouchEnd,
93
+ onTouchMove,
94
+ onTouchStart
95
+ },
55
96
  moveTo,
56
97
  start
57
98
  };
@@ -276,6 +317,8 @@ function useMenuNav(options) {
276
317
  //#region src/ContextMenu/useMenuPress.ts
277
318
  /** How long after a tracked release the browser's own click is still swallowed. */
278
319
  const STRAY_CLICK_MS = 400;
320
+ /** How long a finger must rest on the trigger before the menu opens under it. */
321
+ const DEFAULT_LONG_PRESS_MS = 500;
279
322
  let swallower = null;
280
323
  function disarmStrayClick() {
281
324
  if (swallower == null) return;
@@ -334,23 +377,33 @@ function resetMenuPress() {
334
377
  * - A finger released outside leaves the menu open; a mouse released outside
335
378
  * dismisses it.
336
379
  * - `pointercancel` and a second pointer end the gesture with nothing acting.
380
+ *
381
+ * 传了 `triggerRef` 和 `onTriggerPress` 之后,按压也可以从触发器开始:鼠标按下就开,
382
+ * 手指按住到 `longPressDelayMs` 才开,开着的时候手指可以滑进菜单里挑行。
337
383
  */
338
384
  function useMenuPress(options) {
339
385
  const { menuRef, isEnabled, onDismiss } = options;
340
386
  let trackedId = null;
341
387
  let trackedIsMouse = false;
388
+ let trackedFromTrigger = false;
389
+ let triggerOpened = false;
342
390
  let highlighted = null;
343
391
  let doc = null;
392
+ let longPressTimer = null;
393
+ let triggerPressAt = 0;
394
+ function rowsSelector() {
395
+ return options.itemSelector ?? MENU_ITEM_SELECTOR;
396
+ }
344
397
  function isRowInsideMenu(row) {
345
398
  const menu = menuRef.value;
346
399
  return row instanceof HTMLElement && menu != null && menu.contains(row) && row.closest("[role=\"menu\"]") === menu;
347
400
  }
348
401
  function rowFromEvent(event) {
349
402
  const hit = doc?.elementFromPoint?.(event.clientX, event.clientY) ?? null;
350
- const fromPoint = hit instanceof Element ? hit.closest(MENU_ITEM_SELECTOR) : null;
403
+ const fromPoint = hit instanceof Element ? hit.closest(rowsSelector()) : null;
351
404
  if (fromPoint != null && isRowInsideMenu(fromPoint)) return fromPoint;
352
405
  const target = event.target;
353
- const fromTarget = target instanceof Element ? target.closest(MENU_ITEM_SELECTOR) : null;
406
+ const fromTarget = target instanceof Element ? target.closest(rowsSelector()) : null;
354
407
  return fromTarget != null && isRowInsideMenu(fromTarget) ? fromTarget : null;
355
408
  }
356
409
  function isEventInsideMenu(event) {
@@ -361,23 +414,67 @@ function useMenuPress(options) {
361
414
  const target = event.target;
362
415
  return target instanceof Node && menu.contains(target);
363
416
  }
417
+ function isOverTrigger(event) {
418
+ const trigger = options.triggerRef?.value;
419
+ if (trigger == null) return false;
420
+ const hit = doc?.elementFromPoint?.(event.clientX, event.clientY) ?? null;
421
+ if (hit instanceof Node && trigger.contains(hit)) return true;
422
+ const target = event.target;
423
+ return target instanceof Node && trigger.contains(target);
424
+ }
364
425
  function highlight(row) {
365
426
  if (row === highlighted) return;
366
427
  highlighted = row;
428
+ if (options.onHighlight != null) {
429
+ options.onHighlight(row);
430
+ return;
431
+ }
367
432
  row?.focus({ preventScroll: true });
368
433
  }
434
+ function activate(row, release) {
435
+ if (options.onActivate != null) {
436
+ options.onActivate(row, release);
437
+ return;
438
+ }
439
+ activateMenuItem(row, release);
440
+ }
441
+ function trackPointer(event, fromTrigger) {
442
+ const current = (options.menuRef.value ?? options.triggerRef?.value ?? null)?.ownerDocument ?? null;
443
+ if (current == null) return;
444
+ if (trackedId != null) endGesture();
445
+ doc = current;
446
+ trackedId = event.pointerId;
447
+ trackedIsMouse = event.pointerType === "mouse";
448
+ trackedFromTrigger = fromTrigger;
449
+ triggerOpened = false;
450
+ current.addEventListener("pointermove", onDocumentPointerMove, true);
451
+ current.addEventListener("pointerup", onDocumentPointerUp, true);
452
+ current.addEventListener("pointercancel", onDocumentPointerCancel, true);
453
+ }
369
454
  function onDocumentPointerMove(event) {
370
455
  if (event.pointerId !== trackedId) return;
456
+ if (trackedFromTrigger && !triggerOpened) return;
371
457
  const row = rowFromEvent(event);
372
458
  if (row != null) highlight(row);
373
459
  }
374
460
  function onDocumentPointerUp(event) {
375
461
  if (event.pointerId !== trackedId) return;
376
462
  const row = rowFromEvent(event);
463
+ const wasTrigger = trackedFromTrigger;
464
+ const wasMouse = trackedIsMouse;
465
+ const hadOpened = triggerOpened;
466
+ const overTrigger = wasTrigger && isOverTrigger(event);
467
+ const releasedOutside = !isEventInsideMenu(event);
377
468
  endGesture();
378
- if (row == null) return;
469
+ if (row == null) {
470
+ if (wasTrigger && hadOpened) {
471
+ triggerPressAt = Date.now();
472
+ if (wasMouse && !overTrigger && releasedOutside) onDismiss();
473
+ }
474
+ return;
475
+ }
379
476
  if (doc != null) armStrayClick(doc);
380
- activateMenuItem(row, event);
477
+ activate(row, event);
381
478
  }
382
479
  function onDocumentPointerCancel(event) {
383
480
  if (event.pointerId !== trackedId) return;
@@ -388,7 +485,14 @@ function useMenuPress(options) {
388
485
  endGesture();
389
486
  if (!isInside) onDismiss();
390
487
  }
488
+ function clearLongPress() {
489
+ if (longPressTimer != null) {
490
+ clearTimeout(longPressTimer);
491
+ longPressTimer = null;
492
+ }
493
+ }
391
494
  function endGesture() {
495
+ clearLongPress();
392
496
  const current = doc;
393
497
  if (current != null) {
394
498
  current.removeEventListener("pointermove", onDocumentPointerMove, true);
@@ -398,28 +502,72 @@ function useMenuPress(options) {
398
502
  }
399
503
  trackedId = null;
400
504
  trackedIsMouse = false;
505
+ trackedFromTrigger = false;
506
+ triggerOpened = false;
401
507
  highlighted = null;
402
508
  }
403
509
  function onPointerDown(event) {
404
510
  if (!isEnabled()) return;
405
511
  if (trackedId != null) endGesture();
406
512
  const target = event.target;
407
- const row = target instanceof Element ? target.closest(MENU_ITEM_SELECTOR) : null;
513
+ const row = target instanceof Element ? target.closest(rowsSelector()) : null;
408
514
  if (row == null || !isRowInsideMenu(row)) return;
515
+ trackPointer(event, false);
409
516
  highlighted = row;
410
- trackedId = event.pointerId;
411
- trackedIsMouse = event.pointerType === "mouse";
412
- doc = menuRef.value?.ownerDocument ?? null;
413
517
  if (trackedIsMouse) {
518
+ doc?.removeEventListener("pointermove", onDocumentPointerMove, true);
519
+ doc?.removeEventListener("pointerup", onDocumentPointerUp, true);
520
+ doc?.removeEventListener("pointercancel", onDocumentPointerCancel, true);
414
521
  doc?.addEventListener("mouseup", onDocumentMouseUp, true);
522
+ }
523
+ }
524
+ function onTriggerPointerDown(event) {
525
+ const press = options.onTriggerPress;
526
+ if (press == null || !isEnabled()) return;
527
+ if ((event.button ?? 0) !== 0) return;
528
+ trackPointer(event, true);
529
+ if (trackedIsMouse) {
530
+ triggerOpened = press("mouse") === true;
531
+ triggerPressAt = Date.now();
532
+ if (!triggerOpened) endGesture();
415
533
  return;
416
534
  }
417
- doc?.addEventListener("pointermove", onDocumentPointerMove, true);
418
- doc?.addEventListener("pointerup", onDocumentPointerUp, true);
419
- doc?.addEventListener("pointercancel", onDocumentPointerCancel, true);
535
+ const pointerType = event.pointerType === "pen" ? "pen" : "touch";
536
+ longPressTimer = setTimeout(() => {
537
+ longPressTimer = null;
538
+ triggerOpened = press(pointerType) === true;
539
+ triggerPressAt = Date.now();
540
+ }, options.longPressDelayMs ?? DEFAULT_LONG_PRESS_MS);
541
+ }
542
+ /**
543
+ * Only the browser's own menu for a held finger is suppressed; a mouse's
544
+ * right-click keeps its `contextmenu` route through the application.
545
+ */
546
+ function onTriggerContextMenu(event) {
547
+ if (options.onTriggerPress == null) return;
548
+ if ((event instanceof PointerEvent ? event.pointerType : null) === "mouse") return;
549
+ event.preventDefault();
550
+ }
551
+ function isTriggerClickFromPress() {
552
+ return triggerPressAt !== 0 && Date.now() - triggerPressAt < STRAY_CLICK_MS;
553
+ }
554
+ function cancel() {
555
+ endGesture();
420
556
  }
421
557
  onBeforeUnmount(endGesture);
422
- return { onPointerDown };
558
+ return {
559
+ cancel,
560
+ isTriggerClickFromPress,
561
+ menuProps: {
562
+ "data-astryx-menu-press": "",
563
+ onPointerDown
564
+ },
565
+ onPointerDown,
566
+ triggerProps: {
567
+ onContextMenu: onTriggerContextMenu,
568
+ onPointerDown: onTriggerPointerDown
569
+ }
570
+ };
423
571
  }
424
572
  //#endregion
425
573
  export { useLongPress as a, useMenuNav as i, useMenuPress as n, isModifiedClick as r, resetMenuPress as t };
@@ -0,0 +1,109 @@
1
+ import { n as useDismiss, t as usePositionedLayer } from "./usePositionedLayer-Cru9_00b.js";
2
+ import { computed, shallowRef, toValue, useId } from "vue";
3
+ //#region src/composables/useLayer.ts
4
+ /**
5
+ * 对应原版 Astryx 的 `hooks/useLayer`:渲染浮层的最小内核。
6
+ * 负责开合状态、锚点定位(或固定坐标)、点击外部关闭和延迟渲染。
7
+ * `Popover`、`Tooltip`、`HoverCard` 都在它之上构建。
8
+ *
9
+ * 内容用 `Teleport` 送到 `body`,样式取自 `contentStyle`:
10
+ *
11
+ * ```vue
12
+ * <button :ref="layer.anchorRef" @click="layer.show()">打开</button>
13
+ * <Teleport to="body">
14
+ * <div v-if="layer.isMounted" v-show="layer.isOpen" :ref="layer.contentRef" :style="layer.contentStyle">
15
+ * ...
16
+ * </div>
17
+ * </Teleport>
18
+ * ```
19
+ */
20
+ function useLayer(options) {
21
+ const isFixed = options.mode === "fixed";
22
+ const isOpen = shallowRef(options.isDefaultOpen === true);
23
+ const hasOpened = shallowRef(options.isDefaultOpen === true);
24
+ const internalAnchor = shallowRef(null);
25
+ const anchorRef = options.anchor ?? internalAnchor;
26
+ const contentRef = shallowRef(null);
27
+ const uid = useId();
28
+ const id = `astryx-layer-${uid}`;
29
+ const anchorId = `astryx-layer-anchor-${uid}`;
30
+ const placement = computed(() => toValue(options.placement) ?? "below");
31
+ const alignment = computed(() => toValue(options.alignment) ?? "center");
32
+ const positioned = isFixed ? null : usePositionedLayer({
33
+ anchor: anchorRef,
34
+ layer: contentRef,
35
+ isOpen,
36
+ placement,
37
+ alignment,
38
+ gap: options.gap ?? 4
39
+ });
40
+ const resolvedPlacement = computed(() => positioned?.position.value.placement ?? placement.value);
41
+ const contentStyle = computed(() => {
42
+ if (isFixed) return {
43
+ position: "fixed",
44
+ top: `${toValue(options.y) ?? 0}px`,
45
+ left: `${toValue(options.x) ?? 0}px`
46
+ };
47
+ const { top, left } = positioned?.position.value ?? {
48
+ top: 0,
49
+ left: 0
50
+ };
51
+ return {
52
+ top: `${top}px`,
53
+ left: `${left}px`
54
+ };
55
+ });
56
+ const isMounted = computed(() => !toValue(options.lazyMount) || hasOpened.value);
57
+ function show() {
58
+ if (isOpen.value) return;
59
+ hasOpened.value = true;
60
+ isOpen.value = true;
61
+ options.onShow?.();
62
+ }
63
+ function hide() {
64
+ if (!isOpen.value) return;
65
+ isOpen.value = false;
66
+ options.onHide?.();
67
+ }
68
+ useDismiss({
69
+ container: contentRef,
70
+ trigger: anchorRef,
71
+ isEnabled: computed(() => isOpen.value && toValue(options.lightDismiss) === true),
72
+ onDismiss: hide
73
+ });
74
+ return {
75
+ isOpen,
76
+ anchorRef,
77
+ contentRef,
78
+ contentStyle,
79
+ resolvedPlacement,
80
+ isMounted,
81
+ id,
82
+ anchorId,
83
+ show,
84
+ hide
85
+ };
86
+ }
87
+ //#endregion
88
+ //#region src/composables/useMergedRefs.ts
89
+ /**
90
+ * 对应原版 Astryx 的 `hooks/useMergedRefs`。
91
+ *
92
+ * 把多个 `Ref` 和函数 ref 合成一个函数 ref,交给模板的 `:ref`。
93
+ * 组件既要往外转发使用者给的 ref,又要自己留一份内部 ref 时用得上。
94
+ *
95
+ * 返回的函数在组合式函数的生命周期里只有一份。直接在模板里写
96
+ * `:ref="value => { ... }"` 每次渲染都会造一个新函数,Vue 会先解绑再重新绑定,
97
+ * 白白多做一轮解绑和挂载。
98
+ */
99
+ function useMergedRefs(refs) {
100
+ return function mergedRef(value) {
101
+ for (const target of refs) {
102
+ if (target == null) continue;
103
+ if (typeof target === "function") target(value);
104
+ else target.value = value;
105
+ }
106
+ };
107
+ }
108
+ //#endregion
109
+ export { useLayer as n, useMergedRefs as t };
@@ -0,0 +1,128 @@
1
+ import { computed, toValue, watch } from "vue";
2
+ //#region src/composables/useNumberField.ts
3
+ /** 小数位数。指数写法按尾数算,避免 1e-7 被当成 0 位。 */
4
+ function decimalPlaces(value) {
5
+ const [coefficient, exponentText] = String(value).toLowerCase().split("e");
6
+ const fractionLength = coefficient.split(".")[1]?.length ?? 0;
7
+ const exponent = exponentText == null ? 0 : Number(exponentText);
8
+ return Math.max(0, fractionLength - exponent);
9
+ }
10
+ /**
11
+ * 整数模式下非整数步长退回 1:按 0.5 走一步会落在 2.5,而字段只收整数。
12
+ */
13
+ function effectiveStep(step, integerOnly) {
14
+ if (step == null || !Number.isFinite(step) || step <= 0) return 1;
15
+ if (integerOnly && !Number.isInteger(step)) return 1;
16
+ return step;
17
+ }
18
+ /**
19
+ * 按步长网格走一格:以 min 为起点对齐,先取整再夹到范围内。
20
+ */
21
+ function steppedValue(options) {
22
+ const { currentValue, direction, min, max, step, integerOnly } = options;
23
+ const stride = effectiveStep(step, integerOnly);
24
+ const stepBase = min != null && (!integerOnly || Number.isInteger(min)) ? min : 0;
25
+ let nextValue;
26
+ if (currentValue == null) {
27
+ nextValue = direction === 1 ? min ?? 0 : max ?? 0;
28
+ if (integerOnly) nextValue = direction === 1 ? Math.ceil(nextValue) : Math.floor(nextValue);
29
+ } else {
30
+ const stepPosition = (currentValue - stepBase) / stride;
31
+ const tolerance = Number.EPSILON * Math.max(1, Math.abs(stepPosition)) * 4;
32
+ nextValue = stepBase + (direction === 1 ? Math.floor(stepPosition + tolerance) + 1 : Math.ceil(stepPosition - tolerance) - 1) * stride;
33
+ }
34
+ const precision = Math.min(12, Math.max(decimalPlaces(stride), decimalPlaces(stepBase)));
35
+ nextValue = Number(nextValue.toFixed(precision));
36
+ if (min != null) nextValue = Math.max(min, nextValue);
37
+ if (max != null) nextValue = Math.min(max, nextValue);
38
+ if (!Number.isFinite(nextValue)) return currentValue;
39
+ if (integerOnly && !Number.isInteger(nextValue)) return currentValue;
40
+ return Object.is(nextValue, -0) ? 0 : nextValue;
41
+ }
42
+ /**
43
+ * 数字输入框逻辑:步进、范围限制、整数限制、键盘增减。
44
+ */
45
+ function useNumberField(options) {
46
+ const { value, onChange } = options;
47
+ const readMin = () => toValue(options.min) ?? null;
48
+ const readMax = () => toValue(options.max) ?? null;
49
+ const readStep = () => toValue(options.step);
50
+ const readDisabled = () => Boolean(toValue(options.disabled));
51
+ const readReadOnly = () => Boolean(toValue(options.readOnly));
52
+ const readIntegerOnly = () => Boolean(toValue(options.integerOnly));
53
+ const locked = () => readDisabled() || readReadOnly();
54
+ function nextValue(direction) {
55
+ return steppedValue({
56
+ currentValue: value.value,
57
+ direction,
58
+ min: readMin(),
59
+ max: readMax(),
60
+ step: readStep(),
61
+ integerOnly: readIntegerOnly()
62
+ });
63
+ }
64
+ const canIncrement = computed(() => nextValue(1) !== value.value);
65
+ const canDecrement = computed(() => nextValue(-1) !== value.value);
66
+ function step(direction) {
67
+ if (locked()) return false;
68
+ const next = nextValue(direction);
69
+ if (next == null || next === value.value) return false;
70
+ onChange(next);
71
+ return true;
72
+ }
73
+ function increment() {
74
+ step(1);
75
+ }
76
+ function decrement() {
77
+ step(-1);
78
+ }
79
+ function clamp(val, integerOnly) {
80
+ const rawMin = readMin();
81
+ const rawMax = readMax();
82
+ const min = rawMin == null ? null : integerOnly ? Math.ceil(rawMin) : rawMin;
83
+ const max = rawMax == null ? null : integerOnly ? Math.floor(rawMax) : rawMax;
84
+ let clamped = val;
85
+ if (min != null) clamped = Math.max(min, clamped);
86
+ if (max != null) clamped = Math.min(max, clamped);
87
+ return clamped;
88
+ }
89
+ function setValue(val) {
90
+ if (readDisabled()) return;
91
+ if (val === null) {
92
+ onChange(null);
93
+ return;
94
+ }
95
+ const integerOnly = readIntegerOnly();
96
+ const bounded = clamp(val, integerOnly);
97
+ if (integerOnly && !Number.isInteger(bounded)) return;
98
+ onChange(Object.is(bounded, -0) ? 0 : bounded);
99
+ }
100
+ function onKeyDown(event) {
101
+ if (locked()) return;
102
+ switch (event.key) {
103
+ case "ArrowUp":
104
+ event.preventDefault();
105
+ increment();
106
+ break;
107
+ case "ArrowDown":
108
+ event.preventDefault();
109
+ decrement();
110
+ }
111
+ }
112
+ watch(value, (val) => {
113
+ if (val == null) return;
114
+ const bounded = clamp(val, readIntegerOnly());
115
+ if (bounded !== val) onChange(Object.is(bounded, -0) ? 0 : bounded);
116
+ });
117
+ return {
118
+ canDecrement,
119
+ canIncrement,
120
+ decrement,
121
+ increment,
122
+ onKeyDown,
123
+ setValue,
124
+ step
125
+ };
126
+ }
127
+ //#endregion
128
+ export { useNumberField as t };
@@ -1,6 +1,66 @@
1
- import { nextTick, ref, watch } from "vue";
1
+ import { i as useLayerGutter, s as resolveLayerGutter } from "./context-M-er0-Rk.js";
2
+ import { nextTick, onScopeDispose, ref, watch } from "vue";
3
+ //#region src/composables/useDismiss.ts
4
+ const escapeStack = [];
5
+ /**
6
+ * 统一处理浮层组件的关闭逻辑:点击外部和按 Escape 键。
7
+ * 用于 Popover、Tooltip、DropdownMenu、ContextMenu 等。
8
+ *
9
+ * 设计决策:
10
+ * - 使用 pointerdown 事件(包含 mouse 和 touch)
11
+ * - 在 nextTick 后附加监听器,避免打开时的点击立即触发关闭
12
+ * - Escape 键使用全局栈,确保最内层的浮层优先处理
13
+ */
14
+ function useDismiss(options) {
15
+ const { container, trigger, isEnabled, enableEscape = { value: true }, onDismiss } = options;
16
+ let isAttached = false;
17
+ function dismissFromEscape() {
18
+ if (options.onEscape != null) options.onEscape();
19
+ else onDismiss();
20
+ }
21
+ function onClickOutside(event) {
22
+ if (!isEnabled.value) return;
23
+ const el = container.value;
24
+ if (!el) return;
25
+ const target = event.target;
26
+ if (el.contains(target)) return;
27
+ if ((trigger?.value)?.contains(target)) return;
28
+ onDismiss();
29
+ }
30
+ function onEscapeKey(event) {
31
+ if (!isEnabled.value || !enableEscape.value) return;
32
+ if (event.key === "Escape") {
33
+ if (escapeStack[escapeStack.length - 1] === dismissFromEscape) {
34
+ event.preventDefault();
35
+ dismissFromEscape();
36
+ }
37
+ }
38
+ }
39
+ async function setup() {
40
+ if (typeof document === "undefined" || isAttached) return;
41
+ await nextTick();
42
+ if (!isEnabled.value) return;
43
+ isAttached = true;
44
+ document.addEventListener("pointerdown", onClickOutside, true);
45
+ document.addEventListener("keydown", onEscapeKey, true);
46
+ if (enableEscape.value) escapeStack.push(dismissFromEscape);
47
+ }
48
+ function teardown() {
49
+ if (typeof document === "undefined" || !isAttached) return;
50
+ isAttached = false;
51
+ document.removeEventListener("pointerdown", onClickOutside, true);
52
+ document.removeEventListener("keydown", onEscapeKey, true);
53
+ const index = escapeStack.indexOf(dismissFromEscape);
54
+ if (index !== -1) escapeStack.splice(index, 1);
55
+ }
56
+ watch(isEnabled, (enabled) => {
57
+ if (enabled) setup();
58
+ else teardown();
59
+ }, { immediate: true });
60
+ onScopeDispose(teardown);
61
+ }
62
+ //#endregion
2
63
  //#region src/layer/position.ts
3
- const VIEWPORT_MARGIN = 8;
4
64
  function alignOnAxis(start, size, own, alignment) {
5
65
  if (alignment === "start") return start;
6
66
  if (alignment === "end") return start + size - own;
@@ -11,8 +71,9 @@ function clamp(value, min, max) {
11
71
  }
12
72
  /**
13
73
  * 计算浮层相对锚点的位置。空间不足时翻转到相反方向,最终位置保持在视口内。
74
+ * `gutter` 是浮层离视口每条边的最小空隙,不传就按基础空隙加设备安全区算。
14
75
  */
15
- function computeLayerPosition(anchor, layer, viewport, placement, alignment, gap) {
76
+ function computeLayerPosition(anchor, layer, viewport, placement, alignment, gap, gutter = resolveLayerGutter()) {
16
77
  let resolved = placement;
17
78
  if (resolved === "above" && anchor.top - gap - layer.height < 0) resolved = "below";
18
79
  else if (resolved === "below" && anchor.bottom + gap + layer.height > viewport.height) resolved = "above";
@@ -33,8 +94,8 @@ function computeLayerPosition(anchor, layer, viewport, placement, alignment, gap
33
94
  placement: resolved
34
95
  };
35
96
  return {
36
- top: clamp(top, VIEWPORT_MARGIN, viewport.height - layer.height - VIEWPORT_MARGIN),
37
- left: clamp(left, VIEWPORT_MARGIN, viewport.width - layer.width - VIEWPORT_MARGIN),
97
+ top: clamp(top, gutter.blockStart, viewport.height - layer.height - gutter.blockEnd),
98
+ left: clamp(left, gutter.inlineStart, viewport.width - layer.width - gutter.inlineEnd),
38
99
  placement: resolved
39
100
  };
40
101
  }
@@ -51,6 +112,7 @@ function usePositionedLayer(options) {
51
112
  left: 0,
52
113
  placement: placement.value
53
114
  });
115
+ const gutter = useLayerGutter();
54
116
  function update() {
55
117
  const anchorEl = anchor.value;
56
118
  const layerEl = layer.value;
@@ -61,7 +123,7 @@ function usePositionedLayer(options) {
61
123
  }, {
62
124
  width: window.innerWidth,
63
125
  height: window.innerHeight
64
- }, placement.value, alignment.value, gap);
126
+ }, placement.value, alignment.value, gap, gutter.value);
65
127
  }
66
128
  let pollId;
67
129
  function geometryKey() {
@@ -104,6 +166,7 @@ function usePositionedLayer(options) {
104
166
  } else detach();
105
167
  });
106
168
  watch([placement, alignment], update);
169
+ watch(gutter, update);
107
170
  return {
108
171
  position,
109
172
  update,
@@ -111,4 +174,4 @@ function usePositionedLayer(options) {
111
174
  };
112
175
  }
113
176
  //#endregion
114
- export { usePositionedLayer as t };
177
+ export { useDismiss as n, usePositionedLayer as t };