asta-ui 0.0.0-stage → 0.2.1

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,221 @@
1
+ "use client";
2
+
3
+ // components/lab/blocks/Candlestick.tsx
4
+ import { useEffect, useRef, useState } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ var BUF = 64;
7
+ var NEW_EVERY = 3e3;
8
+ function seeded(s) {
9
+ return () => {
10
+ s = s + 1831565813 | 0;
11
+ let t = Math.imul(s ^ s >>> 15, 1 | s);
12
+ t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t;
13
+ return ((t ^ t >>> 14) >>> 0) / 4294967296;
14
+ };
15
+ }
16
+ function seed() {
17
+ const rand = seeded(1716);
18
+ const out = [];
19
+ let p = 1716;
20
+ for (let i = 0; i < BUF; i++) {
21
+ const o = p;
22
+ const c = o + (rand() - 0.47) * 3.2;
23
+ out.push({ o, c, h: Math.max(o, c) + rand() * 1.1, l: Math.min(o, c) - rand() * 1.1 });
24
+ p = c;
25
+ }
26
+ return out;
27
+ }
28
+ function Candlestick() {
29
+ const canvas = useRef(null);
30
+ const wrap = useRef(null);
31
+ const [ohlc, setOhlc] = useState(null);
32
+ const S = useRef({ data: seed(), born: 0, lo: 0, hi: 0, hx: -1, hy: -1, raf: 0, last: 0, prev: 0, target: 0, onScreen: true });
33
+ useEffect(() => {
34
+ const cv = canvas.current;
35
+ const el = wrap.current;
36
+ const st = S.current;
37
+ const ctx = cv.getContext("2d");
38
+ const still = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
39
+ let w = 0;
40
+ let h = 0;
41
+ let colors = { ink: "#e9e9e4", mute: "#888", paper: "#111", accent: "#e9e9e4" };
42
+ const resize = () => {
43
+ const r = el.getBoundingClientRect();
44
+ const dpr = Math.min(2, window.devicePixelRatio || 1);
45
+ w = r.width;
46
+ h = r.height;
47
+ cv.width = Math.round(w * dpr);
48
+ cv.height = Math.round(h * dpr);
49
+ cv.style.width = `${w}px`;
50
+ cv.style.height = `${h}px`;
51
+ ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
52
+ const cs = getComputedStyle(el);
53
+ colors = { ink: cs.getPropertyValue("--color-ink").trim() || colors.ink, mute: cs.getPropertyValue("--color-mute").trim() || colors.mute, paper: cs.getPropertyValue("--color-paper").trim() || colors.paper, accent: cs.getPropertyValue("--color-brand").trim() || colors.accent };
54
+ };
55
+ const ro = new ResizeObserver(resize);
56
+ ro.observe(el);
57
+ const io = new IntersectionObserver(([e]) => st.onScreen = e.isIntersecting);
58
+ io.observe(el);
59
+ resize();
60
+ st.born = performance.now();
61
+ const draw = (now) => {
62
+ st.raf = requestAnimationFrame(draw);
63
+ if (!st.onScreen || document.hidden || !w) return;
64
+ const d = st.data;
65
+ const dt = Math.min(64, now - (st.prev || now));
66
+ st.prev = now;
67
+ const ease = (tau) => still ? 1 : 1 - Math.exp(-dt / tau);
68
+ const live = d[d.length - 1];
69
+ if (!st.target) st.target = live.c;
70
+ if (now - st.last > 400) {
71
+ st.last = now;
72
+ st.target += (Math.random() - 0.485) * 1.1;
73
+ }
74
+ live.c += (st.target - live.c) * ease(220);
75
+ live.h = Math.max(live.h, live.c);
76
+ live.l = Math.min(live.l, live.c);
77
+ if (now - st.born > NEW_EVERY) {
78
+ d.push({ o: live.c, c: live.c, h: live.c, l: live.c });
79
+ st.target = live.c;
80
+ if (d.length > BUF) d.shift();
81
+ st.born = now;
82
+ }
83
+ const padL = 18;
84
+ const tagW = 62;
85
+ const top = 58;
86
+ const bottom = 22;
87
+ const plotW = w - padL - tagW;
88
+ const n = Math.max(24, Math.min(40, Math.round(plotW / 15)));
89
+ const cw = plotW / n;
90
+ const k = still ? 1 : Math.min(1, (now - st.born) / 800);
91
+ const slide = Math.pow(1 - k, 4) * cw;
92
+ const vis = d.slice(-(n + 1));
93
+ let lo = Infinity;
94
+ let hi = -Infinity;
95
+ for (const c of vis) {
96
+ lo = Math.min(lo, c.l);
97
+ hi = Math.max(hi, c.h);
98
+ }
99
+ if (!st.hi) {
100
+ st.lo = lo;
101
+ st.hi = hi;
102
+ }
103
+ st.lo += (lo - st.lo) * ease(500);
104
+ st.hi += (hi - st.hi) * ease(500);
105
+ const span = Math.max(1, st.hi - st.lo);
106
+ const y = (v) => top + (1 - (v - st.lo) / span) * (h - top - bottom);
107
+ ctx.clearRect(0, 0, w, h);
108
+ ctx.save();
109
+ ctx.beginPath();
110
+ ctx.rect(0, 0, padL + plotW, h);
111
+ ctx.clip();
112
+ vis.forEach((c, i) => {
113
+ const cx = padL + plotW - cw / 2 + slide - (vis.length - 1 - i) * cw;
114
+ const up = c.c >= c.o;
115
+ ctx.fillStyle = ctx.strokeStyle = up ? colors.accent : colors.ink;
116
+ ctx.globalAlpha = up ? i === vis.length - 1 ? 1 : 0.9 : 0.55;
117
+ ctx.lineWidth = 1;
118
+ ctx.beginPath();
119
+ ctx.moveTo(Math.round(cx) + 0.5, y(c.h));
120
+ ctx.lineTo(Math.round(cx) + 0.5, y(c.l));
121
+ ctx.stroke();
122
+ const bw = Math.max(2, cw * 0.62);
123
+ const yt = y(Math.max(c.o, c.c));
124
+ const yb = y(Math.min(c.o, c.c));
125
+ ctx.beginPath();
126
+ if (up) {
127
+ ctx.roundRect(cx - bw / 2, yt, bw, Math.max(1.5, yb - yt), Math.min(2, bw / 4));
128
+ ctx.fill();
129
+ } else {
130
+ ctx.fillStyle = colors.paper;
131
+ ctx.globalAlpha = 1;
132
+ ctx.fillRect(cx - bw / 2, yt, bw, Math.max(1.5, yb - yt));
133
+ ctx.globalAlpha = 0.55;
134
+ ctx.strokeRect(Math.round(cx - bw / 2) + 0.5, Math.round(yt) + 0.5, Math.max(1, Math.round(bw) - 1), Math.max(1, Math.round(yb - yt)));
135
+ }
136
+ });
137
+ ctx.restore();
138
+ ctx.globalAlpha = 1;
139
+ const cur = d[d.length - 1];
140
+ const ly = y(cur.c);
141
+ const col = colors.accent;
142
+ ctx.strokeStyle = col;
143
+ ctx.globalAlpha = 0.5;
144
+ ctx.setLineDash([2, 4]);
145
+ ctx.beginPath();
146
+ ctx.moveTo(padL, Math.round(ly) + 0.5);
147
+ ctx.lineTo(w - tagW + 4, Math.round(ly) + 0.5);
148
+ ctx.stroke();
149
+ ctx.setLineDash([]);
150
+ ctx.globalAlpha = 1;
151
+ ctx.fillStyle = col;
152
+ ctx.beginPath();
153
+ ctx.roundRect(w - tagW + 6, ly - 10, tagW - 14, 20, 5);
154
+ ctx.fill();
155
+ ctx.fillStyle = colors.paper;
156
+ ctx.font = "500 11px ui-monospace, SFMono-Regular, Menlo, monospace";
157
+ ctx.textAlign = "center";
158
+ ctx.textBaseline = "middle";
159
+ ctx.fillText(cur.c.toFixed(2), w - tagW + 6 + (tagW - 14) / 2, ly + 0.5);
160
+ if (st.hx >= 0) {
161
+ ctx.strokeStyle = colors.ink;
162
+ ctx.globalAlpha = 0.28;
163
+ ctx.setLineDash([3, 4]);
164
+ ctx.beginPath();
165
+ ctx.moveTo(Math.round(st.hx) + 0.5, top - 8);
166
+ ctx.lineTo(Math.round(st.hx) + 0.5, h - 8);
167
+ ctx.moveTo(padL, Math.round(st.hy) + 0.5);
168
+ ctx.lineTo(padL + plotW, Math.round(st.hy) + 0.5);
169
+ ctx.stroke();
170
+ ctx.setLineDash([]);
171
+ ctx.globalAlpha = 1;
172
+ const i = vis.length - 1 - Math.round((padL + plotW - cw / 2 + slide - st.hx) / cw);
173
+ const c = vis[Math.max(0, Math.min(vis.length - 1, i))];
174
+ if (c) setOhlc((o) => o === c ? o : c);
175
+ }
176
+ };
177
+ st.raf = requestAnimationFrame(draw);
178
+ return () => {
179
+ cancelAnimationFrame(st.raf);
180
+ ro.disconnect();
181
+ io.disconnect();
182
+ };
183
+ }, []);
184
+ const move = (e) => {
185
+ const r = wrap.current.getBoundingClientRect();
186
+ S.current.hx = e.clientX - r.left;
187
+ S.current.hy = e.clientY - r.top;
188
+ };
189
+ const f = (v) => v.toFixed(2);
190
+ return /* @__PURE__ */ jsxs("div", { className: "relative h-full w-full", children: [
191
+ /* @__PURE__ */ jsx(
192
+ "div",
193
+ {
194
+ ref: wrap,
195
+ className: "absolute inset-0 cursor-crosshair [touch-action:pan-y]",
196
+ onPointerMove: move,
197
+ onPointerDown: move,
198
+ onPointerLeave: () => {
199
+ S.current.hx = -1;
200
+ setOhlc(null);
201
+ },
202
+ children: /* @__PURE__ */ jsx("canvas", { ref: canvas, className: "block", "aria-label": "Live candlestick chart for ACME / USD", role: "img" })
203
+ }
204
+ ),
205
+ /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute left-5 top-5 font-mono text-[11px] tabular-nums sm:left-6", children: ohlc ? /* @__PURE__ */ jsxs("span", { className: "text-mute", children: [
206
+ "O ",
207
+ /* @__PURE__ */ jsx("span", { className: "text-ink", children: f(ohlc.o) }),
208
+ " H ",
209
+ /* @__PURE__ */ jsx("span", { className: "text-ink", children: f(ohlc.h) }),
210
+ " L ",
211
+ /* @__PURE__ */ jsx("span", { className: "text-ink", children: f(ohlc.l) }),
212
+ " C",
213
+ " ",
214
+ /* @__PURE__ */ jsx("span", { style: { color: ohlc.c >= ohlc.o ? "var(--brand)" : "var(--ink-2)" }, children: f(ohlc.c) })
215
+ ] }) : /* @__PURE__ */ jsx("span", { className: "uppercase tracking-[0.12em] text-mute", children: "ACME / USD \xB7 1m" }) })
216
+ ] });
217
+ }
218
+
219
+ export {
220
+ Candlestick
221
+ };
@@ -0,0 +1,138 @@
1
+ "use client";
2
+ import {
3
+ Button
4
+ } from "./chunk-WSL4JGEA.js";
5
+
6
+ // components/kit/base/pricing.tsx
7
+ import { useLayoutEffect, 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 Digit({ d, delay }) {
12
+ return /* @__PURE__ */ jsx("span", { className: "relative inline-block h-[1em] w-[0.62em] overflow-hidden", children: /* @__PURE__ */ jsx(
13
+ "span",
14
+ {
15
+ className: cx("absolute inset-x-0 top-0 flex flex-col transition-transform duration-700 motion-reduce:transition-none", EASE),
16
+ style: { transform: `translateY(${-d * 10}%)`, transitionDelay: `${delay}ms` },
17
+ children: Array.from({ length: 10 }, (_, n) => /* @__PURE__ */ jsx("span", { className: "block h-[1em] text-center leading-[1em]", children: n }, n))
18
+ }
19
+ ) });
20
+ }
21
+ function RollingNumber({ value, className = "" }) {
22
+ const digits = String(Math.max(0, Math.round(value))).split("").map(Number);
23
+ return /* @__PURE__ */ jsxs("span", { className: cx("inline-flex tabular-nums", className), children: [
24
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: value }),
25
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "inline-flex", children: digits.map((d, i) => /* @__PURE__ */ jsx(Digit, { d, delay: (digits.length - 1 - i) * 60 }, digits.length - i)) })
26
+ ] });
27
+ }
28
+ function BillingSwitch({ value, onChange, saving }) {
29
+ const refs = useRef({ monthly: null, yearly: null });
30
+ const [pill, setPill] = useState({ x: 0, w: 0 });
31
+ useLayoutEffect(() => {
32
+ const el = refs.current[value];
33
+ if (el) setPill({ x: el.offsetLeft, w: el.offsetWidth });
34
+ }, [value]);
35
+ return /* @__PURE__ */ jsxs("div", { role: "radiogroup", "aria-label": "Billing period", className: "relative inline-flex rounded-[10px] bg-paper-2 p-1 shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_8%,transparent)]", children: [
36
+ /* @__PURE__ */ jsx(
37
+ "span",
38
+ {
39
+ "aria-hidden": true,
40
+ className: cx("absolute bottom-1 top-1 rounded-[7px] bg-paper shadow-[0_1px_2px_rgb(0_0_0/0.12),0_0_0_1px_color-mix(in_srgb,var(--ink)_8%,transparent)] transition-[transform,width] duration-500", EASE),
41
+ style: { transform: `translateX(${pill.x - 4}px)`, width: pill.w, left: 4 }
42
+ }
43
+ ),
44
+ ["monthly", "yearly"].map((b) => /* @__PURE__ */ jsxs(
45
+ "button",
46
+ {
47
+ ref: (el) => {
48
+ refs.current[b] = el;
49
+ },
50
+ type: "button",
51
+ role: "radio",
52
+ "aria-checked": value === b,
53
+ tabIndex: value === b ? 0 : -1,
54
+ onClick: () => onChange(b),
55
+ onKeyDown: (e) => {
56
+ if (["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"].includes(e.key)) {
57
+ e.preventDefault();
58
+ const next = b === "monthly" ? "yearly" : "monthly";
59
+ onChange(next);
60
+ refs.current[next]?.focus();
61
+ }
62
+ },
63
+ className: cx(
64
+ "relative z-10 flex h-8 items-center gap-1.5 rounded-[7px] px-4 text-[13px] font-medium capitalize outline-none transition-colors duration-300 focus-visible:ring-2 focus-visible:ring-brand/50",
65
+ value === b ? "text-ink" : "text-mute hover:text-ink"
66
+ ),
67
+ children: [
68
+ b,
69
+ b === "yearly" && saving && /* @__PURE__ */ jsx("span", { className: "rounded-[4px] bg-brand px-1.5 text-[10.5px] leading-[18px] text-white", children: saving })
70
+ ]
71
+ },
72
+ b
73
+ ))
74
+ ] });
75
+ }
76
+ var Check = () => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "mt-[3px] h-3.5 w-3.5 shrink-0", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "m3.5 8.5 3 3 6-7" }) });
77
+ function Pricing({ plans, currency = "$", saving, defaultBilling = "monthly", className }) {
78
+ const [billing, setBilling] = useState(defaultBilling);
79
+ return /* @__PURE__ */ jsxs("div", { className: cx("flex w-full flex-col items-center gap-6", className), children: [
80
+ /* @__PURE__ */ jsx(BillingSwitch, { value: billing, onChange: setBilling, saving }),
81
+ /* @__PURE__ */ jsx("div", { className: "grid w-full gap-3 @min-[540px]:grid-cols-3", children: plans.map((p) => {
82
+ const hi = !!p.highlight;
83
+ return /* @__PURE__ */ jsxs(
84
+ "div",
85
+ {
86
+ className: cx(
87
+ "relative flex flex-col rounded-xl p-4 @min-[700px]:p-5 transition-transform duration-500",
88
+ EASE,
89
+ hi ? "bg-ink text-paper shadow-[0_24px_50px_-24px_rgb(0_0_0/0.5)] @min-[540px]:-translate-y-2" : "bg-paper text-ink shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_12%,transparent)]"
90
+ ),
91
+ children: [
92
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
93
+ /* @__PURE__ */ jsx("h3", { className: "text-[15px] font-medium tracking-[-0.01em]", children: p.name }),
94
+ hi && /* @__PURE__ */ jsx("span", { className: "rounded-[5px] bg-brand px-2 py-0.5 text-[11px] font-medium text-white", children: p.highlight })
95
+ ] }),
96
+ /* @__PURE__ */ jsx("p", { className: cx("mt-1 text-[12.5px] leading-snug", hi ? "text-paper/60" : "text-mute"), children: p.description }),
97
+ /* @__PURE__ */ jsxs("div", { className: "mt-5 flex items-end gap-1", children: [
98
+ /* @__PURE__ */ jsxs("span", { className: "flex items-start font-medium leading-none tracking-[-0.04em]", children: [
99
+ /* @__PURE__ */ jsx("span", { className: "mr-0.5 mt-1 text-[20px]", children: currency }),
100
+ /* @__PURE__ */ jsx(RollingNumber, { value: p.price[billing], className: "text-[40px]" })
101
+ ] }),
102
+ /* @__PURE__ */ jsx("span", { className: cx("pb-1 text-[12px]", hi ? "text-paper/55" : "text-mute"), children: "/ month" })
103
+ ] }),
104
+ /* @__PURE__ */ jsxs("p", { className: cx("mt-1.5 h-4 text-[11.5px] transition-opacity duration-300", hi ? "text-paper/55" : "text-mute", billing === "yearly" && p.price.yearly > 0 ? "opacity-100" : "opacity-0"), children: [
105
+ "Billed ",
106
+ currency,
107
+ p.price.yearly * 12,
108
+ " a year"
109
+ ] }),
110
+ /* @__PURE__ */ jsx(
111
+ Button,
112
+ {
113
+ href: p.cta.href,
114
+ variant: hi ? "accent" : "outline",
115
+ shape: "pill",
116
+ className: cx("mt-5 w-full", hi && "shadow-none"),
117
+ children: p.cta.label
118
+ }
119
+ ),
120
+ /* @__PURE__ */ jsx("ul", { className: "mt-5 flex flex-col gap-2", children: p.features.map((f) => /* @__PURE__ */ jsxs("li", { className: cx("flex gap-2 text-[13px] leading-snug", hi ? "text-paper/85" : "text-ink-2"), children: [
121
+ /* @__PURE__ */ jsx("span", { className: hi ? "text-brand" : "text-ink", children: /* @__PURE__ */ jsx(Check, {}) }),
122
+ f
123
+ ] }, f)) })
124
+ ]
125
+ },
126
+ p.name
127
+ );
128
+ }) })
129
+ ] });
130
+ }
131
+ var pricing_default = Pricing;
132
+
133
+ export {
134
+ RollingNumber,
135
+ BillingSwitch,
136
+ Pricing,
137
+ pricing_default
138
+ };
@@ -0,0 +1,247 @@
1
+ "use client";
2
+ import {
3
+ Button
4
+ } from "./chunk-ZWBJUJTR.js";
5
+
6
+ // components/kit/settings-panel.tsx
7
+ import { forwardRef, useEffect, useId, useImperativeHandle, useRef, useState } from "react";
8
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
+ var cx = (...c) => c.filter(Boolean).join(" ");
10
+ var RING = "shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_14%,transparent)]";
11
+ var EASE = "ease-[cubic-bezier(.16,1,.3,1)]";
12
+ function Toggle({ checked, onChange, label, hint }) {
13
+ const id = useId();
14
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4 py-2.5", children: [
15
+ /* @__PURE__ */ jsxs("label", { htmlFor: id, className: "min-w-0 cursor-pointer", children: [
16
+ /* @__PURE__ */ jsx("span", { className: "block text-[14px] text-ink", children: label }),
17
+ hint && /* @__PURE__ */ jsx("span", { className: "mt-0.5 block text-[12.5px] leading-snug text-mute", children: hint })
18
+ ] }),
19
+ /* @__PURE__ */ jsx(
20
+ "button",
21
+ {
22
+ id,
23
+ type: "button",
24
+ role: "switch",
25
+ "aria-checked": checked,
26
+ onClick: () => onChange(!checked),
27
+ className: cx(
28
+ "group relative h-6 w-10 shrink-0 rounded-full outline-none transition-colors duration-300 focus-visible:ring-2 focus-visible:ring-brand/50 focus-visible:ring-offset-2 focus-visible:ring-offset-paper",
29
+ checked ? "bg-brand" : "bg-[color-mix(in_srgb,var(--ink)_16%,transparent)]"
30
+ ),
31
+ children: /* @__PURE__ */ jsx(
32
+ "span",
33
+ {
34
+ className: cx(
35
+ "absolute left-0.5 top-0.5 h-5 w-5 rounded-full bg-white shadow-[0_1px_3px_rgb(0_0_0/0.25)] transition-[transform,width] duration-300 group-active:w-6",
36
+ EASE,
37
+ checked ? "translate-x-4 group-active:translate-x-3" : "translate-x-0"
38
+ )
39
+ }
40
+ )
41
+ }
42
+ )
43
+ ] });
44
+ }
45
+ var THEMES = [
46
+ { value: "light", label: "Light", swatch: "bg-[#fcfcfb]" },
47
+ { value: "dark", label: "Dark", swatch: "bg-[#151516]" },
48
+ { value: "system", label: "System", swatch: "bg-[linear-gradient(135deg,#fcfcfb_50%,#151516_50%)]" }
49
+ ];
50
+ function ThemePicker({ value, onChange }) {
51
+ const refs = useRef([]);
52
+ const move = (d) => {
53
+ const i = (THEMES.findIndex((t) => t.value === value) + d + THEMES.length) % THEMES.length;
54
+ onChange(THEMES[i].value);
55
+ refs.current[i]?.focus();
56
+ };
57
+ return /* @__PURE__ */ jsx("div", { role: "radiogroup", "aria-label": "Theme", className: "grid grid-cols-3 gap-2", children: THEMES.map((t, i) => {
58
+ const on = t.value === value;
59
+ return /* @__PURE__ */ jsxs(
60
+ "button",
61
+ {
62
+ ref: (el) => {
63
+ refs.current[i] = el;
64
+ },
65
+ type: "button",
66
+ role: "radio",
67
+ "aria-checked": on,
68
+ tabIndex: on ? 0 : -1,
69
+ onClick: () => onChange(t.value),
70
+ onKeyDown: (e) => {
71
+ if (e.key === "ArrowRight" || e.key === "ArrowDown") move(1);
72
+ else if (e.key === "ArrowLeft" || e.key === "ArrowUp") move(-1);
73
+ else return;
74
+ e.preventDefault();
75
+ },
76
+ className: cx(
77
+ "flex flex-col items-start gap-2 rounded-[10px] p-2 text-left outline-none transition-shadow duration-300 focus-visible:ring-2 focus-visible:ring-brand/50",
78
+ on ? "shadow-[inset_0_0_0_2px_var(--brand)]" : `${RING} hover:shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_26%,transparent)]`
79
+ ),
80
+ children: [
81
+ /* @__PURE__ */ jsx("span", { className: cx("h-10 w-full rounded-lg shadow-[inset_0_0_0_1px_rgb(0_0_0/0.08)]", t.swatch) }),
82
+ /* @__PURE__ */ jsxs("span", { className: "flex w-full items-center justify-between px-0.5 text-[13px] text-ink", children: [
83
+ t.label,
84
+ /* @__PURE__ */ jsx("span", { className: cx("h-3.5 w-3.5 rounded-full transition-all duration-300", on ? "bg-brand shadow-[inset_0_0_0_3.5px_var(--brand),inset_0_0_0_6px_white]" : RING) })
85
+ ] })
86
+ ]
87
+ },
88
+ t.value
89
+ );
90
+ }) });
91
+ }
92
+ function Section({ title, children }) {
93
+ return /* @__PURE__ */ jsxs("section", { className: "py-5 first:pt-0", children: [
94
+ /* @__PURE__ */ jsx("h4", { className: "mb-3 text-[12px] font-medium uppercase tracking-[0.06em] text-mute", children: title }),
95
+ children
96
+ ] });
97
+ }
98
+ var inputCls = cx("h-10 w-full rounded-lg bg-paper px-3 text-[14px] text-ink outline-none transition-shadow placeholder:text-mute focus-visible:ring-2 focus-visible:ring-brand/50", RING);
99
+ var SettingsPanel = forwardRef(function SettingsPanel2({ initial, onSave, languages = ["English", "Bahasa Indonesia", "Deutsch", "\u65E5\u672C\u8A9E"], className }, ref) {
100
+ const [saved, setSaved] = useState(initial);
101
+ const [draft, setDraft] = useState(initial);
102
+ const [status, setStatus] = useState("idle");
103
+ const bar = useRef(null);
104
+ const nameId = useId();
105
+ const emailId = useId();
106
+ const langId = useId();
107
+ const dirty = JSON.stringify(saved) !== JSON.stringify(draft);
108
+ const showBar = dirty || status !== "idle";
109
+ const dirtyRef = useRef(dirty);
110
+ useEffect(() => {
111
+ dirtyRef.current = dirty;
112
+ }, [dirty]);
113
+ const nudge = () => {
114
+ if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
115
+ bar.current?.animate(
116
+ [{ transform: "none" }, { transform: "translateX(-8px)" }, { transform: "translateX(7px)" }, { transform: "translateX(-4px)" }, { transform: "translateX(2px)" }, { transform: "none" }],
117
+ { duration: 450, easing: "cubic-bezier(.16,1,.3,1)" }
118
+ );
119
+ };
120
+ useImperativeHandle(ref, () => ({
121
+ requestLeave: () => {
122
+ if (dirtyRef.current) nudge();
123
+ return !dirtyRef.current;
124
+ }
125
+ }));
126
+ useEffect(() => {
127
+ if (status !== "saved") return;
128
+ const t = setTimeout(() => setStatus("idle"), 1400);
129
+ return () => clearTimeout(t);
130
+ }, [status]);
131
+ const set = (k, v) => {
132
+ setDraft((d) => ({ ...d, [k]: v }));
133
+ if (status === "saved") setStatus("idle");
134
+ };
135
+ const save = async () => {
136
+ setStatus("saving");
137
+ await (onSave?.(draft) ?? new Promise((r) => setTimeout(r, 900)));
138
+ setSaved(draft);
139
+ setStatus("saved");
140
+ };
141
+ return /* @__PURE__ */ jsx(
142
+ "div",
143
+ {
144
+ className: cx(
145
+ "relative w-full max-w-[520px] overflow-hidden rounded-xl bg-paper shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_10%,transparent),0_18px_40px_-24px_rgb(0_0_0/0.3)]",
146
+ className
147
+ ),
148
+ children: /* @__PURE__ */ jsxs(
149
+ "form",
150
+ {
151
+ onSubmit: (e) => {
152
+ e.preventDefault();
153
+ if (dirty) save();
154
+ },
155
+ children: [
156
+ /* @__PURE__ */ jsxs("div", { className: "max-h-[440px] overflow-y-auto px-5 pb-24 pt-5 sm:px-6 [&>section+section]:shadow-[inset_0_1px_0_color-mix(in_srgb,var(--ink)_7%,transparent)]", children: [
157
+ /* @__PURE__ */ jsx(Section, { title: "Profile", children: /* @__PURE__ */ jsxs("div", { className: "grid gap-3 sm:grid-cols-2", children: [
158
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
159
+ /* @__PURE__ */ jsx("label", { htmlFor: nameId, className: "text-[13px] font-medium text-ink", children: "Display name" }),
160
+ /* @__PURE__ */ jsx("input", { id: nameId, value: draft.name, onChange: (e) => set("name", e.target.value), className: inputCls, autoComplete: "name" })
161
+ ] }),
162
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
163
+ /* @__PURE__ */ jsx("label", { htmlFor: emailId, className: "text-[13px] font-medium text-ink", children: "Email" }),
164
+ /* @__PURE__ */ jsx("input", { id: emailId, type: "email", value: draft.email, onChange: (e) => set("email", e.target.value), className: inputCls, autoComplete: "email" })
165
+ ] })
166
+ ] }) }),
167
+ /* @__PURE__ */ jsxs(Section, { title: "Notifications", children: [
168
+ /* @__PURE__ */ jsx(Toggle, { label: "Product updates", hint: "New features, once a month.", checked: draft.notify.product, onChange: (v) => set("notify", { ...draft.notify, product: v }) }),
169
+ /* @__PURE__ */ jsx(Toggle, { label: "Mentions", hint: "When someone tags you in a comment.", checked: draft.notify.mentions, onChange: (v) => set("notify", { ...draft.notify, mentions: v }) }),
170
+ /* @__PURE__ */ jsx(Toggle, { label: "Weekly digest", checked: draft.notify.digest, onChange: (v) => set("notify", { ...draft.notify, digest: v }) })
171
+ ] }),
172
+ /* @__PURE__ */ jsxs(Section, { title: "Appearance", children: [
173
+ /* @__PURE__ */ jsx(ThemePicker, { value: draft.theme, onChange: (v) => set("theme", v) }),
174
+ /* @__PURE__ */ jsxs("div", { className: "mt-4 flex items-center justify-between gap-4", children: [
175
+ /* @__PURE__ */ jsx("label", { htmlFor: langId, className: "text-[14px] text-ink", children: "Language" }),
176
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
177
+ /* @__PURE__ */ jsx(
178
+ "select",
179
+ {
180
+ id: langId,
181
+ value: draft.language,
182
+ onChange: (e) => set("language", e.target.value),
183
+ className: cx(inputCls, "w-auto cursor-pointer appearance-none pr-9"),
184
+ children: languages.map((l) => /* @__PURE__ */ jsx("option", { children: l }, l))
185
+ }
186
+ ),
187
+ /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "pointer-events-none absolute right-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-mute", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "m4.5 6.5 3.5 3.5 3.5-3.5" }) })
188
+ ] })
189
+ ] })
190
+ ] })
191
+ ] }),
192
+ /* @__PURE__ */ jsx(
193
+ "div",
194
+ {
195
+ className: cx(
196
+ "pointer-events-none absolute inset-x-3 bottom-3 transition-[transform,opacity] duration-500",
197
+ EASE,
198
+ showBar ? "translate-y-0 opacity-100" : "translate-y-[calc(100%+16px)] opacity-0"
199
+ ),
200
+ "aria-hidden": !showBar,
201
+ children: /* @__PURE__ */ jsxs(
202
+ "div",
203
+ {
204
+ ref: bar,
205
+ role: "region",
206
+ "aria-label": "Unsaved changes",
207
+ className: "pointer-events-auto flex items-center gap-2 rounded-[10px] bg-ink py-2 pl-4 pr-2 text-paper shadow-[0_12px_30px_-10px_rgb(0_0_0/0.5)]",
208
+ children: [
209
+ /* @__PURE__ */ jsx("span", { className: "flex min-w-0 flex-1 items-center gap-2 text-[13.5px]", "aria-live": "polite", children: status === "saved" ? /* @__PURE__ */ jsxs(Fragment, { children: [
210
+ /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "h-4 w-4 shrink-0 text-[#30a46c]", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M3.5 8.5l3 3 6-7" }) }),
211
+ "Saved"
212
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
213
+ /* @__PURE__ */ jsx("span", { className: "h-1.5 w-1.5 shrink-0 rounded-full bg-brand" }),
214
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: "Unsaved changes" })
215
+ ] }) }),
216
+ status !== "saved" && /* @__PURE__ */ jsxs(Fragment, { children: [
217
+ /* @__PURE__ */ jsx(
218
+ Button,
219
+ {
220
+ variant: "ghost",
221
+ size: "sm",
222
+ tabIndex: showBar ? 0 : -1,
223
+ disabled: status === "saving",
224
+ onClick: () => setDraft(saved),
225
+ className: "text-paper/70 hover:bg-paper/10 hover:text-paper",
226
+ children: "Reset"
227
+ }
228
+ ),
229
+ /* @__PURE__ */ jsx(Button, { type: "submit", variant: "accent", size: "sm", tabIndex: showBar ? 0 : -1, loading: status === "saving", children: "Save" })
230
+ ] })
231
+ ]
232
+ }
233
+ )
234
+ }
235
+ )
236
+ ]
237
+ }
238
+ )
239
+ }
240
+ );
241
+ });
242
+ var settings_panel_default = SettingsPanel;
243
+
244
+ export {
245
+ SettingsPanel,
246
+ settings_panel_default
247
+ };