asta-ui 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (413) hide show
  1. package/dist/ai-chat.d.ts +2 -0
  2. package/dist/ai-chat.js +9 -0
  3. package/dist/alert.d.ts +2 -0
  4. package/dist/alert.js +9 -0
  5. package/dist/announcement-bar.d.ts +2 -0
  6. package/dist/announcement-bar.js +9 -0
  7. package/dist/avatar-group.d.ts +2 -0
  8. package/dist/avatar-group.js +10 -0
  9. package/dist/avatar.js +3 -1
  10. package/dist/base/ai-chat.d.ts +2 -0
  11. package/dist/base/ai-chat.js +9 -0
  12. package/dist/base/alert.d.ts +2 -0
  13. package/dist/base/alert.js +9 -0
  14. package/dist/base/announcement-bar.d.ts +2 -0
  15. package/dist/base/announcement-bar.js +9 -0
  16. package/dist/base/avatar-group.d.ts +2 -0
  17. package/dist/base/avatar-group.js +10 -0
  18. package/dist/base/avatar.js +3 -1
  19. package/dist/base/booking-slots.d.ts +2 -0
  20. package/dist/base/booking-slots.js +7 -0
  21. package/dist/base/breadcrumb.d.ts +2 -0
  22. package/dist/base/breadcrumb.js +9 -0
  23. package/dist/base/carousel.d.ts +2 -0
  24. package/dist/base/carousel.js +9 -0
  25. package/dist/base/chat-thread.d.ts +2 -0
  26. package/dist/base/chat-thread.js +7 -0
  27. package/dist/base/checkout.d.ts +2 -0
  28. package/dist/base/checkout.js +12 -0
  29. package/dist/base/color-picker.d.ts +2 -0
  30. package/dist/base/color-picker.js +9 -0
  31. package/dist/base/combobox.d.ts +2 -0
  32. package/dist/base/combobox.js +9 -0
  33. package/dist/base/comments.d.ts +2 -0
  34. package/dist/base/comments.js +11 -0
  35. package/dist/base/context-menu.d.ts +2 -0
  36. package/dist/base/context-menu.js +9 -0
  37. package/dist/base/copy-button.d.ts +2 -0
  38. package/dist/base/copy-button.js +9 -0
  39. package/dist/base/data-table.d.ts +2 -0
  40. package/dist/base/data-table.js +9 -0
  41. package/dist/base/date-picker.d.ts +2 -0
  42. package/dist/base/date-picker.js +9 -0
  43. package/dist/base/drawer.d.ts +2 -0
  44. package/dist/base/drawer.js +9 -0
  45. package/dist/base/empty-state.d.ts +2 -0
  46. package/dist/base/empty-state.js +10 -0
  47. package/dist/base/event-calendar.d.ts +2 -0
  48. package/dist/base/event-calendar.js +9 -0
  49. package/dist/base/file-upload.d.ts +2 -0
  50. package/dist/base/file-upload.js +11 -0
  51. package/dist/base/hover-card.d.ts +2 -0
  52. package/dist/base/hover-card.js +9 -0
  53. package/dist/base/image-compare.d.ts +2 -0
  54. package/dist/base/image-compare.js +9 -0
  55. package/dist/base/inline-edit.d.ts +2 -0
  56. package/dist/base/inline-edit.js +9 -0
  57. package/dist/base/kanban.d.ts +2 -0
  58. package/dist/base/kanban.js +10 -0
  59. package/dist/base/notification-center.d.ts +2 -0
  60. package/dist/base/notification-center.js +11 -0
  61. package/dist/base/notification-stack.d.ts +2 -0
  62. package/dist/base/notification-stack.js +7 -0
  63. package/dist/base/now-playing.d.ts +2 -0
  64. package/dist/base/now-playing.js +7 -0
  65. package/dist/base/onboarding.d.ts +2 -0
  66. package/dist/base/onboarding.js +10 -0
  67. package/dist/base/otp-input.d.ts +2 -0
  68. package/dist/base/otp-input.js +9 -0
  69. package/dist/base/pagination.d.ts +2 -0
  70. package/dist/base/pagination.js +11 -0
  71. package/dist/base/password-input.d.ts +2 -0
  72. package/dist/base/password-input.js +13 -0
  73. package/dist/base/payment-received.d.ts +2 -0
  74. package/dist/base/payment-received.js +7 -0
  75. package/dist/base/plan-switcher.d.ts +2 -0
  76. package/dist/base/plan-switcher.js +7 -0
  77. package/dist/base/popover.d.ts +2 -0
  78. package/dist/base/popover.js +9 -0
  79. package/dist/base/progress.d.ts +2 -0
  80. package/dist/base/progress.js +11 -0
  81. package/dist/base/range-slider.d.ts +2 -0
  82. package/dist/base/range-slider.js +9 -0
  83. package/dist/base/rating.d.ts +2 -0
  84. package/dist/base/rating.js +9 -0
  85. package/dist/base/seat-picker.d.ts +2 -0
  86. package/dist/base/seat-picker.js +7 -0
  87. package/dist/base/shipment-tracker.d.ts +2 -0
  88. package/dist/base/shipment-tracker.js +7 -0
  89. package/dist/base/sidebar.d.ts +2 -0
  90. package/dist/base/sidebar.js +10 -0
  91. package/dist/base/stat-card.d.ts +2 -0
  92. package/dist/base/stat-card.js +9 -0
  93. package/dist/base/stepper.d.ts +2 -0
  94. package/dist/base/stepper.js +9 -0
  95. package/dist/base/team-members.d.ts +2 -0
  96. package/dist/base/team-members.js +12 -0
  97. package/dist/base/timeline.d.ts +2 -0
  98. package/dist/base/timeline.js +9 -0
  99. package/dist/base/toggle-group.d.ts +2 -0
  100. package/dist/base/toggle-group.js +9 -0
  101. package/dist/base/token-swap.d.ts +2 -0
  102. package/dist/base/token-swap.js +7 -0
  103. package/dist/base/tree-view.d.ts +2 -0
  104. package/dist/base/tree-view.js +9 -0
  105. package/dist/base/wishlist.d.ts +2 -0
  106. package/dist/base/wishlist.js +7 -0
  107. package/dist/base.js +250 -46
  108. package/dist/booking-slots.d.ts +2 -0
  109. package/dist/booking-slots.js +7 -0
  110. package/dist/breadcrumb.d.ts +2 -0
  111. package/dist/breadcrumb.js +9 -0
  112. package/dist/carousel.d.ts +2 -0
  113. package/dist/carousel.js +9 -0
  114. package/dist/chat-thread.d.ts +2 -0
  115. package/dist/chat-thread.js +7 -0
  116. package/dist/checkout.d.ts +2 -0
  117. package/dist/checkout.js +12 -0
  118. package/dist/{chunk-VGBP42IZ.js → chunk-2LZM435Z.js} +3 -2
  119. package/dist/chunk-33N6SZB5.js +186 -0
  120. package/dist/chunk-3KS5EN3Q.js +134 -0
  121. package/dist/chunk-3RMCFFW2.js +228 -0
  122. package/dist/chunk-45VUWOHQ.js +299 -0
  123. package/dist/chunk-4FR6KJOJ.js +91 -0
  124. package/dist/chunk-4GF7WTR3.js +230 -0
  125. package/dist/chunk-4XM6DKEO.js +164 -0
  126. package/dist/chunk-57PESBSZ.js +97 -0
  127. package/dist/chunk-6HPSPZTF.js +232 -0
  128. package/dist/chunk-6VQTFRSP.js +435 -0
  129. package/dist/chunk-72UKXOMW.js +150 -0
  130. package/dist/chunk-7JNO265Q.js +431 -0
  131. package/dist/chunk-AYSC7AIC.js +322 -0
  132. package/dist/chunk-B5F775GP.js +339 -0
  133. package/dist/chunk-B5OESWCR.js +339 -0
  134. package/dist/chunk-BP3LXM3X.js +309 -0
  135. package/dist/chunk-CA7YQ5BJ.js +271 -0
  136. package/dist/chunk-DRX3KRNL.js +191 -0
  137. package/dist/chunk-EAUUUVUR.js +123 -0
  138. package/dist/chunk-EXX6YSUX.js +340 -0
  139. package/dist/chunk-F7LAUVDJ.js +97 -0
  140. package/dist/chunk-FDHU3RWR.js +213 -0
  141. package/dist/chunk-FJGGXXTT.js +109 -0
  142. package/dist/chunk-FKHNK5VC.js +172 -0
  143. package/dist/chunk-FY6BRODJ.js +230 -0
  144. package/dist/chunk-GDTSCUHY.js +234 -0
  145. package/dist/chunk-H7D6G3GQ.js +290 -0
  146. package/dist/chunk-HB7DFNZP.js +109 -0
  147. package/dist/{chunk-H5C7HOQJ.js → chunk-HNO6EUGJ.js} +3 -2
  148. package/dist/chunk-HPVPHWDM.js +197 -0
  149. package/dist/chunk-I5NZSWDW.js +431 -0
  150. package/dist/chunk-IMBCYI3F.js +114 -0
  151. package/dist/chunk-IS2VTYDA.js +235 -0
  152. package/dist/chunk-ISZ7O2Q6.js +245 -0
  153. package/dist/chunk-JAQKJBVJ.js +170 -0
  154. package/dist/chunk-KYFZ5TTK.js +271 -0
  155. package/dist/chunk-LBXIMJFU.js +170 -0
  156. package/dist/chunk-MSBN2O66.js +110 -0
  157. package/dist/chunk-NB7X26PY.js +388 -0
  158. package/dist/chunk-NIYIT2QU.js +118 -0
  159. package/dist/chunk-QJXPS55V.js +246 -0
  160. package/dist/chunk-RBTX7TVA.js +170 -0
  161. package/dist/chunk-RFVKRVTD.js +172 -0
  162. package/dist/chunk-RIWKIBEP.js +271 -0
  163. package/dist/chunk-RSUZHZCG.js +230 -0
  164. package/dist/chunk-S2DJLW6B.js +322 -0
  165. package/dist/chunk-SDL3JXFN.js +97 -0
  166. package/dist/chunk-SDOWCCM2.js +271 -0
  167. package/dist/chunk-SPKSRH6G.js +283 -0
  168. package/dist/chunk-TLODJONC.js +120 -0
  169. package/dist/chunk-TXRLBMFL.js +191 -0
  170. package/dist/chunk-UWQ26LYZ.js +133 -0
  171. package/dist/chunk-V3SPSN3A.js +308 -0
  172. package/dist/chunk-W57O4RLL.js +435 -0
  173. package/dist/chunk-WO36QUH3.js +188 -0
  174. package/dist/chunk-YLAL6ICI.js +142 -0
  175. package/dist/chunk-ZGMBQZDV.js +250 -0
  176. package/dist/chunk-ZKMEKSJZ.js +133 -0
  177. package/dist/color-picker.d.ts +2 -0
  178. package/dist/color-picker.js +9 -0
  179. package/dist/combobox.d.ts +2 -0
  180. package/dist/combobox.js +9 -0
  181. package/dist/comments.d.ts +2 -0
  182. package/dist/comments.js +11 -0
  183. package/dist/context-menu.d.ts +2 -0
  184. package/dist/context-menu.js +9 -0
  185. package/dist/copy-button.d.ts +2 -0
  186. package/dist/copy-button.js +9 -0
  187. package/dist/data-table.d.ts +2 -0
  188. package/dist/data-table.js +9 -0
  189. package/dist/date-picker.d.ts +2 -0
  190. package/dist/date-picker.js +9 -0
  191. package/dist/drawer.d.ts +2 -0
  192. package/dist/drawer.js +9 -0
  193. package/dist/empty-state.d.ts +2 -0
  194. package/dist/empty-state.js +10 -0
  195. package/dist/event-calendar.d.ts +2 -0
  196. package/dist/event-calendar.js +9 -0
  197. package/dist/file-upload.d.ts +2 -0
  198. package/dist/file-upload.js +11 -0
  199. package/dist/hover-card.d.ts +2 -0
  200. package/dist/hover-card.js +9 -0
  201. package/dist/image-compare.d.ts +2 -0
  202. package/dist/image-compare.js +9 -0
  203. package/dist/index.js +250 -46
  204. package/dist/inline-edit.d.ts +2 -0
  205. package/dist/inline-edit.js +9 -0
  206. package/dist/kanban.d.ts +2 -0
  207. package/dist/kanban.js +10 -0
  208. package/dist/notification-center.d.ts +2 -0
  209. package/dist/notification-center.js +11 -0
  210. package/dist/notification-stack.d.ts +2 -0
  211. package/dist/notification-stack.js +7 -0
  212. package/dist/now-playing.d.ts +2 -0
  213. package/dist/now-playing.js +7 -0
  214. package/dist/onboarding.d.ts +2 -0
  215. package/dist/onboarding.js +10 -0
  216. package/dist/otp-input.d.ts +2 -0
  217. package/dist/otp-input.js +9 -0
  218. package/dist/pagination.d.ts +2 -0
  219. package/dist/pagination.js +11 -0
  220. package/dist/password-input.d.ts +2 -0
  221. package/dist/password-input.js +13 -0
  222. package/dist/payment-received.d.ts +2 -0
  223. package/dist/payment-received.js +7 -0
  224. package/dist/plan-switcher.d.ts +2 -0
  225. package/dist/plan-switcher.js +7 -0
  226. package/dist/popover.d.ts +2 -0
  227. package/dist/popover.js +9 -0
  228. package/dist/progress.d.ts +2 -0
  229. package/dist/progress.js +11 -0
  230. package/dist/range-slider.d.ts +2 -0
  231. package/dist/range-slider.js +9 -0
  232. package/dist/rating.d.ts +2 -0
  233. package/dist/rating.js +9 -0
  234. package/dist/seat-picker.d.ts +2 -0
  235. package/dist/seat-picker.js +7 -0
  236. package/dist/shipment-tracker.d.ts +2 -0
  237. package/dist/shipment-tracker.js +7 -0
  238. package/dist/sidebar.d.ts +2 -0
  239. package/dist/sidebar.js +10 -0
  240. package/dist/stat-card.d.ts +2 -0
  241. package/dist/stat-card.js +9 -0
  242. package/dist/stepper.d.ts +2 -0
  243. package/dist/stepper.js +9 -0
  244. package/dist/team-members.d.ts +2 -0
  245. package/dist/team-members.js +12 -0
  246. package/dist/timeline.d.ts +2 -0
  247. package/dist/timeline.js +9 -0
  248. package/dist/toggle-group.d.ts +2 -0
  249. package/dist/toggle-group.js +9 -0
  250. package/dist/token-swap.d.ts +2 -0
  251. package/dist/token-swap.js +7 -0
  252. package/dist/tree-view.d.ts +2 -0
  253. package/dist/tree-view.js +9 -0
  254. package/dist/types/components/kit/ai-chat.d.ts +37 -0
  255. package/dist/types/components/kit/alert.d.ts +27 -0
  256. package/dist/types/components/kit/announcement-bar.d.ts +36 -0
  257. package/dist/types/components/kit/avatar-group.d.ts +22 -0
  258. package/dist/types/components/kit/avatar.d.ts +2 -0
  259. package/dist/types/components/kit/base/avatar-group.d.ts +22 -0
  260. package/dist/types/components/kit/base/avatar.d.ts +2 -0
  261. package/dist/types/components/kit/base/checkout.d.ts +68 -0
  262. package/dist/types/components/kit/base/comments.d.ts +30 -0
  263. package/dist/types/components/kit/base/empty-state.d.ts +29 -0
  264. package/dist/types/components/kit/base/kanban.d.ts +26 -0
  265. package/dist/types/components/kit/base/notification-center.d.ts +34 -0
  266. package/dist/types/components/kit/base/onboarding.d.ts +28 -0
  267. package/dist/types/components/kit/base/sidebar.d.ts +43 -0
  268. package/dist/types/components/kit/base/team-members.d.ts +46 -0
  269. package/dist/types/components/kit/breadcrumb.d.ts +29 -0
  270. package/dist/types/components/kit/carousel.d.ts +21 -0
  271. package/dist/types/components/kit/checkout.d.ts +68 -0
  272. package/dist/types/components/kit/color-picker.d.ts +28 -0
  273. package/dist/types/components/kit/combobox.d.ts +40 -0
  274. package/dist/types/components/kit/comments.d.ts +30 -0
  275. package/dist/types/components/kit/context-menu.d.ts +37 -0
  276. package/dist/types/components/kit/copy-button.d.ts +20 -0
  277. package/dist/types/components/kit/data-table.d.ts +47 -0
  278. package/dist/types/components/kit/date-picker.d.ts +40 -0
  279. package/dist/types/components/kit/drawer.d.ts +26 -0
  280. package/dist/types/components/kit/empty-state.d.ts +29 -0
  281. package/dist/types/components/kit/event-calendar.d.ts +34 -0
  282. package/dist/types/components/kit/file-upload.d.ts +37 -0
  283. package/dist/types/components/kit/hover-card.d.ts +31 -0
  284. package/dist/types/components/kit/image-compare.d.ts +29 -0
  285. package/dist/types/components/kit/inline-edit.d.ts +26 -0
  286. package/dist/types/components/kit/kanban.d.ts +26 -0
  287. package/dist/types/components/kit/notification-center.d.ts +34 -0
  288. package/dist/types/components/kit/onboarding.d.ts +28 -0
  289. package/dist/types/components/kit/otp-input.d.ts +28 -0
  290. package/dist/types/components/kit/pagination.d.ts +25 -0
  291. package/dist/types/components/kit/password-input.d.ts +32 -0
  292. package/dist/types/components/kit/popover.d.ts +40 -0
  293. package/dist/types/components/kit/progress.d.ts +37 -0
  294. package/dist/types/components/kit/range-slider.d.ts +27 -0
  295. package/dist/types/components/kit/rating.d.ts +23 -0
  296. package/dist/types/components/kit/sidebar.d.ts +43 -0
  297. package/dist/types/components/kit/stat-card.d.ts +24 -0
  298. package/dist/types/components/kit/stepper.d.ts +36 -0
  299. package/dist/types/components/kit/team-members.d.ts +46 -0
  300. package/dist/types/components/kit/timeline.d.ts +24 -0
  301. package/dist/types/components/kit/toggle-group.d.ts +42 -0
  302. package/dist/types/components/kit/tree-view.d.ts +31 -0
  303. package/dist/types/components/lab/blocks/BookingSlots.d.ts +2 -0
  304. package/dist/types/components/lab/blocks/ChatThread.d.ts +2 -0
  305. package/dist/types/components/lab/blocks/NotificationStack.d.ts +2 -0
  306. package/dist/types/components/lab/blocks/NowPlaying.d.ts +2 -0
  307. package/dist/types/components/lab/blocks/PaymentReceived.d.ts +2 -0
  308. package/dist/types/components/lab/blocks/PlanSwitcher.d.ts +2 -0
  309. package/dist/types/components/lab/blocks/SeatPicker.d.ts +2 -0
  310. package/dist/types/components/lab/blocks/ShipmentTracker.d.ts +2 -0
  311. package/dist/types/components/lab/blocks/TokenSwap.d.ts +2 -0
  312. package/dist/types/components/lab/blocks/Wishlist.d.ts +2 -0
  313. package/dist/types/packages/asta-ui/src/ai-chat.d.ts +2 -0
  314. package/dist/types/packages/asta-ui/src/alert.d.ts +2 -0
  315. package/dist/types/packages/asta-ui/src/announcement-bar.d.ts +2 -0
  316. package/dist/types/packages/asta-ui/src/avatar-group.d.ts +2 -0
  317. package/dist/types/packages/asta-ui/src/base/ai-chat.d.ts +2 -0
  318. package/dist/types/packages/asta-ui/src/base/alert.d.ts +2 -0
  319. package/dist/types/packages/asta-ui/src/base/announcement-bar.d.ts +2 -0
  320. package/dist/types/packages/asta-ui/src/base/avatar-group.d.ts +2 -0
  321. package/dist/types/packages/asta-ui/src/base/booking-slots.d.ts +2 -0
  322. package/dist/types/packages/asta-ui/src/base/breadcrumb.d.ts +2 -0
  323. package/dist/types/packages/asta-ui/src/base/carousel.d.ts +2 -0
  324. package/dist/types/packages/asta-ui/src/base/chat-thread.d.ts +2 -0
  325. package/dist/types/packages/asta-ui/src/base/checkout.d.ts +2 -0
  326. package/dist/types/packages/asta-ui/src/base/color-picker.d.ts +2 -0
  327. package/dist/types/packages/asta-ui/src/base/combobox.d.ts +2 -0
  328. package/dist/types/packages/asta-ui/src/base/comments.d.ts +2 -0
  329. package/dist/types/packages/asta-ui/src/base/context-menu.d.ts +2 -0
  330. package/dist/types/packages/asta-ui/src/base/copy-button.d.ts +2 -0
  331. package/dist/types/packages/asta-ui/src/base/data-table.d.ts +2 -0
  332. package/dist/types/packages/asta-ui/src/base/date-picker.d.ts +2 -0
  333. package/dist/types/packages/asta-ui/src/base/drawer.d.ts +2 -0
  334. package/dist/types/packages/asta-ui/src/base/empty-state.d.ts +2 -0
  335. package/dist/types/packages/asta-ui/src/base/event-calendar.d.ts +2 -0
  336. package/dist/types/packages/asta-ui/src/base/file-upload.d.ts +2 -0
  337. package/dist/types/packages/asta-ui/src/base/hover-card.d.ts +2 -0
  338. package/dist/types/packages/asta-ui/src/base/image-compare.d.ts +2 -0
  339. package/dist/types/packages/asta-ui/src/base/inline-edit.d.ts +2 -0
  340. package/dist/types/packages/asta-ui/src/base/kanban.d.ts +2 -0
  341. package/dist/types/packages/asta-ui/src/base/notification-center.d.ts +2 -0
  342. package/dist/types/packages/asta-ui/src/base/notification-stack.d.ts +2 -0
  343. package/dist/types/packages/asta-ui/src/base/now-playing.d.ts +2 -0
  344. package/dist/types/packages/asta-ui/src/base/onboarding.d.ts +2 -0
  345. package/dist/types/packages/asta-ui/src/base/otp-input.d.ts +2 -0
  346. package/dist/types/packages/asta-ui/src/base/pagination.d.ts +2 -0
  347. package/dist/types/packages/asta-ui/src/base/password-input.d.ts +2 -0
  348. package/dist/types/packages/asta-ui/src/base/payment-received.d.ts +2 -0
  349. package/dist/types/packages/asta-ui/src/base/plan-switcher.d.ts +2 -0
  350. package/dist/types/packages/asta-ui/src/base/popover.d.ts +2 -0
  351. package/dist/types/packages/asta-ui/src/base/progress.d.ts +2 -0
  352. package/dist/types/packages/asta-ui/src/base/range-slider.d.ts +2 -0
  353. package/dist/types/packages/asta-ui/src/base/rating.d.ts +2 -0
  354. package/dist/types/packages/asta-ui/src/base/seat-picker.d.ts +2 -0
  355. package/dist/types/packages/asta-ui/src/base/shipment-tracker.d.ts +2 -0
  356. package/dist/types/packages/asta-ui/src/base/sidebar.d.ts +2 -0
  357. package/dist/types/packages/asta-ui/src/base/stat-card.d.ts +2 -0
  358. package/dist/types/packages/asta-ui/src/base/stepper.d.ts +2 -0
  359. package/dist/types/packages/asta-ui/src/base/team-members.d.ts +2 -0
  360. package/dist/types/packages/asta-ui/src/base/timeline.d.ts +2 -0
  361. package/dist/types/packages/asta-ui/src/base/toggle-group.d.ts +2 -0
  362. package/dist/types/packages/asta-ui/src/base/token-swap.d.ts +2 -0
  363. package/dist/types/packages/asta-ui/src/base/tree-view.d.ts +2 -0
  364. package/dist/types/packages/asta-ui/src/base/wishlist.d.ts +2 -0
  365. package/dist/types/packages/asta-ui/src/base.d.ts +87 -1
  366. package/dist/types/packages/asta-ui/src/booking-slots.d.ts +2 -0
  367. package/dist/types/packages/asta-ui/src/breadcrumb.d.ts +2 -0
  368. package/dist/types/packages/asta-ui/src/carousel.d.ts +2 -0
  369. package/dist/types/packages/asta-ui/src/chat-thread.d.ts +2 -0
  370. package/dist/types/packages/asta-ui/src/checkout.d.ts +2 -0
  371. package/dist/types/packages/asta-ui/src/color-picker.d.ts +2 -0
  372. package/dist/types/packages/asta-ui/src/combobox.d.ts +2 -0
  373. package/dist/types/packages/asta-ui/src/comments.d.ts +2 -0
  374. package/dist/types/packages/asta-ui/src/context-menu.d.ts +2 -0
  375. package/dist/types/packages/asta-ui/src/copy-button.d.ts +2 -0
  376. package/dist/types/packages/asta-ui/src/data-table.d.ts +2 -0
  377. package/dist/types/packages/asta-ui/src/date-picker.d.ts +2 -0
  378. package/dist/types/packages/asta-ui/src/drawer.d.ts +2 -0
  379. package/dist/types/packages/asta-ui/src/empty-state.d.ts +2 -0
  380. package/dist/types/packages/asta-ui/src/event-calendar.d.ts +2 -0
  381. package/dist/types/packages/asta-ui/src/file-upload.d.ts +2 -0
  382. package/dist/types/packages/asta-ui/src/hover-card.d.ts +2 -0
  383. package/dist/types/packages/asta-ui/src/image-compare.d.ts +2 -0
  384. package/dist/types/packages/asta-ui/src/index.d.ts +87 -1
  385. package/dist/types/packages/asta-ui/src/inline-edit.d.ts +2 -0
  386. package/dist/types/packages/asta-ui/src/kanban.d.ts +2 -0
  387. package/dist/types/packages/asta-ui/src/notification-center.d.ts +2 -0
  388. package/dist/types/packages/asta-ui/src/notification-stack.d.ts +2 -0
  389. package/dist/types/packages/asta-ui/src/now-playing.d.ts +2 -0
  390. package/dist/types/packages/asta-ui/src/onboarding.d.ts +2 -0
  391. package/dist/types/packages/asta-ui/src/otp-input.d.ts +2 -0
  392. package/dist/types/packages/asta-ui/src/pagination.d.ts +2 -0
  393. package/dist/types/packages/asta-ui/src/password-input.d.ts +2 -0
  394. package/dist/types/packages/asta-ui/src/payment-received.d.ts +2 -0
  395. package/dist/types/packages/asta-ui/src/plan-switcher.d.ts +2 -0
  396. package/dist/types/packages/asta-ui/src/popover.d.ts +2 -0
  397. package/dist/types/packages/asta-ui/src/progress.d.ts +2 -0
  398. package/dist/types/packages/asta-ui/src/range-slider.d.ts +2 -0
  399. package/dist/types/packages/asta-ui/src/rating.d.ts +2 -0
  400. package/dist/types/packages/asta-ui/src/seat-picker.d.ts +2 -0
  401. package/dist/types/packages/asta-ui/src/shipment-tracker.d.ts +2 -0
  402. package/dist/types/packages/asta-ui/src/sidebar.d.ts +2 -0
  403. package/dist/types/packages/asta-ui/src/stat-card.d.ts +2 -0
  404. package/dist/types/packages/asta-ui/src/stepper.d.ts +2 -0
  405. package/dist/types/packages/asta-ui/src/team-members.d.ts +2 -0
  406. package/dist/types/packages/asta-ui/src/timeline.d.ts +2 -0
  407. package/dist/types/packages/asta-ui/src/toggle-group.d.ts +2 -0
  408. package/dist/types/packages/asta-ui/src/token-swap.d.ts +2 -0
  409. package/dist/types/packages/asta-ui/src/tree-view.d.ts +2 -0
  410. package/dist/types/packages/asta-ui/src/wishlist.d.ts +2 -0
  411. package/dist/wishlist.d.ts +2 -0
  412. package/dist/wishlist.js +7 -0
  413. package/package.json +1 -1
