asta-ui 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,247 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Button
|
|
4
|
+
} from "./chunk-WSL4JGEA.js";
|
|
5
|
+
|
|
6
|
+
// components/kit/base/settings-panel.tsx
|
|
7
|
+
import { forwardRef, useEffect, useId, useImperativeHandle, useRef, useState } from "react";
|
|
8
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
var cx = (...c) => c.filter(Boolean).join(" ");
|
|
10
|
+
var RING = "shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_14%,transparent)]";
|
|
11
|
+
var EASE = "ease-[cubic-bezier(.16,1,.3,1)]";
|
|
12
|
+
function Toggle({ checked, onChange, label, hint }) {
|
|
13
|
+
const id = useId();
|
|
14
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4 py-2.5", children: [
|
|
15
|
+
/* @__PURE__ */ jsxs("label", { htmlFor: id, className: "min-w-0 cursor-pointer", children: [
|
|
16
|
+
/* @__PURE__ */ jsx("span", { className: "block text-[14px] text-ink", children: label }),
|
|
17
|
+
hint && /* @__PURE__ */ jsx("span", { className: "mt-0.5 block text-[12.5px] leading-snug text-mute", children: hint })
|
|
18
|
+
] }),
|
|
19
|
+
/* @__PURE__ */ jsx(
|
|
20
|
+
"button",
|
|
21
|
+
{
|
|
22
|
+
id,
|
|
23
|
+
type: "button",
|
|
24
|
+
role: "switch",
|
|
25
|
+
"aria-checked": checked,
|
|
26
|
+
onClick: () => onChange(!checked),
|
|
27
|
+
className: cx(
|
|
28
|
+
"group relative h-6 w-10 shrink-0 rounded-full outline-none transition-colors duration-300 focus-visible:ring-2 focus-visible:ring-brand/50 focus-visible:ring-offset-2 focus-visible:ring-offset-paper",
|
|
29
|
+
checked ? "bg-brand" : "bg-[color-mix(in_srgb,var(--ink)_16%,transparent)]"
|
|
30
|
+
),
|
|
31
|
+
children: /* @__PURE__ */ jsx(
|
|
32
|
+
"span",
|
|
33
|
+
{
|
|
34
|
+
className: cx(
|
|
35
|
+
"absolute left-0.5 top-0.5 h-5 w-5 rounded-full bg-white shadow-[0_1px_3px_rgb(0_0_0/0.25)] transition-[transform,width] duration-300 group-active:w-6",
|
|
36
|
+
EASE,
|
|
37
|
+
checked ? "translate-x-4 group-active:translate-x-3" : "translate-x-0"
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
] });
|
|
44
|
+
}
|
|
45
|
+
var THEMES = [
|
|
46
|
+
{ value: "light", label: "Light", swatch: "bg-[#fcfcfb]" },
|
|
47
|
+
{ value: "dark", label: "Dark", swatch: "bg-[#151516]" },
|
|
48
|
+
{ value: "system", label: "System", swatch: "bg-[linear-gradient(135deg,#fcfcfb_50%,#151516_50%)]" }
|
|
49
|
+
];
|
|
50
|
+
function ThemePicker({ value, onChange }) {
|
|
51
|
+
const refs = useRef([]);
|
|
52
|
+
const move = (d) => {
|
|
53
|
+
const i = (THEMES.findIndex((t) => t.value === value) + d + THEMES.length) % THEMES.length;
|
|
54
|
+
onChange(THEMES[i].value);
|
|
55
|
+
refs.current[i]?.focus();
|
|
56
|
+
};
|
|
57
|
+
return /* @__PURE__ */ jsx("div", { role: "radiogroup", "aria-label": "Theme", className: "grid grid-cols-3 gap-2", children: THEMES.map((t, i) => {
|
|
58
|
+
const on = t.value === value;
|
|
59
|
+
return /* @__PURE__ */ jsxs(
|
|
60
|
+
"button",
|
|
61
|
+
{
|
|
62
|
+
ref: (el) => {
|
|
63
|
+
refs.current[i] = el;
|
|
64
|
+
},
|
|
65
|
+
type: "button",
|
|
66
|
+
role: "radio",
|
|
67
|
+
"aria-checked": on,
|
|
68
|
+
tabIndex: on ? 0 : -1,
|
|
69
|
+
onClick: () => onChange(t.value),
|
|
70
|
+
onKeyDown: (e) => {
|
|
71
|
+
if (e.key === "ArrowRight" || e.key === "ArrowDown") move(1);
|
|
72
|
+
else if (e.key === "ArrowLeft" || e.key === "ArrowUp") move(-1);
|
|
73
|
+
else return;
|
|
74
|
+
e.preventDefault();
|
|
75
|
+
},
|
|
76
|
+
className: cx(
|
|
77
|
+
"flex flex-col items-start gap-2 rounded-[10px] p-2 text-left outline-none transition-shadow duration-300 focus-visible:ring-2 focus-visible:ring-brand/50",
|
|
78
|
+
on ? "shadow-[inset_0_0_0_2px_var(--brand)]" : `${RING} hover:shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_26%,transparent)]`
|
|
79
|
+
),
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ jsx("span", { className: cx("h-10 w-full rounded-lg shadow-[inset_0_0_0_1px_rgb(0_0_0/0.08)]", t.swatch) }),
|
|
82
|
+
/* @__PURE__ */ jsxs("span", { className: "flex w-full items-center justify-between px-0.5 text-[13px] text-ink", children: [
|
|
83
|
+
t.label,
|
|
84
|
+
/* @__PURE__ */ jsx("span", { className: cx("h-3.5 w-3.5 rounded-full transition-all duration-300", on ? "bg-brand shadow-[inset_0_0_0_3.5px_var(--brand),inset_0_0_0_6px_white]" : RING) })
|
|
85
|
+
] })
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
t.value
|
|
89
|
+
);
|
|
90
|
+
}) });
|
|
91
|
+
}
|
|
92
|
+
function Section({ title, children }) {
|
|
93
|
+
return /* @__PURE__ */ jsxs("section", { className: "py-5 first:pt-0", children: [
|
|
94
|
+
/* @__PURE__ */ jsx("h4", { className: "mb-3 text-[12px] font-medium uppercase tracking-[0.06em] text-mute", children: title }),
|
|
95
|
+
children
|
|
96
|
+
] });
|
|
97
|
+
}
|
|
98
|
+
var inputCls = cx("h-10 w-full rounded-lg bg-paper px-3 text-[14px] text-ink outline-none transition-shadow placeholder:text-mute focus-visible:ring-2 focus-visible:ring-brand/50", RING);
|
|
99
|
+
var SettingsPanel = forwardRef(function SettingsPanel2({ initial, onSave, languages = ["English", "Bahasa Indonesia", "Deutsch", "\u65E5\u672C\u8A9E"], className }, ref) {
|
|
100
|
+
const [saved, setSaved] = useState(initial);
|
|
101
|
+
const [draft, setDraft] = useState(initial);
|
|
102
|
+
const [status, setStatus] = useState("idle");
|
|
103
|
+
const bar = useRef(null);
|
|
104
|
+
const nameId = useId();
|
|
105
|
+
const emailId = useId();
|
|
106
|
+
const langId = useId();
|
|
107
|
+
const dirty = JSON.stringify(saved) !== JSON.stringify(draft);
|
|
108
|
+
const showBar = dirty || status !== "idle";
|
|
109
|
+
const dirtyRef = useRef(dirty);
|
|
110
|
+
useEffect(() => {
|
|
111
|
+
dirtyRef.current = dirty;
|
|
112
|
+
}, [dirty]);
|
|
113
|
+
const nudge = () => {
|
|
114
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
115
|
+
bar.current?.animate(
|
|
116
|
+
[{ transform: "none" }, { transform: "translateX(-8px)" }, { transform: "translateX(7px)" }, { transform: "translateX(-4px)" }, { transform: "translateX(2px)" }, { transform: "none" }],
|
|
117
|
+
{ duration: 450, easing: "cubic-bezier(.16,1,.3,1)" }
|
|
118
|
+
);
|
|
119
|
+
};
|
|
120
|
+
useImperativeHandle(ref, () => ({
|
|
121
|
+
requestLeave: () => {
|
|
122
|
+
if (dirtyRef.current) nudge();
|
|
123
|
+
return !dirtyRef.current;
|
|
124
|
+
}
|
|
125
|
+
}));
|
|
126
|
+
useEffect(() => {
|
|
127
|
+
if (status !== "saved") return;
|
|
128
|
+
const t = setTimeout(() => setStatus("idle"), 1400);
|
|
129
|
+
return () => clearTimeout(t);
|
|
130
|
+
}, [status]);
|
|
131
|
+
const set = (k, v) => {
|
|
132
|
+
setDraft((d) => ({ ...d, [k]: v }));
|
|
133
|
+
if (status === "saved") setStatus("idle");
|
|
134
|
+
};
|
|
135
|
+
const save = async () => {
|
|
136
|
+
setStatus("saving");
|
|
137
|
+
await (onSave?.(draft) ?? new Promise((r) => setTimeout(r, 900)));
|
|
138
|
+
setSaved(draft);
|
|
139
|
+
setStatus("saved");
|
|
140
|
+
};
|
|
141
|
+
return /* @__PURE__ */ jsx(
|
|
142
|
+
"div",
|
|
143
|
+
{
|
|
144
|
+
className: cx(
|
|
145
|
+
"relative w-full max-w-[520px] overflow-hidden rounded-xl bg-paper shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_10%,transparent),0_18px_40px_-24px_rgb(0_0_0/0.3)]",
|
|
146
|
+
className
|
|
147
|
+
),
|
|
148
|
+
children: /* @__PURE__ */ jsxs(
|
|
149
|
+
"form",
|
|
150
|
+
{
|
|
151
|
+
onSubmit: (e) => {
|
|
152
|
+
e.preventDefault();
|
|
153
|
+
if (dirty) save();
|
|
154
|
+
},
|
|
155
|
+
children: [
|
|
156
|
+
/* @__PURE__ */ jsxs("div", { className: "max-h-[440px] overflow-y-auto px-5 pb-24 pt-5 sm:px-6 [&>section+section]:shadow-[inset_0_1px_0_color-mix(in_srgb,var(--ink)_7%,transparent)]", children: [
|
|
157
|
+
/* @__PURE__ */ jsx(Section, { title: "Profile", children: /* @__PURE__ */ jsxs("div", { className: "grid gap-3 sm:grid-cols-2", children: [
|
|
158
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
159
|
+
/* @__PURE__ */ jsx("label", { htmlFor: nameId, className: "text-[13px] font-medium text-ink", children: "Display name" }),
|
|
160
|
+
/* @__PURE__ */ jsx("input", { id: nameId, value: draft.name, onChange: (e) => set("name", e.target.value), className: inputCls, autoComplete: "name" })
|
|
161
|
+
] }),
|
|
162
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
163
|
+
/* @__PURE__ */ jsx("label", { htmlFor: emailId, className: "text-[13px] font-medium text-ink", children: "Email" }),
|
|
164
|
+
/* @__PURE__ */ jsx("input", { id: emailId, type: "email", value: draft.email, onChange: (e) => set("email", e.target.value), className: inputCls, autoComplete: "email" })
|
|
165
|
+
] })
|
|
166
|
+
] }) }),
|
|
167
|
+
/* @__PURE__ */ jsxs(Section, { title: "Notifications", children: [
|
|
168
|
+
/* @__PURE__ */ jsx(Toggle, { label: "Product updates", hint: "New features, once a month.", checked: draft.notify.product, onChange: (v) => set("notify", { ...draft.notify, product: v }) }),
|
|
169
|
+
/* @__PURE__ */ jsx(Toggle, { label: "Mentions", hint: "When someone tags you in a comment.", checked: draft.notify.mentions, onChange: (v) => set("notify", { ...draft.notify, mentions: v }) }),
|
|
170
|
+
/* @__PURE__ */ jsx(Toggle, { label: "Weekly digest", checked: draft.notify.digest, onChange: (v) => set("notify", { ...draft.notify, digest: v }) })
|
|
171
|
+
] }),
|
|
172
|
+
/* @__PURE__ */ jsxs(Section, { title: "Appearance", children: [
|
|
173
|
+
/* @__PURE__ */ jsx(ThemePicker, { value: draft.theme, onChange: (v) => set("theme", v) }),
|
|
174
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-4 flex items-center justify-between gap-4", children: [
|
|
175
|
+
/* @__PURE__ */ jsx("label", { htmlFor: langId, className: "text-[14px] text-ink", children: "Language" }),
|
|
176
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
177
|
+
/* @__PURE__ */ jsx(
|
|
178
|
+
"select",
|
|
179
|
+
{
|
|
180
|
+
id: langId,
|
|
181
|
+
value: draft.language,
|
|
182
|
+
onChange: (e) => set("language", e.target.value),
|
|
183
|
+
className: cx(inputCls, "w-auto cursor-pointer appearance-none pr-9"),
|
|
184
|
+
children: languages.map((l) => /* @__PURE__ */ jsx("option", { children: l }, l))
|
|
185
|
+
}
|
|
186
|
+
),
|
|
187
|
+
/* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "pointer-events-none absolute right-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-mute", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "m4.5 6.5 3.5 3.5 3.5-3.5" }) })
|
|
188
|
+
] })
|
|
189
|
+
] })
|
|
190
|
+
] })
|
|
191
|
+
] }),
|
|
192
|
+
/* @__PURE__ */ jsx(
|
|
193
|
+
"div",
|
|
194
|
+
{
|
|
195
|
+
className: cx(
|
|
196
|
+
"pointer-events-none absolute inset-x-3 bottom-3 transition-[transform,opacity] duration-500",
|
|
197
|
+
EASE,
|
|
198
|
+
showBar ? "translate-y-0 opacity-100" : "translate-y-[calc(100%+16px)] opacity-0"
|
|
199
|
+
),
|
|
200
|
+
"aria-hidden": !showBar,
|
|
201
|
+
children: /* @__PURE__ */ jsxs(
|
|
202
|
+
"div",
|
|
203
|
+
{
|
|
204
|
+
ref: bar,
|
|
205
|
+
role: "region",
|
|
206
|
+
"aria-label": "Unsaved changes",
|
|
207
|
+
className: "pointer-events-auto flex items-center gap-2 rounded-[10px] bg-ink py-2 pl-4 pr-2 text-paper shadow-[0_12px_30px_-10px_rgb(0_0_0/0.5)]",
|
|
208
|
+
children: [
|
|
209
|
+
/* @__PURE__ */ jsx("span", { className: "flex min-w-0 flex-1 items-center gap-2 text-[13.5px]", "aria-live": "polite", children: status === "saved" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
210
|
+
/* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "h-4 w-4 shrink-0 text-[#30a46c]", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M3.5 8.5l3 3 6-7" }) }),
|
|
211
|
+
"Saved"
|
|
212
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
213
|
+
/* @__PURE__ */ jsx("span", { className: "h-1.5 w-1.5 shrink-0 rounded-full bg-brand" }),
|
|
214
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: "Unsaved changes" })
|
|
215
|
+
] }) }),
|
|
216
|
+
status !== "saved" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
217
|
+
/* @__PURE__ */ jsx(
|
|
218
|
+
Button,
|
|
219
|
+
{
|
|
220
|
+
variant: "ghost",
|
|
221
|
+
size: "sm",
|
|
222
|
+
tabIndex: showBar ? 0 : -1,
|
|
223
|
+
disabled: status === "saving",
|
|
224
|
+
onClick: () => setDraft(saved),
|
|
225
|
+
className: "text-paper/70 hover:bg-paper/10 hover:text-paper",
|
|
226
|
+
children: "Reset"
|
|
227
|
+
}
|
|
228
|
+
),
|
|
229
|
+
/* @__PURE__ */ jsx(Button, { type: "submit", variant: "accent", size: "sm", tabIndex: showBar ? 0 : -1, loading: status === "saving", children: "Save" })
|
|
230
|
+
] })
|
|
231
|
+
]
|
|
232
|
+
}
|
|
233
|
+
)
|
|
234
|
+
}
|
|
235
|
+
)
|
|
236
|
+
]
|
|
237
|
+
}
|
|
238
|
+
)
|
|
239
|
+
}
|
|
240
|
+
);
|
|
241
|
+
});
|
|
242
|
+
var settings_panel_default = SettingsPanel;
|
|
243
|
+
|
|
244
|
+
export {
|
|
245
|
+
SettingsPanel,
|
|
246
|
+
settings_panel_default
|
|
247
|
+
};
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// components/lab/blocks/PriceChart.tsx
|
|
4
|
+
import { useEffect, useRef, useState } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
var N = 64;
|
|
7
|
+
var UP = "var(--brand)";
|
|
8
|
+
var DOWN = "var(--mute)";
|
|
9
|
+
var EASE = "cubic-bezier(.16,1,.3,1)";
|
|
10
|
+
function seeded(s) {
|
|
11
|
+
return () => {
|
|
12
|
+
s = s + 1831565813 | 0;
|
|
13
|
+
let t = Math.imul(s ^ s >>> 15, 1 | s);
|
|
14
|
+
t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t;
|
|
15
|
+
return ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function walk(n, start) {
|
|
19
|
+
const rand = seeded(1820);
|
|
20
|
+
const out = [start];
|
|
21
|
+
let m = 0;
|
|
22
|
+
for (let i = 1; i < n; i++) {
|
|
23
|
+
m = m * 0.6 + (rand() - 0.46) * 2.6;
|
|
24
|
+
out.push(out[i - 1] + m);
|
|
25
|
+
}
|
|
26
|
+
return out;
|
|
27
|
+
}
|
|
28
|
+
function Roll({ text }) {
|
|
29
|
+
return /* @__PURE__ */ jsx("span", { className: "inline-flex tabular-nums", children: text.split("").map(
|
|
30
|
+
(ch, i) => /\d/.test(ch) ? /* @__PURE__ */ jsx("span", { className: "relative inline-block h-[1em] w-[0.6em] overflow-hidden leading-none", children: /* @__PURE__ */ jsx(
|
|
31
|
+
"span",
|
|
32
|
+
{
|
|
33
|
+
className: "absolute left-0 top-0 flex flex-col transition-transform duration-700 motion-reduce:transition-none",
|
|
34
|
+
style: { transform: `translateY(-${Number(ch) * 10}%)`, transitionTimingFunction: EASE },
|
|
35
|
+
children: "0123456789".split("").map((d) => /* @__PURE__ */ jsx("span", { className: "block h-[1em] leading-none", children: d }, d))
|
|
36
|
+
}
|
|
37
|
+
) }, i) : /* @__PURE__ */ jsx("span", { className: "inline-block h-[1em] leading-none", children: ch }, i)
|
|
38
|
+
) });
|
|
39
|
+
}
|
|
40
|
+
var TICK = 1e3;
|
|
41
|
+
function PriceChart() {
|
|
42
|
+
const [data, setData] = useState(() => walk(N, 1820));
|
|
43
|
+
const [size, setSize] = useState({ w: 0, h: 0 });
|
|
44
|
+
const [hovering, setHovering] = useState(false);
|
|
45
|
+
const box = useRef(null);
|
|
46
|
+
const line = useRef(null);
|
|
47
|
+
const area = useRef(null);
|
|
48
|
+
const dot = useRef(null);
|
|
49
|
+
const tag = useRef(null);
|
|
50
|
+
const cross = useRef(null);
|
|
51
|
+
const crossLine = useRef(null);
|
|
52
|
+
const crossDot = useRef(null);
|
|
53
|
+
const tip = useRef(null);
|
|
54
|
+
const tipText = useRef(null);
|
|
55
|
+
const live = useRef({
|
|
56
|
+
data: [],
|
|
57
|
+
next: 0,
|
|
58
|
+
head: 0,
|
|
59
|
+
t0: 0,
|
|
60
|
+
raf: 0,
|
|
61
|
+
m: 0,
|
|
62
|
+
last: 0,
|
|
63
|
+
lo: 0,
|
|
64
|
+
hi: 1,
|
|
65
|
+
hoverX: null,
|
|
66
|
+
hx: 0
|
|
67
|
+
});
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
const el = box.current;
|
|
70
|
+
if (!el) return;
|
|
71
|
+
const ro = new ResizeObserver(([e]) => setSize({ w: e.contentRect.width, h: e.contentRect.height }));
|
|
72
|
+
ro.observe(el);
|
|
73
|
+
return () => ro.disconnect();
|
|
74
|
+
}, []);
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
const L = live.current;
|
|
77
|
+
L.data = data.slice(0, -1);
|
|
78
|
+
L.next = data[data.length - 1];
|
|
79
|
+
L.head = L.data[L.data.length - 1];
|
|
80
|
+
L.lo = Math.min(...data);
|
|
81
|
+
L.hi = Math.max(...data);
|
|
82
|
+
L.t0 = performance.now();
|
|
83
|
+
const id = setInterval(() => {
|
|
84
|
+
if (document.hidden) return;
|
|
85
|
+
L.m = L.m * 0.6 + (Math.random() - 0.47) * 2.6;
|
|
86
|
+
const v = L.next + L.m;
|
|
87
|
+
L.data = [...L.data.slice(1), L.head];
|
|
88
|
+
L.next = v;
|
|
89
|
+
L.t0 = performance.now();
|
|
90
|
+
setData([...L.data.slice(1), L.head, v]);
|
|
91
|
+
}, TICK);
|
|
92
|
+
return () => clearInterval(id);
|
|
93
|
+
}, []);
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
const L = live.current;
|
|
96
|
+
const { w: w2, h: h2 } = size;
|
|
97
|
+
if (!w2 || !h2) return;
|
|
98
|
+
const still = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
99
|
+
L.last = performance.now();
|
|
100
|
+
const step = (now) => {
|
|
101
|
+
const dt = Math.min(64, now - L.last);
|
|
102
|
+
L.last = now;
|
|
103
|
+
const k = (tau) => still ? 1 : 1 - Math.exp(-dt / tau);
|
|
104
|
+
const p = still ? 0 : Math.min(1, (now - L.t0) / TICK);
|
|
105
|
+
L.head += (L.next - L.head) * k(260);
|
|
106
|
+
const d = L.data;
|
|
107
|
+
const pts = [...d, L.head];
|
|
108
|
+
let lo = Infinity;
|
|
109
|
+
let hi = -Infinity;
|
|
110
|
+
for (const v of pts) {
|
|
111
|
+
if (v < lo) lo = v;
|
|
112
|
+
if (v > hi) hi = v;
|
|
113
|
+
}
|
|
114
|
+
L.lo += (lo - L.lo) * k(600);
|
|
115
|
+
L.hi += (hi - L.hi) * k(600);
|
|
116
|
+
const span = Math.max(1, L.hi - L.lo);
|
|
117
|
+
const pad = h2 * 0.12;
|
|
118
|
+
const right = 92;
|
|
119
|
+
const dx = (w2 - right) / (N - 1);
|
|
120
|
+
const endX = (N - 1) * dx;
|
|
121
|
+
const y = (v) => pad + (1 - (v - L.lo) / span) * (h2 - pad * 2);
|
|
122
|
+
const xs = [];
|
|
123
|
+
let path = "";
|
|
124
|
+
pts.forEach((v, i) => {
|
|
125
|
+
const x = i === pts.length - 1 ? endX : (i + 1 - p) * dx;
|
|
126
|
+
xs.push(x);
|
|
127
|
+
path += `${i ? "L" : "M"}${x.toFixed(2)},${y(v).toFixed(2)}`;
|
|
128
|
+
});
|
|
129
|
+
line.current?.setAttribute("d", path);
|
|
130
|
+
area.current?.setAttribute("d", `${path}L${endX.toFixed(2)},${h2}L${xs[0].toFixed(2)},${h2}Z`);
|
|
131
|
+
if (dot.current) dot.current.style.transform = `translate3d(${endX}px, ${y(L.head)}px, 0)`;
|
|
132
|
+
if (tag.current) tag.current.textContent = L.head.toFixed(2);
|
|
133
|
+
if (L.hoverX !== null) {
|
|
134
|
+
L.hx += (Math.min(endX, Math.max(0, L.hoverX)) - L.hx) * k(70);
|
|
135
|
+
let j = 0;
|
|
136
|
+
while (j < xs.length - 2 && xs[j + 1] < L.hx) j++;
|
|
137
|
+
const t = Math.max(0, Math.min(1, (L.hx - xs[j]) / Math.max(1e-3, xs[j + 1] - xs[j])));
|
|
138
|
+
const v = pts[j] + (pts[j + 1] - pts[j]) * t;
|
|
139
|
+
crossLine.current?.setAttribute("x1", L.hx.toFixed(2));
|
|
140
|
+
crossLine.current?.setAttribute("x2", L.hx.toFixed(2));
|
|
141
|
+
crossDot.current?.setAttribute("cx", L.hx.toFixed(2));
|
|
142
|
+
crossDot.current?.setAttribute("cy", y(v).toFixed(2));
|
|
143
|
+
if (tip.current) tip.current.style.transform = `translate3d(${Math.min(Math.max(8, L.hx - 60), w2 - 132)}px,0,0)`;
|
|
144
|
+
if (tipText.current) tipText.current.textContent = `${v.toFixed(2)} ${Math.max(0, Math.round((endX - L.hx) / dx))}s ago`;
|
|
145
|
+
}
|
|
146
|
+
L.raf = requestAnimationFrame(step);
|
|
147
|
+
};
|
|
148
|
+
L.raf = requestAnimationFrame(step);
|
|
149
|
+
return () => cancelAnimationFrame(L.raf);
|
|
150
|
+
}, [size]);
|
|
151
|
+
const price = data[data.length - 1];
|
|
152
|
+
const open = data[0];
|
|
153
|
+
const up = price >= open;
|
|
154
|
+
const color = UP;
|
|
155
|
+
const pill = up ? UP : DOWN;
|
|
156
|
+
const pct = (price - open) / open * 100;
|
|
157
|
+
const { w, h } = size;
|
|
158
|
+
const point = (clientX) => {
|
|
159
|
+
const L = live.current;
|
|
160
|
+
const r = box.current.getBoundingClientRect();
|
|
161
|
+
const x = clientX - r.left;
|
|
162
|
+
if (L.hoverX === null) L.hx = x;
|
|
163
|
+
L.hoverX = x;
|
|
164
|
+
setHovering(true);
|
|
165
|
+
};
|
|
166
|
+
const leave = () => {
|
|
167
|
+
live.current.hoverX = null;
|
|
168
|
+
setHovering(false);
|
|
169
|
+
};
|
|
170
|
+
const nudge = (dir) => {
|
|
171
|
+
const L = live.current;
|
|
172
|
+
const dx = w ? (w - 92) / (N - 1) : 0;
|
|
173
|
+
const x = (L.hoverX ?? (N - 1) * dx) + dir * dx;
|
|
174
|
+
if (L.hoverX === null) L.hx = x;
|
|
175
|
+
L.hoverX = Math.max(0, Math.min((N - 1) * dx, x));
|
|
176
|
+
setHovering(true);
|
|
177
|
+
};
|
|
178
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative flex h-full w-full flex-col p-5 sm:p-6", children: [
|
|
179
|
+
/* @__PURE__ */ jsxs("div", { className: "relative z-10", children: [
|
|
180
|
+
/* @__PURE__ */ jsx("p", { className: "font-mono text-[11px] uppercase tracking-[0.12em] text-mute", children: "ACME / USD" }),
|
|
181
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-2 flex flex-wrap items-center gap-3", children: [
|
|
182
|
+
/* @__PURE__ */ jsx("span", { className: "text-[clamp(1.9rem,5.5vw,3rem)] font-medium leading-none tracking-[-0.04em] text-ink", children: /* @__PURE__ */ jsx(Roll, { text: price.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 }) }) }),
|
|
183
|
+
/* @__PURE__ */ jsxs(
|
|
184
|
+
"span",
|
|
185
|
+
{
|
|
186
|
+
className: "rounded-md px-2 py-1 font-mono text-[12px] leading-none tabular-nums transition-[color,background-color] duration-700",
|
|
187
|
+
style: { color: pill, background: `color-mix(in srgb, ${pill} 14%, transparent)`, transitionTimingFunction: EASE },
|
|
188
|
+
children: [
|
|
189
|
+
up ? "\u25B2" : "\u25BC",
|
|
190
|
+
" ",
|
|
191
|
+
Math.abs(pct).toFixed(2),
|
|
192
|
+
"%"
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
)
|
|
196
|
+
] })
|
|
197
|
+
] }),
|
|
198
|
+
/* @__PURE__ */ jsxs(
|
|
199
|
+
"div",
|
|
200
|
+
{
|
|
201
|
+
ref: box,
|
|
202
|
+
className: "relative -mx-5 mt-4 min-h-0 flex-1 cursor-crosshair outline-none [touch-action:pan-y] sm:-mx-6",
|
|
203
|
+
tabIndex: 0,
|
|
204
|
+
"aria-label": "Price chart. Arrow keys move the crosshair.",
|
|
205
|
+
onPointerMove: (e) => point(e.clientX),
|
|
206
|
+
onPointerDown: (e) => point(e.clientX),
|
|
207
|
+
onPointerLeave: leave,
|
|
208
|
+
onBlur: leave,
|
|
209
|
+
onKeyDown: (e) => {
|
|
210
|
+
if (e.key === "ArrowLeft") nudge(-1);
|
|
211
|
+
else if (e.key === "ArrowRight") nudge(1);
|
|
212
|
+
else if (e.key === "Escape") leave();
|
|
213
|
+
else return;
|
|
214
|
+
e.preventDefault();
|
|
215
|
+
},
|
|
216
|
+
children: [
|
|
217
|
+
w > 0 && /* @__PURE__ */ jsxs("svg", { width: w, height: h, className: "absolute inset-0 overflow-hidden", children: [
|
|
218
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: "pc-fill", x1: "0", x2: "0", y1: "0", y2: "1", children: [
|
|
219
|
+
/* @__PURE__ */ jsx("stop", { offset: "0", stopColor: color, stopOpacity: "0.18" }),
|
|
220
|
+
/* @__PURE__ */ jsx("stop", { offset: "1", stopColor: color, stopOpacity: "0" })
|
|
221
|
+
] }) }),
|
|
222
|
+
/* @__PURE__ */ jsx("path", { ref: area, fill: "url(#pc-fill)" }),
|
|
223
|
+
/* @__PURE__ */ jsx("path", { ref: line, fill: "none", stroke: color, strokeWidth: "1.5", strokeLinejoin: "round", strokeLinecap: "round" }),
|
|
224
|
+
/* @__PURE__ */ jsxs(
|
|
225
|
+
"g",
|
|
226
|
+
{
|
|
227
|
+
ref: cross,
|
|
228
|
+
className: "transition-opacity duration-300",
|
|
229
|
+
style: { opacity: hovering ? 1 : 0, transitionTimingFunction: EASE },
|
|
230
|
+
children: [
|
|
231
|
+
/* @__PURE__ */ jsx("line", { ref: crossLine, y1: 0, y2: h, stroke: "var(--ink)", strokeOpacity: "0.25", strokeDasharray: "3 4" }),
|
|
232
|
+
/* @__PURE__ */ jsx("circle", { ref: crossDot, r: "4.5", fill: "var(--paper)", stroke: color, strokeWidth: "2" })
|
|
233
|
+
]
|
|
234
|
+
}
|
|
235
|
+
)
|
|
236
|
+
] }),
|
|
237
|
+
/* @__PURE__ */ jsxs("div", { ref: dot, className: "pointer-events-none absolute left-0 top-0 will-change-transform", style: { transform: "translate(-99px,-99px)" }, children: [
|
|
238
|
+
/* @__PURE__ */ jsx("span", { className: "absolute -left-[5px] -top-[5px] h-[10px] w-[10px] rounded-full", style: { background: color } }),
|
|
239
|
+
/* @__PURE__ */ jsx("span", { className: "absolute -left-[5px] -top-[5px] h-[10px] w-[10px] animate-ping rounded-full opacity-60 motion-reduce:hidden", style: { background: color } }),
|
|
240
|
+
/* @__PURE__ */ jsx(
|
|
241
|
+
"span",
|
|
242
|
+
{
|
|
243
|
+
ref: tag,
|
|
244
|
+
className: "absolute left-3 -translate-y-1/2 rounded-[5px] px-1.5 py-0.5 font-mono text-[11px] tabular-nums text-paper",
|
|
245
|
+
style: { background: color }
|
|
246
|
+
}
|
|
247
|
+
)
|
|
248
|
+
] }),
|
|
249
|
+
/* @__PURE__ */ jsx(
|
|
250
|
+
"div",
|
|
251
|
+
{
|
|
252
|
+
ref: tip,
|
|
253
|
+
className: "pointer-events-none absolute left-0 top-1 rounded-md bg-paper-2 px-2.5 py-1.5 font-mono text-[11px] tabular-nums text-ink shadow-[0_8px_24px_-8px_rgb(0_0_0/0.6),inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_10%,transparent)] transition-opacity duration-300",
|
|
254
|
+
style: { opacity: hovering ? 1 : 0, transitionTimingFunction: EASE },
|
|
255
|
+
children: /* @__PURE__ */ jsx("span", { ref: tipText, className: "whitespace-pre" })
|
|
256
|
+
}
|
|
257
|
+
)
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
)
|
|
261
|
+
] });
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export {
|
|
265
|
+
PriceChart
|
|
266
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// components/kit/tabs.tsx
|
|
4
|
+
import { Tabs as T } from "radix-ui";
|
|
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
|
+
if (value === void 0) setInner(v);
|
|
39
|
+
onChange?.(v);
|
|
40
|
+
},
|
|
41
|
+
className,
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ jsxs(
|
|
44
|
+
T.List,
|
|
45
|
+
{
|
|
46
|
+
ref: list,
|
|
47
|
+
"aria-label": label,
|
|
48
|
+
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"),
|
|
49
|
+
children: [
|
|
50
|
+
!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)]" }),
|
|
51
|
+
bar && /* @__PURE__ */ jsx(
|
|
52
|
+
"span",
|
|
53
|
+
{
|
|
54
|
+
"aria-hidden": true,
|
|
55
|
+
className: cx(
|
|
56
|
+
"absolute motion-reduce:!transition-none",
|
|
57
|
+
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"
|
|
58
|
+
),
|
|
59
|
+
style: { left: bar.l, right: bar.r, transition: `left ${bar.dir === 1 ? slow : fast}, right ${bar.dir === 1 ? fast : slow}` }
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
tabs.map((t, i) => /* @__PURE__ */ jsxs(
|
|
63
|
+
T.Trigger,
|
|
64
|
+
{
|
|
65
|
+
value: t.value,
|
|
66
|
+
ref: (el) => {
|
|
67
|
+
refs.current[i] = el;
|
|
68
|
+
},
|
|
69
|
+
className: cx(
|
|
70
|
+
"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-[state=active]:text-ink",
|
|
71
|
+
pill ? "h-8 rounded-[7px] px-3.5" : "h-11 rounded-md"
|
|
72
|
+
),
|
|
73
|
+
children: [
|
|
74
|
+
t.label,
|
|
75
|
+
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-[state=active]/tab:bg-brand group-data-[state=active]/tab:text-white", children: t.count })
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
t.value
|
|
79
|
+
))
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
/* @__PURE__ */ jsx("style", { href: "asta-tabs", precedence: "asta", children: `@keyframes kit-tab-in { from { opacity: 0; transform: translateY(6px); filter: blur(2px) } to { opacity: 1; transform: none; filter: none } }` }),
|
|
84
|
+
tabs.map((t) => /* @__PURE__ */ jsx(T.Content, { 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))
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
var tabs_default = Tabs;
|
|
90
|
+
|
|
91
|
+
export {
|
|
92
|
+
Tabs,
|
|
93
|
+
tabs_default
|
|
94
|
+
};
|