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,246 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// components/lab/blocks/PaymentReceived.tsx
|
|
4
|
+
import { useEffect, useRef, useState } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
var EASE = "cubic-bezier(.16,1,.3,1)";
|
|
7
|
+
var RING = "shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_10%,transparent)]";
|
|
8
|
+
var DIGITS = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
|
9
|
+
var BASE = 12480.2;
|
|
10
|
+
var OLD = [
|
|
11
|
+
{ id: -1, name: "Pine Cafe", amount: 34, via: "Card \xB7\xB7 2207" },
|
|
12
|
+
{ id: -2, name: "M. Silva", amount: 120, via: "Transfer" },
|
|
13
|
+
{ id: -3, name: "Orbit Print", amount: 76.5, via: "Card \xB7\xB7 5530" }
|
|
14
|
+
];
|
|
15
|
+
var INCOMING = [
|
|
16
|
+
{ id: 1, name: "Maple & Co.", amount: 128, via: "Card \xB7\xB7 4821" },
|
|
17
|
+
{ id: 2, name: "Juniper Studio", amount: 342.5, via: "Transfer" },
|
|
18
|
+
{ id: 3, name: "R. Okafor", amount: 46.2, via: "Card \xB7\xB7 0937" },
|
|
19
|
+
{ id: 4, name: "Northfield Goods", amount: 219.99, via: "Transfer" },
|
|
20
|
+
{ id: 5, name: "Lumen Bakery", amount: 18.75, via: "Card \xB7\xB7 1150" },
|
|
21
|
+
{ id: 6, name: "Atlas Rentals", amount: 512, via: "Transfer" },
|
|
22
|
+
{ id: 7, name: "K. Tanaka", amount: 89.4, via: "Card \xB7\xB7 7718" },
|
|
23
|
+
{ id: 8, name: "Harbor Supply", amount: 264.1, via: "Transfer" }
|
|
24
|
+
];
|
|
25
|
+
var SPARK = [80, 140, 60, 210, 120, 180, 90, 160, 230, 110];
|
|
26
|
+
var ROWS = 3;
|
|
27
|
+
var money = (n) => `$${n.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
|
|
28
|
+
var initials = (n) => n.replace(/[^A-Za-z ]/g, "").split(" ").filter(Boolean).slice(0, 2).map((w) => w[0]).join("");
|
|
29
|
+
function Roll({ value, instant }) {
|
|
30
|
+
const chars = value.split("");
|
|
31
|
+
return /* @__PURE__ */ jsx("span", { className: "inline-flex items-start leading-[1.1em] tabular-nums", "aria-label": value, children: chars.map((c, i) => {
|
|
32
|
+
const key = chars.length - i;
|
|
33
|
+
if (!/\d/.test(c))
|
|
34
|
+
return /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "inline-block h-[1.1em]", children: c }, `s${key}`);
|
|
35
|
+
return /* @__PURE__ */ jsxs("span", { "aria-hidden": true, className: "relative inline-block h-[1.1em] overflow-hidden leading-[1.1em]", children: [
|
|
36
|
+
/* @__PURE__ */ jsx("span", { className: "invisible", children: "0" }),
|
|
37
|
+
/* @__PURE__ */ jsx(
|
|
38
|
+
"span",
|
|
39
|
+
{
|
|
40
|
+
className: "absolute left-0 top-0 flex flex-col motion-reduce:transition-none",
|
|
41
|
+
style: { transform: `translateY(-${Number(c) * 1.1}em)`, transition: instant ? "none" : `transform .8s ${EASE} ${(chars.length - i) * 22}ms` },
|
|
42
|
+
children: DIGITS.map((d) => /* @__PURE__ */ jsx("span", { className: "block h-[1.1em]", children: d }, d))
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
] }, `d${key}`);
|
|
46
|
+
}) });
|
|
47
|
+
}
|
|
48
|
+
var Incoming = ({ className = "" }) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className, fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M11.5 4.5l-7 7M4.5 5.5v6h6" }) });
|
|
49
|
+
function PaymentReceived() {
|
|
50
|
+
const [shown, setShown] = useState(0);
|
|
51
|
+
const [applied, setApplied] = useState(0);
|
|
52
|
+
const [hot, setHot] = useState(false);
|
|
53
|
+
const [fade, setFade] = useState(false);
|
|
54
|
+
const [instant, setInstant] = useState(false);
|
|
55
|
+
const [paused, setPaused] = useState(false);
|
|
56
|
+
const k = useRef(0);
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
if (paused) return;
|
|
59
|
+
const still = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
60
|
+
const t = [];
|
|
61
|
+
let alive = true;
|
|
62
|
+
const later = (ms, f) => t.push(setTimeout(() => alive && f(), ms));
|
|
63
|
+
const cycle = () => {
|
|
64
|
+
if (k.current >= INCOMING.length) {
|
|
65
|
+
setFade(true);
|
|
66
|
+
later(450, () => {
|
|
67
|
+
k.current = 0;
|
|
68
|
+
setInstant(true);
|
|
69
|
+
setShown(0);
|
|
70
|
+
setApplied(0);
|
|
71
|
+
setHot(false);
|
|
72
|
+
});
|
|
73
|
+
later(560, () => setInstant(false));
|
|
74
|
+
later(620, () => setFade(false));
|
|
75
|
+
later(1500, cycle);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const i = ++k.current;
|
|
79
|
+
setShown(i);
|
|
80
|
+
later(still ? 0 : 420, () => {
|
|
81
|
+
setApplied(i);
|
|
82
|
+
setHot(true);
|
|
83
|
+
});
|
|
84
|
+
later(2e3, () => setHot(false));
|
|
85
|
+
later(3e3, cycle);
|
|
86
|
+
};
|
|
87
|
+
later(900, cycle);
|
|
88
|
+
return () => {
|
|
89
|
+
alive = false;
|
|
90
|
+
t.forEach(clearTimeout);
|
|
91
|
+
setApplied(k.current);
|
|
92
|
+
setHot(false);
|
|
93
|
+
setFade(false);
|
|
94
|
+
};
|
|
95
|
+
}, [paused]);
|
|
96
|
+
const got = INCOMING.slice(0, applied);
|
|
97
|
+
const sum = got.reduce((a, b) => a + b.amount, 0);
|
|
98
|
+
const toasts = INCOMING.slice(Math.max(0, shown - 3), shown).reverse();
|
|
99
|
+
const rows = [...got].reverse().concat(OLD).slice(0, ROWS + 1);
|
|
100
|
+
const pts = SPARK.concat(got.map((g) => Math.min(560, g.amount)));
|
|
101
|
+
const W = 120;
|
|
102
|
+
const H = 44;
|
|
103
|
+
const step = W / (SPARK.length - 1);
|
|
104
|
+
const y = (v) => H - 5 - v / 560 * (H - 12);
|
|
105
|
+
const xy = (i) => `${(i * step).toFixed(2)} ${y(pts[i]).toFixed(2)}`;
|
|
106
|
+
const line = pts.slice(0, -1).map((_, i) => `${i ? "L" : "M"}${xy(i)}`).join(" ");
|
|
107
|
+
const tail = `M${xy(pts.length - 2)} L${xy(pts.length - 1)}`;
|
|
108
|
+
const area = `${pts.map((_, i) => `${i ? "L" : "M"}${xy(i)}`).join(" ")} L${((pts.length - 1) * step).toFixed(2)} ${H} L0 ${H} Z`;
|
|
109
|
+
const shift = (pts.length - SPARK.length) * step;
|
|
110
|
+
const last = pts.length - 1;
|
|
111
|
+
const toggle = () => setPaused((p) => !p);
|
|
112
|
+
return /* @__PURE__ */ jsxs(
|
|
113
|
+
"div",
|
|
114
|
+
{
|
|
115
|
+
role: "group",
|
|
116
|
+
tabIndex: 0,
|
|
117
|
+
"aria-label": `Merchant balance ${money(BASE + sum)}. ${paused ? "Paused" : "Live"}. Press space to ${paused ? "resume" : "pause"}`,
|
|
118
|
+
onPointerEnter: (e) => e.pointerType === "mouse" && setPaused(true),
|
|
119
|
+
onPointerLeave: (e) => e.pointerType === "mouse" && setPaused(false),
|
|
120
|
+
onPointerUp: (e) => e.pointerType !== "mouse" && toggle(),
|
|
121
|
+
onKeyDown: (e) => {
|
|
122
|
+
if (e.key === " " || e.key === "Enter") {
|
|
123
|
+
e.preventDefault();
|
|
124
|
+
toggle();
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
className: "flex h-full w-full items-center justify-center px-5 pb-5 pt-11 outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-brand/50",
|
|
128
|
+
style: { containerType: "size" },
|
|
129
|
+
children: [
|
|
130
|
+
/* @__PURE__ */ jsx("style", { href: "asta-paymentreceived", precedence: "asta", children: `
|
|
131
|
+
@keyframes lab-pr-drop { from { transform: translateY(-120%) scale(.96); opacity: 0 } to { transform: none; opacity: 1 } }
|
|
132
|
+
@keyframes lab-pr-in { from { opacity: 0; transform: translateY(-40%) } to { opacity: 1; transform: none } }
|
|
133
|
+
@keyframes lab-pr-draw { from { stroke-dashoffset: 1 } to { stroke-dashoffset: 0 } }
|
|
134
|
+
@keyframes lab-pr-fade { from { opacity: 0 } to { opacity: 1 } }
|
|
135
|
+
@keyframes lab-pr-dot { 0% { transform: scale(0) } 60% { transform: scale(1.4) } 100% { transform: scale(1) } }
|
|
136
|
+
@keyframes lab-pr-live { from { transform: scale(1); opacity: .6 } to { transform: scale(2.6); opacity: 0 } }
|
|
137
|
+
.lab-pr-drop { animation: lab-pr-drop .6s ${EASE} backwards }
|
|
138
|
+
.lab-pr-in { animation: lab-pr-in .55s ${EASE} backwards }
|
|
139
|
+
.lab-pr-draw { stroke-dasharray: 1; animation: lab-pr-draw .6s ${EASE} .15s both }
|
|
140
|
+
.lab-pr-fade { animation: lab-pr-fade .8s ${EASE} .2s both }
|
|
141
|
+
.lab-pr-dot { transform-box: fill-box; transform-origin: center; animation: lab-pr-dot .5s ${EASE} .55s both }
|
|
142
|
+
.lab-pr-live { animation: lab-pr-live 1.6s ${EASE} infinite }
|
|
143
|
+
@media (prefers-reduced-motion: reduce) { .lab-pr-drop, .lab-pr-in, .lab-pr-draw, .lab-pr-fade, .lab-pr-dot, .lab-pr-live { animation: none } }
|
|
144
|
+
` }),
|
|
145
|
+
/* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-[460px] flex-col gap-[max(10px,3.6cqh)]", style: { opacity: fade ? 0 : 1, transition: `opacity .45s ${EASE}` }, children: [
|
|
146
|
+
/* @__PURE__ */ jsxs("div", { className: "relative h-[clamp(42px,15cqh,50px)]", "aria-live": "polite", children: [
|
|
147
|
+
toasts.length === 0 && /* @__PURE__ */ jsx("div", { className: `flex h-full items-center justify-center rounded-[11px] text-[12px] text-mute ${RING}`, children: "Waiting for payments\u2026" }),
|
|
148
|
+
toasts.map((tx, d) => /* @__PURE__ */ jsx(
|
|
149
|
+
"div",
|
|
150
|
+
{
|
|
151
|
+
className: "absolute inset-0 origin-bottom",
|
|
152
|
+
style: {
|
|
153
|
+
zIndex: 3 - d,
|
|
154
|
+
opacity: d === 0 ? 1 : d === 1 ? 0.55 : 0,
|
|
155
|
+
transform: d === 0 ? "none" : `translateY(${d * 7}px) scale(${1 - d * 0.05})`,
|
|
156
|
+
transition: instant ? "none" : `transform .6s ${EASE}, opacity .6s ${EASE}`
|
|
157
|
+
},
|
|
158
|
+
children: /* @__PURE__ */ jsxs("div", { className: "lab-pr-drop flex h-full items-center gap-2.5 rounded-[11px] bg-paper px-3 shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_10%,transparent),0_10px_24px_-14px_rgb(0_0_0/0.7)]", children: [
|
|
159
|
+
/* @__PURE__ */ jsx("span", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-brand text-paper", children: /* @__PURE__ */ jsx(Incoming, { className: "h-3.5 w-3.5" }) }),
|
|
160
|
+
/* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1 leading-tight", children: [
|
|
161
|
+
/* @__PURE__ */ jsx("span", { className: "block text-[12.5px] font-medium text-ink", children: "Payment received" }),
|
|
162
|
+
/* @__PURE__ */ jsxs("span", { className: "block truncate text-[11.5px] text-mute", children: [
|
|
163
|
+
"from ",
|
|
164
|
+
tx.name
|
|
165
|
+
] })
|
|
166
|
+
] }),
|
|
167
|
+
/* @__PURE__ */ jsxs("span", { className: "shrink-0 text-[13px] font-medium tabular-nums text-brand", children: [
|
|
168
|
+
"+",
|
|
169
|
+
money(tx.amount)
|
|
170
|
+
] })
|
|
171
|
+
] })
|
|
172
|
+
},
|
|
173
|
+
tx.id
|
|
174
|
+
))
|
|
175
|
+
] }),
|
|
176
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-end justify-between gap-4", children: [
|
|
177
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
178
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 font-mono text-[10.5px] uppercase tracking-wider text-mute", children: [
|
|
179
|
+
"Available balance",
|
|
180
|
+
/* @__PURE__ */ jsxs("span", { className: "relative inline-flex h-1.5 w-1.5", children: [
|
|
181
|
+
!paused && /* @__PURE__ */ jsx("span", { className: "lab-pr-live absolute inset-0 rounded-full bg-brand" }),
|
|
182
|
+
/* @__PURE__ */ jsx("span", { className: `relative h-1.5 w-1.5 rounded-full transition-opacity duration-300 ${paused ? "bg-mute" : "bg-brand"}` })
|
|
183
|
+
] }),
|
|
184
|
+
/* @__PURE__ */ jsx("span", { className: "normal-case tracking-normal", children: paused ? "Paused" : "Live" })
|
|
185
|
+
] }),
|
|
186
|
+
/* @__PURE__ */ jsx("div", { className: "mt-1.5 font-medium tracking-[-0.035em] text-ink", style: { fontSize: "clamp(24px, 9.5cqmin, 38px)", lineHeight: 1 }, children: /* @__PURE__ */ jsx(Roll, { value: money(BASE + sum), instant }) })
|
|
187
|
+
] }),
|
|
188
|
+
/* @__PURE__ */ jsxs("svg", { viewBox: `0 0 ${W} ${H}`, className: "w-[34%] max-w-[150px] shrink-0 overflow-hidden", fill: "none", "aria-hidden": true, children: [
|
|
189
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: "lab-pr-area", x1: "0", x2: "0", y1: "0", y2: "1", children: [
|
|
190
|
+
/* @__PURE__ */ jsx("stop", { offset: "0", stopColor: "var(--brand)", stopOpacity: "0.22" }),
|
|
191
|
+
/* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "var(--brand)", stopOpacity: "0" })
|
|
192
|
+
] }) }),
|
|
193
|
+
/* @__PURE__ */ jsxs("g", { style: { transform: `translateX(${-shift}px)`, transition: instant ? "none" : `transform .8s ${EASE}` }, children: [
|
|
194
|
+
/* @__PURE__ */ jsx("path", { d: area, fill: "url(#lab-pr-area)", className: applied ? "lab-pr-fade" : "" }, `a${last}`),
|
|
195
|
+
/* @__PURE__ */ jsx("path", { d: line, stroke: "var(--brand)", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
196
|
+
/* @__PURE__ */ jsx("path", { d: tail, pathLength: 1, stroke: "var(--brand)", strokeWidth: "1.6", strokeLinecap: "round", className: applied ? "lab-pr-draw" : "" }, `t${last}`),
|
|
197
|
+
/* @__PURE__ */ jsx("circle", { cx: last * step, cy: y(pts[last]), r: "2.6", fill: "var(--brand)", className: applied ? "lab-pr-dot" : "" }, `d${last}`)
|
|
198
|
+
] })
|
|
199
|
+
] })
|
|
200
|
+
] }),
|
|
201
|
+
/* @__PURE__ */ jsx("div", { "aria-label": "Recent payments", children: /* @__PURE__ */ jsx("div", { className: "relative", style: { height: `calc(${ROWS} * clamp(28px, 9.5cqh, 38px))` }, children: rows.map((tx, i) => /* @__PURE__ */ jsxs(
|
|
202
|
+
"div",
|
|
203
|
+
{
|
|
204
|
+
className: `absolute inset-x-0 top-0 flex h-[clamp(28px,9.5cqh,38px)] items-center gap-2.5 px-2`,
|
|
205
|
+
style: {
|
|
206
|
+
transform: `translateY(${i * 100}%)`,
|
|
207
|
+
opacity: i < ROWS ? 1 : 0,
|
|
208
|
+
transition: instant ? "none" : `transform .7s ${EASE}, opacity .5s ${EASE}`
|
|
209
|
+
},
|
|
210
|
+
children: [
|
|
211
|
+
/* @__PURE__ */ jsx(
|
|
212
|
+
"span",
|
|
213
|
+
{
|
|
214
|
+
"aria-hidden": true,
|
|
215
|
+
className: "absolute inset-0 rounded-[8px] bg-brand/12",
|
|
216
|
+
style: { opacity: hot && i === 0 && tx.id > 0 ? 1 : 0, transition: `opacity ${hot ? ".3s" : "1.2s"} ${EASE}` }
|
|
217
|
+
}
|
|
218
|
+
),
|
|
219
|
+
/* @__PURE__ */ jsxs("span", { className: `relative flex w-full items-center gap-2.5 ${tx.id > 0 && i === 0 && !instant ? "lab-pr-in" : ""}`, children: [
|
|
220
|
+
/* @__PURE__ */ jsx("span", { className: `flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-paper text-[9.5px] font-semibold text-ink-2 ${RING}`, children: initials(tx.name) }),
|
|
221
|
+
/* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1 truncate text-[12.5px] text-ink", children: [
|
|
222
|
+
tx.name,
|
|
223
|
+
" ",
|
|
224
|
+
/* @__PURE__ */ jsxs("span", { className: "text-mute", children: [
|
|
225
|
+
"\xB7 ",
|
|
226
|
+
tx.via
|
|
227
|
+
] })
|
|
228
|
+
] }),
|
|
229
|
+
/* @__PURE__ */ jsxs("span", { className: "shrink-0 text-[12.5px] tabular-nums text-ink-2", children: [
|
|
230
|
+
"+",
|
|
231
|
+
money(tx.amount)
|
|
232
|
+
] })
|
|
233
|
+
] })
|
|
234
|
+
]
|
|
235
|
+
},
|
|
236
|
+
tx.id
|
|
237
|
+
)) }) })
|
|
238
|
+
] })
|
|
239
|
+
]
|
|
240
|
+
}
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export {
|
|
245
|
+
PaymentReceived
|
|
246
|
+
};
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Button
|
|
4
|
+
} from "./chunk-ZWBJUJTR.js";
|
|
5
|
+
|
|
6
|
+
// components/kit/onboarding.tsx
|
|
7
|
+
import { useId, useRef, useState } from "react";
|
|
8
|
+
import { Fragment, 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
|
+
var CURVE = "cubic-bezier(.16,1,.3,1)";
|
|
12
|
+
var Check = ({ className = "" }) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className, fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M4 8.5l2.5 2.5 5.5-6" }) });
|
|
13
|
+
function Mark({ done, current }) {
|
|
14
|
+
return /* @__PURE__ */ jsxs("span", { className: "relative flex h-5 w-5 shrink-0 items-center justify-center", "aria-hidden": true, children: [
|
|
15
|
+
/* @__PURE__ */ jsx(
|
|
16
|
+
"span",
|
|
17
|
+
{
|
|
18
|
+
className: cx(
|
|
19
|
+
"absolute inset-0 rounded-full transition-[opacity,transform] duration-300",
|
|
20
|
+
EASE,
|
|
21
|
+
done ? "scale-75 opacity-0" : "scale-100 opacity-100",
|
|
22
|
+
current ? "shadow-[inset_0_0_0_1.5px_var(--ink)]" : "shadow-[inset_0_0_0_1.5px_color-mix(in_srgb,var(--ink)_22%,transparent)]"
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
/* @__PURE__ */ jsx(
|
|
27
|
+
"span",
|
|
28
|
+
{
|
|
29
|
+
className: cx(
|
|
30
|
+
"absolute inset-0 flex items-center justify-center rounded-full bg-brand text-white transition-[opacity,transform] duration-500",
|
|
31
|
+
EASE,
|
|
32
|
+
done ? "scale-100 opacity-100" : "scale-50 opacity-0"
|
|
33
|
+
),
|
|
34
|
+
children: /* @__PURE__ */ jsx(Check, { className: "h-3 w-3" })
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
] });
|
|
38
|
+
}
|
|
39
|
+
function Onboarding({ title = "Get set up", subtitle, steps, defaultCompleted = [], onStep, onFinish, finishLabel = "Go to dashboard", className }) {
|
|
40
|
+
const [done, setDone] = useState(defaultCompleted);
|
|
41
|
+
const doneRef = useRef(done);
|
|
42
|
+
const firstOpen = steps.find((s) => !defaultCompleted.includes(s.id))?.id ?? null;
|
|
43
|
+
const [open, setOpen] = useState(firstOpen);
|
|
44
|
+
const [busy, setBusy] = useState(null);
|
|
45
|
+
const [review, setReview] = useState(false);
|
|
46
|
+
const uid = useId();
|
|
47
|
+
const total = steps.length;
|
|
48
|
+
const count = steps.filter((s) => done.includes(s.id)).length;
|
|
49
|
+
const finished = count === total && !review;
|
|
50
|
+
const complete = async (id) => {
|
|
51
|
+
try {
|
|
52
|
+
const r = onStep?.(id);
|
|
53
|
+
if (r instanceof Promise) {
|
|
54
|
+
setBusy(id);
|
|
55
|
+
await r;
|
|
56
|
+
}
|
|
57
|
+
} catch (err) {
|
|
58
|
+
console.error(err);
|
|
59
|
+
return;
|
|
60
|
+
} finally {
|
|
61
|
+
setBusy((b) => b === id ? null : b);
|
|
62
|
+
}
|
|
63
|
+
const next = doneRef.current.includes(id) ? doneRef.current : [...doneRef.current, id];
|
|
64
|
+
doneRef.current = next;
|
|
65
|
+
setDone((d) => d.includes(id) ? d : [...d, id]);
|
|
66
|
+
const i = steps.findIndex((s) => s.id === id);
|
|
67
|
+
const after = [...steps.slice(i + 1), ...steps.slice(0, i)].find((s) => !next.includes(s.id));
|
|
68
|
+
setOpen(after?.id ?? null);
|
|
69
|
+
};
|
|
70
|
+
return /* @__PURE__ */ jsxs(
|
|
71
|
+
"div",
|
|
72
|
+
{
|
|
73
|
+
className: cx(
|
|
74
|
+
"kit-ob relative w-full max-w-[440px] overflow-hidden rounded-[14px] 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)]",
|
|
75
|
+
className
|
|
76
|
+
),
|
|
77
|
+
children: [
|
|
78
|
+
/* @__PURE__ */ jsx("style", { href: "asta-onboarding", precedence: "asta", children: `
|
|
79
|
+
@keyframes kit-ob-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
|
|
80
|
+
@keyframes kit-ob-pop { 0% { opacity: 0; transform: scale(.6); } 60% { opacity: 1; transform: scale(1.06); } 100% { transform: none; } }
|
|
81
|
+
@media (prefers-reduced-motion: reduce) { .kit-ob, .kit-ob * { animation: none !important; transition-duration: 0s !important; } }
|
|
82
|
+
` }),
|
|
83
|
+
finished ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center px-8 py-12 text-center", style: { animation: `kit-ob-in .5s ${CURVE} both` }, children: [
|
|
84
|
+
/* @__PURE__ */ jsx("span", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-brand text-white", style: { animation: `kit-ob-pop .6s ${CURVE} .1s both` }, children: /* @__PURE__ */ jsx(Check, { className: "h-6 w-6" }) }),
|
|
85
|
+
/* @__PURE__ */ jsx("h3", { className: "mt-5 text-[18px] font-medium tracking-[-0.02em] text-ink", children: "You are all set" }),
|
|
86
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1.5 max-w-[30ch] text-[13.5px] leading-relaxed text-mute", children: "Every step is done. You can come back to this list from Settings." }),
|
|
87
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-6 flex gap-2", children: [
|
|
88
|
+
/* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: () => setReview(true), children: "Review steps" }),
|
|
89
|
+
onFinish && /* @__PURE__ */ jsx(Button, { size: "sm", onClick: onFinish, children: finishLabel })
|
|
90
|
+
] })
|
|
91
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
92
|
+
/* @__PURE__ */ jsxs("div", { className: "px-5 pb-4 pt-5", children: [
|
|
93
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-baseline justify-between gap-4", children: [
|
|
94
|
+
/* @__PURE__ */ jsx("h3", { className: "text-[15px] font-medium tracking-[-0.01em] text-ink", children: title }),
|
|
95
|
+
/* @__PURE__ */ jsxs("span", { className: "text-[12.5px] tabular-nums text-mute", children: [
|
|
96
|
+
count,
|
|
97
|
+
" of ",
|
|
98
|
+
total
|
|
99
|
+
] })
|
|
100
|
+
] }),
|
|
101
|
+
subtitle && /* @__PURE__ */ jsx("p", { className: "mt-1 text-[13px] text-mute", children: subtitle }),
|
|
102
|
+
/* @__PURE__ */ jsx(
|
|
103
|
+
"div",
|
|
104
|
+
{
|
|
105
|
+
role: "progressbar",
|
|
106
|
+
"aria-label": "Setup progress",
|
|
107
|
+
"aria-valuemin": 0,
|
|
108
|
+
"aria-valuemax": total,
|
|
109
|
+
"aria-valuenow": count,
|
|
110
|
+
className: "mt-4 h-1 overflow-hidden rounded-full bg-[color-mix(in_srgb,var(--ink)_8%,transparent)]",
|
|
111
|
+
children: /* @__PURE__ */ jsx("div", { className: cx("h-full origin-left rounded-full bg-brand transition-transform duration-700", EASE), style: { transform: `scaleX(${count / total})` } })
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
] }),
|
|
115
|
+
/* @__PURE__ */ jsx("ol", { className: "px-2 pb-2", children: steps.map((s) => {
|
|
116
|
+
const isDone = done.includes(s.id);
|
|
117
|
+
const isOpen = open === s.id;
|
|
118
|
+
const panel = `${uid}-${s.id}`;
|
|
119
|
+
return /* @__PURE__ */ jsxs("li", { className: cx("rounded-[10px] transition-colors duration-300", isOpen && "bg-paper-2"), children: [
|
|
120
|
+
/* @__PURE__ */ jsxs(
|
|
121
|
+
"button",
|
|
122
|
+
{
|
|
123
|
+
type: "button",
|
|
124
|
+
"aria-expanded": isOpen,
|
|
125
|
+
"aria-controls": panel,
|
|
126
|
+
onClick: () => setOpen(isOpen ? null : s.id),
|
|
127
|
+
className: "flex w-full items-center gap-3 rounded-[10px] px-3 py-3 text-left outline-none focus-visible:ring-2 focus-visible:ring-brand/50",
|
|
128
|
+
children: [
|
|
129
|
+
/* @__PURE__ */ jsx(Mark, { done: isDone, current: isOpen }),
|
|
130
|
+
/* @__PURE__ */ jsxs("span", { className: cx("flex-1 text-[14px] transition-colors duration-300", isDone && !isOpen ? "text-mute" : "text-ink"), children: [
|
|
131
|
+
s.title,
|
|
132
|
+
isDone && /* @__PURE__ */ jsx("span", { className: "sr-only", children: " (done)" })
|
|
133
|
+
] }),
|
|
134
|
+
s.duration && !isDone && /* @__PURE__ */ jsx("span", { className: "text-[12px] tabular-nums text-mute", children: s.duration }),
|
|
135
|
+
/* @__PURE__ */ jsx(
|
|
136
|
+
"svg",
|
|
137
|
+
{
|
|
138
|
+
viewBox: "0 0 16 16",
|
|
139
|
+
className: cx("h-3.5 w-3.5 shrink-0 text-mute transition-transform duration-300", EASE, isOpen && "rotate-180"),
|
|
140
|
+
fill: "none",
|
|
141
|
+
stroke: "currentColor",
|
|
142
|
+
strokeWidth: "1.7",
|
|
143
|
+
strokeLinecap: "round",
|
|
144
|
+
"aria-hidden": true,
|
|
145
|
+
children: /* @__PURE__ */ jsx("path", { d: "m4.5 6.5 3.5 3.5 3.5-3.5" })
|
|
146
|
+
}
|
|
147
|
+
)
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
),
|
|
151
|
+
/* @__PURE__ */ jsx("div", { id: panel, role: "region", "aria-label": s.title, className: cx("grid transition-[grid-template-rows] duration-500", EASE, isOpen ? "grid-rows-[1fr]" : "grid-rows-[0fr]"), children: /* @__PURE__ */ jsx("div", { className: "overflow-hidden", inert: !isOpen, children: /* @__PURE__ */ jsxs("div", { className: cx("pb-4 pl-11 pr-4 transition-[opacity,transform] duration-500", EASE, isOpen ? "translate-y-0 opacity-100" : "-translate-y-1 opacity-0"), children: [
|
|
152
|
+
/* @__PURE__ */ jsx("div", { className: "text-[13px] leading-relaxed text-mute", children: s.description }),
|
|
153
|
+
/* @__PURE__ */ jsx("div", { className: "mt-3.5 flex items-center gap-2", children: isDone ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5 text-[12.5px] text-mute", children: [
|
|
154
|
+
/* @__PURE__ */ jsx(Check, { className: "h-3.5 w-3.5 text-brand" }),
|
|
155
|
+
"Done"
|
|
156
|
+
] }) : /* @__PURE__ */ jsx(Button, { size: "sm", loading: busy === s.id, onClick: () => complete(s.id), children: s.action ?? "Mark as done" }) })
|
|
157
|
+
] }) }) })
|
|
158
|
+
] }, s.id);
|
|
159
|
+
}) })
|
|
160
|
+
] })
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
var onboarding_default = Onboarding;
|
|
166
|
+
|
|
167
|
+
export {
|
|
168
|
+
Onboarding,
|
|
169
|
+
onboarding_default
|
|
170
|
+
};
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// components/kit/drawer.tsx
|
|
4
|
+
import { useEffect, useId, useLayoutEffect, useRef, useState } from "react";
|
|
5
|
+
import { createPortal } from "react-dom";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
var cx = (...c) => c.filter(Boolean).join(" ");
|
|
8
|
+
var EASE = "cubic-bezier(.16,1,.3,1)";
|
|
9
|
+
var FOCUSABLE = 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';
|
|
10
|
+
var still = () => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
11
|
+
var offscreen = (side) => side === "right" ? "translateX(calc(100% + 16px))" : side === "left" ? "translateX(calc(-100% - 16px))" : "translateY(calc(100% + 16px))";
|
|
12
|
+
function Drawer({ open, onOpenChange, side = "right", title, description, children, footer, contained = false, draggable = true, className }) {
|
|
13
|
+
const [mounted, setMounted] = useState(open);
|
|
14
|
+
if (open && !mounted) setMounted(true);
|
|
15
|
+
const uid = useId();
|
|
16
|
+
const panel = useRef(null);
|
|
17
|
+
const overlay = useRef(null);
|
|
18
|
+
const opener = useRef(null);
|
|
19
|
+
const drag = useRef(null);
|
|
20
|
+
useLayoutEffect(() => {
|
|
21
|
+
const p = panel.current;
|
|
22
|
+
if (!open || !p) return;
|
|
23
|
+
if (!p.contains(document.activeElement)) opener.current = document.activeElement;
|
|
24
|
+
const first = p.querySelector("[data-autofocus]") ?? p.querySelector(`[data-body] ${FOCUSABLE}`) ?? p;
|
|
25
|
+
first.focus({ preventScroll: true });
|
|
26
|
+
for (const el of [p, overlay.current]) {
|
|
27
|
+
el?.getAnimations().forEach((a) => a.cancel());
|
|
28
|
+
el?.style.removeProperty(el === p ? "transform" : "opacity");
|
|
29
|
+
}
|
|
30
|
+
if (still()) return;
|
|
31
|
+
p.animate([{ transform: offscreen(side) }, { transform: "none" }], { duration: 560, easing: EASE });
|
|
32
|
+
overlay.current?.animate([{ opacity: 0 }, { opacity: 1 }], { duration: 360, easing: EASE });
|
|
33
|
+
}, [open, side]);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (open || !mounted) return;
|
|
36
|
+
const p = panel.current;
|
|
37
|
+
if (!p) return;
|
|
38
|
+
const from = getComputedStyle(p).transform;
|
|
39
|
+
const ms = still() ? 0 : 340;
|
|
40
|
+
overlay.current?.animate([{ opacity: getComputedStyle(overlay.current).opacity }, { opacity: 0 }], { duration: ms, easing: EASE, fill: "forwards" });
|
|
41
|
+
const a = p.animate([{ transform: from === "none" ? "none" : from }, { transform: offscreen(side) }], { duration: ms, easing: EASE, fill: "forwards" });
|
|
42
|
+
a.onfinish = () => {
|
|
43
|
+
setMounted(false);
|
|
44
|
+
opener.current?.focus({ preventScroll: true });
|
|
45
|
+
opener.current = null;
|
|
46
|
+
};
|
|
47
|
+
return () => {
|
|
48
|
+
a.onfinish = null;
|
|
49
|
+
};
|
|
50
|
+
}, [open, mounted, side]);
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
if (!mounted || contained) return;
|
|
53
|
+
const prev = document.body.style.overflow;
|
|
54
|
+
document.body.style.overflow = "hidden";
|
|
55
|
+
return () => {
|
|
56
|
+
document.body.style.overflow = prev;
|
|
57
|
+
};
|
|
58
|
+
}, [mounted, contained]);
|
|
59
|
+
const onKey = (e) => {
|
|
60
|
+
if (e.key === "Escape") {
|
|
61
|
+
e.stopPropagation();
|
|
62
|
+
onOpenChange(false);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (e.key !== "Tab" || !panel.current) return;
|
|
66
|
+
const items = [...panel.current.querySelectorAll(FOCUSABLE)].filter((el) => el.offsetParent !== null || el === document.activeElement);
|
|
67
|
+
if (!items.length) return e.preventDefault();
|
|
68
|
+
const first = items[0];
|
|
69
|
+
const last = items[items.length - 1];
|
|
70
|
+
if (e.shiftKey && (document.activeElement === first || document.activeElement === panel.current)) {
|
|
71
|
+
e.preventDefault();
|
|
72
|
+
last.focus();
|
|
73
|
+
} else if (!e.shiftKey && document.activeElement === last) {
|
|
74
|
+
e.preventDefault();
|
|
75
|
+
first.focus();
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
const canDrag = side === "bottom" && draggable;
|
|
79
|
+
const onDragStart = (e) => {
|
|
80
|
+
if (!canDrag || e.button !== 0 || !open) return;
|
|
81
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
82
|
+
drag.current = { y: e.clientY, t: e.timeStamp, dy: 0, v: 0 };
|
|
83
|
+
panel.current?.getAnimations().forEach((a) => a.cancel());
|
|
84
|
+
};
|
|
85
|
+
const onDragMove = (e) => {
|
|
86
|
+
const d = drag.current;
|
|
87
|
+
const p = panel.current;
|
|
88
|
+
if (!d || !p) return;
|
|
89
|
+
const raw = e.clientY - d.y;
|
|
90
|
+
const dy = raw < 0 ? -Math.sqrt(-raw) * 2 : raw;
|
|
91
|
+
d.v = (dy - d.dy) / Math.max(1, e.timeStamp - d.t);
|
|
92
|
+
d.t = e.timeStamp;
|
|
93
|
+
d.dy = dy;
|
|
94
|
+
p.style.transform = `translateY(${dy}px)`;
|
|
95
|
+
if (overlay.current) overlay.current.style.opacity = String(Math.max(0, 1 - Math.max(0, dy) / p.offsetHeight));
|
|
96
|
+
};
|
|
97
|
+
const onDragEnd = () => {
|
|
98
|
+
const d = drag.current;
|
|
99
|
+
const p = panel.current;
|
|
100
|
+
drag.current = null;
|
|
101
|
+
if (!d || !p) return;
|
|
102
|
+
if (d.dy > p.offsetHeight * 0.3 || d.v > 0.6) return onOpenChange(false);
|
|
103
|
+
const from = p.style.transform;
|
|
104
|
+
p.style.transform = "";
|
|
105
|
+
if (overlay.current) overlay.current.style.opacity = "";
|
|
106
|
+
if (!still()) p.animate([{ transform: from || "none" }, { transform: "none" }], { duration: 420, easing: EASE });
|
|
107
|
+
};
|
|
108
|
+
if (!mounted || typeof document === "undefined") return null;
|
|
109
|
+
const bottom = side === "bottom";
|
|
110
|
+
const layer = /* @__PURE__ */ jsxs("div", { className: cx(contained ? "absolute" : "fixed", "inset-0 z-50 overflow-hidden", contained && "rounded-[inherit]"), children: [
|
|
111
|
+
/* @__PURE__ */ jsx("div", { ref: overlay, "aria-hidden": true, onClick: () => onOpenChange(false), className: "absolute inset-0 bg-[color-mix(in_srgb,var(--ink)_28%,transparent)] will-change-[opacity]" }),
|
|
112
|
+
/* @__PURE__ */ jsxs(
|
|
113
|
+
"div",
|
|
114
|
+
{
|
|
115
|
+
ref: panel,
|
|
116
|
+
role: "dialog",
|
|
117
|
+
"aria-modal": "true",
|
|
118
|
+
"aria-labelledby": `${uid}-title`,
|
|
119
|
+
"aria-describedby": description ? `${uid}-desc` : void 0,
|
|
120
|
+
tabIndex: -1,
|
|
121
|
+
onKeyDown: onKey,
|
|
122
|
+
className: cx(
|
|
123
|
+
"absolute flex flex-col overflow-hidden rounded-[14px] bg-paper outline-none will-change-transform",
|
|
124
|
+
"shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_8%,transparent),0_24px_64px_-24px_color-mix(in_srgb,var(--ink)_45%,transparent)]",
|
|
125
|
+
side === "right" && "inset-y-2 right-2 w-[min(400px,calc(100%-48px))]",
|
|
126
|
+
side === "left" && "inset-y-2 left-2 w-[min(400px,calc(100%-48px))]",
|
|
127
|
+
bottom && "inset-x-2 bottom-2 mx-auto max-h-[calc(100%-56px)] max-w-[520px]",
|
|
128
|
+
className
|
|
129
|
+
),
|
|
130
|
+
children: [
|
|
131
|
+
bottom && /* @__PURE__ */ jsx(
|
|
132
|
+
"div",
|
|
133
|
+
{
|
|
134
|
+
onPointerDown: onDragStart,
|
|
135
|
+
onPointerMove: onDragMove,
|
|
136
|
+
onPointerUp: onDragEnd,
|
|
137
|
+
onPointerCancel: onDragEnd,
|
|
138
|
+
"aria-hidden": true,
|
|
139
|
+
className: cx("flex shrink-0 justify-center pb-1 pt-2.5 [touch-action:none]", canDrag && "cursor-grab active:cursor-grabbing"),
|
|
140
|
+
children: /* @__PURE__ */ jsx("span", { className: "h-1 w-9 rounded-full bg-[color-mix(in_srgb,var(--ink)_16%,transparent)]" })
|
|
141
|
+
}
|
|
142
|
+
),
|
|
143
|
+
/* @__PURE__ */ jsxs("div", { className: cx("flex shrink-0 items-start justify-between gap-4 px-5", bottom ? "pt-2" : "pt-5"), children: [
|
|
144
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
145
|
+
/* @__PURE__ */ jsx("h2", { id: `${uid}-title`, className: "text-[16px] font-medium tracking-[-0.02em] text-ink", children: title }),
|
|
146
|
+
description && /* @__PURE__ */ jsx("p", { id: `${uid}-desc`, className: "mt-1 text-[13.5px] leading-relaxed text-mute", children: description })
|
|
147
|
+
] }),
|
|
148
|
+
/* @__PURE__ */ jsx(
|
|
149
|
+
"button",
|
|
150
|
+
{
|
|
151
|
+
type: "button",
|
|
152
|
+
"aria-label": "Close",
|
|
153
|
+
onClick: () => onOpenChange(false),
|
|
154
|
+
className: "-mr-1.5 -mt-1 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-mute outline-none transition-colors duration-200 hover:bg-paper-2 hover:text-ink focus-visible:ring-2 focus-visible:ring-brand/50",
|
|
155
|
+
children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "h-3.5 w-3.5", fill: "none", stroke: "currentColor", strokeWidth: "1.7", strokeLinecap: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "m4 4 8 8M12 4l-8 8" }) })
|
|
156
|
+
}
|
|
157
|
+
)
|
|
158
|
+
] }),
|
|
159
|
+
/* @__PURE__ */ jsx("div", { "data-body": true, className: "min-h-0 flex-1 overflow-y-auto overscroll-contain px-5 pb-5 pt-4", children }),
|
|
160
|
+
footer && /* @__PURE__ */ jsx("div", { className: "flex shrink-0 flex-col-reverse gap-2 px-5 pb-5 sm:flex-row sm:justify-end", children: footer })
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
)
|
|
164
|
+
] });
|
|
165
|
+
return contained ? layer : createPortal(layer, document.body);
|
|
166
|
+
}
|
|
167
|
+
var drawer_default = Drawer;
|
|
168
|
+
|
|
169
|
+
export {
|
|
170
|
+
Drawer,
|
|
171
|
+
drawer_default
|
|
172
|
+
};
|