@kumix/ui 0.3.0 → 0.3.2
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/README.md +46 -17
- package/dist/components/agents/agent-activity/activity-row.d.ts +8 -0
- package/dist/components/agents/agent-activity/activity-row.d.ts.map +1 -0
- package/dist/components/agents/agent-activity/activity-row.js +228 -0
- package/dist/components/agents/agent-activity/activity-row.js.map +1 -0
- package/dist/components/agents/agent-activity/index.d.ts +6 -0
- package/dist/components/agents/agent-activity/index.d.ts.map +1 -0
- package/dist/components/agents/agent-activity/index.js +182 -0
- package/dist/components/agents/agent-activity/index.js.map +1 -0
- package/dist/components/agents/agent-code.d.ts +25 -0
- package/dist/components/agents/agent-code.d.ts.map +1 -0
- package/dist/components/agents/agent-code.js +117 -0
- package/dist/components/agents/agent-code.js.map +1 -0
- package/dist/components/agents/agent-disclosure.d.ts +12 -0
- package/dist/components/agents/agent-disclosure.d.ts.map +1 -0
- package/dist/components/agents/agent-disclosure.js +36 -0
- package/dist/components/agents/agent-disclosure.js.map +1 -0
- package/dist/components/agents/ai-sidebar.d.ts +41 -0
- package/dist/components/agents/ai-sidebar.d.ts.map +1 -0
- package/dist/components/agents/ai-sidebar.js +576 -0
- package/dist/components/agents/ai-sidebar.js.map +1 -0
- package/dist/components/agents/approval-card/index.d.ts +51 -0
- package/dist/components/agents/approval-card/index.d.ts.map +1 -0
- package/dist/components/agents/approval-card/index.js +317 -0
- package/dist/components/agents/approval-card/index.js.map +1 -0
- package/dist/components/agents/chat-app.d.ts +10 -0
- package/dist/components/agents/chat-app.d.ts.map +1 -0
- package/dist/components/agents/chat-app.js +20 -0
- package/dist/components/agents/chat-app.js.map +1 -0
- package/dist/components/agents/citations.d.ts +45 -0
- package/dist/components/agents/citations.d.ts.map +1 -0
- package/dist/components/agents/citations.js +175 -0
- package/dist/components/agents/citations.js.map +1 -0
- package/dist/components/agents/code-block.d.ts +21 -0
- package/dist/components/agents/code-block.d.ts.map +1 -0
- package/dist/components/agents/code-block.js +113 -0
- package/dist/components/agents/code-block.js.map +1 -0
- package/dist/components/agents/file-diff.d.ts +30 -0
- package/dist/components/agents/file-diff.d.ts.map +1 -0
- package/dist/components/agents/file-diff.js +186 -0
- package/dist/components/agents/file-diff.js.map +1 -0
- package/dist/components/agents/image-generation.d.ts +27 -0
- package/dist/components/agents/image-generation.d.ts.map +1 -0
- package/dist/components/agents/image-generation.js +308 -0
- package/dist/components/agents/image-generation.js.map +1 -0
- package/dist/components/agents/loading-states/agent-progress.d.ts +16 -0
- package/dist/components/agents/loading-states/agent-progress.d.ts.map +1 -0
- package/dist/components/agents/loading-states/agent-progress.js +117 -0
- package/dist/components/agents/loading-states/agent-progress.js.map +1 -0
- package/dist/components/agents/loading-states/reasoning-text.d.ts +20 -0
- package/dist/components/agents/loading-states/reasoning-text.d.ts.map +1 -0
- package/dist/components/agents/loading-states/reasoning-text.js +184 -0
- package/dist/components/agents/loading-states/reasoning-text.js.map +1 -0
- package/dist/components/agents/loading-states/thinking-shimmer.d.ts +13 -0
- package/dist/components/agents/loading-states/thinking-shimmer.d.ts.map +1 -0
- package/dist/components/agents/loading-states/thinking-shimmer.js +17 -0
- package/dist/components/agents/loading-states/thinking-shimmer.js.map +1 -0
- package/dist/components/agents/message-bubble.d.ts +38 -0
- package/dist/components/agents/message-bubble.d.ts.map +1 -0
- package/dist/components/agents/message-bubble.js +182 -0
- package/dist/components/agents/message-bubble.js.map +1 -0
- package/dist/components/agents/message-context.d.ts +6 -0
- package/dist/components/agents/message-context.d.ts.map +1 -0
- package/dist/components/agents/message-context.js +8 -0
- package/dist/components/agents/message-context.js.map +1 -0
- package/dist/components/agents/message-scroller.d.ts +30 -0
- package/dist/components/agents/message-scroller.d.ts.map +1 -0
- package/dist/components/agents/message-scroller.js +314 -0
- package/dist/components/agents/message-scroller.js.map +1 -0
- package/dist/components/agents/message.d.ts +37 -0
- package/dist/components/agents/message.d.ts.map +1 -0
- package/dist/components/agents/message.js +139 -0
- package/dist/components/agents/message.js.map +1 -0
- package/dist/components/agents/prompt-input.d.ts +37 -0
- package/dist/components/agents/prompt-input.d.ts.map +1 -0
- package/dist/components/agents/prompt-input.js +216 -0
- package/dist/components/agents/prompt-input.js.map +1 -0
- package/dist/components/agents/streaming-response.d.ts +35 -0
- package/dist/components/agents/streaming-response.d.ts.map +1 -0
- package/dist/components/agents/streaming-response.js +151 -0
- package/dist/components/agents/streaming-response.js.map +1 -0
- package/dist/components/agents/todo-list.d.ts +24 -0
- package/dist/components/agents/todo-list.d.ts.map +1 -0
- package/dist/components/agents/todo-list.js +334 -0
- package/dist/components/agents/todo-list.js.map +1 -0
- package/dist/components/agents/tool-approval.d.ts +33 -0
- package/dist/components/agents/tool-approval.d.ts.map +1 -0
- package/dist/components/agents/tool-approval.js +166 -0
- package/dist/components/agents/tool-approval.js.map +1 -0
- package/dist/components/agents/tool-result.d.ts +34 -0
- package/dist/components/agents/tool-result.d.ts.map +1 -0
- package/dist/components/agents/tool-result.js +220 -0
- package/dist/components/agents/tool-result.js.map +1 -0
- package/dist/components/custom/confirm-dialog.d.ts +16 -0
- package/dist/components/custom/confirm-dialog.d.ts.map +1 -0
- package/dist/components/custom/confirm-dialog.js +93 -0
- package/dist/components/custom/confirm-dialog.js.map +1 -0
- package/dist/components/custom/toast.d.ts +20 -0
- package/dist/components/custom/toast.d.ts.map +1 -0
- package/dist/components/custom/toast.js +73 -0
- package/dist/components/custom/toast.js.map +1 -0
- package/dist/components/motion/action-swap.js +1 -1
- package/dist/components/motion/animated-badge.js +1 -1
- package/dist/components/motion/animated-number.js +1 -1
- package/dist/components/motion/animated-sidebar.d.ts.map +1 -1
- package/dist/components/motion/animated-sidebar.js +3 -3
- package/dist/components/motion/animated-sidebar.js.map +1 -1
- package/dist/components/motion/animated-toast-stack.js +1 -1
- package/dist/components/motion/attachment-upload.d.ts +47 -0
- package/dist/components/motion/attachment-upload.d.ts.map +1 -0
- package/dist/components/motion/attachment-upload.js +737 -0
- package/dist/components/motion/attachment-upload.js.map +1 -0
- package/dist/components/motion/availability-scheduler/copy-menu.d.ts +10 -0
- package/dist/components/motion/availability-scheduler/copy-menu.d.ts.map +1 -0
- package/dist/components/motion/availability-scheduler/copy-menu.js +3 -0
- package/dist/components/motion/availability-scheduler/day-row.d.ts +15 -0
- package/dist/components/motion/availability-scheduler/day-row.d.ts.map +1 -0
- package/dist/components/motion/availability-scheduler/day-row.js +181 -0
- package/dist/components/motion/availability-scheduler/day-row.js.map +1 -0
- package/dist/components/motion/availability-scheduler/icon-button.d.ts +15 -0
- package/dist/components/motion/availability-scheduler/icon-button.d.ts.map +1 -0
- package/dist/components/motion/availability-scheduler/icon-button.js +24 -0
- package/dist/components/motion/availability-scheduler/icon-button.js.map +1 -0
- package/dist/components/motion/availability-scheduler/index.d.ts +14 -0
- package/dist/components/motion/availability-scheduler/index.d.ts.map +1 -0
- package/dist/components/motion/availability-scheduler/index.js +59 -0
- package/dist/components/motion/availability-scheduler/index.js.map +1 -0
- package/dist/components/motion/availability-scheduler/time-select.d.ts +10 -0
- package/dist/components/motion/availability-scheduler/time-select.d.ts.map +1 -0
- package/dist/components/motion/availability-scheduler/time-select.js +26 -0
- package/dist/components/motion/availability-scheduler/time-select.js.map +1 -0
- package/dist/components/motion/bloom-menu.d.ts +17 -0
- package/dist/components/motion/bloom-menu.d.ts.map +1 -0
- package/dist/components/motion/bloom-menu.js +170 -0
- package/dist/components/motion/bloom-menu.js.map +1 -0
- package/dist/components/motion/bottom-sheet.js +1 -1
- package/dist/components/motion/bounce-sidebar.js +1 -1
- package/dist/components/motion/bouncy-accordion.js +1 -1
- package/dist/components/motion/button/base.js +1 -1
- package/dist/components/motion/button/index.d.ts +4 -0
- package/dist/components/motion/button/index.js +5 -0
- package/dist/components/motion/button/magnetic.js +1 -1
- package/dist/components/motion/button/stateful.js +1 -1
- package/dist/components/motion/center-morph-modal.js +3 -3
- package/dist/components/motion/center-morph-modal.js.map +1 -1
- package/dist/components/motion/checkbox.js +1 -1
- package/dist/components/motion/chromatic-text-reveal.js +2 -2
- package/dist/components/motion/chromatic-text-reveal.js.map +1 -1
- package/dist/components/motion/command-palette.d.ts +26 -0
- package/dist/components/motion/command-palette.d.ts.map +1 -0
- package/dist/components/motion/command-palette.js +250 -0
- package/dist/components/motion/command-palette.js.map +1 -0
- package/dist/components/motion/context-menu.js +1 -1
- package/dist/components/motion/cylinder-carousel.js +1 -1
- package/dist/components/motion/dock.js +1 -1
- package/dist/components/motion/drawer.js +1 -1
- package/dist/components/motion/dynamic-island.d.ts +22 -0
- package/dist/components/motion/dynamic-island.d.ts.map +1 -0
- package/dist/components/motion/dynamic-island.js +143 -0
- package/dist/components/motion/dynamic-island.js.map +1 -0
- package/dist/components/motion/expandable-action-bar.d.ts +52 -0
- package/dist/components/motion/expandable-action-bar.d.ts.map +1 -0
- package/dist/components/motion/expandable-action-bar.js +191 -0
- package/dist/components/motion/expandable-action-bar.js.map +1 -0
- package/dist/components/motion/expandable-tabs.d.ts +33 -0
- package/dist/components/motion/expandable-tabs.d.ts.map +1 -0
- package/dist/components/motion/expandable-tabs.js +291 -0
- package/dist/components/motion/expandable-tabs.js.map +1 -0
- package/dist/components/motion/feedback-widget.d.ts +18 -0
- package/dist/components/motion/feedback-widget.d.ts.map +1 -0
- package/dist/components/motion/feedback-widget.js +413 -0
- package/dist/components/motion/feedback-widget.js.map +1 -0
- package/dist/components/motion/file-upload.d.ts +48 -0
- package/dist/components/motion/file-upload.d.ts.map +1 -0
- package/dist/components/motion/file-upload.js +382 -0
- package/dist/components/motion/file-upload.js.map +1 -0
- package/dist/components/motion/hold-action-button.js +1 -1
- package/dist/components/motion/infinite-masonry.d.ts +31 -0
- package/dist/components/motion/infinite-masonry.d.ts.map +1 -0
- package/dist/components/motion/infinite-masonry.js +223 -0
- package/dist/components/motion/infinite-masonry.js.map +1 -0
- package/dist/components/motion/input.js +1 -1
- package/dist/components/motion/loader.js +1 -1
- package/dist/components/motion/magnetic.js +1 -1
- package/dist/components/motion/morphing-modal.js +1 -1
- package/dist/components/motion/not-found/glitch.d.ts +6 -0
- package/dist/components/motion/not-found/glitch.d.ts.map +1 -0
- package/dist/components/motion/not-found/glitch.js +90 -0
- package/dist/components/motion/not-found/glitch.js.map +1 -0
- package/dist/components/motion/not-found/magnetic.d.ts +6 -0
- package/dist/components/motion/not-found/magnetic.d.ts.map +1 -0
- package/dist/components/motion/not-found/magnetic.js +47 -0
- package/dist/components/motion/not-found/magnetic.js.map +1 -0
- package/dist/components/motion/not-found/shared.d.ts +32 -0
- package/dist/components/motion/not-found/shared.d.ts.map +1 -0
- package/dist/components/motion/not-found/shared.js +52 -0
- package/dist/components/motion/not-found/shared.js.map +1 -0
- package/dist/components/motion/not-found/spotlight.d.ts +6 -0
- package/dist/components/motion/not-found/spotlight.d.ts.map +1 -0
- package/dist/components/motion/not-found/spotlight.js +70 -0
- package/dist/components/motion/not-found/spotlight.js.map +1 -0
- package/dist/components/motion/not-found/stacked.d.ts +6 -0
- package/dist/components/motion/not-found/stacked.d.ts.map +1 -0
- package/dist/components/motion/not-found/stacked.js +95 -0
- package/dist/components/motion/not-found/stacked.js.map +1 -0
- package/dist/components/motion/not-found/terminal.d.ts +6 -0
- package/dist/components/motion/not-found/terminal.d.ts.map +1 -0
- package/dist/components/motion/not-found/terminal.js +90 -0
- package/dist/components/motion/not-found/terminal.js.map +1 -0
- package/dist/components/motion/notification-stack.d.ts +35 -0
- package/dist/components/motion/notification-stack.d.ts.map +1 -0
- package/dist/components/motion/notification-stack.js +187 -0
- package/dist/components/motion/notification-stack.js.map +1 -0
- package/dist/components/motion/number-ticker.js +1 -1
- package/dist/components/motion/otp-input.d.ts +32 -0
- package/dist/components/motion/otp-input.d.ts.map +1 -0
- package/dist/components/motion/otp-input.js +272 -0
- package/dist/components/motion/otp-input.js.map +1 -0
- package/dist/components/motion/overflow-actions.d.ts +39 -0
- package/dist/components/motion/overflow-actions.d.ts.map +1 -0
- package/dist/components/motion/overflow-actions.js +220 -0
- package/dist/components/motion/overflow-actions.js.map +1 -0
- package/dist/components/motion/parallax.js +1 -1
- package/dist/components/motion/popover-morph.js +2 -2
- package/dist/components/motion/popover-morph.js.map +1 -1
- package/dist/components/motion/popover.js +1 -1
- package/dist/components/motion/preview-rail.d.ts +10 -2
- package/dist/components/motion/preview-rail.d.ts.map +1 -1
- package/dist/components/motion/preview-rail.js +58 -27
- package/dist/components/motion/preview-rail.js.map +1 -1
- package/dist/components/motion/pull-to-refresh.js +2 -2
- package/dist/components/motion/pull-to-refresh.js.map +1 -1
- package/dist/components/motion/radio.js +1 -1
- package/dist/components/motion/range-slider-bubble.js +1 -1
- package/dist/components/motion/range-slider-fluid.js +1 -1
- package/dist/components/motion/range-slider-ruler.js +2 -2
- package/dist/components/motion/range-slider-ruler.js.map +1 -1
- package/dist/components/motion/range-slider-wave.js +1 -1
- package/dist/components/motion/range-slider.js +1 -1
- package/dist/components/motion/scroll-progress.js +1 -1
- package/dist/components/motion/scroll-reveal.js +1 -1
- package/dist/components/motion/select-morph.js +1 -1
- package/dist/components/motion/select.js +1 -1
- package/dist/components/motion/shader-background.js +1 -1
- package/dist/components/motion/shared-layout-bg.js +2 -2
- package/dist/components/motion/shared-layout-bg.js.map +1 -1
- package/dist/components/motion/slide-action-button.js +1 -1
- package/dist/components/motion/smooth-scroll.js +1 -1
- package/dist/components/motion/swipeable-list.d.ts +60 -0
- package/dist/components/motion/swipeable-list.d.ts.map +1 -0
- package/dist/components/motion/swipeable-list.js +254 -0
- package/dist/components/motion/swipeable-list.js.map +1 -0
- package/dist/components/motion/switch.js +1 -1
- package/dist/components/motion/table/index.js +1 -1
- package/dist/components/motion/table/table-header.js +1 -1
- package/dist/components/motion/table/table-menu.js +1 -1
- package/dist/components/motion/tabs.js +1 -1
- package/dist/components/motion/text-reveal.js +1 -1
- package/dist/components/motion/text-shimmer.d.ts.map +1 -1
- package/dist/components/motion/text-shimmer.js +4 -3
- package/dist/components/motion/text-shimmer.js.map +1 -1
- package/dist/components/motion/theme-toggle.js +1 -1
- package/dist/components/motion/tilt-card.js +1 -1
- package/dist/components/motion/tooltip.js +1 -1
- package/dist/components/motion/wheel-picker.js +1 -1
- package/dist/components/reui/alert.d.ts +1 -1
- package/dist/components/reui/badge.d.ts +1 -1
- package/dist/components/reui/data-grid/data-grid-column-filter.d.ts +4 -3
- package/dist/components/reui/data-grid/data-grid-column-filter.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-filter.js +1 -2
- package/dist/components/reui/data-grid/data-grid-column-filter.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-header.d.ts +15 -4
- package/dist/components/reui/data-grid/data-grid-column-header.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-header.js +35 -7
- package/dist/components/reui/data-grid/data-grid-column-header.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-visibility.d.ts +3 -2
- package/dist/components/reui/data-grid/data-grid-column-visibility.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-visibility.js +0 -1
- package/dist/components/reui/data-grid/data-grid-column-visibility.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-pagination.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-pagination.js +2 -3
- package/dist/components/reui/data-grid/data-grid-pagination.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-scroll-area.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-scroll-area.js +12 -7
- package/dist/components/reui/data-grid/data-grid-scroll-area.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.d.ts +71 -4
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js +146 -39
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd.d.ts +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd.js +4 -5
- package/dist/components/reui/data-grid/data-grid-table-dnd.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-virtual.d.ts +6 -5
- package/dist/components/reui/data-grid/data-grid-table-virtual.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-virtual.js +9 -10
- package/dist/components/reui/data-grid/data-grid-table-virtual.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table.d.ts +60 -33
- package/dist/components/reui/data-grid/data-grid-table.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table.js +153 -69
- package/dist/components/reui/data-grid/data-grid-table.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid.d.ts +105 -20
- package/dist/components/reui/data-grid/data-grid.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid.js +83 -10
- package/dist/components/reui/data-grid/data-grid.js.map +1 -1
- package/dist/components/reui/date-selector.js +47 -44
- package/dist/components/reui/date-selector.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-dnd.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-dnd.js +20 -2
- package/dist/components/reui/event-calendar/event-calendar-dnd.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-recurrence.js +7 -5
- package/dist/components/reui/event-calendar/event-calendar-recurrence.js.map +1 -1
- package/dist/components/reui/filters.js +26 -21
- package/dist/components/reui/filters.js.map +1 -1
- package/dist/components/reui/frame.d.ts +1 -1
- package/dist/components/reui/gantt/gantt-view.js +1 -1
- package/dist/components/reui/icon-tile.d.ts +1 -1
- package/dist/components/reui/icon-tile.d.ts.map +1 -1
- package/dist/components/reui/icon-tile.js +8 -1
- package/dist/components/reui/icon-tile.js.map +1 -1
- package/dist/components/reui/phone-input.js +1 -1
- package/dist/components/reui/sortable.js +13 -11
- package/dist/components/reui/sortable.js.map +1 -1
- package/dist/components/ui/attachment.d.ts +1 -1
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/field.d.ts +1 -1
- package/dist/components/ui/item.d.ts +1 -1
- package/dist/components/ui/questionnaire.d.ts +21 -0
- package/dist/components/ui/questionnaire.d.ts.map +1 -0
- package/dist/components/ui/questionnaire.js +164 -0
- package/dist/components/ui/questionnaire.js.map +1 -0
- package/dist/copy-menu-Bk5GP9Gp.js +201 -0
- package/dist/copy-menu-Bk5GP9Gp.js.map +1 -0
- package/dist/hooks/use-body-classes.d.ts +0 -3
- package/dist/hooks/use-body-classes.d.ts.map +1 -1
- package/dist/hooks/use-body-classes.js +0 -3
- package/dist/hooks/use-body-classes.js.map +1 -1
- package/dist/hooks/use-copy-to-clipboard.d.ts +0 -3
- package/dist/hooks/use-copy-to-clipboard.d.ts.map +1 -1
- package/dist/hooks/use-copy-to-clipboard.js +0 -3
- package/dist/hooks/use-copy-to-clipboard.js.map +1 -1
- package/dist/hooks/use-file-upload.js +6 -4
- package/dist/hooks/use-file-upload.js.map +1 -1
- package/dist/hooks/use-hydrated.d.ts +0 -10
- package/dist/hooks/use-hydrated.d.ts.map +1 -1
- package/dist/hooks/use-hydrated.js +0 -10
- package/dist/hooks/use-hydrated.js.map +1 -1
- package/dist/hooks/use-intersection-observer.d.ts.map +1 -1
- package/dist/hooks/use-intersection-observer.js +0 -5
- package/dist/hooks/use-intersection-observer.js.map +1 -1
- package/dist/hooks/use-is-mac.d.ts +0 -5
- package/dist/hooks/use-is-mac.d.ts.map +1 -1
- package/dist/hooks/use-is-mac.js +0 -5
- package/dist/hooks/use-is-mac.js.map +1 -1
- package/dist/hooks/use-media-query.d.ts +0 -5
- package/dist/hooks/use-media-query.d.ts.map +1 -1
- package/dist/hooks/use-media-query.js +0 -5
- package/dist/hooks/use-media-query.js.map +1 -1
- package/dist/hooks/use-meta-color.d.ts.map +1 -1
- package/dist/hooks/use-meta-color.js +0 -3
- package/dist/hooks/use-meta-color.js.map +1 -1
- package/dist/hooks/use-mutation-observer.d.ts.map +1 -1
- package/dist/hooks/use-mutation-observer.js +0 -5
- package/dist/hooks/use-mutation-observer.js.map +1 -1
- package/dist/hooks/use-scroll-position.d.ts.map +1 -1
- package/dist/hooks/use-scroll-position.js +0 -5
- package/dist/hooks/use-scroll-position.js.map +1 -1
- package/dist/hooks/use-slider-input.d.ts.map +1 -1
- package/dist/hooks/use-slider-input.js +0 -5
- package/dist/hooks/use-slider-input.js.map +1 -1
- package/dist/hooks/use-viewport.d.ts +0 -5
- package/dist/hooks/use-viewport.d.ts.map +1 -1
- package/dist/hooks/use-viewport.js +0 -5
- package/dist/hooks/use-viewport.js.map +1 -1
- package/dist/lib/favicon.d.ts +5 -0
- package/dist/lib/favicon.d.ts.map +1 -0
- package/dist/lib/favicon.js +12 -0
- package/dist/lib/favicon.js.map +1 -0
- package/dist/lib/text-shimmer.d.ts +8 -0
- package/dist/lib/text-shimmer.d.ts.map +1 -0
- package/dist/lib/text-shimmer.js +10 -0
- package/dist/lib/text-shimmer.js.map +1 -0
- package/dist/types-j36vVGtZ.d.ts +78 -0
- package/dist/types-j36vVGtZ.d.ts.map +1 -0
- package/dist/types-smkWN_7x.d.ts +20 -0
- package/dist/types-smkWN_7x.d.ts.map +1 -0
- package/package.json +18 -13
- package/dist/components/ui/sonner.d.ts +0 -7
- package/dist/components/ui/sonner.d.ts.map +0 -1
- package/dist/components/ui/sonner.js +0 -32
- package/dist/components/ui/sonner.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useSmoothScroll } from "./smooth-scroll.js";
|
|
3
3
|
import { cn } from "@kumix/utils";
|
|
4
|
-
import { motion, useReducedMotion, useSpring, useTransform } from "motion/react";
|
|
5
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { motion, useReducedMotion, useSpring, useTransform } from "motion/react";
|
|
6
6
|
//#region src/components/motion/scroll-progress.tsx
|
|
7
7
|
const PROGRESS_SPRING = {
|
|
8
8
|
stiffness: 120,
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { EASE_OUT } from "../../lib/ease.js";
|
|
3
3
|
import { useRef } from "react";
|
|
4
4
|
import { cn } from "@kumix/utils";
|
|
5
|
-
import { motion, useInView, useReducedMotion } from "motion/react";
|
|
6
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { motion, useInView, useReducedMotion } from "motion/react";
|
|
7
7
|
//#region src/components/motion/scroll-reveal.tsx
|
|
8
8
|
function ScrollReveal({ children, y = 16, blur = 8, duration = .6, delay = 0, once = true, amount = .3, root, className }) {
|
|
9
9
|
const reduce = useReducedMotion();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createContext, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { cn } from "@kumix/utils";
|
|
4
|
-
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
5
4
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
6
6
|
import { Check, ChevronDown } from "lucide-react";
|
|
7
7
|
//#region src/components/motion/select-morph.tsx
|
|
8
8
|
const MORPH = {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { EASE_OUT } from "../../lib/ease.js";
|
|
3
3
|
import { createContext, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { cn } from "@kumix/utils";
|
|
5
|
-
import { motion, useReducedMotion } from "motion/react";
|
|
6
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { motion, useReducedMotion } from "motion/react";
|
|
7
7
|
import { Check, ChevronDown } from "lucide-react";
|
|
8
8
|
//#region src/components/motion/select.tsx
|
|
9
9
|
const INSTANT_TRANSITION = { duration: 0 };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "@kumix/utils";
|
|
3
|
-
import { useReducedMotion } from "motion/react";
|
|
4
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { useReducedMotion } from "motion/react";
|
|
5
5
|
import { ColorPanels, Dithering, DotGrid, DotOrbit, GodRays, GrainGradient, MeshGradient, Metaballs, NeuroNoise, PerlinNoise, PulsingBorder, SimplexNoise, SmokeRing, Spiral, StaticMeshGradient, StaticRadialGradient, Swirl, Voronoi, Warp, Water, Waves } from "@paper-design/shaders-react";
|
|
6
6
|
//#region src/components/motion/shader-background.tsx
|
|
7
7
|
const VARIANT_COMPONENTS = {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { SPRING_LAYOUT } from "../../lib/ease.js";
|
|
3
3
|
import { Children, cloneElement, forwardRef, isValidElement, useId, useState } from "react";
|
|
4
4
|
import { cn } from "@kumix/utils";
|
|
5
|
-
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
6
5
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
7
7
|
//#region src/components/motion/shared-layout-bg.tsx
|
|
8
8
|
const variants = {
|
|
9
9
|
initial: {
|
|
@@ -54,7 +54,7 @@ const SharedLayoutBg = forwardRef(function SharedLayoutBg({ children, as = "div"
|
|
|
54
54
|
children: activeId === childKey ? /* @__PURE__ */ jsx(motion.div, {
|
|
55
55
|
layoutId: `shared-bg-${uid}`,
|
|
56
56
|
transition: reduce ? { duration: 0 } : SPRING_LAYOUT,
|
|
57
|
-
className: cn("pointer-events-none h-full w-full rounded-2xl bg-primary/
|
|
57
|
+
className: cn("pointer-events-none h-full w-full rounded-2xl bg-primary/6", pillClassName)
|
|
58
58
|
}) : null
|
|
59
59
|
}) : null
|
|
60
60
|
}), /* @__PURE__ */ jsx("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-layout-bg.js","names":[],"sources":["../../../src/components/motion/shared-layout-bg.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Children,\n cloneElement,\n forwardRef,\n type HTMLAttributes,\n isValidElement,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n useId,\n useState,\n} from \"react\";\nimport {\n AnimatePresence,\n type HTMLMotionProps,\n motion,\n useReducedMotion,\n type Variants,\n} from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { SPRING_LAYOUT } from \"../../lib/ease\";\n\nexport interface SharedLayoutBgProps extends Omit<HTMLAttributes<HTMLElement>, \"children\"> {\n children: ReactNode;\n /** Semantic container used for the children. */\n as?: \"div\" | \"ul\";\n /** Tailwind class applied to the moving pill. Defaults to a subtle foreground tint. */\n pillClassName?: string;\n /** Horizontal inset of the pill relative to each row (px). Default 20. */\n inset?: number;\n /** Optional positioning override for the pill wrapper inside each item. */\n pillContainerClassName?: string;\n}\n\nconst variants: Variants = {\n initial: { opacity: 0, filter: \"blur(6px)\" },\n animate: { opacity: 1, filter: \"blur(0px)\" },\n exit: (isActive: boolean) => (!isActive ? { opacity: 0, filter: \"blur(6px)\" } : {}),\n};\n\nconst reducedVariants: Variants = {\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n exit: (isActive: boolean) => (!isActive ? { opacity: 0 } : {}),\n};\n\nexport const SharedLayoutBg = forwardRef<HTMLElement, SharedLayoutBgProps>(function SharedLayoutBg(\n {\n children,\n as = \"div\",\n className,\n onMouseLeave,\n pillClassName,\n pillContainerClassName,\n inset = 20,\n ...props\n },\n forwardedRef,\n) {\n const [activeId, setActiveId] = useState<string | null>(null);\n const uid = useId();\n const reduce = useReducedMotion();\n\n const renderedChildren = Children.toArray(children)\n .filter(isValidElement)\n .map((child, index) => {\n const el = child as ReactElement<{\n className?: string;\n onMouseEnter?: () => void;\n children?: ReactNode;\n }>;\n const childKey = el.key ? String(el.key) : `item-${index}`;\n return cloneElement(\n el,\n {\n key: childKey,\n className: cn(\"relative\", el.props.className),\n onMouseEnter: () => {\n el.props.onMouseEnter?.();\n setActiveId(childKey);\n },\n },\n <>\n <AnimatePresence custom={activeId !== null}>\n {activeId !== null ? (\n <motion.div\n variants={reduce ? reducedVariants : variants}\n initial=\"initial\"\n animate=\"animate\"\n exit=\"exit\"\n custom={activeId !== null}\n className={cn(\"pointer-events-none absolute inset-y-0\", pillContainerClassName)}\n style={{ left: -inset, right: -inset }}\n >\n {activeId === childKey ? (\n <motion.div\n layoutId={`shared-bg-${uid}`}\n transition={reduce ? { duration: 0 } : SPRING_LAYOUT}\n className={cn(\n \"pointer-events-none h-full w-full rounded-2xl bg-primary/
|
|
1
|
+
{"version":3,"file":"shared-layout-bg.js","names":[],"sources":["../../../src/components/motion/shared-layout-bg.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Children,\n cloneElement,\n forwardRef,\n type HTMLAttributes,\n isValidElement,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n useId,\n useState,\n} from \"react\";\nimport {\n AnimatePresence,\n type HTMLMotionProps,\n motion,\n useReducedMotion,\n type Variants,\n} from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { SPRING_LAYOUT } from \"../../lib/ease\";\n\nexport interface SharedLayoutBgProps extends Omit<HTMLAttributes<HTMLElement>, \"children\"> {\n children: ReactNode;\n /** Semantic container used for the children. */\n as?: \"div\" | \"ul\";\n /** Tailwind class applied to the moving pill. Defaults to a subtle foreground tint. */\n pillClassName?: string;\n /** Horizontal inset of the pill relative to each row (px). Default 20. */\n inset?: number;\n /** Optional positioning override for the pill wrapper inside each item. */\n pillContainerClassName?: string;\n}\n\nconst variants: Variants = {\n initial: { opacity: 0, filter: \"blur(6px)\" },\n animate: { opacity: 1, filter: \"blur(0px)\" },\n exit: (isActive: boolean) => (!isActive ? { opacity: 0, filter: \"blur(6px)\" } : {}),\n};\n\nconst reducedVariants: Variants = {\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n exit: (isActive: boolean) => (!isActive ? { opacity: 0 } : {}),\n};\n\nexport const SharedLayoutBg = forwardRef<HTMLElement, SharedLayoutBgProps>(function SharedLayoutBg(\n {\n children,\n as = \"div\",\n className,\n onMouseLeave,\n pillClassName,\n pillContainerClassName,\n inset = 20,\n ...props\n },\n forwardedRef,\n) {\n const [activeId, setActiveId] = useState<string | null>(null);\n const uid = useId();\n const reduce = useReducedMotion();\n\n const renderedChildren = Children.toArray(children)\n .filter(isValidElement)\n .map((child, index) => {\n const el = child as ReactElement<{\n className?: string;\n onMouseEnter?: () => void;\n children?: ReactNode;\n }>;\n const childKey = el.key ? String(el.key) : `item-${index}`;\n return cloneElement(\n el,\n {\n key: childKey,\n className: cn(\"relative\", el.props.className),\n onMouseEnter: () => {\n el.props.onMouseEnter?.();\n setActiveId(childKey);\n },\n },\n <>\n <AnimatePresence custom={activeId !== null}>\n {activeId !== null ? (\n <motion.div\n variants={reduce ? reducedVariants : variants}\n initial=\"initial\"\n animate=\"animate\"\n exit=\"exit\"\n custom={activeId !== null}\n className={cn(\"pointer-events-none absolute inset-y-0\", pillContainerClassName)}\n style={{ left: -inset, right: -inset }}\n >\n {activeId === childKey ? (\n <motion.div\n layoutId={`shared-bg-${uid}`}\n transition={reduce ? { duration: 0 } : SPRING_LAYOUT}\n className={cn(\n \"pointer-events-none h-full w-full rounded-2xl bg-primary/6\",\n pillClassName,\n )}\n />\n ) : null}\n </motion.div>\n ) : null}\n </AnimatePresence>\n <div className=\"relative z-10\">{el.props.children}</div>\n </>,\n );\n });\n\n const handleMouseLeave = (event: MouseEvent<HTMLElement>) => {\n setActiveId(null);\n onMouseLeave?.(event);\n };\n\n // layoutRoot scopes the pill's layout projection to this list, so fixed or\n // scrolled ancestors can't smear scroll offsets into its movement.\n return as === \"ul\" ? (\n <motion.ul\n {...(props as HTMLMotionProps<\"ul\">)}\n ref={forwardedRef as Ref<HTMLUListElement>}\n layoutRoot\n onMouseLeave={handleMouseLeave}\n className={cn(\"flex w-full flex-col\", className)}\n >\n {renderedChildren}\n </motion.ul>\n ) : (\n <motion.div\n {...(props as HTMLMotionProps<\"div\">)}\n ref={forwardedRef as Ref<HTMLDivElement>}\n layoutRoot\n onMouseLeave={handleMouseLeave}\n className={cn(\"flex w-full flex-col\", className)}\n >\n {renderedChildren}\n </motion.div>\n );\n});\n"],"mappings":";;;;;;;AAsCA,MAAM,WAAqB;CACzB,SAAS;EAAE,SAAS;EAAG,QAAQ;CAAY;CAC3C,SAAS;EAAE,SAAS;EAAG,QAAQ;CAAY;CAC3C,OAAO,aAAuB,CAAC,WAAW;EAAE,SAAS;EAAG,QAAQ;CAAY,IAAI,CAAC;AACnF;AAEA,MAAM,kBAA4B;CAChC,SAAS,EAAE,SAAS,EAAE;CACtB,SAAS,EAAE,SAAS,EAAE;CACtB,OAAO,aAAuB,CAAC,WAAW,EAAE,SAAS,EAAE,IAAI,CAAC;AAC9D;AAEA,MAAa,iBAAiB,WAA6C,SAAS,eAClF,EACE,UACA,KAAK,OACL,WACA,cACA,eACA,wBACA,QAAQ,IACR,GAAG,SAEL,cACA;CACA,MAAM,CAAC,UAAU,eAAe,SAAwB,IAAI;CAC5D,MAAM,MAAM,MAAM;CAClB,MAAM,SAAS,iBAAiB;CAEhC,MAAM,mBAAmB,SAAS,QAAQ,QAAQ,CAAC,CAChD,OAAO,cAAc,CAAC,CACtB,KAAK,OAAO,UAAU;EACrB,MAAM,KAAK;EAKX,MAAM,WAAW,GAAG,MAAM,OAAO,GAAG,GAAG,IAAI,QAAQ;EACnD,OAAO,aACL,IACA;GACE,KAAK;GACL,WAAW,GAAG,YAAY,GAAG,MAAM,SAAS;GAC5C,oBAAoB;IAClB,GAAG,MAAM,eAAe;IACxB,YAAY,QAAQ;GACtB;EACF,GACA,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,iBAAD;GAAiB,QAAQ,aAAa;GACnC,UAAA,aAAa,OACZ,oBAAC,OAAO,KAAR;IACE,UAAU,SAAS,kBAAkB;IACrC,SAAQ;IACR,SAAQ;IACR,MAAK;IACL,QAAQ,aAAa;IACrB,WAAW,GAAG,0CAA0C,sBAAsB;IAC9E,OAAO;KAAE,MAAM,CAAC;KAAO,OAAO,CAAC;IAAM;IAEpC,UAAA,aAAa,WACZ,oBAAC,OAAO,KAAR;KACE,UAAU,aAAa;KACvB,YAAY,SAAS,EAAE,UAAU,EAAE,IAAI;KACvC,WAAW,GACT,8DACA,aACF;IACD,CAAA,IACC;GACM,CAAA,IACV;EACW,CAAA,GACjB,oBAAC,OAAD;GAAK,WAAU;GAAiB,UAAA,GAAG,MAAM;EAAc,CAAA,CACvD,EAAA,CAAA,CACJ;CACF,CAAC;CAEH,MAAM,oBAAoB,UAAmC;EAC3D,YAAY,IAAI;EAChB,eAAe,KAAK;CACtB;CAIA,OAAO,OAAO,OACZ,oBAAC,OAAO,IAAR;EACE,GAAK;EACL,KAAK;EACL,YAAA;EACA,cAAc;EACd,WAAW,GAAG,wBAAwB,SAAS;EAE9C,UAAA;CACQ,CAAA,IAEX,oBAAC,OAAO,KAAR;EACE,GAAK;EACL,KAAK;EACL,YAAA;EACA,cAAc;EACd,WAAW,GAAG,wBAAwB,SAAS;EAE9C,UAAA;CACS,CAAA;AAEhB,CAAC"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { EASE_OUT, SPRING_LAYOUT, SPRING_PRESS } from "../../lib/ease.js";
|
|
3
3
|
import { useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
4
4
|
import { cn } from "@kumix/utils";
|
|
5
|
-
import { animate, motion, useMotionValue, useReducedMotion, useTransform } from "motion/react";
|
|
6
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { animate, motion, useMotionValue, useReducedMotion, useTransform } from "motion/react";
|
|
7
7
|
//#region src/components/motion/slide-action-button.tsx
|
|
8
8
|
function SlideActionButton({ children, completeLabel = "Complete", threshold = .82, resetDelay = 1200, onComplete, thumbClassName, fillClassName, className, ...rest }) {
|
|
9
9
|
const reduce = useReducedMotion();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createContext, useCallback, useContext, useEffect, useMemo, useRef } from "react";
|
|
3
|
-
import { useMotionValue, useReducedMotion } from "motion/react";
|
|
4
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { useMotionValue, useReducedMotion } from "motion/react";
|
|
5
5
|
import { ReactLenis, useLenis } from "lenis/react";
|
|
6
6
|
//#region src/components/motion/smooth-scroll.tsx
|
|
7
7
|
const EASE_SCROLL = (t) => Math.min(1, 1.001 - 2 ** (-10 * t));
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/components/motion/swipeable-list.d.ts
|
|
3
|
+
type SwipeSide = "left" | "right";
|
|
4
|
+
type SwipeableListValue = {
|
|
5
|
+
id: string;
|
|
6
|
+
side: SwipeSide;
|
|
7
|
+
};
|
|
8
|
+
type SwipeActionTone = "neutral" | "primary" | "success" | "warning" | "danger";
|
|
9
|
+
type SwipeAction = {
|
|
10
|
+
id: string;
|
|
11
|
+
label: ReactNode;
|
|
12
|
+
icon: ReactNode;
|
|
13
|
+
tone?: SwipeActionTone;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
onClick?: (item: SwipeableListItem) => void;
|
|
16
|
+
};
|
|
17
|
+
type SwipeableListItem = {
|
|
18
|
+
id: string;
|
|
19
|
+
title?: ReactNode;
|
|
20
|
+
description?: ReactNode;
|
|
21
|
+
meta?: ReactNode;
|
|
22
|
+
leading?: ReactNode;
|
|
23
|
+
content?: ReactNode;
|
|
24
|
+
leftActions?: SwipeAction[];
|
|
25
|
+
rightActions?: SwipeAction[];
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
};
|
|
28
|
+
type SwipeableListClassNames = {
|
|
29
|
+
root?: string;
|
|
30
|
+
item?: string;
|
|
31
|
+
rail?: string;
|
|
32
|
+
action?: string;
|
|
33
|
+
surface?: string;
|
|
34
|
+
leading?: string;
|
|
35
|
+
content?: string;
|
|
36
|
+
title?: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
meta?: string;
|
|
39
|
+
};
|
|
40
|
+
interface SwipeableListProps {
|
|
41
|
+
items: SwipeableListItem[];
|
|
42
|
+
value?: SwipeableListValue | null;
|
|
43
|
+
defaultValue?: SwipeableListValue | null;
|
|
44
|
+
onValueChange?: (value: SwipeableListValue | null) => void;
|
|
45
|
+
onAction?: (payload: {
|
|
46
|
+
item: SwipeableListItem;
|
|
47
|
+
action: SwipeAction;
|
|
48
|
+
side: SwipeSide;
|
|
49
|
+
}) => void;
|
|
50
|
+
actionWidth?: number;
|
|
51
|
+
revealThreshold?: number;
|
|
52
|
+
closeOnAction?: boolean;
|
|
53
|
+
className?: string;
|
|
54
|
+
classNames?: SwipeableListClassNames;
|
|
55
|
+
renderItem?: (item: SwipeableListItem) => ReactNode;
|
|
56
|
+
}
|
|
57
|
+
declare function SwipeableList({ items, value, defaultValue, onValueChange, onAction, actionWidth, revealThreshold, closeOnAction, className, classNames, renderItem }: SwipeableListProps): import("react").JSX.Element;
|
|
58
|
+
//#endregion
|
|
59
|
+
export { SwipeAction, SwipeActionTone, SwipeSide, SwipeableList, SwipeableListClassNames, SwipeableListItem, SwipeableListProps, SwipeableListValue };
|
|
60
|
+
//# sourceMappingURL=swipeable-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swipeable-list.d.ts","names":[],"sources":["../../../src/components/motion/swipeable-list.tsx"],"mappings":";;KAOY;KAEA;EACV;EACA,MAAM;;KAGI;KAEA;EACV;EACA,OAAO;EACP,MAAM;EACN,OAAO;EACP;EACA,WAAW,MAAM;;KAGP;EACV;EACA,QAAQ;EACR,cAAc;EACd,OAAO;EACP,UAAU;EACV,UAAU;EACV,cAAc;EACd,eAAe;EACf;;KAGU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf,OAAO;EACP,QAAQ;EACR,eAAe;EACf,iBAAiB,OAAO;EACxB,YAAY;IAAW,MAAM;IAAmB,QAAQ;IAAa,MAAM;;EAC3E;EACA;EACA;EACA;EACA,aAAa;EACb,cAAc,MAAM,sBAAsB;;iBAiV5B,gBACd,OACA,OACA,cACA,eACA,UACA,aACA,iBACA,eACA,WACA,YACA,cACC,qCAAkB,IAAA"}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
|
+
import { cn } from "@kumix/utils";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { animate, motion, useMotionValue, useReducedMotion } from "motion/react";
|
|
6
|
+
//#region src/components/motion/swipeable-list.tsx
|
|
7
|
+
const ROW_SETTLE = {
|
|
8
|
+
type: "spring",
|
|
9
|
+
stiffness: 560,
|
|
10
|
+
damping: 48,
|
|
11
|
+
mass: .82,
|
|
12
|
+
restDelta: .5,
|
|
13
|
+
restSpeed: 8
|
|
14
|
+
};
|
|
15
|
+
const OPEN_DISTANCE_RATIO = .46;
|
|
16
|
+
const CLOSE_DISTANCE_RATIO = .72;
|
|
17
|
+
const OPEN_VELOCITY = 720;
|
|
18
|
+
const CLOSE_VELOCITY = 320;
|
|
19
|
+
const FLING_DISTANCE = 14;
|
|
20
|
+
const RELEASE_VELOCITY_LIMIT = 1500;
|
|
21
|
+
const ACTION_TONE_CLASS = {
|
|
22
|
+
neutral: "text-muted-foreground group-hover:text-foreground",
|
|
23
|
+
primary: "text-foreground",
|
|
24
|
+
success: "text-emerald-600 dark:text-emerald-400",
|
|
25
|
+
warning: "text-amber-600 dark:text-amber-400",
|
|
26
|
+
danger: "text-destructive"
|
|
27
|
+
};
|
|
28
|
+
function useControllableSwipeValue({ value, defaultValue, onValueChange }) {
|
|
29
|
+
const [internalValue, setInternalValue] = useState(defaultValue ?? null);
|
|
30
|
+
const isControlled = value !== void 0;
|
|
31
|
+
return [value ?? internalValue, useCallback((next) => {
|
|
32
|
+
if (!isControlled) setInternalValue(next);
|
|
33
|
+
onValueChange?.(next);
|
|
34
|
+
}, [isControlled, onValueChange])];
|
|
35
|
+
}
|
|
36
|
+
function isActionableSide(value, sideWidth) {
|
|
37
|
+
return sideWidth > 0 && Math.abs(value) > 0;
|
|
38
|
+
}
|
|
39
|
+
function clampReleaseVelocity(velocity) {
|
|
40
|
+
return Math.max(-1500, Math.min(RELEASE_VELOCITY_LIMIT, velocity));
|
|
41
|
+
}
|
|
42
|
+
function SwipeActionButton({ action, actionWidth, side, focusable, onAction, className }) {
|
|
43
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
44
|
+
type: "button",
|
|
45
|
+
disabled: action.disabled,
|
|
46
|
+
tabIndex: focusable ? 0 : -1,
|
|
47
|
+
"aria-label": typeof action.label === "string" ? action.label : void 0,
|
|
48
|
+
onClick: () => onAction(action, side),
|
|
49
|
+
className: cn("group flex h-full shrink-0 items-center justify-center outline-none", "focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background", "disabled:pointer-events-none disabled:opacity-50", className),
|
|
50
|
+
style: { width: actionWidth },
|
|
51
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
52
|
+
className: cn("grid h-9 w-9 place-items-center rounded-full transition-[background-color,color,transform] duration-150 group-hover:bg-background group-active:scale-95", ACTION_TONE_CLASS[action.tone ?? "neutral"]),
|
|
53
|
+
children: action.icon
|
|
54
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
55
|
+
className: "sr-only",
|
|
56
|
+
children: action.label
|
|
57
|
+
})]
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function SwipeableListRow({ item, actionWidth, revealThreshold, openValue, setOpenValue, closeOnAction, onAction, classNames, renderItem }) {
|
|
61
|
+
const reduce = useReducedMotion();
|
|
62
|
+
const x = useMotionValue(0);
|
|
63
|
+
const animationRef = useRef(null);
|
|
64
|
+
const commandedTargetRef = useRef(0);
|
|
65
|
+
const leftActions = item.leftActions ?? [];
|
|
66
|
+
const rightActions = item.rightActions ?? [];
|
|
67
|
+
const leftWidth = leftActions.length * actionWidth;
|
|
68
|
+
const rightWidth = rightActions.length * actionWidth;
|
|
69
|
+
const openSide = openValue?.id === item.id ? openValue.side : null;
|
|
70
|
+
const targetX = openSide === "left" ? leftWidth : openSide === "right" ? -rightWidth : 0;
|
|
71
|
+
const settleX = useCallback((nextX, velocity = 0) => {
|
|
72
|
+
commandedTargetRef.current = nextX;
|
|
73
|
+
animationRef.current?.stop();
|
|
74
|
+
if (reduce) {
|
|
75
|
+
x.set(nextX);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
animationRef.current = animate(x, nextX, {
|
|
79
|
+
...ROW_SETTLE,
|
|
80
|
+
velocity: clampReleaseVelocity(velocity),
|
|
81
|
+
onComplete: () => x.set(nextX)
|
|
82
|
+
});
|
|
83
|
+
}, [reduce, x]);
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
return () => animationRef.current?.stop();
|
|
86
|
+
}, []);
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
if (commandedTargetRef.current === targetX) return;
|
|
89
|
+
settleX(targetX);
|
|
90
|
+
}, [settleX, targetX]);
|
|
91
|
+
const getTargetX = useCallback((side) => side === "left" ? leftWidth : side === "right" ? -rightWidth : 0, [leftWidth, rightWidth]);
|
|
92
|
+
const snapTo = useCallback((side, velocity = 0) => {
|
|
93
|
+
setOpenValue(side ? {
|
|
94
|
+
id: item.id,
|
|
95
|
+
side
|
|
96
|
+
} : null);
|
|
97
|
+
settleX(getTargetX(side), velocity);
|
|
98
|
+
}, [
|
|
99
|
+
getTargetX,
|
|
100
|
+
item.id,
|
|
101
|
+
setOpenValue,
|
|
102
|
+
settleX
|
|
103
|
+
]);
|
|
104
|
+
const onDragStart = useCallback(() => {
|
|
105
|
+
animationRef.current?.stop();
|
|
106
|
+
if (openValue && openValue.id !== item.id) setOpenValue(null);
|
|
107
|
+
}, [
|
|
108
|
+
item.id,
|
|
109
|
+
openValue,
|
|
110
|
+
setOpenValue
|
|
111
|
+
]);
|
|
112
|
+
const onDragEnd = useCallback((_, info) => {
|
|
113
|
+
const velocity = info.velocity.x;
|
|
114
|
+
const latest = x.get();
|
|
115
|
+
const leftOpenThreshold = Math.max(revealThreshold, leftWidth * OPEN_DISTANCE_RATIO);
|
|
116
|
+
const rightOpenThreshold = Math.max(revealThreshold, rightWidth * OPEN_DISTANCE_RATIO);
|
|
117
|
+
if (openSide === "left") {
|
|
118
|
+
if (latest < leftWidth * CLOSE_DISTANCE_RATIO || velocity < -320) {
|
|
119
|
+
snapTo(null, velocity);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
snapTo("left", velocity);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (openSide === "right") {
|
|
126
|
+
if (Math.abs(latest) < rightWidth * CLOSE_DISTANCE_RATIO || velocity > CLOSE_VELOCITY) {
|
|
127
|
+
snapTo(null, velocity);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
snapTo("right", velocity);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
if (isActionableSide(latest, leftWidth) && (latest > leftOpenThreshold || velocity > OPEN_VELOCITY && latest > FLING_DISTANCE)) {
|
|
134
|
+
snapTo("left", velocity);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (isActionableSide(latest, rightWidth) && (latest < -rightOpenThreshold || velocity < -720 && latest < -14)) {
|
|
138
|
+
snapTo("right", velocity);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
snapTo(null, velocity);
|
|
142
|
+
}, [
|
|
143
|
+
leftWidth,
|
|
144
|
+
openSide,
|
|
145
|
+
revealThreshold,
|
|
146
|
+
rightWidth,
|
|
147
|
+
snapTo,
|
|
148
|
+
x
|
|
149
|
+
]);
|
|
150
|
+
const handleAction = useCallback((action, side) => {
|
|
151
|
+
action.onClick?.(item);
|
|
152
|
+
onAction?.({
|
|
153
|
+
item,
|
|
154
|
+
action,
|
|
155
|
+
side
|
|
156
|
+
});
|
|
157
|
+
if (closeOnAction) snapTo(null);
|
|
158
|
+
}, [
|
|
159
|
+
closeOnAction,
|
|
160
|
+
item,
|
|
161
|
+
onAction,
|
|
162
|
+
snapTo
|
|
163
|
+
]);
|
|
164
|
+
const defaultContent = /* @__PURE__ */ jsxs("div", {
|
|
165
|
+
className: "flex min-w-0 items-center gap-3",
|
|
166
|
+
children: [
|
|
167
|
+
item.leading ? /* @__PURE__ */ jsx("div", {
|
|
168
|
+
className: cn("shrink-0", classNames?.leading),
|
|
169
|
+
children: item.leading
|
|
170
|
+
}) : null,
|
|
171
|
+
/* @__PURE__ */ jsxs("div", {
|
|
172
|
+
className: cn("min-w-0 flex-1", classNames?.content),
|
|
173
|
+
children: [item.title ? /* @__PURE__ */ jsx("div", {
|
|
174
|
+
className: cn("truncate font-medium text-foreground text-sm", classNames?.title),
|
|
175
|
+
children: item.title
|
|
176
|
+
}) : null, item.description ? /* @__PURE__ */ jsx("div", {
|
|
177
|
+
className: cn("mt-0.5 truncate text-muted-foreground text-xs", classNames?.description),
|
|
178
|
+
children: item.description
|
|
179
|
+
}) : null]
|
|
180
|
+
}),
|
|
181
|
+
item.meta ? /* @__PURE__ */ jsx("div", {
|
|
182
|
+
className: cn("shrink-0 font-medium text-muted-foreground text-xs", classNames?.meta),
|
|
183
|
+
children: item.meta
|
|
184
|
+
}) : null
|
|
185
|
+
]
|
|
186
|
+
});
|
|
187
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
188
|
+
className: cn("relative isolate overflow-hidden rounded-2xl bg-muted", item.disabled && "opacity-60", classNames?.item),
|
|
189
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
190
|
+
"aria-hidden": !openSide,
|
|
191
|
+
inert: !openSide,
|
|
192
|
+
className: cn("absolute inset-0 z-0 flex overflow-hidden rounded-2xl", classNames?.rail),
|
|
193
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
194
|
+
className: "flex h-full overflow-hidden rounded-l-2xl",
|
|
195
|
+
children: leftActions.map((action) => /* @__PURE__ */ jsx(SwipeActionButton, {
|
|
196
|
+
action,
|
|
197
|
+
actionWidth,
|
|
198
|
+
className: classNames?.action,
|
|
199
|
+
focusable: openSide === "left",
|
|
200
|
+
onAction: handleAction,
|
|
201
|
+
side: "left"
|
|
202
|
+
}, action.id))
|
|
203
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
204
|
+
className: "ml-auto flex h-full overflow-hidden rounded-r-2xl",
|
|
205
|
+
children: rightActions.map((action) => /* @__PURE__ */ jsx(SwipeActionButton, {
|
|
206
|
+
action,
|
|
207
|
+
actionWidth,
|
|
208
|
+
className: classNames?.action,
|
|
209
|
+
focusable: openSide === "right",
|
|
210
|
+
onAction: handleAction,
|
|
211
|
+
side: "right"
|
|
212
|
+
}, action.id))
|
|
213
|
+
})]
|
|
214
|
+
}), /* @__PURE__ */ jsx(motion.div, {
|
|
215
|
+
drag: item.disabled ? false : "x",
|
|
216
|
+
dragConstraints: {
|
|
217
|
+
left: -rightWidth,
|
|
218
|
+
right: leftWidth
|
|
219
|
+
},
|
|
220
|
+
dragElastic: .04,
|
|
221
|
+
dragMomentum: false,
|
|
222
|
+
onDragStart,
|
|
223
|
+
onDragEnd,
|
|
224
|
+
style: { x },
|
|
225
|
+
className: cn("relative z-10 min-h-[72px] cursor-grab touch-pan-y select-none rounded-2xl border border-border bg-card px-4 py-3 shadow-sm active:cursor-grabbing", classNames?.surface),
|
|
226
|
+
children: renderItem ? renderItem(item) : item.content ?? defaultContent
|
|
227
|
+
})]
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
function SwipeableList({ items, value, defaultValue = null, onValueChange, onAction, actionWidth = 56, revealThreshold = 34, closeOnAction = true, className, classNames, renderItem }) {
|
|
231
|
+
const [openValue, setOpenValue] = useControllableSwipeValue({
|
|
232
|
+
value,
|
|
233
|
+
defaultValue,
|
|
234
|
+
onValueChange
|
|
235
|
+
});
|
|
236
|
+
return /* @__PURE__ */ jsx("div", {
|
|
237
|
+
className: cn("flex w-full flex-col gap-2", className, classNames?.root),
|
|
238
|
+
children: items.map((item) => /* @__PURE__ */ jsx(SwipeableListRow, {
|
|
239
|
+
item,
|
|
240
|
+
actionWidth,
|
|
241
|
+
revealThreshold,
|
|
242
|
+
openValue,
|
|
243
|
+
setOpenValue,
|
|
244
|
+
closeOnAction,
|
|
245
|
+
onAction,
|
|
246
|
+
classNames,
|
|
247
|
+
renderItem
|
|
248
|
+
}, item.id))
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
//#endregion
|
|
252
|
+
export { SwipeableList };
|
|
253
|
+
|
|
254
|
+
//# sourceMappingURL=swipeable-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swipeable-list.js","names":[],"sources":["../../../src/components/motion/swipeable-list.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactNode, useCallback, useEffect, useRef, useState } from \"react\";\nimport { animate, motion, type PanInfo, useMotionValue, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\n\nexport type SwipeSide = \"left\" | \"right\";\n\nexport type SwipeableListValue = {\n id: string;\n side: SwipeSide;\n};\n\nexport type SwipeActionTone = \"neutral\" | \"primary\" | \"success\" | \"warning\" | \"danger\";\n\nexport type SwipeAction = {\n id: string;\n label: ReactNode;\n icon: ReactNode;\n tone?: SwipeActionTone;\n disabled?: boolean;\n onClick?: (item: SwipeableListItem) => void;\n};\n\nexport type SwipeableListItem = {\n id: string;\n title?: ReactNode;\n description?: ReactNode;\n meta?: ReactNode;\n leading?: ReactNode;\n content?: ReactNode;\n leftActions?: SwipeAction[];\n rightActions?: SwipeAction[];\n disabled?: boolean;\n};\n\nexport type SwipeableListClassNames = {\n root?: string;\n item?: string;\n rail?: string;\n action?: string;\n surface?: string;\n leading?: string;\n content?: string;\n title?: string;\n description?: string;\n meta?: string;\n};\n\nexport interface SwipeableListProps {\n items: SwipeableListItem[];\n value?: SwipeableListValue | null;\n defaultValue?: SwipeableListValue | null;\n onValueChange?: (value: SwipeableListValue | null) => void;\n onAction?: (payload: { item: SwipeableListItem; action: SwipeAction; side: SwipeSide }) => void;\n actionWidth?: number;\n revealThreshold?: number;\n closeOnAction?: boolean;\n className?: string;\n classNames?: SwipeableListClassNames;\n renderItem?: (item: SwipeableListItem) => ReactNode;\n}\n\n// Distance-based release spring keeps short rebounds and full reveals feeling\n// equally direct, closer to native mobile list interactions.\nconst ROW_SETTLE = {\n type: \"spring\",\n stiffness: 560,\n damping: 48,\n mass: 0.82,\n restDelta: 0.5,\n restSpeed: 8,\n} as const;\nconst OPEN_DISTANCE_RATIO = 0.46;\nconst CLOSE_DISTANCE_RATIO = 0.72;\nconst OPEN_VELOCITY = 720;\nconst CLOSE_VELOCITY = 320;\nconst FLING_DISTANCE = 14;\nconst RELEASE_VELOCITY_LIMIT = 1500;\n\nconst ACTION_TONE_CLASS: Record<SwipeActionTone, string> = {\n neutral: \"text-muted-foreground group-hover:text-foreground\",\n primary: \"text-foreground\",\n success: \"text-emerald-600 dark:text-emerald-400\",\n warning: \"text-amber-600 dark:text-amber-400\",\n danger: \"text-destructive\",\n};\n\nfunction useControllableSwipeValue({\n value,\n defaultValue,\n onValueChange,\n}: {\n value?: SwipeableListValue | null;\n defaultValue?: SwipeableListValue | null;\n onValueChange?: (value: SwipeableListValue | null) => void;\n}) {\n const [internalValue, setInternalValue] = useState(defaultValue ?? null);\n const isControlled = value !== undefined;\n const currentValue = value ?? internalValue;\n\n const setValue = useCallback(\n (next: SwipeableListValue | null) => {\n if (!isControlled) {\n setInternalValue(next);\n }\n\n onValueChange?.(next);\n },\n [isControlled, onValueChange],\n );\n\n return [currentValue, setValue] as const;\n}\n\nfunction isActionableSide(value: number, sideWidth: number) {\n return sideWidth > 0 && Math.abs(value) > 0;\n}\n\nfunction clampReleaseVelocity(velocity: number) {\n return Math.max(-RELEASE_VELOCITY_LIMIT, Math.min(RELEASE_VELOCITY_LIMIT, velocity));\n}\n\nfunction SwipeActionButton({\n action,\n actionWidth,\n side,\n focusable,\n onAction,\n className,\n}: {\n action: SwipeAction;\n actionWidth: number;\n side: SwipeSide;\n focusable: boolean;\n onAction: (action: SwipeAction, side: SwipeSide) => void;\n className?: string;\n}) {\n return (\n <button\n type=\"button\"\n disabled={action.disabled}\n tabIndex={focusable ? 0 : -1}\n aria-label={typeof action.label === \"string\" ? action.label : undefined}\n onClick={() => onAction(action, side)}\n className={cn(\n \"group flex h-full shrink-0 items-center justify-center outline-none\",\n \"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n className,\n )}\n style={{ width: actionWidth }}\n >\n <span\n className={cn(\n \"grid h-9 w-9 place-items-center rounded-full transition-[background-color,color,transform] duration-150 group-hover:bg-background group-active:scale-95\",\n ACTION_TONE_CLASS[action.tone ?? \"neutral\"],\n )}\n >\n {action.icon}\n </span>\n <span className=\"sr-only\">{action.label}</span>\n </button>\n );\n}\n\nfunction SwipeableListRow({\n item,\n actionWidth,\n revealThreshold,\n openValue,\n setOpenValue,\n closeOnAction,\n onAction,\n classNames,\n renderItem,\n}: {\n item: SwipeableListItem;\n actionWidth: number;\n revealThreshold: number;\n openValue: SwipeableListValue | null;\n setOpenValue: (value: SwipeableListValue | null) => void;\n closeOnAction: boolean;\n onAction?: SwipeableListProps[\"onAction\"];\n classNames?: SwipeableListClassNames;\n renderItem?: (item: SwipeableListItem) => ReactNode;\n}) {\n const reduce = useReducedMotion();\n const x = useMotionValue(0);\n const animationRef = useRef<{ stop: () => void } | null>(null);\n const commandedTargetRef = useRef(0);\n const leftActions = item.leftActions ?? [];\n const rightActions = item.rightActions ?? [];\n const leftWidth = leftActions.length * actionWidth;\n const rightWidth = rightActions.length * actionWidth;\n const openSide = openValue?.id === item.id ? openValue.side : null;\n const targetX = openSide === \"left\" ? leftWidth : openSide === \"right\" ? -rightWidth : 0;\n\n const settleX = useCallback(\n (nextX: number, velocity = 0) => {\n commandedTargetRef.current = nextX;\n animationRef.current?.stop();\n\n if (reduce) {\n x.set(nextX);\n return;\n }\n\n animationRef.current = animate(x, nextX, {\n ...ROW_SETTLE,\n velocity: clampReleaseVelocity(velocity),\n onComplete: () => x.set(nextX),\n });\n },\n [reduce, x],\n );\n\n useEffect(() => {\n return () => animationRef.current?.stop();\n }, []);\n\n useEffect(() => {\n if (commandedTargetRef.current === targetX) {\n return;\n }\n\n settleX(targetX);\n }, [settleX, targetX]);\n\n const getTargetX = useCallback(\n (side: SwipeSide | null) => (side === \"left\" ? leftWidth : side === \"right\" ? -rightWidth : 0),\n [leftWidth, rightWidth],\n );\n\n const snapTo = useCallback(\n (side: SwipeSide | null, velocity = 0) => {\n setOpenValue(side ? { id: item.id, side } : null);\n settleX(getTargetX(side), velocity);\n },\n [getTargetX, item.id, setOpenValue, settleX],\n );\n\n const onDragStart = useCallback(() => {\n animationRef.current?.stop();\n\n if (openValue && openValue.id !== item.id) {\n setOpenValue(null);\n }\n }, [item.id, openValue, setOpenValue]);\n\n const onDragEnd = useCallback(\n (_: PointerEvent, info: PanInfo) => {\n const velocity = info.velocity.x;\n const latest = x.get();\n const leftOpenThreshold = Math.max(revealThreshold, leftWidth * OPEN_DISTANCE_RATIO);\n const rightOpenThreshold = Math.max(revealThreshold, rightWidth * OPEN_DISTANCE_RATIO);\n\n if (openSide === \"left\") {\n if (latest < leftWidth * CLOSE_DISTANCE_RATIO || velocity < -CLOSE_VELOCITY) {\n snapTo(null, velocity);\n return;\n }\n\n snapTo(\"left\", velocity);\n return;\n }\n\n if (openSide === \"right\") {\n if (Math.abs(latest) < rightWidth * CLOSE_DISTANCE_RATIO || velocity > CLOSE_VELOCITY) {\n snapTo(null, velocity);\n return;\n }\n\n snapTo(\"right\", velocity);\n return;\n }\n\n if (\n isActionableSide(latest, leftWidth) &&\n (latest > leftOpenThreshold || (velocity > OPEN_VELOCITY && latest > FLING_DISTANCE))\n ) {\n snapTo(\"left\", velocity);\n return;\n }\n\n if (\n isActionableSide(latest, rightWidth) &&\n (latest < -rightOpenThreshold || (velocity < -OPEN_VELOCITY && latest < -FLING_DISTANCE))\n ) {\n snapTo(\"right\", velocity);\n return;\n }\n\n snapTo(null, velocity);\n },\n [leftWidth, openSide, revealThreshold, rightWidth, snapTo, x],\n );\n\n const handleAction = useCallback(\n (action: SwipeAction, side: SwipeSide) => {\n action.onClick?.(item);\n onAction?.({ item, action, side });\n\n if (closeOnAction) {\n snapTo(null);\n }\n },\n [closeOnAction, item, onAction, snapTo],\n );\n\n const defaultContent = (\n <div className=\"flex min-w-0 items-center gap-3\">\n {item.leading ? (\n <div className={cn(\"shrink-0\", classNames?.leading)}>{item.leading}</div>\n ) : null}\n <div className={cn(\"min-w-0 flex-1\", classNames?.content)}>\n {item.title ? (\n <div className={cn(\"truncate font-medium text-foreground text-sm\", classNames?.title)}>\n {item.title}\n </div>\n ) : null}\n {item.description ? (\n <div\n className={cn(\"mt-0.5 truncate text-muted-foreground text-xs\", classNames?.description)}\n >\n {item.description}\n </div>\n ) : null}\n </div>\n {item.meta ? (\n <div className={cn(\"shrink-0 font-medium text-muted-foreground text-xs\", classNames?.meta)}>\n {item.meta}\n </div>\n ) : null}\n </div>\n );\n\n return (\n <div\n className={cn(\n \"relative isolate overflow-hidden rounded-2xl bg-muted\",\n item.disabled && \"opacity-60\",\n classNames?.item,\n )}\n >\n <div\n aria-hidden={!openSide}\n inert={!openSide}\n className={cn(\"absolute inset-0 z-0 flex overflow-hidden rounded-2xl\", classNames?.rail)}\n >\n <div className=\"flex h-full overflow-hidden rounded-l-2xl\">\n {leftActions.map((action) => (\n <SwipeActionButton\n key={action.id}\n action={action}\n actionWidth={actionWidth}\n className={classNames?.action}\n focusable={openSide === \"left\"}\n onAction={handleAction}\n side=\"left\"\n />\n ))}\n </div>\n <div className=\"ml-auto flex h-full overflow-hidden rounded-r-2xl\">\n {rightActions.map((action) => (\n <SwipeActionButton\n key={action.id}\n action={action}\n actionWidth={actionWidth}\n className={classNames?.action}\n focusable={openSide === \"right\"}\n onAction={handleAction}\n side=\"right\"\n />\n ))}\n </div>\n </div>\n\n <motion.div\n drag={item.disabled ? false : \"x\"}\n dragConstraints={{ left: -rightWidth, right: leftWidth }}\n dragElastic={0.04}\n dragMomentum={false}\n onDragStart={onDragStart}\n onDragEnd={onDragEnd}\n style={{ x }}\n className={cn(\n \"relative z-10 min-h-[72px] cursor-grab touch-pan-y select-none rounded-2xl border border-border bg-card px-4 py-3 shadow-sm active:cursor-grabbing\",\n classNames?.surface,\n )}\n >\n {renderItem ? renderItem(item) : (item.content ?? defaultContent)}\n </motion.div>\n </div>\n );\n}\n\nexport function SwipeableList({\n items,\n value,\n defaultValue = null,\n onValueChange,\n onAction,\n actionWidth = 56,\n revealThreshold = 34,\n closeOnAction = true,\n className,\n classNames,\n renderItem,\n}: SwipeableListProps) {\n const [openValue, setOpenValue] = useControllableSwipeValue({\n value,\n defaultValue,\n onValueChange,\n });\n\n return (\n <div className={cn(\"flex w-full flex-col gap-2\", className, classNames?.root)}>\n {items.map((item) => (\n <SwipeableListRow\n key={item.id}\n item={item}\n actionWidth={actionWidth}\n revealThreshold={revealThreshold}\n openValue={openValue}\n setOpenValue={setOpenValue}\n closeOnAction={closeOnAction}\n onAction={onAction}\n classNames={classNames}\n renderItem={renderItem}\n />\n ))}\n </div>\n );\n}\n"],"mappings":"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"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useEffect, useId, useRef, useState } from "react";
|
|
3
3
|
import { cn } from "@kumix/utils";
|
|
4
|
-
import { MotionConfig, animate, motion, useReducedMotion } from "motion/react";
|
|
5
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { MotionConfig, animate, motion, useReducedMotion } from "motion/react";
|
|
6
6
|
//#region src/components/motion/switch.tsx
|
|
7
7
|
const THUMB_SPRING = {
|
|
8
8
|
type: "spring",
|
|
@@ -7,8 +7,8 @@ import { SkeletonRows } from "./skeleton-rows.js";
|
|
|
7
7
|
import { TableHeader } from "./table-header.js";
|
|
8
8
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
9
9
|
import { cn } from "@kumix/utils";
|
|
10
|
-
import { useReducedMotion } from "motion/react";
|
|
11
10
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { useReducedMotion } from "motion/react";
|
|
12
12
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
13
13
|
//#region src/components/motion/table/use-column-reorder.ts
|
|
14
14
|
function useColumnReorder({ columns, thRefs, onColumnOrderChange }) {
|
|
@@ -5,8 +5,8 @@ import { TableMenu } from "./table-menu.js";
|
|
|
5
5
|
import { i as alignText, n as COLUMN_ACTIVE_SHADOW, r as alignFlex } from "../../../utils-DQ7OpbYQ.js";
|
|
6
6
|
import { useEffect } from "react";
|
|
7
7
|
import { cn } from "@kumix/utils";
|
|
8
|
-
import { motion } from "motion/react";
|
|
9
8
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { motion } from "motion/react";
|
|
10
10
|
import { ArrowLeftToLine, ArrowRightToLine, ChevronUp, GripVertical, MoreHorizontal, Trash2 } from "lucide-react";
|
|
11
11
|
import { createPortal } from "react-dom";
|
|
12
12
|
//#region src/components/motion/table/table-header.tsx
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { SPRING_PANEL } from "../../../lib/ease.js";
|
|
3
3
|
import { useEffect, useRef, useState } from "react";
|
|
4
4
|
import { cn } from "@kumix/utils";
|
|
5
|
-
import { motion, useReducedMotion } from "motion/react";
|
|
6
5
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { motion, useReducedMotion } from "motion/react";
|
|
7
7
|
import { createPortal } from "react-dom";
|
|
8
8
|
//#region src/components/motion/table/table-menu.tsx
|
|
9
9
|
const MENU_WIDTH = 188;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { EASE_OUT } from "../../lib/ease.js";
|
|
3
3
|
import { createContext, useCallback, useContext, useId, useMemo, useState } from "react";
|
|
4
4
|
import { cn } from "@kumix/utils";
|
|
5
|
-
import { MotionConfig, motion, useReducedMotion } from "motion/react";
|
|
6
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { MotionConfig, motion, useReducedMotion } from "motion/react";
|
|
7
7
|
//#region src/components/motion/tabs.tsx
|
|
8
8
|
const TabsCtx = createContext(null);
|
|
9
9
|
function useTabs() {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { EASE_OUT } from "../../lib/ease.js";
|
|
3
3
|
import { useRef } from "react";
|
|
4
4
|
import { cn } from "@kumix/utils";
|
|
5
|
-
import { motion, useInView, useReducedMotion } from "motion/react";
|
|
6
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { motion, useInView, useReducedMotion } from "motion/react";
|
|
7
7
|
//#region src/components/motion/text-reveal.tsx
|
|
8
8
|
const DEFAULT_SPRING = {
|
|
9
9
|
stiffness: 140,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-shimmer.d.ts","names":[],"sources":["../../../src/components/motion/text-shimmer.tsx"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"text-shimmer.d.ts","names":[],"sources":["../../../src/components/motion/text-shimmer.tsx"],"mappings":";;UAWiB;EACf,UAAU;EACV,KAAK;EACL;EACA;;iBAGc,cACd,UACA,IAAI,MACJ,UACA,aACC,mCAAgB,IAAA"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { TEXT_SHIMMER_CLASS_NAME, TEXT_SHIMMER_KEYFRAMES, textShimmerStyle } from "../../lib/text-shimmer.js";
|
|
2
3
|
import { cn } from "@kumix/utils";
|
|
3
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
//#region src/components/motion/text-shimmer.tsx
|
|
5
6
|
function TextShimmer({ children, as: Comp = "span", duration = 2.5, className }) {
|
|
6
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("style", { children:
|
|
7
|
-
style:
|
|
8
|
-
className: cn("inline-block
|
|
7
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("style", { children: TEXT_SHIMMER_KEYFRAMES }), /* @__PURE__ */ jsx(Comp, {
|
|
8
|
+
style: textShimmerStyle(duration),
|
|
9
|
+
className: cn("inline-block", TEXT_SHIMMER_CLASS_NAME, className),
|
|
9
10
|
children
|
|
10
11
|
})] });
|
|
11
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-shimmer.js","names":[],"sources":["../../../src/components/motion/text-shimmer.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ElementType, ReactNode } from \"react\";\n\nimport { cn } from \"@kumix/utils\";\n\nexport interface TextShimmerProps {\n children: ReactNode;\n as?: ElementType;\n duration?: number;\n className?: string;\n}\n\nexport function TextShimmer({\n children,\n as: Comp = \"span\",\n duration = 2.5,\n className,\n}: TextShimmerProps) {\n return (\n <>\n <style
|
|
1
|
+
{"version":3,"file":"text-shimmer.js","names":[],"sources":["../../../src/components/motion/text-shimmer.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ElementType, ReactNode } from \"react\";\n\nimport { cn } from \"@kumix/utils\";\nimport {\n TEXT_SHIMMER_CLASS_NAME,\n TEXT_SHIMMER_KEYFRAMES,\n textShimmerStyle,\n} from \"../../lib/text-shimmer\";\n\nexport interface TextShimmerProps {\n children: ReactNode;\n as?: ElementType;\n duration?: number;\n className?: string;\n}\n\nexport function TextShimmer({\n children,\n as: Comp = \"span\",\n duration = 2.5,\n className,\n}: TextShimmerProps) {\n return (\n <>\n <style>{TEXT_SHIMMER_KEYFRAMES}</style>\n <Comp\n style={textShimmerStyle(duration)}\n className={cn(\"inline-block\", TEXT_SHIMMER_CLASS_NAME, className)}\n >\n {children}\n </Comp>\n </>\n );\n}\n"],"mappings":";;;;;AAkBA,SAAgB,YAAY,EAC1B,UACA,IAAI,OAAO,QACX,WAAW,KACX,aACmB;CACnB,OACE,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,SAAD,EAAA,UAAQ,uBAA8B,CAAA,GACtC,oBAAC,MAAD;EACE,OAAO,iBAAiB,QAAQ;EAChC,WAAW,GAAG,gBAAgB,yBAAyB,SAAS;EAE/D;CACG,CAAA,CACN,EAAA,CAAA;AAEN"}
|
|
@@ -4,8 +4,8 @@ import { ActionSwapIcon } from "./action-swap.js";
|
|
|
4
4
|
import { useEffect, useState } from "react";
|
|
5
5
|
import { cn } from "@kumix/utils";
|
|
6
6
|
import { useTheme } from "next-themes";
|
|
7
|
-
import { useReducedMotion } from "motion/react";
|
|
8
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
import { useReducedMotion } from "motion/react";
|
|
9
9
|
import { Moon, Sun } from "lucide-react";
|
|
10
10
|
//#region src/components/motion/theme-toggle.tsx
|
|
11
11
|
const VT_STYLE_ID = "beui-theme-toggle-vt";
|
|
@@ -3,8 +3,8 @@ import { useHoverCapable } from "../../hooks/use-hover-capable.js";
|
|
|
3
3
|
import { SPRING_MOUSE } from "../../lib/ease.js";
|
|
4
4
|
import { useRef } from "react";
|
|
5
5
|
import { cn } from "@kumix/utils";
|
|
6
|
-
import { motion, useMotionTemplate, useMotionValue, useReducedMotion, useSpring } from "motion/react";
|
|
7
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { motion, useMotionTemplate, useMotionValue, useReducedMotion, useSpring } from "motion/react";
|
|
8
8
|
//#region src/components/motion/tilt-card.tsx
|
|
9
9
|
function TiltCard({ children, max = 12, glare = true, className }) {
|
|
10
10
|
const ref = useRef(null);
|
|
@@ -3,8 +3,8 @@ import { useHoverCapable } from "../../hooks/use-hover-capable.js";
|
|
|
3
3
|
import { EASE_OUT } from "../../lib/ease.js";
|
|
4
4
|
import { cloneElement, isValidElement, useCallback, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
5
5
|
import { cn } from "@kumix/utils";
|
|
6
|
-
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
7
6
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
8
8
|
import { createPortal } from "react-dom";
|
|
9
9
|
//#region src/components/motion/tooltip.tsx
|
|
10
10
|
const GAP = 8;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { createTickPlayer } from "../../lib/tick-sound.js";
|
|
3
3
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { cn } from "@kumix/utils";
|
|
5
|
-
import { useReducedMotion } from "motion/react";
|
|
6
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { useReducedMotion } from "motion/react";
|
|
7
7
|
//#region src/components/motion/wheel-picker.tsx
|
|
8
8
|
const DEG = Math.PI / 180;
|
|
9
9
|
const DECELERATION = 42e-5;
|