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
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Astabyte Labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,70 @@
|
|
|
1
|
-
#
|
|
1
|
+
# asta-ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[Astabyte UI](https://ui.astabyte.com): motion-first React + Tailwind CSS v4 components. Interactive ones come in a Radix or a Base UI build with the same props, look and motion. This one package works two ways:
|
|
4
|
+
|
|
5
|
+
- **CLI:** copy a component's source into your project (shadcn style) and own it.
|
|
6
|
+
- **Library:** `import { Dialog } from "asta-ui"` and take updates with `pnpm update asta-ui`.
|
|
7
|
+
|
|
8
|
+
> **Beta.** Names and props can still change before 1.0. Pin the version and check the changelog before you update.
|
|
9
|
+
|
|
10
|
+
Works in Next.js, Vite, React Router, Astro (islands), TanStack Start and Gatsby.
|
|
11
|
+
|
|
12
|
+
## Copy the source (CLI)
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
pnpm dlx asta-ui@latest init # sets up shadcn (if needed) and the @astabyte registry
|
|
16
|
+
pnpm dlx asta-ui@latest add dialog select
|
|
17
|
+
pnpm dlx asta-ui@latest add textarea-aui-003 --base
|
|
18
|
+
pnpm dlx asta-ui@latest list chart
|
|
19
|
+
pnpm dlx asta-ui@latest prompt price-chart # a prompt for your AI coding agent
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Works with `npx`, `bunx` and `yarn dlx` too. Under the hood it calls the [shadcn CLI](https://ui.shadcn.com/docs/cli) with our registry URLs, so the files land in your project and are yours to edit. Any extra flag (`-y`, `-o`, `-p src/components`) is passed to shadcn.
|
|
23
|
+
|
|
24
|
+
| Command | What it does |
|
|
25
|
+
|---|---|
|
|
26
|
+
| `init [--radix \| --base]` | Runs `shadcn init` when there is no `components.json`, then adds the `@astabyte` registry for the primitive you pick. |
|
|
27
|
+
| `add <name...> [--radix \| --base]` | Checks the names against the catalogue and installs them. Without a flag it uses what `init` chose (Radix by default). |
|
|
28
|
+
| `list [search]` | Lists every component and variant. |
|
|
29
|
+
| `prompt <name>` | Prints a ready-to-paste prompt for Claude Code, Cursor, Codex, v0 or Lovable. |
|
|
30
|
+
|
|
31
|
+
Set `ASTA_UI_URL` to point at another registry host (e.g. a local dev server).
|
|
32
|
+
|
|
33
|
+
## Import it (library)
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
pnpm add asta-ui radix-ui # Radix build
|
|
37
|
+
pnpm add asta-ui @base-ui/react # Base UI build
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Needs React 18.3+ and Tailwind CSS v4. Add the stylesheet once, after Tailwind:
|
|
41
|
+
|
|
42
|
+
```css
|
|
43
|
+
@import "tailwindcss";
|
|
44
|
+
@import "asta-ui/styles.css";
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
It holds the tokens (`:root` light, `.dark` dark), the eases and an `@source` line, so Tailwind generates the classes the components use. If your setup misses them, add `@source "../node_modules/asta-ui/dist";` to your stylesheet (path relative to that file).
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
import { Button, Dialog, PriceChart, TextareaAui003 } from "asta-ui"; // Radix build
|
|
51
|
+
import { Button, Dialog } from "asta-ui/base"; // Base UI build
|
|
52
|
+
import { PriceChart } from "asta-ui/price-chart"; // one component
|
|
53
|
+
import { Dialog } from "asta-ui/base/dialog"; // one component, Base UI
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
| Entry | What it is | Needs |
|
|
57
|
+
|---|---|---|
|
|
58
|
+
| `asta-ui` | Every component, Radix build | `radix-ui` |
|
|
59
|
+
| `asta-ui/base` | Every component, Base UI build | `@base-ui/react` |
|
|
60
|
+
| `asta-ui/<slug>` | One component (Radix where it applies) | what that component uses |
|
|
61
|
+
| `asta-ui/base/<slug>` | One component, Base UI build | what that component uses |
|
|
62
|
+
| `asta-ui/styles.css` | Tokens + `@source` for Tailwind v4 | |
|
|
63
|
+
|
|
64
|
+
Components without primitives (motion blocks, inputs, badges…) are the same in both builds and need no headless package when imported by slug.
|
|
65
|
+
|
|
66
|
+
**Names** follow the site. Kit components go by their component name (`Dialog`, `Select`, `Toaster` and `useToast` for toast, `SignInCard`), motion blocks by theirs (`PriceChart`, `OrderBook`, `CardCheckout`) and variants by their id in PascalCase (`TextareaAui003`, also exported by name as `ChatComposer`). Button's inline spinner is exported as `ButtonSpinner`, so `Spinner` is the standalone loader. Props types are exported too (`DialogProps`, `SelectOption`…).
|
|
67
|
+
|
|
68
|
+
Every module is a client component (`"use client"`), so Next.js Server Components can render them directly. Motion blocks fill their parent: give the wrapper a size. They are designed on dark surfaces, so put them inside an element with the `dark` class.
|
|
69
|
+
|
|
70
|
+
MIT © Astabyte Labs
|
package/bin/asta-ui.mjs
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Astabyte UI CLI: a thin layer over the shadcn CLI that knows our registry.
|
|
3
|
+
// No dependencies on purpose, so `npx asta-ui@latest` starts instantly.
|
|
4
|
+
import { spawn } from "node:child_process";
|
|
5
|
+
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
6
|
+
import { join } from "node:path";
|
|
7
|
+
import { createRequire } from "node:module";
|
|
8
|
+
|
|
9
|
+
const { version } = createRequire(import.meta.url)("../package.json");
|
|
10
|
+
const SITE = (process.env.ASTA_UI_URL || "https://ui.astabyte.com").replace(/\/$/, "");
|
|
11
|
+
const NS = "@astabyte";
|
|
12
|
+
const tty = process.stdout.isTTY && !process.env.NO_COLOR;
|
|
13
|
+
const c = (code) => (s) => (tty ? `\x1b[${code}m${s}\x1b[0m` : String(s));
|
|
14
|
+
const dim = c(2), bold = c(1), blue = c(34), red = c(31), green = c(32);
|
|
15
|
+
|
|
16
|
+
const HELP = `
|
|
17
|
+
${bold("asta-ui")} ${dim(`v${version}`)} Astabyte UI components for any React + Tailwind v4 project
|
|
18
|
+
|
|
19
|
+
${bold("Usage")}
|
|
20
|
+
npx asta-ui@latest init [--radix | --base] set up shadcn and the ${NS} registry
|
|
21
|
+
npx asta-ui@latest add <component...> [flags] add components (e.g. add dialog select)
|
|
22
|
+
npx asta-ui@latest list [search] list components and variants
|
|
23
|
+
npx asta-ui@latest prompt <component> print a prompt for your AI coding agent
|
|
24
|
+
|
|
25
|
+
${bold("Flags")}
|
|
26
|
+
--radix | --base primitive library (default: what init chose, else Radix)
|
|
27
|
+
any other flag is passed to shadcn (e.g. -y, -o, -p src/components)
|
|
28
|
+
|
|
29
|
+
${bold("Docs")} ${SITE}
|
|
30
|
+
`;
|
|
31
|
+
|
|
32
|
+
function runner() {
|
|
33
|
+
const ua = process.env.npm_config_user_agent || "";
|
|
34
|
+
if (ua.startsWith("pnpm")) return ["pnpm", ["dlx"]];
|
|
35
|
+
if (ua.startsWith("bun")) return ["bunx", []];
|
|
36
|
+
if (ua.startsWith("yarn")) return ["yarn", ["dlx"]];
|
|
37
|
+
return ["npx", ["--yes", "--package", "shadcn@latest", "--"]];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function shadcn(args) {
|
|
41
|
+
const [bin, pre] = runner();
|
|
42
|
+
const cmd = bin === "npx" ? [...pre, "shadcn", ...args] : [...pre, "shadcn@latest", ...args];
|
|
43
|
+
console.log(dim(`→ ${bin === "npx" ? "npx shadcn@latest" : `${bin} ${pre.join(" ")} shadcn@latest`.replace(/ +/g, " ")} ${args.join(" ")}`));
|
|
44
|
+
// When we run under `npx asta-ui`, npm leaves its own exec settings in the env; drop them so the
|
|
45
|
+
// nested call resolves shadcn instead of re-running this package.
|
|
46
|
+
const env = { ...process.env };
|
|
47
|
+
for (const k of Object.keys(env)) if (/^npm_config_(package|call|yes)$/i.test(k)) delete env[k];
|
|
48
|
+
return new Promise((resolve) => {
|
|
49
|
+
const p = spawn(bin, cmd, { stdio: "inherit", env, shell: process.platform === "win32" });
|
|
50
|
+
p.on("close", (code) => resolve(code ?? 1));
|
|
51
|
+
p.on("error", (e) => {
|
|
52
|
+
console.error(red(`Could not start ${bin}: ${e.message}`));
|
|
53
|
+
resolve(1);
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const CONFIG = join(process.cwd(), "components.json");
|
|
59
|
+
const readConfig = () => {
|
|
60
|
+
try {
|
|
61
|
+
return JSON.parse(readFileSync(CONFIG, "utf8"));
|
|
62
|
+
} catch {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
const registryUrl = (p) => (p === "base" ? `${SITE}/r/base/{name}.json` : `${SITE}/r/{name}.json`);
|
|
67
|
+
|
|
68
|
+
function primitive(flags) {
|
|
69
|
+
if (flags.has("--base")) return "base";
|
|
70
|
+
if (flags.has("--radix")) return "radix";
|
|
71
|
+
const url = readConfig()?.registries?.[NS];
|
|
72
|
+
const u = typeof url === "string" ? url : url?.url;
|
|
73
|
+
return u && u.includes("/r/base/") ? "base" : "radix";
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
async function catalogue() {
|
|
77
|
+
const res = await fetch(`${SITE}/r/registry.json`).catch(() => null);
|
|
78
|
+
if (!res?.ok) throw new Error(`Could not load the catalogue from ${SITE}/r/registry.json`);
|
|
79
|
+
return (await res.json()).items;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function closest(name, names) {
|
|
83
|
+
const score = (a, b) => {
|
|
84
|
+
const m = Array.from({ length: a.length + 1 }, (_, i) => [i, ...Array(b.length).fill(0)]);
|
|
85
|
+
for (let j = 1; j <= b.length; j++) m[0][j] = j;
|
|
86
|
+
for (let i = 1; i <= a.length; i++)
|
|
87
|
+
for (let j = 1; j <= b.length; j++)
|
|
88
|
+
m[i][j] = Math.min(m[i - 1][j] + 1, m[i][j - 1] + 1, m[i - 1][j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1));
|
|
89
|
+
return m[a.length][b.length];
|
|
90
|
+
};
|
|
91
|
+
return names
|
|
92
|
+
.map((n) => [n, n.includes(name) ? 0 : score(name, n)])
|
|
93
|
+
.sort((x, y) => x[1] - y[1])
|
|
94
|
+
.slice(0, 3)
|
|
95
|
+
.filter(([, s]) => s <= 4)
|
|
96
|
+
.map(([n]) => n);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
async function init(flags, rest) {
|
|
100
|
+
const p = primitive(flags);
|
|
101
|
+
if (!existsSync(CONFIG)) {
|
|
102
|
+
console.log(bold("No components.json yet, running shadcn init first."));
|
|
103
|
+
const code = await shadcn(["init", ...rest]);
|
|
104
|
+
if (code !== 0 || !existsSync(CONFIG)) return code || 1;
|
|
105
|
+
}
|
|
106
|
+
const cfg = readConfig();
|
|
107
|
+
if (!cfg) {
|
|
108
|
+
console.error(red("components.json is not valid JSON."));
|
|
109
|
+
return 1;
|
|
110
|
+
}
|
|
111
|
+
cfg.registries = { ...(cfg.registries || {}), [NS]: registryUrl(p) };
|
|
112
|
+
writeFileSync(CONFIG, JSON.stringify(cfg, null, 2) + "\n");
|
|
113
|
+
console.log(`${green("✓")} Added the ${bold(NS)} registry (${p === "base" ? "Base UI" : "Radix"}) to components.json`);
|
|
114
|
+
console.log(` Next: ${blue("npx asta-ui@latest add button")} or ${blue(`npx shadcn@latest add ${NS}/button`)}`);
|
|
115
|
+
return 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
async function add(flags, names, rest) {
|
|
119
|
+
if (!names.length) {
|
|
120
|
+
console.error(red("Name at least one component, e.g. ") + blue("npx asta-ui@latest add dialog"));
|
|
121
|
+
return 1;
|
|
122
|
+
}
|
|
123
|
+
const p = primitive(flags);
|
|
124
|
+
let items = null;
|
|
125
|
+
try {
|
|
126
|
+
items = await catalogue();
|
|
127
|
+
} catch (e) {
|
|
128
|
+
console.warn(dim(`${e.message}. Skipping the name check.`));
|
|
129
|
+
}
|
|
130
|
+
if (items) {
|
|
131
|
+
const known = items.map((i) => i.name);
|
|
132
|
+
const missing = names.filter((n) => !known.includes(n));
|
|
133
|
+
if (missing.length) {
|
|
134
|
+
for (const m of missing) {
|
|
135
|
+
const s = closest(m, known);
|
|
136
|
+
console.error(red(`Unknown component "${m}".`) + (s.length ? ` Did you mean ${s.map(blue).join(", ")}?` : ""));
|
|
137
|
+
}
|
|
138
|
+
console.error(dim(`See all: npx asta-ui@latest list`));
|
|
139
|
+
return 1;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
const urls = names.map((n) => registryUrl(p).replace("{name}", n));
|
|
143
|
+
console.log(`${bold("Adding")} ${names.join(", ")} ${dim(`(${p === "base" ? "Base UI" : "Radix"})`)}`);
|
|
144
|
+
return shadcn(["add", ...urls, ...rest]);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
async function list(query) {
|
|
148
|
+
const items = await catalogue();
|
|
149
|
+
const q = (query || "").toLowerCase();
|
|
150
|
+
const rows = items.filter((i) => !q || `${i.name} ${i.title} ${i.description}`.toLowerCase().includes(q));
|
|
151
|
+
const w = Math.max(...rows.map((i) => i.name.length), 4);
|
|
152
|
+
for (const i of rows) console.log(`${blue(i.name.padEnd(w))} ${i.title}${i.description ? dim(` — ${i.description.slice(0, 70)}`) : ""}`);
|
|
153
|
+
console.log(dim(`\n${rows.length} of ${items.length} · add with: npx asta-ui@latest add <name>`));
|
|
154
|
+
return 0;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
async function prompt(name, flags) {
|
|
158
|
+
if (!name) {
|
|
159
|
+
console.error(red("Usage: npx asta-ui@latest prompt <component>"));
|
|
160
|
+
return 1;
|
|
161
|
+
}
|
|
162
|
+
const items = await catalogue();
|
|
163
|
+
const it = items.find((i) => i.name === name);
|
|
164
|
+
if (!it) {
|
|
165
|
+
const s = closest(name, items.map((i) => i.name));
|
|
166
|
+
console.error(red(`Unknown component "${name}".`) + (s.length ? ` Did you mean ${s.join(", ")}?` : ""));
|
|
167
|
+
return 1;
|
|
168
|
+
}
|
|
169
|
+
const p = primitive(flags);
|
|
170
|
+
console.log(`Add the Astabyte UI ${it.title} component to my project.
|
|
171
|
+
${it.description ?? ""}
|
|
172
|
+
|
|
173
|
+
Install it (any React + Tailwind CSS v4 project; run \`npx shadcn@latest init\` first if there is no components.json):
|
|
174
|
+
npx asta-ui@latest add ${name}${p === "base" ? " --base" : ""}
|
|
175
|
+
|
|
176
|
+
Docs and usage: ${SITE}/${name.replace(/-aui-\d+$/, "")}
|
|
177
|
+
Full catalogue for context: ${SITE}/llms.txt
|
|
178
|
+
|
|
179
|
+
Rules: keep the kit's colour tokens (brand, paper, ink, mute) instead of hard-coded colours, keep motion on transform/opacity and respect prefers-reduced-motion, keep the keyboard and ARIA behaviour.
|
|
180
|
+
|
|
181
|
+
Use it to: [describe where it goes and what it should do]`);
|
|
182
|
+
return 0;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const argv = process.argv.slice(2);
|
|
186
|
+
const cmd = argv[0];
|
|
187
|
+
const flags = new Set();
|
|
188
|
+
const names = [];
|
|
189
|
+
const rest = [];
|
|
190
|
+
const VALUE = new Set(["-p", "--path", "-c", "--cwd"]); // shadcn flags that take a value
|
|
191
|
+
for (let i = 1; i < argv.length; i++) {
|
|
192
|
+
const a = argv[i];
|
|
193
|
+
if (a === "--base" || a === "--radix") flags.add(a);
|
|
194
|
+
else if (VALUE.has(a)) rest.push(a, argv[++i] ?? "");
|
|
195
|
+
else if (a.startsWith("-")) rest.push(a);
|
|
196
|
+
else names.push(a);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const main = {
|
|
200
|
+
init: () => init(flags, rest),
|
|
201
|
+
add: () => add(flags, names, rest),
|
|
202
|
+
list: () => list(names[0]),
|
|
203
|
+
ls: () => list(names[0]),
|
|
204
|
+
prompt: () => prompt(names[0], flags),
|
|
205
|
+
"-v": () => (console.log(version), 0),
|
|
206
|
+
"--version": () => (console.log(version), 0),
|
|
207
|
+
}[cmd];
|
|
208
|
+
|
|
209
|
+
if (!main) {
|
|
210
|
+
console.log(HELP);
|
|
211
|
+
process.exit(cmd && !["-h", "--help", "help"].includes(cmd) ? 1 : 0);
|
|
212
|
+
}
|
|
213
|
+
main()
|
|
214
|
+
.then((code) => process.exit(code))
|
|
215
|
+
.catch((e) => {
|
|
216
|
+
console.error(red(e.message));
|
|
217
|
+
process.exit(1);
|
|
218
|
+
});
|
package/dist/avatar.d.ts
ADDED
package/dist/avatar.js
ADDED
package/dist/badge.d.ts
ADDED
package/dist/badge.js
ADDED