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,225 @@
1
+ "use client";
2
+
3
+ // components/lab/blocks/AddToCart.tsx
4
+ import { useEffect, useRef, useState } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ var EASE = "cubic-bezier(.16,1,.3,1)";
7
+ var RING = "shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_10%,transparent)]";
8
+ var CartIcon = ({ className = "h-[18px] w-[18px]" }) => /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 20 20", className, fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
9
+ /* @__PURE__ */ jsx("path", { d: "M2.5 3h2l2 9.5h8.5l1.8-6.5H6" }),
10
+ /* @__PURE__ */ jsx("circle", { cx: "8", cy: "16", r: "1.1" }),
11
+ /* @__PURE__ */ jsx("circle", { cx: "14.5", cy: "16", r: "1.1" })
12
+ ] });
13
+ function AddToCart({
14
+ image = "https://ui.astabyte.com/lab/headphones.jpg",
15
+ imageAlt = "",
16
+ name = "Studio headphones",
17
+ meta = "Audio \xB7 Graphite",
18
+ price = "$189.00"
19
+ } = {}) {
20
+ const [count, setCount] = useState(0);
21
+ const [pressed, setPressed] = useState(false);
22
+ const [paused, setPaused] = useState(false);
23
+ const root = useRef(null);
24
+ const from = useRef(null);
25
+ const cart = useRef(null);
26
+ const idle = useRef(null);
27
+ const badge = useRef(null);
28
+ const bump = () => {
29
+ cart.current?.animate(
30
+ [
31
+ { transform: "scale(1, 1)" },
32
+ { transform: "scale(1.12, 0.88)", offset: 0.22 },
33
+ { transform: "scale(0.95, 1.05)", offset: 0.5 },
34
+ { transform: "scale(1.02, 0.99)", offset: 0.75 },
35
+ { transform: "scale(1, 1)" }
36
+ ],
37
+ { duration: 680, easing: "cubic-bezier(.22,1,.36,1)" }
38
+ );
39
+ badge.current?.animate(
40
+ [{ transform: "scale(0.5)" }, { transform: "scale(1.22)", offset: 0.4 }, { transform: "scale(0.94)", offset: 0.7 }, { transform: "scale(1)" }],
41
+ { duration: 620, easing: "cubic-bezier(.22,1,.36,1)" }
42
+ );
43
+ };
44
+ const fly = (then) => {
45
+ const box = root.current;
46
+ const a = from.current?.getBoundingClientRect();
47
+ const c = cart.current?.getBoundingClientRect();
48
+ if (!box || !a || !c || window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
49
+ then();
50
+ bump();
51
+ return;
52
+ }
53
+ const b = box.getBoundingClientRect();
54
+ const dot = document.createElement("span");
55
+ const x0 = a.left + a.width / 2 - b.left;
56
+ const y0 = a.top + a.height / 2 - b.top;
57
+ Object.assign(dot.style, {
58
+ position: "absolute",
59
+ left: `${x0 - 6}px`,
60
+ top: `${y0 - 6}px`,
61
+ width: "12px",
62
+ height: "12px",
63
+ borderRadius: "999px",
64
+ background: "var(--brand)",
65
+ boxShadow: "0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent)",
66
+ pointerEvents: "none",
67
+ zIndex: "20"
68
+ });
69
+ box.appendChild(dot);
70
+ const dx = c.left + c.width / 2 - b.left - x0;
71
+ const dy = c.top + c.height / 2 - b.top - y0;
72
+ const lift = Math.min(110, Math.abs(dy) * 0.6 + 40);
73
+ const ease = (t) => t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2;
74
+ const cx = dx * 0.35;
75
+ const cy = Math.min(0, dy) - lift;
76
+ const frames = [];
77
+ const N = 40;
78
+ for (let i = 0; i <= N; i++) {
79
+ const t = ease(i / N);
80
+ const x = 2 * (1 - t) * t * cx + t * t * dx;
81
+ const y = 2 * (1 - t) * t * cy + t * t * dy;
82
+ frames.push({ transform: `translate(${x}px, ${y}px) scale(${1 - 0.5 * t})`, opacity: t < 0.8 ? 1 : 1 - (t - 0.8) / 0.2 });
83
+ }
84
+ dot.style.willChange = "transform, opacity";
85
+ const anim = dot.animate(frames, { duration: 760, easing: "linear" });
86
+ anim.onfinish = () => {
87
+ dot.remove();
88
+ then();
89
+ bump();
90
+ };
91
+ };
92
+ const add = () => fly(() => setCount((c) => c + 1));
93
+ const takeOver = () => {
94
+ setPaused(true);
95
+ if (idle.current) clearTimeout(idle.current);
96
+ idle.current = setTimeout(() => setPaused(false), 8e3);
97
+ };
98
+ useEffect(() => () => void (idle.current && clearTimeout(idle.current)), []);
99
+ useEffect(() => {
100
+ if (paused) return;
101
+ const t = [];
102
+ let alive = true;
103
+ const run = () => {
104
+ t.push(setTimeout(() => setPressed(true), 1100));
105
+ t.push(
106
+ setTimeout(() => {
107
+ setPressed(false);
108
+ if (alive) add();
109
+ }, 1280)
110
+ );
111
+ t.push(setTimeout(() => alive && add(), 3200));
112
+ t.push(setTimeout(() => setCount(0), 5600));
113
+ t.push(setTimeout(() => alive && run(), 6400));
114
+ };
115
+ t.push(setTimeout(() => alive && setCount(0), 0));
116
+ run();
117
+ return () => {
118
+ alive = false;
119
+ t.forEach(clearTimeout);
120
+ };
121
+ }, [paused]);
122
+ const on = count > 0;
123
+ return /* @__PURE__ */ jsxs("div", { ref: root, className: "relative h-full w-full overflow-hidden", style: { containerType: "size" }, children: [
124
+ /* @__PURE__ */ jsx("style", { href: "asta-addtocart", precedence: "asta", children: `
125
+ @keyframes lab-atc-roll { from { transform: translateY(70%); opacity: 0; filter: blur(2px) } to { transform: none; opacity: 1; filter: none } }
126
+ @media (prefers-reduced-motion: reduce) { .lab-atc-anim { animation: none !important } }
127
+ ` }),
128
+ /* @__PURE__ */ jsxs(
129
+ "div",
130
+ {
131
+ ref: cart,
132
+ className: `absolute left-4 top-4 flex h-10 w-10 items-center justify-center rounded-[9px] bg-paper-2 text-ink-2 ${RING}`,
133
+ "aria-label": `Cart, ${count} item${count === 1 ? "" : "s"}`,
134
+ role: "status",
135
+ children: [
136
+ /* @__PURE__ */ jsx(CartIcon, {}),
137
+ /* @__PURE__ */ jsx(
138
+ "span",
139
+ {
140
+ ref: badge,
141
+ "aria-hidden": true,
142
+ className: "absolute -right-1.5 -top-1.5 flex h-[18px] min-w-[18px] items-center justify-center rounded-full bg-brand px-1 text-[10.5px] font-semibold tabular-nums text-paper transition-[opacity,scale] duration-500 motion-reduce:transition-none",
143
+ style: { transitionTimingFunction: EASE, opacity: on ? 1 : 0, scale: on ? "1" : "0.4" },
144
+ children: Math.max(count, 1)
145
+ }
146
+ )
147
+ ]
148
+ }
149
+ ),
150
+ /* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center justify-center px-5 pt-10", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-[460px] items-center gap-[5cqw]", children: [
151
+ /* @__PURE__ */ jsxs("div", { className: `relative shrink-0 overflow-hidden rounded-[12px] bg-[#f4f4f4] ${RING}`, style: { width: "min(38cqw, 62cqh)", aspectRatio: "1" }, children: [
152
+ /* @__PURE__ */ jsx("img", { src: image, alt: imageAlt, width: 480, height: 480, loading: "lazy", decoding: "async", draggable: false, className: "absolute inset-0 h-full w-full object-cover grayscale" }),
153
+ /* @__PURE__ */ jsx("span", { className: "absolute bottom-2.5 left-3 font-mono text-[10px] uppercase tracking-wider text-black/45", children: "N\xBA 04" })
154
+ ] }),
155
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [
156
+ /* @__PURE__ */ jsx("span", { className: "font-mono text-[10.5px] uppercase tracking-wider text-mute", children: meta }),
157
+ /* @__PURE__ */ jsx("span", { className: "mt-1.5 truncate text-[clamp(15px,4.4cqw,22px)] font-medium tracking-[-0.02em] text-ink", children: name }),
158
+ /* @__PURE__ */ jsx("span", { className: "mt-0.5 text-[clamp(13px,3.4cqw,16px)] tabular-nums text-ink-2", children: price }),
159
+ /* @__PURE__ */ jsxs("div", { ref: from, className: "relative mt-[max(14px,5cqh)] h-10 w-full max-w-[220px]", children: [
160
+ /* @__PURE__ */ jsx(
161
+ "button",
162
+ {
163
+ type: "button",
164
+ onClick: () => {
165
+ takeOver();
166
+ add();
167
+ },
168
+ tabIndex: on ? -1 : 0,
169
+ "aria-hidden": on,
170
+ className: `absolute inset-0 flex items-center justify-center gap-2 rounded-[9px] bg-ink text-[13.5px] font-medium text-paper outline-none transition-[opacity,transform] duration-[600ms] focus-visible:ring-2 focus-visible:ring-brand/60 ${on ? "pointer-events-none scale-[0.92] opacity-0" : pressed ? "scale-[0.96]" : ""}`,
171
+ style: { transitionTimingFunction: EASE },
172
+ children: "Add to cart"
173
+ }
174
+ ),
175
+ /* @__PURE__ */ jsxs(
176
+ "div",
177
+ {
178
+ className: `absolute inset-0 flex items-center justify-between rounded-[9px] bg-paper-2 px-1 transition-[opacity,transform] duration-[600ms] ${RING} ${on ? "" : "pointer-events-none scale-[1.06] opacity-0"}`,
179
+ style: { transitionTimingFunction: EASE },
180
+ "aria-hidden": !on,
181
+ children: [
182
+ /* @__PURE__ */ jsx(
183
+ "button",
184
+ {
185
+ type: "button",
186
+ tabIndex: on ? 0 : -1,
187
+ "aria-label": "Remove one",
188
+ onClick: () => {
189
+ takeOver();
190
+ setCount((c) => Math.max(0, c - 1));
191
+ },
192
+ className: "flex h-8 w-8 items-center justify-center rounded-[7px] text-[17px] text-ink-2 outline-none transition-colors hover:bg-paper hover:text-ink focus-visible:ring-2 focus-visible:ring-brand/60",
193
+ children: "\u2212"
194
+ }
195
+ ),
196
+ /* @__PURE__ */ jsx("span", { className: "relative h-5 overflow-hidden text-[13.5px] font-medium tabular-nums text-ink", children: /* @__PURE__ */ jsxs("span", { className: "lab-atc-anim block", style: { animation: `lab-atc-roll .55s ${EASE}` }, children: [
197
+ count,
198
+ " in cart"
199
+ ] }, count) }),
200
+ /* @__PURE__ */ jsx(
201
+ "button",
202
+ {
203
+ type: "button",
204
+ tabIndex: on ? 0 : -1,
205
+ "aria-label": "Add one",
206
+ onClick: () => {
207
+ takeOver();
208
+ add();
209
+ },
210
+ className: "flex h-8 w-8 items-center justify-center rounded-[7px] text-[17px] text-ink-2 outline-none transition-colors hover:bg-paper hover:text-ink focus-visible:ring-2 focus-visible:ring-brand/60",
211
+ children: "+"
212
+ }
213
+ )
214
+ ]
215
+ }
216
+ )
217
+ ] })
218
+ ] })
219
+ ] }) })
220
+ ] });
221
+ }
222
+
223
+ export {
224
+ AddToCart
225
+ };
@@ -0,0 +1,62 @@
1
+ "use client";
2
+
3
+ // components/kit/spinner.tsx
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ var cx = (...c) => c.filter(Boolean).join(" ");
6
+ var KEYFRAMES = `
7
+ @keyframes kit-spin { to { transform: rotate(360deg) } }
8
+ @keyframes kit-dot { 0%, 80%, 100% { transform: scale(.55); opacity: .35 } 40% { transform: scale(1); opacity: 1 } }
9
+ @keyframes kit-bar { 0%, 100% { transform: scaleY(.35) } 50% { transform: scaleY(1) } }
10
+ @keyframes kit-indet { 0% { left: -40%; width: 40% } 60% { width: 55% } 100% { left: 100%; width: 40% } }
11
+ @media (prefers-reduced-motion: reduce) { .kit-spinner * { animation-duration: 2.4s !important } }
12
+ `;
13
+ function Spinner({ variant = "ring", label = "Loading", className }) {
14
+ return /* @__PURE__ */ jsxs("span", { role: "status", "aria-label": label, className: cx("kit-spinner relative inline-flex h-[1em] w-[1em] shrink-0 items-center justify-center", className), children: [
15
+ /* @__PURE__ */ jsx("style", { href: "asta-spinner", precedence: "asta", children: KEYFRAMES }),
16
+ variant === "ring" && /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", className: "h-full w-full animate-[kit-spin_.8s_linear_infinite]", fill: "none", "aria-hidden": true, children: [
17
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "9.5", stroke: "currentColor", strokeOpacity: ".18", strokeWidth: "2.5" }),
18
+ /* @__PURE__ */ jsx("path", { d: "M21.5 12A9.5 9.5 0 0 0 12 2.5", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round" })
19
+ ] }),
20
+ variant === "dots" && /* @__PURE__ */ jsx("span", { className: "flex h-full w-full items-center justify-between", "aria-hidden": true, children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx("span", { className: "h-[26%] w-[26%] rounded-full bg-current", style: { animation: `kit-dot 1.1s ${i * 0.16}s cubic-bezier(.16,1,.3,1) infinite` } }, i)) }),
21
+ variant === "bars" && /* @__PURE__ */ jsx("span", { className: "flex h-[80%] w-full items-center justify-between", "aria-hidden": true, children: [0, 1, 2, 3].map((i) => /* @__PURE__ */ jsx("span", { className: "h-full w-[16%] rounded-full bg-current", style: { animation: `kit-bar .9s ${i * 0.12}s ease-in-out infinite` } }, i)) }),
22
+ variant === "orbit" && /* @__PURE__ */ jsxs("span", { className: "relative h-full w-full", "aria-hidden": true, children: [
23
+ /* @__PURE__ */ jsx("span", { className: "absolute inset-[30%] rounded-full bg-current opacity-25" }),
24
+ /* @__PURE__ */ jsx("span", { className: "absolute inset-0 animate-[kit-spin_1.2s_cubic-bezier(.6,.1,.4,.9)_infinite]", children: /* @__PURE__ */ jsx("span", { className: "absolute left-1/2 top-0 h-[24%] w-[24%] -translate-x-1/2 rounded-full bg-current" }) }),
25
+ /* @__PURE__ */ jsx("span", { className: "absolute inset-0 animate-[kit-spin_1.8s_linear_infinite_reverse]", children: /* @__PURE__ */ jsx("span", { className: "absolute bottom-[6%] left-1/2 h-[16%] w-[16%] -translate-x-1/2 rounded-full bg-current opacity-60" }) })
26
+ ] })
27
+ ] });
28
+ }
29
+ function Progress({ value, label, showValue, className }) {
30
+ const v = value === void 0 ? void 0 : Math.max(0, Math.min(100, value));
31
+ return /* @__PURE__ */ jsxs("div", { className: cx("w-full", className), children: [
32
+ (label || showValue) && /* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-between text-[13px]", children: [
33
+ /* @__PURE__ */ jsx("span", { className: "text-ink-2", children: label }),
34
+ showValue && v !== void 0 && /* @__PURE__ */ jsxs("span", { className: "tabular-nums text-mute", children: [
35
+ Math.round(v),
36
+ "%"
37
+ ] })
38
+ ] }),
39
+ /* @__PURE__ */ jsxs(
40
+ "div",
41
+ {
42
+ role: "progressbar",
43
+ "aria-label": label ?? "Progress",
44
+ "aria-valuemin": 0,
45
+ "aria-valuemax": 100,
46
+ "aria-valuenow": v,
47
+ className: "kit-spinner relative h-1.5 w-full overflow-hidden rounded-full bg-[color-mix(in_srgb,var(--ink)_9%,transparent)]",
48
+ children: [
49
+ /* @__PURE__ */ jsx("style", { href: "asta-spinner-2", precedence: "asta", children: KEYFRAMES }),
50
+ v === void 0 ? /* @__PURE__ */ jsx("span", { className: "absolute inset-y-0 rounded-full bg-brand", style: { animation: "kit-indet 1.3s cubic-bezier(.65,0,.35,1) infinite" } }) : /* @__PURE__ */ jsx("span", { className: "absolute inset-y-0 left-0 rounded-full bg-brand transition-[width] duration-700 ease-[cubic-bezier(.16,1,.3,1)]", style: { width: `${v}%` } })
51
+ ]
52
+ }
53
+ )
54
+ ] });
55
+ }
56
+ var spinner_default = Spinner;
57
+
58
+ export {
59
+ Spinner,
60
+ Progress,
61
+ spinner_default
62
+ };
@@ -0,0 +1,96 @@
1
+ "use client";
2
+
3
+ // components/kit/base/tabs.tsx
4
+ import { Tabs as T } from "@base-ui/react/tabs";
5
+ import { useLayoutEffect, useRef, useState } from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ var cx = (...c) => c.filter(Boolean).join(" ");
8
+ function Tabs({ tabs, value, defaultValue, onChange, variant = "underline", label, className }) {
9
+ const [inner, setInner] = useState(defaultValue ?? tabs[0]?.value);
10
+ const current = value ?? inner;
11
+ const index = Math.max(0, tabs.findIndex((t) => t.value === current));
12
+ const refs = useRef([]);
13
+ const list = useRef(null);
14
+ const prev = useRef(index);
15
+ const [bar, setBar] = useState(null);
16
+ useLayoutEffect(() => {
17
+ const measure = () => {
18
+ const el = refs.current[index];
19
+ const box = list.current;
20
+ if (!el || !box) return;
21
+ const dir = index >= prev.current ? 1 : -1;
22
+ prev.current = index;
23
+ setBar({ l: el.offsetLeft, r: box.scrollWidth - el.offsetLeft - el.offsetWidth, dir });
24
+ };
25
+ measure();
26
+ const ro = new ResizeObserver(measure);
27
+ if (list.current) ro.observe(list.current);
28
+ return () => ro.disconnect();
29
+ }, [index]);
30
+ const fast = "cubic-bezier(.16,1,.3,1) 0.32s";
31
+ const slow = "cubic-bezier(.16,1,.3,1) 0.62s";
32
+ const pill = variant === "pill";
33
+ return /* @__PURE__ */ jsxs(
34
+ T.Root,
35
+ {
36
+ value: current,
37
+ onValueChange: (v) => {
38
+ const next = String(v);
39
+ if (value === void 0) setInner(next);
40
+ onChange?.(next);
41
+ },
42
+ className,
43
+ children: [
44
+ /* @__PURE__ */ jsxs(
45
+ T.List,
46
+ {
47
+ ref: list,
48
+ "aria-label": label,
49
+ activateOnFocus: true,
50
+ className: cx("relative flex overflow-x-auto [scrollbar-width:none]", pill ? "gap-1 rounded-[10px] bg-paper-2 p-1" : "gap-5 sm:gap-6"),
51
+ children: [
52
+ !pill && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "absolute inset-x-0 bottom-0 h-px bg-[color-mix(in_srgb,var(--ink)_10%,transparent)]" }),
53
+ bar && /* @__PURE__ */ jsx(
54
+ "span",
55
+ {
56
+ "aria-hidden": true,
57
+ className: cx(
58
+ "absolute motion-reduce:!transition-none",
59
+ pill ? "top-1 bottom-1 rounded-[7px] bg-paper shadow-[0_1px_2px_rgb(0_0_0/0.08),inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_8%,transparent)]" : "bottom-0 h-0.5 rounded-full bg-ink"
60
+ ),
61
+ style: { left: bar.l, right: bar.r, transition: `left ${bar.dir === 1 ? slow : fast}, right ${bar.dir === 1 ? fast : slow}` }
62
+ }
63
+ ),
64
+ tabs.map((t, i) => /* @__PURE__ */ jsxs(
65
+ T.Tab,
66
+ {
67
+ value: t.value,
68
+ ref: (el) => {
69
+ refs.current[i] = el;
70
+ },
71
+ className: cx(
72
+ "group/tab relative z-10 inline-flex shrink-0 items-center gap-2 whitespace-nowrap text-[14px] font-medium tracking-[-0.01em] text-mute outline-none transition-colors duration-300 hover:text-ink focus-visible:ring-2 focus-visible:ring-brand/50 data-[active]:text-ink",
73
+ pill ? "h-8 rounded-[7px] px-3.5" : "h-11 rounded-md"
74
+ ),
75
+ children: [
76
+ t.label,
77
+ t.count !== void 0 && /* @__PURE__ */ jsx("span", { className: "rounded-[5px] bg-[color-mix(in_srgb,var(--ink)_7%,transparent)] px-1.5 text-[11px] leading-[18px] tabular-nums text-mute transition-colors duration-300 group-data-[active]/tab:bg-brand group-data-[active]/tab:text-white", children: t.count })
78
+ ]
79
+ },
80
+ t.value
81
+ ))
82
+ ]
83
+ }
84
+ ),
85
+ /* @__PURE__ */ jsx("style", { href: "asta-base-tabs", precedence: "asta", children: `@keyframes kit-tab-in { from { opacity: 0; transform: translateY(6px); filter: blur(2px) } to { opacity: 1; transform: none; filter: none } }` }),
86
+ tabs.map((t) => /* @__PURE__ */ jsx(T.Panel, { value: t.value, className: "pt-5 outline-none animate-[kit-tab-in_.45s_cubic-bezier(.16,1,.3,1)_both] motion-reduce:!animate-none", children: t.content }, t.value))
87
+ ]
88
+ }
89
+ );
90
+ }
91
+ var tabs_default = Tabs;
92
+
93
+ export {
94
+ Tabs,
95
+ tabs_default
96
+ };
@@ -0,0 +1,141 @@
1
+ "use client";
2
+ import {
3
+ Button
4
+ } from "./chunk-ZWBJUJTR.js";
5
+
6
+ // components/kit/footer.tsx
7
+ import { useRef, useState } from "react";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ var cx = (...c) => c.filter(Boolean).join(" ");
10
+ var EASE = "ease-[cubic-bezier(.16,1,.3,1)]";
11
+ function Newsletter({ onSubscribe }) {
12
+ const [email, setEmail] = useState("");
13
+ const [state, setState] = useState("idle");
14
+ const submit = async (e) => {
15
+ e.preventDefault();
16
+ if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) return setState("error");
17
+ setState("busy");
18
+ try {
19
+ await (onSubscribe?.(email) ?? new Promise((r) => setTimeout(r, 900)));
20
+ setState("done");
21
+ } catch {
22
+ setState("error");
23
+ }
24
+ };
25
+ return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
26
+ /* @__PURE__ */ jsxs(
27
+ "form",
28
+ {
29
+ onSubmit: submit,
30
+ noValidate: true,
31
+ "aria-hidden": state === "done" || void 0,
32
+ className: cx(
33
+ "flex h-11 items-center gap-1 rounded-[10px] bg-paper/10 p-1 pl-4 shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--paper)_14%,transparent)] transition-[opacity,transform,box-shadow] duration-500 focus-within:shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--paper)_45%,transparent)]",
34
+ EASE,
35
+ state === "done" && "pointer-events-none -translate-y-2 opacity-0",
36
+ state === "error" && "shadow-[inset_0_0_0_1px_#e5484d]"
37
+ ),
38
+ children: [
39
+ /* @__PURE__ */ jsx("label", { htmlFor: "kit-footer-email", className: "sr-only", children: "Email address" }),
40
+ /* @__PURE__ */ jsx(
41
+ "input",
42
+ {
43
+ id: "kit-footer-email",
44
+ type: "email",
45
+ value: email,
46
+ onChange: (e) => {
47
+ setEmail(e.target.value);
48
+ if (state === "error") setState("idle");
49
+ },
50
+ placeholder: "you@company.com",
51
+ "aria-invalid": state === "error" || void 0,
52
+ "aria-describedby": "kit-footer-msg",
53
+ tabIndex: state === "done" ? -1 : void 0,
54
+ className: "min-w-0 flex-1 bg-transparent text-[14px] text-paper outline-none placeholder:text-paper/40"
55
+ }
56
+ ),
57
+ /* @__PURE__ */ jsx(Button, { type: "submit", variant: "accent", size: "sm", shape: "pill", loading: state === "busy", className: "shadow-none", tabIndex: state === "done" ? -1 : void 0, children: "Subscribe" })
58
+ ]
59
+ }
60
+ ),
61
+ /* @__PURE__ */ jsxs(
62
+ "p",
63
+ {
64
+ className: cx(
65
+ "absolute inset-0 flex items-center gap-2 pl-1 text-[14px] text-paper transition-[opacity,transform] duration-500",
66
+ EASE,
67
+ state === "done" ? "opacity-100" : "pointer-events-none translate-y-2 opacity-0"
68
+ ),
69
+ "aria-hidden": state !== "done",
70
+ children: [
71
+ /* @__PURE__ */ jsx("span", { className: "flex h-6 w-6 items-center justify-center rounded-full bg-brand text-white", children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "h-3.5 w-3.5", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "m3.5 8.5 3 3 6-7", strokeDasharray: "16", style: { strokeDashoffset: state === "done" ? 0 : 16, transition: "stroke-dashoffset .5s .2s" } }) }) }),
72
+ "You're in. First letter lands next week."
73
+ ]
74
+ }
75
+ ),
76
+ /* @__PURE__ */ jsx("p", { id: "kit-footer-msg", role: "status", className: "mt-2 h-4 text-[12px] text-[#ff8a8d]", children: state === "error" ? "That doesn't look like an email address." : "" })
77
+ ] });
78
+ }
79
+ function Wordmark({ text }) {
80
+ const box = useRef(null);
81
+ const move = (x) => {
82
+ const el = box.current;
83
+ if (!el || window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
84
+ for (const s of el.querySelectorAll("span[data-l]")) {
85
+ if (x === null) {
86
+ s.style.transform = "";
87
+ s.style.opacity = "";
88
+ continue;
89
+ }
90
+ const r = s.getBoundingClientRect();
91
+ const k = Math.max(0, 1 - Math.abs(x - (r.left + r.width / 2)) / (r.width * 2.5));
92
+ s.style.transform = `translateY(${-k * 14}%)`;
93
+ s.style.opacity = String(0.22 + k * 0.78);
94
+ }
95
+ };
96
+ return /* @__PURE__ */ jsx(
97
+ "div",
98
+ {
99
+ ref: box,
100
+ "aria-hidden": true,
101
+ onPointerMove: (e) => move(e.clientX),
102
+ onPointerLeave: () => move(null),
103
+ className: "-mb-[0.18em] mt-6 flex select-none justify-center overflow-hidden pt-[0.1em] text-[clamp(3rem,19.5cqw,13rem)] font-semibold leading-[0.9] tracking-[-0.06em]",
104
+ children: text.split("").map((c, i) => /* @__PURE__ */ jsx("span", { "data-l": true, className: cx("inline-block opacity-[0.22] transition-[transform,opacity] duration-500", EASE), children: c }, i))
105
+ }
106
+ );
107
+ }
108
+ function Footer({ brand, wordmark, columns, tagline, onSubscribe, legal, className }) {
109
+ return /* @__PURE__ */ jsxs("footer", { className: cx("@container overflow-hidden rounded-2xl bg-ink px-6 pt-8 text-paper sm:px-8", className), children: [
110
+ /* @__PURE__ */ jsxs("div", { className: "grid gap-8 @min-[620px]:grid-cols-[1.3fr_2fr]", children: [
111
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-4", children: [
112
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 text-[15px] font-semibold tracking-[-0.02em]", children: brand }),
113
+ tagline && /* @__PURE__ */ jsx("p", { className: "max-w-[30ch] text-[13.5px] leading-relaxed text-paper/60", children: tagline }),
114
+ /* @__PURE__ */ jsx(Newsletter, { onSubscribe })
115
+ ] }),
116
+ /* @__PURE__ */ jsx("nav", { "aria-label": "Footer", className: "grid grid-cols-2 gap-6 @min-[420px]:grid-cols-3", children: columns.map((c) => /* @__PURE__ */ jsxs("div", { children: [
117
+ /* @__PURE__ */ jsx("p", { className: "text-[12px] text-paper/45", children: c.heading }),
118
+ /* @__PURE__ */ jsx("ul", { className: "mt-3 flex flex-col gap-2", children: c.links.map((l) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
119
+ "a",
120
+ {
121
+ href: l.href,
122
+ className: "group/fl inline-flex items-center gap-1 rounded text-[13.5px] text-paper/80 outline-none transition-colors hover:text-paper focus-visible:ring-2 focus-visible:ring-brand/60",
123
+ children: [
124
+ l.label,
125
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: cx("-translate-x-1 text-[11px] opacity-0 transition-[translate,opacity] duration-300 group-hover/fl:translate-x-0 group-hover/fl:opacity-60", EASE), children: "\u2197" })
126
+ ]
127
+ }
128
+ ) }, l.label)) })
129
+ ] }, c.heading)) })
130
+ ] }),
131
+ legal && /* @__PURE__ */ jsx("div", { className: "mt-8 flex flex-wrap justify-between gap-2 text-[12px] text-paper/45", children: legal }),
132
+ /* @__PURE__ */ jsx(Wordmark, { text: wordmark })
133
+ ] });
134
+ }
135
+ var footer_default = Footer;
136
+
137
+ export {
138
+ Newsletter,
139
+ Footer,
140
+ footer_default
141
+ };
@@ -0,0 +1,70 @@
1
+ "use client";
2
+
3
+ // components/kit/variants/textarea-aui-007.tsx
4
+ import { useEffect, useId, useRef, useState } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ var cx = (...c) => c.filter(Boolean).join(" ");
7
+ var reduced = () => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
8
+ function ValidatedTextarea({ label, rules, value: valueProp, defaultValue = "", onChange, success = "Looks good.", className, rows = 4, id, ...rest }) {
9
+ const auto = useId();
10
+ const fid = id ?? auto;
11
+ const box = useRef(null);
12
+ const [inner, setInner] = useState(defaultValue);
13
+ const value = valueProp ?? inner;
14
+ const [touched, setTouched] = useState(false);
15
+ const results = rules.map((r) => r.test(value));
16
+ const valid = results.every(Boolean);
17
+ const state = !touched ? "idle" : valid ? "success" : "error";
18
+ const prev = useRef(state);
19
+ useEffect(() => {
20
+ if (state === "error" && prev.current !== "error" && !reduced()) {
21
+ box.current?.animate([{ transform: "translateX(0)" }, { transform: "translateX(-5px)" }, { transform: "translateX(4px)" }, { transform: "translateX(-2px)" }, { transform: "translateX(0)" }], { duration: 360, easing: "cubic-bezier(.16,1,.3,1)" });
22
+ }
23
+ prev.current = state;
24
+ }, [state]);
25
+ const ring = state === "error" ? "shadow-[inset_0_0_0_1px_#e5484d] focus-within:shadow-[inset_0_0_0_1px_#e5484d,0_0_0_4px_rgb(229_72_77/0.14)]" : state === "success" ? "shadow-[inset_0_0_0_1px_#30a46c] focus-within:shadow-[inset_0_0_0_1px_#30a46c,0_0_0_4px_rgb(48_164_108/0.14)]" : "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-within:!shadow-[inset_0_0_0_1px_var(--brand),0_0_0_4px_color-mix(in_srgb,var(--brand)_16%,transparent)]";
26
+ return /* @__PURE__ */ jsxs("div", { className: cx("flex w-full flex-col gap-1.5", className), children: [
27
+ /* @__PURE__ */ jsx("label", { htmlFor: fid, className: "text-[13px] font-medium text-ink", children: label }),
28
+ /* @__PURE__ */ jsx("div", { ref: box, className: cx("rounded-xl bg-paper transition-shadow duration-300 motion-reduce:transition-none", ring), children: /* @__PURE__ */ jsx(
29
+ "textarea",
30
+ {
31
+ id: fid,
32
+ rows,
33
+ ...rest,
34
+ value,
35
+ "aria-invalid": state === "error" || void 0,
36
+ "aria-describedby": `${fid}-rules`,
37
+ onChange: (e) => {
38
+ const next = e.target.value;
39
+ if (valueProp === void 0) setInner(next);
40
+ onChange?.(next, rules.every((r) => r.test(next)));
41
+ },
42
+ onBlur: (e) => {
43
+ if (value) setTouched(true);
44
+ rest.onBlur?.(e);
45
+ },
46
+ className: "block w-full resize-none bg-transparent px-3.5 py-3 text-[14px] leading-[1.55] text-ink outline-none placeholder:text-mute"
47
+ }
48
+ ) }),
49
+ /* @__PURE__ */ jsx("div", { className: cx("grid transition-[grid-template-rows] duration-400 ease-[cubic-bezier(.16,1,.3,1)] motion-reduce:transition-none", state === "idle" ? "grid-rows-[0fr]" : "grid-rows-[1fr]"), children: /* @__PURE__ */ jsx("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsx("ul", { id: `${fid}-rules`, className: "flex flex-col gap-1 pt-1", "aria-live": "polite", children: state === "success" ? /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-2 text-[12.5px] text-[#30a46c]", children: [
50
+ /* @__PURE__ */ jsx(Check, { on: true }),
51
+ " ",
52
+ success
53
+ ] }) : rules.map((r, i) => /* @__PURE__ */ jsxs("li", { className: cx("flex items-center gap-2 text-[12.5px] transition-colors duration-300", results[i] ? "text-mute" : "text-[#e5484d]"), children: [
54
+ /* @__PURE__ */ jsx(Check, { on: results[i] }),
55
+ /* @__PURE__ */ jsx("span", { className: cx("transition-[text-decoration-color] duration-300", results[i] && "line-through decoration-mute/50"), children: r.label })
56
+ ] }, r.label)) }) }) })
57
+ ] });
58
+ }
59
+ function Check({ on }) {
60
+ return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", className: "h-3.5 w-3.5 shrink-0", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
61
+ /* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "6.2", className: cx("transition-opacity duration-300", on ? "opacity-0" : "opacity-100") }),
62
+ /* @__PURE__ */ jsx("path", { d: "m5 8.2 2 2 4-4.2", strokeDasharray: "10", strokeDashoffset: on ? 0 : 10, className: "transition-[stroke-dashoffset] duration-300 ease-[cubic-bezier(.16,1,.3,1)]" })
63
+ ] });
64
+ }
65
+ var textarea_aui_007_default = ValidatedTextarea;
66
+
67
+ export {
68
+ ValidatedTextarea,
69
+ textarea_aui_007_default
70
+ };
@@ -0,0 +1,55 @@
1
+ "use client";
2
+
3
+ // components/kit/field.tsx
4
+ import { Children, cloneElement, isValidElement, useEffect, useId, useRef } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ var cx = (...c) => c.filter(Boolean).join(" ");
7
+ function Field({ label, hint, error, required, aside, className, children }) {
8
+ const id = useId();
9
+ const wrap = useRef(null);
10
+ const last = useRef(null);
11
+ useEffect(() => {
12
+ if (error && error !== last.current && !window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
13
+ wrap.current?.animate(
14
+ [{ transform: "none" }, { transform: "translateX(-6px)" }, { transform: "translateX(5px)" }, { transform: "translateX(-3px)" }, { transform: "translateX(2px)" }, { transform: "none" }],
15
+ { duration: 420, easing: "cubic-bezier(.36,.07,.19,.97)" }
16
+ );
17
+ }
18
+ last.current = error ?? null;
19
+ }, [error]);
20
+ const child = Children.only(children);
21
+ const msgId = error ? `${id}-error` : hint ? `${id}-hint` : void 0;
22
+ const input = isValidElement(child) ? cloneElement(child, {
23
+ id: child.props.id ?? id,
24
+ "aria-describedby": msgId,
25
+ "aria-invalid": error ? true : void 0,
26
+ "aria-required": required || void 0
27
+ }) : child;
28
+ const inputId = child.props.id ?? id;
29
+ return /* @__PURE__ */ jsxs("div", { className: cx("flex flex-col gap-1.5", className), children: [
30
+ /* @__PURE__ */ jsxs("div", { className: "flex items-baseline justify-between gap-3", children: [
31
+ /* @__PURE__ */ jsxs("label", { htmlFor: inputId, className: "text-[13px] font-medium tracking-[-0.01em] text-ink", children: [
32
+ label,
33
+ required && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "ml-0.5 text-[#e5484d]", children: "*" })
34
+ ] }),
35
+ aside && /* @__PURE__ */ jsx("span", { className: "text-[12px] tabular-nums text-mute", children: aside })
36
+ ] }),
37
+ /* @__PURE__ */ jsx("div", { ref: wrap, children: input }),
38
+ /* @__PURE__ */ jsx("div", { className: "grid text-[12.5px] leading-snug", children: error ? /* @__PURE__ */ jsxs("p", { id: `${id}-error`, role: "alert", className: "flex items-start gap-1.5 text-[#e5484d] animate-[kit-field-in_.3s_cubic-bezier(.16,1,.3,1)_both]", children: [
39
+ /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", className: "mt-px h-3.5 w-3.5 shrink-0", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", "aria-hidden": true, children: [
40
+ /* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "6" }),
41
+ /* @__PURE__ */ jsx("path", { d: "M8 5v3.5M8 11h0" })
42
+ ] }),
43
+ error
44
+ ] }) : hint ? /* @__PURE__ */ jsx("p", { id: `${id}-hint`, className: "text-mute", children: hint }) : null }),
45
+ /* @__PURE__ */ jsx("style", { href: "asta-field", precedence: "asta", children: `@keyframes kit-field-in { from { opacity: 0; transform: translateY(-3px) } to { opacity: 1; transform: none } }` })
46
+ ] });
47
+ }
48
+ var fieldInputClass = "h-10 w-full rounded-lg bg-paper px-3 text-[14px] text-ink outline-none placeholder:text-mute shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_14%,transparent)] transition-shadow duration-200 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_3px_color-mix(in_srgb,var(--brand)_18%,transparent)] aria-[invalid=true]:shadow-[inset_0_0_0_1px_#e5484d,0_0_0_3px_rgb(229_72_77/0.14)]";
49
+ var field_default = Field;
50
+
51
+ export {
52
+ Field,
53
+ fieldInputClass,
54
+ field_default
55
+ };