asta-ui 0.9.2 → 0.9.4
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.
- package/css/asta.css +2 -2
- package/css/asta.js +248 -1
- package/css/components.css +722 -44
- package/css/runtime/core.css +5 -5
- package/css/runtime/data.css +2 -2
- package/css/runtime/modules.css +49 -0
- package/css/runtime/modules.js +245 -0
- package/css/runtime/overlays.css +22 -9
- package/css/src/blocks.css +3 -3
- package/css/src/core.css +8 -8
- package/css/src/data.css +3 -3
- package/css/src/display.css +6 -5
- package/css/src/forms.css +6 -6
- package/css/src/modules.css +616 -0
- package/css/src/overlays.css +3 -3
- package/css/tokens.css +6 -2
- package/dist/ai-chat.js +1 -1
- package/dist/avatar-group.js +2 -2
- package/dist/avatar.js +1 -1
- package/dist/base/ai-chat.js +1 -1
- package/dist/base/avatar-group.js +2 -2
- package/dist/base/avatar.js +1 -1
- package/dist/base/billing.d.ts +2 -0
- package/dist/base/billing.js +11 -0
- package/dist/base/bubble-wrap.js +1 -1
- package/dist/base/candlestick.js +1 -1
- package/dist/base/card-checkout.js +1 -1
- package/dist/base/chart-card.d.ts +2 -0
- package/dist/base/chart-card.js +11 -0
- package/dist/base/chat-thread.js +1 -1
- package/dist/base/checkbox.js +1 -1
- package/dist/base/checkout.js +3 -3
- package/dist/base/color-picker.js +1 -1
- package/dist/base/combo-lock.js +1 -1
- package/dist/base/combobox-aui-046.js +1 -1
- package/dist/base/combobox-aui-047.js +1 -1
- package/dist/base/combobox.js +1 -1
- package/dist/base/command-palette.js +1 -1
- package/dist/base/comments.js +2 -2
- package/dist/base/context-menu.js +1 -1
- package/dist/base/cookie-consent.d.ts +2 -0
- package/dist/base/cookie-consent.js +13 -0
- package/dist/base/countdown.d.ts +2 -0
- package/dist/base/countdown.js +9 -0
- package/dist/base/data-table.js +1 -1
- package/dist/base/dialog.js +1 -1
- package/dist/base/dropdown-menu.js +1 -1
- package/dist/base/field.js +1 -1
- package/dist/base/file-manager.d.ts +2 -0
- package/dist/base/file-manager.js +19 -0
- package/dist/base/flash-sale.d.ts +2 -0
- package/dist/base/flash-sale.js +7 -0
- package/dist/base/footer-aui-027.js +1 -1
- package/dist/base/footer-aui-028.js +1 -1
- package/dist/base/footer.js +1 -1
- package/dist/base/hover-card.js +1 -1
- package/dist/base/inbox.d.ts +2 -0
- package/dist/base/inbox.js +11 -0
- package/dist/base/inline-edit.js +1 -1
- package/dist/base/input-aui-029.js +1 -1
- package/dist/base/input-aui-030.js +1 -1
- package/dist/base/input-aui-031.js +1 -1
- package/dist/base/input-aui-032.js +1 -1
- package/dist/base/input-aui-033.js +1 -1
- package/dist/base/input-aui-034.js +1 -1
- package/dist/base/input.js +1 -1
- package/dist/base/invoice.d.ts +2 -0
- package/dist/base/invoice.js +10 -0
- package/dist/base/kanban.js +2 -2
- package/dist/base/menubar.d.ts +2 -0
- package/dist/base/menubar.js +9 -0
- package/dist/base/meter.d.ts +2 -0
- package/dist/base/meter.js +9 -0
- package/dist/base/morse-tap.js +1 -1
- package/dist/base/navbar-aui-009.js +1 -1
- package/dist/base/navbar-aui-011.js +1 -1
- package/dist/base/navbar-aui-012.js +1 -1
- package/dist/base/navbar-aui-013.js +1 -1
- package/dist/base/navbar.js +1 -1
- package/dist/base/notification-center.js +3 -3
- package/dist/base/number-input.js +1 -1
- package/dist/base/order-book.js +1 -1
- package/dist/base/otp-input-aui-041.js +1 -1
- package/dist/base/otp-input-aui-042.js +1 -1
- package/dist/base/otp-input.js +1 -1
- package/dist/base/password-input-aui-039.js +1 -1
- package/dist/base/password-input-aui-040.js +1 -1
- package/dist/base/password-input.js +1 -1
- package/dist/base/payment-received.js +1 -1
- package/dist/base/phone-input.d.ts +2 -0
- package/dist/base/phone-input.js +13 -0
- package/dist/base/popover.js +1 -1
- package/dist/base/price-alert.d.ts +2 -0
- package/dist/base/price-alert.js +7 -0
- package/dist/base/price-chart.js +1 -1
- package/dist/base/properties-panel.js +1 -1
- package/dist/base/radio-group.js +1 -1
- package/dist/base/select-aui-045.js +1 -1
- package/dist/base/select.js +1 -1
- package/dist/base/settings-panel.js +1 -1
- package/dist/base/shipment-tracker.js +1 -1
- package/dist/base/sidebar.js +2 -2
- package/dist/base/sign-in-aui-015.js +1 -1
- package/dist/base/sign-in-aui-016.js +1 -1
- package/dist/base/sign-in-aui-017.js +1 -1
- package/dist/base/sign-in-aui-018.js +1 -1
- package/dist/base/sign-in-aui-019.js +1 -1
- package/dist/base/sign-in-aui-020.js +1 -1
- package/dist/base/sign-in.js +1 -1
- package/dist/base/snap-grid.js +1 -1
- package/dist/base/sortable-list.d.ts +2 -0
- package/dist/base/sortable-list.js +9 -0
- package/dist/base/split-bill.d.ts +2 -0
- package/dist/base/split-bill.js +7 -0
- package/dist/base/stat-card.js +1 -1
- package/dist/base/tag-input-aui-048.js +1 -1
- package/dist/base/tag-input-aui-049.js +1 -1
- package/dist/base/tag-input.js +1 -1
- package/dist/base/team-members.js +3 -3
- package/dist/base/testimonials.d.ts +2 -0
- package/dist/base/testimonials.js +10 -0
- package/dist/base/textarea-aui-001.js +1 -1
- package/dist/base/textarea-aui-002.js +1 -1
- package/dist/base/textarea-aui-003.js +1 -1
- package/dist/base/textarea-aui-004.js +1 -1
- package/dist/base/textarea-aui-005.js +1 -1
- package/dist/base/textarea-aui-006.js +1 -1
- package/dist/base/textarea-aui-007.js +1 -1
- package/dist/base/textarea-aui-008.js +1 -1
- package/dist/base/textarea-aui-035.js +1 -1
- package/dist/base/textarea-aui-036.js +1 -1
- package/dist/base/textarea-aui-037.js +1 -1
- package/dist/base/textarea-aui-038.js +1 -1
- package/dist/base/textarea.js +1 -1
- package/dist/base/token-swap.js +1 -1
- package/dist/base/tooltip.js +1 -1
- package/dist/base/trade-ticket.js +1 -1
- package/dist/base/watchlist.d.ts +2 -0
- package/dist/base/watchlist.js +7 -0
- package/dist/base.js +166 -90
- package/dist/billing.d.ts +2 -0
- package/dist/billing.js +11 -0
- package/dist/bubble-wrap.js +1 -1
- package/dist/candlestick.js +1 -1
- package/dist/card-checkout.js +1 -1
- package/dist/chart-card.d.ts +2 -0
- package/dist/chart-card.js +11 -0
- package/dist/chat-thread.js +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/checkout.js +3 -3
- package/dist/{chunk-7TK42PS3.js → chunk-25RCKHWV.js} +19 -4
- package/dist/{chunk-4L4EKC46.js → chunk-2EBWWZPS.js} +1 -1
- package/dist/chunk-2F5CE6ZB.js +269 -0
- package/dist/{chunk-SATIWCJQ.js → chunk-2LM3VHNO.js} +3 -2
- package/dist/{chunk-5VQV2I7C.js → chunk-2PPF4GK5.js} +9 -6
- package/dist/{chunk-ZRGPSYW6.js → chunk-2PQIPQGO.js} +10 -6
- package/dist/{chunk-HB7DFNZP.js → chunk-3PQTSFOS.js} +1 -1
- package/dist/{chunk-VPZP6TCT.js → chunk-3UQIYJTI.js} +7 -3
- package/dist/{chunk-FY6BRODJ.js → chunk-3ZFF6VC5.js} +4 -2
- package/dist/{chunk-V3SPSN3A.js → chunk-45KDL3JM.js} +1 -1
- package/dist/{chunk-EVSTTLOT.js → chunk-4SLC3EK6.js} +18 -4
- package/dist/{chunk-VWYHP4SB.js → chunk-4WCMPLE3.js} +13 -4
- package/dist/chunk-5DLY6FGD.js +160 -0
- package/dist/{chunk-SRGDJSW7.js → chunk-5GGS6VP5.js} +1 -0
- package/dist/chunk-5N2G462S.js +338 -0
- package/dist/{chunk-FKHNK5VC.js → chunk-6C52ZQRB.js} +2 -1
- package/dist/{chunk-VVAL2JZJ.js → chunk-6MPEI6V5.js} +2 -2
- package/dist/{chunk-HNO6EUGJ.js → chunk-6RA7LJ3K.js} +7 -1
- package/dist/{chunk-RRHQBGRO.js → chunk-77RFV2MG.js} +7 -2
- package/dist/{chunk-RIWKIBEP.js → chunk-7MBTBYTJ.js} +3 -3
- package/dist/{chunk-XIU7K2YE.js → chunk-ADZI4ROA.js} +1 -1
- package/dist/{chunk-SAJ4D3Z2.js → chunk-AMVX4DDT.js} +7 -3
- package/dist/{chunk-7JNO265Q.js → chunk-B4XRAVHL.js} +33 -17
- package/dist/{chunk-MDI73RL6.js → chunk-B7MVYR7C.js} +7 -4
- package/dist/{chunk-OFPZUTBI.js → chunk-BEV2X4YL.js} +2 -1
- package/dist/chunk-BG2W2KVE.js +200 -0
- package/dist/chunk-BKHH2CJA.js +146 -0
- package/dist/{chunk-XRVVZA2Y.js → chunk-CACW5LH3.js} +1 -1
- package/dist/{chunk-I2WXKWTQ.js → chunk-CBJUY4WE.js} +10 -5
- package/dist/{chunk-746WX2DF.js → chunk-CSTI5CTF.js} +8 -2
- package/dist/{chunk-3KS5EN3Q.js → chunk-D2JJSUXI.js} +1 -1
- package/dist/chunk-D4AYULMF.js +338 -0
- package/dist/{chunk-4XM6DKEO.js → chunk-DD2TBHSJ.js} +2 -1
- package/dist/{chunk-B5OESWCR.js → chunk-DPLH3EGO.js} +1 -1
- package/dist/{chunk-5TSQZY34.js → chunk-DU3CZ3K7.js} +1 -1
- package/dist/{chunk-YON5SU2G.js → chunk-DWA62IYV.js} +5 -2
- package/dist/{chunk-FUNXYRSG.js → chunk-DWZT455C.js} +24 -9
- package/dist/{chunk-WSTQ6WZO.js → chunk-ECGJ6D5D.js} +3 -2
- package/dist/{chunk-3JNUC3FU.js → chunk-EN6XBXW5.js} +1 -1
- package/dist/{chunk-GJ3R6IZL.js → chunk-EOZDJA7Z.js} +1 -1
- package/dist/{chunk-KXWC2UHE.js → chunk-FBIGYEFN.js} +6 -3
- package/dist/{chunk-RS3XHHDE.js → chunk-FDE3S2YK.js} +1 -1
- package/dist/{chunk-DRX3KRNL.js → chunk-FFRJW5O7.js} +3 -2
- package/dist/{chunk-UEOEWP7L.js → chunk-FIPWA5KL.js} +3 -2
- package/dist/chunk-FLCT7THQ.js +75 -0
- package/dist/{chunk-RTAHGY6P.js → chunk-FOJRZASV.js} +7 -1
- package/dist/{chunk-CA7YQ5BJ.js → chunk-FQ4YUKAE.js} +3 -3
- package/dist/{chunk-33N6SZB5.js → chunk-FXXR3FM3.js} +6 -3
- package/dist/{chunk-BGVAXPHD.js → chunk-G7WTEBMX.js} +21 -6
- package/dist/{chunk-HPVPHWDM.js → chunk-IATF2OTU.js} +1 -1
- package/dist/{chunk-CLCP2GFW.js → chunk-IDXERBKL.js} +3 -3
- package/dist/{chunk-NB7X26PY.js → chunk-IF6CWIUB.js} +1 -1
- package/dist/{chunk-WVIV4JBH.js → chunk-ITGWD7ZY.js} +2 -2
- package/dist/{chunk-2LZM435Z.js → chunk-IVCHYE55.js} +7 -1
- package/dist/{chunk-BH2DLHFW.js → chunk-JE2MAZGR.js} +3 -2
- package/dist/{chunk-W57O4RLL.js → chunk-JF4BKHFK.js} +37 -9
- package/dist/{chunk-QDRBMWRX.js → chunk-JLCSRNI2.js} +7 -3
- package/dist/{chunk-7L4YE6HM.js → chunk-JNNMKFEQ.js} +1 -1
- package/dist/{chunk-GDTSCUHY.js → chunk-JRD6FENH.js} +1 -1
- package/dist/{chunk-F5I6EK7F.js → chunk-JSS4QASL.js} +1 -1
- package/dist/{chunk-B5F775GP.js → chunk-JWBGI7FN.js} +1 -1
- package/dist/{chunk-WTNNS7AX.js → chunk-JX7V6EFT.js} +36 -9
- package/dist/{chunk-7SNVRPED.js → chunk-KEMC4RIF.js} +2 -1
- package/dist/chunk-KVARQNGF.js +123 -0
- package/dist/chunk-LDTCIVDX.js +146 -0
- package/dist/{chunk-45VUWOHQ.js → chunk-LKRE4HLZ.js} +4 -2
- package/dist/{chunk-ZN3W5PAI.js → chunk-LOHFV5JF.js} +1 -1
- package/dist/chunk-LS6CFF6X.js +80 -0
- package/dist/{chunk-I5NZSWDW.js → chunk-MAKFUH34.js} +33 -17
- package/dist/{chunk-OQU6KGVR.js → chunk-MDB4RFMV.js} +1 -1
- package/dist/{chunk-FDHU3RWR.js → chunk-MJJU6OLM.js} +1 -1
- package/dist/{chunk-PIC5ZIR3.js → chunk-MPH64VG7.js} +1 -1
- package/dist/{chunk-AYSC7AIC.js → chunk-MVE7RJJ6.js} +1 -1
- package/dist/{chunk-2SQQFICY.js → chunk-N3X4T5OR.js} +25 -8
- package/dist/{chunk-CNY76NHF.js → chunk-NFJDL44V.js} +7 -3
- package/dist/{chunk-FJGGXXTT.js → chunk-NPVUFQGC.js} +1 -1
- package/dist/{chunk-QSLS3ENY.js → chunk-NVLYF4UL.js} +1 -1
- package/dist/chunk-O626XQW2.js +165 -0
- package/dist/chunk-OH5VAD27.js +224 -0
- package/dist/{chunk-TIAKMX7U.js → chunk-OIOZQP2H.js} +1 -1
- package/dist/{chunk-56BEMYK3.js → chunk-OU3EEX4Y.js} +1 -1
- package/dist/{chunk-6AZKJUL4.js → chunk-OUIOJROO.js} +1 -1
- package/dist/{chunk-OLNMOTAD.js → chunk-PAXDHYBX.js} +18 -4
- package/dist/chunk-PIE76JKF.js +224 -0
- package/dist/{chunk-6B6NTRMC.js → chunk-PIXHOFUT.js} +7 -2
- package/dist/{chunk-FATLQKRY.js → chunk-PZ2ZUHC3.js} +3 -3
- package/dist/chunk-Q5A5OTLI.js +192 -0
- package/dist/{chunk-TXRLBMFL.js → chunk-QASSYLQQ.js} +3 -2
- package/dist/{chunk-TCID6NNE.js → chunk-QJXVIEB5.js} +1 -1
- package/dist/{chunk-K5PWBSVO.js → chunk-QWOO4V7N.js} +2 -2
- package/dist/chunk-RGVRHFKY.js +213 -0
- package/dist/{chunk-J6GK2V2C.js → chunk-RQNXELUL.js} +2 -1
- package/dist/{chunk-KQCXQY5K.js → chunk-RXOVKEYG.js} +2 -1
- package/dist/{chunk-NICNFGHT.js → chunk-S2VTHA6G.js} +2 -2
- package/dist/chunk-SCQ6A4ZG.js +247 -0
- package/dist/{chunk-EVCUN45S.js → chunk-SMZVKQKM.js} +3 -2
- package/dist/{chunk-GERWW3CA.js → chunk-SR4NYQWO.js} +2 -2
- package/dist/{chunk-DQWKBQBT.js → chunk-TAAAYFBT.js} +2 -2
- package/dist/{chunk-S2DJLW6B.js → chunk-TBMUSER2.js} +1 -1
- package/dist/chunk-TMOEFAXQ.js +165 -0
- package/dist/chunk-TXC6CCSA.js +75 -0
- package/dist/chunk-UC55XR76.js +193 -0
- package/dist/{chunk-5U4H2CXC.js → chunk-UJYZZSII.js} +11 -4
- package/dist/chunk-UOOGRGEC.js +185 -0
- package/dist/{chunk-ZBF2UYXP.js → chunk-USDST2TI.js} +1 -1
- package/dist/{chunk-W7RITVDV.js → chunk-UX6CWJT7.js} +1 -1
- package/dist/{chunk-U7BYEW3Y.js → chunk-UZF7SCRT.js} +13 -5
- package/dist/{chunk-Q7OHWQP2.js → chunk-V7JUJQNR.js} +1 -0
- package/dist/{chunk-WWQV7LE7.js → chunk-VNUX5LOC.js} +24 -9
- package/dist/{chunk-CTO36MY2.js → chunk-VS3GQ4JR.js} +2 -2
- package/dist/{chunk-UMDVPRJW.js → chunk-VTTXURIB.js} +1 -1
- package/dist/{chunk-6NNHSXFD.js → chunk-W2S6JDBM.js} +1 -1
- package/dist/{chunk-3XMVXIOF.js → chunk-W5M3EHJL.js} +4 -2
- package/dist/chunk-X2VID7XY.js +228 -0
- package/dist/{chunk-H7D6G3GQ.js → chunk-X4JYOCFA.js} +7 -1
- package/dist/{chunk-6VQTFRSP.js → chunk-XKA3LTJZ.js} +37 -9
- package/dist/{chunk-7GKCX4IE.js → chunk-XUZH4Y52.js} +1 -1
- package/dist/{chunk-UAP47MSR.js → chunk-Y4JOW2UW.js} +11 -5
- package/dist/{chunk-T4SOPNM5.js → chunk-YCXZ3TYF.js} +1 -1
- package/dist/{chunk-2KJNBHUV.js → chunk-YF3XSH54.js} +2 -1
- package/dist/{chunk-66OZ7CBK.js → chunk-YJAZHJY3.js} +1 -1
- package/dist/{chunk-4WK3F76T.js → chunk-YLILJ2FH.js} +1 -1
- package/dist/{chunk-FGQPCDXI.js → chunk-YNPG4WOS.js} +1 -1
- package/dist/chunk-YPFZXGPT.js +160 -0
- package/dist/{chunk-KYFZ5TTK.js → chunk-YRPLUNP4.js} +3 -1
- package/dist/{chunk-P3USWDWR.js → chunk-YVGC7QT7.js} +4 -2
- package/dist/{chunk-4ZJEAWNG.js → chunk-Z2DF2YL5.js} +4 -2
- package/dist/{chunk-JAQANAOP.js → chunk-ZUH7XRX7.js} +19 -4
- package/dist/{chunk-UWQ26LYZ.js → chunk-ZYI6J34Q.js} +2 -2
- package/dist/{chunk-BOJCW7Z7.js → chunk-ZZ25XSK2.js} +3 -2
- package/dist/color-picker.js +1 -1
- package/dist/combo-lock.js +1 -1
- package/dist/combobox-aui-046.js +1 -1
- package/dist/combobox-aui-047.js +1 -1
- package/dist/combobox.js +1 -1
- package/dist/command-palette.js +1 -1
- package/dist/comments.js +2 -2
- package/dist/context-menu.js +1 -1
- package/dist/cookie-consent.d.ts +2 -0
- package/dist/cookie-consent.js +13 -0
- package/dist/countdown.d.ts +2 -0
- package/dist/countdown.js +9 -0
- package/dist/data-table.js +1 -1
- package/dist/dialog.js +1 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/field.js +1 -1
- package/dist/file-manager.d.ts +2 -0
- package/dist/file-manager.js +19 -0
- package/dist/flash-sale.d.ts +2 -0
- package/dist/flash-sale.js +7 -0
- package/dist/footer-aui-027.js +1 -1
- package/dist/footer-aui-028.js +1 -1
- package/dist/footer.js +1 -1
- package/dist/hover-card.js +1 -1
- package/dist/inbox.d.ts +2 -0
- package/dist/inbox.js +11 -0
- package/dist/index.js +166 -90
- package/dist/inline-edit.js +1 -1
- package/dist/input-aui-029.js +1 -1
- package/dist/input-aui-030.js +1 -1
- package/dist/input-aui-031.js +1 -1
- package/dist/input-aui-032.js +1 -1
- package/dist/input-aui-033.js +1 -1
- package/dist/input-aui-034.js +1 -1
- package/dist/input.js +1 -1
- package/dist/invoice.d.ts +2 -0
- package/dist/invoice.js +10 -0
- package/dist/kanban.js +2 -2
- package/dist/menubar.d.ts +2 -0
- package/dist/menubar.js +9 -0
- package/dist/meter.d.ts +2 -0
- package/dist/meter.js +9 -0
- package/dist/morse-tap.js +1 -1
- package/dist/navbar-aui-009.js +1 -1
- package/dist/navbar-aui-011.js +1 -1
- package/dist/navbar-aui-012.js +1 -1
- package/dist/navbar-aui-013.js +1 -1
- package/dist/navbar.js +1 -1
- package/dist/notification-center.js +3 -3
- package/dist/number-input.js +1 -1
- package/dist/order-book.js +1 -1
- package/dist/otp-input-aui-041.js +1 -1
- package/dist/otp-input-aui-042.js +1 -1
- package/dist/otp-input.js +1 -1
- package/dist/password-input-aui-039.js +1 -1
- package/dist/password-input-aui-040.js +1 -1
- package/dist/password-input.js +1 -1
- package/dist/payment-received.js +1 -1
- package/dist/phone-input.d.ts +2 -0
- package/dist/phone-input.js +13 -0
- package/dist/popover.js +1 -1
- package/dist/price-alert.d.ts +2 -0
- package/dist/price-alert.js +7 -0
- package/dist/price-chart.js +1 -1
- package/dist/properties-panel.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/select-aui-045.js +1 -1
- package/dist/select.js +1 -1
- package/dist/settings-panel.js +1 -1
- package/dist/shipment-tracker.js +1 -1
- package/dist/sidebar.js +2 -2
- package/dist/sign-in-aui-015.js +1 -1
- package/dist/sign-in-aui-016.js +1 -1
- package/dist/sign-in-aui-017.js +1 -1
- package/dist/sign-in-aui-018.js +1 -1
- package/dist/sign-in-aui-019.js +1 -1
- package/dist/sign-in-aui-020.js +1 -1
- package/dist/sign-in.js +1 -1
- package/dist/snap-grid.js +1 -1
- package/dist/sortable-list.d.ts +2 -0
- package/dist/sortable-list.js +9 -0
- package/dist/split-bill.d.ts +2 -0
- package/dist/split-bill.js +7 -0
- package/dist/stat-card.js +1 -1
- package/dist/styles.css +2 -2
- package/dist/tag-input-aui-048.js +1 -1
- package/dist/tag-input-aui-049.js +1 -1
- package/dist/tag-input.js +1 -1
- package/dist/team-members.js +3 -3
- package/dist/testimonials.d.ts +2 -0
- package/dist/testimonials.js +10 -0
- package/dist/textarea-aui-001.js +1 -1
- package/dist/textarea-aui-002.js +1 -1
- package/dist/textarea-aui-003.js +1 -1
- package/dist/textarea-aui-004.js +1 -1
- package/dist/textarea-aui-005.js +1 -1
- package/dist/textarea-aui-006.js +1 -1
- package/dist/textarea-aui-007.js +1 -1
- package/dist/textarea-aui-008.js +1 -1
- package/dist/textarea-aui-035.js +1 -1
- package/dist/textarea-aui-036.js +1 -1
- package/dist/textarea-aui-037.js +1 -1
- package/dist/textarea-aui-038.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/token-swap.js +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/trade-ticket.js +1 -1
- package/dist/types/components/kit/base/billing.d.ts +53 -0
- package/dist/types/components/kit/base/cookie-consent.d.ts +37 -0
- package/dist/types/components/kit/base/file-manager.d.ts +41 -0
- package/dist/types/components/kit/base/inbox.d.ts +33 -0
- package/dist/types/components/kit/base/invoice.d.ts +45 -0
- package/dist/types/components/kit/base/testimonials.d.ts +25 -0
- package/dist/types/components/kit/billing.d.ts +53 -0
- package/dist/types/components/kit/chart-card.d.ts +43 -0
- package/dist/types/components/kit/cookie-consent.d.ts +37 -0
- package/dist/types/components/kit/countdown.d.ts +21 -0
- package/dist/types/components/kit/file-manager.d.ts +41 -0
- package/dist/types/components/kit/inbox.d.ts +33 -0
- package/dist/types/components/kit/invoice.d.ts +45 -0
- package/dist/types/components/kit/menubar.d.ts +41 -0
- package/dist/types/components/kit/meter.d.ts +32 -0
- package/dist/types/components/kit/number-input.d.ts +3 -1
- package/dist/types/components/kit/phone-input.d.ts +42 -0
- package/dist/types/components/kit/sortable-list.d.ts +25 -0
- package/dist/types/components/kit/tag-input.d.ts +3 -1
- package/dist/types/components/kit/testimonials.d.ts +25 -0
- package/dist/types/components/lab/blocks/FlashSale.d.ts +2 -0
- package/dist/types/components/lab/blocks/PriceAlert.d.ts +2 -0
- package/dist/types/components/lab/blocks/SplitBill.d.ts +2 -0
- package/dist/types/components/lab/blocks/Watchlist.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/billing.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/chart-card.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/cookie-consent.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/countdown.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/file-manager.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/flash-sale.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/inbox.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/invoice.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/menubar.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/meter.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/phone-input.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/price-alert.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/sortable-list.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/split-bill.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/testimonials.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/watchlist.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base.d.ts +29 -1
- package/dist/types/packages/asta-ui/src/billing.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/chart-card.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/cookie-consent.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/countdown.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/file-manager.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/flash-sale.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/inbox.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/index.d.ts +29 -1
- package/dist/types/packages/asta-ui/src/invoice.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/menubar.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/meter.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/phone-input.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/price-alert.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/sortable-list.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/split-bill.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/testimonials.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/watchlist.d.ts +2 -0
- package/dist/watchlist.d.ts +2 -0
- package/dist/watchlist.js +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// components/lab/blocks/FlashSale.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 DIGITS = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
|
9
|
+
var STOCK = 500;
|
|
10
|
+
var START = 352;
|
|
11
|
+
var START_SECS = 4 * 60 + 12;
|
|
12
|
+
var BURSTS = [6, 11, 4, 15, 8, 19, 12, 23, 9, 17, 24];
|
|
13
|
+
function Roll({ value, instant }) {
|
|
14
|
+
const chars = value.split("");
|
|
15
|
+
return /* @__PURE__ */ jsx("span", { className: "inline-flex items-start leading-[1.1em] tabular-nums", "aria-label": value, children: chars.map((c, i) => {
|
|
16
|
+
const key = chars.length - i;
|
|
17
|
+
if (!/\d/.test(c))
|
|
18
|
+
return /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "inline-block h-[1.1em]", children: c }, `s${key}`);
|
|
19
|
+
return /* @__PURE__ */ jsxs("span", { "aria-hidden": true, className: "relative inline-block h-[1.1em] overflow-hidden leading-[1.1em]", children: [
|
|
20
|
+
/* @__PURE__ */ jsx("span", { className: "invisible", children: "0" }),
|
|
21
|
+
/* @__PURE__ */ jsx(
|
|
22
|
+
"span",
|
|
23
|
+
{
|
|
24
|
+
className: "absolute left-0 top-0 flex flex-col motion-reduce:transition-none",
|
|
25
|
+
style: { transform: `translateY(-${Number(c) * 1.1}em)`, transition: instant ? "none" : `transform .7s ${EASE} ${(chars.length - i) * 22}ms` },
|
|
26
|
+
children: DIGITS.map((d) => /* @__PURE__ */ jsx("span", { className: "block h-[1.1em]", children: d }, d))
|
|
27
|
+
}
|
|
28
|
+
)
|
|
29
|
+
] }, `d${key}`);
|
|
30
|
+
}) });
|
|
31
|
+
}
|
|
32
|
+
var clock = (s) => `${String(Math.floor(s / 60)).padStart(2, "0")}:${String(s % 60).padStart(2, "0")}`;
|
|
33
|
+
function FlashSale() {
|
|
34
|
+
const [beat, setBeat] = useState(0);
|
|
35
|
+
const [secs, setSecs] = useState(START_SECS);
|
|
36
|
+
const [fade, setFade] = useState(false);
|
|
37
|
+
const [instant, setInstant] = useState(false);
|
|
38
|
+
const [hover, setHover] = useState(false);
|
|
39
|
+
const [visible, setVisible] = useState(true);
|
|
40
|
+
const root = useRef(null);
|
|
41
|
+
const k = useRef(0);
|
|
42
|
+
const paused = hover || !visible;
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
const el = root.current;
|
|
45
|
+
if (!el) return;
|
|
46
|
+
let seen = true;
|
|
47
|
+
const sync = () => setVisible(seen && !document.hidden);
|
|
48
|
+
const io = new IntersectionObserver(([e]) => {
|
|
49
|
+
seen = e.isIntersecting;
|
|
50
|
+
sync();
|
|
51
|
+
});
|
|
52
|
+
io.observe(el);
|
|
53
|
+
document.addEventListener("visibilitychange", sync);
|
|
54
|
+
return () => {
|
|
55
|
+
io.disconnect();
|
|
56
|
+
document.removeEventListener("visibilitychange", sync);
|
|
57
|
+
};
|
|
58
|
+
}, []);
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
if (paused) return;
|
|
61
|
+
const t = [];
|
|
62
|
+
let alive = true;
|
|
63
|
+
const later = (ms, f) => t.push(setTimeout(() => alive && f(), ms));
|
|
64
|
+
const cycle = () => {
|
|
65
|
+
if (k.current > BURSTS.length) {
|
|
66
|
+
setFade(true);
|
|
67
|
+
later(450, () => {
|
|
68
|
+
k.current = 0;
|
|
69
|
+
setInstant(true);
|
|
70
|
+
setBeat(0);
|
|
71
|
+
setSecs(START_SECS);
|
|
72
|
+
});
|
|
73
|
+
later(560, () => setInstant(false));
|
|
74
|
+
later(620, () => setFade(false));
|
|
75
|
+
later(1500, cycle);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
setBeat(++k.current);
|
|
79
|
+
if (k.current <= BURSTS.length) setSecs((s) => s - 1);
|
|
80
|
+
later(k.current === BURSTS.length ? 2800 : 1e3, cycle);
|
|
81
|
+
};
|
|
82
|
+
later(900, cycle);
|
|
83
|
+
return () => {
|
|
84
|
+
alive = false;
|
|
85
|
+
t.forEach(clearTimeout);
|
|
86
|
+
setFade(false);
|
|
87
|
+
};
|
|
88
|
+
}, [paused]);
|
|
89
|
+
const claimed = START + BURSTS.slice(0, beat).reduce((a, b) => a + b, 0);
|
|
90
|
+
const left = STOCK - claimed;
|
|
91
|
+
const soldOut = left <= 0;
|
|
92
|
+
const toggle = () => setHover((h) => !h);
|
|
93
|
+
return /* @__PURE__ */ jsxs(
|
|
94
|
+
"div",
|
|
95
|
+
{
|
|
96
|
+
ref: root,
|
|
97
|
+
role: "group",
|
|
98
|
+
tabIndex: 0,
|
|
99
|
+
"aria-label": `Flash sale. ${soldOut ? "Sold out" : `${left} left, ends in ${clock(secs)}`}. ${hover ? "Paused" : "Live"}. Press space to ${hover ? "resume" : "pause"}`,
|
|
100
|
+
onPointerEnter: (e) => e.pointerType === "mouse" && setHover(true),
|
|
101
|
+
onPointerLeave: (e) => e.pointerType === "mouse" && setHover(false),
|
|
102
|
+
onPointerUp: (e) => e.pointerType !== "mouse" && toggle(),
|
|
103
|
+
onKeyDown: (e) => {
|
|
104
|
+
if (e.key === " " || e.key === "Enter") {
|
|
105
|
+
e.preventDefault();
|
|
106
|
+
toggle();
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
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",
|
|
110
|
+
style: { containerType: "size" },
|
|
111
|
+
children: [
|
|
112
|
+
/* @__PURE__ */ jsx("style", { href: "asta-flashsale", precedence: "asta", children: `
|
|
113
|
+
@keyframes lab-fs-pop { 0% { transform: scale(.6); opacity: 0 } 60% { transform: scale(1.08) } 100% { transform: none; opacity: 1 } }
|
|
114
|
+
@keyframes lab-fs-tick { from { opacity: .35 } to { opacity: 1 } }
|
|
115
|
+
.lab-fs-pop { animation: lab-fs-pop .5s ${EASE} both }
|
|
116
|
+
.lab-fs-tick { animation: lab-fs-tick .5s ${EASE} both }
|
|
117
|
+
@media (prefers-reduced-motion: reduce) { .lab-fs-pop, .lab-fs-tick { animation: none } }
|
|
118
|
+
` }),
|
|
119
|
+
/* @__PURE__ */ jsxs(
|
|
120
|
+
"div",
|
|
121
|
+
{
|
|
122
|
+
className: `flex w-full max-w-[500px] items-stretch gap-[clamp(10px,4cqw,18px)] rounded-[14px] bg-paper p-[clamp(10px,3.4cqmin,14px)] ${RING} shadow-[0_18px_40px_-28px_rgb(0_0_0/0.35)]`,
|
|
123
|
+
style: { opacity: fade ? 0 : 1, transition: `opacity .45s ${EASE}` },
|
|
124
|
+
children: [
|
|
125
|
+
/* @__PURE__ */ jsxs("div", { className: "relative w-[40%] shrink-0 overflow-hidden rounded-[10px] bg-paper-2", children: [
|
|
126
|
+
/* @__PURE__ */ jsx("img", { src: "/lab/headphones.jpg", alt: "Studio headphones", width: 600, height: 600, loading: "lazy", decoding: "async", className: "absolute inset-0 h-full w-full object-cover" }),
|
|
127
|
+
/* @__PURE__ */ jsx("span", { className: "absolute left-2 top-2 rounded-md bg-ink px-1.5 py-0.5 text-[10.5px] font-medium text-paper", children: "\u221235%" }),
|
|
128
|
+
/* @__PURE__ */ jsx(
|
|
129
|
+
"span",
|
|
130
|
+
{
|
|
131
|
+
"aria-hidden": true,
|
|
132
|
+
className: "absolute inset-0 grid place-items-center bg-paper/70",
|
|
133
|
+
style: { opacity: soldOut ? 1 : 0, transition: `opacity .5s ${EASE}` },
|
|
134
|
+
children: soldOut && /* @__PURE__ */ jsx("span", { className: "lab-fs-pop rounded-md bg-ink px-2.5 py-1 text-[12px] font-medium text-paper", children: "Sold out" })
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
] }),
|
|
138
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-[max(6px,2.2cqh)] py-0.5", children: [
|
|
139
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
140
|
+
/* @__PURE__ */ jsx("span", { className: "font-mono text-[10.5px] uppercase tracking-wider text-brand", children: "Flash sale" }),
|
|
141
|
+
/* @__PURE__ */ jsxs("span", { className: `flex items-center gap-1 rounded-md px-1.5 py-0.5 font-mono text-[11px] tabular-nums ${soldOut ? "bg-paper-2 text-mute" : "bg-ink text-paper"}`, children: [
|
|
142
|
+
/* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", className: "h-3 w-3", fill: "none", stroke: "currentColor", strokeWidth: "1.7", strokeLinecap: "round", "aria-hidden": true, children: [
|
|
143
|
+
/* @__PURE__ */ jsx("circle", { cx: "8", cy: "8.5", r: "5.5" }),
|
|
144
|
+
/* @__PURE__ */ jsx("path", { d: "M8 5.5v3l2 1.2M6.5 1.5h3" })
|
|
145
|
+
] }),
|
|
146
|
+
/* @__PURE__ */ jsx("span", { className: instant ? "" : "lab-fs-tick", children: soldOut ? "Ended" : clock(secs) }, secs)
|
|
147
|
+
] })
|
|
148
|
+
] }),
|
|
149
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
150
|
+
/* @__PURE__ */ jsx("p", { className: "line-clamp-2 text-[14px] font-medium leading-tight tracking-[-0.01em] text-ink", children: "Astabyte Studio Headphones" }),
|
|
151
|
+
/* @__PURE__ */ jsx("p", { className: "truncate text-[11.5px] text-mute", children: "Wireless \xB7 40 h battery \xB7 Graphite" })
|
|
152
|
+
] }),
|
|
153
|
+
/* @__PURE__ */ jsxs("p", { className: "flex items-baseline gap-2", children: [
|
|
154
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium tracking-[-0.03em] text-ink", style: { fontSize: "clamp(20px, 7cqmin, 28px)", lineHeight: 1 }, children: "$129" }),
|
|
155
|
+
/* @__PURE__ */ jsx("span", { className: "text-[12.5px] text-mute line-through", children: "$199" })
|
|
156
|
+
] }),
|
|
157
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-auto flex flex-col gap-1.5", children: [
|
|
158
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-baseline justify-between gap-2 text-[11.5px]", children: [
|
|
159
|
+
/* @__PURE__ */ jsxs("span", { className: "text-ink", children: [
|
|
160
|
+
/* @__PURE__ */ jsx(Roll, { value: String(claimed), instant }),
|
|
161
|
+
" ",
|
|
162
|
+
/* @__PURE__ */ jsx("span", { className: "text-mute", children: "claimed" })
|
|
163
|
+
] }),
|
|
164
|
+
/* @__PURE__ */ jsx("span", { className: soldOut ? "text-mute" : left <= 60 ? "font-medium text-ink" : "text-mute", children: soldOut ? "None left" : `Only ${left} left` })
|
|
165
|
+
] }),
|
|
166
|
+
/* @__PURE__ */ jsx("div", { className: "h-1.5 overflow-hidden rounded-full bg-paper-2", role: "meter", "aria-label": "Stock left", "aria-valuemin": 0, "aria-valuemax": STOCK, "aria-valuenow": left, children: /* @__PURE__ */ jsx(
|
|
167
|
+
"div",
|
|
168
|
+
{
|
|
169
|
+
className: "h-full origin-left rounded-full bg-brand",
|
|
170
|
+
style: { transform: `scaleX(${Math.max(0, left / STOCK)})`, transition: instant ? "none" : `transform .8s ${EASE}` }
|
|
171
|
+
}
|
|
172
|
+
) }),
|
|
173
|
+
/* @__PURE__ */ jsx(
|
|
174
|
+
"div",
|
|
175
|
+
{
|
|
176
|
+
className: `mt-1 flex h-[clamp(30px,10cqh,36px)] items-center justify-center rounded-[9px] text-[12.5px] font-medium ${soldOut ? `bg-paper text-ink ${RING}` : "bg-ink text-paper"}`,
|
|
177
|
+
style: { transition: `background-color .4s ${EASE}, color .4s ${EASE}` },
|
|
178
|
+
children: /* @__PURE__ */ jsx("span", { className: instant ? "" : "lab-fs-pop", children: soldOut ? "Join the waitlist" : "Buy now" }, soldOut ? "w" : "b")
|
|
179
|
+
}
|
|
180
|
+
)
|
|
181
|
+
] })
|
|
182
|
+
] })
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
)
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export {
|
|
192
|
+
FlashSale
|
|
193
|
+
};
|
|
@@ -25,7 +25,7 @@ var validEmail = (v) => /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(v.trim());
|
|
|
25
25
|
var wait = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
26
26
|
var Spinner = () => /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "h-4 w-4 animate-spin rounded-full border-2 border-current border-r-transparent" });
|
|
27
27
|
var Arrow = () => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "h-3.5 w-3.5 transition-transform duration-300 group-hover:translate-x-0.5", style: { transitionTimingFunction: EASE }, fill: "none", stroke: "currentColor", strokeWidth: "1.7", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M3 8h10M9 4l4 4-4 4" }) });
|
|
28
|
-
function Field({ label, type, value, onChange, error, shake, autoComplete, placeholder, inputRef, onKeyUp, hint, end }) {
|
|
28
|
+
function Field({ label, name, type, inputMode, value, onChange, error, shake, autoComplete, placeholder, inputRef, onKeyUp, hint, end }) {
|
|
29
29
|
const id = useId();
|
|
30
30
|
const box = useRef(null);
|
|
31
31
|
const hasError = !!error;
|
|
@@ -47,16 +47,20 @@ function Field({ label, type, value, onChange, error, shake, autoComplete, place
|
|
|
47
47
|
{
|
|
48
48
|
ref: inputRef,
|
|
49
49
|
id,
|
|
50
|
+
name,
|
|
50
51
|
type,
|
|
52
|
+
inputMode,
|
|
51
53
|
value,
|
|
52
54
|
autoComplete,
|
|
55
|
+
autoCapitalize: "none",
|
|
56
|
+
spellCheck: false,
|
|
53
57
|
placeholder,
|
|
54
58
|
onChange: (e) => onChange(e.target.value),
|
|
55
59
|
onKeyUp,
|
|
56
60
|
"aria-invalid": hasError || void 0,
|
|
57
61
|
"aria-describedby": hasError ? `${id}-err` : void 0,
|
|
58
62
|
className: cx(
|
|
59
|
-
"h-11 w-full rounded-[9px] bg-paper px-3.5 text-[14.5px] text-ink outline-none transition-shadow duration-200 placeholder:text-mute focus-visible:shadow-[inset_0_0_0_1px_var(--brand),0_0_0_4px_color-mix(in_srgb,var(--brand)_14%,transparent)]",
|
|
63
|
+
"h-11 w-full rounded-[9px] bg-paper px-3.5 text-[16px] sm:text-[14.5px] text-ink outline-none transition-shadow duration-200 placeholder:text-mute focus-visible:shadow-[inset_0_0_0_1px_var(--brand),0_0_0_4px_color-mix(in_srgb,var(--brand)_14%,transparent)]",
|
|
60
64
|
!!end && "pr-11",
|
|
61
65
|
hasError ? "shadow-[inset_0_0_0_1.5px_var(--ink)]" : RING
|
|
62
66
|
)
|
|
@@ -110,7 +114,7 @@ function StepSignIn({ brand = "Astabyte", title = "Sign in to Astabyte", subtitl
|
|
|
110
114
|
const next = async (e) => {
|
|
111
115
|
e.preventDefault();
|
|
112
116
|
if (pending) return;
|
|
113
|
-
const msg = !email.trim() ? "Enter your email." : !validEmail(email) ? "
|
|
117
|
+
const msg = !email.trim() ? "Enter your email." : !validEmail(email) ? "Enter an email like name@company.com." : "";
|
|
114
118
|
if (msg) return fail("email", msg);
|
|
115
119
|
setPending(true);
|
|
116
120
|
try {
|
|
@@ -188,7 +192,9 @@ function StepSignIn({ brand = "Astabyte", title = "Sign in to Astabyte", subtitl
|
|
|
188
192
|
Field,
|
|
189
193
|
{
|
|
190
194
|
label: "Work email",
|
|
195
|
+
name: "email",
|
|
191
196
|
type: "email",
|
|
197
|
+
inputMode: "email",
|
|
192
198
|
autoComplete: "username",
|
|
193
199
|
placeholder: "you@company.com",
|
|
194
200
|
value: email,
|
|
@@ -252,9 +258,10 @@ function StepSignIn({ brand = "Astabyte", title = "Sign in to Astabyte", subtitl
|
|
|
252
258
|
Field,
|
|
253
259
|
{
|
|
254
260
|
label: "Password",
|
|
261
|
+
name: "password",
|
|
255
262
|
type: reveal ? "text" : "password",
|
|
256
263
|
autoComplete: "current-password",
|
|
257
|
-
placeholder: "At least 8 characters",
|
|
264
|
+
placeholder: "At least 8 characters\u2026",
|
|
258
265
|
value: password,
|
|
259
266
|
onChange: (v) => {
|
|
260
267
|
setPassword(v);
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// components/lab/blocks/Watchlist.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 START = [
|
|
9
|
+
{ sym: "ASTA", name: "Astabyte Inc.", price: 186.42, open: 182.1 },
|
|
10
|
+
{ sym: "TIDE", name: "Tidewater Energy", price: 311.2, open: 309.85 },
|
|
11
|
+
{ sym: "NRTH", name: "Northpeak Labs", price: 64.12, open: 64.4 },
|
|
12
|
+
{ sym: "JNPR", name: "Juniper Goods", price: 23.85, open: 24.31 },
|
|
13
|
+
{ sym: "OAKL", name: "Oakline Freight", price: 9.47, open: 9.81 }
|
|
14
|
+
].map((r, i) => ({ ...r, hist: Array.from({ length: 18 }, (_, k) => r.open + (r.price - r.open) * (k / 17) + Math.sin(k * 1.3 + i) * r.open * 4e-3) }));
|
|
15
|
+
var pct = (r) => (r.price - r.open) / r.open * 100;
|
|
16
|
+
var ranks = (rs) => new Map([...rs].sort((a, b) => pct(b) - pct(a)).map((r, i) => [r.sym, i]));
|
|
17
|
+
var money = (n) => n.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
|
18
|
+
var MOVES = [
|
|
19
|
+
["NRTH", 0.012],
|
|
20
|
+
["OAKL", 0.02],
|
|
21
|
+
["ASTA", -6e-3],
|
|
22
|
+
["NRTH", 0.014],
|
|
23
|
+
["JNPR", 0.018],
|
|
24
|
+
["TIDE", 9e-3],
|
|
25
|
+
["OAKL", 0.03],
|
|
26
|
+
["ASTA", -0.012],
|
|
27
|
+
["JNPR", 0.016],
|
|
28
|
+
["NRTH", -0.01],
|
|
29
|
+
["TIDE", 0.011],
|
|
30
|
+
["OAKL", -0.028],
|
|
31
|
+
["ASTA", 0.018],
|
|
32
|
+
["JNPR", -0.034],
|
|
33
|
+
["NRTH", -0.016],
|
|
34
|
+
["OAKL", -0.022],
|
|
35
|
+
["TIDE", -0.02]
|
|
36
|
+
];
|
|
37
|
+
function Spark({ data, up }) {
|
|
38
|
+
const lo = Math.min(...data);
|
|
39
|
+
const hi = Math.max(...data);
|
|
40
|
+
const W = 64;
|
|
41
|
+
const H = 22;
|
|
42
|
+
const d = data.map((v, i) => `${i ? "L" : "M"}${(i / (data.length - 1) * W).toFixed(1)} ${(H - 2 - (v - lo) / (hi - lo || 1) * (H - 4)).toFixed(1)}`).join(" ");
|
|
43
|
+
return /* @__PURE__ */ jsx("svg", { viewBox: `0 0 ${W} ${H}`, className: "h-[22px] w-[clamp(40px,16cqw,64px)] shrink-0", fill: "none", "aria-hidden": true, preserveAspectRatio: "none", children: /* @__PURE__ */ jsx("path", { d, stroke: up ? "var(--brand)" : "var(--mute)", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke", style: { transition: `stroke .4s ${EASE}` } }) });
|
|
44
|
+
}
|
|
45
|
+
function Watchlist() {
|
|
46
|
+
const [rows, setRows] = useState(START);
|
|
47
|
+
const [flash, setFlash] = useState(null);
|
|
48
|
+
const [hover, setHover] = useState(false);
|
|
49
|
+
const [visible, setVisible] = useState(true);
|
|
50
|
+
const root = useRef(null);
|
|
51
|
+
const step = useRef(0);
|
|
52
|
+
const live = useRef(START);
|
|
53
|
+
const [lift, setLift] = useState({});
|
|
54
|
+
const paused = hover || !visible;
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
const el = root.current;
|
|
57
|
+
if (!el) return;
|
|
58
|
+
let seen = true;
|
|
59
|
+
const sync = () => setVisible(seen && !document.hidden);
|
|
60
|
+
const io = new IntersectionObserver(([e]) => {
|
|
61
|
+
seen = e.isIntersecting;
|
|
62
|
+
sync();
|
|
63
|
+
});
|
|
64
|
+
io.observe(el);
|
|
65
|
+
document.addEventListener("visibilitychange", sync);
|
|
66
|
+
return () => {
|
|
67
|
+
io.disconnect();
|
|
68
|
+
document.removeEventListener("visibilitychange", sync);
|
|
69
|
+
};
|
|
70
|
+
}, []);
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
if (paused) return;
|
|
73
|
+
let alive = true;
|
|
74
|
+
let t;
|
|
75
|
+
const tick = () => {
|
|
76
|
+
if (!alive) return;
|
|
77
|
+
const [sym, m] = MOVES[step.current++ % MOVES.length];
|
|
78
|
+
const before = ranks(live.current);
|
|
79
|
+
const next = live.current.map((r) => {
|
|
80
|
+
if (r.sym !== sym) return r;
|
|
81
|
+
const price = Math.round(r.price * (1 + m) * 100) / 100;
|
|
82
|
+
return { ...r, price, hist: [...r.hist.slice(1), price] };
|
|
83
|
+
});
|
|
84
|
+
const after = ranks(next);
|
|
85
|
+
live.current = next;
|
|
86
|
+
setRows(next);
|
|
87
|
+
setLift(Object.fromEntries(next.map((r) => [r.sym, Math.sign(before.get(r.sym) - after.get(r.sym))])));
|
|
88
|
+
setFlash((f) => ({ sym, up: m > 0, n: (f?.n ?? 0) + 1 }));
|
|
89
|
+
t = setTimeout(tick, 1500);
|
|
90
|
+
};
|
|
91
|
+
t = setTimeout(tick, 700);
|
|
92
|
+
return () => {
|
|
93
|
+
alive = false;
|
|
94
|
+
clearTimeout(t);
|
|
95
|
+
};
|
|
96
|
+
}, [paused]);
|
|
97
|
+
const rank = ranks(rows);
|
|
98
|
+
const best = rows.find((r) => rank.get(r.sym) === 0);
|
|
99
|
+
return /* @__PURE__ */ jsxs(
|
|
100
|
+
"div",
|
|
101
|
+
{
|
|
102
|
+
ref: root,
|
|
103
|
+
role: "group",
|
|
104
|
+
tabIndex: 0,
|
|
105
|
+
"aria-label": `Watchlist, top movers. ${best.sym} leads at ${pct(best).toFixed(2)}%. ${hover ? "Paused" : "Live"}. Press space to ${hover ? "resume" : "pause"}`,
|
|
106
|
+
onPointerEnter: (e) => e.pointerType === "mouse" && setHover(true),
|
|
107
|
+
onPointerLeave: (e) => e.pointerType === "mouse" && setHover(false),
|
|
108
|
+
onPointerUp: (e) => e.pointerType !== "mouse" && setHover((h) => !h),
|
|
109
|
+
onKeyDown: (e) => {
|
|
110
|
+
if (e.key === " " || e.key === "Enter") {
|
|
111
|
+
e.preventDefault();
|
|
112
|
+
setHover((h) => !h);
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
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",
|
|
116
|
+
style: { containerType: "size" },
|
|
117
|
+
children: [
|
|
118
|
+
/* @__PURE__ */ jsx("style", { href: "asta-watchlist", precedence: "asta", children: `
|
|
119
|
+
@keyframes lab-wl-up { 0% { opacity: 1 } 100% { opacity: 0 } }
|
|
120
|
+
@keyframes lab-wl-live { from { transform: scale(1); opacity: .6 } to { transform: scale(2.6); opacity: 0 } }
|
|
121
|
+
.lab-wl-flash { animation: lab-wl-up 1.1s ${EASE} both }
|
|
122
|
+
.lab-wl-live { animation: lab-wl-live 1.6s ${EASE} infinite }
|
|
123
|
+
@media (prefers-reduced-motion: reduce) { .lab-wl-flash, .lab-wl-live { animation: none; opacity: 0 } .lab-wl-row { transition: none !important } }
|
|
124
|
+
` }),
|
|
125
|
+
/* @__PURE__ */ jsxs("div", { className: `flex w-full max-w-[480px] flex-col gap-[max(8px,2.6cqh)] rounded-[14px] bg-paper p-[clamp(10px,3.6cqmin,16px)] ${RING} shadow-[0_18px_40px_-28px_rgb(0_0_0/0.35)]`, children: [
|
|
126
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3 px-1", children: [
|
|
127
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
128
|
+
/* @__PURE__ */ jsx("p", { className: "text-[13.5px] font-medium tracking-[-0.01em] text-ink", children: "Watchlist" }),
|
|
129
|
+
/* @__PURE__ */ jsx("p", { className: "truncate text-[11.5px] text-mute", children: "Sorted by today\u2019s change" })
|
|
130
|
+
] }),
|
|
131
|
+
/* @__PURE__ */ jsxs("span", { className: "flex shrink-0 items-center gap-1.5 rounded-md bg-paper-2 px-2 py-1 text-[11px] text-mute", children: [
|
|
132
|
+
/* @__PURE__ */ jsxs("span", { className: "relative inline-flex h-1.5 w-1.5", children: [
|
|
133
|
+
!paused && /* @__PURE__ */ jsx("span", { className: "lab-wl-live absolute inset-0 rounded-full bg-brand" }),
|
|
134
|
+
/* @__PURE__ */ jsx("span", { className: `relative h-1.5 w-1.5 rounded-full ${paused ? "bg-mute" : "bg-brand"}` })
|
|
135
|
+
] }),
|
|
136
|
+
hover ? "Paused" : "Live"
|
|
137
|
+
] })
|
|
138
|
+
] }),
|
|
139
|
+
/* @__PURE__ */ jsx("ol", { className: "relative", style: { height: `calc(${rows.length} * clamp(34px, 13cqh, 48px))` }, "aria-label": "Top movers", children: rows.map((r) => {
|
|
140
|
+
const p = pct(r);
|
|
141
|
+
const up = p >= 0;
|
|
142
|
+
const i = rank.get(r.sym);
|
|
143
|
+
const hot = flash?.sym === r.sym;
|
|
144
|
+
return /* @__PURE__ */ jsxs(
|
|
145
|
+
"li",
|
|
146
|
+
{
|
|
147
|
+
className: "lab-wl-row absolute inset-x-0 top-0 flex h-[clamp(34px,13cqh,48px)] items-center gap-3 bg-paper px-1",
|
|
148
|
+
style: { transform: `translateY(${i * 100}%)`, transition: `transform .7s ${EASE}`, zIndex: 2 + (lift[r.sym] ?? 0) },
|
|
149
|
+
children: [
|
|
150
|
+
/* @__PURE__ */ jsx("span", { className: "w-4 shrink-0 text-right font-mono text-[10.5px] tabular-nums text-mute", children: i + 1 }),
|
|
151
|
+
/* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1 leading-tight", children: [
|
|
152
|
+
/* @__PURE__ */ jsx("span", { className: "block text-[12.5px] font-semibold tracking-[0.01em] text-ink", children: r.sym }),
|
|
153
|
+
/* @__PURE__ */ jsx("span", { className: "block truncate text-[11px] text-mute", children: r.name })
|
|
154
|
+
] }),
|
|
155
|
+
/* @__PURE__ */ jsx(Spark, { data: r.hist, up }),
|
|
156
|
+
/* @__PURE__ */ jsxs("span", { className: "relative w-[72px] shrink-0 rounded-md px-1.5 py-0.5 text-right text-[12.5px] tabular-nums text-ink", children: [
|
|
157
|
+
hot && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: `lab-wl-flash absolute inset-0 rounded-md ${flash.up ? "bg-brand/15" : "bg-[color-mix(in_srgb,var(--ink)_9%,transparent)]"}` }, flash.n),
|
|
158
|
+
/* @__PURE__ */ jsx("span", { className: "relative", children: money(r.price) })
|
|
159
|
+
] }),
|
|
160
|
+
/* @__PURE__ */ jsxs(
|
|
161
|
+
"span",
|
|
162
|
+
{
|
|
163
|
+
className: `w-[62px] shrink-0 rounded-md py-1 text-center text-[11.5px] font-medium tabular-nums ${up ? "bg-brand text-paper" : "bg-paper-2 text-ink-2"}`,
|
|
164
|
+
style: { transition: `background-color .4s ${EASE}, color .4s ${EASE}` },
|
|
165
|
+
children: [
|
|
166
|
+
up ? "+" : "\u2212",
|
|
167
|
+
Math.abs(p).toFixed(2),
|
|
168
|
+
"%"
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
)
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
r.sym
|
|
175
|
+
);
|
|
176
|
+
}) })
|
|
177
|
+
] })
|
|
178
|
+
]
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export {
|
|
184
|
+
Watchlist
|
|
185
|
+
};
|
|
@@ -185,7 +185,7 @@ function AmountInput({
|
|
|
185
185
|
el.setSelectionRange(el.value.length, el.value.length);
|
|
186
186
|
},
|
|
187
187
|
onBlur: () => setFocused(false),
|
|
188
|
-
className: "absolute inset-0 h-full w-full cursor-text opacity-0"
|
|
188
|
+
className: "absolute inset-0 h-full w-full cursor-text text-[16px] opacity-0"
|
|
189
189
|
}
|
|
190
190
|
)
|
|
191
191
|
] }),
|
|
@@ -148,7 +148,7 @@ function NotesTextarea({
|
|
|
148
148
|
}
|
|
149
149
|
},
|
|
150
150
|
spellCheck: true,
|
|
151
|
-
className: "block w-full resize-none bg-transparent pb-2 pl-[52px] pr-5 text-[14.5px] text-ink outline-none placeholder:text-mute",
|
|
151
|
+
className: "block w-full resize-none bg-transparent pb-2 pl-[52px] pr-5 text-[16px] sm:text-[14.5px] text-ink outline-none placeholder:text-mute",
|
|
152
152
|
style: {
|
|
153
153
|
lineHeight: `${LINE}px`,
|
|
154
154
|
paddingTop: 2,
|
|
@@ -5,9 +5,9 @@ import { useRef, useState } from "react";
|
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
var cx = (...c) => c.filter(Boolean).join(" ");
|
|
7
7
|
var SIZE = {
|
|
8
|
-
sm: "h-8 rounded-md px-2.5 text-[13px] gap-2",
|
|
9
|
-
md: "h-10 rounded-lg px-3 text-[14px] gap-2.5",
|
|
10
|
-
lg: "h-12 rounded-[9px] px-4 text-[15px] gap-3"
|
|
8
|
+
sm: "h-8 rounded-md px-2.5 text-[16px] sm:text-[13px] gap-2",
|
|
9
|
+
md: "h-10 rounded-lg px-3 text-[16px] sm:text-[14px] gap-2.5",
|
|
10
|
+
lg: "h-12 rounded-[9px] px-4 text-[16px] sm:text-[15px] gap-3"
|
|
11
11
|
};
|
|
12
12
|
var RING = {
|
|
13
13
|
default: "shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_14%,transparent)] hover:shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_24%,transparent)] focus-within:!shadow-[inset_0_0_0_1px_var(--brand),0_0_0_4px_color-mix(in_srgb,var(--brand)_16%,transparent)]",
|
|
@@ -57,7 +57,7 @@ function Input({ size = "md", state = "default", iconLeft, iconRight, clearable,
|
|
|
57
57
|
if (!controlled) setInner(e.target.value);
|
|
58
58
|
rest.onChange?.(e);
|
|
59
59
|
},
|
|
60
|
-
className: cx("h-full min-w-0 flex-1 bg-transparent outline-none placeholder:text-mute", inputClassName)
|
|
60
|
+
className: cx("h-full min-w-0 flex-1 bg-transparent outline-none placeholder:text-mute [&::-webkit-search-cancel-button]:hidden", inputClassName)
|
|
61
61
|
}
|
|
62
62
|
),
|
|
63
63
|
clearable && /* @__PURE__ */ jsx(
|
|
@@ -85,6 +85,10 @@ function PasswordInput(props) {
|
|
|
85
85
|
return /* @__PURE__ */ jsx(
|
|
86
86
|
Input,
|
|
87
87
|
{
|
|
88
|
+
name: "password",
|
|
89
|
+
autoComplete: "current-password",
|
|
90
|
+
autoCapitalize: "none",
|
|
91
|
+
spellCheck: false,
|
|
88
92
|
...props,
|
|
89
93
|
type: show ? "text" : "password",
|
|
90
94
|
inputClassName: cx(!show && "tracking-[0.12em]", props.inputClassName),
|
|
@@ -98,7 +102,11 @@ function PasswordInput(props) {
|
|
|
98
102
|
className: "-mr-1 grid h-7 w-7 place-items-center rounded-lg text-mute outline-none transition-colors hover:bg-paper-2 hover:text-ink focus-visible:ring-2 focus-visible:ring-brand/50",
|
|
99
103
|
children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", className: "!h-4 !w-4", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
100
104
|
/* @__PURE__ */ jsx("path", { d: "M1.5 8S4 3.5 8 3.5 14.5 8 14.5 8 12 12.5 8 12.5 1.5 8 1.5 8Z" }),
|
|
101
|
-
/* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "2", className: cx(
|
|
105
|
+
/* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "2", className: cx(
|
|
106
|
+
"origin-center transition-transform duration-300",
|
|
107
|
+
show ? "scale-100" : "scale-0"
|
|
108
|
+
/* perf-ok: eye pupil */
|
|
109
|
+
) }),
|
|
102
110
|
/* @__PURE__ */ jsx("path", { d: "M2.5 13.5l11-11", pathLength: 1, strokeDasharray: "1", className: "transition-[stroke-dashoffset] duration-300 ease-[cubic-bezier(.16,1,.3,1)]", style: { strokeDashoffset: show ? 1 : 0 } })
|
|
103
111
|
] })
|
|
104
112
|
}
|
|
@@ -93,6 +93,7 @@ function Dot({ on }) {
|
|
|
93
93
|
className: cx(
|
|
94
94
|
"h-1.5 w-1.5 rounded-full bg-white transition-transform duration-300 ease-[cubic-bezier(.34,1.8,.64,1)] motion-reduce:transition-none",
|
|
95
95
|
on ? "scale-100" : "scale-0"
|
|
96
|
+
// perf-ok: 6px radio dot, not a surface
|
|
96
97
|
)
|
|
97
98
|
}
|
|
98
99
|
)
|
|
@@ -22,7 +22,7 @@ var GitHubGlyph = () => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", "aria
|
|
|
22
22
|
d: "M8 .5a7.5 7.5 0 0 0-2.4 14.6c.4.1.5-.2.5-.4v-1.4c-2.1.5-2.5-.9-2.5-.9-.4-.9-.9-1.1-.9-1.1-.7-.5 0-.5 0-.5.8.1 1.2.8 1.2.8.7 1.2 1.8.8 2.2.6.1-.5.3-.8.5-1-1.7-.2-3.4-.8-3.4-3.7 0-.8.3-1.5.8-2-.1-.2-.3-1 .1-2 0 0 .6-.2 2.1.8a7 7 0 0 1 3.8 0c1.4-1 2.1-.8 2.1-.8.4 1 .2 1.8.1 2 .5.5.8 1.2.8 2 0 2.9-1.8 3.5-3.4 3.7.3.2.5.7.5 1.4v2.1c0 .2.1.5.5.4A7.5 7.5 0 0 0 8 .5Z"
|
|
23
23
|
}
|
|
24
24
|
) });
|
|
25
|
-
function Field({ label, type, value, onChange, onBlur, error, shake, autoComplete, placeholder, end }) {
|
|
25
|
+
function Field({ label, type, value, onChange, onBlur, error, shake, name, autoComplete, inputMode, placeholder, end }) {
|
|
26
26
|
const id = useId();
|
|
27
27
|
const box = useRef(null);
|
|
28
28
|
const hasError = !!error;
|
|
@@ -40,16 +40,20 @@ function Field({ label, type, value, onChange, onBlur, error, shake, autoComplet
|
|
|
40
40
|
"input",
|
|
41
41
|
{
|
|
42
42
|
id,
|
|
43
|
+
name,
|
|
43
44
|
type,
|
|
44
45
|
value,
|
|
45
46
|
autoComplete,
|
|
47
|
+
inputMode,
|
|
48
|
+
autoCapitalize: "none",
|
|
49
|
+
spellCheck: false,
|
|
46
50
|
placeholder,
|
|
47
51
|
onChange: (e) => onChange(e.target.value),
|
|
48
52
|
onBlur,
|
|
49
53
|
"aria-invalid": !!error || void 0,
|
|
50
54
|
"aria-describedby": error ? `${id}-err` : void 0,
|
|
51
55
|
className: cx(
|
|
52
|
-
"h-10 w-full rounded-lg bg-paper px-3 text-[14px] text-ink outline-none transition-shadow duration-200 placeholder:text-mute",
|
|
56
|
+
"h-10 w-full rounded-lg bg-paper px-3 text-[16px] sm:text-[14px] text-ink outline-none transition-shadow duration-200 placeholder:text-mute",
|
|
53
57
|
!!end && "pr-11",
|
|
54
58
|
error ? "shadow-[inset_0_0_0_1px_#e5484d] focus-visible:ring-2 focus-visible:ring-[#e5484d]/30" : `${RING} focus-visible:ring-2 focus-visible:ring-brand/50`
|
|
55
59
|
)
|
|
@@ -77,17 +81,25 @@ function SignInCard({ title = "Welcome back", subtitle = "Sign in to continue to
|
|
|
77
81
|
const [state, setState] = useState("idle");
|
|
78
82
|
const [formError, setFormError] = useState("");
|
|
79
83
|
const [shake, setShake] = useState(0);
|
|
80
|
-
const
|
|
81
|
-
email: !
|
|
82
|
-
password: !
|
|
84
|
+
const check = {
|
|
85
|
+
email: (v) => !v.trim() ? "Enter your email." : !validEmail(v) ? "Enter an email like name@company.com." : "",
|
|
86
|
+
password: (v) => !v ? "Enter your password." : v.length < 8 ? "Use at least 8 characters." : ""
|
|
83
87
|
};
|
|
88
|
+
const errors = { email: check.email(email), password: check.password(password) };
|
|
84
89
|
const show = (k) => touched[k] ? errors[k] : "";
|
|
90
|
+
const edit = (k, v) => {
|
|
91
|
+
if (k === "email") setEmail(v);
|
|
92
|
+
else setPassword(v);
|
|
93
|
+
if (touched[k] && !check[k](v)) setTouched((t) => ({ ...t, [k]: false }));
|
|
94
|
+
};
|
|
85
95
|
const submit = async (e) => {
|
|
86
96
|
e.preventDefault();
|
|
87
97
|
setTouched({ email: true, password: true });
|
|
88
98
|
setFormError("");
|
|
89
99
|
if (errors.email || errors.password) {
|
|
90
100
|
setShake((n) => n + 1);
|
|
101
|
+
const first = e.currentTarget.elements.namedItem(errors.email ? "email" : "password");
|
|
102
|
+
if (first instanceof HTMLInputElement) first.focus();
|
|
91
103
|
return;
|
|
92
104
|
}
|
|
93
105
|
setState("loading");
|
|
@@ -133,11 +145,13 @@ function SignInCard({ title = "Welcome back", subtitle = "Sign in to continue to
|
|
|
133
145
|
Field,
|
|
134
146
|
{
|
|
135
147
|
label: "Email",
|
|
148
|
+
name: "email",
|
|
136
149
|
type: "email",
|
|
137
150
|
autoComplete: "email",
|
|
151
|
+
inputMode: "email",
|
|
138
152
|
placeholder: "you@company.com",
|
|
139
153
|
value: email,
|
|
140
|
-
onChange:
|
|
154
|
+
onChange: (v) => edit("email", v),
|
|
141
155
|
onBlur: () => email && setTouched((t) => ({ ...t, email: true })),
|
|
142
156
|
error: show("email"),
|
|
143
157
|
shake
|
|
@@ -147,11 +161,12 @@ function SignInCard({ title = "Welcome back", subtitle = "Sign in to continue to
|
|
|
147
161
|
Field,
|
|
148
162
|
{
|
|
149
163
|
label: "Password",
|
|
164
|
+
name: "password",
|
|
150
165
|
type: reveal ? "text" : "password",
|
|
151
166
|
autoComplete: "current-password",
|
|
152
|
-
placeholder: "At least 8 characters",
|
|
167
|
+
placeholder: "At least 8 characters\u2026",
|
|
153
168
|
value: password,
|
|
154
|
-
onChange:
|
|
169
|
+
onChange: (v) => edit("password", v),
|
|
155
170
|
onBlur: () => password && setTouched((t) => ({ ...t, password: true })),
|
|
156
171
|
error: show("password"),
|
|
157
172
|
shake,
|
|
@@ -175,7 +190,7 @@ function SignInCard({ title = "Welcome back", subtitle = "Sign in to continue to
|
|
|
175
190
|
] }),
|
|
176
191
|
/* @__PURE__ */ jsxs("div", { className: "mt-3 flex items-center justify-between text-[13px]", children: [
|
|
177
192
|
/* @__PURE__ */ jsxs("label", { className: "flex cursor-pointer items-center gap-2 text-ink-2", children: [
|
|
178
|
-
/* @__PURE__ */ jsx("input", { type: "checkbox", defaultChecked: true, className: "h-3.5 w-3.5 accent-[var(--brand)]" }),
|
|
193
|
+
/* @__PURE__ */ jsx("input", { type: "checkbox", name: "remember", defaultChecked: true, className: "h-3.5 w-3.5 accent-[var(--brand)]" }),
|
|
179
194
|
"Remember me"
|
|
180
195
|
] }),
|
|
181
196
|
/* @__PURE__ */ jsx("a", { href: "#", onClick: (e) => e.preventDefault(), className: "text-brand outline-none hover:underline focus-visible:underline", children: "Forgot password?" })
|
|
@@ -54,8 +54,8 @@ function SnapGrid() {
|
|
|
54
54
|
/* @__PURE__ */ jsx(
|
|
55
55
|
"div",
|
|
56
56
|
{
|
|
57
|
-
className: "pointer-events-none absolute border border-dashed border-signal/60 transition-
|
|
58
|
-
style: {
|
|
57
|
+
className: "pointer-events-none absolute left-0 top-0 border border-dashed border-signal/60 transition-[transform,opacity] duration-150",
|
|
58
|
+
style: { width: CELL, height: CELL, transform: `translate(${cx * CELL}px, ${cy * CELL}px)`, opacity: dragging ? 1 : 0 }
|
|
59
59
|
}
|
|
60
60
|
),
|
|
61
61
|
/* @__PURE__ */ jsx(
|
|
@@ -53,7 +53,7 @@ function FloatingInput({
|
|
|
53
53
|
if (!controlled) setInner(e.target.value);
|
|
54
54
|
rest.onChange?.(e);
|
|
55
55
|
},
|
|
56
|
-
className: "peer h-full w-full bg-transparent pt-1.5 text-[15px] tracking-[-0.01em] text-ink outline-none placeholder:text-transparent focus:placeholder:text-mute"
|
|
56
|
+
className: "peer h-full w-full bg-transparent pt-1.5 text-[16px] sm:text-[15px] tracking-[-0.01em] text-ink outline-none placeholder:text-transparent focus:placeholder:text-mute"
|
|
57
57
|
}
|
|
58
58
|
),
|
|
59
59
|
/* @__PURE__ */ jsxs(
|
|
@@ -21,7 +21,7 @@ var CSS = `
|
|
|
21
21
|
.aui-009-in { animation: aui-009-rise .55s ${EASE} both; animation-delay: calc(var(--i, 0) * 50ms); }
|
|
22
22
|
.aui-009-vp { transform-origin: top center; }
|
|
23
23
|
.aui-009-vp[data-state=open] { animation: aui-009-vp-in .26s ${EASE}; }
|
|
24
|
-
.aui-009-vp[data-state=closed] { animation: aui-009-vp-out .16s
|
|
24
|
+
.aui-009-vp[data-state=closed] { animation: aui-009-vp-out .16s cubic-bezier(.16,1,.3,1) forwards; }
|
|
25
25
|
.aui-009-c[data-motion=from-start] { animation: aui-009-from-l .3s ${EASE}; }
|
|
26
26
|
.aui-009-c[data-motion=from-end] { animation: aui-009-from-r .3s ${EASE}; }
|
|
27
27
|
.aui-009-c[data-motion=to-start] { animation: aui-009-to-l .3s ${EASE} forwards; }
|