asta-ui 0.0.0-stage → 0.2.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 (547) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +69 -2
  3. package/bin/asta-ui.mjs +218 -0
  4. package/dist/accordion.d.ts +2 -0
  5. package/dist/accordion.js +9 -0
  6. package/dist/add-to-cart.d.ts +2 -0
  7. package/dist/add-to-cart.js +7 -0
  8. package/dist/avatar.d.ts +2 -0
  9. package/dist/avatar.js +13 -0
  10. package/dist/badge.d.ts +2 -0
  11. package/dist/badge.js +11 -0
  12. package/dist/base/accordion.d.ts +2 -0
  13. package/dist/base/accordion.js +9 -0
  14. package/dist/base/add-to-cart.d.ts +2 -0
  15. package/dist/base/add-to-cart.js +7 -0
  16. package/dist/base/avatar.d.ts +2 -0
  17. package/dist/base/avatar.js +13 -0
  18. package/dist/base/badge.d.ts +2 -0
  19. package/dist/base/badge.js +11 -0
  20. package/dist/base/bubble-wrap.d.ts +2 -0
  21. package/dist/base/bubble-wrap.js +7 -0
  22. package/dist/base/button.d.ts +2 -0
  23. package/dist/base/button.js +13 -0
  24. package/dist/base/candlestick.d.ts +2 -0
  25. package/dist/base/candlestick.js +7 -0
  26. package/dist/base/card-checkout.d.ts +2 -0
  27. package/dist/base/card-checkout.js +7 -0
  28. package/dist/base/cart-drawer.d.ts +2 -0
  29. package/dist/base/cart-drawer.js +7 -0
  30. package/dist/base/checkbox.d.ts +2 -0
  31. package/dist/base/checkbox.js +9 -0
  32. package/dist/base/combo-lock.d.ts +2 -0
  33. package/dist/base/combo-lock.js +7 -0
  34. package/dist/base/command-palette.d.ts +2 -0
  35. package/dist/base/command-palette.js +11 -0
  36. package/dist/base/dial-knob.d.ts +2 -0
  37. package/dist/base/dial-knob.js +7 -0
  38. package/dist/base/dialog.d.ts +2 -0
  39. package/dist/base/dialog.js +9 -0
  40. package/dist/base/dropdown-menu.d.ts +2 -0
  41. package/dist/base/dropdown-menu.js +10 -0
  42. package/dist/base/elastic-string.d.ts +2 -0
  43. package/dist/base/elastic-string.js +7 -0
  44. package/dist/base/field.d.ts +2 -0
  45. package/dist/base/field.js +11 -0
  46. package/dist/base/footer.d.ts +2 -0
  47. package/dist/base/footer.js +12 -0
  48. package/dist/base/gravity-pills.d.ts +2 -0
  49. package/dist/base/gravity-pills.js +7 -0
  50. package/dist/base/hold-to-confirm.d.ts +2 -0
  51. package/dist/base/hold-to-confirm.js +7 -0
  52. package/dist/base/ink-trail.d.ts +2 -0
  53. package/dist/base/ink-trail.js +7 -0
  54. package/dist/base/input.d.ts +2 -0
  55. package/dist/base/input.js +11 -0
  56. package/dist/base/kbd.d.ts +2 -0
  57. package/dist/base/kbd.js +11 -0
  58. package/dist/base/morse-tap.d.ts +2 -0
  59. package/dist/base/morse-tap.js +7 -0
  60. package/dist/base/motion-button.d.ts +2 -0
  61. package/dist/base/motion-button.js +23 -0
  62. package/dist/base/navbar.d.ts +2 -0
  63. package/dist/base/navbar.js +10 -0
  64. package/dist/base/needle-field.d.ts +2 -0
  65. package/dist/base/needle-field.js +7 -0
  66. package/dist/base/number-input.d.ts +2 -0
  67. package/dist/base/number-input.js +9 -0
  68. package/dist/base/order-book.d.ts +2 -0
  69. package/dist/base/order-book.js +7 -0
  70. package/dist/base/pay-methods.d.ts +2 -0
  71. package/dist/base/pay-methods.js +7 -0
  72. package/dist/base/payment-status.d.ts +2 -0
  73. package/dist/base/payment-status.js +7 -0
  74. package/dist/base/pixel-reveal.d.ts +2 -0
  75. package/dist/base/pixel-reveal.js +7 -0
  76. package/dist/base/price-chart.d.ts +2 -0
  77. package/dist/base/price-chart.js +7 -0
  78. package/dist/base/pricing.d.ts +2 -0
  79. package/dist/base/pricing.js +14 -0
  80. package/dist/base/radio-group.d.ts +2 -0
  81. package/dist/base/radio-group.js +11 -0
  82. package/dist/base/scramble-text.d.ts +2 -0
  83. package/dist/base/scramble-text.js +7 -0
  84. package/dist/base/segmented-control.d.ts +2 -0
  85. package/dist/base/segmented-control.js +9 -0
  86. package/dist/base/select.d.ts +2 -0
  87. package/dist/base/select.js +9 -0
  88. package/dist/base/settings-panel.d.ts +2 -0
  89. package/dist/base/settings-panel.js +10 -0
  90. package/dist/base/sign-in.d.ts +2 -0
  91. package/dist/base/sign-in.js +10 -0
  92. package/dist/base/skeleton.d.ts +2 -0
  93. package/dist/base/skeleton.js +13 -0
  94. package/dist/base/slider.d.ts +2 -0
  95. package/dist/base/slider.js +9 -0
  96. package/dist/base/snap-grid.d.ts +2 -0
  97. package/dist/base/snap-grid.js +7 -0
  98. package/dist/base/spinner.d.ts +2 -0
  99. package/dist/base/spinner.js +11 -0
  100. package/dist/base/split-flap.d.ts +2 -0
  101. package/dist/base/split-flap.js +7 -0
  102. package/dist/base/spotlight-grid.d.ts +2 -0
  103. package/dist/base/spotlight-grid.js +7 -0
  104. package/dist/base/switch.d.ts +2 -0
  105. package/dist/base/switch.js +9 -0
  106. package/dist/base/tabs.d.ts +2 -0
  107. package/dist/base/tabs.js +9 -0
  108. package/dist/base/tag-input.d.ts +2 -0
  109. package/dist/base/tag-input.js +9 -0
  110. package/dist/base/textarea-aui-001.d.ts +2 -0
  111. package/dist/base/textarea-aui-001.js +9 -0
  112. package/dist/base/textarea-aui-002.d.ts +2 -0
  113. package/dist/base/textarea-aui-002.js +9 -0
  114. package/dist/base/textarea-aui-003.d.ts +2 -0
  115. package/dist/base/textarea-aui-003.js +9 -0
  116. package/dist/base/textarea-aui-004.d.ts +2 -0
  117. package/dist/base/textarea-aui-004.js +9 -0
  118. package/dist/base/textarea-aui-005.d.ts +2 -0
  119. package/dist/base/textarea-aui-005.js +9 -0
  120. package/dist/base/textarea-aui-006.d.ts +2 -0
  121. package/dist/base/textarea-aui-006.js +9 -0
  122. package/dist/base/textarea-aui-007.d.ts +2 -0
  123. package/dist/base/textarea-aui-007.js +9 -0
  124. package/dist/base/textarea-aui-008.d.ts +2 -0
  125. package/dist/base/textarea-aui-008.js +9 -0
  126. package/dist/base/textarea.d.ts +2 -0
  127. package/dist/base/textarea.js +9 -0
  128. package/dist/base/toast.d.ts +2 -0
  129. package/dist/base/toast.js +11 -0
  130. package/dist/base/tooltip.d.ts +2 -0
  131. package/dist/base/tooltip.js +9 -0
  132. package/dist/base/trade-ticket.d.ts +2 -0
  133. package/dist/base/trade-ticket.js +7 -0
  134. package/dist/base/variant-picker.d.ts +2 -0
  135. package/dist/base/variant-picker.js +7 -0
  136. package/dist/base.d.ts +1 -0
  137. package/dist/base.js +315 -0
  138. package/dist/bubble-wrap.d.ts +2 -0
  139. package/dist/bubble-wrap.js +7 -0
  140. package/dist/button.d.ts +2 -0
  141. package/dist/button.js +13 -0
  142. package/dist/candlestick.d.ts +2 -0
  143. package/dist/candlestick.js +7 -0
  144. package/dist/card-checkout.d.ts +2 -0
  145. package/dist/card-checkout.js +7 -0
  146. package/dist/cart-drawer.d.ts +2 -0
  147. package/dist/cart-drawer.js +7 -0
  148. package/dist/checkbox.d.ts +2 -0
  149. package/dist/checkbox.js +9 -0
  150. package/dist/chunk-2KJNBHUV.js +137 -0
  151. package/dist/chunk-2OGTIQVU.js +237 -0
  152. package/dist/chunk-2Z5Z4YYZ.js +57 -0
  153. package/dist/chunk-37JQA6PI.js +98 -0
  154. package/dist/chunk-3JNUC3FU.js +92 -0
  155. package/dist/chunk-4L4EKC46.js +360 -0
  156. package/dist/chunk-4WK3F76T.js +57 -0
  157. package/dist/chunk-56BEMYK3.js +36 -0
  158. package/dist/chunk-5A36JYGI.js +71 -0
  159. package/dist/chunk-5RPJPL2V.js +102 -0
  160. package/dist/chunk-6322OCI4.js +189 -0
  161. package/dist/chunk-66OZ7CBK.js +153 -0
  162. package/dist/chunk-6AZKJUL4.js +67 -0
  163. package/dist/chunk-7L4YE6HM.js +56 -0
  164. package/dist/chunk-7MGB7FVD.js +221 -0
  165. package/dist/chunk-7RCBOTWL.js +138 -0
  166. package/dist/chunk-7TK42PS3.js +247 -0
  167. package/dist/chunk-7UMBKY3H.js +105 -0
  168. package/dist/chunk-AS6RA64I.js +53 -0
  169. package/dist/chunk-B7V4ZTKI.js +53 -0
  170. package/dist/chunk-BH2DLHFW.js +145 -0
  171. package/dist/chunk-BOJCW7Z7.js +131 -0
  172. package/dist/chunk-C2G5BUEG.js +197 -0
  173. package/dist/chunk-CLCP2GFW.js +93 -0
  174. package/dist/chunk-CNY76NHF.js +92 -0
  175. package/dist/chunk-CTO36MY2.js +87 -0
  176. package/dist/chunk-DK2BM32V.js +71 -0
  177. package/dist/chunk-DQWKBQBT.js +68 -0
  178. package/dist/chunk-DUGKLVQJ.js +89 -0
  179. package/dist/chunk-E4MX3E3B.js +66 -0
  180. package/dist/chunk-EG7NXGDD.js +109 -0
  181. package/dist/chunk-EVSTTLOT.js +141 -0
  182. package/dist/chunk-F5I6EK7F.js +55 -0
  183. package/dist/chunk-FATLQKRY.js +88 -0
  184. package/dist/chunk-FK2LKLRN.js +89 -0
  185. package/dist/chunk-FT7WZV3D.js +184 -0
  186. package/dist/chunk-FUNXYRSG.js +198 -0
  187. package/dist/chunk-H4URFOQC.js +69 -0
  188. package/dist/chunk-H5C7HOQJ.js +84 -0
  189. package/dist/chunk-JAQANAOP.js +247 -0
  190. package/dist/chunk-JIVLBHHE.js +266 -0
  191. package/dist/chunk-KEMMI76V.js +94 -0
  192. package/dist/chunk-N6FMS47F.js +225 -0
  193. package/dist/chunk-NDBLIYMX.js +62 -0
  194. package/dist/chunk-OBU2UOYI.js +96 -0
  195. package/dist/chunk-OLNMOTAD.js +141 -0
  196. package/dist/chunk-OQU6KGVR.js +70 -0
  197. package/dist/chunk-PIC5ZIR3.js +55 -0
  198. package/dist/chunk-PSTMF66E.js +79 -0
  199. package/dist/chunk-Q7OHWQP2.js +108 -0
  200. package/dist/chunk-QDRBMWRX.js +190 -0
  201. package/dist/chunk-R3LWG23K.js +138 -0
  202. package/dist/chunk-RS3XHHDE.js +77 -0
  203. package/dist/chunk-SAJ4D3Z2.js +206 -0
  204. package/dist/chunk-SATIWCJQ.js +141 -0
  205. package/dist/chunk-SRGDJSW7.js +107 -0
  206. package/dist/chunk-T4SOPNM5.js +107 -0
  207. package/dist/chunk-TCID6NNE.js +69 -0
  208. package/dist/chunk-TIAKMX7U.js +49 -0
  209. package/dist/chunk-TRIXMWR3.js +74 -0
  210. package/dist/chunk-TRR3J5NJ.js +28 -0
  211. package/dist/chunk-U7BYEW3Y.js +115 -0
  212. package/dist/chunk-U7VX6A6K.js +136 -0
  213. package/dist/chunk-UAP47MSR.js +230 -0
  214. package/dist/chunk-UXRTPEH7.js +57 -0
  215. package/dist/chunk-VGBP42IZ.js +84 -0
  216. package/dist/chunk-VWYX5IRP.js +92 -0
  217. package/dist/chunk-WRB66XD3.js +31 -0
  218. package/dist/chunk-WSL4JGEA.js +87 -0
  219. package/dist/chunk-WVIV4JBH.js +69 -0
  220. package/dist/chunk-WWQV7LE7.js +198 -0
  221. package/dist/chunk-XIU7K2YE.js +60 -0
  222. package/dist/chunk-XNL5BLUR.js +283 -0
  223. package/dist/chunk-XRVVZA2Y.js +360 -0
  224. package/dist/chunk-XYNJQGYX.js +107 -0
  225. package/dist/chunk-YON5SU2G.js +156 -0
  226. package/dist/chunk-Z6IAITZJ.js +214 -0
  227. package/dist/chunk-ZE7BT2K4.js +173 -0
  228. package/dist/chunk-ZN3W5PAI.js +107 -0
  229. package/dist/chunk-ZQV2GAWY.js +178 -0
  230. package/dist/chunk-ZRGPSYW6.js +237 -0
  231. package/dist/chunk-ZWBJUJTR.js +83 -0
  232. package/dist/combo-lock.d.ts +2 -0
  233. package/dist/combo-lock.js +7 -0
  234. package/dist/command-palette.d.ts +2 -0
  235. package/dist/command-palette.js +11 -0
  236. package/dist/dial-knob.d.ts +2 -0
  237. package/dist/dial-knob.js +7 -0
  238. package/dist/dialog.d.ts +2 -0
  239. package/dist/dialog.js +9 -0
  240. package/dist/dropdown-menu.d.ts +2 -0
  241. package/dist/dropdown-menu.js +10 -0
  242. package/dist/elastic-string.d.ts +2 -0
  243. package/dist/elastic-string.js +7 -0
  244. package/dist/field.d.ts +2 -0
  245. package/dist/field.js +11 -0
  246. package/dist/footer.d.ts +2 -0
  247. package/dist/footer.js +12 -0
  248. package/dist/gravity-pills.d.ts +2 -0
  249. package/dist/gravity-pills.js +7 -0
  250. package/dist/hold-to-confirm.d.ts +2 -0
  251. package/dist/hold-to-confirm.js +7 -0
  252. package/dist/index.d.ts +1 -0
  253. package/dist/index.js +315 -0
  254. package/dist/ink-trail.d.ts +2 -0
  255. package/dist/ink-trail.js +7 -0
  256. package/dist/input.d.ts +2 -0
  257. package/dist/input.js +11 -0
  258. package/dist/kbd.d.ts +2 -0
  259. package/dist/kbd.js +11 -0
  260. package/dist/morse-tap.d.ts +2 -0
  261. package/dist/morse-tap.js +7 -0
  262. package/dist/motion-button.d.ts +2 -0
  263. package/dist/motion-button.js +23 -0
  264. package/dist/navbar.d.ts +2 -0
  265. package/dist/navbar.js +10 -0
  266. package/dist/needle-field.d.ts +2 -0
  267. package/dist/needle-field.js +7 -0
  268. package/dist/number-input.d.ts +2 -0
  269. package/dist/number-input.js +9 -0
  270. package/dist/order-book.d.ts +2 -0
  271. package/dist/order-book.js +7 -0
  272. package/dist/pay-methods.d.ts +2 -0
  273. package/dist/pay-methods.js +7 -0
  274. package/dist/payment-status.d.ts +2 -0
  275. package/dist/payment-status.js +7 -0
  276. package/dist/pixel-reveal.d.ts +2 -0
  277. package/dist/pixel-reveal.js +7 -0
  278. package/dist/price-chart.d.ts +2 -0
  279. package/dist/price-chart.js +7 -0
  280. package/dist/pricing.d.ts +2 -0
  281. package/dist/pricing.js +14 -0
  282. package/dist/radio-group.d.ts +2 -0
  283. package/dist/radio-group.js +11 -0
  284. package/dist/scramble-text.d.ts +2 -0
  285. package/dist/scramble-text.js +7 -0
  286. package/dist/segmented-control.d.ts +2 -0
  287. package/dist/segmented-control.js +9 -0
  288. package/dist/select.d.ts +2 -0
  289. package/dist/select.js +9 -0
  290. package/dist/settings-panel.d.ts +2 -0
  291. package/dist/settings-panel.js +10 -0
  292. package/dist/sign-in.d.ts +2 -0
  293. package/dist/sign-in.js +10 -0
  294. package/dist/skeleton.d.ts +2 -0
  295. package/dist/skeleton.js +13 -0
  296. package/dist/slider.d.ts +2 -0
  297. package/dist/slider.js +9 -0
  298. package/dist/snap-grid.d.ts +2 -0
  299. package/dist/snap-grid.js +7 -0
  300. package/dist/spinner.d.ts +2 -0
  301. package/dist/spinner.js +11 -0
  302. package/dist/split-flap.d.ts +2 -0
  303. package/dist/split-flap.js +7 -0
  304. package/dist/spotlight-grid.d.ts +2 -0
  305. package/dist/spotlight-grid.js +7 -0
  306. package/dist/styles.css +46 -0
  307. package/dist/switch.d.ts +2 -0
  308. package/dist/switch.js +9 -0
  309. package/dist/tabs.d.ts +2 -0
  310. package/dist/tabs.js +9 -0
  311. package/dist/tag-input.d.ts +2 -0
  312. package/dist/tag-input.js +9 -0
  313. package/dist/textarea-aui-001.d.ts +2 -0
  314. package/dist/textarea-aui-001.js +9 -0
  315. package/dist/textarea-aui-002.d.ts +2 -0
  316. package/dist/textarea-aui-002.js +9 -0
  317. package/dist/textarea-aui-003.d.ts +2 -0
  318. package/dist/textarea-aui-003.js +9 -0
  319. package/dist/textarea-aui-004.d.ts +2 -0
  320. package/dist/textarea-aui-004.js +9 -0
  321. package/dist/textarea-aui-005.d.ts +2 -0
  322. package/dist/textarea-aui-005.js +9 -0
  323. package/dist/textarea-aui-006.d.ts +2 -0
  324. package/dist/textarea-aui-006.js +9 -0
  325. package/dist/textarea-aui-007.d.ts +2 -0
  326. package/dist/textarea-aui-007.js +9 -0
  327. package/dist/textarea-aui-008.d.ts +2 -0
  328. package/dist/textarea-aui-008.js +9 -0
  329. package/dist/textarea.d.ts +2 -0
  330. package/dist/textarea.js +9 -0
  331. package/dist/toast.d.ts +2 -0
  332. package/dist/toast.js +11 -0
  333. package/dist/tooltip.d.ts +2 -0
  334. package/dist/tooltip.js +9 -0
  335. package/dist/trade-ticket.d.ts +2 -0
  336. package/dist/trade-ticket.js +7 -0
  337. package/dist/types/components/kit/accordion.d.ts +19 -0
  338. package/dist/types/components/kit/avatar.d.ts +32 -0
  339. package/dist/types/components/kit/badge.d.ts +23 -0
  340. package/dist/types/components/kit/base/accordion.d.ts +19 -0
  341. package/dist/types/components/kit/base/avatar.d.ts +32 -0
  342. package/dist/types/components/kit/base/button.d.ts +38 -0
  343. package/dist/types/components/kit/base/checkbox.d.ts +19 -0
  344. package/dist/types/components/kit/base/command-palette.d.ts +38 -0
  345. package/dist/types/components/kit/base/dialog.d.ts +21 -0
  346. package/dist/types/components/kit/base/dropdown-menu.d.ts +32 -0
  347. package/dist/types/components/kit/base/footer.d.ts +29 -0
  348. package/dist/types/components/kit/base/navbar.d.ts +54 -0
  349. package/dist/types/components/kit/base/pricing.d.ts +39 -0
  350. package/dist/types/components/kit/base/radio-group.d.ts +29 -0
  351. package/dist/types/components/kit/base/segmented-control.d.ts +23 -0
  352. package/dist/types/components/kit/base/select.d.ts +29 -0
  353. package/dist/types/components/kit/base/settings-panel.d.ts +29 -0
  354. package/dist/types/components/kit/base/sign-in.d.ts +17 -0
  355. package/dist/types/components/kit/base/slider.d.ts +27 -0
  356. package/dist/types/components/kit/base/switch.d.ts +22 -0
  357. package/dist/types/components/kit/base/tabs.d.ts +23 -0
  358. package/dist/types/components/kit/base/tooltip.d.ts +20 -0
  359. package/dist/types/components/kit/base/variants/textarea-aui-008.d.ts +23 -0
  360. package/dist/types/components/kit/button.d.ts +38 -0
  361. package/dist/types/components/kit/checkbox.d.ts +19 -0
  362. package/dist/types/components/kit/command-palette.d.ts +38 -0
  363. package/dist/types/components/kit/dialog.d.ts +21 -0
  364. package/dist/types/components/kit/dropdown-menu.d.ts +32 -0
  365. package/dist/types/components/kit/field.d.ts +19 -0
  366. package/dist/types/components/kit/footer.d.ts +29 -0
  367. package/dist/types/components/kit/input.d.ts +19 -0
  368. package/dist/types/components/kit/kbd.d.ts +26 -0
  369. package/dist/types/components/kit/motion-button.d.ts +30 -0
  370. package/dist/types/components/kit/navbar.d.ts +54 -0
  371. package/dist/types/components/kit/number-input.d.ts +20 -0
  372. package/dist/types/components/kit/pricing.d.ts +39 -0
  373. package/dist/types/components/kit/radio-group.d.ts +29 -0
  374. package/dist/types/components/kit/segmented-control.d.ts +23 -0
  375. package/dist/types/components/kit/select.d.ts +29 -0
  376. package/dist/types/components/kit/settings-panel.d.ts +29 -0
  377. package/dist/types/components/kit/sign-in.d.ts +17 -0
  378. package/dist/types/components/kit/skeleton.d.ts +20 -0
  379. package/dist/types/components/kit/slider.d.ts +27 -0
  380. package/dist/types/components/kit/spinner.d.ts +18 -0
  381. package/dist/types/components/kit/switch.d.ts +22 -0
  382. package/dist/types/components/kit/tabs.d.ts +23 -0
  383. package/dist/types/components/kit/tag-input.d.ts +16 -0
  384. package/dist/types/components/kit/textarea.d.ts +11 -0
  385. package/dist/types/components/kit/toast.d.ts +32 -0
  386. package/dist/types/components/kit/tooltip.d.ts +20 -0
  387. package/dist/types/components/kit/variants/textarea-aui-001.d.ts +13 -0
  388. package/dist/types/components/kit/variants/textarea-aui-002.d.ts +13 -0
  389. package/dist/types/components/kit/variants/textarea-aui-003.d.ts +16 -0
  390. package/dist/types/components/kit/variants/textarea-aui-004.d.ts +7 -0
  391. package/dist/types/components/kit/variants/textarea-aui-005.d.ts +8 -0
  392. package/dist/types/components/kit/variants/textarea-aui-006.d.ts +21 -0
  393. package/dist/types/components/kit/variants/textarea-aui-007.d.ts +20 -0
  394. package/dist/types/components/kit/variants/textarea-aui-008.d.ts +23 -0
  395. package/dist/types/components/lab/blocks/AddToCart.d.ts +10 -0
  396. package/dist/types/components/lab/blocks/BubbleWrap.d.ts +2 -0
  397. package/dist/types/components/lab/blocks/Candlestick.d.ts +2 -0
  398. package/dist/types/components/lab/blocks/CardCheckout.d.ts +5 -0
  399. package/dist/types/components/lab/blocks/CartDrawer.d.ts +2 -0
  400. package/dist/types/components/lab/blocks/ComboLock.d.ts +2 -0
  401. package/dist/types/components/lab/blocks/DialKnob.d.ts +2 -0
  402. package/dist/types/components/lab/blocks/ElasticString.d.ts +2 -0
  403. package/dist/types/components/lab/blocks/GravityPills.d.ts +2 -0
  404. package/dist/types/components/lab/blocks/HoldToConfirm.d.ts +6 -0
  405. package/dist/types/components/lab/blocks/InkTrail.d.ts +2 -0
  406. package/dist/types/components/lab/blocks/MorseTap.d.ts +2 -0
  407. package/dist/types/components/lab/blocks/NeedleField.d.ts +2 -0
  408. package/dist/types/components/lab/blocks/OrderBook.d.ts +2 -0
  409. package/dist/types/components/lab/blocks/PayMethods.d.ts +2 -0
  410. package/dist/types/components/lab/blocks/PaymentStatus.d.ts +2 -0
  411. package/dist/types/components/lab/blocks/PixelReveal.d.ts +2 -0
  412. package/dist/types/components/lab/blocks/PriceChart.d.ts +2 -0
  413. package/dist/types/components/lab/blocks/ScrambleText.d.ts +1 -0
  414. package/dist/types/components/lab/blocks/SnapGrid.d.ts +2 -0
  415. package/dist/types/components/lab/blocks/SplitFlap.d.ts +2 -0
  416. package/dist/types/components/lab/blocks/SpotlightGrid.d.ts +1 -0
  417. package/dist/types/components/lab/blocks/TradeTicket.d.ts +2 -0
  418. package/dist/types/components/lab/blocks/VariantPicker.d.ts +2 -0
  419. package/dist/types/packages/asta-ui/src/accordion.d.ts +2 -0
  420. package/dist/types/packages/asta-ui/src/add-to-cart.d.ts +2 -0
  421. package/dist/types/packages/asta-ui/src/avatar.d.ts +2 -0
  422. package/dist/types/packages/asta-ui/src/badge.d.ts +2 -0
  423. package/dist/types/packages/asta-ui/src/base/accordion.d.ts +2 -0
  424. package/dist/types/packages/asta-ui/src/base/add-to-cart.d.ts +2 -0
  425. package/dist/types/packages/asta-ui/src/base/avatar.d.ts +2 -0
  426. package/dist/types/packages/asta-ui/src/base/badge.d.ts +2 -0
  427. package/dist/types/packages/asta-ui/src/base/bubble-wrap.d.ts +2 -0
  428. package/dist/types/packages/asta-ui/src/base/button.d.ts +2 -0
  429. package/dist/types/packages/asta-ui/src/base/candlestick.d.ts +2 -0
  430. package/dist/types/packages/asta-ui/src/base/card-checkout.d.ts +2 -0
  431. package/dist/types/packages/asta-ui/src/base/cart-drawer.d.ts +2 -0
  432. package/dist/types/packages/asta-ui/src/base/checkbox.d.ts +2 -0
  433. package/dist/types/packages/asta-ui/src/base/combo-lock.d.ts +2 -0
  434. package/dist/types/packages/asta-ui/src/base/command-palette.d.ts +2 -0
  435. package/dist/types/packages/asta-ui/src/base/dial-knob.d.ts +2 -0
  436. package/dist/types/packages/asta-ui/src/base/dialog.d.ts +2 -0
  437. package/dist/types/packages/asta-ui/src/base/dropdown-menu.d.ts +2 -0
  438. package/dist/types/packages/asta-ui/src/base/elastic-string.d.ts +2 -0
  439. package/dist/types/packages/asta-ui/src/base/field.d.ts +2 -0
  440. package/dist/types/packages/asta-ui/src/base/footer.d.ts +2 -0
  441. package/dist/types/packages/asta-ui/src/base/gravity-pills.d.ts +2 -0
  442. package/dist/types/packages/asta-ui/src/base/hold-to-confirm.d.ts +2 -0
  443. package/dist/types/packages/asta-ui/src/base/ink-trail.d.ts +2 -0
  444. package/dist/types/packages/asta-ui/src/base/input.d.ts +2 -0
  445. package/dist/types/packages/asta-ui/src/base/kbd.d.ts +2 -0
  446. package/dist/types/packages/asta-ui/src/base/morse-tap.d.ts +2 -0
  447. package/dist/types/packages/asta-ui/src/base/motion-button.d.ts +2 -0
  448. package/dist/types/packages/asta-ui/src/base/navbar.d.ts +2 -0
  449. package/dist/types/packages/asta-ui/src/base/needle-field.d.ts +2 -0
  450. package/dist/types/packages/asta-ui/src/base/number-input.d.ts +2 -0
  451. package/dist/types/packages/asta-ui/src/base/order-book.d.ts +2 -0
  452. package/dist/types/packages/asta-ui/src/base/pay-methods.d.ts +2 -0
  453. package/dist/types/packages/asta-ui/src/base/payment-status.d.ts +2 -0
  454. package/dist/types/packages/asta-ui/src/base/pixel-reveal.d.ts +2 -0
  455. package/dist/types/packages/asta-ui/src/base/price-chart.d.ts +2 -0
  456. package/dist/types/packages/asta-ui/src/base/pricing.d.ts +2 -0
  457. package/dist/types/packages/asta-ui/src/base/radio-group.d.ts +2 -0
  458. package/dist/types/packages/asta-ui/src/base/scramble-text.d.ts +2 -0
  459. package/dist/types/packages/asta-ui/src/base/segmented-control.d.ts +2 -0
  460. package/dist/types/packages/asta-ui/src/base/select.d.ts +2 -0
  461. package/dist/types/packages/asta-ui/src/base/settings-panel.d.ts +2 -0
  462. package/dist/types/packages/asta-ui/src/base/sign-in.d.ts +2 -0
  463. package/dist/types/packages/asta-ui/src/base/skeleton.d.ts +2 -0
  464. package/dist/types/packages/asta-ui/src/base/slider.d.ts +2 -0
  465. package/dist/types/packages/asta-ui/src/base/snap-grid.d.ts +2 -0
  466. package/dist/types/packages/asta-ui/src/base/spinner.d.ts +2 -0
  467. package/dist/types/packages/asta-ui/src/base/split-flap.d.ts +2 -0
  468. package/dist/types/packages/asta-ui/src/base/spotlight-grid.d.ts +2 -0
  469. package/dist/types/packages/asta-ui/src/base/switch.d.ts +2 -0
  470. package/dist/types/packages/asta-ui/src/base/tabs.d.ts +2 -0
  471. package/dist/types/packages/asta-ui/src/base/tag-input.d.ts +2 -0
  472. package/dist/types/packages/asta-ui/src/base/textarea-aui-001.d.ts +2 -0
  473. package/dist/types/packages/asta-ui/src/base/textarea-aui-002.d.ts +2 -0
  474. package/dist/types/packages/asta-ui/src/base/textarea-aui-003.d.ts +2 -0
  475. package/dist/types/packages/asta-ui/src/base/textarea-aui-004.d.ts +2 -0
  476. package/dist/types/packages/asta-ui/src/base/textarea-aui-005.d.ts +2 -0
  477. package/dist/types/packages/asta-ui/src/base/textarea-aui-006.d.ts +2 -0
  478. package/dist/types/packages/asta-ui/src/base/textarea-aui-007.d.ts +2 -0
  479. package/dist/types/packages/asta-ui/src/base/textarea-aui-008.d.ts +2 -0
  480. package/dist/types/packages/asta-ui/src/base/textarea.d.ts +2 -0
  481. package/dist/types/packages/asta-ui/src/base/toast.d.ts +2 -0
  482. package/dist/types/packages/asta-ui/src/base/tooltip.d.ts +2 -0
  483. package/dist/types/packages/asta-ui/src/base/trade-ticket.d.ts +2 -0
  484. package/dist/types/packages/asta-ui/src/base/variant-picker.d.ts +2 -0
  485. package/dist/types/packages/asta-ui/src/base.d.ts +100 -0
  486. package/dist/types/packages/asta-ui/src/bubble-wrap.d.ts +2 -0
  487. package/dist/types/packages/asta-ui/src/button.d.ts +2 -0
  488. package/dist/types/packages/asta-ui/src/candlestick.d.ts +2 -0
  489. package/dist/types/packages/asta-ui/src/card-checkout.d.ts +2 -0
  490. package/dist/types/packages/asta-ui/src/cart-drawer.d.ts +2 -0
  491. package/dist/types/packages/asta-ui/src/checkbox.d.ts +2 -0
  492. package/dist/types/packages/asta-ui/src/combo-lock.d.ts +2 -0
  493. package/dist/types/packages/asta-ui/src/command-palette.d.ts +2 -0
  494. package/dist/types/packages/asta-ui/src/dial-knob.d.ts +2 -0
  495. package/dist/types/packages/asta-ui/src/dialog.d.ts +2 -0
  496. package/dist/types/packages/asta-ui/src/dropdown-menu.d.ts +2 -0
  497. package/dist/types/packages/asta-ui/src/elastic-string.d.ts +2 -0
  498. package/dist/types/packages/asta-ui/src/field.d.ts +2 -0
  499. package/dist/types/packages/asta-ui/src/footer.d.ts +2 -0
  500. package/dist/types/packages/asta-ui/src/gravity-pills.d.ts +2 -0
  501. package/dist/types/packages/asta-ui/src/hold-to-confirm.d.ts +2 -0
  502. package/dist/types/packages/asta-ui/src/index.d.ts +100 -0
  503. package/dist/types/packages/asta-ui/src/ink-trail.d.ts +2 -0
  504. package/dist/types/packages/asta-ui/src/input.d.ts +2 -0
  505. package/dist/types/packages/asta-ui/src/kbd.d.ts +2 -0
  506. package/dist/types/packages/asta-ui/src/morse-tap.d.ts +2 -0
  507. package/dist/types/packages/asta-ui/src/motion-button.d.ts +2 -0
  508. package/dist/types/packages/asta-ui/src/navbar.d.ts +2 -0
  509. package/dist/types/packages/asta-ui/src/needle-field.d.ts +2 -0
  510. package/dist/types/packages/asta-ui/src/number-input.d.ts +2 -0
  511. package/dist/types/packages/asta-ui/src/order-book.d.ts +2 -0
  512. package/dist/types/packages/asta-ui/src/pay-methods.d.ts +2 -0
  513. package/dist/types/packages/asta-ui/src/payment-status.d.ts +2 -0
  514. package/dist/types/packages/asta-ui/src/pixel-reveal.d.ts +2 -0
  515. package/dist/types/packages/asta-ui/src/price-chart.d.ts +2 -0
  516. package/dist/types/packages/asta-ui/src/pricing.d.ts +2 -0
  517. package/dist/types/packages/asta-ui/src/radio-group.d.ts +2 -0
  518. package/dist/types/packages/asta-ui/src/scramble-text.d.ts +2 -0
  519. package/dist/types/packages/asta-ui/src/segmented-control.d.ts +2 -0
  520. package/dist/types/packages/asta-ui/src/select.d.ts +2 -0
  521. package/dist/types/packages/asta-ui/src/settings-panel.d.ts +2 -0
  522. package/dist/types/packages/asta-ui/src/sign-in.d.ts +2 -0
  523. package/dist/types/packages/asta-ui/src/skeleton.d.ts +2 -0
  524. package/dist/types/packages/asta-ui/src/slider.d.ts +2 -0
  525. package/dist/types/packages/asta-ui/src/snap-grid.d.ts +2 -0
  526. package/dist/types/packages/asta-ui/src/spinner.d.ts +2 -0
  527. package/dist/types/packages/asta-ui/src/split-flap.d.ts +2 -0
  528. package/dist/types/packages/asta-ui/src/spotlight-grid.d.ts +2 -0
  529. package/dist/types/packages/asta-ui/src/switch.d.ts +2 -0
  530. package/dist/types/packages/asta-ui/src/tabs.d.ts +2 -0
  531. package/dist/types/packages/asta-ui/src/tag-input.d.ts +2 -0
  532. package/dist/types/packages/asta-ui/src/textarea-aui-001.d.ts +2 -0
  533. package/dist/types/packages/asta-ui/src/textarea-aui-002.d.ts +2 -0
  534. package/dist/types/packages/asta-ui/src/textarea-aui-003.d.ts +2 -0
  535. package/dist/types/packages/asta-ui/src/textarea-aui-004.d.ts +2 -0
  536. package/dist/types/packages/asta-ui/src/textarea-aui-005.d.ts +2 -0
  537. package/dist/types/packages/asta-ui/src/textarea-aui-006.d.ts +2 -0
  538. package/dist/types/packages/asta-ui/src/textarea-aui-007.d.ts +2 -0
  539. package/dist/types/packages/asta-ui/src/textarea-aui-008.d.ts +2 -0
  540. package/dist/types/packages/asta-ui/src/textarea.d.ts +2 -0
  541. package/dist/types/packages/asta-ui/src/toast.d.ts +2 -0
  542. package/dist/types/packages/asta-ui/src/tooltip.d.ts +2 -0
  543. package/dist/types/packages/asta-ui/src/trade-ticket.d.ts +2 -0
  544. package/dist/types/packages/asta-ui/src/variant-picker.d.ts +2 -0
  545. package/dist/variant-picker.d.ts +2 -0
  546. package/dist/variant-picker.js +7 -0
  547. package/package.json +86 -4
