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,340 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// components/kit/date-picker.tsx
|
|
4
|
+
import { useEffect, useId, 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 kit-dp-in { from { opacity: 0; transform: translateY(-4px) scale(.97) } }
|
|
8
|
+
@keyframes kit-dp-next { from { opacity: 0; transform: translateX(28px) } }
|
|
9
|
+
@keyframes kit-dp-prev { from { opacity: 0; transform: translateX(-28px) } }
|
|
10
|
+
@keyframes kit-dp-pop { 0% { opacity: 0; transform: scale(.55) } 60% { opacity: 1; transform: scale(1.06) } 100% { transform: scale(1) } }`;
|
|
11
|
+
var day0 = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
|
12
|
+
var addDays = (d, n) => new Date(d.getFullYear(), d.getMonth(), d.getDate() + n);
|
|
13
|
+
var month0 = (d) => new Date(d.getFullYear(), d.getMonth(), 1);
|
|
14
|
+
var addMonths = (d, n) => {
|
|
15
|
+
const last = new Date(d.getFullYear(), d.getMonth() + n + 1, 0).getDate();
|
|
16
|
+
return new Date(d.getFullYear(), d.getMonth() + n, Math.min(d.getDate(), last));
|
|
17
|
+
};
|
|
18
|
+
var sameDay = (a, b) => !!a && !!b && day0(a).getTime() === day0(b).getTime();
|
|
19
|
+
var key = (d) => `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`;
|
|
20
|
+
var clamp = (d, min, max) => min && d < day0(min) ? day0(min) : max && d > day0(max) ? day0(max) : d;
|
|
21
|
+
function CalendarIcon() {
|
|
22
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", className: "h-4 w-4 shrink-0 text-mute", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", "aria-hidden": true, children: [
|
|
23
|
+
/* @__PURE__ */ jsx("rect", { x: "2.5", y: "3.5", width: "11", height: "10", rx: "2" }),
|
|
24
|
+
/* @__PURE__ */ jsx("path", { d: "M2.5 6.5h11M5.5 2v3M10.5 2v3" })
|
|
25
|
+
] });
|
|
26
|
+
}
|
|
27
|
+
function Arrow({ dir }) {
|
|
28
|
+
return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "h-4 w-4", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: dir === 1 ? "m6 3.5 4.5 4.5L6 12.5" : "m10 3.5L5.5 8l4.5 4.5" }) });
|
|
29
|
+
}
|
|
30
|
+
function DatePicker(props) {
|
|
31
|
+
const { locale = "en-US", weekStartsOn = 0, min, max, placeholder, label, name, disabled, size = "md", className } = props;
|
|
32
|
+
const range = props.mode === "range";
|
|
33
|
+
const [innerSingle, setInnerSingle] = useState(!range ? props.defaultValue ?? null : null);
|
|
34
|
+
const [innerRange, setInnerRange] = useState(range ? props.defaultValue ?? { start: null, end: null } : { start: null, end: null });
|
|
35
|
+
const single = !range ? props.value !== void 0 ? props.value : innerSingle : null;
|
|
36
|
+
const rawSpan = range ? props.value ?? innerRange : { start: null, end: null };
|
|
37
|
+
const span = { start: rawSpan.start ? day0(rawSpan.start) : null, end: rawSpan.end ? day0(rawSpan.end) : null };
|
|
38
|
+
const [open, setOpen] = useState(false);
|
|
39
|
+
const [today, setToday] = useState(null);
|
|
40
|
+
const [view, setView] = useState(null);
|
|
41
|
+
const [focus, setFocus] = useState(null);
|
|
42
|
+
const [dir, setDir] = useState(0);
|
|
43
|
+
const [hover, setHover] = useState(null);
|
|
44
|
+
const root = useRef(null);
|
|
45
|
+
const triggerRef = useRef(null);
|
|
46
|
+
const gridRef = useRef(null);
|
|
47
|
+
const steer = useRef(true);
|
|
48
|
+
const uid = useId();
|
|
49
|
+
const fmt = useMemo(() => new Intl.DateTimeFormat(locale, { month: "short", day: "numeric", year: "numeric" }), [locale]);
|
|
50
|
+
const title = useMemo(() => new Intl.DateTimeFormat(locale, { month: "long", year: "numeric" }), [locale]);
|
|
51
|
+
const full = useMemo(() => new Intl.DateTimeFormat(locale, { weekday: "long", month: "long", day: "numeric", year: "numeric" }), [locale]);
|
|
52
|
+
const weekdays = useMemo(() => {
|
|
53
|
+
const w = new Intl.DateTimeFormat(locale, { weekday: "short" });
|
|
54
|
+
const long = new Intl.DateTimeFormat(locale, { weekday: "long" });
|
|
55
|
+
return Array.from({ length: 7 }, (_, i) => {
|
|
56
|
+
const d = new Date(2026, 10, 1 + (i + weekStartsOn) % 7);
|
|
57
|
+
return { short: w.format(d), long: long.format(d) };
|
|
58
|
+
});
|
|
59
|
+
}, [locale, weekStartsOn]);
|
|
60
|
+
const isOff = (d) => min && d < day0(min) || max && d > day0(max) || false;
|
|
61
|
+
const show = () => {
|
|
62
|
+
if (disabled) return;
|
|
63
|
+
const now = day0(/* @__PURE__ */ new Date());
|
|
64
|
+
const anchor = clamp(day0((range ? span.start : single) ?? now), min, max);
|
|
65
|
+
setToday(now);
|
|
66
|
+
setView(month0(anchor));
|
|
67
|
+
setFocus(anchor);
|
|
68
|
+
setHover(null);
|
|
69
|
+
setDir(0);
|
|
70
|
+
steer.current = true;
|
|
71
|
+
setOpen(true);
|
|
72
|
+
};
|
|
73
|
+
const close = (refocus = true) => {
|
|
74
|
+
setOpen(false);
|
|
75
|
+
if (refocus) triggerRef.current?.focus();
|
|
76
|
+
};
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
if (!open) return;
|
|
79
|
+
const onDown = (e) => {
|
|
80
|
+
if (!root.current?.contains(e.target)) setOpen(false);
|
|
81
|
+
};
|
|
82
|
+
document.addEventListener("pointerdown", onDown);
|
|
83
|
+
return () => document.removeEventListener("pointerdown", onDown);
|
|
84
|
+
}, [open]);
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
if (open && focus && steer.current) gridRef.current?.querySelector(`[data-day="${key(focus)}"]`)?.focus({ preventScroll: true });
|
|
87
|
+
}, [open, focus, view]);
|
|
88
|
+
const moveTo = (d) => {
|
|
89
|
+
const next = clamp(d, min, max);
|
|
90
|
+
if (view && (next.getFullYear() !== view.getFullYear() || next.getMonth() !== view.getMonth())) {
|
|
91
|
+
setDir(next > view ? 1 : -1);
|
|
92
|
+
setView(month0(next));
|
|
93
|
+
}
|
|
94
|
+
setFocus(next);
|
|
95
|
+
};
|
|
96
|
+
const canFlip = (n) => {
|
|
97
|
+
if (!view) return false;
|
|
98
|
+
const to = addMonths(view, n);
|
|
99
|
+
return !(min && to < month0(min)) && !(max && to > month0(max));
|
|
100
|
+
};
|
|
101
|
+
const flip = (n) => {
|
|
102
|
+
if (!view || !canFlip(n)) return;
|
|
103
|
+
setDir(n > 0 ? 1 : -1);
|
|
104
|
+
setView(addMonths(view, n));
|
|
105
|
+
if (focus) setFocus(clamp(addMonths(focus, n), min, max));
|
|
106
|
+
};
|
|
107
|
+
const pick = (d) => {
|
|
108
|
+
if (isOff(d)) return;
|
|
109
|
+
if (!range) {
|
|
110
|
+
const p2 = props;
|
|
111
|
+
if (p2.value === void 0) setInnerSingle(d);
|
|
112
|
+
p2.onChange?.(d);
|
|
113
|
+
close();
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const p = props;
|
|
117
|
+
let next;
|
|
118
|
+
if (!span.start || span.end) next = { start: d, end: null };
|
|
119
|
+
else if (d < span.start) next = { start: d, end: null };
|
|
120
|
+
else next = { start: span.start, end: d };
|
|
121
|
+
if (p.value === void 0) setInnerRange(next);
|
|
122
|
+
p.onChange?.(next);
|
|
123
|
+
if (next.end) close();
|
|
124
|
+
else moveTo(d);
|
|
125
|
+
};
|
|
126
|
+
const clear = () => {
|
|
127
|
+
if (!range) {
|
|
128
|
+
const p = props;
|
|
129
|
+
if (p.value === void 0) setInnerSingle(null);
|
|
130
|
+
p.onChange?.(null);
|
|
131
|
+
} else {
|
|
132
|
+
const p = props;
|
|
133
|
+
const next = { start: null, end: null };
|
|
134
|
+
if (p.value === void 0) setInnerRange(next);
|
|
135
|
+
p.onChange?.(next);
|
|
136
|
+
}
|
|
137
|
+
close();
|
|
138
|
+
};
|
|
139
|
+
const onGridKey = (e) => {
|
|
140
|
+
if (!focus) return;
|
|
141
|
+
steer.current = true;
|
|
142
|
+
const dow = (focus.getDay() - weekStartsOn + 7) % 7;
|
|
143
|
+
if (e.key === "ArrowRight") moveTo(addDays(focus, 1));
|
|
144
|
+
else if (e.key === "ArrowLeft") moveTo(addDays(focus, -1));
|
|
145
|
+
else if (e.key === "ArrowDown") moveTo(addDays(focus, 7));
|
|
146
|
+
else if (e.key === "ArrowUp") moveTo(addDays(focus, -7));
|
|
147
|
+
else if (e.key === "Home") moveTo(addDays(focus, -dow));
|
|
148
|
+
else if (e.key === "End") moveTo(addDays(focus, 6 - dow));
|
|
149
|
+
else if (e.key === "PageDown") flip(e.shiftKey ? 12 : 1);
|
|
150
|
+
else if (e.key === "PageUp") flip(e.shiftKey ? -12 : -1);
|
|
151
|
+
else if (e.key === "Enter" || e.key === " ") pick(focus);
|
|
152
|
+
else return;
|
|
153
|
+
e.preventDefault();
|
|
154
|
+
};
|
|
155
|
+
const cells = useMemo(() => {
|
|
156
|
+
if (!view) return [];
|
|
157
|
+
const lead = (view.getDay() - weekStartsOn + 7) % 7;
|
|
158
|
+
const first = addDays(view, -lead);
|
|
159
|
+
return Array.from({ length: 42 }, (_, i) => addDays(first, i));
|
|
160
|
+
}, [view, weekStartsOn]);
|
|
161
|
+
const previewEnd = range && span.start && !span.end ? hover ?? focus : null;
|
|
162
|
+
const bandFrom = span.start;
|
|
163
|
+
const bandTo = span.end ?? (previewEnd && span.start && previewEnd > span.start ? previewEnd : null);
|
|
164
|
+
const shown = range ? span.start && span.end ? fmt.formatRange(span.start, span.end) : span.start ? `${fmt.format(span.start)} \u2013 \u2026` : null : single ? fmt.format(single) : null;
|
|
165
|
+
const hidden = range ? span.start && span.end ? `${key(span.start)}/${key(span.end)}` : "" : single ? key(single) : "";
|
|
166
|
+
return /* @__PURE__ */ jsxs("div", { ref: root, className: cx("relative w-full", className), children: [
|
|
167
|
+
/* @__PURE__ */ jsxs(
|
|
168
|
+
"button",
|
|
169
|
+
{
|
|
170
|
+
ref: triggerRef,
|
|
171
|
+
type: "button",
|
|
172
|
+
disabled,
|
|
173
|
+
"aria-label": label,
|
|
174
|
+
"aria-haspopup": "dialog",
|
|
175
|
+
"aria-expanded": open,
|
|
176
|
+
"aria-controls": open ? `${uid}-cal` : void 0,
|
|
177
|
+
onClick: () => open ? close(false) : show(),
|
|
178
|
+
onKeyDown: (e) => {
|
|
179
|
+
if (e.key === "ArrowDown" && !open) {
|
|
180
|
+
e.preventDefault();
|
|
181
|
+
show();
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
className: cx(
|
|
185
|
+
"flex w-full items-center gap-2 bg-paper text-left outline-none transition-shadow duration-200 focus-visible:ring-2 focus-visible:ring-brand/50 disabled:cursor-not-allowed disabled:opacity-45",
|
|
186
|
+
"shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_14%,transparent)] hover:shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_24%,transparent)]",
|
|
187
|
+
open && "!shadow-[inset_0_0_0_1px_var(--brand),0_0_0_3px_color-mix(in_srgb,var(--brand)_18%,transparent)]",
|
|
188
|
+
size === "sm" ? "h-8 rounded-md px-2.5 text-[13px]" : "h-10 rounded-lg px-3 text-[14px]"
|
|
189
|
+
),
|
|
190
|
+
children: [
|
|
191
|
+
/* @__PURE__ */ jsx(CalendarIcon, {}),
|
|
192
|
+
/* @__PURE__ */ jsx("span", { className: cx("min-w-0 flex-1 truncate tabular-nums", shown ? "text-ink" : "text-mute"), children: shown ?? placeholder ?? (range ? "Pick dates" : "Pick a date") })
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
),
|
|
196
|
+
name && /* @__PURE__ */ jsx("input", { type: "hidden", name, value: hidden }),
|
|
197
|
+
open && view && /* @__PURE__ */ jsxs(
|
|
198
|
+
"div",
|
|
199
|
+
{
|
|
200
|
+
id: `${uid}-cal`,
|
|
201
|
+
role: "dialog",
|
|
202
|
+
"aria-label": label ?? "Choose a date",
|
|
203
|
+
className: cx(
|
|
204
|
+
"absolute left-0 top-full z-50 mt-2 w-[296px] origin-top-left rounded-xl bg-paper p-3 outline-none",
|
|
205
|
+
"shadow-[0_0_0_1px_color-mix(in_srgb,var(--ink)_10%,transparent),0_12px_32px_-8px_rgb(0_0_0/0.22),0_4px_8px_-4px_rgb(0_0_0/0.08)]",
|
|
206
|
+
"animate-[kit-dp-in_.24s_cubic-bezier(.16,1,.3,1)_both] motion-reduce:!animate-none"
|
|
207
|
+
),
|
|
208
|
+
onKeyDown: (e) => {
|
|
209
|
+
if (e.key === "Escape") {
|
|
210
|
+
e.preventDefault();
|
|
211
|
+
close();
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
children: [
|
|
215
|
+
/* @__PURE__ */ jsx("style", { href: "asta-date-picker", precedence: "asta", children: KEYFRAMES }),
|
|
216
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-between gap-2 pl-2", children: [
|
|
217
|
+
/* @__PURE__ */ jsx("p", { "aria-live": "polite", className: "text-[14px] font-medium tracking-[-0.01em] text-ink", children: title.format(view) }),
|
|
218
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-0.5", children: [-1, 1].map((d) => /* @__PURE__ */ jsx(
|
|
219
|
+
"button",
|
|
220
|
+
{
|
|
221
|
+
type: "button",
|
|
222
|
+
"aria-label": d === 1 ? "Next month" : "Previous month",
|
|
223
|
+
disabled: !canFlip(d),
|
|
224
|
+
onClick: () => {
|
|
225
|
+
steer.current = false;
|
|
226
|
+
flip(d);
|
|
227
|
+
},
|
|
228
|
+
className: "flex h-8 w-8 items-center justify-center rounded-md text-ink-2 outline-none transition-[background-color,transform] duration-150 hover:bg-paper-2 hover:text-ink focus-visible:ring-2 focus-visible:ring-brand/50 active:scale-90 disabled:pointer-events-none disabled:opacity-35",
|
|
229
|
+
children: /* @__PURE__ */ jsx(Arrow, { dir: d })
|
|
230
|
+
},
|
|
231
|
+
d
|
|
232
|
+
)) })
|
|
233
|
+
] }),
|
|
234
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 pb-1", "aria-hidden": true, children: weekdays.map((w) => /* @__PURE__ */ jsx("span", { className: "py-1 text-center text-[11px] font-medium text-mute", children: w.short }, w.long)) }),
|
|
235
|
+
/* @__PURE__ */ jsx("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsx(
|
|
236
|
+
"div",
|
|
237
|
+
{
|
|
238
|
+
ref: gridRef,
|
|
239
|
+
role: "grid",
|
|
240
|
+
"aria-label": title.format(view),
|
|
241
|
+
onKeyDown: onGridKey,
|
|
242
|
+
onPointerLeave: () => setHover(null),
|
|
243
|
+
className: cx(
|
|
244
|
+
"grid grid-cols-7 gap-y-0.5 motion-reduce:!animate-none",
|
|
245
|
+
dir === 1 && "animate-[kit-dp-next_.34s_cubic-bezier(.16,1,.3,1)_both]",
|
|
246
|
+
dir === -1 && "animate-[kit-dp-prev_.34s_cubic-bezier(.16,1,.3,1)_both]"
|
|
247
|
+
),
|
|
248
|
+
children: cells.map((d) => {
|
|
249
|
+
const inMonth = d.getMonth() === view.getMonth();
|
|
250
|
+
const off = isOff(d);
|
|
251
|
+
const isStart = range ? sameDay(d, span.start) : sameDay(d, single);
|
|
252
|
+
const isEnd = range && sameDay(d, span.end);
|
|
253
|
+
const picked = isStart || isEnd;
|
|
254
|
+
const inBand = !!(bandFrom && bandTo && d >= day0(bandFrom) && d <= day0(bandTo) && !sameDay(bandFrom, bandTo));
|
|
255
|
+
const bandStart = inBand && sameDay(d, bandFrom);
|
|
256
|
+
const bandEnd = inBand && sameDay(d, bandTo);
|
|
257
|
+
const isToday = sameDay(d, today);
|
|
258
|
+
const isFocus = sameDay(d, focus);
|
|
259
|
+
return /* @__PURE__ */ jsxs("div", { role: "gridcell", "aria-selected": picked || inBand || void 0, className: "relative", children: [
|
|
260
|
+
inBand && /* @__PURE__ */ jsx(
|
|
261
|
+
"span",
|
|
262
|
+
{
|
|
263
|
+
"aria-hidden": true,
|
|
264
|
+
className: cx(
|
|
265
|
+
"absolute inset-y-0 bg-[color-mix(in_srgb,var(--brand)_11%,transparent)]",
|
|
266
|
+
bandStart ? "left-1/2 right-0" : bandEnd ? "left-0 right-1/2" : "inset-x-0",
|
|
267
|
+
!span.end && "opacity-70"
|
|
268
|
+
)
|
|
269
|
+
}
|
|
270
|
+
),
|
|
271
|
+
/* @__PURE__ */ jsxs(
|
|
272
|
+
"button",
|
|
273
|
+
{
|
|
274
|
+
type: "button",
|
|
275
|
+
"data-day": key(d),
|
|
276
|
+
tabIndex: isFocus ? 0 : -1,
|
|
277
|
+
disabled: off,
|
|
278
|
+
"aria-label": full.format(d),
|
|
279
|
+
"aria-current": isToday ? "date" : void 0,
|
|
280
|
+
onClick: () => pick(d),
|
|
281
|
+
onPointerEnter: () => range && setHover(d),
|
|
282
|
+
onFocus: () => !isFocus && setFocus(d),
|
|
283
|
+
className: cx(
|
|
284
|
+
"relative mx-auto flex h-9 w-9 items-center justify-center rounded-lg text-[13px] tabular-nums outline-none transition-colors duration-150",
|
|
285
|
+
"focus-visible:ring-2 focus-visible:ring-brand/50 disabled:cursor-not-allowed disabled:opacity-30",
|
|
286
|
+
picked ? "font-medium text-white" : inMonth ? "text-ink hover:bg-paper-2" : "text-mute hover:bg-paper-2"
|
|
287
|
+
),
|
|
288
|
+
children: [
|
|
289
|
+
picked && /* @__PURE__ */ jsx(
|
|
290
|
+
"span",
|
|
291
|
+
{
|
|
292
|
+
"aria-hidden": true,
|
|
293
|
+
className: "absolute inset-0 rounded-lg bg-brand shadow-[0_4px_10px_-4px_color-mix(in_srgb,var(--brand)_70%,transparent)] animate-[kit-dp-pop_.36s_cubic-bezier(.16,1,.3,1)_both] motion-reduce:!animate-none"
|
|
294
|
+
},
|
|
295
|
+
key(d)
|
|
296
|
+
),
|
|
297
|
+
/* @__PURE__ */ jsx("span", { className: "relative", children: d.getDate() }),
|
|
298
|
+
isToday && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: cx("absolute bottom-1 left-1/2 h-1 w-1 -translate-x-1/2 rounded-full", picked ? "bg-white" : "bg-brand") })
|
|
299
|
+
]
|
|
300
|
+
}
|
|
301
|
+
)
|
|
302
|
+
] }, key(d));
|
|
303
|
+
})
|
|
304
|
+
},
|
|
305
|
+
key(view)
|
|
306
|
+
) }),
|
|
307
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-2 flex items-center justify-between gap-2 pl-2", children: [
|
|
308
|
+
/* @__PURE__ */ jsx("p", { className: "text-[12px] tabular-nums text-mute", children: range && span.start && !span.end ? "Pick an end date" : range && span.start && span.end ? `${Math.round((day0(span.end).getTime() - day0(span.start).getTime()) / 864e5) + 1} days` : "" }),
|
|
309
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-1", children: [
|
|
310
|
+
/* @__PURE__ */ jsx(
|
|
311
|
+
"button",
|
|
312
|
+
{
|
|
313
|
+
type: "button",
|
|
314
|
+
onClick: clear,
|
|
315
|
+
className: "h-7 rounded-md px-2.5 text-[12px] font-medium text-ink-2 outline-none transition-colors hover:bg-paper-2 hover:text-ink focus-visible:ring-2 focus-visible:ring-brand/50",
|
|
316
|
+
children: "Clear"
|
|
317
|
+
}
|
|
318
|
+
),
|
|
319
|
+
today && !isOff(today) && /* @__PURE__ */ jsx(
|
|
320
|
+
"button",
|
|
321
|
+
{
|
|
322
|
+
type: "button",
|
|
323
|
+
onClick: () => moveTo(today),
|
|
324
|
+
className: "h-7 rounded-md bg-paper-2 px-2.5 text-[12px] font-medium text-ink outline-none transition-colors hover:bg-[color-mix(in_srgb,var(--ink)_8%,var(--paper-2))] focus-visible:ring-2 focus-visible:ring-brand/50",
|
|
325
|
+
children: "Today"
|
|
326
|
+
}
|
|
327
|
+
)
|
|
328
|
+
] })
|
|
329
|
+
] })
|
|
330
|
+
]
|
|
331
|
+
}
|
|
332
|
+
)
|
|
333
|
+
] });
|
|
334
|
+
}
|
|
335
|
+
var date_picker_default = DatePicker;
|
|
336
|
+
|
|
337
|
+
export {
|
|
338
|
+
DatePicker,
|
|
339
|
+
date_picker_default
|
|
340
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// components/kit/alert.tsx
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
var cx = (...c) => c.filter(Boolean).join(" ");
|
|
7
|
+
var KEYFRAMES = `@keyframes asta-alert-in { from { opacity: 0; transform: translateY(-4px) } }`;
|
|
8
|
+
var SURFACE = {
|
|
9
|
+
info: "bg-[color-mix(in_srgb,var(--brand)_7%,var(--paper))]",
|
|
10
|
+
success: "bg-paper-2",
|
|
11
|
+
warning: "bg-paper-2 shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_16%,transparent)]",
|
|
12
|
+
neutral: "bg-paper-2"
|
|
13
|
+
};
|
|
14
|
+
function ToneIcon({ tone }) {
|
|
15
|
+
const common = { viewBox: "0 0 20 20", className: "h-5 w-5", "aria-hidden": true };
|
|
16
|
+
if (tone === "success")
|
|
17
|
+
return /* @__PURE__ */ jsxs("svg", { ...common, children: [
|
|
18
|
+
/* @__PURE__ */ jsx("circle", { cx: "10", cy: "10", r: "8", className: "fill-brand" }),
|
|
19
|
+
/* @__PURE__ */ jsx("path", { d: "m6.6 10.2 2.3 2.3 4.5-5", fill: "none", stroke: "white", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
20
|
+
] });
|
|
21
|
+
if (tone === "warning")
|
|
22
|
+
return /* @__PURE__ */ jsxs("svg", { ...common, children: [
|
|
23
|
+
/* @__PURE__ */ jsx("path", { d: "M10 2.8c.5 0 .9.25 1.15.68l6.3 11.1c.5.9-.14 2-1.15 2H3.7c-1 0-1.65-1.1-1.15-2l6.3-11.1c.25-.43.65-.68 1.15-.68z", className: "fill-ink" }),
|
|
24
|
+
/* @__PURE__ */ jsx("path", { d: "M10 7.4v4", className: "stroke-paper", strokeWidth: "1.8", strokeLinecap: "round" }),
|
|
25
|
+
/* @__PURE__ */ jsx("circle", { cx: "10", cy: "14", r: "1", className: "fill-paper" })
|
|
26
|
+
] });
|
|
27
|
+
return /* @__PURE__ */ jsxs("svg", { ...common, fill: "none", children: [
|
|
28
|
+
/* @__PURE__ */ jsx("circle", { cx: "10", cy: "10", r: "7.6", strokeWidth: "1.6", className: tone === "info" ? "stroke-brand" : "stroke-mute" }),
|
|
29
|
+
/* @__PURE__ */ jsx("path", { d: "M10 9v4.4", strokeWidth: "1.7", strokeLinecap: "round", className: tone === "info" ? "stroke-brand" : "stroke-mute" }),
|
|
30
|
+
/* @__PURE__ */ jsx("circle", { cx: "10", cy: "6.4", r: "1", className: tone === "info" ? "fill-brand" : "fill-mute" })
|
|
31
|
+
] });
|
|
32
|
+
}
|
|
33
|
+
function Alert({ tone = "info", title, children, action, icon, dismissible, onDismiss, onExited, open, className }) {
|
|
34
|
+
const [closed, setClosed] = useState(false);
|
|
35
|
+
const [gone, setGone] = useState(false);
|
|
36
|
+
const visible = open ?? !closed;
|
|
37
|
+
if (visible && gone) setGone(false);
|
|
38
|
+
if (gone) return null;
|
|
39
|
+
const finish = () => {
|
|
40
|
+
if (visible) return;
|
|
41
|
+
setGone(true);
|
|
42
|
+
onExited?.();
|
|
43
|
+
};
|
|
44
|
+
return /* @__PURE__ */ jsxs(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
className: "grid transition-[grid-template-rows] delay-150 duration-300 motion-reduce:!delay-0 motion-reduce:!duration-[1ms]",
|
|
48
|
+
style: { gridTemplateRows: visible ? "1fr" : "0fr", transitionTimingFunction: "cubic-bezier(.16,1,.3,1)" },
|
|
49
|
+
onTransitionEnd: (e) => {
|
|
50
|
+
if (e.target === e.currentTarget) finish();
|
|
51
|
+
},
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ jsx("style", { href: "asta-alert", precedence: "asta", children: KEYFRAMES }),
|
|
54
|
+
/* @__PURE__ */ jsx("div", { className: "min-h-0 overflow-hidden", children: /* @__PURE__ */ jsxs(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
role: tone === "warning" ? "alert" : "status",
|
|
58
|
+
className: cx(
|
|
59
|
+
"flex items-start gap-3 rounded-xl px-4 py-3.5 transition-[opacity,transform] duration-200 motion-reduce:!duration-[1ms]",
|
|
60
|
+
"animate-[asta-alert-in_.36s_cubic-bezier(.16,1,.3,1)_backwards] motion-reduce:animate-none",
|
|
61
|
+
visible ? "opacity-100" : "scale-[.98] opacity-0",
|
|
62
|
+
SURFACE[tone],
|
|
63
|
+
className
|
|
64
|
+
),
|
|
65
|
+
children: [
|
|
66
|
+
icon !== false && /* @__PURE__ */ jsx("span", { className: "mt-px flex shrink-0 text-ink", children: icon ?? /* @__PURE__ */ jsx(ToneIcon, { tone }) }),
|
|
67
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1 pt-px", children: [
|
|
68
|
+
title && /* @__PURE__ */ jsx("p", { className: "text-[13.5px] font-medium tracking-[-0.01em] text-ink", children: title }),
|
|
69
|
+
children && /* @__PURE__ */ jsx("div", { className: cx("text-[13px] leading-relaxed text-ink-2", !!title && "mt-0.5"), children }),
|
|
70
|
+
action && /* @__PURE__ */ jsx("div", { className: "mt-2.5 flex flex-wrap items-center gap-2", children: action })
|
|
71
|
+
] }),
|
|
72
|
+
dismissible && /* @__PURE__ */ jsx(
|
|
73
|
+
"button",
|
|
74
|
+
{
|
|
75
|
+
type: "button",
|
|
76
|
+
"aria-label": "Dismiss",
|
|
77
|
+
onClick: () => {
|
|
78
|
+
if (open === void 0) setClosed(true);
|
|
79
|
+
onDismiss?.();
|
|
80
|
+
},
|
|
81
|
+
className: "-mr-1.5 -mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-mute outline-none transition-colors hover:bg-[color-mix(in_srgb,var(--ink)_7%,transparent)] hover:text-ink focus-visible:ring-2 focus-visible:ring-brand/50",
|
|
82
|
+
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" }) })
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
) })
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
var alert_default = Alert;
|
|
93
|
+
|
|
94
|
+
export {
|
|
95
|
+
Alert,
|
|
96
|
+
alert_default
|
|
97
|
+
};
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// components/kit/hover-card.tsx
|
|
4
|
+
import {
|
|
5
|
+
cloneElement,
|
|
6
|
+
isValidElement,
|
|
7
|
+
useCallback,
|
|
8
|
+
useEffect,
|
|
9
|
+
useId,
|
|
10
|
+
useLayoutEffect,
|
|
11
|
+
useRef,
|
|
12
|
+
useState
|
|
13
|
+
} from "react";
|
|
14
|
+
import { createPortal } from "react-dom";
|
|
15
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
var cx = (...c) => c.filter(Boolean).join(" ");
|
|
17
|
+
var KEYFRAMES = `@keyframes asta-hovercard-in { from { opacity: 0; transform: translateY(var(--asta-hc-y, 6px)) scale(.98) } }
|
|
18
|
+
@keyframes asta-hovercard-out { to { opacity: 0; transform: translateY(calc(var(--asta-hc-y, 6px) / 2)) } }`;
|
|
19
|
+
var PAD = 8;
|
|
20
|
+
var FOCUSABLE = 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';
|
|
21
|
+
function assignRef(r, el) {
|
|
22
|
+
if (typeof r === "function") r(el);
|
|
23
|
+
else if (r) r.current = el;
|
|
24
|
+
}
|
|
25
|
+
function HoverCard({ trigger, children, open, defaultOpen = false, onOpenChange, openDelay = 500, closeDelay = 220, side = "bottom", align = "center", offset = 8, label, className }) {
|
|
26
|
+
const id = useId();
|
|
27
|
+
const [inner, setInner] = useState(defaultOpen);
|
|
28
|
+
const isOpen = open ?? inner;
|
|
29
|
+
const [present, setPresent] = useState(isOpen);
|
|
30
|
+
const [anchor, setAnchor] = useState(null);
|
|
31
|
+
const card = useRef(null);
|
|
32
|
+
const timer = useRef(void 0);
|
|
33
|
+
if (isOpen && !present) setPresent(true);
|
|
34
|
+
const cur = useRef(isOpen);
|
|
35
|
+
useLayoutEffect(() => {
|
|
36
|
+
cur.current = isOpen;
|
|
37
|
+
});
|
|
38
|
+
const setOpen = (next) => {
|
|
39
|
+
clearTimeout(timer.current);
|
|
40
|
+
if (next === cur.current) return;
|
|
41
|
+
if (open === void 0) {
|
|
42
|
+
cur.current = next;
|
|
43
|
+
setInner(next);
|
|
44
|
+
}
|
|
45
|
+
onOpenChange?.(next);
|
|
46
|
+
};
|
|
47
|
+
const later = (next) => {
|
|
48
|
+
clearTimeout(timer.current);
|
|
49
|
+
if (next === cur.current) return;
|
|
50
|
+
timer.current = setTimeout(() => setOpen(next), next ? openDelay : closeDelay);
|
|
51
|
+
};
|
|
52
|
+
const hold = () => clearTimeout(timer.current);
|
|
53
|
+
useEffect(() => () => clearTimeout(timer.current), []);
|
|
54
|
+
useLayoutEffect(() => {
|
|
55
|
+
if (!present || !anchor) return;
|
|
56
|
+
const place = () => {
|
|
57
|
+
const el = card.current;
|
|
58
|
+
if (!el) return;
|
|
59
|
+
const a = anchor.getBoundingClientRect();
|
|
60
|
+
const w = el.offsetWidth;
|
|
61
|
+
const h = el.offsetHeight;
|
|
62
|
+
const vw = window.innerWidth;
|
|
63
|
+
const vh = window.innerHeight;
|
|
64
|
+
let s = side;
|
|
65
|
+
const room = { top: a.top, bottom: vh - a.bottom };
|
|
66
|
+
const other = s === "top" ? "bottom" : "top";
|
|
67
|
+
if (room[s] < h + offset + PAD && room[other] > room[s]) s = other;
|
|
68
|
+
let x = align === "start" ? a.left : align === "end" ? a.right - w : a.left + a.width / 2 - w / 2;
|
|
69
|
+
x = Math.min(Math.max(PAD, x), vw - w - PAD);
|
|
70
|
+
const y = s === "bottom" ? a.bottom + offset : a.top - offset - h;
|
|
71
|
+
const ox = Math.min(Math.max(16, a.left + a.width / 2 - x), w - 16);
|
|
72
|
+
el.style.left = `${Math.round(x)}px`;
|
|
73
|
+
el.style.top = `${Math.round(y)}px`;
|
|
74
|
+
el.style.transformOrigin = `${ox}px ${s === "bottom" ? "0" : "100%"}`;
|
|
75
|
+
el.style.setProperty("--asta-hc-y", s === "bottom" ? "6px" : "-6px");
|
|
76
|
+
el.style.setProperty("--asta-hc-gap", `${offset + 2}px`);
|
|
77
|
+
el.dataset.side = s;
|
|
78
|
+
};
|
|
79
|
+
place();
|
|
80
|
+
const ro = new ResizeObserver(place);
|
|
81
|
+
ro.observe(card.current);
|
|
82
|
+
window.addEventListener("resize", place);
|
|
83
|
+
window.addEventListener("scroll", place, true);
|
|
84
|
+
return () => {
|
|
85
|
+
ro.disconnect();
|
|
86
|
+
window.removeEventListener("resize", place);
|
|
87
|
+
window.removeEventListener("scroll", place, true);
|
|
88
|
+
};
|
|
89
|
+
}, [present, anchor, side, align, offset]);
|
|
90
|
+
const focusables = () => [...card.current?.querySelectorAll(FOCUSABLE) ?? []];
|
|
91
|
+
const onBlurOut = (to) => {
|
|
92
|
+
if (to instanceof Node && (anchor?.contains(to) || card.current?.contains(to))) return;
|
|
93
|
+
later(false);
|
|
94
|
+
};
|
|
95
|
+
const handlers = {
|
|
96
|
+
enter: (e) => e.pointerType === "mouse" && later(true),
|
|
97
|
+
leave: (e) => e.pointerType === "mouse" && later(false),
|
|
98
|
+
// Keyboard focus only: a mouse click shouldn't pop the card a second time.
|
|
99
|
+
focus: (e) => e.currentTarget.matches(":focus-visible") && later(true),
|
|
100
|
+
blur: (e) => onBlurOut(e.relatedTarget),
|
|
101
|
+
key: (e) => {
|
|
102
|
+
if (e.key === "Escape" && cur.current) {
|
|
103
|
+
e.stopPropagation();
|
|
104
|
+
setOpen(false);
|
|
105
|
+
}
|
|
106
|
+
if (e.key === "Tab" && !e.shiftKey && cur.current) {
|
|
107
|
+
const first = focusables()[0];
|
|
108
|
+
if (first) {
|
|
109
|
+
e.preventDefault();
|
|
110
|
+
hold();
|
|
111
|
+
first.focus();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
const latest = useRef(handlers);
|
|
117
|
+
useLayoutEffect(() => {
|
|
118
|
+
latest.current = handlers;
|
|
119
|
+
});
|
|
120
|
+
useEffect(() => {
|
|
121
|
+
if (!anchor) return;
|
|
122
|
+
const on = [
|
|
123
|
+
["pointerenter", (e) => latest.current.enter(e)],
|
|
124
|
+
["pointerleave", (e) => latest.current.leave(e)],
|
|
125
|
+
["focus", (e) => latest.current.focus(e)],
|
|
126
|
+
["blur", (e) => latest.current.blur(e)],
|
|
127
|
+
["keydown", (e) => latest.current.key(e)]
|
|
128
|
+
];
|
|
129
|
+
for (const [t, f] of on) anchor.addEventListener(t, f);
|
|
130
|
+
return () => {
|
|
131
|
+
for (const [t, f] of on) anchor.removeEventListener(t, f);
|
|
132
|
+
};
|
|
133
|
+
}, [anchor]);
|
|
134
|
+
const triggerRef = isValidElement(trigger) ? trigger.props.ref : void 0;
|
|
135
|
+
const setTriggerRef = useCallback(
|
|
136
|
+
(el) => {
|
|
137
|
+
setAnchor(el);
|
|
138
|
+
assignRef(triggerRef, el);
|
|
139
|
+
},
|
|
140
|
+
[triggerRef]
|
|
141
|
+
);
|
|
142
|
+
const triggerNode = isValidElement(trigger) ? cloneElement(trigger, {
|
|
143
|
+
ref: setTriggerRef,
|
|
144
|
+
"aria-describedby": isOpen ? id : void 0,
|
|
145
|
+
"data-state": isOpen ? "open" : "closed"
|
|
146
|
+
}) : trigger;
|
|
147
|
+
const onCardKey = (e) => {
|
|
148
|
+
if (e.key === "Escape") {
|
|
149
|
+
e.stopPropagation();
|
|
150
|
+
setOpen(false);
|
|
151
|
+
anchor?.focus({ preventScroll: true });
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
if (e.key !== "Tab") return;
|
|
155
|
+
const items = focusables();
|
|
156
|
+
const at = document.activeElement;
|
|
157
|
+
if (e.shiftKey && at === items[0]) {
|
|
158
|
+
e.preventDefault();
|
|
159
|
+
anchor?.focus({ preventScroll: true });
|
|
160
|
+
} else if (!e.shiftKey && at === items[items.length - 1]) {
|
|
161
|
+
setOpen(false);
|
|
162
|
+
anchor?.focus({ preventScroll: true });
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
166
|
+
triggerNode,
|
|
167
|
+
present && typeof document !== "undefined" && createPortal(
|
|
168
|
+
/* @__PURE__ */ jsxs(
|
|
169
|
+
"div",
|
|
170
|
+
{
|
|
171
|
+
ref: card,
|
|
172
|
+
id,
|
|
173
|
+
role: "dialog",
|
|
174
|
+
"aria-modal": "false",
|
|
175
|
+
"aria-label": label,
|
|
176
|
+
"data-state": isOpen ? "open" : "closed",
|
|
177
|
+
onPointerEnter: (e) => {
|
|
178
|
+
if (e.pointerType === "mouse") hold();
|
|
179
|
+
},
|
|
180
|
+
onPointerLeave: (e) => {
|
|
181
|
+
if (e.pointerType === "mouse") later(false);
|
|
182
|
+
},
|
|
183
|
+
onFocus: hold,
|
|
184
|
+
onBlur: (e) => onBlurOut(e.relatedTarget),
|
|
185
|
+
onKeyDown: onCardKey,
|
|
186
|
+
onAnimationEnd: (e) => {
|
|
187
|
+
if (e.target === e.currentTarget && !isOpen) setPresent(false);
|
|
188
|
+
},
|
|
189
|
+
className: cx(
|
|
190
|
+
"fixed left-0 top-0 z-50 w-[300px] max-w-[calc(100vw-16px)] rounded-xl bg-paper p-4 text-ink outline-none",
|
|
191
|
+
"shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_10%,transparent),0_18px_44px_-16px_rgb(0_0_0/0.32),0_4px_10px_-6px_rgb(0_0_0/0.12)]",
|
|
192
|
+
// An invisible bridge over the gap, so the pointer can cross from the link without the card closing.
|
|
193
|
+
"before:absolute before:inset-x-0 before:h-[var(--asta-hc-gap,10px)] before:content-[''] data-[side=bottom]:before:bottom-full data-[side=top]:before:top-full",
|
|
194
|
+
"animate-[asta-hovercard-in_.28s_cubic-bezier(.16,1,.3,1)_both] data-[state=closed]:animate-[asta-hovercard-out_.14s_ease-in_both]",
|
|
195
|
+
"data-[state=closed]:pointer-events-none motion-reduce:![animation-duration:1ms]",
|
|
196
|
+
className
|
|
197
|
+
),
|
|
198
|
+
children: [
|
|
199
|
+
/* @__PURE__ */ jsx("style", { href: "asta-hover-card", precedence: "asta", children: KEYFRAMES }),
|
|
200
|
+
children
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
),
|
|
204
|
+
document.body
|
|
205
|
+
)
|
|
206
|
+
] });
|
|
207
|
+
}
|
|
208
|
+
var hover_card_default = HoverCard;
|
|
209
|
+
|
|
210
|
+
export {
|
|
211
|
+
HoverCard,
|
|
212
|
+
hover_card_default
|
|
213
|
+
};
|