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,80 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// components/kit/meter.tsx
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
var cx = (...c) => c.filter(Boolean).join(" ");
|
|
6
|
+
var KEYFRAMES = `@keyframes asta-meter-in { from { transform: scaleX(0) } }
|
|
7
|
+
@keyframes asta-meter-fade { from { opacity: 0; transform: translateY(2px) } }
|
|
8
|
+
@media (prefers-reduced-motion: reduce) { .asta-meter-a { animation: none !important; transition: none !important } }`;
|
|
9
|
+
var FILLS = [
|
|
10
|
+
"var(--brand)",
|
|
11
|
+
"color-mix(in srgb, var(--brand) 55%, var(--paper))",
|
|
12
|
+
"color-mix(in srgb, var(--ink) 62%, var(--paper))",
|
|
13
|
+
"color-mix(in srgb, var(--ink) 28%, var(--paper))",
|
|
14
|
+
"color-mix(in srgb, var(--ink) 14%, var(--paper))"
|
|
15
|
+
];
|
|
16
|
+
function Meter({ label, value = 0, max, segments, format = (n) => n.toLocaleString("en-US"), warnAt = 0.9, warning = "Almost at your limit", action, size = "md", legend = true, className }) {
|
|
17
|
+
const parts = segments?.length ? segments : [{ label, value }];
|
|
18
|
+
const used = parts.reduce((a, p) => a + Math.max(0, p.value), 0);
|
|
19
|
+
const share = max > 0 ? Math.min(1, used / max) : 0;
|
|
20
|
+
const warn = share >= warnAt;
|
|
21
|
+
const starts = parts.map((_, i) => parts.slice(0, i).reduce((a, p) => a + Math.max(0, p.value), 0) / (max || 1));
|
|
22
|
+
return /* @__PURE__ */ jsxs("div", { className: cx("flex w-full flex-col", size === "sm" ? "gap-2" : "gap-2.5", className), children: [
|
|
23
|
+
/* @__PURE__ */ jsx("style", { href: "asta-meter", precedence: "asta", children: KEYFRAMES }),
|
|
24
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-baseline justify-between gap-3", children: [
|
|
25
|
+
/* @__PURE__ */ jsx("p", { className: cx("font-medium text-ink", size === "sm" ? "text-[13px]" : "text-[14px]"), children: label }),
|
|
26
|
+
action
|
|
27
|
+
] }),
|
|
28
|
+
/* @__PURE__ */ jsx(
|
|
29
|
+
"div",
|
|
30
|
+
{
|
|
31
|
+
role: "meter",
|
|
32
|
+
"aria-label": label,
|
|
33
|
+
"aria-valuemin": 0,
|
|
34
|
+
"aria-valuemax": max,
|
|
35
|
+
"aria-valuenow": Math.min(used, max),
|
|
36
|
+
"aria-valuetext": `${format(used)} of ${format(max)}${warn ? `. ${typeof warning === "string" ? warning : ""}` : ""}`,
|
|
37
|
+
className: cx("relative w-full overflow-hidden rounded-full bg-paper-2 shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_6%,transparent)]", size === "sm" ? "h-1.5" : "h-2.5"),
|
|
38
|
+
children: /* @__PURE__ */ jsx("div", { className: "asta-meter-a absolute inset-0 origin-left animate-[asta-meter-in_1s_cubic-bezier(.16,1,.3,1)_both]", children: parts.map((p, i) => {
|
|
39
|
+
const w = max > 0 ? Math.max(0, p.value) / max : 0;
|
|
40
|
+
const x = starts[i];
|
|
41
|
+
return /* @__PURE__ */ jsx(
|
|
42
|
+
"span",
|
|
43
|
+
{
|
|
44
|
+
className: "asta-meter-a absolute inset-y-0 left-0 w-full origin-left transition-[transform,background-color] duration-700 ease-[cubic-bezier(.16,1,.3,1)]",
|
|
45
|
+
style: { transform: `translateX(${Math.min(1, x) * 100}%) scaleX(${Math.min(w, Math.max(0, 1 - x))})`, background: warn && parts.length === 1 ? "var(--ink)" : FILLS[i % FILLS.length] }
|
|
46
|
+
},
|
|
47
|
+
p.label
|
|
48
|
+
);
|
|
49
|
+
}) })
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
/* @__PURE__ */ jsxs("div", { className: cx("flex flex-wrap items-center justify-between gap-x-4 gap-y-1", size === "sm" ? "text-[12px]" : "text-[12.5px]"), children: [
|
|
53
|
+
/* @__PURE__ */ jsxs("p", { className: "tabular-nums text-ink-2", children: [
|
|
54
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium text-ink", children: format(used) }),
|
|
55
|
+
/* @__PURE__ */ jsxs("span", { className: "text-mute", children: [
|
|
56
|
+
" of ",
|
|
57
|
+
format(max)
|
|
58
|
+
] })
|
|
59
|
+
] }),
|
|
60
|
+
warn ? /* @__PURE__ */ jsxs("p", { className: "asta-meter-a flex animate-[asta-meter-fade_.4s_cubic-bezier(.16,1,.3,1)_both] items-center gap-1.5 font-medium text-ink", children: [
|
|
61
|
+
/* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "h-3.5 w-3.5", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M8 2.5 14 13H2zM8 6.5v3M8 11.2h.01" }) }),
|
|
62
|
+
warning
|
|
63
|
+
] }, "warn") : /* @__PURE__ */ jsxs("p", { className: "tabular-nums text-mute", children: [
|
|
64
|
+
Math.round(share * 100),
|
|
65
|
+
"% used"
|
|
66
|
+
] })
|
|
67
|
+
] }),
|
|
68
|
+
legend && segments && segments.length > 1 && /* @__PURE__ */ jsx("ul", { className: "flex flex-wrap gap-x-4 gap-y-1.5 pt-0.5", children: segments.map((p, i) => /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-1.5 text-[12px] text-mute", children: [
|
|
69
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "h-2 w-2 rounded-full", style: { background: FILLS[i % FILLS.length] } }),
|
|
70
|
+
/* @__PURE__ */ jsx("span", { className: "text-ink-2", children: p.label }),
|
|
71
|
+
/* @__PURE__ */ jsx("span", { className: "tabular-nums", children: format(p.value) })
|
|
72
|
+
] }, p.label)) })
|
|
73
|
+
] });
|
|
74
|
+
}
|
|
75
|
+
var meter_default = Meter;
|
|
76
|
+
|
|
77
|
+
export {
|
|
78
|
+
Meter,
|
|
79
|
+
meter_default
|
|
80
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
Select
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JLCSRNI2.js";
|
|
5
5
|
import {
|
|
6
6
|
Button
|
|
7
7
|
} from "./chunk-WSL4JGEA.js";
|
|
8
8
|
import {
|
|
9
9
|
Input
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-UZF7SCRT.js";
|
|
11
11
|
|
|
12
12
|
// components/kit/base/checkout.tsx
|
|
13
13
|
import { useEffect, useId, useMemo, useRef, useState } from "react";
|
|
@@ -49,20 +49,26 @@ function check(f, d) {
|
|
|
49
49
|
case "email":
|
|
50
50
|
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(v) ? null : "Enter an email like you@example.com.";
|
|
51
51
|
case "cardNumber":
|
|
52
|
-
return (isAmex(v) ? v.length === 15 : v.length >= 13 && v.length <= 19) ? null : "
|
|
52
|
+
return (isAmex(v) ? v.length === 15 : v.length >= 13 && v.length <= 19) ? null : isAmex(v) ? "Enter all 15 digits on the front of the card." : "Enter the full card number from the front of the card.";
|
|
53
53
|
case "cardExpiry": {
|
|
54
54
|
const [m, y] = v.split("/").map(Number);
|
|
55
|
-
if (!/^\d{2}\/\d{2}$/.test(v) || !m || m > 12) return "
|
|
55
|
+
if (!/^\d{2}\/\d{2}$/.test(v) || !m || m > 12) return "Enter the expiry as MM / YY, like 08 / 29.";
|
|
56
56
|
const now = /* @__PURE__ */ new Date();
|
|
57
57
|
const end = new Date(2e3 + y, m, 1);
|
|
58
|
-
return end > now ? null : "This card has expired.";
|
|
58
|
+
return end > now ? null : "This card has expired. Use one with a later date.";
|
|
59
59
|
}
|
|
60
60
|
case "cardCvc":
|
|
61
|
-
return v.length >= 3 ? null : "3 or 4 digits
|
|
61
|
+
return v.length >= 3 ? null : "Enter the 3 or 4 digits on the back of the card.";
|
|
62
62
|
default:
|
|
63
|
-
return v ? null : "
|
|
63
|
+
return v ? null : REQUIRED[f] ?? "Fill in this field.";
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
+
var REQUIRED = {
|
|
67
|
+
name: "Enter your full name.",
|
|
68
|
+
address: "Enter your street address.",
|
|
69
|
+
city: "Enter your city.",
|
|
70
|
+
postal: "Enter your postal code."
|
|
71
|
+
};
|
|
66
72
|
function RollChar({ c, animate, delay }) {
|
|
67
73
|
const [on] = useState(animate);
|
|
68
74
|
return /* @__PURE__ */ jsx("span", { className: "inline-block whitespace-pre", style: on ? { animation: `kit-co-roll .5s ${CURVE} ${delay}ms both` } : void 0, children: c });
|
|
@@ -181,7 +187,11 @@ function Checkout({
|
|
|
181
187
|
const errors = Object.fromEntries(ORDER.map((f) => [f, check(f, d)]));
|
|
182
188
|
const shown = (f) => touched[f] ? errors[f] : null;
|
|
183
189
|
const locked = state !== "idle";
|
|
184
|
-
const set = (f, v) =>
|
|
190
|
+
const set = (f, v) => {
|
|
191
|
+
setD((p) => ({ ...p, [f]: v }));
|
|
192
|
+
const k = f;
|
|
193
|
+
if (ORDER.includes(k) && touched[k] && !check(k, { ...d, [f]: v })) setTouched((t) => ({ ...t, [k]: false }));
|
|
194
|
+
};
|
|
185
195
|
const blur = (f) => setTouched((t) => ({ ...t, [f]: true }));
|
|
186
196
|
const formatted = (f, fmt, max) => (e) => {
|
|
187
197
|
const el = e.currentTarget;
|
|
@@ -203,13 +213,13 @@ function Checkout({
|
|
|
203
213
|
const applyPromo = () => {
|
|
204
214
|
const code = promoText.trim().toUpperCase();
|
|
205
215
|
const hit = Object.entries(promoCodes).find(([k]) => k.toUpperCase() === code);
|
|
206
|
-
if (!code) return;
|
|
216
|
+
if (!code) return setPromoMsg("Enter a promo code first.");
|
|
207
217
|
if (hit) {
|
|
208
218
|
setPromo({ code: hit[0].toUpperCase(), off: hit[1] });
|
|
209
219
|
setPromoMsg(`${hit[0].toUpperCase()} applied.`);
|
|
210
220
|
setPromoText("");
|
|
211
221
|
setPromoOpen(false);
|
|
212
|
-
} else setPromoMsg("That code isn't valid.");
|
|
222
|
+
} else setPromoMsg("That code isn't valid. Check the spelling and try again.");
|
|
213
223
|
};
|
|
214
224
|
const pay = async () => {
|
|
215
225
|
if (locked) return;
|
|
@@ -234,6 +244,7 @@ function Checkout({
|
|
|
234
244
|
Input,
|
|
235
245
|
{
|
|
236
246
|
id: id(f),
|
|
247
|
+
name: f,
|
|
237
248
|
value: f === "cardNumber" ? fmtCard(d[f]) : f === "cardExpiry" ? fmtExpiry(digits(d[f])) : d[f],
|
|
238
249
|
onChange: (e) => set(f, e.target.value),
|
|
239
250
|
onBlur: () => blur(f),
|
|
@@ -270,17 +281,17 @@ function Checkout({
|
|
|
270
281
|
pay();
|
|
271
282
|
},
|
|
272
283
|
children: [
|
|
273
|
-
/* @__PURE__ */ jsx(Section, { n: 1, title: "Contact", children: /* @__PURE__ */ jsx(Labeled, { id: id("email"), label: "Email", error: shown("email"), children: input("email", { type: "email", autoComplete: "email", placeholder: "you@example.com" }) }) }),
|
|
284
|
+
/* @__PURE__ */ jsx(Section, { n: 1, title: "Contact", children: /* @__PURE__ */ jsx(Labeled, { id: id("email"), label: "Email", error: shown("email"), children: input("email", { type: "email", autoComplete: "email", inputMode: "email", autoCapitalize: "none", spellCheck: false, placeholder: "you@example.com" }) }) }),
|
|
274
285
|
/* @__PURE__ */ jsxs(Section, { n: 2, title: "Shipping", children: [
|
|
275
286
|
/* @__PURE__ */ jsx(Labeled, { id: id("name"), label: "Full name", error: shown("name"), children: input("name", { autoComplete: "name" }) }),
|
|
276
|
-
/* @__PURE__ */ jsx(Labeled, { id: id("address"), label: "Address", error: shown("address"), children: input("address", { autoComplete: "
|
|
287
|
+
/* @__PURE__ */ jsx(Labeled, { id: id("address"), label: "Address", error: shown("address"), children: input("address", { autoComplete: "address-line1" }) }),
|
|
277
288
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
278
289
|
/* @__PURE__ */ jsx(Labeled, { id: id("city"), label: "City", error: shown("city"), children: input("city", { autoComplete: "address-level2" }) }),
|
|
279
|
-
/* @__PURE__ */ jsx(Labeled, { id: id("postal"), label: "Postal code", error: shown("postal"), children: input("postal", { autoComplete: "postal-code",
|
|
290
|
+
/* @__PURE__ */ jsx(Labeled, { id: id("postal"), label: "Postal code", error: shown("postal"), children: input("postal", { autoComplete: "postal-code", autoCapitalize: "characters" }) })
|
|
280
291
|
] }),
|
|
281
292
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
282
293
|
/* @__PURE__ */ jsx("p", { className: "mb-1.5 text-[12.5px] text-ink-2", children: "Country" }),
|
|
283
|
-
/* @__PURE__ */ jsx(Select, { label: "Country", options: countries, value: d.country, onChange: (v) => set("country", v), disabled: locked })
|
|
294
|
+
/* @__PURE__ */ jsx(Select, { label: "Country", name: "country", options: countries, value: d.country, onChange: (v) => set("country", v), disabled: locked })
|
|
284
295
|
] }),
|
|
285
296
|
/* @__PURE__ */ jsx("div", { role: "radiogroup", "aria-label": "Shipping speed", className: "mt-1 grid gap-2 sm:grid-cols-2", children: shippingOptions.map((s) => {
|
|
286
297
|
const on = s.id === d.shipping;
|
|
@@ -365,8 +376,13 @@ function Checkout({
|
|
|
365
376
|
Input,
|
|
366
377
|
{
|
|
367
378
|
size: "sm",
|
|
379
|
+
name: "promo",
|
|
368
380
|
"aria-label": "Promo code",
|
|
369
|
-
|
|
381
|
+
"aria-describedby": promoMsg ? `${uid}-promo-msg` : void 0,
|
|
382
|
+
placeholder: "Enter code\u2026",
|
|
383
|
+
autoComplete: "off",
|
|
384
|
+
autoCapitalize: "characters",
|
|
385
|
+
spellCheck: false,
|
|
370
386
|
value: promoText,
|
|
371
387
|
autoFocus: true,
|
|
372
388
|
disabled: locked,
|
|
@@ -382,7 +398,7 @@ function Checkout({
|
|
|
382
398
|
}
|
|
383
399
|
}
|
|
384
400
|
),
|
|
385
|
-
/* @__PURE__ */ jsx(Button, { size: "sm", variant: "outline", onClick: applyPromo, disabled: locked
|
|
401
|
+
/* @__PURE__ */ jsx(Button, { size: "sm", variant: "outline", onClick: applyPromo, disabled: locked, children: "Apply" })
|
|
386
402
|
] }) : /* @__PURE__ */ jsx(
|
|
387
403
|
"button",
|
|
388
404
|
{
|
|
@@ -393,7 +409,7 @@ function Checkout({
|
|
|
393
409
|
children: "Add a promo code"
|
|
394
410
|
}
|
|
395
411
|
),
|
|
396
|
-
/* @__PURE__ */ jsx("p", { className: "mt-1.5 min-h-4 text-[12px] text-mute", "aria-live": "polite", children: promoMsg })
|
|
412
|
+
/* @__PURE__ */ jsx("p", { id: `${uid}-promo-msg`, className: "mt-1.5 min-h-4 text-[12px] text-mute", "aria-live": "polite", children: promoMsg })
|
|
397
413
|
] }),
|
|
398
414
|
/* @__PURE__ */ jsxs("dl", { className: "mt-3 grid gap-2", children: [
|
|
399
415
|
/* @__PURE__ */ jsxs("div", { className: rowCls, children: [
|
|
@@ -43,7 +43,7 @@ function ValidatedTextarea({ label, rules, value: valueProp, defaultValue = "",
|
|
|
43
43
|
if (value) setTouched(true);
|
|
44
44
|
rest.onBlur?.(e);
|
|
45
45
|
},
|
|
46
|
-
className: "block w-full resize-none bg-transparent px-3.5 py-3 text-[14px] leading-[1.55] text-ink outline-none placeholder:text-mute"
|
|
46
|
+
className: "block w-full resize-none bg-transparent px-3.5 py-3 text-[16px] sm:text-[14px] leading-[1.55] text-ink outline-none placeholder:text-mute"
|
|
47
47
|
}
|
|
48
48
|
) }),
|
|
49
49
|
/* @__PURE__ */ jsx("div", { className: cx("grid transition-[grid-template-rows] duration-400 ease-[cubic-bezier(.16,1,.3,1)] motion-reduce:transition-none", state === "idle" ? "grid-rows-[0fr]" : "grid-rows-[1fr]"), children: /* @__PURE__ */ jsx("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsx("ul", { id: `${fid}-rules`, className: "flex flex-col gap-1 pt-1", "aria-live": "polite", children: state === "success" ? /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-2 text-[12.5px] text-[#30a46c]", children: [
|
|
@@ -191,7 +191,7 @@ function HoverCard({ trigger, children, open, defaultOpen = false, onOpenChange,
|
|
|
191
191
|
"shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_10%,transparent),0_18px_44px_-16px_rgb(0_0_0/0.32),0_4px_10px_-6px_rgb(0_0_0/0.12)]",
|
|
192
192
|
// An invisible bridge over the gap, so the pointer can cross from the link without the card closing.
|
|
193
193
|
"before:absolute before:inset-x-0 before:h-[var(--asta-hc-gap,10px)] before:content-[''] data-[side=bottom]:before:bottom-full data-[side=top]:before:top-full",
|
|
194
|
-
"animate-[asta-hovercard-in_.28s_cubic-bezier(.16,1,.3,1)_both] data-[state=closed]:animate-[asta-hovercard-out_.
|
|
194
|
+
"animate-[asta-hovercard-in_.28s_cubic-bezier(.16,1,.3,1)_both] data-[state=closed]:animate-[asta-hovercard-out_.14s_cubic-bezier(.16,1,.3,1)_both]",
|
|
195
195
|
"data-[state=closed]:pointer-events-none motion-reduce:![animation-duration:1ms]",
|
|
196
196
|
className
|
|
197
197
|
),
|
|
@@ -45,7 +45,7 @@ function Field({ label, hint, error, required, aside, className, children }) {
|
|
|
45
45
|
/* @__PURE__ */ jsx("style", { href: "asta-field", precedence: "asta", children: `@keyframes kit-field-in { from { opacity: 0; transform: translateY(-3px) } to { opacity: 1; transform: none } }` })
|
|
46
46
|
] });
|
|
47
47
|
}
|
|
48
|
-
var fieldInputClass = "h-10 w-full rounded-lg bg-paper px-3 text-[14px] text-ink outline-none placeholder:text-mute shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_14%,transparent)] transition-shadow duration-200 hover:shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_24%,transparent)] focus:shadow-[inset_0_0_0_1px_var(--brand),0_0_0_3px_color-mix(in_srgb,var(--brand)_18%,transparent)] aria-[invalid=true]:shadow-[inset_0_0_0_1px_#e5484d,0_0_0_3px_rgb(229_72_77/0.14)]";
|
|
48
|
+
var fieldInputClass = "h-10 w-full rounded-lg bg-paper px-3 text-[16px] sm:text-[14px] text-ink outline-none placeholder:text-mute shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_14%,transparent)] transition-shadow duration-200 hover:shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_24%,transparent)] focus:shadow-[inset_0_0_0_1px_var(--brand),0_0_0_3px_color-mix(in_srgb,var(--brand)_18%,transparent)] aria-[invalid=true]:shadow-[inset_0_0_0_1px_#e5484d,0_0_0_3px_rgb(229_72_77/0.14)]";
|
|
49
49
|
var field_default = Field;
|
|
50
50
|
|
|
51
51
|
export {
|
|
@@ -33,7 +33,9 @@ var Spinner = () => /* @__PURE__ */ jsx(
|
|
|
33
33
|
);
|
|
34
34
|
function Field({
|
|
35
35
|
label,
|
|
36
|
+
name,
|
|
36
37
|
type,
|
|
38
|
+
inputMode,
|
|
37
39
|
value,
|
|
38
40
|
onChange,
|
|
39
41
|
onBlur,
|
|
@@ -68,16 +70,20 @@ function Field({
|
|
|
68
70
|
"input",
|
|
69
71
|
{
|
|
70
72
|
id,
|
|
73
|
+
name,
|
|
71
74
|
type,
|
|
75
|
+
inputMode,
|
|
72
76
|
value,
|
|
73
77
|
autoComplete,
|
|
78
|
+
autoCapitalize: "none",
|
|
79
|
+
spellCheck: false,
|
|
74
80
|
placeholder,
|
|
75
81
|
onChange: (e) => onChange(e.target.value),
|
|
76
82
|
onBlur,
|
|
77
83
|
"aria-invalid": hasError || void 0,
|
|
78
84
|
"aria-describedby": hasError ? `${id}-err` : void 0,
|
|
79
85
|
className: cx(
|
|
80
|
-
"h-11 w-full rounded-[10px] bg-paper-2 px-4 text-[14px] text-ink outline-none transition-[box-shadow,background-color] duration-300 placeholder:text-mute hover:bg-[color-mix(in_srgb,var(--ink)_6%,var(--paper-2))] focus-visible:bg-paper focus-visible:shadow-[inset_0_0_0_1px_var(--brand),0_0_0_4px_color-mix(in_srgb,var(--brand)_12%,transparent)]",
|
|
86
|
+
"h-11 w-full rounded-[10px] bg-paper-2 px-4 text-[16px] sm:text-[14px] text-ink outline-none transition-[box-shadow,background-color] duration-300 placeholder:text-mute hover:bg-[color-mix(in_srgb,var(--ink)_6%,var(--paper-2))] focus-visible:bg-paper focus-visible:shadow-[inset_0_0_0_1px_var(--brand),0_0_0_4px_color-mix(in_srgb,var(--brand)_12%,transparent)]",
|
|
81
87
|
!!end && "pr-12",
|
|
82
88
|
hasError && "shadow-[inset_0_0_0_1.5px_var(--ink)]"
|
|
83
89
|
)
|
|
@@ -157,11 +163,17 @@ function SplitSignIn({
|
|
|
157
163
|
const y = (e.clientY - r.top) / r.height - 0.5;
|
|
158
164
|
img.style.transform = `scale(1.06) translate(${(-x * 14).toFixed(1)}px, ${(-y * 10).toFixed(1)}px)`;
|
|
159
165
|
};
|
|
160
|
-
const
|
|
161
|
-
email: !
|
|
162
|
-
password: !
|
|
166
|
+
const check = {
|
|
167
|
+
email: (v) => !v.trim() ? "Enter your email." : !validEmail(v) ? "Enter an email like name@company.com." : "",
|
|
168
|
+
password: (v) => !v ? "Enter your password." : v.length < 8 ? "Use at least 8 characters." : ""
|
|
163
169
|
};
|
|
170
|
+
const errors = { email: check.email(email), password: check.password(password) };
|
|
164
171
|
const show = (k) => touched[k] ? errors[k] : "";
|
|
172
|
+
const edit = (k, v) => {
|
|
173
|
+
if (k === "email") setEmail(v);
|
|
174
|
+
else setPassword(v);
|
|
175
|
+
if (touched[k] && !check[k](v)) setTouched((t) => ({ ...t, [k]: false }));
|
|
176
|
+
};
|
|
165
177
|
const submit = async (e) => {
|
|
166
178
|
e.preventDefault();
|
|
167
179
|
if (state === "loading") return;
|
|
@@ -169,6 +181,8 @@ function SplitSignIn({
|
|
|
169
181
|
setFormError("");
|
|
170
182
|
if (errors.email || errors.password) {
|
|
171
183
|
setShake((n) => n + 1);
|
|
184
|
+
const first2 = e.currentTarget.elements.namedItem(errors.email ? "email" : "password");
|
|
185
|
+
if (first2 instanceof HTMLElement) first2.focus();
|
|
172
186
|
return;
|
|
173
187
|
}
|
|
174
188
|
setState("loading");
|
|
@@ -352,11 +366,13 @@ function SplitSignIn({
|
|
|
352
366
|
Field,
|
|
353
367
|
{
|
|
354
368
|
label: "Email",
|
|
369
|
+
name: "email",
|
|
355
370
|
type: "email",
|
|
371
|
+
inputMode: "email",
|
|
356
372
|
autoComplete: "email",
|
|
357
|
-
placeholder: "Enter email",
|
|
373
|
+
placeholder: "Enter your email\u2026",
|
|
358
374
|
value: email,
|
|
359
|
-
onChange:
|
|
375
|
+
onChange: (v) => edit("email", v),
|
|
360
376
|
onBlur: () => email && setTouched((t) => ({ ...t, email: true })),
|
|
361
377
|
error: show("email"),
|
|
362
378
|
shake
|
|
@@ -366,11 +382,12 @@ function SplitSignIn({
|
|
|
366
382
|
Field,
|
|
367
383
|
{
|
|
368
384
|
label: "Password",
|
|
385
|
+
name: "password",
|
|
369
386
|
type: reveal ? "text" : "password",
|
|
370
387
|
autoComplete: "current-password",
|
|
371
|
-
placeholder: "Enter password",
|
|
388
|
+
placeholder: "Enter your password\u2026",
|
|
372
389
|
value: password,
|
|
373
|
-
onChange:
|
|
390
|
+
onChange: (v) => edit("password", v),
|
|
374
391
|
onBlur: () => password && setTouched((t) => ({ ...t, password: true })),
|
|
375
392
|
error: show("password") || formError,
|
|
376
393
|
shake,
|
|
@@ -8,6 +8,7 @@ var DOWN = "var(--ink-2)";
|
|
|
8
8
|
var LEVELS = 5;
|
|
9
9
|
var TICK = 0.01;
|
|
10
10
|
var EASE = "cubic-bezier(.16,1,.3,1)";
|
|
11
|
+
var SIDE = "shrink-0 px-3 text-[0.85em] leading-none uppercase tracking-[0.1em] text-mute";
|
|
11
12
|
function seeded(s) {
|
|
12
13
|
return () => {
|
|
13
14
|
s = s + 1831565813 | 0;
|
|
@@ -74,15 +75,18 @@ function OrderBook() {
|
|
|
74
75
|
return /* @__PURE__ */ jsxs("div", { className: "flex h-full w-full items-center justify-center px-5 pb-5 pt-14 [container-type:size]", children: [
|
|
75
76
|
/* @__PURE__ */ jsx("style", { href: "asta-orderbook", precedence: "asta", children: `@keyframes ob-flash { from { opacity: 1 } to { opacity: 0 } }` }),
|
|
76
77
|
/* @__PURE__ */ jsxs("div", { className: "flex h-full max-h-[460px] w-full max-w-[380px] flex-col gap-[3px] font-mono text-[clamp(11px,2.6cqh,15px)]", children: [
|
|
77
|
-
|
|
78
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: SIDE, children: "Asks" }),
|
|
79
|
+
/* @__PURE__ */ jsx("div", { role: "group", "aria-label": "Asks", className: "flex min-h-0 flex-[5] flex-col gap-[3px]", children: [...book.asks].reverse().map((r, i) => row(r, ca[LEVELS - 1 - i], DOWN, `a${i}`, LEVELS - 1 - i)) }),
|
|
78
80
|
/* @__PURE__ */ jsxs("div", { className: "my-1.5 flex flex-[1.6] items-center justify-between px-3", children: [
|
|
79
81
|
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2 text-[1.55em] font-medium tabular-nums tracking-[-0.02em] transition-colors duration-700", style: { color: mc, transitionTimingFunction: EASE }, children: [
|
|
80
82
|
book.mid.toFixed(2),
|
|
81
|
-
/* @__PURE__ */ jsx("span", { className: `text-[0.6em] transition-transform duration-500 ${book.dir > 0 ? "" : "rotate-180"}`, style: { transitionTimingFunction: EASE }, children: "\u25B2" })
|
|
83
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: `text-[0.6em] transition-transform duration-500 ${book.dir > 0 ? "" : "rotate-180"}`, style: { transitionTimingFunction: EASE }, children: "\u25B2" }),
|
|
84
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: book.dir > 0 ? "up" : "down" })
|
|
82
85
|
] }),
|
|
83
86
|
/* @__PURE__ */ jsx("span", { className: "text-[0.85em] uppercase tracking-[0.1em] text-mute", children: "mid" })
|
|
84
87
|
] }),
|
|
85
|
-
book.bids.map((r, i) => row(r, cb[i], UP, `b${i}`, i))
|
|
88
|
+
/* @__PURE__ */ jsx("div", { role: "group", "aria-label": "Bids", className: "flex min-h-0 flex-[5] flex-col gap-[3px]", children: book.bids.map((r, i) => row(r, cb[i], UP, `b${i}`, i)) }),
|
|
89
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: SIDE, children: "Bids" })
|
|
86
90
|
] })
|
|
87
91
|
] });
|
|
88
92
|
}
|
|
@@ -23,7 +23,7 @@ var CSS = `
|
|
|
23
23
|
.aui-011-sheet { animation: aui-011-drop .4s ${EASE} both; }
|
|
24
24
|
.aui-011-vp { transform-origin: top center; }
|
|
25
25
|
.aui-011-vp[data-state=open] { animation: aui-011-vp-in .26s ${EASE}; }
|
|
26
|
-
.aui-011-vp[data-state=closed] { animation: aui-011-vp-out .16s
|
|
26
|
+
.aui-011-vp[data-state=closed] { animation: aui-011-vp-out .16s cubic-bezier(.16,1,.3,1) forwards; }
|
|
27
27
|
.aui-011-c[data-motion=from-start] { animation: aui-011-from-l .3s ${EASE}; }
|
|
28
28
|
.aui-011-c[data-motion=from-end] { animation: aui-011-from-r .3s ${EASE}; }
|
|
29
29
|
.aui-011-c[data-motion=to-start] { animation: aui-011-to-l .3s ${EASE} forwards; }
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Button
|
|
4
|
+
} from "./chunk-ZWBJUJTR.js";
|
|
5
|
+
|
|
6
|
+
// components/kit/invoice.tsx
|
|
7
|
+
import { useState } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
var cx = (...c) => c.filter(Boolean).join(" ");
|
|
10
|
+
var KEYFRAMES = `@keyframes asta-invoice-in { from { opacity: 0; transform: translateY(4px) } }
|
|
11
|
+
@keyframes asta-invoice-draw { from { stroke-dashoffset: 1 } }
|
|
12
|
+
@keyframes asta-invoice-pop { 0% { transform: scale(.6); opacity: 0 } 60% { transform: scale(1.08) } 100% { transform: none; opacity: 1 } }
|
|
13
|
+
@media (prefers-reduced-motion: reduce) { .asta-invoice-a { animation: none !important } }`;
|
|
14
|
+
var STATUS = {
|
|
15
|
+
draft: { label: "Draft", cls: "text-mute shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_16%,transparent)]" },
|
|
16
|
+
due: { label: "Due", cls: "bg-paper-2 text-ink" },
|
|
17
|
+
overdue: { label: "Overdue", cls: "bg-ink text-paper" },
|
|
18
|
+
paid: { label: "Paid", cls: "bg-[color-mix(in_srgb,var(--brand)_12%,transparent)] text-brand" }
|
|
19
|
+
};
|
|
20
|
+
function Invoice({ number, issued, due, from, to, items, taxRate = 0, discount = 0, currency = "USD", locale = "en-US", status = "due", notes, brand, onPay, onDownload, className }) {
|
|
21
|
+
const [state, setState] = useState(status);
|
|
22
|
+
const [paying, setPaying] = useState(false);
|
|
23
|
+
const [paidOn, setPaidOn] = useState(null);
|
|
24
|
+
const money = (n) => new Intl.NumberFormat(locale, { style: "currency", currency }).format(n);
|
|
25
|
+
const subtotal = items.reduce((a, it) => a + it.quantity * it.unitPrice, 0);
|
|
26
|
+
const taxed = Math.max(0, subtotal - discount);
|
|
27
|
+
const tax = Math.round(taxed * taxRate * 100) / 100;
|
|
28
|
+
const total = taxed + tax;
|
|
29
|
+
const paid = state === "paid";
|
|
30
|
+
const s = STATUS[state];
|
|
31
|
+
const pay = async () => {
|
|
32
|
+
if (!onPay || paying) return;
|
|
33
|
+
setPaying(true);
|
|
34
|
+
try {
|
|
35
|
+
await onPay();
|
|
36
|
+
setPaidOn((/* @__PURE__ */ new Date()).toLocaleDateString(locale, { month: "short", day: "numeric", year: "numeric" }));
|
|
37
|
+
setState("paid");
|
|
38
|
+
} finally {
|
|
39
|
+
setPaying(false);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
return /* @__PURE__ */ jsxs(
|
|
43
|
+
"article",
|
|
44
|
+
{
|
|
45
|
+
"aria-label": `Invoice ${number}`,
|
|
46
|
+
className: cx("@container w-full rounded-[14px] bg-paper text-ink shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_10%,transparent),0_18px_44px_-28px_rgb(0_0_0/0.3)]", className),
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ jsx("style", { href: "asta-invoice", precedence: "asta", children: KEYFRAMES }),
|
|
49
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-7 p-5 @min-[560px]:p-8", children: [
|
|
50
|
+
/* @__PURE__ */ jsxs("header", { className: "flex flex-wrap items-start justify-between gap-4", children: [
|
|
51
|
+
/* @__PURE__ */ jsx("div", { className: "min-w-0", children: brand ?? /* @__PURE__ */ jsx("p", { className: "text-[17px] font-semibold tracking-[-0.03em]", children: from.name }) }),
|
|
52
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-end gap-1.5 text-right", children: [
|
|
53
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
54
|
+
/* @__PURE__ */ jsx("h2", { className: "text-[20px] font-medium tracking-[-0.03em]", children: "Invoice" }),
|
|
55
|
+
/* @__PURE__ */ jsxs("span", { className: cx("asta-invoice-a inline-flex h-6 animate-[asta-invoice-pop_.45s_cubic-bezier(.16,1,.3,1)_both] items-center gap-1 rounded-md px-2 text-[11.5px] font-medium", s.cls), children: [
|
|
56
|
+
paid ? /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "h-3 w-3", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "m3.5 8.5 3 3 6-7", pathLength: 1, strokeDasharray: 1, className: "asta-invoice-a animate-[asta-invoice-draw_.5s_cubic-bezier(.16,1,.3,1)_.15s_both]" }) }) : state === "overdue" ? /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "h-3 w-3", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M8 4.5v4M8 11.2h.01" }) }) : null,
|
|
57
|
+
s.label
|
|
58
|
+
] }, state)
|
|
59
|
+
] }),
|
|
60
|
+
/* @__PURE__ */ jsx("p", { className: "font-mono text-[12px] text-mute", children: number })
|
|
61
|
+
] })
|
|
62
|
+
] }),
|
|
63
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-5 text-[13px] @min-[560px]:grid-cols-[1fr_1fr_auto] @min-[560px]:gap-8", children: [
|
|
64
|
+
[
|
|
65
|
+
["Billed to", to],
|
|
66
|
+
["From", from]
|
|
67
|
+
].map(([title, p]) => {
|
|
68
|
+
const party = p;
|
|
69
|
+
return /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
70
|
+
/* @__PURE__ */ jsx("p", { className: "font-mono text-[10.5px] uppercase tracking-wider text-mute", children: title }),
|
|
71
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1.5 font-medium", children: party.name }),
|
|
72
|
+
party.lines.map((l) => /* @__PURE__ */ jsx("p", { className: "text-mute", children: l }, l))
|
|
73
|
+
] }, title);
|
|
74
|
+
}),
|
|
75
|
+
/* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-2 gap-x-6 gap-y-1.5 @min-[560px]:grid-cols-1 @min-[560px]:text-right", children: [
|
|
76
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
77
|
+
/* @__PURE__ */ jsx("dt", { className: "font-mono text-[10.5px] uppercase tracking-wider text-mute", children: "Issued" }),
|
|
78
|
+
/* @__PURE__ */ jsx("dd", { className: "mt-1", children: issued })
|
|
79
|
+
] }),
|
|
80
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
81
|
+
/* @__PURE__ */ jsx("dt", { className: "font-mono text-[10.5px] uppercase tracking-wider text-mute", children: paid ? "Paid" : "Due" }),
|
|
82
|
+
/* @__PURE__ */ jsx("dd", { className: cx("mt-1", paid && "asta-invoice-a animate-[asta-invoice-in_.4s_cubic-bezier(.16,1,.3,1)_both] text-brand"), children: paid ? paidOn ?? due : due }, paid ? "p" : "d")
|
|
83
|
+
] })
|
|
84
|
+
] })
|
|
85
|
+
] }),
|
|
86
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
87
|
+
/* @__PURE__ */ jsxs("div", { className: "hidden grid-cols-[1fr_56px_96px_104px] gap-4 px-1 pb-2 font-mono text-[10.5px] uppercase tracking-wider text-mute @min-[560px]:grid", "aria-hidden": true, children: [
|
|
88
|
+
/* @__PURE__ */ jsx("span", { children: "Item" }),
|
|
89
|
+
/* @__PURE__ */ jsx("span", { className: "text-right", children: "Qty" }),
|
|
90
|
+
/* @__PURE__ */ jsx("span", { className: "text-right", children: "Price" }),
|
|
91
|
+
/* @__PURE__ */ jsx("span", { className: "text-right", children: "Amount" })
|
|
92
|
+
] }),
|
|
93
|
+
/* @__PURE__ */ jsx("ul", { className: "flex flex-col", children: items.map((it, i) => /* @__PURE__ */ jsxs(
|
|
94
|
+
"li",
|
|
95
|
+
{
|
|
96
|
+
className: "grid grid-cols-[1fr_auto] gap-x-4 gap-y-0.5 rounded-lg px-1 py-2.5 text-[13.5px] odd:bg-paper-2 @min-[560px]:grid-cols-[1fr_56px_96px_104px] @min-[560px]:items-center @min-[560px]:px-3",
|
|
97
|
+
children: [
|
|
98
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
99
|
+
/* @__PURE__ */ jsx("p", { className: "font-medium", children: it.description }),
|
|
100
|
+
it.detail && /* @__PURE__ */ jsx("p", { className: "text-[12px] text-mute", children: it.detail }),
|
|
101
|
+
/* @__PURE__ */ jsxs("p", { className: "text-[12px] tabular-nums text-mute @min-[560px]:hidden", children: [
|
|
102
|
+
it.quantity,
|
|
103
|
+
" \xD7 ",
|
|
104
|
+
money(it.unitPrice)
|
|
105
|
+
] })
|
|
106
|
+
] }),
|
|
107
|
+
/* @__PURE__ */ jsx("span", { className: "hidden text-right tabular-nums text-ink-2 @min-[560px]:block", children: it.quantity }),
|
|
108
|
+
/* @__PURE__ */ jsx("span", { className: "hidden text-right tabular-nums text-ink-2 @min-[560px]:block", children: money(it.unitPrice) }),
|
|
109
|
+
/* @__PURE__ */ jsx("span", { className: "text-right font-medium tabular-nums", children: money(it.quantity * it.unitPrice) })
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
it.description + i
|
|
113
|
+
)) })
|
|
114
|
+
] }),
|
|
115
|
+
/* @__PURE__ */ jsxs("dl", { className: "ml-auto flex w-full max-w-[300px] flex-col gap-1.5 text-[13px]", children: [
|
|
116
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-between gap-4", children: [
|
|
117
|
+
/* @__PURE__ */ jsx("dt", { className: "text-mute", children: "Subtotal" }),
|
|
118
|
+
/* @__PURE__ */ jsx("dd", { className: "tabular-nums", children: money(subtotal) })
|
|
119
|
+
] }),
|
|
120
|
+
discount > 0 && /* @__PURE__ */ jsxs("div", { className: "flex justify-between gap-4", children: [
|
|
121
|
+
/* @__PURE__ */ jsx("dt", { className: "text-mute", children: "Discount" }),
|
|
122
|
+
/* @__PURE__ */ jsxs("dd", { className: "tabular-nums", children: [
|
|
123
|
+
"\u2212",
|
|
124
|
+
money(discount)
|
|
125
|
+
] })
|
|
126
|
+
] }),
|
|
127
|
+
taxRate > 0 && /* @__PURE__ */ jsxs("div", { className: "flex justify-between gap-4", children: [
|
|
128
|
+
/* @__PURE__ */ jsxs("dt", { className: "text-mute", children: [
|
|
129
|
+
"Tax (",
|
|
130
|
+
Math.round(taxRate * 1e3) / 10,
|
|
131
|
+
"%)"
|
|
132
|
+
] }),
|
|
133
|
+
/* @__PURE__ */ jsx("dd", { className: "tabular-nums", children: money(tax) })
|
|
134
|
+
] }),
|
|
135
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-1.5 flex items-baseline justify-between gap-4 pt-1.5", children: [
|
|
136
|
+
/* @__PURE__ */ jsx("dt", { className: "font-medium", children: "Total" }),
|
|
137
|
+
/* @__PURE__ */ jsx("dd", { className: "text-[22px] font-medium tracking-[-0.03em] tabular-nums", children: money(total) })
|
|
138
|
+
] }),
|
|
139
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-between gap-4", children: [
|
|
140
|
+
/* @__PURE__ */ jsx("dt", { className: "text-mute", children: "Amount due" }),
|
|
141
|
+
/* @__PURE__ */ jsx("dd", { className: cx("font-medium tabular-nums", paid && "asta-invoice-a animate-[asta-invoice-in_.4s_cubic-bezier(.16,1,.3,1)_both] text-brand"), children: money(paid ? 0 : total) }, paid ? "p" : "d")
|
|
142
|
+
] })
|
|
143
|
+
] }),
|
|
144
|
+
(notes || onPay || onDownload) && /* @__PURE__ */ jsxs("footer", { className: "flex flex-col gap-4 @min-[560px]:flex-row @min-[560px]:items-end @min-[560px]:justify-between", children: [
|
|
145
|
+
notes ? /* @__PURE__ */ jsx("div", { className: "max-w-[360px] text-[12.5px] leading-relaxed text-mute", children: notes }) : /* @__PURE__ */ jsx("span", {}),
|
|
146
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-2 @max-[559px]:[&>*]:flex-1", children: [
|
|
147
|
+
onDownload && /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: onDownload, children: "Download PDF" }),
|
|
148
|
+
onPay && !paid && state !== "draft" && /* @__PURE__ */ jsxs(Button, { variant: "accent", size: "sm", loading: paying, onClick: pay, children: [
|
|
149
|
+
"Pay ",
|
|
150
|
+
money(total)
|
|
151
|
+
] })
|
|
152
|
+
] })
|
|
153
|
+
] }),
|
|
154
|
+
/* @__PURE__ */ jsx("p", { className: "sr-only", "aria-live": "polite", children: paid && paidOn ? `Invoice ${number} paid on ${paidOn}.` : "" })
|
|
155
|
+
] })
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
var invoice_default = Invoice;
|
|
161
|
+
|
|
162
|
+
export {
|
|
163
|
+
Invoice,
|
|
164
|
+
invoice_default
|
|
165
|
+
};
|