@@ -0,0 +1,360 @@
1
+ "use client";
2
+ import {
3
+ Button
4
+ } from "./chunk-WSL4JGEA.js";
5
+
6
+ // components/kit/base/navbar.tsx
7
+ import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
8
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
+ var cx = (...c) => c.filter(Boolean).join(" ");
10
+ var RING = "shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_12%,transparent)]";
11
+ var EASE = "ease-[cubic-bezier(.16,1,.3,1)]";
12
+ var Chevron = ({ className = "" }) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: cx("h-3.5 w-3.5", className), fill: "none", stroke: "currentColor", strokeWidth: "1.7", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "m6 4 4 4-4 4" }) });
13
+ function Preview({ kind }) {
14
+ const bar = "rounded-full bg-[color-mix(in_srgb,var(--ink)_12%,transparent)] transition-colors duration-500";
15
+ return /* @__PURE__ */ jsxs(
16
+ "div",
17
+ {
18
+ "aria-hidden": true,
19
+ className: cx(
20
+ "absolute -bottom-px -right-px h-[46%] w-[72%] rounded-tl-xl bg-paper p-3 transition-transform duration-500 group-hover/tile:-translate-x-1 group-hover/tile:-translate-y-1",
21
+ RING,
22
+ EASE
23
+ ),
24
+ children: [
25
+ kind === "chart" && /* @__PURE__ */ jsx("div", { className: "flex h-full items-end gap-1.5", children: [40, 64, 52, 80, 70, 96].map((h, i) => /* @__PURE__ */ jsx("span", { className: cx(bar, "w-full rounded-[3px] group-hover/tile:bg-brand"), style: { height: `${h}%`, transitionDelay: `${i * 40}ms` } }, i)) }),
26
+ kind === "list" && /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2", children: [80, 56, 68].map((w, i) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
27
+ /* @__PURE__ */ jsx("span", { className: cx(bar, "h-3 w-3 shrink-0 group-hover/tile:bg-brand"), style: { transitionDelay: `${i * 60}ms` } }),
28
+ /* @__PURE__ */ jsx("span", { className: cx(bar, "h-1.5"), style: { width: `${w}%` } })
29
+ ] }, i)) }),
30
+ kind === "code" && /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-1.5 font-mono", children: [
31
+ [20, 50],
32
+ [36, 30],
33
+ [28, 44],
34
+ [20, 24]
35
+ ].map(([a, b], i) => /* @__PURE__ */ jsxs("div", { className: "flex gap-1.5", children: [
36
+ /* @__PURE__ */ jsx("span", { className: cx(bar, "h-1.5 group-hover/tile:bg-brand"), style: { width: `${a}%`, transitionDelay: `${i * 50}ms` } }),
37
+ /* @__PURE__ */ jsx("span", { className: cx(bar, "h-1.5"), style: { width: `${b}%` } })
38
+ ] }, i)) })
39
+ ]
40
+ }
41
+ );
42
+ }
43
+ function Tile({ tile, big }) {
44
+ return /* @__PURE__ */ jsxs(
45
+ "a",
46
+ {
47
+ href: tile.href,
48
+ "data-kit-nav-link": true,
49
+ className: cx(
50
+ "group/tile relative flex flex-col gap-1.5 overflow-hidden rounded-[10px] bg-paper-2 p-4 outline-none transition-[opacity,background-color] duration-300",
51
+ "group-has-[a:hover]/menu:opacity-55 hover:!opacity-100 focus-visible:ring-2 focus-visible:ring-brand/50",
52
+ big ? "min-h-[184px]" : "min-h-[92px]"
53
+ ),
54
+ children: [
55
+ /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2 text-[14px] font-medium tracking-[-0.01em] text-ink", children: [
56
+ tile.icon && /* @__PURE__ */ jsx("span", { className: cx("flex h-6 w-6 items-center justify-center rounded-md bg-paper text-ink [&_svg]:h-3.5 [&_svg]:w-3.5", RING), children: tile.icon }),
57
+ tile.title,
58
+ /* @__PURE__ */ jsx(Chevron, { className: cx("-translate-x-0.5 text-mute transition-[translate,color] duration-300 group-hover/tile:translate-x-0 group-hover/tile:text-ink", EASE) })
59
+ ] }),
60
+ tile.description && /* @__PURE__ */ jsx("span", { className: cx("text-[12.5px] leading-snug text-mute", big && "max-w-[22ch]"), children: tile.description }),
61
+ big && tile.preview && /* @__PURE__ */ jsx(Preview, { kind: tile.preview })
62
+ ]
63
+ }
64
+ );
65
+ }
66
+ function Panel({ menu }) {
67
+ const tiles = menu.tiles ?? [];
68
+ const big = tiles.some((t) => t.preview);
69
+ return /* @__PURE__ */ jsxs("div", { className: "group/menu flex flex-col gap-2 p-2", children: [
70
+ tiles.length > 0 && /* @__PURE__ */ jsx("div", { className: "grid gap-2", style: { gridTemplateColumns: `repeat(${tiles.length === 4 ? 2 : tiles.length}, minmax(0, 1fr))` }, children: tiles.map((t) => /* @__PURE__ */ jsx(Tile, { tile: t, big }, t.title)) }),
71
+ (menu.columns || menu.feature) && /* @__PURE__ */ jsxs("div", { className: "grid gap-2", style: { gridTemplateColumns: `repeat(${(menu.columns?.length ?? 0) + (menu.feature ? 1 : 0)}, minmax(0, 1fr))` }, children: [
72
+ menu.columns?.map((col) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5 p-2", children: [
73
+ /* @__PURE__ */ jsx("span", { className: "mb-1.5 px-2 text-[11.5px] text-mute", children: col.heading }),
74
+ col.links.map((l) => /* @__PURE__ */ jsxs(
75
+ "a",
76
+ {
77
+ href: l.href,
78
+ "data-kit-nav-link": true,
79
+ className: "group/link flex flex-col rounded-lg px-2 py-1.5 outline-none transition-[background-color,opacity] duration-200 hover:bg-paper-2 focus-visible:bg-paper-2 group-has-[a:hover]/menu:opacity-60 hover:!opacity-100",
80
+ children: [
81
+ /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1 text-[13.5px] font-medium text-ink", children: [
82
+ l.title,
83
+ /* @__PURE__ */ jsx(Chevron, { className: cx("h-3 w-3 -translate-x-1 text-mute opacity-0 transition-[translate,opacity] duration-300 group-hover/link:translate-x-0 group-hover/link:opacity-100", EASE) })
84
+ ] }),
85
+ l.description && /* @__PURE__ */ jsx("span", { className: "text-[12px] leading-snug text-mute", children: l.description })
86
+ ]
87
+ },
88
+ l.title
89
+ ))
90
+ ] }, col.heading)),
91
+ menu.feature && /* @__PURE__ */ jsxs(
92
+ "a",
93
+ {
94
+ href: menu.feature.href,
95
+ "data-kit-nav-link": true,
96
+ className: "group/feat relative flex min-h-[200px] flex-col justify-end overflow-hidden rounded-[10px] bg-brand p-4 text-white outline-none transition-opacity duration-300 group-has-[a:hover]/menu:opacity-70 hover:!opacity-100 focus-visible:ring-2 focus-visible:ring-brand/50 focus-visible:ring-offset-2 focus-visible:ring-offset-paper",
97
+ children: [
98
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: cx("absolute -right-10 -top-10 h-40 w-40 rounded-full bg-white/15 transition-transform duration-700 group-hover/feat:scale-125", EASE) }),
99
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: cx("absolute -right-2 top-12 h-20 w-20 rounded-full bg-white/10 transition-transform duration-700 group-hover/feat:-translate-x-3", EASE) }),
100
+ /* @__PURE__ */ jsx("span", { className: "relative text-[15px] font-medium tracking-[-0.01em]", children: menu.feature.title }),
101
+ /* @__PURE__ */ jsx("span", { className: "relative mt-1 text-[12.5px] leading-snug text-white/80", children: menu.feature.description }),
102
+ /* @__PURE__ */ jsxs("span", { className: "relative mt-3 flex items-center gap-1 text-[13px] font-medium", children: [
103
+ menu.feature.cta,
104
+ /* @__PURE__ */ jsx(Chevron, { className: cx("transition-transform duration-300 group-hover/feat:translate-x-0.5", EASE) })
105
+ ] })
106
+ ]
107
+ }
108
+ )
109
+ ] })
110
+ ] });
111
+ }
112
+ var flat = (m) => [...m.tiles ?? [], ...m.columns?.flatMap((c) => c.links) ?? []];
113
+ function Navbar({ brand, brandHref = "/", items, docs, cta, scrollRoot, className }) {
114
+ const [open, setOpen] = useState(null);
115
+ const [dir, setDir] = useState(1);
116
+ const [last, setLast] = useState(null);
117
+ const [slide, setSlide] = useState(false);
118
+ const [size, setSize] = useState({ w: 0, h: 0 });
119
+ const [scrolled, setScrolled] = useState(false);
120
+ const [sheet, setSheet] = useState(false);
121
+ const [section, setSection] = useState(null);
122
+ const root = useRef(null);
123
+ const content = useRef(null);
124
+ const triggers = useRef([]);
125
+ const timer = useRef(void 0);
126
+ const focusPanel = useRef(false);
127
+ const openRef = useRef(null);
128
+ const shown = open ?? last;
129
+ useEffect(() => {
130
+ openRef.current = open;
131
+ }, [open]);
132
+ const show = useCallback((i) => {
133
+ clearTimeout(timer.current);
134
+ const cur = openRef.current;
135
+ const moving = i !== null && cur !== null && i !== cur;
136
+ if (moving) setDir(i > cur ? 1 : -1);
137
+ setSlide(moving);
138
+ if (i !== null) setLast(i);
139
+ setOpen(i);
140
+ }, []);
141
+ const enter = (i) => {
142
+ clearTimeout(timer.current);
143
+ if (openRef.current === null) timer.current = setTimeout(() => show(i), 110);
144
+ else show(i);
145
+ };
146
+ const leave = () => {
147
+ clearTimeout(timer.current);
148
+ timer.current = setTimeout(() => show(null), 180);
149
+ };
150
+ const stay = () => clearTimeout(timer.current);
151
+ useLayoutEffect(() => {
152
+ const el = content.current;
153
+ if (shown === null || !el) return;
154
+ const measure = () => setSize({ w: el.offsetWidth, h: el.offsetHeight });
155
+ measure();
156
+ const ro = new ResizeObserver(measure);
157
+ ro.observe(el);
158
+ if (focusPanel.current) {
159
+ focusPanel.current = false;
160
+ el.querySelector("[data-kit-nav-link]")?.focus();
161
+ }
162
+ return () => ro.disconnect();
163
+ }, [shown, open]);
164
+ useEffect(() => {
165
+ const el = scrollRoot?.current ?? null;
166
+ const read = () => setScrolled((el ? el.scrollTop : window.scrollY) > 40);
167
+ read();
168
+ const target = el ?? window;
169
+ target.addEventListener("scroll", read, { passive: true });
170
+ return () => target.removeEventListener("scroll", read);
171
+ }, [scrollRoot]);
172
+ useEffect(() => {
173
+ const down = (e) => {
174
+ if (!root.current?.contains(e.target)) {
175
+ show(null);
176
+ setSheet(false);
177
+ }
178
+ };
179
+ const key = (e) => {
180
+ if (e.key !== "Escape") return;
181
+ const i = openRef.current;
182
+ if (i !== null) {
183
+ show(null);
184
+ triggers.current[i]?.focus();
185
+ }
186
+ setSheet(false);
187
+ };
188
+ document.addEventListener("pointerdown", down);
189
+ document.addEventListener("keydown", key);
190
+ return () => {
191
+ document.removeEventListener("pointerdown", down);
192
+ document.removeEventListener("keydown", key);
193
+ };
194
+ }, [show]);
195
+ useEffect(() => () => clearTimeout(timer.current), []);
196
+ const menu = shown !== null ? items[shown]?.menu : void 0;
197
+ const trigger = "flex h-8 items-center gap-1 rounded-md px-2.5 text-[13.5px] font-medium text-ink-2 outline-none transition-colors duration-200 hover:bg-paper-2 hover:text-ink focus-visible:ring-2 focus-visible:ring-brand/50 aria-expanded:bg-paper-2 aria-expanded:text-ink";
198
+ return /* @__PURE__ */ jsxs(
199
+ "header",
200
+ {
201
+ ref: root,
202
+ className: cx(
203
+ "sticky top-0 z-30 w-full bg-paper/85 backdrop-blur-md transition-shadow duration-300",
204
+ scrolled || sheet ? "shadow-[0_1px_0_color-mix(in_srgb,var(--ink)_10%,transparent)]" : "",
205
+ className
206
+ ),
207
+ children: [
208
+ /* @__PURE__ */ jsx("style", { href: "asta-navbar", precedence: "asta", children: `
209
+ @keyframes kit-nav-in { from { opacity: 0; transform: translateX(calc(var(--kit-dir) * 36px)); } to { opacity: 1; transform: none; } }
210
+ @keyframes kit-nav-pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
211
+ @media (prefers-reduced-motion: reduce) { .kit-nav-motion, .kit-nav-motion * { animation: none !important; transition-duration: 0s !important; } }
212
+ ` }),
213
+ /* @__PURE__ */ jsxs("div", { className: "kit-nav-motion relative flex h-14 items-center gap-3 px-4", children: [
214
+ /* @__PURE__ */ jsx("a", { href: brandHref, className: "flex flex-1 items-center gap-2 text-[15px] font-semibold tracking-[-0.02em] text-ink outline-none focus-visible:ring-2 focus-visible:ring-brand/50 rounded-md", children: brand }),
215
+ /* @__PURE__ */ jsx("nav", { "aria-label": "Main", className: "hidden @min-[560px]:block", onPointerLeave: leave, onPointerEnter: stay, children: /* @__PURE__ */ jsx("ul", { className: "flex items-center gap-0.5", children: items.map((it, i) => /* @__PURE__ */ jsx("li", { children: it.menu ? /* @__PURE__ */ jsxs(
216
+ "button",
217
+ {
218
+ ref: (el) => {
219
+ triggers.current[i] = el;
220
+ },
221
+ type: "button",
222
+ "aria-expanded": open === i,
223
+ "aria-controls": "kit-nav-panel",
224
+ onPointerEnter: (e) => e.pointerType === "mouse" && enter(i),
225
+ onClick: () => show(open === i ? null : i),
226
+ onKeyDown: (e) => {
227
+ if (e.key === "ArrowDown" || (e.key === "Enter" || e.key === " ") && open !== i) {
228
+ e.preventDefault();
229
+ focusPanel.current = true;
230
+ show(i);
231
+ } else if (e.key === "ArrowRight" || e.key === "ArrowLeft") {
232
+ e.preventDefault();
233
+ const step = e.key === "ArrowRight" ? 1 : -1;
234
+ const next = (i + step + items.length) % items.length;
235
+ root.current?.querySelectorAll("nav[aria-label=Main] li > *")[next]?.focus();
236
+ if (open !== null && items[next].menu) show(next);
237
+ }
238
+ },
239
+ className: cx(trigger, "pr-2"),
240
+ children: [
241
+ it.label,
242
+ /* @__PURE__ */ jsx(Chevron, { className: cx("text-mute transition-transform duration-300", EASE, open === i ? "-rotate-90" : "rotate-90") })
243
+ ]
244
+ }
245
+ ) : /* @__PURE__ */ jsx("a", { href: it.href, className: trigger, onPointerEnter: () => openRef.current !== null && show(null), children: it.label }) }, it.label)) }) }),
246
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-1 items-center justify-end gap-1.5", children: [
247
+ docs && /* @__PURE__ */ jsx(
248
+ "div",
249
+ {
250
+ className: cx(
251
+ "hidden overflow-hidden transition-[max-width,opacity] duration-500 @min-[680px]:block",
252
+ EASE,
253
+ scrolled ? "max-w-0 opacity-0" : "max-w-[120px] opacity-100"
254
+ ),
255
+ "aria-hidden": scrolled || void 0,
256
+ children: /* @__PURE__ */ jsx(Button, { href: docs.href, variant: "ghost", size: "sm", shape: "pill", tabIndex: scrolled ? -1 : void 0, children: docs.label })
257
+ }
258
+ ),
259
+ /* @__PURE__ */ jsx(Button, { href: cta.href, size: "sm", shape: "pill", iconRight: /* @__PURE__ */ jsx(Chevron, {}), nudge: true, children: cta.label }),
260
+ /* @__PURE__ */ jsxs(
261
+ "button",
262
+ {
263
+ type: "button",
264
+ "aria-label": sheet ? "Close menu" : "Open menu",
265
+ "aria-expanded": sheet,
266
+ "aria-controls": "kit-nav-sheet",
267
+ onClick: () => setSheet((v) => !v),
268
+ className: "relative flex h-8 w-8 items-center justify-center rounded-md outline-none transition-colors hover:bg-paper-2 focus-visible:ring-2 focus-visible:ring-brand/50 @min-[560px]:hidden",
269
+ children: [
270
+ /* @__PURE__ */ jsx("span", { className: cx("absolute h-[1.5px] w-4 rounded-full bg-ink transition-transform duration-500", EASE, sheet ? "rotate-45" : "-translate-y-[3.5px]") }),
271
+ /* @__PURE__ */ jsx("span", { className: cx("absolute h-[1.5px] w-4 rounded-full bg-ink transition-transform duration-500", EASE, sheet ? "-rotate-45" : "translate-y-[3.5px]") })
272
+ ]
273
+ }
274
+ )
275
+ ] }),
276
+ /* @__PURE__ */ jsx(
277
+ "div",
278
+ {
279
+ id: "kit-nav-panel",
280
+ onPointerEnter: stay,
281
+ onPointerLeave: leave,
282
+ className: cx(
283
+ "absolute left-1/2 top-[calc(100%-2px)] hidden -translate-x-1/2 @min-[560px]:block",
284
+ open === null && "pointer-events-none"
285
+ ),
286
+ children: /* @__PURE__ */ jsx(
287
+ "div",
288
+ {
289
+ className: cx(
290
+ "overflow-hidden rounded-xl bg-paper shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_12%,transparent),0_16px_40px_-12px_rgb(0_0_0/0.22)] transition-[width,height,opacity,transform] duration-300",
291
+ EASE,
292
+ open === null ? "-translate-y-1 scale-[.98] opacity-0" : "opacity-100"
293
+ ),
294
+ style: { width: size.w || void 0, height: size.h || void 0 },
295
+ children: menu && /* @__PURE__ */ jsx(
296
+ "div",
297
+ {
298
+ ref: content,
299
+ className: "w-max",
300
+ style: {
301
+ "--kit-dir": dir,
302
+ width: `min(${menu.width ?? 560}px, calc(100cqw - 24px))`,
303
+ animation: slide ? "kit-nav-in .38s cubic-bezier(.16,1,.3,1) both" : void 0
304
+ },
305
+ children: /* @__PURE__ */ jsx(Panel, { menu })
306
+ },
307
+ shown
308
+ )
309
+ }
310
+ )
311
+ }
312
+ )
313
+ ] }),
314
+ /* @__PURE__ */ jsxs(
315
+ "div",
316
+ {
317
+ id: "kit-nav-sheet",
318
+ hidden: !sheet,
319
+ className: "kit-nav-motion absolute inset-x-0 top-full max-h-[calc(100svh-3.5rem)] overflow-y-auto bg-paper px-3 pb-6 pt-2 @min-[560px]:hidden",
320
+ style: { animation: sheet ? "kit-nav-pop .4s cubic-bezier(.16,1,.3,1) both" : void 0 },
321
+ children: [
322
+ /* @__PURE__ */ jsx("ul", { className: "flex flex-col", children: items.map((it, i) => /* @__PURE__ */ jsx("li", { children: it.menu ? /* @__PURE__ */ jsxs(Fragment, { children: [
323
+ /* @__PURE__ */ jsxs(
324
+ "button",
325
+ {
326
+ type: "button",
327
+ "aria-expanded": section === i,
328
+ onClick: () => setSection(section === i ? null : i),
329
+ className: "flex h-12 w-full items-center justify-between rounded-[10px] px-3 text-[15px] font-medium text-ink outline-none focus-visible:bg-paper-2",
330
+ children: [
331
+ it.label,
332
+ /* @__PURE__ */ jsx(Chevron, { className: cx("text-mute transition-transform duration-300", EASE, section === i ? "-rotate-90" : "rotate-90") })
333
+ ]
334
+ }
335
+ ),
336
+ /* @__PURE__ */ jsx("div", { className: cx("grid transition-[grid-template-rows] duration-500", EASE, section === i ? "grid-rows-[1fr]" : "grid-rows-[0fr]"), children: /* @__PURE__ */ jsx("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-0.5 pb-2 pl-2", children: flat(it.menu).map((l) => /* @__PURE__ */ jsxs("a", { href: l.href, tabIndex: section === i ? void 0 : -1, className: "flex items-center gap-3 rounded-lg px-3 py-2 outline-none hover:bg-paper-2 focus-visible:bg-paper-2", children: [
337
+ l.icon && /* @__PURE__ */ jsx("span", { className: cx("flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-paper-2 text-ink [&_svg]:h-3.5 [&_svg]:w-3.5"), children: l.icon }),
338
+ /* @__PURE__ */ jsxs("span", { className: "flex flex-col", children: [
339
+ /* @__PURE__ */ jsx("span", { className: "text-[14px] text-ink", children: l.title }),
340
+ l.description && /* @__PURE__ */ jsx("span", { className: "text-[12px] leading-snug text-mute", children: l.description })
341
+ ] })
342
+ ] }, l.title)) }) }) })
343
+ ] }) : /* @__PURE__ */ jsx("a", { href: it.href, className: "flex h-12 items-center rounded-[10px] px-3 text-[15px] font-medium text-ink outline-none focus-visible:bg-paper-2", children: it.label }) }, it.label)) }),
344
+ /* @__PURE__ */ jsxs("div", { className: "mt-4 flex flex-col gap-2 px-1", children: [
345
+ docs && /* @__PURE__ */ jsx(Button, { href: docs.href, variant: "outline", shape: "pill", className: "w-full", children: docs.label }),
346
+ /* @__PURE__ */ jsx(Button, { href: cta.href, shape: "pill", className: "w-full", children: cta.label })
347
+ ] })
348
+ ]
349
+ }
350
+ )
351
+ ]
352
+ }
353
+ );
354
+ }
355
+ var navbar_default = Navbar;
356
+
357
+ export {
358
+ Navbar,
359
+ navbar_default
360
+ };
@@ -0,0 +1,57 @@
1
+ "use client";
2
+
3
+ // components/lab/blocks/ComboLock.tsx
4
+ import { useRef, useState } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ var CODE = [4, 0, 4];
7
+ function ComboLock() {
8
+ const [d, setD] = useState([1, 7, 2]);
9
+ const [focus, setFocus] = useState(0);
10
+ const drag = useRef(null);
11
+ const open = d.every((v, i) => v === CODE[i]);
12
+ const set = (i, v) => setD((cur) => cur.map((x, k) => k === i ? (v % 10 + 10) % 10 : x));
13
+ return /* @__PURE__ */ jsxs("div", { className: "flex h-full w-full flex-col items-center justify-center gap-4", children: [
14
+ /* @__PURE__ */ jsx("svg", { viewBox: "0 0 40 24", className: `h-6 w-10 transition-all duration-500 ease-[cubic-bezier(.5,1.8,.4,.8)] ${open ? "-translate-y-2 text-signal" : "text-mute"}`, fill: "none", stroke: "currentColor", strokeWidth: "3", children: /* @__PURE__ */ jsx("path", { d: open ? "M10 24V12a10 10 0 0 1 20 0v2" : "M10 24V12a10 10 0 0 1 20 0v12" }) }),
15
+ /* @__PURE__ */ jsx(
16
+ "div",
17
+ {
18
+ tabIndex: 0,
19
+ role: "group",
20
+ "aria-label": `Lock, code ${d.join("")}`,
21
+ onKeyDown: (e) => {
22
+ if (e.key === "ArrowLeft") setFocus((f) => (f + 2) % 3);
23
+ if (e.key === "ArrowRight") setFocus((f) => (f + 1) % 3);
24
+ if (e.key === "ArrowUp" || e.key === "ArrowDown") {
25
+ e.preventDefault();
26
+ set(focus, d[focus] + (e.key === "ArrowUp" ? 1 : -1));
27
+ }
28
+ },
29
+ className: `flex gap-1 border p-1 outline-none transition-colors ${open ? "border-signal" : "border-line focus-visible:border-ink/40"}`,
30
+ children: d.map((v, i) => /* @__PURE__ */ jsx(
31
+ "div",
32
+ {
33
+ onPointerDown: (e) => {
34
+ e.currentTarget.setPointerCapture(e.pointerId);
35
+ drag.current = { i, y: e.clientY, v };
36
+ setFocus(i);
37
+ },
38
+ onPointerMove: (e) => {
39
+ if (drag.current?.i !== i) return;
40
+ set(i, drag.current.v + Math.round((drag.current.y - e.clientY) / 18));
41
+ },
42
+ onPointerUp: () => drag.current = null,
43
+ onWheel: (e) => set(i, v + Math.sign(e.deltaY)),
44
+ className: `relative h-[108px] w-14 cursor-ns-resize select-none overflow-hidden bg-paper-2 [touch-action:none] ${focus === i ? "outline outline-1 outline-ink/20" : ""}`,
45
+ children: /* @__PURE__ */ jsx("div", { className: "absolute inset-x-0 top-1/2 -translate-y-1/2 font-mono text-[28px] leading-[36px] tabular-nums", children: [-1, 0, 1].map((o) => /* @__PURE__ */ jsx("div", { className: `text-center transition-colors ${o === 0 ? open ? "text-signal" : "text-ink" : "text-ink/20"}`, children: ((v + o) % 10 + 10) % 10 }, o)) })
46
+ },
47
+ i
48
+ ))
49
+ }
50
+ ),
51
+ /* @__PURE__ */ jsx("span", { className: "font-mono text-[11px] uppercase tracking-[0.08em] text-mute", children: open ? "Unlocked" : "Hint: page not found" })
52
+ ] });
53
+ }
54
+
55
+ export {
56
+ ComboLock
57
+ };
@@ -0,0 +1,36 @@
1
+ "use client";
2
+
3
+ // components/kit/variants/textarea-aui-004.tsx
4
+ import { useId } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ var cx = (...c) => c.filter(Boolean).join(" ");
7
+ function FloatingLabelTextarea({ label, className, rows = 4, id, ...rest }) {
8
+ const auto = useId();
9
+ const fid = id ?? auto;
10
+ return /* @__PURE__ */ jsxs("div", { className: cx("relative w-full", className), children: [
11
+ /* @__PURE__ */ jsx(
12
+ "textarea",
13
+ {
14
+ id: fid,
15
+ rows,
16
+ placeholder: " ",
17
+ ...rest,
18
+ className: "peer block w-full resize-none rounded-xl bg-paper px-3.5 pb-3 pt-7 text-[14px] leading-[1.55] text-ink outline-none transition-shadow duration-200 shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_14%,transparent)] hover:shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_24%,transparent)] focus:!shadow-[inset_0_0_0_1px_var(--brand),0_0_0_4px_color-mix(in_srgb,var(--brand)_16%,transparent)] motion-reduce:transition-none"
19
+ }
20
+ ),
21
+ /* @__PURE__ */ jsx(
22
+ "label",
23
+ {
24
+ htmlFor: fid,
25
+ className: "pointer-events-none absolute left-3.5 top-0 origin-left translate-y-[18px] text-[14px] text-mute transition-[transform,color] duration-300 ease-[cubic-bezier(.16,1,.3,1)] peer-focus:translate-y-[9px] peer-focus:scale-[.82] peer-focus:text-brand peer-[:not(:placeholder-shown)]:translate-y-[9px] peer-[:not(:placeholder-shown)]:scale-[.82] motion-reduce:transition-none",
26
+ children: label
27
+ }
28
+ )
29
+ ] });
30
+ }
31
+ var textarea_aui_004_default = FloatingLabelTextarea;
32
+
33
+ export {
34
+ FloatingLabelTextarea,
35
+ textarea_aui_004_default
36
+ };
@@ -0,0 +1,71 @@
1
+ "use client";
2
+
3
+ // components/kit/base/switch.tsx
4
+ import { Switch as Sw } from "@base-ui/react/switch";
5
+ import { useId, useState } from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ var cx = (...c) => c.filter(Boolean).join(" ");
8
+ var DIM = {
9
+ sm: { w: 30, h: 18, t: 14 },
10
+ md: { w: 40, h: 24, t: 20 },
11
+ lg: { w: 52, h: 30, t: 26 }
12
+ };
13
+ function Switch({ checked, defaultChecked = false, onCheckedChange, size = "md", disabled, label, description, id, name, className, "aria-label": ariaLabel }) {
14
+ const auto = useId();
15
+ const sid = id ?? auto;
16
+ const [inner, setInner] = useState(defaultChecked);
17
+ const [press, setPress] = useState(false);
18
+ const on = checked ?? inner;
19
+ const { w, h, t } = DIM[size];
20
+ const pad = (h - t) / 2;
21
+ const stretch = press ? t * 0.3 : 0;
22
+ const x = on ? w - pad * 2 - t - stretch : 0;
23
+ const control = /* @__PURE__ */ jsx(
24
+ Sw.Root,
25
+ {
26
+ id: sid,
27
+ name,
28
+ checked: on,
29
+ onCheckedChange: (v) => {
30
+ if (checked === void 0) setInner(v);
31
+ onCheckedChange?.(v);
32
+ },
33
+ "aria-label": ariaLabel,
34
+ "aria-describedby": description ? `${sid}-d` : void 0,
35
+ disabled,
36
+ onPointerDown: () => setPress(true),
37
+ onPointerUp: () => setPress(false),
38
+ onPointerLeave: () => setPress(false),
39
+ onKeyDown: (e) => (e.key === " " || e.key === "Enter") && setPress(true),
40
+ onKeyUp: () => setPress(false),
41
+ onBlur: () => setPress(false),
42
+ className: cx(
43
+ "relative shrink-0 rounded-full outline-none transition-[background-color,box-shadow] duration-300",
44
+ "focus-visible:ring-2 focus-visible:ring-brand/50 focus-visible:ring-offset-2 focus-visible:ring-offset-paper disabled:opacity-45",
45
+ on ? "bg-brand shadow-[inset_0_1px_2px_rgb(0_0_0/0.15)]" : "bg-[color-mix(in_srgb,var(--ink)_14%,var(--paper))] shadow-[inset_0_1px_2px_rgb(0_0_0/0.08)]"
46
+ ),
47
+ style: { width: w, height: h, padding: pad },
48
+ children: /* @__PURE__ */ jsx(
49
+ Sw.Thumb,
50
+ {
51
+ className: "block rounded-full bg-white shadow-[0_1px_2px_rgb(0_0_0/0.2),0_2px_6px_-1px_rgb(0_0_0/0.18)] transition-[transform,width] duration-[450ms] ease-[cubic-bezier(.34,1.56,.64,1)] motion-reduce:transition-none",
52
+ style: { width: t + stretch, height: t, transform: `translateX(${x}px)` }
53
+ }
54
+ )
55
+ }
56
+ );
57
+ if (!label) return /* @__PURE__ */ jsx("span", { className, children: control });
58
+ return /* @__PURE__ */ jsxs("div", { className: cx("flex items-center justify-between gap-4", disabled && "opacity-60", className), children: [
59
+ /* @__PURE__ */ jsxs("span", { className: "min-w-0", children: [
60
+ /* @__PURE__ */ jsx("label", { htmlFor: sid, className: cx("block select-none text-[14px] leading-5 text-ink", !disabled && "cursor-pointer"), children: label }),
61
+ description && /* @__PURE__ */ jsx("span", { id: `${sid}-d`, className: "mt-0.5 block text-[13px] leading-snug text-mute", children: description })
62
+ ] }),
63
+ control
64
+ ] });
65
+ }
66
+ var switch_default = Switch;
67
+
68
+ export {
69
+ Switch,
70
+ switch_default
71
+ };
@@ -0,0 +1,102 @@
1
+ "use client";
2
+
3
+ // components/lab/blocks/PixelReveal.tsx
4
+ import { useEffect, useRef } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ var PX = 12;
7
+ function PixelReveal() {
8
+ const ref = useRef(null);
9
+ useEffect(() => {
10
+ const cv = ref.current;
11
+ const ctx = cv.getContext("2d");
12
+ let w = 0;
13
+ let h = 0;
14
+ let cols = 0;
15
+ let rows = 0;
16
+ let dpr = 1;
17
+ let cells = new Float32Array(0);
18
+ let idle = new Float32Array(0);
19
+ let raf = 0;
20
+ let last = performance.now();
21
+ let visible = true;
22
+ const size = () => {
23
+ const r = cv.getBoundingClientRect();
24
+ w = r.width;
25
+ h = r.height;
26
+ dpr = Math.min(window.devicePixelRatio || 1, 2);
27
+ cv.width = Math.round(w * dpr);
28
+ cv.height = Math.round(h * dpr);
29
+ cols = Math.ceil(w / PX);
30
+ rows = Math.ceil(h / PX);
31
+ cells = new Float32Array(cols * rows).fill(1);
32
+ idle = new Float32Array(cols * rows);
33
+ };
34
+ const draw = (t) => {
35
+ const dt = t - last;
36
+ last = t;
37
+ ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
38
+ ctx.clearRect(0, 0, w, h);
39
+ for (let i = 0; i < cells.length; i++) {
40
+ if (cells[i] < 1) {
41
+ idle[i] += dt;
42
+ if (idle[i] > 1800) cells[i] = Math.min(1, cells[i] + dt / 900);
43
+ }
44
+ const v = cells[i];
45
+ if (v <= 0.02) continue;
46
+ const x = i % cols * PX;
47
+ const y = Math.floor(i / cols) * PX;
48
+ const s = PX * v;
49
+ const shade = 20 + i * 7919 % 9;
50
+ ctx.fillStyle = `rgb(${shade} ${shade + 1} ${shade - 1})`;
51
+ ctx.fillRect(x + (PX - s) / 2, y + (PX - s) / 2, s, s);
52
+ }
53
+ if (visible) raf = requestAnimationFrame(draw);
54
+ };
55
+ const move = (e) => {
56
+ const r = cv.getBoundingClientRect();
57
+ const px = e.clientX - r.left;
58
+ const py = e.clientY - r.top;
59
+ const R = 34;
60
+ for (let y = Math.max(0, Math.floor((py - R) / PX)); y <= Math.min(rows - 1, Math.floor((py + R) / PX)); y++) {
61
+ for (let x = Math.max(0, Math.floor((px - R) / PX)); x <= Math.min(cols - 1, Math.floor((px + R) / PX)); x++) {
62
+ const d = Math.hypot(x * PX + PX / 2 - px, y * PX + PX / 2 - py);
63
+ if (d < R) {
64
+ const i = y * cols + x;
65
+ cells[i] = Math.min(cells[i], d / R - 0.3 < 0 ? 0 : d / R * 0.6);
66
+ idle[i] = 0;
67
+ }
68
+ }
69
+ }
70
+ };
71
+ size();
72
+ const ro = new ResizeObserver(size);
73
+ ro.observe(cv);
74
+ const io = new IntersectionObserver(([e]) => {
75
+ visible = e.isIntersecting;
76
+ cancelAnimationFrame(raf);
77
+ last = performance.now();
78
+ if (visible) raf = requestAnimationFrame(draw);
79
+ });
80
+ io.observe(cv);
81
+ cv.addEventListener("pointermove", move);
82
+ return () => {
83
+ cancelAnimationFrame(raf);
84
+ ro.disconnect();
85
+ io.disconnect();
86
+ cv.removeEventListener("pointermove", move);
87
+ };
88
+ }, []);
89
+ return /* @__PURE__ */ jsxs("div", { className: "relative h-full w-full overflow-hidden", children: [
90
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 grid place-items-center p-6 text-center", children: /* @__PURE__ */ jsxs("p", { className: "font-medium leading-[0.92] tracking-[-0.05em] text-[clamp(2rem,4.2vw,3.2rem)] text-signal", children: [
91
+ "Made by",
92
+ /* @__PURE__ */ jsx("br", {}),
93
+ "hand."
94
+ ] }) }),
95
+ /* @__PURE__ */ jsx("canvas", { ref, className: "absolute inset-0 h-full w-full [touch-action:none]", "aria-label": "Rub to reveal" }),
96
+ /* @__PURE__ */ jsx("span", { className: "font-mono text-[11px] uppercase tracking-[0.08em] pointer-events-none absolute bottom-3 left-4 text-mute", children: "Rub to reveal" })
97
+ ] });
98
+ }
99
+
100
+ export {
101
+ PixelReveal
102
+ };