asta-ui 0.0.0-stage → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +69 -2
- package/bin/asta-ui.mjs +218 -0
- package/dist/accordion.d.ts +2 -0
- package/dist/accordion.js +9 -0
- package/dist/add-to-cart.d.ts +2 -0
- package/dist/add-to-cart.js +7 -0
- package/dist/avatar.d.ts +2 -0
- package/dist/avatar.js +13 -0
- package/dist/badge.d.ts +2 -0
- package/dist/badge.js +11 -0
- package/dist/base/accordion.d.ts +2 -0
- package/dist/base/accordion.js +9 -0
- package/dist/base/add-to-cart.d.ts +2 -0
- package/dist/base/add-to-cart.js +7 -0
- package/dist/base/avatar.d.ts +2 -0
- package/dist/base/avatar.js +13 -0
- package/dist/base/badge.d.ts +2 -0
- package/dist/base/badge.js +11 -0
- package/dist/base/bubble-wrap.d.ts +2 -0
- package/dist/base/bubble-wrap.js +7 -0
- package/dist/base/button.d.ts +2 -0
- package/dist/base/button.js +13 -0
- package/dist/base/candlestick.d.ts +2 -0
- package/dist/base/candlestick.js +7 -0
- package/dist/base/card-checkout.d.ts +2 -0
- package/dist/base/card-checkout.js +7 -0
- package/dist/base/cart-drawer.d.ts +2 -0
- package/dist/base/cart-drawer.js +7 -0
- package/dist/base/checkbox.d.ts +2 -0
- package/dist/base/checkbox.js +9 -0
- package/dist/base/combo-lock.d.ts +2 -0
- package/dist/base/combo-lock.js +7 -0
- package/dist/base/command-palette.d.ts +2 -0
- package/dist/base/command-palette.js +11 -0
- package/dist/base/dial-knob.d.ts +2 -0
- package/dist/base/dial-knob.js +7 -0
- package/dist/base/dialog.d.ts +2 -0
- package/dist/base/dialog.js +9 -0
- package/dist/base/dropdown-menu.d.ts +2 -0
- package/dist/base/dropdown-menu.js +10 -0
- package/dist/base/elastic-string.d.ts +2 -0
- package/dist/base/elastic-string.js +7 -0
- package/dist/base/field.d.ts +2 -0
- package/dist/base/field.js +11 -0
- package/dist/base/footer.d.ts +2 -0
- package/dist/base/footer.js +12 -0
- package/dist/base/gravity-pills.d.ts +2 -0
- package/dist/base/gravity-pills.js +7 -0
- package/dist/base/hold-to-confirm.d.ts +2 -0
- package/dist/base/hold-to-confirm.js +7 -0
- package/dist/base/ink-trail.d.ts +2 -0
- package/dist/base/ink-trail.js +7 -0
- package/dist/base/input.d.ts +2 -0
- package/dist/base/input.js +11 -0
- package/dist/base/kbd.d.ts +2 -0
- package/dist/base/kbd.js +11 -0
- package/dist/base/morse-tap.d.ts +2 -0
- package/dist/base/morse-tap.js +7 -0
- package/dist/base/motion-button.d.ts +2 -0
- package/dist/base/motion-button.js +23 -0
- package/dist/base/navbar.d.ts +2 -0
- package/dist/base/navbar.js +10 -0
- package/dist/base/needle-field.d.ts +2 -0
- package/dist/base/needle-field.js +7 -0
- package/dist/base/number-input.d.ts +2 -0
- package/dist/base/number-input.js +9 -0
- package/dist/base/order-book.d.ts +2 -0
- package/dist/base/order-book.js +7 -0
- package/dist/base/pay-methods.d.ts +2 -0
- package/dist/base/pay-methods.js +7 -0
- package/dist/base/payment-status.d.ts +2 -0
- package/dist/base/payment-status.js +7 -0
- package/dist/base/pixel-reveal.d.ts +2 -0
- package/dist/base/pixel-reveal.js +7 -0
- package/dist/base/price-chart.d.ts +2 -0
- package/dist/base/price-chart.js +7 -0
- package/dist/base/pricing.d.ts +2 -0
- package/dist/base/pricing.js +14 -0
- package/dist/base/radio-group.d.ts +2 -0
- package/dist/base/radio-group.js +11 -0
- package/dist/base/scramble-text.d.ts +2 -0
- package/dist/base/scramble-text.js +7 -0
- package/dist/base/segmented-control.d.ts +2 -0
- package/dist/base/segmented-control.js +9 -0
- package/dist/base/select.d.ts +2 -0
- package/dist/base/select.js +9 -0
- package/dist/base/settings-panel.d.ts +2 -0
- package/dist/base/settings-panel.js +10 -0
- package/dist/base/sign-in.d.ts +2 -0
- package/dist/base/sign-in.js +10 -0
- package/dist/base/skeleton.d.ts +2 -0
- package/dist/base/skeleton.js +13 -0
- package/dist/base/slider.d.ts +2 -0
- package/dist/base/slider.js +9 -0
- package/dist/base/snap-grid.d.ts +2 -0
- package/dist/base/snap-grid.js +7 -0
- package/dist/base/spinner.d.ts +2 -0
- package/dist/base/spinner.js +11 -0
- package/dist/base/split-flap.d.ts +2 -0
- package/dist/base/split-flap.js +7 -0
- package/dist/base/spotlight-grid.d.ts +2 -0
- package/dist/base/spotlight-grid.js +7 -0
- package/dist/base/switch.d.ts +2 -0
- package/dist/base/switch.js +9 -0
- package/dist/base/tabs.d.ts +2 -0
- package/dist/base/tabs.js +9 -0
- package/dist/base/tag-input.d.ts +2 -0
- package/dist/base/tag-input.js +9 -0
- package/dist/base/textarea-aui-001.d.ts +2 -0
- package/dist/base/textarea-aui-001.js +9 -0
- package/dist/base/textarea-aui-002.d.ts +2 -0
- package/dist/base/textarea-aui-002.js +9 -0
- package/dist/base/textarea-aui-003.d.ts +2 -0
- package/dist/base/textarea-aui-003.js +9 -0
- package/dist/base/textarea-aui-004.d.ts +2 -0
- package/dist/base/textarea-aui-004.js +9 -0
- package/dist/base/textarea-aui-005.d.ts +2 -0
- package/dist/base/textarea-aui-005.js +9 -0
- package/dist/base/textarea-aui-006.d.ts +2 -0
- package/dist/base/textarea-aui-006.js +9 -0
- package/dist/base/textarea-aui-007.d.ts +2 -0
- package/dist/base/textarea-aui-007.js +9 -0
- package/dist/base/textarea-aui-008.d.ts +2 -0
- package/dist/base/textarea-aui-008.js +9 -0
- package/dist/base/textarea.d.ts +2 -0
- package/dist/base/textarea.js +9 -0
- package/dist/base/toast.d.ts +2 -0
- package/dist/base/toast.js +11 -0
- package/dist/base/tooltip.d.ts +2 -0
- package/dist/base/tooltip.js +9 -0
- package/dist/base/trade-ticket.d.ts +2 -0
- package/dist/base/trade-ticket.js +7 -0
- package/dist/base/variant-picker.d.ts +2 -0
- package/dist/base/variant-picker.js +7 -0
- package/dist/base.d.ts +1 -0
- package/dist/base.js +315 -0
- package/dist/bubble-wrap.d.ts +2 -0
- package/dist/bubble-wrap.js +7 -0
- package/dist/button.d.ts +2 -0
- package/dist/button.js +13 -0
- package/dist/candlestick.d.ts +2 -0
- package/dist/candlestick.js +7 -0
- package/dist/card-checkout.d.ts +2 -0
- package/dist/card-checkout.js +7 -0
- package/dist/cart-drawer.d.ts +2 -0
- package/dist/cart-drawer.js +7 -0
- package/dist/checkbox.d.ts +2 -0
- package/dist/checkbox.js +9 -0
- package/dist/chunk-2KJNBHUV.js +137 -0
- package/dist/chunk-2OGTIQVU.js +237 -0
- package/dist/chunk-2Z5Z4YYZ.js +57 -0
- package/dist/chunk-37JQA6PI.js +98 -0
- package/dist/chunk-3JNUC3FU.js +92 -0
- package/dist/chunk-4L4EKC46.js +360 -0
- package/dist/chunk-4WK3F76T.js +57 -0
- package/dist/chunk-56BEMYK3.js +36 -0
- package/dist/chunk-5A36JYGI.js +71 -0
- package/dist/chunk-5RPJPL2V.js +102 -0
- package/dist/chunk-6322OCI4.js +189 -0
- package/dist/chunk-66OZ7CBK.js +153 -0
- package/dist/chunk-6AZKJUL4.js +67 -0
- package/dist/chunk-7L4YE6HM.js +56 -0
- package/dist/chunk-7MGB7FVD.js +221 -0
- package/dist/chunk-7RCBOTWL.js +138 -0
- package/dist/chunk-7TK42PS3.js +247 -0
- package/dist/chunk-7UMBKY3H.js +105 -0
- package/dist/chunk-AS6RA64I.js +53 -0
- package/dist/chunk-B7V4ZTKI.js +53 -0
- package/dist/chunk-BH2DLHFW.js +145 -0
- package/dist/chunk-BOJCW7Z7.js +131 -0
- package/dist/chunk-C2G5BUEG.js +197 -0
- package/dist/chunk-CLCP2GFW.js +93 -0
- package/dist/chunk-CNY76NHF.js +92 -0
- package/dist/chunk-CTO36MY2.js +87 -0
- package/dist/chunk-DK2BM32V.js +71 -0
- package/dist/chunk-DQWKBQBT.js +68 -0
- package/dist/chunk-DUGKLVQJ.js +89 -0
- package/dist/chunk-E4MX3E3B.js +66 -0
- package/dist/chunk-EG7NXGDD.js +109 -0
- package/dist/chunk-EVSTTLOT.js +141 -0
- package/dist/chunk-F5I6EK7F.js +55 -0
- package/dist/chunk-FATLQKRY.js +88 -0
- package/dist/chunk-FK2LKLRN.js +89 -0
- package/dist/chunk-FT7WZV3D.js +184 -0
- package/dist/chunk-FUNXYRSG.js +198 -0
- package/dist/chunk-H4URFOQC.js +69 -0
- package/dist/chunk-H5C7HOQJ.js +84 -0
- package/dist/chunk-JAQANAOP.js +247 -0
- package/dist/chunk-JIVLBHHE.js +266 -0
- package/dist/chunk-KEMMI76V.js +94 -0
- package/dist/chunk-N6FMS47F.js +225 -0
- package/dist/chunk-NDBLIYMX.js +62 -0
- package/dist/chunk-OBU2UOYI.js +96 -0
- package/dist/chunk-OLNMOTAD.js +141 -0
- package/dist/chunk-OQU6KGVR.js +70 -0
- package/dist/chunk-PIC5ZIR3.js +55 -0
- package/dist/chunk-PSTMF66E.js +79 -0
- package/dist/chunk-Q7OHWQP2.js +108 -0
- package/dist/chunk-QDRBMWRX.js +190 -0
- package/dist/chunk-R3LWG23K.js +138 -0
- package/dist/chunk-RS3XHHDE.js +77 -0
- package/dist/chunk-SAJ4D3Z2.js +206 -0
- package/dist/chunk-SATIWCJQ.js +141 -0
- package/dist/chunk-SRGDJSW7.js +107 -0
- package/dist/chunk-T4SOPNM5.js +107 -0
- package/dist/chunk-TCID6NNE.js +69 -0
- package/dist/chunk-TIAKMX7U.js +49 -0
- package/dist/chunk-TRIXMWR3.js +74 -0
- package/dist/chunk-TRR3J5NJ.js +28 -0
- package/dist/chunk-U7BYEW3Y.js +115 -0
- package/dist/chunk-U7VX6A6K.js +136 -0
- package/dist/chunk-UAP47MSR.js +230 -0
- package/dist/chunk-UXRTPEH7.js +57 -0
- package/dist/chunk-VGBP42IZ.js +84 -0
- package/dist/chunk-VWYX5IRP.js +92 -0
- package/dist/chunk-WRB66XD3.js +31 -0
- package/dist/chunk-WSL4JGEA.js +87 -0
- package/dist/chunk-WVIV4JBH.js +69 -0
- package/dist/chunk-WWQV7LE7.js +198 -0
- package/dist/chunk-XIU7K2YE.js +60 -0
- package/dist/chunk-XNL5BLUR.js +283 -0
- package/dist/chunk-XRVVZA2Y.js +360 -0
- package/dist/chunk-XYNJQGYX.js +107 -0
- package/dist/chunk-YON5SU2G.js +156 -0
- package/dist/chunk-Z6IAITZJ.js +214 -0
- package/dist/chunk-ZE7BT2K4.js +173 -0
- package/dist/chunk-ZN3W5PAI.js +107 -0
- package/dist/chunk-ZQV2GAWY.js +178 -0
- package/dist/chunk-ZRGPSYW6.js +237 -0
- package/dist/chunk-ZWBJUJTR.js +83 -0
- package/dist/combo-lock.d.ts +2 -0
- package/dist/combo-lock.js +7 -0
- package/dist/command-palette.d.ts +2 -0
- package/dist/command-palette.js +11 -0
- package/dist/dial-knob.d.ts +2 -0
- package/dist/dial-knob.js +7 -0
- package/dist/dialog.d.ts +2 -0
- package/dist/dialog.js +9 -0
- package/dist/dropdown-menu.d.ts +2 -0
- package/dist/dropdown-menu.js +10 -0
- package/dist/elastic-string.d.ts +2 -0
- package/dist/elastic-string.js +7 -0
- package/dist/field.d.ts +2 -0
- package/dist/field.js +11 -0
- package/dist/footer.d.ts +2 -0
- package/dist/footer.js +12 -0
- package/dist/gravity-pills.d.ts +2 -0
- package/dist/gravity-pills.js +7 -0
- package/dist/hold-to-confirm.d.ts +2 -0
- package/dist/hold-to-confirm.js +7 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +315 -0
- package/dist/ink-trail.d.ts +2 -0
- package/dist/ink-trail.js +7 -0
- package/dist/input.d.ts +2 -0
- package/dist/input.js +11 -0
- package/dist/kbd.d.ts +2 -0
- package/dist/kbd.js +11 -0
- package/dist/morse-tap.d.ts +2 -0
- package/dist/morse-tap.js +7 -0
- package/dist/motion-button.d.ts +2 -0
- package/dist/motion-button.js +23 -0
- package/dist/navbar.d.ts +2 -0
- package/dist/navbar.js +10 -0
- package/dist/needle-field.d.ts +2 -0
- package/dist/needle-field.js +7 -0
- package/dist/number-input.d.ts +2 -0
- package/dist/number-input.js +9 -0
- package/dist/order-book.d.ts +2 -0
- package/dist/order-book.js +7 -0
- package/dist/pay-methods.d.ts +2 -0
- package/dist/pay-methods.js +7 -0
- package/dist/payment-status.d.ts +2 -0
- package/dist/payment-status.js +7 -0
- package/dist/pixel-reveal.d.ts +2 -0
- package/dist/pixel-reveal.js +7 -0
- package/dist/price-chart.d.ts +2 -0
- package/dist/price-chart.js +7 -0
- package/dist/pricing.d.ts +2 -0
- package/dist/pricing.js +14 -0
- package/dist/radio-group.d.ts +2 -0
- package/dist/radio-group.js +11 -0
- package/dist/scramble-text.d.ts +2 -0
- package/dist/scramble-text.js +7 -0
- package/dist/segmented-control.d.ts +2 -0
- package/dist/segmented-control.js +9 -0
- package/dist/select.d.ts +2 -0
- package/dist/select.js +9 -0
- package/dist/settings-panel.d.ts +2 -0
- package/dist/settings-panel.js +10 -0
- package/dist/sign-in.d.ts +2 -0
- package/dist/sign-in.js +10 -0
- package/dist/skeleton.d.ts +2 -0
- package/dist/skeleton.js +13 -0
- package/dist/slider.d.ts +2 -0
- package/dist/slider.js +9 -0
- package/dist/snap-grid.d.ts +2 -0
- package/dist/snap-grid.js +7 -0
- package/dist/spinner.d.ts +2 -0
- package/dist/spinner.js +11 -0
- package/dist/split-flap.d.ts +2 -0
- package/dist/split-flap.js +7 -0
- package/dist/spotlight-grid.d.ts +2 -0
- package/dist/spotlight-grid.js +7 -0
- package/dist/styles.css +46 -0
- package/dist/switch.d.ts +2 -0
- package/dist/switch.js +9 -0
- package/dist/tabs.d.ts +2 -0
- package/dist/tabs.js +9 -0
- package/dist/tag-input.d.ts +2 -0
- package/dist/tag-input.js +9 -0
- package/dist/textarea-aui-001.d.ts +2 -0
- package/dist/textarea-aui-001.js +9 -0
- package/dist/textarea-aui-002.d.ts +2 -0
- package/dist/textarea-aui-002.js +9 -0
- package/dist/textarea-aui-003.d.ts +2 -0
- package/dist/textarea-aui-003.js +9 -0
- package/dist/textarea-aui-004.d.ts +2 -0
- package/dist/textarea-aui-004.js +9 -0
- package/dist/textarea-aui-005.d.ts +2 -0
- package/dist/textarea-aui-005.js +9 -0
- package/dist/textarea-aui-006.d.ts +2 -0
- package/dist/textarea-aui-006.js +9 -0
- package/dist/textarea-aui-007.d.ts +2 -0
- package/dist/textarea-aui-007.js +9 -0
- package/dist/textarea-aui-008.d.ts +2 -0
- package/dist/textarea-aui-008.js +9 -0
- package/dist/textarea.d.ts +2 -0
- package/dist/textarea.js +9 -0
- package/dist/toast.d.ts +2 -0
- package/dist/toast.js +11 -0
- package/dist/tooltip.d.ts +2 -0
- package/dist/tooltip.js +9 -0
- package/dist/trade-ticket.d.ts +2 -0
- package/dist/trade-ticket.js +7 -0
- package/dist/types/components/kit/accordion.d.ts +19 -0
- package/dist/types/components/kit/avatar.d.ts +32 -0
- package/dist/types/components/kit/badge.d.ts +23 -0
- package/dist/types/components/kit/base/accordion.d.ts +19 -0
- package/dist/types/components/kit/base/avatar.d.ts +32 -0
- package/dist/types/components/kit/base/button.d.ts +38 -0
- package/dist/types/components/kit/base/checkbox.d.ts +19 -0
- package/dist/types/components/kit/base/command-palette.d.ts +38 -0
- package/dist/types/components/kit/base/dialog.d.ts +21 -0
- package/dist/types/components/kit/base/dropdown-menu.d.ts +32 -0
- package/dist/types/components/kit/base/footer.d.ts +29 -0
- package/dist/types/components/kit/base/navbar.d.ts +54 -0
- package/dist/types/components/kit/base/pricing.d.ts +39 -0
- package/dist/types/components/kit/base/radio-group.d.ts +29 -0
- package/dist/types/components/kit/base/segmented-control.d.ts +23 -0
- package/dist/types/components/kit/base/select.d.ts +29 -0
- package/dist/types/components/kit/base/settings-panel.d.ts +29 -0
- package/dist/types/components/kit/base/sign-in.d.ts +17 -0
- package/dist/types/components/kit/base/slider.d.ts +27 -0
- package/dist/types/components/kit/base/switch.d.ts +22 -0
- package/dist/types/components/kit/base/tabs.d.ts +23 -0
- package/dist/types/components/kit/base/tooltip.d.ts +20 -0
- package/dist/types/components/kit/base/variants/textarea-aui-008.d.ts +23 -0
- package/dist/types/components/kit/button.d.ts +38 -0
- package/dist/types/components/kit/checkbox.d.ts +19 -0
- package/dist/types/components/kit/command-palette.d.ts +38 -0
- package/dist/types/components/kit/dialog.d.ts +21 -0
- package/dist/types/components/kit/dropdown-menu.d.ts +32 -0
- package/dist/types/components/kit/field.d.ts +19 -0
- package/dist/types/components/kit/footer.d.ts +29 -0
- package/dist/types/components/kit/input.d.ts +19 -0
- package/dist/types/components/kit/kbd.d.ts +26 -0
- package/dist/types/components/kit/motion-button.d.ts +30 -0
- package/dist/types/components/kit/navbar.d.ts +54 -0
- package/dist/types/components/kit/number-input.d.ts +20 -0
- package/dist/types/components/kit/pricing.d.ts +39 -0
- package/dist/types/components/kit/radio-group.d.ts +29 -0
- package/dist/types/components/kit/segmented-control.d.ts +23 -0
- package/dist/types/components/kit/select.d.ts +29 -0
- package/dist/types/components/kit/settings-panel.d.ts +29 -0
- package/dist/types/components/kit/sign-in.d.ts +17 -0
- package/dist/types/components/kit/skeleton.d.ts +20 -0
- package/dist/types/components/kit/slider.d.ts +27 -0
- package/dist/types/components/kit/spinner.d.ts +18 -0
- package/dist/types/components/kit/switch.d.ts +22 -0
- package/dist/types/components/kit/tabs.d.ts +23 -0
- package/dist/types/components/kit/tag-input.d.ts +16 -0
- package/dist/types/components/kit/textarea.d.ts +11 -0
- package/dist/types/components/kit/toast.d.ts +32 -0
- package/dist/types/components/kit/tooltip.d.ts +20 -0
- package/dist/types/components/kit/variants/textarea-aui-001.d.ts +13 -0
- package/dist/types/components/kit/variants/textarea-aui-002.d.ts +13 -0
- package/dist/types/components/kit/variants/textarea-aui-003.d.ts +16 -0
- package/dist/types/components/kit/variants/textarea-aui-004.d.ts +7 -0
- package/dist/types/components/kit/variants/textarea-aui-005.d.ts +8 -0
- package/dist/types/components/kit/variants/textarea-aui-006.d.ts +21 -0
- package/dist/types/components/kit/variants/textarea-aui-007.d.ts +20 -0
- package/dist/types/components/kit/variants/textarea-aui-008.d.ts +23 -0
- package/dist/types/components/lab/blocks/AddToCart.d.ts +10 -0
- package/dist/types/components/lab/blocks/BubbleWrap.d.ts +2 -0
- package/dist/types/components/lab/blocks/Candlestick.d.ts +2 -0
- package/dist/types/components/lab/blocks/CardCheckout.d.ts +5 -0
- package/dist/types/components/lab/blocks/CartDrawer.d.ts +2 -0
- package/dist/types/components/lab/blocks/ComboLock.d.ts +2 -0
- package/dist/types/components/lab/blocks/DialKnob.d.ts +2 -0
- package/dist/types/components/lab/blocks/ElasticString.d.ts +2 -0
- package/dist/types/components/lab/blocks/GravityPills.d.ts +2 -0
- package/dist/types/components/lab/blocks/HoldToConfirm.d.ts +6 -0
- package/dist/types/components/lab/blocks/InkTrail.d.ts +2 -0
- package/dist/types/components/lab/blocks/MorseTap.d.ts +2 -0
- package/dist/types/components/lab/blocks/NeedleField.d.ts +2 -0
- package/dist/types/components/lab/blocks/OrderBook.d.ts +2 -0
- package/dist/types/components/lab/blocks/PayMethods.d.ts +2 -0
- package/dist/types/components/lab/blocks/PaymentStatus.d.ts +2 -0
- package/dist/types/components/lab/blocks/PixelReveal.d.ts +2 -0
- package/dist/types/components/lab/blocks/PriceChart.d.ts +2 -0
- package/dist/types/components/lab/blocks/ScrambleText.d.ts +1 -0
- package/dist/types/components/lab/blocks/SnapGrid.d.ts +2 -0
- package/dist/types/components/lab/blocks/SplitFlap.d.ts +2 -0
- package/dist/types/components/lab/blocks/SpotlightGrid.d.ts +1 -0
- package/dist/types/components/lab/blocks/TradeTicket.d.ts +2 -0
- package/dist/types/components/lab/blocks/VariantPicker.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/accordion.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/add-to-cart.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/avatar.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/badge.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/accordion.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/add-to-cart.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/avatar.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/badge.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/bubble-wrap.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/button.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/candlestick.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/card-checkout.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/cart-drawer.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/checkbox.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/combo-lock.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/command-palette.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/dial-knob.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/dialog.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/dropdown-menu.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/elastic-string.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/field.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/footer.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/gravity-pills.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/hold-to-confirm.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/ink-trail.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/input.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/kbd.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/morse-tap.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/motion-button.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/navbar.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/needle-field.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/number-input.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/order-book.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/pay-methods.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/payment-status.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/pixel-reveal.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/price-chart.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/pricing.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/radio-group.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/scramble-text.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/segmented-control.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/select.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/settings-panel.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/sign-in.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/skeleton.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/slider.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/snap-grid.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/spinner.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/split-flap.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/spotlight-grid.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/switch.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/tabs.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/tag-input.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/textarea-aui-001.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/textarea-aui-002.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/textarea-aui-003.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/textarea-aui-004.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/textarea-aui-005.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/textarea-aui-006.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/textarea-aui-007.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/textarea-aui-008.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/textarea.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/toast.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/tooltip.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/trade-ticket.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/variant-picker.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base.d.ts +100 -0
- package/dist/types/packages/asta-ui/src/bubble-wrap.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/button.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/candlestick.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/card-checkout.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/cart-drawer.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/checkbox.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/combo-lock.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/command-palette.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/dial-knob.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/dialog.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/dropdown-menu.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/elastic-string.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/field.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/footer.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/gravity-pills.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/hold-to-confirm.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/index.d.ts +100 -0
- package/dist/types/packages/asta-ui/src/ink-trail.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/input.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/kbd.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/morse-tap.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/motion-button.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/navbar.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/needle-field.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/number-input.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/order-book.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/pay-methods.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/payment-status.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/pixel-reveal.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/price-chart.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/pricing.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/radio-group.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/scramble-text.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/segmented-control.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/select.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/settings-panel.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/sign-in.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/skeleton.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/slider.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/snap-grid.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/spinner.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/split-flap.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/spotlight-grid.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/switch.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/tabs.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/tag-input.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/textarea-aui-001.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/textarea-aui-002.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/textarea-aui-003.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/textarea-aui-004.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/textarea-aui-005.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/textarea-aui-006.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/textarea-aui-007.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/textarea-aui-008.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/textarea.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/toast.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/tooltip.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/trade-ticket.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/variant-picker.d.ts +2 -0
- package/dist/variant-picker.d.ts +2 -0
- package/dist/variant-picker.js +7 -0
- package/package.json +86 -4
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// components/lab/blocks/AddToCart.tsx
|
|
4
|
+
import { useEffect, useRef, useState } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
var EASE = "cubic-bezier(.16,1,.3,1)";
|
|
7
|
+
var RING = "shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_10%,transparent)]";
|
|
8
|
+
var CartIcon = ({ className = "h-[18px] w-[18px]" }) => /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 20 20", className, fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
9
|
+
/* @__PURE__ */ jsx("path", { d: "M2.5 3h2l2 9.5h8.5l1.8-6.5H6" }),
|
|
10
|
+
/* @__PURE__ */ jsx("circle", { cx: "8", cy: "16", r: "1.1" }),
|
|
11
|
+
/* @__PURE__ */ jsx("circle", { cx: "14.5", cy: "16", r: "1.1" })
|
|
12
|
+
] });
|
|
13
|
+
function AddToCart({
|
|
14
|
+
image = "https://ui.astabyte.com/lab/headphones.jpg",
|
|
15
|
+
imageAlt = "",
|
|
16
|
+
name = "Studio headphones",
|
|
17
|
+
meta = "Audio \xB7 Graphite",
|
|
18
|
+
price = "$189.00"
|
|
19
|
+
} = {}) {
|
|
20
|
+
const [count, setCount] = useState(0);
|
|
21
|
+
const [pressed, setPressed] = useState(false);
|
|
22
|
+
const [paused, setPaused] = useState(false);
|
|
23
|
+
const root = useRef(null);
|
|
24
|
+
const from = useRef(null);
|
|
25
|
+
const cart = useRef(null);
|
|
26
|
+
const idle = useRef(null);
|
|
27
|
+
const badge = useRef(null);
|
|
28
|
+
const bump = () => {
|
|
29
|
+
cart.current?.animate(
|
|
30
|
+
[
|
|
31
|
+
{ transform: "scale(1, 1)" },
|
|
32
|
+
{ transform: "scale(1.12, 0.88)", offset: 0.22 },
|
|
33
|
+
{ transform: "scale(0.95, 1.05)", offset: 0.5 },
|
|
34
|
+
{ transform: "scale(1.02, 0.99)", offset: 0.75 },
|
|
35
|
+
{ transform: "scale(1, 1)" }
|
|
36
|
+
],
|
|
37
|
+
{ duration: 680, easing: "cubic-bezier(.22,1,.36,1)" }
|
|
38
|
+
);
|
|
39
|
+
badge.current?.animate(
|
|
40
|
+
[{ transform: "scale(0.5)" }, { transform: "scale(1.22)", offset: 0.4 }, { transform: "scale(0.94)", offset: 0.7 }, { transform: "scale(1)" }],
|
|
41
|
+
{ duration: 620, easing: "cubic-bezier(.22,1,.36,1)" }
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
const fly = (then) => {
|
|
45
|
+
const box = root.current;
|
|
46
|
+
const a = from.current?.getBoundingClientRect();
|
|
47
|
+
const c = cart.current?.getBoundingClientRect();
|
|
48
|
+
if (!box || !a || !c || window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
49
|
+
then();
|
|
50
|
+
bump();
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const b = box.getBoundingClientRect();
|
|
54
|
+
const dot = document.createElement("span");
|
|
55
|
+
const x0 = a.left + a.width / 2 - b.left;
|
|
56
|
+
const y0 = a.top + a.height / 2 - b.top;
|
|
57
|
+
Object.assign(dot.style, {
|
|
58
|
+
position: "absolute",
|
|
59
|
+
left: `${x0 - 6}px`,
|
|
60
|
+
top: `${y0 - 6}px`,
|
|
61
|
+
width: "12px",
|
|
62
|
+
height: "12px",
|
|
63
|
+
borderRadius: "999px",
|
|
64
|
+
background: "var(--brand)",
|
|
65
|
+
boxShadow: "0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent)",
|
|
66
|
+
pointerEvents: "none",
|
|
67
|
+
zIndex: "20"
|
|
68
|
+
});
|
|
69
|
+
box.appendChild(dot);
|
|
70
|
+
const dx = c.left + c.width / 2 - b.left - x0;
|
|
71
|
+
const dy = c.top + c.height / 2 - b.top - y0;
|
|
72
|
+
const lift = Math.min(110, Math.abs(dy) * 0.6 + 40);
|
|
73
|
+
const ease = (t) => t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2;
|
|
74
|
+
const cx = dx * 0.35;
|
|
75
|
+
const cy = Math.min(0, dy) - lift;
|
|
76
|
+
const frames = [];
|
|
77
|
+
const N = 40;
|
|
78
|
+
for (let i = 0; i <= N; i++) {
|
|
79
|
+
const t = ease(i / N);
|
|
80
|
+
const x = 2 * (1 - t) * t * cx + t * t * dx;
|
|
81
|
+
const y = 2 * (1 - t) * t * cy + t * t * dy;
|
|
82
|
+
frames.push({ transform: `translate(${x}px, ${y}px) scale(${1 - 0.5 * t})`, opacity: t < 0.8 ? 1 : 1 - (t - 0.8) / 0.2 });
|
|
83
|
+
}
|
|
84
|
+
dot.style.willChange = "transform, opacity";
|
|
85
|
+
const anim = dot.animate(frames, { duration: 760, easing: "linear" });
|
|
86
|
+
anim.onfinish = () => {
|
|
87
|
+
dot.remove();
|
|
88
|
+
then();
|
|
89
|
+
bump();
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
const add = () => fly(() => setCount((c) => c + 1));
|
|
93
|
+
const takeOver = () => {
|
|
94
|
+
setPaused(true);
|
|
95
|
+
if (idle.current) clearTimeout(idle.current);
|
|
96
|
+
idle.current = setTimeout(() => setPaused(false), 8e3);
|
|
97
|
+
};
|
|
98
|
+
useEffect(() => () => void (idle.current && clearTimeout(idle.current)), []);
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
if (paused) return;
|
|
101
|
+
const t = [];
|
|
102
|
+
let alive = true;
|
|
103
|
+
const run = () => {
|
|
104
|
+
t.push(setTimeout(() => setPressed(true), 1100));
|
|
105
|
+
t.push(
|
|
106
|
+
setTimeout(() => {
|
|
107
|
+
setPressed(false);
|
|
108
|
+
if (alive) add();
|
|
109
|
+
}, 1280)
|
|
110
|
+
);
|
|
111
|
+
t.push(setTimeout(() => alive && add(), 3200));
|
|
112
|
+
t.push(setTimeout(() => setCount(0), 5600));
|
|
113
|
+
t.push(setTimeout(() => alive && run(), 6400));
|
|
114
|
+
};
|
|
115
|
+
t.push(setTimeout(() => alive && setCount(0), 0));
|
|
116
|
+
run();
|
|
117
|
+
return () => {
|
|
118
|
+
alive = false;
|
|
119
|
+
t.forEach(clearTimeout);
|
|
120
|
+
};
|
|
121
|
+
}, [paused]);
|
|
122
|
+
const on = count > 0;
|
|
123
|
+
return /* @__PURE__ */ jsxs("div", { ref: root, className: "relative h-full w-full overflow-hidden", style: { containerType: "size" }, children: [
|
|
124
|
+
/* @__PURE__ */ jsx("style", { href: "asta-addtocart", precedence: "asta", children: `
|
|
125
|
+
@keyframes lab-atc-roll { from { transform: translateY(70%); opacity: 0; filter: blur(2px) } to { transform: none; opacity: 1; filter: none } }
|
|
126
|
+
@media (prefers-reduced-motion: reduce) { .lab-atc-anim { animation: none !important } }
|
|
127
|
+
` }),
|
|
128
|
+
/* @__PURE__ */ jsxs(
|
|
129
|
+
"div",
|
|
130
|
+
{
|
|
131
|
+
ref: cart,
|
|
132
|
+
className: `absolute left-4 top-4 flex h-10 w-10 items-center justify-center rounded-[9px] bg-paper-2 text-ink-2 ${RING}`,
|
|
133
|
+
"aria-label": `Cart, ${count} item${count === 1 ? "" : "s"}`,
|
|
134
|
+
role: "status",
|
|
135
|
+
children: [
|
|
136
|
+
/* @__PURE__ */ jsx(CartIcon, {}),
|
|
137
|
+
/* @__PURE__ */ jsx(
|
|
138
|
+
"span",
|
|
139
|
+
{
|
|
140
|
+
ref: badge,
|
|
141
|
+
"aria-hidden": true,
|
|
142
|
+
className: "absolute -right-1.5 -top-1.5 flex h-[18px] min-w-[18px] items-center justify-center rounded-full bg-brand px-1 text-[10.5px] font-semibold tabular-nums text-paper transition-[opacity,scale] duration-500 motion-reduce:transition-none",
|
|
143
|
+
style: { transitionTimingFunction: EASE, opacity: on ? 1 : 0, scale: on ? "1" : "0.4" },
|
|
144
|
+
children: Math.max(count, 1)
|
|
145
|
+
}
|
|
146
|
+
)
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
),
|
|
150
|
+
/* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center justify-center px-5 pt-10", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-[460px] items-center gap-[5cqw]", children: [
|
|
151
|
+
/* @__PURE__ */ jsxs("div", { className: `relative shrink-0 overflow-hidden rounded-[12px] bg-[#f4f4f4] ${RING}`, style: { width: "min(38cqw, 62cqh)", aspectRatio: "1" }, children: [
|
|
152
|
+
/* @__PURE__ */ jsx("img", { src: image, alt: imageAlt, width: 480, height: 480, loading: "lazy", decoding: "async", draggable: false, className: "absolute inset-0 h-full w-full object-cover grayscale" }),
|
|
153
|
+
/* @__PURE__ */ jsx("span", { className: "absolute bottom-2.5 left-3 font-mono text-[10px] uppercase tracking-wider text-black/45", children: "N\xBA 04" })
|
|
154
|
+
] }),
|
|
155
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
156
|
+
/* @__PURE__ */ jsx("span", { className: "font-mono text-[10.5px] uppercase tracking-wider text-mute", children: meta }),
|
|
157
|
+
/* @__PURE__ */ jsx("span", { className: "mt-1.5 truncate text-[clamp(15px,4.4cqw,22px)] font-medium tracking-[-0.02em] text-ink", children: name }),
|
|
158
|
+
/* @__PURE__ */ jsx("span", { className: "mt-0.5 text-[clamp(13px,3.4cqw,16px)] tabular-nums text-ink-2", children: price }),
|
|
159
|
+
/* @__PURE__ */ jsxs("div", { ref: from, className: "relative mt-[max(14px,5cqh)] h-10 w-full max-w-[220px]", children: [
|
|
160
|
+
/* @__PURE__ */ jsx(
|
|
161
|
+
"button",
|
|
162
|
+
{
|
|
163
|
+
type: "button",
|
|
164
|
+
onClick: () => {
|
|
165
|
+
takeOver();
|
|
166
|
+
add();
|
|
167
|
+
},
|
|
168
|
+
tabIndex: on ? -1 : 0,
|
|
169
|
+
"aria-hidden": on,
|
|
170
|
+
className: `absolute inset-0 flex items-center justify-center gap-2 rounded-[9px] bg-ink text-[13.5px] font-medium text-paper outline-none transition-[opacity,transform] duration-[600ms] focus-visible:ring-2 focus-visible:ring-brand/60 ${on ? "pointer-events-none scale-[0.92] opacity-0" : pressed ? "scale-[0.96]" : ""}`,
|
|
171
|
+
style: { transitionTimingFunction: EASE },
|
|
172
|
+
children: "Add to cart"
|
|
173
|
+
}
|
|
174
|
+
),
|
|
175
|
+
/* @__PURE__ */ jsxs(
|
|
176
|
+
"div",
|
|
177
|
+
{
|
|
178
|
+
className: `absolute inset-0 flex items-center justify-between rounded-[9px] bg-paper-2 px-1 transition-[opacity,transform] duration-[600ms] ${RING} ${on ? "" : "pointer-events-none scale-[1.06] opacity-0"}`,
|
|
179
|
+
style: { transitionTimingFunction: EASE },
|
|
180
|
+
"aria-hidden": !on,
|
|
181
|
+
children: [
|
|
182
|
+
/* @__PURE__ */ jsx(
|
|
183
|
+
"button",
|
|
184
|
+
{
|
|
185
|
+
type: "button",
|
|
186
|
+
tabIndex: on ? 0 : -1,
|
|
187
|
+
"aria-label": "Remove one",
|
|
188
|
+
onClick: () => {
|
|
189
|
+
takeOver();
|
|
190
|
+
setCount((c) => Math.max(0, c - 1));
|
|
191
|
+
},
|
|
192
|
+
className: "flex h-8 w-8 items-center justify-center rounded-[7px] text-[17px] text-ink-2 outline-none transition-colors hover:bg-paper hover:text-ink focus-visible:ring-2 focus-visible:ring-brand/60",
|
|
193
|
+
children: "\u2212"
|
|
194
|
+
}
|
|
195
|
+
),
|
|
196
|
+
/* @__PURE__ */ jsx("span", { className: "relative h-5 overflow-hidden text-[13.5px] font-medium tabular-nums text-ink", children: /* @__PURE__ */ jsxs("span", { className: "lab-atc-anim block", style: { animation: `lab-atc-roll .55s ${EASE}` }, children: [
|
|
197
|
+
count,
|
|
198
|
+
" in cart"
|
|
199
|
+
] }, count) }),
|
|
200
|
+
/* @__PURE__ */ jsx(
|
|
201
|
+
"button",
|
|
202
|
+
{
|
|
203
|
+
type: "button",
|
|
204
|
+
tabIndex: on ? 0 : -1,
|
|
205
|
+
"aria-label": "Add one",
|
|
206
|
+
onClick: () => {
|
|
207
|
+
takeOver();
|
|
208
|
+
add();
|
|
209
|
+
},
|
|
210
|
+
className: "flex h-8 w-8 items-center justify-center rounded-[7px] text-[17px] text-ink-2 outline-none transition-colors hover:bg-paper hover:text-ink focus-visible:ring-2 focus-visible:ring-brand/60",
|
|
211
|
+
children: "+"
|
|
212
|
+
}
|
|
213
|
+
)
|
|
214
|
+
]
|
|
215
|
+
}
|
|
216
|
+
)
|
|
217
|
+
] })
|
|
218
|
+
] })
|
|
219
|
+
] }) })
|
|
220
|
+
] });
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export {
|
|
224
|
+
AddToCart
|
|
225
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// components/kit/spinner.tsx
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
var cx = (...c) => c.filter(Boolean).join(" ");
|
|
6
|
+
var KEYFRAMES = `
|
|
7
|
+
@keyframes kit-spin { to { transform: rotate(360deg) } }
|
|
8
|
+
@keyframes kit-dot { 0%, 80%, 100% { transform: scale(.55); opacity: .35 } 40% { transform: scale(1); opacity: 1 } }
|
|
9
|
+
@keyframes kit-bar { 0%, 100% { transform: scaleY(.35) } 50% { transform: scaleY(1) } }
|
|
10
|
+
@keyframes kit-indet { 0% { left: -40%; width: 40% } 60% { width: 55% } 100% { left: 100%; width: 40% } }
|
|
11
|
+
@media (prefers-reduced-motion: reduce) { .kit-spinner * { animation-duration: 2.4s !important } }
|
|
12
|
+
`;
|
|
13
|
+
function Spinner({ variant = "ring", label = "Loading", className }) {
|
|
14
|
+
return /* @__PURE__ */ jsxs("span", { role: "status", "aria-label": label, className: cx("kit-spinner relative inline-flex h-[1em] w-[1em] shrink-0 items-center justify-center", className), children: [
|
|
15
|
+
/* @__PURE__ */ jsx("style", { href: "asta-spinner", precedence: "asta", children: KEYFRAMES }),
|
|
16
|
+
variant === "ring" && /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", className: "h-full w-full animate-[kit-spin_.8s_linear_infinite]", fill: "none", "aria-hidden": true, children: [
|
|
17
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "9.5", stroke: "currentColor", strokeOpacity: ".18", strokeWidth: "2.5" }),
|
|
18
|
+
/* @__PURE__ */ jsx("path", { d: "M21.5 12A9.5 9.5 0 0 0 12 2.5", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round" })
|
|
19
|
+
] }),
|
|
20
|
+
variant === "dots" && /* @__PURE__ */ jsx("span", { className: "flex h-full w-full items-center justify-between", "aria-hidden": true, children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx("span", { className: "h-[26%] w-[26%] rounded-full bg-current", style: { animation: `kit-dot 1.1s ${i * 0.16}s cubic-bezier(.16,1,.3,1) infinite` } }, i)) }),
|
|
21
|
+
variant === "bars" && /* @__PURE__ */ jsx("span", { className: "flex h-[80%] w-full items-center justify-between", "aria-hidden": true, children: [0, 1, 2, 3].map((i) => /* @__PURE__ */ jsx("span", { className: "h-full w-[16%] rounded-full bg-current", style: { animation: `kit-bar .9s ${i * 0.12}s ease-in-out infinite` } }, i)) }),
|
|
22
|
+
variant === "orbit" && /* @__PURE__ */ jsxs("span", { className: "relative h-full w-full", "aria-hidden": true, children: [
|
|
23
|
+
/* @__PURE__ */ jsx("span", { className: "absolute inset-[30%] rounded-full bg-current opacity-25" }),
|
|
24
|
+
/* @__PURE__ */ jsx("span", { className: "absolute inset-0 animate-[kit-spin_1.2s_cubic-bezier(.6,.1,.4,.9)_infinite]", children: /* @__PURE__ */ jsx("span", { className: "absolute left-1/2 top-0 h-[24%] w-[24%] -translate-x-1/2 rounded-full bg-current" }) }),
|
|
25
|
+
/* @__PURE__ */ jsx("span", { className: "absolute inset-0 animate-[kit-spin_1.8s_linear_infinite_reverse]", children: /* @__PURE__ */ jsx("span", { className: "absolute bottom-[6%] left-1/2 h-[16%] w-[16%] -translate-x-1/2 rounded-full bg-current opacity-60" }) })
|
|
26
|
+
] })
|
|
27
|
+
] });
|
|
28
|
+
}
|
|
29
|
+
function Progress({ value, label, showValue, className }) {
|
|
30
|
+
const v = value === void 0 ? void 0 : Math.max(0, Math.min(100, value));
|
|
31
|
+
return /* @__PURE__ */ jsxs("div", { className: cx("w-full", className), children: [
|
|
32
|
+
(label || showValue) && /* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-between text-[13px]", children: [
|
|
33
|
+
/* @__PURE__ */ jsx("span", { className: "text-ink-2", children: label }),
|
|
34
|
+
showValue && v !== void 0 && /* @__PURE__ */ jsxs("span", { className: "tabular-nums text-mute", children: [
|
|
35
|
+
Math.round(v),
|
|
36
|
+
"%"
|
|
37
|
+
] })
|
|
38
|
+
] }),
|
|
39
|
+
/* @__PURE__ */ jsxs(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
role: "progressbar",
|
|
43
|
+
"aria-label": label ?? "Progress",
|
|
44
|
+
"aria-valuemin": 0,
|
|
45
|
+
"aria-valuemax": 100,
|
|
46
|
+
"aria-valuenow": v,
|
|
47
|
+
className: "kit-spinner relative h-1.5 w-full overflow-hidden rounded-full bg-[color-mix(in_srgb,var(--ink)_9%,transparent)]",
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ jsx("style", { href: "asta-spinner-2", precedence: "asta", children: KEYFRAMES }),
|
|
50
|
+
v === void 0 ? /* @__PURE__ */ jsx("span", { className: "absolute inset-y-0 rounded-full bg-brand", style: { animation: "kit-indet 1.3s cubic-bezier(.65,0,.35,1) infinite" } }) : /* @__PURE__ */ jsx("span", { className: "absolute inset-y-0 left-0 rounded-full bg-brand transition-[width] duration-700 ease-[cubic-bezier(.16,1,.3,1)]", style: { width: `${v}%` } })
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
] });
|
|
55
|
+
}
|
|
56
|
+
var spinner_default = Spinner;
|
|
57
|
+
|
|
58
|
+
export {
|
|
59
|
+
Spinner,
|
|
60
|
+
Progress,
|
|
61
|
+
spinner_default
|
|
62
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// components/kit/base/tabs.tsx
|
|
4
|
+
import { Tabs as T } from "@base-ui/react/tabs";
|
|
5
|
+
import { useLayoutEffect, useRef, useState } from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
var cx = (...c) => c.filter(Boolean).join(" ");
|
|
8
|
+
function Tabs({ tabs, value, defaultValue, onChange, variant = "underline", label, className }) {
|
|
9
|
+
const [inner, setInner] = useState(defaultValue ?? tabs[0]?.value);
|
|
10
|
+
const current = value ?? inner;
|
|
11
|
+
const index = Math.max(0, tabs.findIndex((t) => t.value === current));
|
|
12
|
+
const refs = useRef([]);
|
|
13
|
+
const list = useRef(null);
|
|
14
|
+
const prev = useRef(index);
|
|
15
|
+
const [bar, setBar] = useState(null);
|
|
16
|
+
useLayoutEffect(() => {
|
|
17
|
+
const measure = () => {
|
|
18
|
+
const el = refs.current[index];
|
|
19
|
+
const box = list.current;
|
|
20
|
+
if (!el || !box) return;
|
|
21
|
+
const dir = index >= prev.current ? 1 : -1;
|
|
22
|
+
prev.current = index;
|
|
23
|
+
setBar({ l: el.offsetLeft, r: box.scrollWidth - el.offsetLeft - el.offsetWidth, dir });
|
|
24
|
+
};
|
|
25
|
+
measure();
|
|
26
|
+
const ro = new ResizeObserver(measure);
|
|
27
|
+
if (list.current) ro.observe(list.current);
|
|
28
|
+
return () => ro.disconnect();
|
|
29
|
+
}, [index]);
|
|
30
|
+
const fast = "cubic-bezier(.16,1,.3,1) 0.32s";
|
|
31
|
+
const slow = "cubic-bezier(.16,1,.3,1) 0.62s";
|
|
32
|
+
const pill = variant === "pill";
|
|
33
|
+
return /* @__PURE__ */ jsxs(
|
|
34
|
+
T.Root,
|
|
35
|
+
{
|
|
36
|
+
value: current,
|
|
37
|
+
onValueChange: (v) => {
|
|
38
|
+
const next = String(v);
|
|
39
|
+
if (value === void 0) setInner(next);
|
|
40
|
+
onChange?.(next);
|
|
41
|
+
},
|
|
42
|
+
className,
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ jsxs(
|
|
45
|
+
T.List,
|
|
46
|
+
{
|
|
47
|
+
ref: list,
|
|
48
|
+
"aria-label": label,
|
|
49
|
+
activateOnFocus: true,
|
|
50
|
+
className: cx("relative flex overflow-x-auto [scrollbar-width:none]", pill ? "gap-1 rounded-[10px] bg-paper-2 p-1" : "gap-5 sm:gap-6"),
|
|
51
|
+
children: [
|
|
52
|
+
!pill && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "absolute inset-x-0 bottom-0 h-px bg-[color-mix(in_srgb,var(--ink)_10%,transparent)]" }),
|
|
53
|
+
bar && /* @__PURE__ */ jsx(
|
|
54
|
+
"span",
|
|
55
|
+
{
|
|
56
|
+
"aria-hidden": true,
|
|
57
|
+
className: cx(
|
|
58
|
+
"absolute motion-reduce:!transition-none",
|
|
59
|
+
pill ? "top-1 bottom-1 rounded-[7px] bg-paper shadow-[0_1px_2px_rgb(0_0_0/0.08),inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_8%,transparent)]" : "bottom-0 h-0.5 rounded-full bg-ink"
|
|
60
|
+
),
|
|
61
|
+
style: { left: bar.l, right: bar.r, transition: `left ${bar.dir === 1 ? slow : fast}, right ${bar.dir === 1 ? fast : slow}` }
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
tabs.map((t, i) => /* @__PURE__ */ jsxs(
|
|
65
|
+
T.Tab,
|
|
66
|
+
{
|
|
67
|
+
value: t.value,
|
|
68
|
+
ref: (el) => {
|
|
69
|
+
refs.current[i] = el;
|
|
70
|
+
},
|
|
71
|
+
className: cx(
|
|
72
|
+
"group/tab relative z-10 inline-flex shrink-0 items-center gap-2 whitespace-nowrap text-[14px] font-medium tracking-[-0.01em] text-mute outline-none transition-colors duration-300 hover:text-ink focus-visible:ring-2 focus-visible:ring-brand/50 data-[active]:text-ink",
|
|
73
|
+
pill ? "h-8 rounded-[7px] px-3.5" : "h-11 rounded-md"
|
|
74
|
+
),
|
|
75
|
+
children: [
|
|
76
|
+
t.label,
|
|
77
|
+
t.count !== void 0 && /* @__PURE__ */ jsx("span", { className: "rounded-[5px] bg-[color-mix(in_srgb,var(--ink)_7%,transparent)] px-1.5 text-[11px] leading-[18px] tabular-nums text-mute transition-colors duration-300 group-data-[active]/tab:bg-brand group-data-[active]/tab:text-white", children: t.count })
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
t.value
|
|
81
|
+
))
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
/* @__PURE__ */ jsx("style", { href: "asta-base-tabs", precedence: "asta", children: `@keyframes kit-tab-in { from { opacity: 0; transform: translateY(6px); filter: blur(2px) } to { opacity: 1; transform: none; filter: none } }` }),
|
|
86
|
+
tabs.map((t) => /* @__PURE__ */ jsx(T.Panel, { value: t.value, className: "pt-5 outline-none animate-[kit-tab-in_.45s_cubic-bezier(.16,1,.3,1)_both] motion-reduce:!animate-none", children: t.content }, t.value))
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
var tabs_default = Tabs;
|
|
92
|
+
|
|
93
|
+
export {
|
|
94
|
+
Tabs,
|
|
95
|
+
tabs_default
|
|
96
|
+
};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Button
|
|
4
|
+
} from "./chunk-ZWBJUJTR.js";
|
|
5
|
+
|
|
6
|
+
// components/kit/footer.tsx
|
|
7
|
+
import { useRef, useState } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
var cx = (...c) => c.filter(Boolean).join(" ");
|
|
10
|
+
var EASE = "ease-[cubic-bezier(.16,1,.3,1)]";
|
|
11
|
+
function Newsletter({ onSubscribe }) {
|
|
12
|
+
const [email, setEmail] = useState("");
|
|
13
|
+
const [state, setState] = useState("idle");
|
|
14
|
+
const submit = async (e) => {
|
|
15
|
+
e.preventDefault();
|
|
16
|
+
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) return setState("error");
|
|
17
|
+
setState("busy");
|
|
18
|
+
try {
|
|
19
|
+
await (onSubscribe?.(email) ?? new Promise((r) => setTimeout(r, 900)));
|
|
20
|
+
setState("done");
|
|
21
|
+
} catch {
|
|
22
|
+
setState("error");
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
26
|
+
/* @__PURE__ */ jsxs(
|
|
27
|
+
"form",
|
|
28
|
+
{
|
|
29
|
+
onSubmit: submit,
|
|
30
|
+
noValidate: true,
|
|
31
|
+
"aria-hidden": state === "done" || void 0,
|
|
32
|
+
className: cx(
|
|
33
|
+
"flex h-11 items-center gap-1 rounded-[10px] bg-paper/10 p-1 pl-4 shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--paper)_14%,transparent)] transition-[opacity,transform,box-shadow] duration-500 focus-within:shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--paper)_45%,transparent)]",
|
|
34
|
+
EASE,
|
|
35
|
+
state === "done" && "pointer-events-none -translate-y-2 opacity-0",
|
|
36
|
+
state === "error" && "shadow-[inset_0_0_0_1px_#e5484d]"
|
|
37
|
+
),
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "kit-footer-email", className: "sr-only", children: "Email address" }),
|
|
40
|
+
/* @__PURE__ */ jsx(
|
|
41
|
+
"input",
|
|
42
|
+
{
|
|
43
|
+
id: "kit-footer-email",
|
|
44
|
+
type: "email",
|
|
45
|
+
value: email,
|
|
46
|
+
onChange: (e) => {
|
|
47
|
+
setEmail(e.target.value);
|
|
48
|
+
if (state === "error") setState("idle");
|
|
49
|
+
},
|
|
50
|
+
placeholder: "you@company.com",
|
|
51
|
+
"aria-invalid": state === "error" || void 0,
|
|
52
|
+
"aria-describedby": "kit-footer-msg",
|
|
53
|
+
tabIndex: state === "done" ? -1 : void 0,
|
|
54
|
+
className: "min-w-0 flex-1 bg-transparent text-[14px] text-paper outline-none placeholder:text-paper/40"
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
/* @__PURE__ */ jsx(Button, { type: "submit", variant: "accent", size: "sm", shape: "pill", loading: state === "busy", className: "shadow-none", tabIndex: state === "done" ? -1 : void 0, children: "Subscribe" })
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
/* @__PURE__ */ jsxs(
|
|
62
|
+
"p",
|
|
63
|
+
{
|
|
64
|
+
className: cx(
|
|
65
|
+
"absolute inset-0 flex items-center gap-2 pl-1 text-[14px] text-paper transition-[opacity,transform] duration-500",
|
|
66
|
+
EASE,
|
|
67
|
+
state === "done" ? "opacity-100" : "pointer-events-none translate-y-2 opacity-0"
|
|
68
|
+
),
|
|
69
|
+
"aria-hidden": state !== "done",
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ jsx("span", { className: "flex h-6 w-6 items-center justify-center rounded-full bg-brand text-white", children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "h-3.5 w-3.5", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "m3.5 8.5 3 3 6-7", strokeDasharray: "16", style: { strokeDashoffset: state === "done" ? 0 : 16, transition: "stroke-dashoffset .5s .2s" } }) }) }),
|
|
72
|
+
"You're in. First letter lands next week."
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
/* @__PURE__ */ jsx("p", { id: "kit-footer-msg", role: "status", className: "mt-2 h-4 text-[12px] text-[#ff8a8d]", children: state === "error" ? "That doesn't look like an email address." : "" })
|
|
77
|
+
] });
|
|
78
|
+
}
|
|
79
|
+
function Wordmark({ text }) {
|
|
80
|
+
const box = useRef(null);
|
|
81
|
+
const move = (x) => {
|
|
82
|
+
const el = box.current;
|
|
83
|
+
if (!el || window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
84
|
+
for (const s of el.querySelectorAll("span[data-l]")) {
|
|
85
|
+
if (x === null) {
|
|
86
|
+
s.style.transform = "";
|
|
87
|
+
s.style.opacity = "";
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
const r = s.getBoundingClientRect();
|
|
91
|
+
const k = Math.max(0, 1 - Math.abs(x - (r.left + r.width / 2)) / (r.width * 2.5));
|
|
92
|
+
s.style.transform = `translateY(${-k * 14}%)`;
|
|
93
|
+
s.style.opacity = String(0.22 + k * 0.78);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
return /* @__PURE__ */ jsx(
|
|
97
|
+
"div",
|
|
98
|
+
{
|
|
99
|
+
ref: box,
|
|
100
|
+
"aria-hidden": true,
|
|
101
|
+
onPointerMove: (e) => move(e.clientX),
|
|
102
|
+
onPointerLeave: () => move(null),
|
|
103
|
+
className: "-mb-[0.18em] mt-6 flex select-none justify-center overflow-hidden pt-[0.1em] text-[clamp(3rem,19.5cqw,13rem)] font-semibold leading-[0.9] tracking-[-0.06em]",
|
|
104
|
+
children: text.split("").map((c, i) => /* @__PURE__ */ jsx("span", { "data-l": true, className: cx("inline-block opacity-[0.22] transition-[transform,opacity] duration-500", EASE), children: c }, i))
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
function Footer({ brand, wordmark, columns, tagline, onSubscribe, legal, className }) {
|
|
109
|
+
return /* @__PURE__ */ jsxs("footer", { className: cx("@container overflow-hidden rounded-2xl bg-ink px-6 pt-8 text-paper sm:px-8", className), children: [
|
|
110
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-8 @min-[620px]:grid-cols-[1.3fr_2fr]", children: [
|
|
111
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-4", children: [
|
|
112
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 text-[15px] font-semibold tracking-[-0.02em]", children: brand }),
|
|
113
|
+
tagline && /* @__PURE__ */ jsx("p", { className: "max-w-[30ch] text-[13.5px] leading-relaxed text-paper/60", children: tagline }),
|
|
114
|
+
/* @__PURE__ */ jsx(Newsletter, { onSubscribe })
|
|
115
|
+
] }),
|
|
116
|
+
/* @__PURE__ */ jsx("nav", { "aria-label": "Footer", className: "grid grid-cols-2 gap-6 @min-[420px]:grid-cols-3", children: columns.map((c) => /* @__PURE__ */ jsxs("div", { children: [
|
|
117
|
+
/* @__PURE__ */ jsx("p", { className: "text-[12px] text-paper/45", children: c.heading }),
|
|
118
|
+
/* @__PURE__ */ jsx("ul", { className: "mt-3 flex flex-col gap-2", children: c.links.map((l) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
|
|
119
|
+
"a",
|
|
120
|
+
{
|
|
121
|
+
href: l.href,
|
|
122
|
+
className: "group/fl inline-flex items-center gap-1 rounded text-[13.5px] text-paper/80 outline-none transition-colors hover:text-paper focus-visible:ring-2 focus-visible:ring-brand/60",
|
|
123
|
+
children: [
|
|
124
|
+
l.label,
|
|
125
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: cx("-translate-x-1 text-[11px] opacity-0 transition-[translate,opacity] duration-300 group-hover/fl:translate-x-0 group-hover/fl:opacity-60", EASE), children: "\u2197" })
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
) }, l.label)) })
|
|
129
|
+
] }, c.heading)) })
|
|
130
|
+
] }),
|
|
131
|
+
legal && /* @__PURE__ */ jsx("div", { className: "mt-8 flex flex-wrap justify-between gap-2 text-[12px] text-paper/45", children: legal }),
|
|
132
|
+
/* @__PURE__ */ jsx(Wordmark, { text: wordmark })
|
|
133
|
+
] });
|
|
134
|
+
}
|
|
135
|
+
var footer_default = Footer;
|
|
136
|
+
|
|
137
|
+
export {
|
|
138
|
+
Newsletter,
|
|
139
|
+
Footer,
|
|
140
|
+
footer_default
|
|
141
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// components/kit/variants/textarea-aui-007.tsx
|
|
4
|
+
import { useEffect, useId, useRef, useState } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
var cx = (...c) => c.filter(Boolean).join(" ");
|
|
7
|
+
var reduced = () => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
8
|
+
function ValidatedTextarea({ label, rules, value: valueProp, defaultValue = "", onChange, success = "Looks good.", className, rows = 4, id, ...rest }) {
|
|
9
|
+
const auto = useId();
|
|
10
|
+
const fid = id ?? auto;
|
|
11
|
+
const box = useRef(null);
|
|
12
|
+
const [inner, setInner] = useState(defaultValue);
|
|
13
|
+
const value = valueProp ?? inner;
|
|
14
|
+
const [touched, setTouched] = useState(false);
|
|
15
|
+
const results = rules.map((r) => r.test(value));
|
|
16
|
+
const valid = results.every(Boolean);
|
|
17
|
+
const state = !touched ? "idle" : valid ? "success" : "error";
|
|
18
|
+
const prev = useRef(state);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (state === "error" && prev.current !== "error" && !reduced()) {
|
|
21
|
+
box.current?.animate([{ transform: "translateX(0)" }, { transform: "translateX(-5px)" }, { transform: "translateX(4px)" }, { transform: "translateX(-2px)" }, { transform: "translateX(0)" }], { duration: 360, easing: "cubic-bezier(.16,1,.3,1)" });
|
|
22
|
+
}
|
|
23
|
+
prev.current = state;
|
|
24
|
+
}, [state]);
|
|
25
|
+
const ring = state === "error" ? "shadow-[inset_0_0_0_1px_#e5484d] focus-within:shadow-[inset_0_0_0_1px_#e5484d,0_0_0_4px_rgb(229_72_77/0.14)]" : state === "success" ? "shadow-[inset_0_0_0_1px_#30a46c] focus-within:shadow-[inset_0_0_0_1px_#30a46c,0_0_0_4px_rgb(48_164_108/0.14)]" : "shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_14%,transparent)] hover:shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_24%,transparent)] focus-within:!shadow-[inset_0_0_0_1px_var(--brand),0_0_0_4px_color-mix(in_srgb,var(--brand)_16%,transparent)]";
|
|
26
|
+
return /* @__PURE__ */ jsxs("div", { className: cx("flex w-full flex-col gap-1.5", className), children: [
|
|
27
|
+
/* @__PURE__ */ jsx("label", { htmlFor: fid, className: "text-[13px] font-medium text-ink", children: label }),
|
|
28
|
+
/* @__PURE__ */ jsx("div", { ref: box, className: cx("rounded-xl bg-paper transition-shadow duration-300 motion-reduce:transition-none", ring), children: /* @__PURE__ */ jsx(
|
|
29
|
+
"textarea",
|
|
30
|
+
{
|
|
31
|
+
id: fid,
|
|
32
|
+
rows,
|
|
33
|
+
...rest,
|
|
34
|
+
value,
|
|
35
|
+
"aria-invalid": state === "error" || void 0,
|
|
36
|
+
"aria-describedby": `${fid}-rules`,
|
|
37
|
+
onChange: (e) => {
|
|
38
|
+
const next = e.target.value;
|
|
39
|
+
if (valueProp === void 0) setInner(next);
|
|
40
|
+
onChange?.(next, rules.every((r) => r.test(next)));
|
|
41
|
+
},
|
|
42
|
+
onBlur: (e) => {
|
|
43
|
+
if (value) setTouched(true);
|
|
44
|
+
rest.onBlur?.(e);
|
|
45
|
+
},
|
|
46
|
+
className: "block w-full resize-none bg-transparent px-3.5 py-3 text-[14px] leading-[1.55] text-ink outline-none placeholder:text-mute"
|
|
47
|
+
}
|
|
48
|
+
) }),
|
|
49
|
+
/* @__PURE__ */ jsx("div", { className: cx("grid transition-[grid-template-rows] duration-400 ease-[cubic-bezier(.16,1,.3,1)] motion-reduce:transition-none", state === "idle" ? "grid-rows-[0fr]" : "grid-rows-[1fr]"), children: /* @__PURE__ */ jsx("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsx("ul", { id: `${fid}-rules`, className: "flex flex-col gap-1 pt-1", "aria-live": "polite", children: state === "success" ? /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-2 text-[12.5px] text-[#30a46c]", children: [
|
|
50
|
+
/* @__PURE__ */ jsx(Check, { on: true }),
|
|
51
|
+
" ",
|
|
52
|
+
success
|
|
53
|
+
] }) : rules.map((r, i) => /* @__PURE__ */ jsxs("li", { className: cx("flex items-center gap-2 text-[12.5px] transition-colors duration-300", results[i] ? "text-mute" : "text-[#e5484d]"), children: [
|
|
54
|
+
/* @__PURE__ */ jsx(Check, { on: results[i] }),
|
|
55
|
+
/* @__PURE__ */ jsx("span", { className: cx("transition-[text-decoration-color] duration-300", results[i] && "line-through decoration-mute/50"), children: r.label })
|
|
56
|
+
] }, r.label)) }) }) })
|
|
57
|
+
] });
|
|
58
|
+
}
|
|
59
|
+
function Check({ on }) {
|
|
60
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", className: "h-3.5 w-3.5 shrink-0", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
61
|
+
/* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "6.2", className: cx("transition-opacity duration-300", on ? "opacity-0" : "opacity-100") }),
|
|
62
|
+
/* @__PURE__ */ jsx("path", { d: "m5 8.2 2 2 4-4.2", strokeDasharray: "10", strokeDashoffset: on ? 0 : 10, className: "transition-[stroke-dashoffset] duration-300 ease-[cubic-bezier(.16,1,.3,1)]" })
|
|
63
|
+
] });
|
|
64
|
+
}
|
|
65
|
+
var textarea_aui_007_default = ValidatedTextarea;
|
|
66
|
+
|
|
67
|
+
export {
|
|
68
|
+
ValidatedTextarea,
|
|
69
|
+
textarea_aui_007_default
|
|
70
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// components/kit/field.tsx
|
|
4
|
+
import { Children, cloneElement, isValidElement, useEffect, useId, useRef } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
var cx = (...c) => c.filter(Boolean).join(" ");
|
|
7
|
+
function Field({ label, hint, error, required, aside, className, children }) {
|
|
8
|
+
const id = useId();
|
|
9
|
+
const wrap = useRef(null);
|
|
10
|
+
const last = useRef(null);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (error && error !== last.current && !window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
13
|
+
wrap.current?.animate(
|
|
14
|
+
[{ transform: "none" }, { transform: "translateX(-6px)" }, { transform: "translateX(5px)" }, { transform: "translateX(-3px)" }, { transform: "translateX(2px)" }, { transform: "none" }],
|
|
15
|
+
{ duration: 420, easing: "cubic-bezier(.36,.07,.19,.97)" }
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
last.current = error ?? null;
|
|
19
|
+
}, [error]);
|
|
20
|
+
const child = Children.only(children);
|
|
21
|
+
const msgId = error ? `${id}-error` : hint ? `${id}-hint` : void 0;
|
|
22
|
+
const input = isValidElement(child) ? cloneElement(child, {
|
|
23
|
+
id: child.props.id ?? id,
|
|
24
|
+
"aria-describedby": msgId,
|
|
25
|
+
"aria-invalid": error ? true : void 0,
|
|
26
|
+
"aria-required": required || void 0
|
|
27
|
+
}) : child;
|
|
28
|
+
const inputId = child.props.id ?? id;
|
|
29
|
+
return /* @__PURE__ */ jsxs("div", { className: cx("flex flex-col gap-1.5", className), children: [
|
|
30
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-baseline justify-between gap-3", children: [
|
|
31
|
+
/* @__PURE__ */ jsxs("label", { htmlFor: inputId, className: "text-[13px] font-medium tracking-[-0.01em] text-ink", children: [
|
|
32
|
+
label,
|
|
33
|
+
required && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "ml-0.5 text-[#e5484d]", children: "*" })
|
|
34
|
+
] }),
|
|
35
|
+
aside && /* @__PURE__ */ jsx("span", { className: "text-[12px] tabular-nums text-mute", children: aside })
|
|
36
|
+
] }),
|
|
37
|
+
/* @__PURE__ */ jsx("div", { ref: wrap, children: input }),
|
|
38
|
+
/* @__PURE__ */ jsx("div", { className: "grid text-[12.5px] leading-snug", children: error ? /* @__PURE__ */ jsxs("p", { id: `${id}-error`, role: "alert", className: "flex items-start gap-1.5 text-[#e5484d] animate-[kit-field-in_.3s_cubic-bezier(.16,1,.3,1)_both]", children: [
|
|
39
|
+
/* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", className: "mt-px h-3.5 w-3.5 shrink-0", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", "aria-hidden": true, children: [
|
|
40
|
+
/* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "6" }),
|
|
41
|
+
/* @__PURE__ */ jsx("path", { d: "M8 5v3.5M8 11h0" })
|
|
42
|
+
] }),
|
|
43
|
+
error
|
|
44
|
+
] }) : hint ? /* @__PURE__ */ jsx("p", { id: `${id}-hint`, className: "text-mute", children: hint }) : null }),
|
|
45
|
+
/* @__PURE__ */ jsx("style", { href: "asta-field", precedence: "asta", children: `@keyframes kit-field-in { from { opacity: 0; transform: translateY(-3px) } to { opacity: 1; transform: none } }` })
|
|
46
|
+
] });
|
|
47
|
+
}
|
|
48
|
+
var fieldInputClass = "h-10 w-full rounded-lg bg-paper px-3 text-[14px] text-ink outline-none placeholder:text-mute shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_14%,transparent)] transition-shadow duration-200 hover:shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_24%,transparent)] focus:shadow-[inset_0_0_0_1px_var(--brand),0_0_0_3px_color-mix(in_srgb,var(--brand)_18%,transparent)] aria-[invalid=true]:shadow-[inset_0_0_0_1px_#e5484d,0_0_0_3px_rgb(229_72_77/0.14)]";
|
|
49
|
+
var field_default = Field;
|
|
50
|
+
|
|
51
|
+
export {
|
|
52
|
+
Field,
|
|
53
|
+
fieldInputClass,
|
|
54
|
+
field_default
|
|
55
|
+
};
|