asta-ui 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-chat.d.ts +2 -0
- package/dist/ai-chat.js +9 -0
- package/dist/alert.d.ts +2 -0
- package/dist/alert.js +9 -0
- package/dist/announcement-bar.d.ts +2 -0
- package/dist/announcement-bar.js +9 -0
- package/dist/avatar-group.d.ts +2 -0
- package/dist/avatar-group.js +10 -0
- package/dist/avatar.js +3 -1
- package/dist/base/ai-chat.d.ts +2 -0
- package/dist/base/ai-chat.js +9 -0
- package/dist/base/alert.d.ts +2 -0
- package/dist/base/alert.js +9 -0
- package/dist/base/announcement-bar.d.ts +2 -0
- package/dist/base/announcement-bar.js +9 -0
- package/dist/base/avatar-group.d.ts +2 -0
- package/dist/base/avatar-group.js +10 -0
- package/dist/base/avatar.js +3 -1
- package/dist/base/booking-slots.d.ts +2 -0
- package/dist/base/booking-slots.js +7 -0
- package/dist/base/breadcrumb.d.ts +2 -0
- package/dist/base/breadcrumb.js +9 -0
- package/dist/base/carousel.d.ts +2 -0
- package/dist/base/carousel.js +9 -0
- package/dist/base/chat-thread.d.ts +2 -0
- package/dist/base/chat-thread.js +7 -0
- package/dist/base/checkout.d.ts +2 -0
- package/dist/base/checkout.js +12 -0
- package/dist/base/color-picker.d.ts +2 -0
- package/dist/base/color-picker.js +9 -0
- package/dist/base/combobox.d.ts +2 -0
- package/dist/base/combobox.js +9 -0
- package/dist/base/comments.d.ts +2 -0
- package/dist/base/comments.js +11 -0
- package/dist/base/context-menu.d.ts +2 -0
- package/dist/base/context-menu.js +9 -0
- package/dist/base/copy-button.d.ts +2 -0
- package/dist/base/copy-button.js +9 -0
- package/dist/base/data-table.d.ts +2 -0
- package/dist/base/data-table.js +9 -0
- package/dist/base/date-picker.d.ts +2 -0
- package/dist/base/date-picker.js +9 -0
- package/dist/base/drawer.d.ts +2 -0
- package/dist/base/drawer.js +9 -0
- package/dist/base/empty-state.d.ts +2 -0
- package/dist/base/empty-state.js +10 -0
- package/dist/base/event-calendar.d.ts +2 -0
- package/dist/base/event-calendar.js +9 -0
- package/dist/base/file-upload.d.ts +2 -0
- package/dist/base/file-upload.js +11 -0
- package/dist/base/hover-card.d.ts +2 -0
- package/dist/base/hover-card.js +9 -0
- package/dist/base/image-compare.d.ts +2 -0
- package/dist/base/image-compare.js +9 -0
- package/dist/base/inline-edit.d.ts +2 -0
- package/dist/base/inline-edit.js +9 -0
- package/dist/base/kanban.d.ts +2 -0
- package/dist/base/kanban.js +10 -0
- package/dist/base/notification-center.d.ts +2 -0
- package/dist/base/notification-center.js +11 -0
- package/dist/base/notification-stack.d.ts +2 -0
- package/dist/base/notification-stack.js +7 -0
- package/dist/base/now-playing.d.ts +2 -0
- package/dist/base/now-playing.js +7 -0
- package/dist/base/onboarding.d.ts +2 -0
- package/dist/base/onboarding.js +10 -0
- package/dist/base/otp-input.d.ts +2 -0
- package/dist/base/otp-input.js +9 -0
- package/dist/base/pagination.d.ts +2 -0
- package/dist/base/pagination.js +11 -0
- package/dist/base/password-input.d.ts +2 -0
- package/dist/base/password-input.js +13 -0
- package/dist/base/payment-received.d.ts +2 -0
- package/dist/base/payment-received.js +7 -0
- package/dist/base/plan-switcher.d.ts +2 -0
- package/dist/base/plan-switcher.js +7 -0
- package/dist/base/popover.d.ts +2 -0
- package/dist/base/popover.js +9 -0
- package/dist/base/progress.d.ts +2 -0
- package/dist/base/progress.js +11 -0
- package/dist/base/range-slider.d.ts +2 -0
- package/dist/base/range-slider.js +9 -0
- package/dist/base/rating.d.ts +2 -0
- package/dist/base/rating.js +9 -0
- package/dist/base/seat-picker.d.ts +2 -0
- package/dist/base/seat-picker.js +7 -0
- package/dist/base/shipment-tracker.d.ts +2 -0
- package/dist/base/shipment-tracker.js +7 -0
- package/dist/base/sidebar.d.ts +2 -0
- package/dist/base/sidebar.js +10 -0
- package/dist/base/stat-card.d.ts +2 -0
- package/dist/base/stat-card.js +9 -0
- package/dist/base/stepper.d.ts +2 -0
- package/dist/base/stepper.js +9 -0
- package/dist/base/team-members.d.ts +2 -0
- package/dist/base/team-members.js +12 -0
- package/dist/base/timeline.d.ts +2 -0
- package/dist/base/timeline.js +9 -0
- package/dist/base/toggle-group.d.ts +2 -0
- package/dist/base/toggle-group.js +9 -0
- package/dist/base/token-swap.d.ts +2 -0
- package/dist/base/token-swap.js +7 -0
- package/dist/base/tree-view.d.ts +2 -0
- package/dist/base/tree-view.js +9 -0
- package/dist/base/wishlist.d.ts +2 -0
- package/dist/base/wishlist.js +7 -0
- package/dist/base.js +250 -46
- package/dist/booking-slots.d.ts +2 -0
- package/dist/booking-slots.js +7 -0
- package/dist/breadcrumb.d.ts +2 -0
- package/dist/breadcrumb.js +9 -0
- package/dist/carousel.d.ts +2 -0
- package/dist/carousel.js +9 -0
- package/dist/chat-thread.d.ts +2 -0
- package/dist/chat-thread.js +7 -0
- package/dist/checkout.d.ts +2 -0
- package/dist/checkout.js +12 -0
- package/dist/{chunk-VGBP42IZ.js → chunk-2LZM435Z.js} +3 -2
- package/dist/chunk-33N6SZB5.js +186 -0
- package/dist/chunk-3KS5EN3Q.js +134 -0
- package/dist/chunk-3RMCFFW2.js +228 -0
- package/dist/chunk-45VUWOHQ.js +299 -0
- package/dist/chunk-4FR6KJOJ.js +91 -0
- package/dist/chunk-4GF7WTR3.js +230 -0
- package/dist/chunk-4XM6DKEO.js +164 -0
- package/dist/chunk-57PESBSZ.js +97 -0
- package/dist/chunk-6HPSPZTF.js +232 -0
- package/dist/chunk-6VQTFRSP.js +435 -0
- package/dist/chunk-72UKXOMW.js +150 -0
- package/dist/chunk-7JNO265Q.js +431 -0
- package/dist/chunk-AYSC7AIC.js +322 -0
- package/dist/chunk-B5F775GP.js +339 -0
- package/dist/chunk-B5OESWCR.js +339 -0
- package/dist/chunk-BP3LXM3X.js +309 -0
- package/dist/chunk-CA7YQ5BJ.js +271 -0
- package/dist/chunk-DRX3KRNL.js +191 -0
- package/dist/chunk-EAUUUVUR.js +123 -0
- package/dist/chunk-EXX6YSUX.js +340 -0
- package/dist/chunk-F7LAUVDJ.js +97 -0
- package/dist/chunk-FDHU3RWR.js +213 -0
- package/dist/chunk-FJGGXXTT.js +109 -0
- package/dist/chunk-FKHNK5VC.js +172 -0
- package/dist/chunk-FY6BRODJ.js +230 -0
- package/dist/chunk-GDTSCUHY.js +234 -0
- package/dist/chunk-H7D6G3GQ.js +290 -0
- package/dist/chunk-HB7DFNZP.js +109 -0
- package/dist/{chunk-H5C7HOQJ.js → chunk-HNO6EUGJ.js} +3 -2
- package/dist/chunk-HPVPHWDM.js +197 -0
- package/dist/chunk-I5NZSWDW.js +431 -0
- package/dist/chunk-IMBCYI3F.js +114 -0
- package/dist/chunk-IS2VTYDA.js +235 -0
- package/dist/chunk-ISZ7O2Q6.js +245 -0
- package/dist/chunk-JAQKJBVJ.js +170 -0
- package/dist/chunk-KYFZ5TTK.js +271 -0
- package/dist/chunk-LBXIMJFU.js +170 -0
- package/dist/chunk-MSBN2O66.js +110 -0
- package/dist/chunk-NB7X26PY.js +388 -0
- package/dist/chunk-NIYIT2QU.js +118 -0
- package/dist/chunk-QJXPS55V.js +246 -0
- package/dist/chunk-RBTX7TVA.js +170 -0
- package/dist/chunk-RFVKRVTD.js +172 -0
- package/dist/chunk-RIWKIBEP.js +271 -0
- package/dist/chunk-RSUZHZCG.js +230 -0
- package/dist/chunk-S2DJLW6B.js +322 -0
- package/dist/chunk-SDL3JXFN.js +97 -0
- package/dist/chunk-SDOWCCM2.js +271 -0
- package/dist/chunk-SPKSRH6G.js +283 -0
- package/dist/chunk-TLODJONC.js +120 -0
- package/dist/chunk-TXRLBMFL.js +191 -0
- package/dist/chunk-UWQ26LYZ.js +133 -0
- package/dist/chunk-V3SPSN3A.js +308 -0
- package/dist/chunk-W57O4RLL.js +435 -0
- package/dist/chunk-WO36QUH3.js +188 -0
- package/dist/chunk-YLAL6ICI.js +142 -0
- package/dist/chunk-ZGMBQZDV.js +250 -0
- package/dist/chunk-ZKMEKSJZ.js +133 -0
- package/dist/color-picker.d.ts +2 -0
- package/dist/color-picker.js +9 -0
- package/dist/combobox.d.ts +2 -0
- package/dist/combobox.js +9 -0
- package/dist/comments.d.ts +2 -0
- package/dist/comments.js +11 -0
- package/dist/context-menu.d.ts +2 -0
- package/dist/context-menu.js +9 -0
- package/dist/copy-button.d.ts +2 -0
- package/dist/copy-button.js +9 -0
- package/dist/data-table.d.ts +2 -0
- package/dist/data-table.js +9 -0
- package/dist/date-picker.d.ts +2 -0
- package/dist/date-picker.js +9 -0
- package/dist/drawer.d.ts +2 -0
- package/dist/drawer.js +9 -0
- package/dist/empty-state.d.ts +2 -0
- package/dist/empty-state.js +10 -0
- package/dist/event-calendar.d.ts +2 -0
- package/dist/event-calendar.js +9 -0
- package/dist/file-upload.d.ts +2 -0
- package/dist/file-upload.js +11 -0
- package/dist/hover-card.d.ts +2 -0
- package/dist/hover-card.js +9 -0
- package/dist/image-compare.d.ts +2 -0
- package/dist/image-compare.js +9 -0
- package/dist/index.js +250 -46
- package/dist/inline-edit.d.ts +2 -0
- package/dist/inline-edit.js +9 -0
- package/dist/kanban.d.ts +2 -0
- package/dist/kanban.js +10 -0
- package/dist/notification-center.d.ts +2 -0
- package/dist/notification-center.js +11 -0
- package/dist/notification-stack.d.ts +2 -0
- package/dist/notification-stack.js +7 -0
- package/dist/now-playing.d.ts +2 -0
- package/dist/now-playing.js +7 -0
- package/dist/onboarding.d.ts +2 -0
- package/dist/onboarding.js +10 -0
- package/dist/otp-input.d.ts +2 -0
- package/dist/otp-input.js +9 -0
- package/dist/pagination.d.ts +2 -0
- package/dist/pagination.js +11 -0
- package/dist/password-input.d.ts +2 -0
- package/dist/password-input.js +13 -0
- package/dist/payment-received.d.ts +2 -0
- package/dist/payment-received.js +7 -0
- package/dist/plan-switcher.d.ts +2 -0
- package/dist/plan-switcher.js +7 -0
- package/dist/popover.d.ts +2 -0
- package/dist/popover.js +9 -0
- package/dist/progress.d.ts +2 -0
- package/dist/progress.js +11 -0
- package/dist/range-slider.d.ts +2 -0
- package/dist/range-slider.js +9 -0
- package/dist/rating.d.ts +2 -0
- package/dist/rating.js +9 -0
- package/dist/seat-picker.d.ts +2 -0
- package/dist/seat-picker.js +7 -0
- package/dist/shipment-tracker.d.ts +2 -0
- package/dist/shipment-tracker.js +7 -0
- package/dist/sidebar.d.ts +2 -0
- package/dist/sidebar.js +10 -0
- package/dist/stat-card.d.ts +2 -0
- package/dist/stat-card.js +9 -0
- package/dist/stepper.d.ts +2 -0
- package/dist/stepper.js +9 -0
- package/dist/team-members.d.ts +2 -0
- package/dist/team-members.js +12 -0
- package/dist/timeline.d.ts +2 -0
- package/dist/timeline.js +9 -0
- package/dist/toggle-group.d.ts +2 -0
- package/dist/toggle-group.js +9 -0
- package/dist/token-swap.d.ts +2 -0
- package/dist/token-swap.js +7 -0
- package/dist/tree-view.d.ts +2 -0
- package/dist/tree-view.js +9 -0
- package/dist/types/components/kit/ai-chat.d.ts +37 -0
- package/dist/types/components/kit/alert.d.ts +27 -0
- package/dist/types/components/kit/announcement-bar.d.ts +36 -0
- package/dist/types/components/kit/avatar-group.d.ts +22 -0
- package/dist/types/components/kit/avatar.d.ts +2 -0
- package/dist/types/components/kit/base/avatar-group.d.ts +22 -0
- package/dist/types/components/kit/base/avatar.d.ts +2 -0
- package/dist/types/components/kit/base/checkout.d.ts +68 -0
- package/dist/types/components/kit/base/comments.d.ts +30 -0
- package/dist/types/components/kit/base/empty-state.d.ts +29 -0
- package/dist/types/components/kit/base/kanban.d.ts +26 -0
- package/dist/types/components/kit/base/notification-center.d.ts +34 -0
- package/dist/types/components/kit/base/onboarding.d.ts +28 -0
- package/dist/types/components/kit/base/sidebar.d.ts +43 -0
- package/dist/types/components/kit/base/team-members.d.ts +46 -0
- package/dist/types/components/kit/breadcrumb.d.ts +29 -0
- package/dist/types/components/kit/carousel.d.ts +21 -0
- package/dist/types/components/kit/checkout.d.ts +68 -0
- package/dist/types/components/kit/color-picker.d.ts +28 -0
- package/dist/types/components/kit/combobox.d.ts +40 -0
- package/dist/types/components/kit/comments.d.ts +30 -0
- package/dist/types/components/kit/context-menu.d.ts +37 -0
- package/dist/types/components/kit/copy-button.d.ts +20 -0
- package/dist/types/components/kit/data-table.d.ts +47 -0
- package/dist/types/components/kit/date-picker.d.ts +40 -0
- package/dist/types/components/kit/drawer.d.ts +26 -0
- package/dist/types/components/kit/empty-state.d.ts +29 -0
- package/dist/types/components/kit/event-calendar.d.ts +34 -0
- package/dist/types/components/kit/file-upload.d.ts +37 -0
- package/dist/types/components/kit/hover-card.d.ts +31 -0
- package/dist/types/components/kit/image-compare.d.ts +29 -0
- package/dist/types/components/kit/inline-edit.d.ts +26 -0
- package/dist/types/components/kit/kanban.d.ts +26 -0
- package/dist/types/components/kit/notification-center.d.ts +34 -0
- package/dist/types/components/kit/onboarding.d.ts +28 -0
- package/dist/types/components/kit/otp-input.d.ts +28 -0
- package/dist/types/components/kit/pagination.d.ts +25 -0
- package/dist/types/components/kit/password-input.d.ts +32 -0
- package/dist/types/components/kit/popover.d.ts +40 -0
- package/dist/types/components/kit/progress.d.ts +37 -0
- package/dist/types/components/kit/range-slider.d.ts +27 -0
- package/dist/types/components/kit/rating.d.ts +23 -0
- package/dist/types/components/kit/sidebar.d.ts +43 -0
- package/dist/types/components/kit/stat-card.d.ts +24 -0
- package/dist/types/components/kit/stepper.d.ts +36 -0
- package/dist/types/components/kit/team-members.d.ts +46 -0
- package/dist/types/components/kit/timeline.d.ts +24 -0
- package/dist/types/components/kit/toggle-group.d.ts +42 -0
- package/dist/types/components/kit/tree-view.d.ts +31 -0
- package/dist/types/components/lab/blocks/BookingSlots.d.ts +2 -0
- package/dist/types/components/lab/blocks/ChatThread.d.ts +2 -0
- package/dist/types/components/lab/blocks/NotificationStack.d.ts +2 -0
- package/dist/types/components/lab/blocks/NowPlaying.d.ts +2 -0
- package/dist/types/components/lab/blocks/PaymentReceived.d.ts +2 -0
- package/dist/types/components/lab/blocks/PlanSwitcher.d.ts +2 -0
- package/dist/types/components/lab/blocks/SeatPicker.d.ts +2 -0
- package/dist/types/components/lab/blocks/ShipmentTracker.d.ts +2 -0
- package/dist/types/components/lab/blocks/TokenSwap.d.ts +2 -0
- package/dist/types/components/lab/blocks/Wishlist.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/ai-chat.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/alert.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/announcement-bar.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/avatar-group.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/ai-chat.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/alert.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/announcement-bar.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/avatar-group.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/booking-slots.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/breadcrumb.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/carousel.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/chat-thread.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/checkout.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/color-picker.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/combobox.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/comments.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/context-menu.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/copy-button.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/data-table.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/date-picker.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/drawer.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/empty-state.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/event-calendar.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/file-upload.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/hover-card.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/image-compare.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/inline-edit.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/kanban.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/notification-center.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/notification-stack.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/now-playing.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/onboarding.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/otp-input.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/pagination.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/password-input.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/payment-received.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/plan-switcher.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/popover.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/progress.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/range-slider.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/rating.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/seat-picker.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/shipment-tracker.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/sidebar.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/stat-card.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/stepper.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/team-members.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/timeline.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/toggle-group.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/token-swap.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/tree-view.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/wishlist.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base.d.ts +87 -1
- package/dist/types/packages/asta-ui/src/booking-slots.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/breadcrumb.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/carousel.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/chat-thread.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/checkout.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/color-picker.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/combobox.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/comments.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/context-menu.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/copy-button.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/data-table.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/date-picker.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/drawer.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/empty-state.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/event-calendar.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/file-upload.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/hover-card.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/image-compare.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/index.d.ts +87 -1
- package/dist/types/packages/asta-ui/src/inline-edit.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/kanban.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/notification-center.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/notification-stack.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/now-playing.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/onboarding.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/otp-input.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/pagination.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/password-input.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/payment-received.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/plan-switcher.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/popover.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/progress.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/range-slider.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/rating.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/seat-picker.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/shipment-tracker.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/sidebar.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/stat-card.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/stepper.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/team-members.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/timeline.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/toggle-group.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/token-swap.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/tree-view.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/wishlist.d.ts +2 -0
- package/dist/wishlist.d.ts +2 -0
- package/dist/wishlist.js +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// components/kit/stepper.tsx
|
|
4
|
+
import { useId, useState } from "react";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
var cx = (...c) => c.filter(Boolean).join(" ");
|
|
7
|
+
var KEYFRAMES = `@keyframes kit-step-next { from { opacity: 0; transform: translateX(32px) } }
|
|
8
|
+
@keyframes kit-step-back { from { opacity: 0; transform: translateX(-32px) } }`;
|
|
9
|
+
function Mark({ index, state }) {
|
|
10
|
+
const done = state === "done";
|
|
11
|
+
return /* @__PURE__ */ jsxs(
|
|
12
|
+
"span",
|
|
13
|
+
{
|
|
14
|
+
className: cx(
|
|
15
|
+
"relative flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-[13px] font-medium tabular-nums transition-[background-color,box-shadow,color] duration-300",
|
|
16
|
+
done && "bg-brand text-white",
|
|
17
|
+
state === "current" && "bg-paper text-brand shadow-[inset_0_0_0_1.5px_var(--brand),0_0_0_4px_color-mix(in_srgb,var(--brand)_14%,transparent)]",
|
|
18
|
+
state === "todo" && "bg-paper text-mute shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_16%,transparent)]"
|
|
19
|
+
),
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ jsx("span", { className: cx("transition-[opacity,transform] duration-300 ease-[cubic-bezier(.16,1,.3,1)] motion-reduce:transition-none", done ? "scale-50 opacity-0" : "scale-100 opacity-100"), children: index + 1 }),
|
|
22
|
+
/* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "absolute h-4 w-4", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx(
|
|
23
|
+
"path",
|
|
24
|
+
{
|
|
25
|
+
d: "m3.5 8.5 3 3 6-7",
|
|
26
|
+
pathLength: 1,
|
|
27
|
+
strokeDasharray: 1,
|
|
28
|
+
strokeDashoffset: done ? 0 : 1,
|
|
29
|
+
className: "transition-[stroke-dashoffset] delay-150 duration-[450ms] ease-[cubic-bezier(.16,1,.3,1)] motion-reduce:transition-none"
|
|
30
|
+
}
|
|
31
|
+
) })
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
function Stepper({ steps, step, defaultStep = 0, onStepChange, clickable = true, complete, children, className }) {
|
|
37
|
+
const [inner, setInner] = useState(defaultStep);
|
|
38
|
+
const current = Math.max(0, Math.min(steps.length, step ?? inner));
|
|
39
|
+
const uid = useId();
|
|
40
|
+
const [prev, setPrev] = useState(current);
|
|
41
|
+
const [dir, setDir] = useState(1);
|
|
42
|
+
if (prev !== current) {
|
|
43
|
+
setDir(current > prev ? 1 : -1);
|
|
44
|
+
setPrev(current);
|
|
45
|
+
}
|
|
46
|
+
const goTo = (n) => {
|
|
47
|
+
const next = Math.max(0, Math.min(steps.length, n));
|
|
48
|
+
if (next === current) return;
|
|
49
|
+
if (step === void 0) setInner(next);
|
|
50
|
+
onStepChange?.(next);
|
|
51
|
+
};
|
|
52
|
+
const isComplete = current >= steps.length;
|
|
53
|
+
const controls = {
|
|
54
|
+
step: current,
|
|
55
|
+
next: () => goTo(current + 1),
|
|
56
|
+
back: () => goTo(current - 1),
|
|
57
|
+
goTo,
|
|
58
|
+
isFirst: current === 0,
|
|
59
|
+
isLast: current === steps.length - 1,
|
|
60
|
+
isComplete
|
|
61
|
+
};
|
|
62
|
+
const body = isComplete ? complete : steps[current]?.content;
|
|
63
|
+
return /* @__PURE__ */ jsxs("div", { className: cx("flex w-full flex-col", className), children: [
|
|
64
|
+
/* @__PURE__ */ jsx("style", { href: "asta-stepper", precedence: "asta", children: KEYFRAMES }),
|
|
65
|
+
/* @__PURE__ */ jsx("ol", { "aria-label": "Progress", className: "flex items-start", children: steps.map((s, i) => {
|
|
66
|
+
const state = i < current ? "done" : i === current ? "current" : "todo";
|
|
67
|
+
const canClick = clickable && state === "done" && !isComplete;
|
|
68
|
+
const label = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
69
|
+
/* @__PURE__ */ jsx(Mark, { index: i, state }),
|
|
70
|
+
/* @__PURE__ */ jsxs("span", { className: cx("min-w-0 flex-col text-left", state === "current" ? "flex" : "hidden sm:flex"), children: [
|
|
71
|
+
/* @__PURE__ */ jsx("span", { className: cx("truncate text-[13px] font-medium tracking-[-0.01em] transition-colors duration-300", state === "todo" ? "text-mute" : "text-ink"), children: s.title }),
|
|
72
|
+
s.description && /* @__PURE__ */ jsx("span", { className: "truncate text-[12px] text-mute", children: s.description })
|
|
73
|
+
] })
|
|
74
|
+
] });
|
|
75
|
+
return /* @__PURE__ */ jsxs("li", { "aria-current": state === "current" ? "step" : void 0, className: cx("flex min-w-0 items-center", i < steps.length - 1 && "flex-1"), children: [
|
|
76
|
+
canClick ? /* @__PURE__ */ jsx(
|
|
77
|
+
"button",
|
|
78
|
+
{
|
|
79
|
+
type: "button",
|
|
80
|
+
onClick: () => goTo(i),
|
|
81
|
+
"aria-label": `${s.title}, done. Go back to this step`,
|
|
82
|
+
className: "-m-1 flex min-w-0 items-center gap-2.5 rounded-lg p-1 outline-none transition-transform duration-200 hover:opacity-80 focus-visible:ring-2 focus-visible:ring-brand/50 active:scale-[0.98]",
|
|
83
|
+
children: label
|
|
84
|
+
}
|
|
85
|
+
) : /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 items-center gap-2.5", children: [
|
|
86
|
+
label,
|
|
87
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: state === "done" ? ", done" : state === "todo" ? ", not started" : "" })
|
|
88
|
+
] }),
|
|
89
|
+
i < steps.length - 1 && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "relative mx-3 h-[2px] min-w-6 flex-1 overflow-hidden rounded-full bg-[color-mix(in_srgb,var(--ink)_10%,transparent)]", children: /* @__PURE__ */ jsx(
|
|
90
|
+
"span",
|
|
91
|
+
{
|
|
92
|
+
className: "absolute inset-0 origin-left rounded-full bg-brand transition-transform duration-500 ease-[cubic-bezier(.16,1,.3,1)] motion-reduce:transition-none",
|
|
93
|
+
style: { transform: `scaleX(${i < current ? 1 : 0})` }
|
|
94
|
+
}
|
|
95
|
+
) })
|
|
96
|
+
] }, s.title);
|
|
97
|
+
}) }),
|
|
98
|
+
/* @__PURE__ */ jsx("div", { className: "mt-6 overflow-hidden", children: /* @__PURE__ */ jsx(
|
|
99
|
+
"div",
|
|
100
|
+
{
|
|
101
|
+
id: `${uid}-panel`,
|
|
102
|
+
role: "region",
|
|
103
|
+
"aria-label": isComplete ? "Done" : steps[current]?.title,
|
|
104
|
+
className: cx(
|
|
105
|
+
"motion-reduce:!animate-none",
|
|
106
|
+
dir === 1 ? "animate-[kit-step-next_.42s_cubic-bezier(.16,1,.3,1)_both]" : "animate-[kit-step-back_.42s_cubic-bezier(.16,1,.3,1)_both]"
|
|
107
|
+
),
|
|
108
|
+
children: body
|
|
109
|
+
},
|
|
110
|
+
current
|
|
111
|
+
) }),
|
|
112
|
+
children && /* @__PURE__ */ jsx("div", { className: "mt-6", children: typeof children === "function" ? children(controls) : children })
|
|
113
|
+
] });
|
|
114
|
+
}
|
|
115
|
+
var stepper_default = Stepper;
|
|
116
|
+
|
|
117
|
+
export {
|
|
118
|
+
Stepper,
|
|
119
|
+
stepper_default
|
|
120
|
+
};
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Avatar
|
|
4
|
+
} from "./chunk-HNO6EUGJ.js";
|
|
5
|
+
import {
|
|
6
|
+
Button
|
|
7
|
+
} from "./chunk-ZWBJUJTR.js";
|
|
8
|
+
|
|
9
|
+
// components/kit/comments.tsx
|
|
10
|
+
import { useId, useRef, useState } from "react";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
var cx = (...c) => c.filter(Boolean).join(" ");
|
|
13
|
+
var CURVE = "cubic-bezier(.16,1,.3,1)";
|
|
14
|
+
function Composer({
|
|
15
|
+
user,
|
|
16
|
+
label,
|
|
17
|
+
placeholder,
|
|
18
|
+
initial = "",
|
|
19
|
+
autoFocus,
|
|
20
|
+
onSubmit,
|
|
21
|
+
onCancel
|
|
22
|
+
}) {
|
|
23
|
+
const [text, setText] = useState(initial);
|
|
24
|
+
const id = useId();
|
|
25
|
+
const area = useRef(null);
|
|
26
|
+
const empty = !text.trim();
|
|
27
|
+
const send = () => {
|
|
28
|
+
if (empty) return;
|
|
29
|
+
onSubmit(text.trim());
|
|
30
|
+
setText("");
|
|
31
|
+
area.current?.focus();
|
|
32
|
+
};
|
|
33
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex gap-3", children: [
|
|
34
|
+
/* @__PURE__ */ jsx(Avatar, { name: user.name, src: user.src, size: "sm" }),
|
|
35
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1 rounded-[10px] bg-paper shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_12%,transparent)] transition-shadow duration-200 focus-within:shadow-[inset_0_0_0_1px_var(--brand),0_0_0_3px_color-mix(in_srgb,var(--brand)_14%,transparent)]", children: [
|
|
36
|
+
/* @__PURE__ */ jsx("label", { htmlFor: id, className: "sr-only", children: label }),
|
|
37
|
+
/* @__PURE__ */ jsx(
|
|
38
|
+
"textarea",
|
|
39
|
+
{
|
|
40
|
+
ref: area,
|
|
41
|
+
id,
|
|
42
|
+
rows: 1,
|
|
43
|
+
value: text,
|
|
44
|
+
autoFocus,
|
|
45
|
+
placeholder,
|
|
46
|
+
onChange: (e) => setText(e.target.value),
|
|
47
|
+
onFocus: (e) => e.currentTarget.setSelectionRange(e.currentTarget.value.length, e.currentTarget.value.length),
|
|
48
|
+
onKeyDown: (e) => {
|
|
49
|
+
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
|
|
50
|
+
e.preventDefault();
|
|
51
|
+
send();
|
|
52
|
+
} else if (e.key === "Escape" && onCancel) {
|
|
53
|
+
e.preventDefault();
|
|
54
|
+
onCancel();
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
className: "block max-h-40 min-h-[44px] w-full resize-none bg-transparent px-3 pt-2.5 text-[14px] leading-relaxed text-ink outline-none [field-sizing:content] placeholder:text-mute"
|
|
58
|
+
}
|
|
59
|
+
),
|
|
60
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-1.5 px-2 pb-2", children: [
|
|
61
|
+
onCancel && /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "xs", onClick: onCancel, children: "Cancel" }),
|
|
62
|
+
/* @__PURE__ */ jsx(Button, { variant: "accent", size: "xs", disabled: empty, onClick: send, kbd: "\u2318\u21B5", children: label })
|
|
63
|
+
] })
|
|
64
|
+
] })
|
|
65
|
+
] });
|
|
66
|
+
}
|
|
67
|
+
function Like({ count, liked, pop, onToggle }) {
|
|
68
|
+
return /* @__PURE__ */ jsxs(
|
|
69
|
+
"button",
|
|
70
|
+
{
|
|
71
|
+
type: "button",
|
|
72
|
+
"aria-pressed": liked,
|
|
73
|
+
"aria-label": `Like, ${count}`,
|
|
74
|
+
onClick: onToggle,
|
|
75
|
+
className: cx(
|
|
76
|
+
"inline-flex h-7 items-center gap-1.5 rounded-full px-2.5 text-[12px] tabular-nums outline-none transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-brand/50",
|
|
77
|
+
liked ? "bg-[color-mix(in_srgb,var(--brand)_10%,transparent)] text-brand" : "text-mute hover:bg-paper-2 hover:text-ink"
|
|
78
|
+
),
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ jsx(
|
|
81
|
+
"svg",
|
|
82
|
+
{
|
|
83
|
+
viewBox: "0 0 16 16",
|
|
84
|
+
className: "h-3.5 w-3.5",
|
|
85
|
+
fill: liked ? "currentColor" : "none",
|
|
86
|
+
stroke: "currentColor",
|
|
87
|
+
strokeWidth: "1.5",
|
|
88
|
+
strokeLinejoin: "round",
|
|
89
|
+
"aria-hidden": true,
|
|
90
|
+
style: pop && liked ? { animation: `kit-cm-pop .45s ${CURVE}` } : void 0,
|
|
91
|
+
children: /* @__PURE__ */ jsx("path", { d: "M8 13.5S2.5 10.3 2.5 6.4A2.9 2.9 0 0 1 8 5a2.9 2.9 0 0 1 5.5 1.4c0 3.9-5.5 7.1-5.5 7.1Z" })
|
|
92
|
+
},
|
|
93
|
+
liked ? "on" : "off"
|
|
94
|
+
),
|
|
95
|
+
/* @__PURE__ */ jsx("span", { className: "relative inline-flex overflow-hidden", children: /* @__PURE__ */ jsx("span", { style: pop ? { animation: `kit-cm-roll .35s ${CURVE}` } : void 0, children: count }, count) })
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
function Comments({ defaultComments, currentUser, title = "Discussion", onPost, className }) {
|
|
101
|
+
const [comments, setComments] = useState(defaultComments);
|
|
102
|
+
const [replyTo, setReplyTo] = useState(null);
|
|
103
|
+
const [fresh, setFresh] = useState([]);
|
|
104
|
+
const [popped, setPopped] = useState(null);
|
|
105
|
+
const replyButtons = useRef(/* @__PURE__ */ new Map());
|
|
106
|
+
const seq = useRef(0);
|
|
107
|
+
const total = comments.reduce((n, c) => n + 1 + (c.replies?.length ?? 0), 0);
|
|
108
|
+
const post = (body, parent) => {
|
|
109
|
+
const item = { id: `new-${++seq.current}`, author: currentUser, time: "Just now", body, likes: 0 };
|
|
110
|
+
setComments((list) => parent ? list.map((c) => c.id === parent ? { ...c, replies: [...c.replies ?? [], item] } : c) : [...list, item]);
|
|
111
|
+
setFresh((f) => [...f, item.id]);
|
|
112
|
+
onPost?.(body, parent);
|
|
113
|
+
};
|
|
114
|
+
const toggleLike = (id) => {
|
|
115
|
+
const flip = (c) => c.id === id ? { ...c, liked: !c.liked, likes: (c.likes ?? 0) + (c.liked ? -1 : 1) } : { ...c, replies: c.replies?.map(flip) };
|
|
116
|
+
setComments((list) => list.map(flip));
|
|
117
|
+
setPopped(id);
|
|
118
|
+
};
|
|
119
|
+
const closeReply = () => {
|
|
120
|
+
const parent = replyTo?.parent;
|
|
121
|
+
setReplyTo(null);
|
|
122
|
+
if (parent) replyButtons.current.get(parent)?.focus();
|
|
123
|
+
};
|
|
124
|
+
const row = (c, parent) => /* @__PURE__ */ jsxs("article", { className: "flex gap-3", style: fresh.includes(c.id) ? { animation: `kit-cm-in .5s ${CURVE} both` } : void 0, children: [
|
|
125
|
+
/* @__PURE__ */ jsx(Avatar, { name: c.author.name, src: c.author.src, size: "sm" }),
|
|
126
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
127
|
+
/* @__PURE__ */ jsxs("header", { className: "flex items-baseline gap-2", children: [
|
|
128
|
+
/* @__PURE__ */ jsx("span", { className: "text-[13.5px] font-medium text-ink", children: c.author.name }),
|
|
129
|
+
/* @__PURE__ */ jsx("span", { className: "text-[12px] text-mute", children: c.time })
|
|
130
|
+
] }),
|
|
131
|
+
/* @__PURE__ */ jsx("p", { className: "mt-0.5 whitespace-pre-wrap break-words text-[14px] leading-relaxed text-ink-2", children: c.body }),
|
|
132
|
+
/* @__PURE__ */ jsxs("div", { className: "-ml-2.5 mt-1.5 flex items-center gap-0.5", children: [
|
|
133
|
+
/* @__PURE__ */ jsx(Like, { count: c.likes ?? 0, liked: !!c.liked, pop: popped === c.id, onToggle: () => toggleLike(c.id) }),
|
|
134
|
+
/* @__PURE__ */ jsx(
|
|
135
|
+
"button",
|
|
136
|
+
{
|
|
137
|
+
ref: (el) => {
|
|
138
|
+
if (el && c.id === parent) replyButtons.current.set(parent, el);
|
|
139
|
+
},
|
|
140
|
+
type: "button",
|
|
141
|
+
onClick: () => setReplyTo({ parent, mention: c.id === parent ? void 0 : c.author.name.split(" ")[0] }),
|
|
142
|
+
className: "inline-flex h-7 items-center rounded-full px-2.5 text-[12px] text-mute outline-none transition-colors hover:bg-paper-2 hover:text-ink focus-visible:ring-2 focus-visible:ring-brand/50",
|
|
143
|
+
children: "Reply"
|
|
144
|
+
}
|
|
145
|
+
)
|
|
146
|
+
] })
|
|
147
|
+
] })
|
|
148
|
+
] }, c.id);
|
|
149
|
+
return /* @__PURE__ */ jsxs("section", { "aria-label": title, className: cx("kit-cm w-full max-w-[560px]", className), children: [
|
|
150
|
+
/* @__PURE__ */ jsx("style", { href: "asta-comments", precedence: "asta", children: `
|
|
151
|
+
@keyframes kit-cm-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
|
|
152
|
+
@keyframes kit-cm-pop { 0% { transform: scale(.6); } 55% { transform: scale(1.25); } 100% { transform: none; } }
|
|
153
|
+
@keyframes kit-cm-roll { from { opacity: 0; transform: translateY(70%); } to { opacity: 1; transform: none; } }
|
|
154
|
+
@media (prefers-reduced-motion: reduce) { .kit-cm, .kit-cm * { animation: none !important; transition-duration: 0s !important; } }
|
|
155
|
+
` }),
|
|
156
|
+
/* @__PURE__ */ jsxs("h3", { className: "mb-5 flex items-baseline gap-2 text-[15px] font-medium tracking-[-0.01em] text-ink", children: [
|
|
157
|
+
title,
|
|
158
|
+
/* @__PURE__ */ jsx("span", { className: "text-[12.5px] font-normal tabular-nums text-mute", children: total })
|
|
159
|
+
] }),
|
|
160
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-col gap-6", children: comments.map((c) => /* @__PURE__ */ jsxs("div", { children: [
|
|
161
|
+
row(c, c.id),
|
|
162
|
+
(!!c.replies?.length || replyTo?.parent === c.id) && /* @__PURE__ */ jsxs("div", { className: "relative mt-4 flex flex-col gap-4 pl-11", children: [
|
|
163
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "absolute bottom-1 left-4 top-0 w-px bg-[color-mix(in_srgb,var(--ink)_9%,transparent)]" }),
|
|
164
|
+
c.replies?.map((r) => row(r, c.id)),
|
|
165
|
+
replyTo?.parent === c.id && /* @__PURE__ */ jsx("div", { style: { animation: `kit-cm-in .4s ${CURVE} both` }, children: /* @__PURE__ */ jsx(
|
|
166
|
+
Composer,
|
|
167
|
+
{
|
|
168
|
+
user: currentUser,
|
|
169
|
+
label: "Reply",
|
|
170
|
+
placeholder: `Reply to ${c.author.name.split(" ")[0]}\u2026`,
|
|
171
|
+
initial: replyTo.mention ? `@${replyTo.mention} ` : "",
|
|
172
|
+
autoFocus: true,
|
|
173
|
+
onSubmit: (body) => {
|
|
174
|
+
post(body, c.id);
|
|
175
|
+
closeReply();
|
|
176
|
+
},
|
|
177
|
+
onCancel: closeReply
|
|
178
|
+
},
|
|
179
|
+
replyTo.mention ?? "reply"
|
|
180
|
+
) })
|
|
181
|
+
] })
|
|
182
|
+
] }, c.id)) }),
|
|
183
|
+
/* @__PURE__ */ jsx("div", { className: "mt-8", children: /* @__PURE__ */ jsx(Composer, { user: currentUser, label: "Comment", placeholder: "Add a comment\u2026", onSubmit: (body) => post(body) }) })
|
|
184
|
+
] });
|
|
185
|
+
}
|
|
186
|
+
var comments_default = Comments;
|
|
187
|
+
|
|
188
|
+
export {
|
|
189
|
+
Comments,
|
|
190
|
+
comments_default
|
|
191
|
+
};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// components/kit/otp-input.tsx
|
|
4
|
+
import { Fragment, useId, useState } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
var cx = (...c) => c.filter(Boolean).join(" ");
|
|
7
|
+
var KEYFRAMES = `@keyframes asta-otp-drop { from { opacity: 0; transform: translateY(-7px) scale(.9) } }
|
|
8
|
+
@keyframes asta-otp-caret { 0%, 100% { opacity: 1 } 50% { opacity: 0 } }
|
|
9
|
+
@keyframes asta-otp-wave-0 { 0%, 100% { transform: translateY(0) } 35% { transform: translateY(-7px) } }
|
|
10
|
+
@keyframes asta-otp-wave-1 { 0%, 100% { transform: translateY(0) } 35% { transform: translateY(-7px) } }
|
|
11
|
+
@keyframes asta-otp-shake-0 { 0%, 100% { transform: translateX(0) } 20% { transform: translateX(-7px) } 40% { transform: translateX(6px) } 60% { transform: translateX(-4px) } 80% { transform: translateX(2px) } }
|
|
12
|
+
@keyframes asta-otp-shake-1 { 0%, 100% { transform: translateX(0) } 20% { transform: translateX(-7px) } 40% { transform: translateX(6px) } 60% { transform: translateX(-4px) } 80% { transform: translateX(2px) } }`;
|
|
13
|
+
var EASE = "cubic-bezier(.16,1,.3,1)";
|
|
14
|
+
function OtpInput({
|
|
15
|
+
length = 6,
|
|
16
|
+
value,
|
|
17
|
+
defaultValue = "",
|
|
18
|
+
onChange,
|
|
19
|
+
onComplete,
|
|
20
|
+
digitsOnly = true,
|
|
21
|
+
error,
|
|
22
|
+
disabled,
|
|
23
|
+
autoFocus,
|
|
24
|
+
groupSize,
|
|
25
|
+
label = "One-time code",
|
|
26
|
+
name,
|
|
27
|
+
className
|
|
28
|
+
}) {
|
|
29
|
+
const id = useId();
|
|
30
|
+
const [inner, setInner] = useState(defaultValue);
|
|
31
|
+
const code = (value ?? inner).slice(0, length);
|
|
32
|
+
const [focused, setFocused] = useState(false);
|
|
33
|
+
const [wave, setWave] = useState(0);
|
|
34
|
+
const [shake, setShake] = useState(0);
|
|
35
|
+
const [prevError, setPrevError] = useState(Boolean(error));
|
|
36
|
+
if (Boolean(error) !== prevError) {
|
|
37
|
+
setPrevError(Boolean(error));
|
|
38
|
+
if (error) setShake((s) => s + 1);
|
|
39
|
+
}
|
|
40
|
+
const clean = (s) => (digitsOnly ? s.replace(/\D/g, "") : s.replace(/[^a-z0-9]/gi, "").toUpperCase()).slice(0, length);
|
|
41
|
+
const update = (raw) => {
|
|
42
|
+
const next = clean(raw);
|
|
43
|
+
if (next === code) return;
|
|
44
|
+
if (value === void 0) setInner(next);
|
|
45
|
+
onChange?.(next);
|
|
46
|
+
if (next.length === length && code.length < length) {
|
|
47
|
+
setWave((w) => w + 1);
|
|
48
|
+
onComplete?.(next);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const onPaste = (e) => {
|
|
52
|
+
e.preventDefault();
|
|
53
|
+
update(e.clipboardData.getData("text"));
|
|
54
|
+
};
|
|
55
|
+
const toEnd = (e) => {
|
|
56
|
+
const el = e.currentTarget;
|
|
57
|
+
const n = el.value.length;
|
|
58
|
+
if (el.selectionStart !== n || el.selectionEnd !== n) el.setSelectionRange(n, n);
|
|
59
|
+
};
|
|
60
|
+
const active = focused ? Math.min(code.length, length - 1) : -1;
|
|
61
|
+
const full = code.length === length;
|
|
62
|
+
return /* @__PURE__ */ jsxs("div", { className: cx("relative inline-flex", disabled && "opacity-45", className), children: [
|
|
63
|
+
/* @__PURE__ */ jsx("style", { href: "asta-otp-input", precedence: "asta", children: KEYFRAMES }),
|
|
64
|
+
/* @__PURE__ */ jsx(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
"aria-hidden": true,
|
|
68
|
+
className: "flex items-center gap-2 motion-reduce:!animate-none",
|
|
69
|
+
style: shake > 0 ? { animation: `asta-otp-shake-${shake % 2} .42s ${EASE} both` } : void 0,
|
|
70
|
+
children: Array.from({ length }, (_, i) => {
|
|
71
|
+
const ch = code[i];
|
|
72
|
+
const on = i === active && !error;
|
|
73
|
+
const ring = error ? "shadow-[inset_0_0_0_1.5px_var(--ink)]" : on ? "shadow-[inset_0_0_0_1.5px_var(--brand),0_0_0_4px_color-mix(in_srgb,var(--brand)_16%,transparent)]" : full ? "shadow-[inset_0_0_0_1.5px_color-mix(in_srgb,var(--brand)_55%,transparent)]" : ch ? "shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_26%,transparent)]" : "shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_14%,transparent)]";
|
|
74
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
75
|
+
groupSize && i > 0 && i % groupSize === 0 && /* @__PURE__ */ jsx("span", { className: "mx-0.5 h-[2px] w-2.5 rounded-full bg-[color-mix(in_srgb,var(--ink)_22%,transparent)]" }),
|
|
76
|
+
/* @__PURE__ */ jsx(
|
|
77
|
+
"span",
|
|
78
|
+
{
|
|
79
|
+
className: "block motion-reduce:!animate-none",
|
|
80
|
+
style: wave > 0 ? { animation: `asta-otp-wave-${wave % 2} .55s ${EASE} ${i * 45}ms both` } : void 0,
|
|
81
|
+
children: /* @__PURE__ */ jsx(
|
|
82
|
+
"span",
|
|
83
|
+
{
|
|
84
|
+
className: cx(
|
|
85
|
+
"grid h-12 w-10 place-items-center rounded-[10px] bg-paper text-[22px] font-medium tabular-nums tracking-[-0.02em] transition-shadow duration-200 sm:h-14 sm:w-12 sm:text-[24px]",
|
|
86
|
+
"text-ink",
|
|
87
|
+
ring
|
|
88
|
+
),
|
|
89
|
+
children: ch ? /* @__PURE__ */ jsx("span", { className: "animate-[asta-otp-drop_.3s_cubic-bezier(.16,1,.3,1)_both] motion-reduce:animate-none", children: ch }, `${i}-${ch}`) : on ? /* @__PURE__ */ jsx("span", { className: "h-6 w-[1.5px] rounded-full bg-ink animate-[asta-otp-caret_1.05s_steps(1)_infinite] motion-reduce:animate-none" }) : null
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
] }, i);
|
|
95
|
+
})
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
/* @__PURE__ */ jsx(
|
|
99
|
+
"input",
|
|
100
|
+
{
|
|
101
|
+
id,
|
|
102
|
+
name,
|
|
103
|
+
value: code,
|
|
104
|
+
onChange: (e) => update(e.target.value),
|
|
105
|
+
onPaste,
|
|
106
|
+
onFocus: (e) => {
|
|
107
|
+
setFocused(true);
|
|
108
|
+
toEnd(e);
|
|
109
|
+
},
|
|
110
|
+
onBlur: () => setFocused(false),
|
|
111
|
+
onSelect: toEnd,
|
|
112
|
+
onClick: toEnd,
|
|
113
|
+
disabled,
|
|
114
|
+
autoFocus,
|
|
115
|
+
maxLength: length,
|
|
116
|
+
inputMode: digitsOnly ? "numeric" : "text",
|
|
117
|
+
pattern: digitsOnly ? "[0-9]*" : void 0,
|
|
118
|
+
autoComplete: "one-time-code",
|
|
119
|
+
autoCapitalize: digitsOnly ? void 0 : "characters",
|
|
120
|
+
spellCheck: false,
|
|
121
|
+
"aria-label": label,
|
|
122
|
+
"aria-invalid": error || void 0,
|
|
123
|
+
className: "absolute inset-0 h-full w-full cursor-text bg-transparent text-[16px] text-transparent caret-transparent opacity-0 outline-none disabled:cursor-not-allowed"
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
] });
|
|
127
|
+
}
|
|
128
|
+
var otp_input_default = OtpInput;
|
|
129
|
+
|
|
130
|
+
export {
|
|
131
|
+
OtpInput,
|
|
132
|
+
otp_input_default
|
|
133
|
+
};
|