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