@@ -0,0 +1,339 @@
1
+ "use client";
2
+ import {
3
+ Avatar
4
+ } from "./chunk-2LZM435Z.js";
5
+
6
+ // components/kit/base/kanban.tsx
7
+ import { useEffect, useId, useLayoutEffect, useRef, useState } from "react";
8
+ import { Fragment, 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
+ var CURVE = "cubic-bezier(.16,1,.3,1)";
12
+ var GAP = 8;
13
+ var reduced = () => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
14
+ function place(cards, card, col, index) {
15
+ const rest = cards.filter((c) => c.id !== card.id);
16
+ const inCol = rest.filter((c) => c.column === col);
17
+ const before = inCol[index];
18
+ const at = before ? rest.indexOf(before) : inCol.length ? rest.indexOf(inCol[inCol.length - 1]) + 1 : rest.length;
19
+ rest.splice(at, 0, { ...card, column: col });
20
+ return rest;
21
+ }
22
+ function shiftOf(d, g, id) {
23
+ const D = d.h + GAP;
24
+ const i = g.ids.indexOf(id);
25
+ const src = g.id === d.from ? g.ids.indexOf(d.id) : -1;
26
+ const after = src >= 0 && i > src;
27
+ const compact = after ? i - 1 : i;
28
+ return (after ? -D : 0) + (g.id === d.target.col && compact >= d.target.index ? D : 0);
29
+ }
30
+ function gapTop(d, g) {
31
+ const D = d.h + GAP;
32
+ const src = g.id === d.from ? g.ids.indexOf(d.id) : -1;
33
+ const adj = (id) => src >= 0 && g.ids.indexOf(id) > src ? -D : 0;
34
+ const compact = g.ids.filter((id) => id !== d.id);
35
+ if (d.target.index < compact.length) {
36
+ const id = compact[d.target.index];
37
+ return g.box[id].top + adj(id);
38
+ }
39
+ const last = compact[compact.length - 1];
40
+ return last ? g.box[last].top + adj(last) + g.box[last].h + GAP : 0;
41
+ }
42
+ function CardBody({ card }) {
43
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
44
+ /* @__PURE__ */ jsx("p", { className: "text-[13.5px] leading-snug text-ink", children: card.title }),
45
+ (card.tag || card.assignee || card.due) && /* @__PURE__ */ jsxs("div", { className: "mt-3 flex items-center gap-2 text-[11.5px] text-mute", children: [
46
+ card.tag && /* @__PURE__ */ jsx("span", { className: "rounded-md bg-paper-2 px-1.5 leading-5", children: card.tag }),
47
+ card.due && /* @__PURE__ */ jsx("span", { className: "tabular-nums", children: card.due }),
48
+ card.assignee && /* @__PURE__ */ jsx(Avatar, { name: card.assignee, size: "xs", className: "ml-auto" })
49
+ ] })
50
+ ] });
51
+ }
52
+ var cardCls = "rounded-[10px] bg-paper p-3 shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_9%,transparent),0_1px_2px_rgb(0_0_0/0.04)]";
53
+ function Kanban({ columns, defaultCards, onChange, className }) {
54
+ const [cards, setCards] = useState(defaultCards);
55
+ const [drag, setDrag] = useState(null);
56
+ const [picked, setPicked] = useState(null);
57
+ const [msg, setMsg] = useState("");
58
+ const hintId = useId();
59
+ const root = useRef(null);
60
+ const lists = useRef(/* @__PURE__ */ new Map());
61
+ const els = useRef(/* @__PURE__ */ new Map());
62
+ const press = useRef(null);
63
+ const flip = useRef(null);
64
+ const refocus = useRef(null);
65
+ const pickedRef = useRef(picked);
66
+ useEffect(() => {
67
+ pickedRef.current = picked;
68
+ }, [picked]);
69
+ const inCol = (list, col) => list.filter((c) => c.column === col);
70
+ const titleOf = (col) => columns.find((c) => c.id === col)?.title ?? col;
71
+ const where = (list, id) => {
72
+ const card = list.find((c) => c.id === id);
73
+ const col = inCol(list, card.column);
74
+ return `${titleOf(card.column)}, position ${col.indexOf(card) + 1} of ${col.length}`;
75
+ };
76
+ useLayoutEffect(() => {
77
+ const from = flip.current;
78
+ flip.current = null;
79
+ if (from && !reduced()) {
80
+ from.forEach((r, id2) => {
81
+ const el = els.current.get(id2);
82
+ if (!el) return;
83
+ const n = el.getBoundingClientRect();
84
+ const dx = r.left - n.left;
85
+ const dy = r.top - n.top;
86
+ if (dx || dy) el.animate([{ transform: `translate(${dx}px, ${dy}px)` }, { transform: "none" }], { duration: 340, easing: CURVE });
87
+ });
88
+ }
89
+ const id = picked?.id ?? refocus.current;
90
+ refocus.current = null;
91
+ if (id && document.activeElement !== els.current.get(id)) els.current.get(id)?.focus();
92
+ }, [cards, picked]);
93
+ const start = (e, card) => {
94
+ const board = root.current.getBoundingClientRect();
95
+ const geo = columns.map((c) => {
96
+ const r2 = lists.current.get(c.id).getBoundingClientRect();
97
+ const ids = inCol(cards, c.id).map((k) => k.id);
98
+ const box = Object.fromEntries(ids.map((id) => [id, { top: els.current.get(id).offsetTop, h: els.current.get(id).offsetHeight }]));
99
+ return { id: c.id, left: r2.left - board.left, right: r2.right - board.left, top: r2.top - board.top, ids, box };
100
+ });
101
+ const r = els.current.get(card.id).getBoundingClientRect();
102
+ const index = geo.find((g) => g.id === card.column).ids.indexOf(card.id);
103
+ setDrag({
104
+ id: card.id,
105
+ from: card.column,
106
+ x: r.left - board.left,
107
+ y: r.top - board.top,
108
+ w: r.width,
109
+ h: r.height,
110
+ ox: e.clientX - r.left,
111
+ oy: e.clientY - r.top,
112
+ target: { col: card.column, index },
113
+ geo
114
+ });
115
+ };
116
+ const move = (e, d) => {
117
+ const board = root.current.getBoundingClientRect();
118
+ const x = e.clientX - board.left - d.ox;
119
+ const y = e.clientY - board.top - d.oy;
120
+ const px = e.clientX - board.left;
121
+ const g = d.geo.find((c) => px >= c.left && px <= c.right) ?? d.geo.reduce((a, b) => Math.abs((a.left + a.right) / 2 - px) < Math.abs((b.left + b.right) / 2 - px) ? a : b);
122
+ const cy = y + d.h / 2 - g.top;
123
+ const closing = { ...d, target: { col: "", index: 0 } };
124
+ const compact = g.ids.filter((id) => id !== d.id);
125
+ let index = compact.length;
126
+ for (let i = 0; i < compact.length; i++) {
127
+ const b = g.box[compact[i]];
128
+ const top = b.top + shiftOf(closing, g, compact[i]);
129
+ if (cy < top + b.h / 2) {
130
+ index = i;
131
+ break;
132
+ }
133
+ }
134
+ setDrag({ ...d, x, y, target: { col: g.id, index } });
135
+ };
136
+ const commit = (d) => {
137
+ const card = cards.find((c) => c.id === d.id);
138
+ const next = place(cards, card, d.target.col, d.target.index);
139
+ setCards(next);
140
+ setDrag(null);
141
+ setMsg(`Dropped ${card.title} in ${where(next, card.id)}.`);
142
+ onChange?.(next);
143
+ };
144
+ const drop = (d) => {
145
+ if (reduced()) return commit(d);
146
+ const g = d.geo.find((c) => c.id === d.target.col);
147
+ setDrag({ ...d, x: g.left, y: g.top + gapTop(d, g), dropping: true });
148
+ setTimeout(() => commit(d), 260);
149
+ };
150
+ const cancelPick = (focus) => {
151
+ const p = pickedRef.current;
152
+ if (!p) return;
153
+ pickedRef.current = null;
154
+ const card = p.origin.find((c) => c.id === p.id);
155
+ flip.current = new Map([...els.current].map(([id, el]) => [id, el.getBoundingClientRect()]));
156
+ if (focus) refocus.current = p.id;
157
+ setCards(p.origin);
158
+ setPicked(null);
159
+ setMsg(`Cancelled. ${card.title} is back in ${where(p.origin, p.id)}.`);
160
+ };
161
+ const pointer = {
162
+ down: (e, card) => {
163
+ if (picked) return cancelPick(false);
164
+ if (e.button !== 0 || drag) return;
165
+ press.current = { id: card.id, sx: e.clientX, sy: e.clientY };
166
+ e.currentTarget.setPointerCapture(e.pointerId);
167
+ },
168
+ move: (e, card) => {
169
+ const p = press.current;
170
+ if (!p || p.id !== card.id) return;
171
+ if (drag) {
172
+ if (!drag.dropping) move(e, drag);
173
+ } else if (Math.hypot(e.clientX - p.sx, e.clientY - p.sy) > 4) start(e, card);
174
+ },
175
+ up: () => {
176
+ press.current = null;
177
+ if (drag && !drag.dropping) drop(drag);
178
+ },
179
+ cancel: () => {
180
+ press.current = null;
181
+ if (drag && !drag.dropping) setDrag(null);
182
+ }
183
+ };
184
+ const keyMove = (card, dx, dy) => {
185
+ const ci = columns.findIndex((c) => c.id === card.column);
186
+ const nci = Math.min(columns.length - 1, Math.max(0, ci + dx));
187
+ const col = columns[nci].id;
188
+ const here = inCol(cards, card.column).indexOf(card);
189
+ const others = inCol(cards, col).filter((c) => c.id !== card.id);
190
+ const index = dx ? Math.min(here, others.length) : Math.min(others.length, Math.max(0, here + dy));
191
+ if (col === card.column && index === here) return;
192
+ flip.current = new Map([...els.current].map(([id, el]) => [id, el.getBoundingClientRect()]));
193
+ const next = place(cards, card, col, index);
194
+ setCards(next);
195
+ setMsg(`${card.title}: ${where(next, card.id)}.`);
196
+ };
197
+ const onKey = (e, card) => {
198
+ const held = picked?.id === card.id;
199
+ if (e.key === " " || e.key === "Enter") {
200
+ e.preventDefault();
201
+ if (held) {
202
+ setPicked(null);
203
+ setMsg(`Dropped ${card.title} in ${where(cards, card.id)}.`);
204
+ onChange?.(cards);
205
+ } else if (!picked) {
206
+ setPicked({ id: card.id, origin: cards });
207
+ setMsg(`Picked up ${card.title}. Use the arrow keys to move it, Space to drop, Escape to cancel.`);
208
+ }
209
+ return;
210
+ }
211
+ if (!held) return;
212
+ const dir = { ArrowLeft: [-1, 0], ArrowRight: [1, 0], ArrowUp: [0, -1], ArrowDown: [0, 1] }[e.key];
213
+ if (dir) {
214
+ e.preventDefault();
215
+ keyMove(card, dir[0], dir[1]);
216
+ } else if (e.key === "Escape") {
217
+ e.preventDefault();
218
+ cancelPick(true);
219
+ }
220
+ };
221
+ const onBlur = (id) => {
222
+ if (pickedRef.current?.id !== id) return;
223
+ setTimeout(() => {
224
+ if (pickedRef.current?.id === id && document.activeElement !== els.current.get(id)) cancelPick(false);
225
+ });
226
+ };
227
+ const dragged = drag ? cards.find((c) => c.id === drag.id) : void 0;
228
+ return /* @__PURE__ */ jsxs("div", { className: cx("w-full overflow-x-auto", className), children: [
229
+ /* @__PURE__ */ jsx("style", { href: "asta-kanban", precedence: "asta", children: `
230
+ @keyframes kit-kb-lift { to { transform: rotate(1.5deg) scale(1.03); box-shadow: 0 18px 36px -14px rgb(0 0 0 / .28); } }
231
+ @keyframes kit-kb-land { from { transform: rotate(1.5deg) scale(1.03); box-shadow: 0 18px 36px -14px rgb(0 0 0 / .28); } }
232
+ @keyframes kit-kb-fade { from { opacity: 0; } }
233
+ @keyframes kit-kb-count { from { opacity: 0; transform: translateY(4px); } }
234
+ @media (prefers-reduced-motion: reduce) { .kit-kb, .kit-kb * { animation: none !important; transition-duration: 0s !important; } }
235
+ ` }),
236
+ /* @__PURE__ */ jsx("p", { id: hintId, className: "sr-only", children: "Press Space to pick up a card. Use the arrow keys to move it, Space to drop, Escape to cancel." }),
237
+ /* @__PURE__ */ jsx("p", { className: "sr-only", "aria-live": "polite", children: msg }),
238
+ /* @__PURE__ */ jsxs("div", { ref: root, className: "kit-kb relative grid min-w-[620px] gap-3", style: { gridTemplateColumns: `repeat(${columns.length}, minmax(0, 1fr))` }, children: [
239
+ columns.map((col) => {
240
+ const list = inCol(cards, col.id);
241
+ const g = drag?.geo.find((c) => c.id === col.id);
242
+ const count = list.length - (drag?.from === col.id ? 1 : 0) + (drag?.target.col === col.id ? 1 : 0);
243
+ return /* @__PURE__ */ jsxs("section", { "aria-label": col.title, className: "flex min-h-[340px] flex-col rounded-xl bg-paper-2 p-2", children: [
244
+ /* @__PURE__ */ jsxs("header", { className: "flex items-center gap-2 px-1.5 pb-2.5 pt-1", children: [
245
+ /* @__PURE__ */ jsx("h4", { className: "text-[13px] font-medium text-ink", children: col.title }),
246
+ /* @__PURE__ */ jsx("span", { className: "text-[12px] tabular-nums text-mute", style: { animation: `kit-kb-count .4s ${CURVE}` }, children: count }, count)
247
+ ] }),
248
+ /* @__PURE__ */ jsxs(
249
+ "ul",
250
+ {
251
+ ref: (el) => {
252
+ if (el) lists.current.set(col.id, el);
253
+ },
254
+ className: "relative flex flex-1 flex-col gap-2",
255
+ children: [
256
+ drag && g && drag.target.col === col.id && /* @__PURE__ */ jsx(
257
+ "li",
258
+ {
259
+ "aria-hidden": true,
260
+ className: cx(
261
+ "pointer-events-none absolute inset-x-0 top-0 rounded-[10px] bg-[color-mix(in_srgb,var(--brand)_5%,transparent)] shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--brand)_28%,transparent)] transition-transform duration-300",
262
+ EASE
263
+ ),
264
+ style: { height: drag.h, transform: `translateY(${gapTop(drag, g)}px)`, animation: `kit-kb-fade .25s ${CURVE}` }
265
+ },
266
+ `gap-${col.id}`
267
+ ),
268
+ list.map((card) => {
269
+ const held = picked?.id === card.id;
270
+ const hidden = drag?.id === card.id;
271
+ const dy = drag && g ? shiftOf(drag, g, card.id) : 0;
272
+ return /* @__PURE__ */ jsx(
273
+ "li",
274
+ {
275
+ ref: (el) => {
276
+ if (!el) return;
277
+ els.current.set(card.id, el);
278
+ return () => {
279
+ if (els.current.get(card.id) === el) els.current.delete(card.id);
280
+ };
281
+ },
282
+ tabIndex: 0,
283
+ "aria-roledescription": "draggable card",
284
+ "aria-describedby": hintId,
285
+ "data-picked": held || void 0,
286
+ onPointerDown: (e) => pointer.down(e, card),
287
+ onPointerMove: (e) => pointer.move(e, card),
288
+ onPointerUp: pointer.up,
289
+ onPointerCancel: pointer.cancel,
290
+ onKeyDown: (e) => onKey(e, card),
291
+ onBlur: () => onBlur(card.id),
292
+ className: cx(
293
+ cardCls,
294
+ "relative cursor-grab touch-none select-none outline-none focus-visible:ring-2 focus-visible:ring-brand/50",
295
+ drag && "transition-transform duration-300",
296
+ EASE,
297
+ hidden && "opacity-0",
298
+ held && "z-10 scale-[1.02] !shadow-[inset_0_0_0_1.5px_var(--brand),0_14px_30px_-14px_rgb(0_0_0/0.3)] transition-[scale,box-shadow] duration-300"
299
+ ),
300
+ style: dy ? { transform: `translateY(${dy}px)` } : void 0,
301
+ children: /* @__PURE__ */ jsx(CardBody, { card })
302
+ },
303
+ card.id
304
+ );
305
+ })
306
+ ]
307
+ }
308
+ )
309
+ ] }, col.id);
310
+ }),
311
+ drag && dragged && /* @__PURE__ */ jsx(
312
+ "div",
313
+ {
314
+ "aria-hidden": true,
315
+ className: "pointer-events-none absolute left-0 top-0 z-30",
316
+ style: {
317
+ width: drag.w,
318
+ transform: `translate3d(${drag.x}px, ${drag.y}px, 0)`,
319
+ transition: drag.dropping ? `transform .26s ${CURVE}` : "none"
320
+ },
321
+ children: /* @__PURE__ */ jsx(
322
+ "div",
323
+ {
324
+ className: cx(cardCls, "cursor-grabbing"),
325
+ style: { animation: drag.dropping ? `kit-kb-land .26s ${CURVE} both` : `kit-kb-lift .22s ${CURVE} both` },
326
+ children: /* @__PURE__ */ jsx(CardBody, { card: dragged })
327
+ }
328
+ )
329
+ }
330
+ )
331
+ ] })
332
+ ] });
333
+ }
334
+ var kanban_default = Kanban;
335
+
336
+ export {
337
+ Kanban,
338
+ kanban_default
339
+ };
@@ -0,0 +1,309 @@
1
+ "use client";
2
+
3
+ // components/lab/blocks/NowPlaying.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 BRAND = "var(--brand)";
9
+ var INK = "var(--ink)";
10
+ var TRACKS = [
11
+ {
12
+ title: "Slow Orbit",
13
+ artist: "Halden",
14
+ len: 204,
15
+ start: 38,
16
+ bg: `linear-gradient(150deg, color-mix(in srgb, ${BRAND} 70%, white), ${BRAND})`,
17
+ shape: { inset: "34% -12% -12% 34%", borderRadius: "50%", background: "rgb(255 255 255 / .9)" }
18
+ },
19
+ {
20
+ title: "Northern Static",
21
+ artist: "Ivy Arden",
22
+ len: 187,
23
+ start: 64,
24
+ bg: `linear-gradient(200deg, color-mix(in srgb, ${INK} 88%, ${BRAND}), ${INK})`,
25
+ shape: { inset: "22%", borderRadius: "50%", boxShadow: `inset 0 0 0 7px ${BRAND}` }
26
+ },
27
+ {
28
+ title: "Glass Hours",
29
+ artist: "The Quiet Rooms",
30
+ len: 232,
31
+ start: 91,
32
+ bg: `linear-gradient(180deg, color-mix(in srgb, ${BRAND} 12%, white), color-mix(in srgb, ${BRAND} 30%, white))`,
33
+ shape: { inset: "50% 0 0 0", background: BRAND, borderRadius: "50% 50% 0 0 / 100% 100% 0 0" }
34
+ },
35
+ {
36
+ title: "Soft Meridian",
37
+ artist: "Lumen Coast",
38
+ len: 199,
39
+ start: 47,
40
+ bg: `radial-gradient(circle at 70% 25%, color-mix(in srgb, ${BRAND} 60%, white), ${BRAND} 55%, color-mix(in srgb, ${BRAND} 60%, black))`,
41
+ shape: { inset: "62% 18% 30% 18%", background: "rgb(255 255 255 / .85)", borderRadius: "2px" }
42
+ }
43
+ ];
44
+ var BARS = [0.9, 1.15, 0.8, 1.05];
45
+ var DWELL = 9e3;
46
+ var still = () => window.matchMedia("(prefers-reduced-motion: reduce)").matches;
47
+ var clock = (s) => `${Math.floor(s / 60)}:${String(Math.floor(s % 60)).padStart(2, "0")}`;
48
+ var Skip = ({ back }) => /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", className: "h-4 w-4", fill: "currentColor", style: back ? { transform: "scaleX(-1)" } : void 0, "aria-hidden": true, children: [
49
+ /* @__PURE__ */ jsx("path", { d: "M3 3.2v9.6c0 .5.5.8.9.5L10.5 8.4a.6.6 0 0 0 0-.8L3.9 2.7c-.4-.3-.9 0-.9.5Z" }),
50
+ /* @__PURE__ */ jsx("rect", { x: "11.6", y: "2.8", width: "1.8", height: "10.4", rx: ".6" })
51
+ ] });
52
+ function NowPlaying() {
53
+ const [cur, setCur] = useState(0);
54
+ const [prev, setPrev] = useState(null);
55
+ const [dir, setDir] = useState(1);
56
+ const [at, setAt] = useState(TRACKS[0].start);
57
+ const [playing, setPlaying] = useState(true);
58
+ const [demo, setDemo] = useState(true);
59
+ const idle = useRef(null);
60
+ const bar = useRef(null);
61
+ const n = useRef(0);
62
+ const curRef = useRef(0);
63
+ const track = TRACKS[cur];
64
+ const go = (d) => {
65
+ const c = curRef.current;
66
+ const next = (c + d + TRACKS.length) % TRACKS.length;
67
+ curRef.current = next;
68
+ setPrev({ i: c, dir: d, n: ++n.current });
69
+ setCur(next);
70
+ setAt(TRACKS[next].start);
71
+ setDir(d);
72
+ };
73
+ const takeOver = () => {
74
+ setDemo(false);
75
+ if (idle.current) clearTimeout(idle.current);
76
+ idle.current = setTimeout(() => setDemo(true), 1e4);
77
+ };
78
+ useEffect(() => () => void (idle.current && clearTimeout(idle.current)), []);
79
+ useEffect(() => {
80
+ if (!still()) return;
81
+ const id = setTimeout(() => setPlaying(false), 0);
82
+ return () => clearTimeout(id);
83
+ }, []);
84
+ useEffect(() => {
85
+ if (!playing) return;
86
+ const id = setInterval(() => setAt((a) => a + 0.25), 250);
87
+ return () => clearInterval(id);
88
+ }, [playing]);
89
+ useEffect(() => {
90
+ if (at < track.len) return;
91
+ const id = setTimeout(() => go(1), 0);
92
+ return () => clearTimeout(id);
93
+ }, [at, track.len]);
94
+ useEffect(() => {
95
+ if (!demo || !playing || still()) return;
96
+ const id = setTimeout(() => go(1), DWELL);
97
+ return () => clearTimeout(id);
98
+ }, [demo, playing, cur]);
99
+ useEffect(() => {
100
+ if (!prev) return;
101
+ const id = setTimeout(() => setPrev((p2) => p2 && p2.n === prev.n ? null : p2), 600);
102
+ return () => clearTimeout(id);
103
+ }, [prev]);
104
+ const toggle = () => {
105
+ takeOver();
106
+ setPlaying((p2) => !p2);
107
+ };
108
+ const skip = (d) => {
109
+ takeOver();
110
+ go(d);
111
+ };
112
+ const seekTo = (x) => {
113
+ const r = bar.current?.getBoundingClientRect();
114
+ if (!r) return;
115
+ setAt(Math.max(0, Math.min(track.len - 1, (x - r.left) / r.width * track.len)));
116
+ };
117
+ const onBar = (e) => {
118
+ takeOver();
119
+ e.currentTarget.setPointerCapture(e.pointerId);
120
+ seekTo(e.clientX);
121
+ };
122
+ const onKey = (e) => {
123
+ const onButton = e.target !== e.currentTarget && e.target.tagName === "BUTTON";
124
+ if (e.key === " " && !onButton) {
125
+ e.preventDefault();
126
+ toggle();
127
+ } else if (e.key === "ArrowRight" || e.key === "ArrowLeft") {
128
+ e.preventDefault();
129
+ takeOver();
130
+ const d = e.key === "ArrowRight" ? 5 : -5;
131
+ setAt((a) => Math.max(0, Math.min(track.len - 1, a + d)));
132
+ }
133
+ };
134
+ const p = Math.min(1, at / track.len);
135
+ const slide = (i, out, d) => /* @__PURE__ */ jsxs("span", { className: `${out ? "absolute inset-0" : "block"} ${out ? d > 0 ? "lab-np-out" : "lab-np-out-b" : d > 0 ? "lab-np-in" : d < 0 ? "lab-np-in-b" : ""}`, children: [
136
+ /* @__PURE__ */ jsx("span", { className: "block truncate text-[15px] font-medium tracking-[-0.015em] text-ink", children: TRACKS[i].title }),
137
+ /* @__PURE__ */ jsx("span", { className: "block truncate text-[12.5px] text-mute", children: TRACKS[i].artist })
138
+ ] }, `${i}-${out ? prev?.n : "in"}-${cur}`);
139
+ return /* @__PURE__ */ jsxs(
140
+ "div",
141
+ {
142
+ role: "group",
143
+ tabIndex: 0,
144
+ "aria-label": `Music player. ${track.title} by ${track.artist}. ${playing ? "Playing" : "Paused"}. Space to ${playing ? "pause" : "play"}, arrows to seek`,
145
+ onKeyDown: onKey,
146
+ className: "flex h-full w-full items-center justify-center px-5 pb-5 pt-11 outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-brand/50",
147
+ style: { containerType: "size" },
148
+ children: [
149
+ /* @__PURE__ */ jsx("style", { href: "asta-nowplaying", precedence: "asta", children: `
150
+ .lab-np-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: min(6cqw, 28px); align-items: center }
151
+ .lab-np-cover { width: min(62cqh, 40cqw, 200px) }
152
+ @container (aspect-ratio < 1.15) { .lab-np-body { grid-template-columns: minmax(0, 1fr); gap: 16px } .lab-np-cover { width: min(38cqh, 100%) } }
153
+ @keyframes lab-np-in { from { transform: translateX(18px); opacity: 0 } to { transform: none; opacity: 1 } }
154
+ @keyframes lab-np-in-b { from { transform: translateX(-18px); opacity: 0 } to { transform: none; opacity: 1 } }
155
+ @keyframes lab-np-out { to { transform: translateX(-18px); opacity: 0 } }
156
+ @keyframes lab-np-out-b { to { transform: translateX(18px); opacity: 0 } }
157
+ @keyframes lab-np-eq { 0% { transform: scaleY(.3) } 35% { transform: scaleY(1) } 65% { transform: scaleY(.55) } 100% { transform: scaleY(.85) } }
158
+ .lab-np-in { animation: lab-np-in .55s ${EASE} both }
159
+ .lab-np-in-b { animation: lab-np-in-b .55s ${EASE} both }
160
+ .lab-np-out { animation: lab-np-out .45s ${EASE} both }
161
+ .lab-np-out-b { animation: lab-np-out-b .45s ${EASE} both }
162
+ .lab-np-eq { transform-origin: bottom; animation: lab-np-eq var(--d) ${EASE} infinite alternate }
163
+ @media (prefers-reduced-motion: reduce) {
164
+ .lab-np-in, .lab-np-in-b, .lab-np-out, .lab-np-out-b, .lab-np-eq { animation: none }
165
+ .lab-np-out, .lab-np-out-b { opacity: 0 }
166
+ .lab-np-eq { transform: scaleY(.5) }
167
+ }
168
+ ` }),
169
+ /* @__PURE__ */ jsxs("div", { className: "lab-np-body w-full max-w-[460px]", children: [
170
+ /* @__PURE__ */ jsx("div", { className: `lab-np-cover relative mx-auto aspect-square overflow-hidden rounded-[12px] bg-paper-2 ${RING}`, children: TRACKS.map((t, i) => /* @__PURE__ */ jsx(
171
+ "div",
172
+ {
173
+ "aria-hidden": true,
174
+ className: "absolute inset-0 transition-[opacity,transform] duration-700 motion-reduce:transition-none",
175
+ style: {
176
+ background: t.bg,
177
+ opacity: i === cur ? 1 : 0,
178
+ transform: i === cur ? "none" : prev?.i === i ? `translateX(${-dir * 8}%) scale(.98)` : `translateX(${dir * 8}%) scale(.98)`,
179
+ transitionTimingFunction: EASE
180
+ },
181
+ children: /* @__PURE__ */ jsx("span", { className: "absolute", style: t.shape })
182
+ },
183
+ t.title
184
+ )) }),
185
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col", children: [
186
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-[10.5px] uppercase tracking-[0.12em] text-mute", children: [
187
+ /* @__PURE__ */ jsx(
188
+ "span",
189
+ {
190
+ className: "flex h-3 items-end gap-[2px] transition-[opacity,transform] duration-500",
191
+ style: { opacity: playing ? 1 : 0.45, transform: playing ? "none" : "scaleY(.35)", transformOrigin: "bottom", transitionTimingFunction: EASE },
192
+ "aria-hidden": true,
193
+ children: BARS.map((d, i) => /* @__PURE__ */ jsx(
194
+ "span",
195
+ {
196
+ className: "lab-np-eq block h-full w-[2.5px] rounded-[1px] bg-brand",
197
+ style: { ["--d"]: `${d * 0.5}s`, animationDelay: `${-i * 0.17}s`, animationPlayState: playing ? "running" : "paused" }
198
+ },
199
+ i
200
+ ))
201
+ }
202
+ ),
203
+ playing ? "Now playing" : "Paused"
204
+ ] }),
205
+ /* @__PURE__ */ jsxs("div", { className: "relative mt-2 overflow-hidden", "aria-live": "polite", children: [
206
+ prev && slide(prev.i, true, prev.dir),
207
+ slide(cur, false, prev ? prev.dir : 0)
208
+ ] }),
209
+ /* @__PURE__ */ jsxs(
210
+ "div",
211
+ {
212
+ ref: bar,
213
+ role: "slider",
214
+ "aria-label": "Seek",
215
+ "aria-valuemin": 0,
216
+ "aria-valuemax": track.len,
217
+ "aria-valuenow": Math.floor(at),
218
+ "aria-valuetext": `${clock(at)} of ${clock(track.len)}`,
219
+ onPointerDown: onBar,
220
+ onPointerMove: (e) => e.buttons && seekTo(e.clientX),
221
+ className: "group relative mt-[max(12px,4cqh)] flex h-4 cursor-pointer touch-none items-center",
222
+ children: [
223
+ /* @__PURE__ */ jsx("span", { className: "relative h-[3px] w-full overflow-hidden rounded-full bg-[color-mix(in_srgb,var(--ink)_12%,transparent)]", children: /* @__PURE__ */ jsx(
224
+ "span",
225
+ {
226
+ className: "absolute inset-0 origin-left rounded-full bg-brand",
227
+ style: { transform: `scaleX(${p})`, transition: `transform .25s linear` }
228
+ },
229
+ cur
230
+ ) }),
231
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "pointer-events-none absolute inset-0", style: { transform: `translateX(${p * 100}%)`, transition: `transform .25s linear` }, children: /* @__PURE__ */ jsx("span", { className: "absolute left-0 top-1/2 h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-ink opacity-0 transition-opacity duration-300 group-hover:opacity-100" }) }, `k${cur}`)
232
+ ]
233
+ }
234
+ ),
235
+ /* @__PURE__ */ jsxs("div", { className: "mt-1 flex justify-between text-[11px] tabular-nums text-mute", children: [
236
+ /* @__PURE__ */ jsx("span", { children: clock(at) }),
237
+ /* @__PURE__ */ jsxs("span", { children: [
238
+ "-",
239
+ clock(Math.max(0, track.len - at))
240
+ ] })
241
+ ] }),
242
+ /* @__PURE__ */ jsxs("div", { className: "mt-[max(8px,2.5cqh)] flex items-center justify-center gap-2", children: [
243
+ /* @__PURE__ */ jsx(
244
+ "button",
245
+ {
246
+ type: "button",
247
+ "aria-label": "Previous track",
248
+ onClick: () => skip(-1),
249
+ className: "flex h-9 w-9 items-center justify-center rounded-[8px] text-ink-2 outline-none transition-transform duration-200 active:scale-90 focus-visible:ring-2 focus-visible:ring-brand/50",
250
+ children: /* @__PURE__ */ jsx(Skip, { back: true })
251
+ }
252
+ ),
253
+ /* @__PURE__ */ jsxs(
254
+ "button",
255
+ {
256
+ type: "button",
257
+ "aria-label": playing ? "Pause" : "Play",
258
+ onClick: toggle,
259
+ className: "relative flex h-10 w-10 items-center justify-center rounded-[9px] bg-ink text-paper outline-none transition-transform duration-200 active:scale-95 focus-visible:ring-2 focus-visible:ring-brand/50 focus-visible:ring-offset-2 focus-visible:ring-offset-paper",
260
+ children: [
261
+ /* @__PURE__ */ jsx(
262
+ "svg",
263
+ {
264
+ viewBox: "0 0 16 16",
265
+ className: "absolute h-4 w-4 transition-[opacity,transform] duration-500 motion-reduce:transition-none",
266
+ style: { opacity: playing ? 0 : 1, transform: playing ? "rotate(-90deg) scale(.5)" : "none", transitionTimingFunction: EASE },
267
+ fill: "currentColor",
268
+ "aria-hidden": true,
269
+ children: /* @__PURE__ */ jsx("path", { d: "M4.5 2.9v10.2c0 .5.5.8.9.5l7.6-5.1a.6.6 0 0 0 0-1L5.4 2.4c-.4-.3-.9 0-.9.5Z" })
270
+ }
271
+ ),
272
+ /* @__PURE__ */ jsxs(
273
+ "svg",
274
+ {
275
+ viewBox: "0 0 16 16",
276
+ className: "absolute h-4 w-4 transition-[opacity,transform] duration-500 motion-reduce:transition-none",
277
+ style: { opacity: playing ? 1 : 0, transform: playing ? "none" : "rotate(90deg) scale(.5)", transitionTimingFunction: EASE },
278
+ fill: "currentColor",
279
+ "aria-hidden": true,
280
+ children: [
281
+ /* @__PURE__ */ jsx("rect", { x: "3.5", y: "2.5", width: "3", height: "11", rx: "1" }),
282
+ /* @__PURE__ */ jsx("rect", { x: "9.5", y: "2.5", width: "3", height: "11", rx: "1" })
283
+ ]
284
+ }
285
+ )
286
+ ]
287
+ }
288
+ ),
289
+ /* @__PURE__ */ jsx(
290
+ "button",
291
+ {
292
+ type: "button",
293
+ "aria-label": "Next track",
294
+ onClick: () => skip(1),
295
+ className: "flex h-9 w-9 items-center justify-center rounded-[8px] text-ink-2 outline-none transition-transform duration-200 active:scale-90 focus-visible:ring-2 focus-visible:ring-brand/50",
296
+ children: /* @__PURE__ */ jsx(Skip, {})
297
+ }
298
+ )
299
+ ] })
300
+ ] })
301
+ ] })
302
+ ]
303
+ }
304
+ );
305
+ }
306
+
307
+ export {
308
+ NowPlaying
309
+ };