asta-ui 0.2.0 → 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,114 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// components/kit/progress.tsx
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
var cx = (...c) => c.filter(Boolean).join(" ");
|
|
6
|
+
var KEYFRAMES = `@keyframes asta-progress-sweep { from { transform: translateX(-100%) } to { transform: translateX(260%) } }
|
|
7
|
+
@keyframes asta-progress-spin { to { transform: rotate(360deg) } }
|
|
8
|
+
@keyframes asta-progress-breathe { 50% { opacity: .45 } }`;
|
|
9
|
+
var EASE = "cubic-bezier(.16,1,.3,1)";
|
|
10
|
+
function clamp(value, max) {
|
|
11
|
+
if (value === void 0 || Number.isNaN(value)) return void 0;
|
|
12
|
+
return Math.max(0, Math.min(max, value));
|
|
13
|
+
}
|
|
14
|
+
function ProgressBar({ value, max = 100, label = "Progress", showValue, valueText, size = "md", hideLabel, className }) {
|
|
15
|
+
const v = clamp(value, max);
|
|
16
|
+
const pct = v === void 0 ? void 0 : v / max * 100;
|
|
17
|
+
const text = valueText ?? (pct === void 0 ? void 0 : `${Math.round(pct)}%`);
|
|
18
|
+
return /* @__PURE__ */ jsxs("div", { className: cx("w-full", className), children: [
|
|
19
|
+
/* @__PURE__ */ jsx("style", { href: "asta-progress", precedence: "asta", children: KEYFRAMES }),
|
|
20
|
+
(!hideLabel || showValue) && /* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-baseline justify-between gap-4 text-[13px]", children: [
|
|
21
|
+
/* @__PURE__ */ jsx("span", { className: cx("text-ink-2", hideLabel && "sr-only"), children: label }),
|
|
22
|
+
showValue && text && /* @__PURE__ */ jsx("span", { className: "tabular-nums text-mute", children: text })
|
|
23
|
+
] }),
|
|
24
|
+
/* @__PURE__ */ jsx(
|
|
25
|
+
"div",
|
|
26
|
+
{
|
|
27
|
+
role: "progressbar",
|
|
28
|
+
"aria-label": label,
|
|
29
|
+
"aria-valuemin": 0,
|
|
30
|
+
"aria-valuemax": max,
|
|
31
|
+
"aria-valuenow": v,
|
|
32
|
+
"aria-valuetext": v === void 0 ? "Loading" : text,
|
|
33
|
+
"aria-busy": v === void 0 || void 0,
|
|
34
|
+
className: cx("relative w-full overflow-hidden rounded-full bg-[color-mix(in_srgb,var(--ink)_9%,transparent)]", size === "md" ? "h-1.5" : "h-1"),
|
|
35
|
+
children: pct === void 0 ? /* @__PURE__ */ jsx(
|
|
36
|
+
"span",
|
|
37
|
+
{
|
|
38
|
+
className: "absolute inset-y-0 left-0 w-[38%] rounded-full bg-brand motion-reduce:!w-full motion-reduce:![animation:asta-progress-breathe_1.8s_ease-in-out_infinite]",
|
|
39
|
+
style: { animation: `asta-progress-sweep 1.5s ${EASE} infinite` }
|
|
40
|
+
}
|
|
41
|
+
) : /* @__PURE__ */ jsx(
|
|
42
|
+
"span",
|
|
43
|
+
{
|
|
44
|
+
className: "absolute inset-0 rounded-full bg-brand transition-transform duration-700 motion-reduce:transition-none",
|
|
45
|
+
style: { transform: `translateX(${pct - 100}%)`, transitionTimingFunction: EASE }
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
] });
|
|
51
|
+
}
|
|
52
|
+
function ProgressRing({ value, max = 100, label = "Progress", showValue, valueText, size = 44, thickness = 3.5, children, className }) {
|
|
53
|
+
const v = clamp(value, max);
|
|
54
|
+
const pct = v === void 0 ? void 0 : v / max * 100;
|
|
55
|
+
const text = valueText ?? (pct === void 0 ? void 0 : `${Math.round(pct)}%`);
|
|
56
|
+
const r = (size - thickness) / 2;
|
|
57
|
+
const c = size / 2;
|
|
58
|
+
const inner = children ?? (showValue && text ? /* @__PURE__ */ jsx("span", { className: "tabular-nums", children: text }) : null);
|
|
59
|
+
return /* @__PURE__ */ jsxs(
|
|
60
|
+
"span",
|
|
61
|
+
{
|
|
62
|
+
role: "progressbar",
|
|
63
|
+
"aria-label": label,
|
|
64
|
+
"aria-valuemin": 0,
|
|
65
|
+
"aria-valuemax": max,
|
|
66
|
+
"aria-valuenow": v,
|
|
67
|
+
"aria-valuetext": v === void 0 ? "Loading" : text,
|
|
68
|
+
"aria-busy": v === void 0 || void 0,
|
|
69
|
+
className: cx("relative inline-flex shrink-0 items-center justify-center", className),
|
|
70
|
+
style: { width: size, height: size },
|
|
71
|
+
children: [
|
|
72
|
+
/* @__PURE__ */ jsx("style", { href: "asta-progress", precedence: "asta", children: KEYFRAMES }),
|
|
73
|
+
/* @__PURE__ */ jsxs(
|
|
74
|
+
"svg",
|
|
75
|
+
{
|
|
76
|
+
viewBox: `0 0 ${size} ${size}`,
|
|
77
|
+
width: size,
|
|
78
|
+
height: size,
|
|
79
|
+
"aria-hidden": true,
|
|
80
|
+
className: cx("absolute inset-0", pct === void 0 && "motion-reduce:![animation:asta-progress-breathe_1.8s_ease-in-out_infinite]"),
|
|
81
|
+
style: pct === void 0 ? { animation: "asta-progress-spin 1s linear infinite" } : { transform: "rotate(-90deg)" },
|
|
82
|
+
children: [
|
|
83
|
+
/* @__PURE__ */ jsx("circle", { cx: c, cy: c, r, fill: "none", strokeWidth: thickness, style: { stroke: "color-mix(in srgb, var(--ink) 9%, transparent)" } }),
|
|
84
|
+
/* @__PURE__ */ jsx(
|
|
85
|
+
"circle",
|
|
86
|
+
{
|
|
87
|
+
cx: c,
|
|
88
|
+
cy: c,
|
|
89
|
+
r,
|
|
90
|
+
fill: "none",
|
|
91
|
+
strokeWidth: thickness,
|
|
92
|
+
strokeLinecap: "round",
|
|
93
|
+
pathLength: 100,
|
|
94
|
+
strokeDasharray: "100 100",
|
|
95
|
+
strokeDashoffset: pct === void 0 ? 75 : 100 - pct,
|
|
96
|
+
className: "stroke-brand transition-[stroke-dashoffset] duration-700 motion-reduce:transition-none",
|
|
97
|
+
style: { transitionTimingFunction: EASE, opacity: pct === 0 ? 0 : 1 }
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
),
|
|
103
|
+
inner && /* @__PURE__ */ jsx("span", { className: "relative text-[11px] font-medium text-ink", children: inner })
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
var progress_default = ProgressBar;
|
|
109
|
+
|
|
110
|
+
export {
|
|
111
|
+
ProgressBar,
|
|
112
|
+
ProgressRing,
|
|
113
|
+
progress_default
|
|
114
|
+
};
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// components/kit/tree-view.tsx
|
|
4
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
var cx = (...c) => c.filter(Boolean).join(" ");
|
|
7
|
+
var KEYFRAMES = `@keyframes asta-tree-in { from { opacity: 0; transform: translateY(-4px) } }`;
|
|
8
|
+
var isFolder = (n) => n.children !== void 0;
|
|
9
|
+
function FolderIcon({ open }) {
|
|
10
|
+
return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinejoin: "round", "aria-hidden": true, children: open ? /* @__PURE__ */ jsx("path", { d: "M2 12.5v-8a1 1 0 0 1 1-1h3l1.5 1.5H12a1 1 0 0 1 1 1V7M2 12.5 3.8 8a1 1 0 0 1 .9-.6h9.1a.6.6 0 0 1 .6.8l-1.6 4.3h-11Z" }) : /* @__PURE__ */ jsx("path", { d: "M2 4.5a1 1 0 0 1 1-1h3L7.5 5H13a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-7.5Z" }) });
|
|
11
|
+
}
|
|
12
|
+
function FileIcon() {
|
|
13
|
+
return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M4 2.5h5L12.5 6v7.5H4zM9 2.5V6h3.5" }) });
|
|
14
|
+
}
|
|
15
|
+
function TreeView({ nodes, selected, defaultSelected = null, onSelect, expanded, defaultExpanded = [], onExpandedChange, label, className }) {
|
|
16
|
+
const [innerSel, setInnerSel] = useState(defaultSelected);
|
|
17
|
+
const [innerExp, setInnerExp] = useState(defaultExpanded);
|
|
18
|
+
const sel = selected !== void 0 ? selected : innerSel;
|
|
19
|
+
const exp = useMemo(() => new Set(expanded ?? innerExp), [expanded, innerExp]);
|
|
20
|
+
const [opened, setOpened] = useState(() => /* @__PURE__ */ new Set());
|
|
21
|
+
const [focusId, setFocusId] = useState(null);
|
|
22
|
+
const refs = useRef(/* @__PURE__ */ new Map());
|
|
23
|
+
const tree = useRef(null);
|
|
24
|
+
const typed = useRef({ text: "", at: 0 });
|
|
25
|
+
const index = useMemo(() => {
|
|
26
|
+
const m = /* @__PURE__ */ new Map();
|
|
27
|
+
const walk = (list, level, parent) => {
|
|
28
|
+
for (const n of list) {
|
|
29
|
+
m.set(n.id, { node: n, level, parent });
|
|
30
|
+
if (n.children) walk(n.children, level + 1, n.id);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
walk(nodes, 1, null);
|
|
34
|
+
return m;
|
|
35
|
+
}, [nodes]);
|
|
36
|
+
const visible = useMemo(() => {
|
|
37
|
+
const out = [];
|
|
38
|
+
const walk = (list, level, parent) => {
|
|
39
|
+
for (const n of list) {
|
|
40
|
+
out.push({ node: n, level, parent });
|
|
41
|
+
if (n.children && exp.has(n.id)) walk(n.children, level + 1, n.id);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
walk(nodes, 1, null);
|
|
45
|
+
return out;
|
|
46
|
+
}, [nodes, exp]);
|
|
47
|
+
const visibleIds = new Set(visible.map((r) => r.node.id));
|
|
48
|
+
const tabId = focusId && visibleIds.has(focusId) ? focusId : sel && visibleIds.has(sel) ? sel : visible[0]?.node.id ?? null;
|
|
49
|
+
const setExp = (next) => {
|
|
50
|
+
const ids = [...next];
|
|
51
|
+
if (expanded === void 0) setInnerExp(ids);
|
|
52
|
+
onExpandedChange?.(ids);
|
|
53
|
+
};
|
|
54
|
+
const isAncestor = (id, of) => {
|
|
55
|
+
for (let p = of ? index.get(of)?.parent : null; p; p = index.get(p)?.parent) if (p === id) return true;
|
|
56
|
+
return false;
|
|
57
|
+
};
|
|
58
|
+
const toggle = (id, open = !exp.has(id)) => {
|
|
59
|
+
if (open === exp.has(id)) return;
|
|
60
|
+
const next = new Set(exp);
|
|
61
|
+
if (open) {
|
|
62
|
+
next.add(id);
|
|
63
|
+
setOpened((o) => o.has(id) ? o : new Set(o).add(id));
|
|
64
|
+
} else {
|
|
65
|
+
next.delete(id);
|
|
66
|
+
if (isAncestor(id, focusId)) setFocusId(id);
|
|
67
|
+
}
|
|
68
|
+
setExp(next);
|
|
69
|
+
};
|
|
70
|
+
const choose = (n) => {
|
|
71
|
+
if (n.disabled) return;
|
|
72
|
+
if (selected === void 0) setInnerSel(n.id);
|
|
73
|
+
onSelect?.(n.id, n);
|
|
74
|
+
};
|
|
75
|
+
const focus = (id) => {
|
|
76
|
+
if (!id) return;
|
|
77
|
+
setFocusId(id);
|
|
78
|
+
refs.current.get(id)?.focus();
|
|
79
|
+
};
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
if (!focusId || !tree.current?.contains(document.activeElement)) return;
|
|
82
|
+
const el = refs.current.get(focusId);
|
|
83
|
+
if (el && document.activeElement !== el) el.focus();
|
|
84
|
+
}, [focusId, visible]);
|
|
85
|
+
const onKey = (e) => {
|
|
86
|
+
const i = visible.findIndex((r) => r.node.id === tabId);
|
|
87
|
+
const row = visible[i];
|
|
88
|
+
if (!row) return;
|
|
89
|
+
const n = row.node;
|
|
90
|
+
let handled = true;
|
|
91
|
+
switch (e.key) {
|
|
92
|
+
case "ArrowDown":
|
|
93
|
+
focus(visible[i + 1]?.node.id);
|
|
94
|
+
break;
|
|
95
|
+
case "ArrowUp":
|
|
96
|
+
focus(visible[i - 1]?.node.id);
|
|
97
|
+
break;
|
|
98
|
+
case "Home":
|
|
99
|
+
focus(visible[0]?.node.id);
|
|
100
|
+
break;
|
|
101
|
+
case "End":
|
|
102
|
+
focus(visible[visible.length - 1]?.node.id);
|
|
103
|
+
break;
|
|
104
|
+
case "ArrowRight":
|
|
105
|
+
if (isFolder(n) && !n.disabled) {
|
|
106
|
+
if (!exp.has(n.id)) toggle(n.id, true);
|
|
107
|
+
else if (n.children.length) focus(n.children[0].id);
|
|
108
|
+
}
|
|
109
|
+
break;
|
|
110
|
+
case "ArrowLeft":
|
|
111
|
+
if (isFolder(n) && exp.has(n.id)) toggle(n.id, false);
|
|
112
|
+
else focus(row.parent);
|
|
113
|
+
break;
|
|
114
|
+
case "Enter":
|
|
115
|
+
choose(n);
|
|
116
|
+
if (isFolder(n) && !n.disabled) toggle(n.id);
|
|
117
|
+
break;
|
|
118
|
+
case " ":
|
|
119
|
+
choose(n);
|
|
120
|
+
break;
|
|
121
|
+
case "*": {
|
|
122
|
+
const siblings = row.parent ? index.get(row.parent).node.children : nodes;
|
|
123
|
+
const next = new Set(exp);
|
|
124
|
+
const fresh = [];
|
|
125
|
+
for (const s of siblings)
|
|
126
|
+
if (isFolder(s) && !s.disabled && !next.has(s.id)) {
|
|
127
|
+
next.add(s.id);
|
|
128
|
+
fresh.push(s.id);
|
|
129
|
+
}
|
|
130
|
+
if (fresh.length) {
|
|
131
|
+
setOpened((o) => /* @__PURE__ */ new Set([...o, ...fresh]));
|
|
132
|
+
setExp(next);
|
|
133
|
+
}
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
default:
|
|
137
|
+
handled = false;
|
|
138
|
+
if (e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey) {
|
|
139
|
+
const t = typed.current;
|
|
140
|
+
t.text = e.timeStamp - t.at > 600 ? e.key.toLowerCase() : t.text + e.key.toLowerCase();
|
|
141
|
+
t.at = e.timeStamp;
|
|
142
|
+
const start = t.text.length === 1 ? i + 1 : i;
|
|
143
|
+
const order = [...visible.slice(start), ...visible.slice(0, start)];
|
|
144
|
+
const hit = order.find((r) => r.node.label.toLowerCase().startsWith(t.text));
|
|
145
|
+
if (hit) {
|
|
146
|
+
focus(hit.node.id);
|
|
147
|
+
handled = true;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
if (handled) e.preventDefault();
|
|
152
|
+
};
|
|
153
|
+
const renderList = (list, level, parent) => list.map((n, k) => {
|
|
154
|
+
const folder = isFolder(n);
|
|
155
|
+
const open = folder && exp.has(n.id);
|
|
156
|
+
const isSel = sel === n.id;
|
|
157
|
+
const animate = parent !== null && opened.has(parent);
|
|
158
|
+
return /* @__PURE__ */ jsxs(
|
|
159
|
+
"li",
|
|
160
|
+
{
|
|
161
|
+
ref: (el) => {
|
|
162
|
+
if (el) refs.current.set(n.id, el);
|
|
163
|
+
else refs.current.delete(n.id);
|
|
164
|
+
},
|
|
165
|
+
role: "treeitem",
|
|
166
|
+
tabIndex: tabId === n.id ? 0 : -1,
|
|
167
|
+
"aria-level": level,
|
|
168
|
+
"aria-setsize": list.length,
|
|
169
|
+
"aria-posinset": k + 1,
|
|
170
|
+
"aria-expanded": folder ? open : void 0,
|
|
171
|
+
"aria-selected": isSel,
|
|
172
|
+
"aria-disabled": n.disabled || void 0,
|
|
173
|
+
onFocus: (e) => {
|
|
174
|
+
if (e.target === e.currentTarget) setFocusId(n.id);
|
|
175
|
+
},
|
|
176
|
+
className: cx(
|
|
177
|
+
"outline-none [&:focus-visible>div:first-child]:ring-2 [&:focus-visible>div:first-child]:ring-inset [&:focus-visible>div:first-child]:ring-brand/50",
|
|
178
|
+
animate && "animate-[asta-tree-in_.32s_cubic-bezier(.16,1,.3,1)_both] motion-reduce:animate-none"
|
|
179
|
+
),
|
|
180
|
+
style: animate ? { animationDelay: `${Math.min(k, 8) * 24}ms` } : void 0,
|
|
181
|
+
children: [
|
|
182
|
+
/* @__PURE__ */ jsxs(
|
|
183
|
+
"div",
|
|
184
|
+
{
|
|
185
|
+
"data-selected": isSel || void 0,
|
|
186
|
+
onClick: () => {
|
|
187
|
+
if (n.disabled) return;
|
|
188
|
+
focus(n.id);
|
|
189
|
+
choose(n);
|
|
190
|
+
if (folder) toggle(n.id);
|
|
191
|
+
},
|
|
192
|
+
style: { paddingLeft: 8 + (level - 1) * 18 },
|
|
193
|
+
className: cx(
|
|
194
|
+
"group/row flex h-8 select-none items-center gap-2 rounded-lg pr-2.5 text-[13px] transition-colors duration-150",
|
|
195
|
+
n.disabled ? "cursor-not-allowed text-mute opacity-50" : "cursor-pointer",
|
|
196
|
+
isSel ? "bg-paper-2 text-ink" : !n.disabled && "text-ink-2 hover:bg-[color-mix(in_srgb,var(--paper-2)_60%,transparent)] hover:text-ink"
|
|
197
|
+
),
|
|
198
|
+
children: [
|
|
199
|
+
/* @__PURE__ */ jsx(
|
|
200
|
+
"span",
|
|
201
|
+
{
|
|
202
|
+
"aria-hidden": true,
|
|
203
|
+
onClick: (e) => {
|
|
204
|
+
if (!folder || n.disabled) return;
|
|
205
|
+
e.stopPropagation();
|
|
206
|
+
focus(n.id);
|
|
207
|
+
toggle(n.id);
|
|
208
|
+
},
|
|
209
|
+
className: "grid h-4 w-4 shrink-0 place-items-center text-mute",
|
|
210
|
+
children: folder && /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: cx("h-3 w-3 transition-transform duration-300 ease-[cubic-bezier(.16,1,.3,1)] motion-reduce:transition-none", open && "rotate-90"), fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("path", { d: "m6 4 4 4-4 4" }) })
|
|
211
|
+
}
|
|
212
|
+
),
|
|
213
|
+
/* @__PURE__ */ jsx("span", { className: cx("inline-flex h-4 w-4 shrink-0 transition-colors [&_svg]:h-4 [&_svg]:w-4", isSel ? "text-brand" : "text-mute group-hover/row:text-ink-2"), children: n.icon ?? (folder ? /* @__PURE__ */ jsx(FolderIcon, { open }) : /* @__PURE__ */ jsx(FileIcon, {})) }),
|
|
214
|
+
/* @__PURE__ */ jsx("span", { className: "flex-1 truncate", children: n.label }),
|
|
215
|
+
n.meta && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-[11.5px] tabular-nums text-mute", children: n.meta })
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
),
|
|
219
|
+
open && n.children.length > 0 && /* @__PURE__ */ jsx("ul", { role: "group", className: "flex flex-col gap-px pt-px", children: renderList(n.children, level + 1, n.id) })
|
|
220
|
+
]
|
|
221
|
+
},
|
|
222
|
+
n.id
|
|
223
|
+
);
|
|
224
|
+
});
|
|
225
|
+
return /* @__PURE__ */ jsxs("ul", { ref: tree, role: "tree", "aria-label": label, onKeyDown: onKey, className: cx("flex flex-col gap-px", className), children: [
|
|
226
|
+
/* @__PURE__ */ jsx("style", { href: "asta-tree-view", precedence: "asta", children: KEYFRAMES }),
|
|
227
|
+
renderList(nodes, 1, null)
|
|
228
|
+
] });
|
|
229
|
+
}
|
|
230
|
+
var tree_view_default = TreeView;
|
|
231
|
+
|
|
232
|
+
export {
|
|
233
|
+
TreeView,
|
|
234
|
+
tree_view_default
|
|
235
|
+
};
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// components/lab/blocks/PlanSwitcher.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 PLANS = [
|
|
10
|
+
{ name: "Starter", note: "Just you", month: 9, year: 7, has: 2 },
|
|
11
|
+
{ name: "Pro", note: "Growing work", month: 29, year: 24, has: 4 },
|
|
12
|
+
{ name: "Team", note: "The whole crew", month: 79, year: 66, has: 5 }
|
|
13
|
+
];
|
|
14
|
+
var FEATURES = ["Core editor", "Version history", "Custom domain", "Priority support", "Shared workspace"];
|
|
15
|
+
var DEMO = [
|
|
16
|
+
[1, true],
|
|
17
|
+
[2, true],
|
|
18
|
+
[2, false],
|
|
19
|
+
[0, false],
|
|
20
|
+
[0, true],
|
|
21
|
+
[1, false]
|
|
22
|
+
];
|
|
23
|
+
function next(s, sel, yearly) {
|
|
24
|
+
if (s.sel === sel && s.yearly === yearly) return s;
|
|
25
|
+
const stamp = s.stamp + 1;
|
|
26
|
+
const born = s.born.map((b, i) => i < PLANS[sel].has && i >= PLANS[s.sel].has ? stamp : b);
|
|
27
|
+
return { sel, yearly, stamp, born };
|
|
28
|
+
}
|
|
29
|
+
function Roll({ value }) {
|
|
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 transition-transform duration-700 motion-reduce:transition-none",
|
|
41
|
+
style: { transform: `translateY(-${Number(c) * 1.1}em)`, transitionTimingFunction: EASE },
|
|
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 Check = () => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "h-[62%] w-[62%]", fill: "none", stroke: "currentColor", strokeWidth: "2.6", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M3.5 8.5l3 3 6-7" }) });
|
|
49
|
+
function PlanSwitcher() {
|
|
50
|
+
const [s, setS] = useState({ sel: 1, yearly: false, stamp: 0, born: FEATURES.map(() => -1) });
|
|
51
|
+
const [paused, setPaused] = useState(false);
|
|
52
|
+
const idle = useRef(null);
|
|
53
|
+
const radios = useRef([]);
|
|
54
|
+
const takeOver = () => {
|
|
55
|
+
setPaused(true);
|
|
56
|
+
if (idle.current) clearTimeout(idle.current);
|
|
57
|
+
idle.current = setTimeout(() => setPaused(false), 8e3);
|
|
58
|
+
};
|
|
59
|
+
useEffect(() => () => void (idle.current && clearTimeout(idle.current)), []);
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
if (paused || window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
62
|
+
let i = 0;
|
|
63
|
+
let id;
|
|
64
|
+
const tick = () => {
|
|
65
|
+
const [p, y] = DEMO[i % DEMO.length];
|
|
66
|
+
setS((v) => next(v, p, y));
|
|
67
|
+
i++;
|
|
68
|
+
id = setTimeout(tick, 2100);
|
|
69
|
+
};
|
|
70
|
+
id = setTimeout(tick, 1400);
|
|
71
|
+
return () => clearTimeout(id);
|
|
72
|
+
}, [paused]);
|
|
73
|
+
const pick = (sel, yearly = s.yearly) => {
|
|
74
|
+
takeOver();
|
|
75
|
+
setS((v) => next(v, sel, yearly));
|
|
76
|
+
};
|
|
77
|
+
const onKey = (e) => {
|
|
78
|
+
const d = e.key === "ArrowDown" || e.key === "ArrowRight" ? 1 : e.key === "ArrowUp" || e.key === "ArrowLeft" ? -1 : 0;
|
|
79
|
+
if (!d) return;
|
|
80
|
+
e.preventDefault();
|
|
81
|
+
const n = (s.sel + d + PLANS.length) % PLANS.length;
|
|
82
|
+
pick(n);
|
|
83
|
+
radios.current[n]?.focus();
|
|
84
|
+
};
|
|
85
|
+
const plan = PLANS[s.sel];
|
|
86
|
+
const price = s.yearly ? plan.year : plan.month;
|
|
87
|
+
const save = (plan.month - plan.year) * 12;
|
|
88
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex h-full w-full items-center justify-center px-5 pb-5 pt-11", style: { containerType: "size" }, children: [
|
|
89
|
+
/* @__PURE__ */ jsx("style", { href: "asta-planswitcher", precedence: "asta", children: `
|
|
90
|
+
.lab-pl-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: min(6cqw, 32px); align-items: center }
|
|
91
|
+
.lab-pl-note { display: none }
|
|
92
|
+
@container (min-width: 500px) { .lab-pl-note { display: block } }
|
|
93
|
+
@container (max-width: 400px) { .lab-pl-row { display: none } }
|
|
94
|
+
@container (aspect-ratio < 1.05) { .lab-pl-body { grid-template-columns: minmax(0, 1fr); gap: 16px } }
|
|
95
|
+
@keyframes lab-pl-tick { 0% { transform: scale(.3); opacity: 0 } 55% { transform: scale(1.18); opacity: 1 } 80% { transform: scale(.94) } 100% { transform: none; opacity: 1 } }
|
|
96
|
+
@keyframes lab-pl-in { from { transform: translateX(-10px); opacity: 0 } to { transform: none; opacity: 1 } }
|
|
97
|
+
@keyframes lab-pl-pop { 0% { transform: translateY(6px) scale(.7); opacity: 0 } 55% { transform: scale(1.07); opacity: 1 } 80% { transform: scale(.98) } 100% { transform: none; opacity: 1 } }
|
|
98
|
+
.lab-pl-tick { animation: lab-pl-tick .6s ${EASE} both }
|
|
99
|
+
.lab-pl-in { animation: lab-pl-in .55s ${EASE} both }
|
|
100
|
+
.lab-pl-pop { animation: lab-pl-pop .6s ${EASE} both }
|
|
101
|
+
@media (prefers-reduced-motion: reduce) { .lab-pl-tick, .lab-pl-in, .lab-pl-pop { animation: none } }
|
|
102
|
+
` }),
|
|
103
|
+
/* @__PURE__ */ jsxs("div", { className: "lab-pl-body w-full max-w-[520px]", children: [
|
|
104
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-3", children: [
|
|
105
|
+
/* @__PURE__ */ jsxs(
|
|
106
|
+
"button",
|
|
107
|
+
{
|
|
108
|
+
type: "button",
|
|
109
|
+
role: "switch",
|
|
110
|
+
"aria-checked": s.yearly,
|
|
111
|
+
"aria-label": "Bill yearly",
|
|
112
|
+
onClick: () => pick(s.sel, !s.yearly),
|
|
113
|
+
className: `relative grid h-8 w-full grid-cols-2 rounded-full bg-paper-2 p-[3px] text-[11.5px] font-medium outline-none focus-visible:ring-2 focus-visible:ring-brand/60 ${RING}`,
|
|
114
|
+
children: [
|
|
115
|
+
/* @__PURE__ */ jsx(
|
|
116
|
+
"span",
|
|
117
|
+
{
|
|
118
|
+
"aria-hidden": true,
|
|
119
|
+
className: "absolute inset-y-[3px] left-[3px] w-[calc(50%-3px)] rounded-full bg-paper shadow-[0_1px_2px_rgb(0_0_0/0.18)] transition-transform duration-500 motion-reduce:transition-none",
|
|
120
|
+
style: { transform: s.yearly ? "translateX(100%)" : "none", transitionTimingFunction: EASE }
|
|
121
|
+
}
|
|
122
|
+
),
|
|
123
|
+
/* @__PURE__ */ jsx("span", { className: `relative px-2.5 leading-[22px] transition-opacity duration-300 ${s.yearly ? "text-mute" : "text-ink"}`, children: "Monthly" }),
|
|
124
|
+
/* @__PURE__ */ jsx("span", { className: `relative px-2.5 leading-[22px] transition-opacity duration-300 ${s.yearly ? "text-ink" : "text-mute"}`, children: "Yearly" })
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
),
|
|
128
|
+
/* @__PURE__ */ jsxs("div", { role: "radiogroup", "aria-label": "Plan", onKeyDown: onKey, className: "relative flex flex-col", children: [
|
|
129
|
+
/* @__PURE__ */ jsx(
|
|
130
|
+
"span",
|
|
131
|
+
{
|
|
132
|
+
"aria-hidden": true,
|
|
133
|
+
className: "pointer-events-none absolute inset-x-0 top-0 h-1/3 rounded-[10px] bg-paper shadow-[inset_0_0_0_1.5px_var(--brand),0_6px_16px_-10px_rgb(0_0_0/0.5)] transition-transform duration-[650ms] motion-reduce:transition-none",
|
|
134
|
+
style: { transform: `translateY(${s.sel * 100}%)`, transitionTimingFunction: EASE }
|
|
135
|
+
}
|
|
136
|
+
),
|
|
137
|
+
PLANS.map((p, i) => /* @__PURE__ */ jsxs(
|
|
138
|
+
"button",
|
|
139
|
+
{
|
|
140
|
+
ref: (el) => {
|
|
141
|
+
radios.current[i] = el;
|
|
142
|
+
},
|
|
143
|
+
type: "button",
|
|
144
|
+
role: "radio",
|
|
145
|
+
"aria-checked": s.sel === i,
|
|
146
|
+
tabIndex: s.sel === i ? 0 : -1,
|
|
147
|
+
onClick: () => pick(i),
|
|
148
|
+
className: "relative flex h-[clamp(40px,14cqh,52px)] items-center justify-between gap-3 rounded-[10px] px-3 text-left outline-none focus-visible:ring-2 focus-visible:ring-brand/60",
|
|
149
|
+
children: [
|
|
150
|
+
/* @__PURE__ */ jsxs("span", { className: "flex min-w-0 items-center gap-2.5", children: [
|
|
151
|
+
/* @__PURE__ */ jsx("span", { className: `relative h-3.5 w-3.5 shrink-0 rounded-full ${RING}`, children: /* @__PURE__ */ jsx(
|
|
152
|
+
"span",
|
|
153
|
+
{
|
|
154
|
+
className: "absolute inset-[3px] rounded-full bg-brand transition-[opacity,transform] duration-500 motion-reduce:transition-none",
|
|
155
|
+
style: { opacity: s.sel === i ? 1 : 0, transform: s.sel === i ? "none" : "scale(.3)", transitionTimingFunction: EASE }
|
|
156
|
+
}
|
|
157
|
+
) }),
|
|
158
|
+
/* @__PURE__ */ jsxs("span", { className: "min-w-0", children: [
|
|
159
|
+
/* @__PURE__ */ jsx("span", { className: "block truncate text-[13.5px] font-medium leading-tight text-ink", children: p.name }),
|
|
160
|
+
/* @__PURE__ */ jsx("span", { className: "lab-pl-note truncate text-[11.5px] leading-tight text-mute", children: p.note })
|
|
161
|
+
] })
|
|
162
|
+
] }),
|
|
163
|
+
/* @__PURE__ */ jsxs("span", { className: "lab-pl-row shrink-0 text-[12px] tabular-nums text-ink-2", children: [
|
|
164
|
+
"$",
|
|
165
|
+
s.yearly ? p.year : p.month,
|
|
166
|
+
"/mo"
|
|
167
|
+
] })
|
|
168
|
+
]
|
|
169
|
+
},
|
|
170
|
+
p.name
|
|
171
|
+
))
|
|
172
|
+
] })
|
|
173
|
+
] }),
|
|
174
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col", children: [
|
|
175
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-end gap-1.5", children: [
|
|
176
|
+
/* @__PURE__ */ jsxs("span", { className: "font-medium tracking-[-0.04em] text-ink", style: { fontSize: "clamp(30px, 12cqmin, 46px)", lineHeight: 1 }, "aria-live": "polite", children: [
|
|
177
|
+
"$",
|
|
178
|
+
/* @__PURE__ */ jsx(Roll, { value: String(price) })
|
|
179
|
+
] }),
|
|
180
|
+
/* @__PURE__ */ jsx("span", { className: "pb-[3px] text-[13px] text-mute", children: "/mo" })
|
|
181
|
+
] }),
|
|
182
|
+
/* @__PURE__ */ jsxs("div", { className: "relative mt-2 h-6", children: [
|
|
183
|
+
/* @__PURE__ */ jsx(
|
|
184
|
+
"span",
|
|
185
|
+
{
|
|
186
|
+
className: "absolute left-0 top-0 text-[12px] leading-6 text-mute transition-opacity duration-300",
|
|
187
|
+
style: { opacity: s.yearly ? 0 : 1 },
|
|
188
|
+
"aria-hidden": s.yearly,
|
|
189
|
+
children: "Billed monthly"
|
|
190
|
+
}
|
|
191
|
+
),
|
|
192
|
+
/* @__PURE__ */ jsx(
|
|
193
|
+
"span",
|
|
194
|
+
{
|
|
195
|
+
className: "absolute left-0 top-0 transition-[opacity,transform] duration-500 motion-reduce:transition-none",
|
|
196
|
+
style: { opacity: s.yearly ? 1 : 0, transform: s.yearly ? "none" : "translateY(4px) scale(.92)", transitionTimingFunction: EASE },
|
|
197
|
+
"aria-hidden": !s.yearly,
|
|
198
|
+
children: /* @__PURE__ */ jsxs(
|
|
199
|
+
"span",
|
|
200
|
+
{
|
|
201
|
+
className: `inline-flex h-6 items-center whitespace-pre rounded-full bg-brand px-2.5 text-[11.5px] font-medium text-paper ${s.yearly ? "lab-pl-pop" : ""}`,
|
|
202
|
+
children: [
|
|
203
|
+
"You save $",
|
|
204
|
+
/* @__PURE__ */ jsx(Roll, { value: String(save) }),
|
|
205
|
+
"/yr"
|
|
206
|
+
]
|
|
207
|
+
},
|
|
208
|
+
s.yearly ? "y" : "m"
|
|
209
|
+
)
|
|
210
|
+
}
|
|
211
|
+
)
|
|
212
|
+
] }),
|
|
213
|
+
/* @__PURE__ */ jsx("ul", { className: "mt-[max(10px,3.5cqh)] flex flex-col gap-[max(4px,1.4cqh)]", "aria-label": `${plan.name} features`, children: FEATURES.map((f, i) => {
|
|
214
|
+
const on = i < plan.has;
|
|
215
|
+
const fresh = s.born[i] >= 0;
|
|
216
|
+
return /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-2.5 text-[clamp(12px,3.6cqmin,14px)] leading-snug", "aria-hidden": !on, children: [
|
|
217
|
+
/* @__PURE__ */ jsx("span", { className: `relative h-4 w-4 shrink-0 rounded-full ${RING}`, children: /* @__PURE__ */ jsx(
|
|
218
|
+
"span",
|
|
219
|
+
{
|
|
220
|
+
className: "absolute inset-0 transition-[opacity,transform] duration-500 motion-reduce:transition-none",
|
|
221
|
+
style: { opacity: on ? 1 : 0, transform: on ? "none" : "scale(.4)", transitionTimingFunction: EASE },
|
|
222
|
+
children: /* @__PURE__ */ jsx("span", { className: `flex h-full w-full items-center justify-center rounded-full bg-brand text-paper ${fresh ? "lab-pl-tick" : ""}`, children: /* @__PURE__ */ jsx(Check, {}) }, s.born[i])
|
|
223
|
+
}
|
|
224
|
+
) }),
|
|
225
|
+
/* @__PURE__ */ jsxs("span", { className: "relative min-w-0 transition-opacity duration-500", style: { opacity: on ? 1 : 0.32 }, children: [
|
|
226
|
+
/* @__PURE__ */ jsx("span", { className: `block truncate ${on ? "text-ink" : "text-mute"} ${fresh ? "lab-pl-in" : ""}`, children: f }, s.born[i]),
|
|
227
|
+
/* @__PURE__ */ jsx(
|
|
228
|
+
"span",
|
|
229
|
+
{
|
|
230
|
+
"aria-hidden": true,
|
|
231
|
+
className: "absolute left-0 top-1/2 h-px w-full origin-left bg-current text-mute transition-transform duration-500 motion-reduce:transition-none",
|
|
232
|
+
style: { transform: on ? "scaleX(0)" : "scaleX(1)", transitionTimingFunction: EASE }
|
|
233
|
+
}
|
|
234
|
+
)
|
|
235
|
+
] })
|
|
236
|
+
] }, f);
|
|
237
|
+
}) })
|
|
238
|
+
] })
|
|
239
|
+
] })
|
|
240
|
+
] });
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export {
|
|
244
|
+
PlanSwitcher
|
|
245
|
+
};
|